@creatorsn/powereditor3 0.2.0 → 0.2.2
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/powereditor3.css +1 -1
- package/dist/powereditor3.js +666 -603
- package/dist/powereditor3.umd.cjs +8 -5
- package/dist/types/editor/index.d.ts +9 -9
- package/dist/types/editor/src/components/bubbleToolBar.vue.d.ts +2 -2
- package/dist/types/editor/src/components/custom/source/codeBlockX.vue.d.ts +9 -1
- package/dist/types/editor/src/components/menus/calloutBase.vue.d.ts +1 -1
- package/dist/types/editor/src/components/menus/colorCallout.vue.d.ts +1 -1
- package/dist/types/editor/src/components/menus/embedCallout.vue.d.ts +1 -1
- package/dist/types/editor/src/components/menus/emojiCallout.vue.d.ts +1 -1
- package/dist/types/editor/src/components/menus/headingCallout.vue.d.ts +1 -1
- package/dist/types/editor/src/components/menus/imageCallout.vue.d.ts +1 -1
- package/dist/types/editor/src/components/menus/linkCallout.vue.d.ts +1 -1
- package/dist/types/editor/src/components/menus/tableCallout.vue.d.ts +1 -1
- package/dist/types/editor/src/components/toolBar.vue.d.ts +7 -7
- package/dist/types/editor/src/index.vue.d.ts +9 -9
- package/package.json +2 -2
|
@@ -139,9 +139,12 @@ ${t}
|
|
|
139
139
|
`),[o,s]=cC(i);if(o.length===0)return;const a=c_(o,0,t);return a.length===0?void 0:{type:"list",ordered:!0,start:((r=o[0])==null?void 0:r.number)||1,items:a,raw:i.slice(0,s).join(`
|
|
140
140
|
`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(dC,this.editor.getAttributes(u_)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let n=Jr({find:d_,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(n=Jr({find:d_,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(u_)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[n]}}),hC=/^\s*(\[([( |x])?\])\s$/,fC=xt.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:n=>{const e=n.getAttribute("data-checked");return e===""||e==="true"},renderHTML:n=>({"data-checked":n.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:n,HTMLAttributes:e}){return["li",$e(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:n.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(n,e)=>{const t=[];if(n.tokens&&n.tokens.length>0?t.push(e.createNode("paragraph",{},e.parseInline(n.tokens))):n.text?t.push(e.createNode("paragraph",{},[e.createNode("text",{text:n.text})])):t.push(e.createNode("paragraph",{},[])),n.nestedTokens&&n.nestedTokens.length>0){const r=e.parseChildren(n.nestedTokens);t.push(...r)}return e.createNode("taskItem",{checked:n.checked||!1},t)},renderMarkdown:(n,e)=>{var t;const i=`- [${(t=n.attrs)!=null&&t.checked?"x":" "}] `;return Xu(n,e,i)},addKeyboardShortcuts(){const n={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...n,Tab:()=>this.editor.commands.sinkListItem(this.name)}:n},addNodeView(){return({node:n,HTMLAttributes:e,getPos:t,editor:r})=>{const i=document.createElement("li"),o=document.createElement("label"),s=document.createElement("span"),a=document.createElement("input"),l=document.createElement("div"),c=d=>{var m,b;a.ariaLabel=((b=(m=this.options.a11y)==null?void 0:m.checkboxLabel)==null?void 0:b.call(m,d,a.checked))||`Task item checkbox for ${d.textContent||"empty task item"}`};c(n),o.contentEditable="false",a.type="checkbox",a.addEventListener("mousedown",d=>d.preventDefault()),a.addEventListener("change",d=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){a.checked=!a.checked;return}const{checked:m}=d.target;r.isEditable&&typeof t=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:b})=>{const f=t();if(typeof f!="number")return!1;const y=b.doc.nodeAt(f);return b.setNodeMarkup(f,void 0,{...y==null?void 0:y.attrs,checked:m}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(n,m)||(a.checked=!a.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([d,m])=>{i.setAttribute(d,m)}),i.dataset.checked=n.attrs.checked,a.checked=n.attrs.checked,o.append(a,s),i.append(o,l),Object.entries(e).forEach(([d,m])=>{i.setAttribute(d,m)});let u=new Set(Object.keys(e));return{dom:i,contentDOM:l,update:d=>{if(d.type!==this.type)return!1;i.dataset.checked=d.attrs.checked,a.checked=d.attrs.checked,c(d);const m=r.extensionManager.attributes,b=fs(d,m),f=new Set(Object.keys(b)),y=this.options.HTMLAttributes;return u.forEach(w=>{f.has(w)||(w in y?i.setAttribute(w,y[w]):i.removeAttribute(w))}),Object.entries(b).forEach(([w,k])=>{k==null?w in y?i.setAttribute(w,y[w]):i.removeAttribute(w):i.setAttribute(w,k)}),u=f,!0}}}},addInputRules(){return[Jr({find:hC,type:this.type,getAttributes:n=>({checked:n[n.length-1]==="x"})})]}}),pC=xt.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:n}){return["ul",$e(this.options.HTMLAttributes,n,{"data-type":this.name}),0]},parseMarkdown:(n,e)=>e.createNode("taskList",{},e.parseChildren(n.items||[])),renderMarkdown:(n,e)=>n.content?e.renderChildren(n.content,`
|
|
141
141
|
`):"",markdownTokenizer:{name:"taskList",level:"block",start(n){var e;const t=(e=n.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:e.index;return t!==void 0?t:-1},tokenize(n,e,t){const r=o=>{const s=Zu(o,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:a=>({indentLevel:a[1].length,mainContent:a[4],checked:a[3].toLowerCase()==="x"}),createToken:(a,l)=>({type:"taskItem",raw:"",mainContent:a.mainContent,indentLevel:a.indentLevel,checked:a.checked,text:a.mainContent,tokens:t.inlineTokens(a.mainContent),nestedTokens:l}),customNestedParser:r},t);return s?[{type:"taskList",raw:s.raw,items:s.items}]:t.blockTokens(o)},i=Zu(n,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:o=>({indentLevel:o[1].length,mainContent:o[4],checked:o[3].toLowerCase()==="x"}),createToken:(o,s)=>({type:"taskItem",raw:"",mainContent:o.mainContent,indentLevel:o.indentLevel,checked:o.checked,text:o.mainContent,tokens:t.inlineTokens(o.mainContent),nestedTokens:s}),customNestedParser:r},t);if(i)return{type:"taskList",raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:n})=>n.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});Je.create({name:"listKit",addExtensions(){const n=[];return this.options.bulletList!==!1&&n.push(e_.configure(this.options.bulletList)),this.options.listItem!==!1&&n.push(t_.configure(this.options.listItem)),this.options.listKeymap!==!1&&n.push(a_.configure(this.options.listKeymap)),this.options.orderedList!==!1&&n.push(h_.configure(this.options.orderedList)),this.options.taskItem!==!1&&n.push(fC.configure(this.options.taskItem)),this.options.taskList!==!1&&n.push(pC.configure(this.options.taskList)),n}});var Rl=" ",V0=" ",mC=xt.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",$e(this.options.HTMLAttributes,n),0]},parseMarkdown:(n,e)=>{const t=n.tokens||[];if(t.length===1&&t[0].type==="image")return e.parseChildren([t[0]]);const r=e.parseInline(t);return t.length===1&&t[0].type==="text"&&(t[0].raw===Rl||t[0].text===Rl||t[0].raw===V0||t[0].text===V0)&&r.length===1&&r[0].type==="text"&&(r[0].text===Rl||r[0].text===V0)?e.createNode("paragraph",void 0,[]):e.createNode("paragraph",void 0,r)},renderMarkdown:(n,e,t)=>{var r,i;if(!n)return"";const o=Array.isArray(n.content)?n.content:[];if(o.length===0){const s=Array.isArray((r=t==null?void 0:t.previousNode)==null?void 0:r.content)?t.previousNode.content:[];return((i=t==null?void 0:t.previousNode)==null?void 0:i.type)==="paragraph"&&s.length===0?Rl:""}return e.renderChildren(o)},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),gC=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,bC=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,_C=zn.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["s",$e(this.options.HTMLAttributes,n),0]},markdownTokenName:"del",parseMarkdown:(n,e)=>e.applyMark("strike",e.parseInline(n.tokens||[])),renderMarkdown:(n,e)=>`~~${e.renderChildren(n)}~~`,addCommands(){return{setStrike:()=>({commands:n})=>n.setMark(this.name),toggleStrike:()=>({commands:n})=>n.toggleMark(this.name),unsetStrike:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Ai({find:gC,type:this.type})]},addPasteRules(){return[ei({find:bC,type:this.type})]}}),yC=xt.create({name:"text",group:"inline",parseMarkdown:n=>({type:"text",text:n.text||""}),renderMarkdown:n=>n.text||""}),f_=zn.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["u",$e(this.options.HTMLAttributes,n),0]},parseMarkdown(n,e){return e.applyMark(this.name||"underline",e.parseInline(n.tokens||[]))},renderMarkdown(n,e){return`++${e.renderChildren(n)}++`},markdownTokenizer:{name:"underline",level:"inline",start(n){return n.indexOf("++")},tokenize(n,e,t){const i=/^(\+\+)([\s\S]+?)(\+\+)/.exec(n);if(!i)return;const o=i[2].trim();return{type:"underline",raw:i[0],text:o,tokens:t.inlineTokens(o)}}},addCommands(){return{setUnderline:()=>({commands:n})=>n.setMark(this.name),toggleUnderline:()=>({commands:n})=>n.toggleMark(this.name),unsetUnderline:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),vC=f_;function wC(n={}){return new at({view(e){return new xC(e,n)}})}class xC{constructor(e,t){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=t.width)!==null&&r!==void 0?r:1,this.color=t.color===!1?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let o=s=>{this[i](s)};return e.dom.addEventListener(i,o),{name:i,handler:o}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,r,i=this.editorView.dom,o=i.getBoundingClientRect(),s=o.width/i.offsetWidth,a=o.height/i.offsetHeight;if(t){let d=e.nodeBefore,m=e.nodeAfter;if(d||m){let b=this.editorView.nodeDOM(this.cursorPos-(d?d.nodeSize:0));if(b){let f=b.getBoundingClientRect(),y=d?f.bottom:f.top;d&&m&&(y=(y+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let w=this.width/2*a;r={left:f.left,right:f.right,top:y-w,bottom:y+w}}}}if(!r){let d=this.editorView.coordsAtPos(this.cursorPos),m=this.width/2*s;r={left:d.left-m,right:d.left+m,top:d.top,bottom:d.bottom}}let l=this.editorView.dom.offsetParent;this.element||(this.element=l.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",t),this.element.classList.toggle("prosemirror-dropcursor-inline",!t);let c,u;if(!l||l==document.body&&getComputedStyle(l).position=="static")c=-pageXOffset,u=-pageYOffset;else{let d=l.getBoundingClientRect(),m=d.width/l.offsetWidth,b=d.height/l.offsetHeight;c=d.left-l.scrollLeft*m,u=d.top-l.scrollTop*b}this.element.style.left=(r.left-c)/s+"px",this.element.style.top=(r.top-u)/a+"px",this.element.style.width=(r.right-r.left)/s+"px",this.element.style.height=(r.bottom-r.top)/a+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),i=r&&r.type.spec.disableDropCursor,o=typeof i=="function"?i(this.editorView,t,e):i;if(t&&!o){let s=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=im(this.editorView.state.doc,s,this.editorView.dragging.slice);a!=null&&(s=a)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class Dt extends Be{constructor(e){super(e,e)}map(e,t){let r=e.resolve(t.map(this.head));return Dt.valid(r)?new Dt(r):Be.near(r)}content(){return ve.empty}eq(e){return e instanceof Dt&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Dt(e.resolve(t.pos))}getBookmark(){return new U0(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!kC(e)||!SC(e))return!1;let r=t.type.spec.allowGapCursor;if(r!=null)return r;let i=t.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,t,r=!1){e:for(;;){if(!r&&Dt.valid(e))return e;let i=e.pos,o=null;for(let s=e.depth;;s--){let a=e.node(s);if(t>0?e.indexAfter(s)<a.childCount:e.index(s)>0){o=a.child(t>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;i+=t;let l=e.doc.resolve(i);if(Dt.valid(l))return l}for(;;){let s=t>0?o.firstChild:o.lastChild;if(!s){if(o.isAtom&&!o.isText&&!Te.isSelectable(o)){e=e.doc.resolve(i+o.nodeSize*t),r=!1;continue e}break}o=s,i+=t;let a=e.doc.resolve(i);if(Dt.valid(a))return a}return null}}}Dt.prototype.visible=!1,Dt.findFrom=Dt.findGapCursorFrom,Be.jsonID("gapcursor",Dt);class U0{constructor(e){this.pos=e}map(e){return new U0(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return Dt.valid(t)?new Dt(t):Be.near(t)}}function kC(n){for(let e=n.depth;e>=0;e--){let t=n.index(e),r=n.node(e);if(t==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(t-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function SC(n){for(let e=n.depth;e>=0;e--){let t=n.indexAfter(e),r=n.node(e);if(t==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(t);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function CC(){return new at({props:{decorations:MC,createSelectionBetween(n,e,t){return e.pos==t.pos&&Dt.valid(t)?new Dt(t):null},handleClick:TC,handleKeyDown:EC,handleDOMEvents:{beforeinput:AC}}})}const EC=Du({ArrowLeft:Il("horiz",-1),ArrowRight:Il("horiz",1),ArrowUp:Il("vert",-1),ArrowDown:Il("vert",1)});function Il(n,e){const t=n=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,o){let s=r.selection,a=e>0?s.$to:s.$from,l=s.empty;if(s instanceof Ee){if(!o.endOfTextblock(t)||a.depth==0)return!1;l=!1,a=r.doc.resolve(e>0?a.after():a.before())}let c=Dt.findGapCursorFrom(a,e,l);return c?(i&&i(r.tr.setSelection(new Dt(c))),!0):!1}}function TC(n,e,t){if(!n||!n.editable)return!1;let r=n.state.doc.resolve(e);if(!Dt.valid(r))return!1;let i=n.posAtCoords({left:t.clientX,top:t.clientY});return i&&i.inside>-1&&Te.isSelectable(n.state.doc.nodeAt(i.inside))?!1:(n.dispatch(n.state.tr.setSelection(new Dt(r))),!0)}function AC(n,e){if(e.inputType!="insertCompositionText"||!(n.state.selection instanceof Dt))return!1;let{$from:t}=n.state.selection,r=t.parent.contentMatchAt(t.index()).findWrapping(n.state.schema.nodes.text);if(!r)return!1;let i=se.empty;for(let s=r.length-1;s>=0;s--)i=se.from(r[s].createAndFill(null,i));let o=n.state.tr.replace(t.pos,t.pos,new ve(i,0,0));return o.setSelection(Ee.near(o.doc.resolve(t.pos+1))),n.dispatch(o),!1}function MC(n){if(!(n.selection instanceof Dt))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",ht.create(n.doc,[qt.widget(n.selection.head,e,{key:"gapcursor"})])}var Ol=200,Ut=function(){};Ut.prototype.append=function(e){return e.length?(e=Ut.from(e),!this.length&&e||e.length<Ol&&this.leafAppend(e)||this.length<Ol&&e.leafPrepend(this)||this.appendInner(e)):this},Ut.prototype.prepend=function(e){return e.length?Ut.from(e).append(this):this},Ut.prototype.appendInner=function(e){return new NC(this,e)},Ut.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?Ut.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},Ut.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Ut.prototype.forEach=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length),t<=r?this.forEachInner(e,t,r,0):this.forEachInvertedInner(e,t,r,0)},Ut.prototype.map=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,s){return i.push(e(o,s))},t,r),i},Ut.from=function(e){return e instanceof Ut?e:e&&e.length?new p_(e):Ut.empty};var p_=function(n){function e(r){n.call(this),this.values=r}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,s,a){for(var l=o;l<s;l++)if(i(this.values[l],a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(i,o,s,a){for(var l=o-1;l>=s;l--)if(i(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Ol)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Ol)return new e(i.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e}(Ut);Ut.empty=new p_([]);var NC=function(n){function e(t,r){n.call(this),this.left=t,this.right=r,this.length=t.length+r.length,this.depth=Math.max(t.depth,r.depth)+1}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,i,o,s){var a=this.left.length;if(i<a&&this.left.forEachInner(r,i,Math.min(o,a),s)===!1||o>a&&this.right.forEachInner(r,Math.max(i-a,0),Math.min(this.length,o)-a,s+a)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,s){var a=this.left.length;if(i>a&&this.right.forEachInvertedInner(r,i-a,Math.max(o,a)-a,s+a)===!1||o<a&&this.left.forEachInvertedInner(r,Math.min(i,a),o,s)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var o=this.left.length;return i<=o?this.left.slice(r,i):r>=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(Ut);const DC=500;class Gn{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;t&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=e.tr,a,l,c=[],u=[];return this.items.forEach((d,m)=>{if(!d.step){i||(i=this.remapping(r,m+1),o=i.maps.length),o--,u.push(d);return}if(i){u.push(new ir(d.map));let b=d.step.map(i.slice(o)),f;b&&s.maybeStep(b).doc&&(f=s.mapping.maps[s.mapping.maps.length-1],c.push(new ir(f,void 0,void 0,c.length+u.length))),o--,f&&i.appendMap(f,o)}else s.maybeStep(d.step);if(d.selection)return a=i?d.selection.map(i.slice(o)):d.selection,l=new Gn(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:s,selection:a}}addTransform(e,t,r,i){let o=[],s=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null;for(let u=0;u<e.steps.length;u++){let d=e.steps[u].invert(e.docs[u]),m=new ir(e.mapping.maps[u],d,t),b;(b=l&&l.merge(m))&&(m=b,u?o.pop():a=a.slice(0,a.length-1)),o.push(m),t&&(s++,t=void 0),i||(l=m)}let c=s-r.depth;return c>IC&&(a=RC(a,c),s-=c),new Gn(a.append(o),s)}remapping(e,t){let r=new Qo;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s)},e,t),r}addMaps(e){return this.eventCount==0?this:new Gn(this.items.append(e.map(t=>new ir(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-t),o=e.mapping,s=e.steps.length,a=this.eventCount;this.items.forEach(m=>{m.selection&&a--},i);let l=t;this.items.forEach(m=>{let b=o.getMirror(--l);if(b==null)return;s=Math.min(s,b);let f=o.maps[b];if(m.step){let y=e.steps[b].invert(e.docs[b]),w=m.selection&&m.selection.map(o.slice(l+1,b));w&&a++,r.push(new ir(f,y,w))}else r.push(new ir(f))},i);let c=[];for(let m=t;m<s;m++)c.push(new ir(o.maps[m]));let u=this.items.slice(0,i).append(c).append(r),d=new Gn(u,a);return d.emptyItemCount()>DC&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),r=t.maps.length,i=[],o=0;return this.items.forEach((s,a)=>{if(a>=e)i.push(s),s.selection&&o++;else if(s.step){let l=s.step.map(t.slice(r)),c=l&&l.getMap();if(r--,c&&t.appendMap(c,r),l){let u=s.selection&&s.selection.map(t.slice(r));u&&o++;let d=new ir(c.invert(),l,u),m,b=i.length-1;(m=i.length&&i[b].merge(d))?i[b]=m:i.push(d)}}else s.map&&r--},this.items.length,0),new Gn(Ut.from(i.reverse()),o)}}Gn.empty=new Gn(Ut.empty,0);function RC(n,e){let t;return n.forEach((r,i)=>{if(r.selection&&e--==0)return t=i,!1}),n.slice(t)}class ir{constructor(e,t,r,i){this.map=e,this.step=t,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new ir(t.getMap().invert(),t,this.selection)}}}class si{constructor(e,t,r,i,o){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const IC=20;function OC(n,e,t,r){let i=t.getMeta(Pi),o;if(i)return i.historyState;t.getMeta(BC)&&(n=new si(n.done,n.undone,null,0,-1));let s=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(s&&s.getMeta(Pi))return s.getMeta(Pi).redo?new si(n.done.addTransform(t,void 0,r,Ll(e)),n.undone,m_(t.mapping.maps),n.prevTime,n.prevComposition):new si(n.done,n.undone.addTransform(t,void 0,r,Ll(e)),null,n.prevTime,n.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=t.getMeta("composition"),l=n.prevTime==0||!s&&n.prevComposition!=a&&(n.prevTime<(t.time||0)-r.newGroupDelay||!LC(t,n.prevRanges)),c=s?G0(n.prevRanges,t.mapping):m_(t.mapping.maps);return new si(n.done.addTransform(t,l?e.selection.getBookmark():void 0,r,Ll(e)),Gn.empty,c,t.time,a??n.prevComposition)}else return(o=t.getMeta("rebased"))?new si(n.done.rebased(t,o),n.undone.rebased(t,o),G0(n.prevRanges,t.mapping),n.prevTime,n.prevComposition):new si(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),G0(n.prevRanges,t.mapping),n.prevTime,n.prevComposition)}function LC(n,e){if(!e)return!1;if(!n.docChanged)return!0;let t=!1;return n.mapping.maps[0].forEach((r,i)=>{for(let o=0;o<e.length;o+=2)r<=e[o+1]&&i>=e[o]&&(t=!0)}),t}function m_(n){let e=[];for(let t=n.length-1;t>=0&&e.length==0;t--)n[t].forEach((r,i,o,s)=>e.push(o,s));return e}function G0(n,e){if(!n)return null;let t=[];for(let r=0;r<n.length;r+=2){let i=e.map(n[r],1),o=e.map(n[r+1],-1);i<=o&&t.push(i,o)}return t}function PC(n,e,t){let r=Ll(e),i=Pi.get(e).spec.config,o=(t?n.undone:n.done).popEvent(e,r);if(!o)return null;let s=o.selection.resolve(o.transform.doc),a=(t?n.done:n.undone).addTransform(o.transform,e.selection.getBookmark(),i,r),l=new si(t?a:o.remaining,t?o.remaining:a,null,0,-1);return o.transform.setSelection(s).setMeta(Pi,{redo:t,historyState:l})}let $0=!1,g_=null;function Ll(n){let e=n.plugins;if(g_!=e){$0=!1,g_=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){$0=!0;break}}return $0}const Pi=new dt("history"),BC=new dt("closeHistory");function FC(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new at({key:Pi,state:{init(){return new si(Gn.empty,Gn.empty,null,0,-1)},apply(e,t,r){return OC(t,r,e,n)}},config:n,props:{handleDOMEvents:{beforeinput(e,t){let r=t.inputType,i=r=="historyUndo"?__:r=="historyRedo"?y_:null;return!i||!e.editable?!1:(t.preventDefault(),i(e.state,e.dispatch))}}}})}function b_(n,e){return(t,r)=>{let i=Pi.getState(t);if(!i||(n?i.undone:i.done).eventCount==0)return!1;if(r){let o=PC(i,t,n);o&&r(e?o.scrollIntoView():o)}return!0}}const __=b_(!1,!0),y_=b_(!0,!0);Je.create({name:"characterCount",addOptions(){return{limit:null,autoTrim:!0,mode:"textSize",textCounter:n=>n.length,wordCounter:n=>n.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=n=>{const e=(n==null?void 0:n.node)||this.editor.state.doc;if(((n==null?void 0:n.mode)||this.options.mode)==="textSize"){const r=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(r)}return e.nodeSize},this.storage.words=n=>{const e=(n==null?void 0:n.node)||this.editor.state.doc,t=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(t)}},addProseMirrorPlugins(){let n=!1;return[new at({key:new dt("characterCount"),appendTransaction:(e,t,r)=>{if(n)return;const i=this.options.limit,o=this.options.autoTrim;if(i==null||i===0||o===!1){n=!0;return}const s=this.storage.characters({node:r.doc});if(s>i){const a=s-i,l=0,c=a;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);const u=r.tr.deleteRange(l,c);return n=!0,u}n=!0},filterTransaction:(e,t)=>{const r=this.options.limit;if(!e.docChanged||r===0||r===null||r===void 0)return!0;const i=this.storage.characters({node:t.doc}),o=this.storage.characters({node:e.doc});if(o<=r||i>r&&o>r&&o<=i)return!0;if(i>r&&o>r&&o>i||!e.getMeta("paste"))return!1;const a=e.selection.$head.pos,l=o-r,c=a-l,u=a;return e.deleteRange(c,u),!(this.storage.characters({node:e.doc})>r)}})]}});var zC=Je.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[wC(this.options)]}});Je.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new at({key:new dt("focus"),props:{decorations:({doc:n,selection:e})=>{const{isEditable:t,isFocused:r}=this.editor,{anchor:i}=e,o=[];if(!t||!r)return ht.create(n,[]);let s=0;this.options.mode==="deepest"&&n.descendants((l,c)=>{if(l.isText)return;if(!(i>=c&&i<=c+l.nodeSize-1))return!1;s+=1});let a=0;return n.descendants((l,c)=>{if(l.isText||!(i>=c&&i<=c+l.nodeSize-1))return!1;if(a+=1,this.options.mode==="deepest"&&s-a>0||this.options.mode==="shallowest"&&a>1)return this.options.mode==="deepest";o.push(qt.node(c,c+l.nodeSize,{class:this.options.className}))}),ht.create(n,o)}}})]}});var qC=Je.create({name:"gapCursor",addProseMirrorPlugins(){return[CC()]},extendNodeSchema(n){var e;const t={name:n.name,options:n.options,storage:n.storage};return{allowGapCursor:(e=Xe(Me(n,"allowGapCursor",t)))!=null?e:null}}});function v_(n){const{editor:e,placeholder:t,dataAttribute:r,pos:i,node:o,isEmptyDoc:s,hasAnchor:a,classes:{emptyNode:l,emptyEditor:c}}=n,u=[l];return s&&u.push(c),qt.node(i,i+o.nodeSize,{class:u.join(" "),[r]:typeof t=="function"?t({editor:e,node:o,pos:i,hasAnchor:a}):t})}function HC(n){const e=getComputedStyle(n),t=`${e.overflow} ${e.overflowY} ${e.overflowX}`;return/auto|scroll|overlay/.test(t)}function VC(n){let e=n;for(;e;){if(HC(e))return e;const t=e.parentElement;if(!t){const r=e.getRootNode();if(r instanceof ShadowRoot){e=r.host;continue}return window}e=t}return window}function UC(n){return n===window?{top:0,bottom:window.innerHeight}:n.getBoundingClientRect()}function GC({doc:n,view:e,scrollContainer:t}){const r=e.dom.getBoundingClientRect(),i=t?UC(t):{top:0,bottom:window.innerHeight},o=Math.max(r.top,i.top),s=Math.min(r.bottom,i.bottom);if(o>=s)return{top:0,bottom:n.content.size};const l=getComputedStyle(e.dom).direction==="rtl"?Math.max(r.right-2,r.left+2):r.left+2,c=e.posAtCoords({left:l,top:o+2}),u=e.posAtCoords({left:l,top:s-2});return{top:c?c.pos:0,bottom:u?u.pos:n.content.size}}function $C(n,e){let t=null;return{call:(...o)=>{t||(n(...o),t=setTimeout(()=>{t=null},e))},cancel:()=>{t&&(clearTimeout(t),t=null)}}}var w_="placeholder";function WC(n){return n.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}var Ds=new dt("tiptap__placeholder"),KC=Je.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:w_,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){const n=this.options.dataAttribute?`data-${WC(this.options.dataAttribute)}`:`data-${w_}`;return[new at({state:{init(){return{topPos:null,bottomPos:null}},apply(e,t){const r=e.getMeta(Ds);return r!=null&&r.positions?{topPos:r.positions.top,bottomPos:r.positions.bottom}:e.docChanged?{topPos:t.topPos!==null?e.mapping.map(t.topPos):null,bottomPos:t.bottomPos!==null?e.mapping.map(t.bottomPos):null}:t}},key:Ds,view(e){const t=VC(e.dom),r=()=>{const a=GC({view:e,doc:e.state.doc,scrollContainer:t}),l=Ds.getState(e.state);if(l.topPos===a.top&&l.bottomPos===a.bottom)return;const c=e.state.tr.setMeta(Ds,{positions:a}).setMeta("tiptap__viewportUpdate",!0);e.dispatch(c)},{call:i,cancel:o}=$C(r,250),s=t;return s.addEventListener("scroll",i,{passive:!0}),r(),{update(a,l){e.state.doc.content.size!==l.doc.content.size&&r()},destroy:()=>{o(),s.removeEventListener("scroll",i)}}},props:{decorations:({doc:e,selection:t})=>{var r,i;if(!(this.editor.isEditable||!this.options.showOnlyWhenEditable))return null;const{anchor:s}=t,a=[],l=this.editor.isEmpty;if(this.options.showOnlyCurrent&&!this.options.includeChildren){const u=e.resolve(s);if(u.depth>0){const d=u.node(1),m=u.before(1);if(d.type.isTextblock&&gs(d)){const b=s>=m&&s<=m+d.nodeSize,f=v_({node:d,dataAttribute:n,hasAnchor:b,placeholder:this.options.placeholder,classes:{emptyEditor:this.options.emptyEditorClass,emptyNode:this.options.emptyNodeClass},editor:this.editor,isEmptyDoc:l,pos:u.before(1)});a.push(f)}}}else{const u=Ds.getState(this.editor.state),d=(r=u.topPos)!=null?r:0,m=(i=u.bottomPos)!=null?i:e.content.size;e.nodesBetween(d,m,(b,f)=>{const y=s>=f&&s<=f+b.nodeSize,w=!b.isLeaf&&gs(b);if(!b.type.isTextblock)return this.options.includeChildren;if((y||!this.options.showOnlyCurrent)&&w){const k=v_({classes:{emptyEditor:this.options.emptyEditorClass,emptyNode:this.options.emptyNodeClass},editor:this.editor,isEmptyDoc:l,dataAttribute:n,hasAnchor:y,placeholder:this.options.placeholder,node:b,pos:f});a.push(k)}return this.options.includeChildren})}return ht.create(e,a)}}})]}});Je.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:n,options:e}=this;return[new at({key:new dt("selection"),props:{decorations(t){return t.selection.empty||n.isFocused||!n.isEditable||m1(t.selection)||n.view.dragging?null:ht.create(t.doc,[qt.inline(t.selection.from,t.selection.to,{class:e.className})])}}})]}});var jC="skipTrailingNode";function x_({types:n,node:e}){return e&&Array.isArray(n)&&n.includes(e.type)||(e==null?void 0:e.type)===n}var QC=Je.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var n;const e=new dt(this.name),t=this.options.node||((n=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:n.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,i])=>i).filter(i=>(this.options.notAfter||[]).concat(t).includes(i.name));return[new at({key:e,appendTransaction:(i,o,s)=>{const{doc:a,tr:l,schema:c}=s,u=e.getState(s),d=a.content.size,m=c.nodes[t];if(!i.some(b=>b.getMeta(jC))&&u)return l.insert(d,m.create())},state:{init:(i,o)=>{const s=o.tr.doc.lastChild;return!x_({node:s,types:r})},apply:(i,o)=>{if(!i.docChanged||i.getMeta("__uniqueIDTransaction"))return o;const s=i.doc.lastChild;return!x_({node:s,types:r})}}})]}}),YC=Je.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>__(n,e),redo:()=>({state:n,dispatch:e})=>y_(n,e)}},addProseMirrorPlugins(){return[FC(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),ZC=Je.create({name:"starterKit",addExtensions(){var n,e,t,r;const i=[];return this.options.bold!==!1&&i.push(h7.configure(this.options.bold)),this.options.blockquote!==!1&&i.push(a7.configure(this.options.blockquote)),this.options.bulletList!==!1&&i.push(e_.configure(this.options.bulletList)),this.options.code!==!1&&i.push(m7.configure(this.options.code)),this.options.codeBlock!==!1&&i.push(Lb.configure(this.options.codeBlock)),this.options.document!==!1&&i.push(_7.configure(this.options.document)),this.options.dropcursor!==!1&&i.push(zC.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&i.push(qC.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&i.push(y7.configure(this.options.hardBreak)),this.options.heading!==!1&&i.push(v7.configure(this.options.heading)),this.options.undoRedo!==!1&&i.push(YC.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&i.push(w7.configure(this.options.horizontalRule)),this.options.italic!==!1&&i.push(E7.configure(this.options.italic)),this.options.listItem!==!1&&i.push(t_.configure(this.options.listItem)),this.options.listKeymap!==!1&&i.push(a_.configure((n=this.options)==null?void 0:n.listKeymap)),this.options.link!==!1&&i.push(Zb.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&i.push(h_.configure(this.options.orderedList)),this.options.paragraph!==!1&&i.push(mC.configure(this.options.paragraph)),this.options.strike!==!1&&i.push(_C.configure(this.options.strike)),this.options.text!==!1&&i.push(yC.configure(this.options.text)),this.options.underline!==!1&&i.push(f_.configure((t=this.options)==null?void 0:t.underline)),this.options.trailingNode!==!1&&i.push(QC.configure((r=this.options)==null?void 0:r.trailingNode)),i}}),k_=ZC,XC=Je.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:n=>{const e=n.style.textAlign;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:n=>n.textAlign?{style:`text-align: ${n.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:n=>({commands:e})=>this.options.alignments.includes(n)?this.options.types.map(t=>e.updateAttributes(t,{textAlign:n})).some(t=>t):!1,unsetTextAlign:()=>({commands:n})=>this.options.types.map(e=>n.resetAttributes(e,"textAlign")).some(e=>e),toggleTextAlign:n=>({editor:e,commands:t})=>this.options.alignments.includes(n)?e.isActive({textAlign:n})?t.unsetTextAlign():t.setTextAlign(n):!1}},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")}}}),JC=XC,eE=20,S_=(n,e=0)=>{const t=[];return!n.children.length||e>eE||Array.from(n.children).forEach(r=>{r.tagName==="SPAN"?t.push(r):r.children.length&&t.push(...S_(r,e+1))}),t},tE=n=>{if(!n.children.length)return;const e=S_(n);e&&e.forEach(t=>{var r,i;const o=t.getAttribute("style"),s=(i=(r=t.parentElement)==null?void 0:r.closest("span"))==null?void 0:i.getAttribute("style");t.setAttribute("style",`${s};${o}`)})},C_=zn.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!0}},parseHTML(){return[{tag:"span",consuming:!1,getAttrs:n=>n.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&tE(n),{}):!1}]},renderHTML({HTMLAttributes:n}){return["span",$e(this.options.HTMLAttributes,n),0]},addCommands(){return{toggleTextStyle:n=>({commands:e})=>e.toggleMark(this.name,n),removeEmptyTextStyle:()=>({tr:n})=>{const{selection:e}=n;return n.doc.nodesBetween(e.from,e.to,(t,r)=>{if(t.isTextblock)return!0;t.marks.filter(i=>i.type===this.type).some(i=>Object.values(i.attrs).some(o=>!!o))||n.removeMark(r,r+t.nodeSize,this.type)}),!0}}}}),nE=Je.create({name:"backgroundColor",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{backgroundColor:{default:null,parseHTML:n=>{var e;const t=(e=ho(n,"background-color"))!=null?e:n.style.backgroundColor;return t==null?void 0:t.replace(/['"]+/g,"")},renderHTML:n=>n.backgroundColor?{style:`background-color: ${n.backgroundColor}`}:{}}}}]},addCommands(){return{setBackgroundColor:n=>({chain:e})=>e().setMark("textStyle",{backgroundColor:n}).run(),unsetBackgroundColor:()=>({chain:n})=>n().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run()}}}),E_=Je.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:n=>{var e;const t=(e=ho(n,"color"))!=null?e:n.style.color;return t==null?void 0:t.replace(/['"]+/g,"")},renderHTML:n=>n.color?{style:`color: ${n.color}`}:{}}}}]},addCommands(){return{setColor:n=>({chain:e})=>e().setMark("textStyle",{color:n}).run(),unsetColor:()=>({chain:n})=>n().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}),rE=Je.create({name:"fontFamily",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:n=>{var e;return(e=ho(n,"font-family"))!=null?e:n.style.fontFamily},renderHTML:n=>n.fontFamily?{style:`font-family: ${n.fontFamily}`}:{}}}}]},addCommands(){return{setFontFamily:n=>({chain:e})=>e().setMark("textStyle",{fontFamily:n}).run(),unsetFontFamily:()=>({chain:n})=>n().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}}}),iE=Je.create({name:"fontSize",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:n=>{var e;return(e=ho(n,"font-size"))!=null?e:n.style.fontSize},renderHTML:n=>n.fontSize?{style:`font-size: ${n.fontSize}`}:{}}}}]},addCommands(){return{setFontSize:n=>({chain:e})=>e().setMark("textStyle",{fontSize:n}).run(),unsetFontSize:()=>({chain:n})=>n().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}}),oE=Je.create({name:"lineHeight",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:n=>{var e;return(e=ho(n,"line-height"))!=null?e:n.style.lineHeight},renderHTML:n=>n.lineHeight?{style:`line-height: ${n.lineHeight}`}:{}}}}]},addCommands(){return{setLineHeight:n=>({chain:e})=>e().setMark("textStyle",{lineHeight:n}).run(),unsetLineHeight:()=>({chain:n})=>n().setMark("textStyle",{lineHeight:null}).removeEmptyTextStyle().run()}}});Je.create({name:"textStyleKit",addExtensions(){const n=[];return this.options.backgroundColor!==!1&&n.push(nE.configure(this.options.backgroundColor)),this.options.color!==!1&&n.push(E_.configure(this.options.color)),this.options.fontFamily!==!1&&n.push(rE.configure(this.options.fontFamily)),this.options.fontSize!==!1&&n.push(iE.configure(this.options.fontSize)),this.options.lineHeight!==!1&&n.push(oE.configure(this.options.lineHeight)),this.options.textStyle!==!1&&n.push(C_.configure(this.options.textStyle)),n}});var sE=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,aE=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,lE=zn.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:n=>n.getAttribute("data-color")||ho(n,"background-color")||n.style.backgroundColor,renderHTML:n=>n.color?{"data-color":n.color,style:`background-color: ${n.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:n}){return["mark",$e(this.options.HTMLAttributes,n),0]},renderMarkdown:(n,e)=>`==${e.renderChildren(n)}==`,parseMarkdown:(n,e)=>e.applyMark("highlight",e.parseInline(n.tokens||[])),markdownTokenizer:{name:"highlight",level:"inline",start:n=>n.indexOf("=="),tokenize(n,e,t){const i=/^(==)([^=]+)(==)/.exec(n);if(i){const o=i[2].trim(),s=t.inlineTokens(o);return{type:"highlight",raw:i[0],text:o,tokens:s}}}},addCommands(){return{setHighlight:n=>({commands:e})=>e.setMark(this.name,n),toggleHighlight:n=>({commands:e})=>e.toggleMark(this.name,n),unsetHighlight:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Ai({find:sE,type:this.type})]},addPasteRules(){return[ei({find:aE,type:this.type})]}}),cE=lE,uE=zn.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(n){return n!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:n}){return["sub",$e(this.options.HTMLAttributes,n),0]},addCommands(){return{setSubscript:()=>({commands:n})=>n.setMark(this.name),toggleSubscript:()=>({commands:n})=>n.toggleMark(this.name),unsetSubscript:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),dE=uE,hE=zn.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(n){return n!=="super"?!1:null}}]},renderHTML({HTMLAttributes:n}){return["sup",$e(this.options.HTMLAttributes,n),0]},addCommands(){return{setSuperscript:()=>({commands:n})=>n.setMark(this.name),toggleSuperscript:()=>({commands:n})=>n.toggleMark(this.name),unsetSuperscript:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),fE=hE,pE=KC,T_=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function or(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var W0,A_;function mE(){if(A_)return W0;A_=1;var n={exports:{}};function e(N){return N instanceof Map?N.clear=N.delete=N.set=function(){throw new Error("map is read-only")}:N instanceof Set&&(N.add=N.clear=N.delete=function(){throw new Error("set is read-only")}),Object.freeze(N),Object.getOwnPropertyNames(N).forEach(function(ee){var J=N[ee];typeof J=="object"&&!Object.isFrozen(J)&&e(J)}),N}n.exports=e,n.exports.default=e;class t{constructor(ee){ee.data===void 0&&(ee.data={}),this.data=ee.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function r(N){return N.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function i(N,...ee){const J=Object.create(null);for(const De in N)J[De]=N[De];return ee.forEach(function(De){for(const ct in De)J[ct]=De[ct]}),J}const o="</span>",s=N=>!!N.scope||N.sublanguage&&N.language,a=(N,{prefix:ee})=>{if(N.includes(".")){const J=N.split(".");return[`${ee}${J.shift()}`,...J.map((De,ct)=>`${De}${"_".repeat(ct+1)}`)].join(" ")}return`${ee}${N}`};class l{constructor(ee,J){this.buffer="",this.classPrefix=J.classPrefix,ee.walk(this)}addText(ee){this.buffer+=r(ee)}openNode(ee){if(!s(ee))return;let J="";ee.sublanguage?J=`language-${ee.language}`:J=a(ee.scope,{prefix:this.classPrefix}),this.span(J)}closeNode(ee){s(ee)&&(this.buffer+=o)}value(){return this.buffer}span(ee){this.buffer+=`<span class="${ee}">`}}const c=(N={})=>{const ee={children:[]};return Object.assign(ee,N),ee};class u{constructor(){this.rootNode=c(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(ee){this.top.children.push(ee)}openNode(ee){const J=c({scope:ee});this.add(J),this.stack.push(J)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(ee){return this.constructor._walk(ee,this.rootNode)}static _walk(ee,J){return typeof J=="string"?ee.addText(J):J.children&&(ee.openNode(J),J.children.forEach(De=>this._walk(ee,De)),ee.closeNode(J)),ee}static _collapse(ee){typeof ee!="string"&&ee.children&&(ee.children.every(J=>typeof J=="string")?ee.children=[ee.children.join("")]:ee.children.forEach(J=>{u._collapse(J)}))}}class d extends u{constructor(ee){super(),this.options=ee}addKeyword(ee,J){ee!==""&&(this.openNode(J),this.addText(ee),this.closeNode())}addText(ee){ee!==""&&this.add(ee)}addSublanguage(ee,J){const De=ee.root;De.sublanguage=!0,De.language=J,this.add(De)}toHTML(){return new l(this,this.options).value()}finalize(){return!0}}function m(N){return N?typeof N=="string"?N:N.source:null}function b(N){return w("(?=",N,")")}function f(N){return w("(?:",N,")*")}function y(N){return w("(?:",N,")?")}function w(...N){return N.map(J=>m(J)).join("")}function k(N){const ee=N[N.length-1];return typeof ee=="object"&&ee.constructor===Object?(N.splice(N.length-1,1),ee):{}}function E(...N){return"("+(k(N).capture?"":"?:")+N.map(De=>m(De)).join("|")+")"}function S(N){return new RegExp(N.toString()+"|").exec("").length-1}function D(N,ee){const J=N&&N.exec(ee);return J&&J.index===0}const R=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function L(N,{joinWith:ee}){let J=0;return N.map(De=>{J+=1;const ct=J;let we=m(De),me="";for(;we.length>0;){const _e=R.exec(we);if(!_e){me+=we;break}me+=we.substring(0,_e.index),we=we.substring(_e.index+_e[0].length),_e[0][0]==="\\"&&_e[1]?me+="\\"+String(Number(_e[1])+ct):(me+=_e[0],_e[0]==="("&&J++)}return me}).map(De=>`(${De})`).join(ee)}const q=/\b\B/,H="[a-zA-Z]\\w*",U="[a-zA-Z_]\\w*",F="\\b\\d+(\\.\\d+)?",j="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Y="\\b(0b[01]+)",ne="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",$=(N={})=>{const ee=/^#![ ]*\//;return N.binary&&(N.begin=w(ee,/.*\b/,N.binary,/\b.*/)),i({scope:"meta",begin:ee,end:/$/,relevance:0,"on:begin":(J,De)=>{J.index!==0&&De.ignoreMatch()}},N)},Q={begin:"\\\\[\\s\\S]",relevance:0},ie={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Q]},re={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Q]},ue={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/},X=function(N,ee,J={}){const De=i({scope:"comment",begin:N,end:ee,contains:[]},J);De.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 ct=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 De.contains.push({begin:w(/[ ]+/,"(",ct,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),De},te=X("//","$"),fe=X("/\\*","\\*/"),be=X("#","$"),Ce={scope:"number",begin:F,relevance:0},qe={scope:"number",begin:j,relevance:0},pt={scope:"number",begin:Y,relevance:0},We={begin:/(?=\/[^/\n]*\/)/,contains:[{scope:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[Q,{begin:/\[/,end:/\]/,relevance:0,contains:[Q]}]}]},Ke={scope:"title",begin:H,relevance:0},mt={scope:"title",begin:U,relevance:0},Fe={begin:"\\.\\s*"+U,relevance:0};var Ye=Object.freeze({__proto__:null,MATCH_NOTHING_RE:q,IDENT_RE:H,UNDERSCORE_IDENT_RE:U,NUMBER_RE:F,C_NUMBER_RE:j,BINARY_NUMBER_RE:Y,RE_STARTERS_RE:ne,SHEBANG:$,BACKSLASH_ESCAPE:Q,APOS_STRING_MODE:ie,QUOTE_STRING_MODE:re,PHRASAL_WORDS_MODE:ue,COMMENT:X,C_LINE_COMMENT_MODE:te,C_BLOCK_COMMENT_MODE:fe,HASH_COMMENT_MODE:be,NUMBER_MODE:Ce,C_NUMBER_MODE:qe,BINARY_NUMBER_MODE:pt,REGEXP_MODE:We,TITLE_MODE:Ke,UNDERSCORE_TITLE_MODE:mt,METHOD_GUARD:Fe,END_SAME_AS_BEGIN:function(N){return Object.assign(N,{"on:begin":(ee,J)=>{J.data._beginMatch=ee[1]},"on:end":(ee,J)=>{J.data._beginMatch!==ee[1]&&J.ignoreMatch()}})}});function lt(N,ee){N.input[N.index-1]==="."&&ee.ignoreMatch()}function St(N,ee){N.className!==void 0&&(N.scope=N.className,delete N.className)}function yt(N,ee){ee&&N.beginKeywords&&(N.begin="\\b("+N.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",N.__beforeBegin=lt,N.keywords=N.keywords||N.beginKeywords,delete N.beginKeywords,N.relevance===void 0&&(N.relevance=0))}function tt(N,ee){Array.isArray(N.illegal)&&(N.illegal=E(...N.illegal))}function $t(N,ee){if(N.match){if(N.begin||N.end)throw new Error("begin & end are not supported with match");N.begin=N.match,delete N.match}}function bc(N,ee){N.relevance===void 0&&(N.relevance=1)}const _c=(N,ee)=>{if(!N.beforeMatch)return;if(N.starts)throw new Error("beforeMatch cannot be used with starts");const J=Object.assign({},N);Object.keys(N).forEach(De=>{delete N[De]}),N.keywords=J.keywords,N.begin=w(J.beforeMatch,b(J.begin)),N.starts={relevance:0,contains:[Object.assign(J,{endsParent:!0})]},N.relevance=0,delete J.beforeMatch},yc=["of","and","for","in","not","or","if","then","parent","list","value"],$i="keyword";function Eo(N,ee,J=$i){const De=Object.create(null);return typeof N=="string"?ct(J,N.split(" ")):Array.isArray(N)?ct(J,N):Object.keys(N).forEach(function(we){Object.assign(De,Eo(N[we],ee,we))}),De;function ct(we,me){ee&&(me=me.map(_e=>_e.toLowerCase())),me.forEach(function(_e){const Le=_e.split("|");De[Le[0]]=[we,Ef(Le[0],Le[1])]})}}function Ef(N,ee){return ee?Number(ee):Tf(N)?0:1}function Tf(N){return yc.includes(N.toLowerCase())}const cn={},tn=N=>{console.error(N)},lr=(N,...ee)=>{console.log(`WARN: ${N}`,...ee)},cr=(N,ee)=>{cn[`${N}/${ee}`]||(console.log(`Deprecated as of ${N}. ${ee}`),cn[`${N}/${ee}`]=!0)},Wi=new Error;function vc(N,ee,{key:J}){let De=0;const ct=N[J],we={},me={};for(let _e=1;_e<=ee.length;_e++)me[_e+De]=ct[_e],we[_e+De]=!0,De+=S(ee[_e-1]);N[J]=me,N[J]._emit=we,N[J]._multi=!0}function On(N){if(Array.isArray(N.begin)){if(N.skip||N.excludeBegin||N.returnBegin)throw tn("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Wi;if(typeof N.beginScope!="object"||N.beginScope===null)throw tn("beginScope must be object"),Wi;vc(N,N.begin,{key:"beginScope"}),N.begin=L(N.begin,{joinWith:""})}}function To(N){if(Array.isArray(N.end)){if(N.skip||N.excludeEnd||N.returnEnd)throw tn("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Wi;if(typeof N.endScope!="object"||N.endScope===null)throw tn("endScope must be object"),Wi;vc(N,N.end,{key:"endScope"}),N.end=L(N.end,{joinWith:""})}}function wc(N){N.scope&&typeof N.scope=="object"&&N.scope!==null&&(N.beginScope=N.scope,delete N.scope)}function Af(N){wc(N),typeof N.beginScope=="string"&&(N.beginScope={_wrap:N.beginScope}),typeof N.endScope=="string"&&(N.endScope={_wrap:N.endScope}),On(N),To(N)}function Ws(N){function ee(me,_e){return new RegExp(m(me),"m"+(N.case_insensitive?"i":"")+(N.unicodeRegex?"u":"")+(_e?"g":""))}class J{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(_e,Le){Le.position=this.position++,this.matchIndexes[this.matchAt]=Le,this.regexes.push([Le,_e]),this.matchAt+=S(_e)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const _e=this.regexes.map(Le=>Le[1]);this.matcherRe=ee(L(_e,{joinWith:"|"}),!0),this.lastIndex=0}exec(_e){this.matcherRe.lastIndex=this.lastIndex;const Le=this.matcherRe.exec(_e);if(!Le)return null;const V=Le.findIndex((W,Mo)=>Mo>0&&W!==void 0),nt=this.matchIndexes[V];return Le.splice(0,V),Object.assign(Le,nt)}}class De{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(_e){if(this.multiRegexes[_e])return this.multiRegexes[_e];const Le=new J;return this.rules.slice(_e).forEach(([V,nt])=>Le.addRule(V,nt)),Le.compile(),this.multiRegexes[_e]=Le,Le}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(_e,Le){this.rules.push([_e,Le]),Le.type==="begin"&&this.count++}exec(_e){const Le=this.getMatcher(this.regexIndex);Le.lastIndex=this.lastIndex;let V=Le.exec(_e);if(this.resumingScanAtSamePosition()&&!(V&&V.index===this.lastIndex)){const nt=this.getMatcher(0);nt.lastIndex=this.lastIndex+1,V=nt.exec(_e)}return V&&(this.regexIndex+=V.position+1,this.regexIndex===this.count&&this.considerAll()),V}}function ct(me){const _e=new De;return me.contains.forEach(Le=>_e.addRule(Le.begin,{rule:Le,type:"begin"})),me.terminatorEnd&&_e.addRule(me.terminatorEnd,{type:"end"}),me.illegal&&_e.addRule(me.illegal,{type:"illegal"}),_e}function we(me,_e){const Le=me;if(me.isCompiled)return Le;[St,$t,Af,_c].forEach(nt=>nt(me,_e)),N.compilerExtensions.forEach(nt=>nt(me,_e)),me.__beforeBegin=null,[yt,tt,bc].forEach(nt=>nt(me,_e)),me.isCompiled=!0;let V=null;return typeof me.keywords=="object"&&me.keywords.$pattern&&(me.keywords=Object.assign({},me.keywords),V=me.keywords.$pattern,delete me.keywords.$pattern),V=V||/\w+/,me.keywords&&(me.keywords=Eo(me.keywords,N.case_insensitive)),Le.keywordPatternRe=ee(V,!0),_e&&(me.begin||(me.begin=/\B|\b/),Le.beginRe=ee(Le.begin),!me.end&&!me.endsWithParent&&(me.end=/\B|\b/),me.end&&(Le.endRe=ee(Le.end)),Le.terminatorEnd=m(Le.end)||"",me.endsWithParent&&_e.terminatorEnd&&(Le.terminatorEnd+=(me.end?"|":"")+_e.terminatorEnd)),me.illegal&&(Le.illegalRe=ee(me.illegal)),me.contains||(me.contains=[]),me.contains=[].concat(...me.contains.map(function(nt){return Mf(nt==="self"?me:nt)})),me.contains.forEach(function(nt){we(nt,Le)}),me.starts&&we(me.starts,_e),Le.matcher=ct(Le),Le}if(N.compilerExtensions||(N.compilerExtensions=[]),N.contains&&N.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return N.classNameAliases=i(N.classNameAliases||{}),we(N)}function Ao(N){return N?N.endsWithParent||Ao(N.starts):!1}function Mf(N){return N.variants&&!N.cachedVariants&&(N.cachedVariants=N.variants.map(function(ee){return i(N,{variants:null},ee)})),N.cachedVariants?N.cachedVariants:Ao(N)?i(N,{starts:N.starts?i(N.starts):null}):Object.isFrozen(N)?i(N):N}var Nf="11.6.0";class Df extends Error{constructor(ee,J){super(ee),this.name="HTMLInjectionError",this.html=J}}const ci=r,vt=i,C=Symbol("nomatch"),M=7;var O=function(N){const ee=Object.create(null),J=Object.create(null),De=[];let ct=!0;const we="Could not find the language '{}', did you forget to load/include a language module?",me={disableAutodetect:!0,name:"Plain text",contains:[]};let _e={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:d};function Le(pe){return _e.noHighlightRe.test(pe)}function V(pe){let Pe=pe.className+" ";Pe+=pe.parentNode?pe.parentNode.className:"";const Ge=_e.languageDetectRe.exec(Pe);if(Ge){const it=rn(Ge[1]);return it||(lr(we.replace("{}",Ge[1])),lr("Falling back to no-highlight mode for this block.",pe)),it?Ge[1]:"no-highlight"}return Pe.split(/\s+/).find(it=>Le(it)||rn(it))}function nt(pe,Pe,Ge){let it="",It="";typeof Pe=="object"?(it=pe,Ge=Pe.ignoreIllegals,It=Pe.language):(cr("10.7.0","highlight(lang, code, ...args) has been deprecated."),cr("10.7.0",`Please use highlight(code, options) instead.
|
|
142
|
-
https://github.com/highlightjs/highlight.js/issues/2277`),It=pe,it=Pe),Ge===void 0&&(Ge=!0);const vn={code:it,language:It};Rr("before:highlight",vn);const Ln=vn.result?vn.result:W(vn.language,vn.code,Ge);return Ln.code=vn.code,Rr("after:highlight",Ln),Ln}function W(pe,Pe,Ge,it){const It=Object.create(null);function vn(xe,Ne){return xe.keywords[Ne]}function Ln(){if(!He.keywords){Ft.addText(gt);return}let xe=0;He.keywordPatternRe.lastIndex=0;let Ne=He.keywordPatternRe.exec(gt),K="";for(;Ne;){K+=gt.substring(xe,Ne.index);const Ie=At.case_insensitive?Ne[0].toLowerCase():Ne[0],Ct=vn(He,Ie);if(Ct){const[Ht,Pf]=Ct;if(Ft.addText(K),K="",It[Ie]=(It[Ie]||0)+1,It[Ie]<=M&&(Fo+=Pf),Ht.startsWith("_"))K+=Ne[0];else{const Bf=At.classNameAliases[Ht]||Ht;Ft.addKeyword(Ne[0],Bf)}}else K+=Ne[0];xe=He.keywordPatternRe.lastIndex,Ne=He.keywordPatternRe.exec(gt)}K+=gt.substring(xe),Ft.addText(K)}function Lo(){if(gt==="")return;let xe=null;if(typeof He.subLanguage=="string"){if(!ee[He.subLanguage]){Ft.addText(gt);return}xe=W(He.subLanguage,gt,!0,Zs[He.subLanguage]),Zs[He.subLanguage]=xe._top}else xe=No(gt,He.subLanguage.length?He.subLanguage:null);He.relevance>0&&(Fo+=xe.relevance),Ft.addSublanguage(xe._emitter,xe.language)}function on(){He.subLanguage!=null?Lo():Ln(),gt=""}function Ze(xe,Ne){let K=1;const Ie=Ne.length-1;for(;K<=Ie;){if(!xe._emit[K]){K++;continue}const Ct=At.classNameAliases[xe[K]]||xe[K],Ht=Ne[K];Ct?Ft.addKeyword(Ht,Ct):(gt=Ht,Ln(),gt=""),K++}}function ji(xe,Ne){return xe.scope&&typeof xe.scope=="string"&&Ft.openNode(At.classNameAliases[xe.scope]||xe.scope),xe.beginScope&&(xe.beginScope._wrap?(Ft.addKeyword(gt,At.classNameAliases[xe.beginScope._wrap]||xe.beginScope._wrap),gt=""):xe.beginScope._multi&&(Ze(xe.beginScope,Ne),gt="")),He=Object.create(xe,{parent:{value:He}}),He}function pn(xe,Ne,K){let Ie=D(xe.endRe,K);if(Ie){if(xe["on:end"]){const Ct=new t(xe);xe["on:end"](Ne,Ct),Ct.isMatchIgnored&&(Ie=!1)}if(Ie){for(;xe.endsParent&&xe.parent;)xe=xe.parent;return xe}}if(xe.endsWithParent)return pn(xe.parent,Ne,K)}function Rf(xe){return He.matcher.regexIndex===0?(gt+=xe[0],1):(zo=!0,0)}function If(xe){const Ne=xe[0],K=xe.rule,Ie=new t(K),Ct=[K.__beforeBegin,K["on:begin"]];for(const Ht of Ct)if(Ht&&(Ht(xe,Ie),Ie.isMatchIgnored))return Rf(Ne);return K.skip?gt+=Ne:(K.excludeBegin&&(gt+=Ne),on(),!K.returnBegin&&!K.excludeBegin&&(gt=Ne)),ji(K,xe),K.returnBegin?0:Ne.length}function Of(xe){const Ne=xe[0],K=Pe.substring(xe.index),Ie=pn(He,xe,K);if(!Ie)return C;const Ct=He;He.endScope&&He.endScope._wrap?(on(),Ft.addKeyword(Ne,He.endScope._wrap)):He.endScope&&He.endScope._multi?(on(),Ze(He.endScope,xe)):Ct.skip?gt+=Ne:(Ct.returnEnd||Ct.excludeEnd||(gt+=Ne),on(),Ct.excludeEnd&&(gt=Ne));do He.scope&&Ft.closeNode(),!He.skip&&!He.subLanguage&&(Fo+=He.relevance),He=He.parent;while(He!==Ie.parent);return Ie.starts&&ji(Ie.starts,xe),Ct.returnEnd?0:Ne.length}function Lf(){const xe=[];for(let Ne=He;Ne!==At;Ne=Ne.parent)Ne.scope&&xe.unshift(Ne.scope);xe.forEach(Ne=>Ft.openNode(Ne))}let Po={};function Bo(xe,Ne){const K=Ne&&Ne[0];if(gt+=xe,K==null)return on(),0;if(Po.type==="begin"&&Ne.type==="end"&&Po.index===Ne.index&&K===""){if(gt+=Pe.slice(Ne.index,Ne.index+1),!ct){const Ie=new Error(`0 width match regex (${pe})`);throw Ie.languageName=pe,Ie.badRule=Po.rule,Ie}return 1}if(Po=Ne,Ne.type==="begin")return If(Ne);if(Ne.type==="illegal"&&!Ge){const Ie=new Error('Illegal lexeme "'+K+'" for mode "'+(He.scope||"<unnamed>")+'"');throw Ie.mode=He,Ie}else if(Ne.type==="end"){const Ie=Of(Ne);if(Ie!==C)return Ie}if(Ne.type==="illegal"&&K==="")return 1;if(di>1e5&&di>Ne.index*3)throw new Error("potential infinite loop, way more iterations than matches");return gt+=K,K.length}const At=rn(pe);if(!At)throw tn(we.replace("{}",pe)),new Error('Unknown language: "'+pe+'"');const Cc=Ws(At);let Ys="",He=it||Cc;const Zs={},Ft=new _e.__emitter(_e);Lf();let gt="",Fo=0,Ir=0,di=0,zo=!1;try{for(He.matcher.considerAll();;){di++,zo?zo=!1:He.matcher.considerAll(),He.matcher.lastIndex=Ir;const xe=He.matcher.exec(Pe);if(!xe)break;const Ne=Pe.substring(Ir,xe.index),K=Bo(Ne,xe);Ir=xe.index+K}return Bo(Pe.substring(Ir)),Ft.closeAllNodes(),Ft.finalize(),Ys=Ft.toHTML(),{language:pe,value:Ys,relevance:Fo,illegal:!1,_emitter:Ft,_top:He}}catch(xe){if(xe.message&&xe.message.includes("Illegal"))return{language:pe,value:ci(Pe),illegal:!0,relevance:0,_illegalBy:{message:xe.message,index:Ir,context:Pe.slice(Ir-100,Ir+100),mode:xe.mode,resultSoFar:Ys},_emitter:Ft};if(ct)return{language:pe,value:ci(Pe),illegal:!1,relevance:0,errorRaised:xe,_emitter:Ft,_top:He};throw xe}}function Mo(pe){const Pe={value:ci(pe),illegal:!1,relevance:0,_top:me,_emitter:new _e.__emitter(_e)};return Pe._emitter.addText(pe),Pe}function No(pe,Pe){Pe=Pe||_e.languages||Object.keys(ee);const Ge=Mo(pe),it=Pe.filter(rn).filter(Io).map(on=>W(on,pe,!1));it.unshift(Ge);const It=it.sort((on,Ze)=>{if(on.relevance!==Ze.relevance)return Ze.relevance-on.relevance;if(on.language&&Ze.language){if(rn(on.language).supersetOf===Ze.language)return 1;if(rn(Ze.language).supersetOf===on.language)return-1}return 0}),[vn,Ln]=It,Lo=vn;return Lo.secondBest=Ln,Lo}function Ks(pe,Pe,Ge){const it=Pe&&J[Pe]||Ge;pe.classList.add("hljs"),pe.classList.add(`language-${it}`)}function Do(pe){let Pe=null;const Ge=V(pe);if(Le(Ge))return;if(Rr("before:highlightElement",{el:pe,language:Ge}),pe.children.length>0&&(_e.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(pe)),_e.throwUnescapedHTML))throw new Df("One of your code blocks includes unescaped HTML.",pe.innerHTML);Pe=pe;const it=Pe.textContent,It=Ge?nt(it,{language:Ge,ignoreIllegals:!0}):No(it);pe.innerHTML=It.value,Ks(pe,Ge,It.language),pe.result={language:It.language,re:It.relevance,relevance:It.relevance},It.secondBest&&(pe.secondBest={language:It.secondBest.language,relevance:It.secondBest.relevance}),Rr("after:highlightElement",{el:pe,result:It,text:it})}function xc(pe){_e=vt(_e,pe)}const js=()=>{ui(),cr("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function kc(){ui(),cr("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Ki=!1;function ui(){if(document.readyState==="loading"){Ki=!0;return}document.querySelectorAll(_e.cssSelector).forEach(Do)}function Ro(){Ki&&ui()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",Ro,!1);function ze(pe,Pe){let Ge=null;try{Ge=Pe(N)}catch(it){if(tn("Language definition for '{}' could not be registered.".replace("{}",pe)),ct)tn(it);else throw it;Ge=me}Ge.name||(Ge.name=pe),ee[pe]=Ge,Ge.rawDefinition=Pe.bind(null,N),Ge.aliases&&jn(Ge.aliases,{languageName:pe})}function nn(pe){delete ee[pe];for(const Pe of Object.keys(J))J[Pe]===pe&&delete J[Pe]}function Rt(){return Object.keys(ee)}function rn(pe){return pe=(pe||"").toLowerCase(),ee[pe]||ee[J[pe]]}function jn(pe,{languageName:Pe}){typeof pe=="string"&&(pe=[pe]),pe.forEach(Ge=>{J[Ge.toLowerCase()]=Pe})}function Io(pe){const Pe=rn(pe);return Pe&&!Pe.disableAutodetect}function Qs(pe){pe["before:highlightBlock"]&&!pe["before:highlightElement"]&&(pe["before:highlightElement"]=Pe=>{pe["before:highlightBlock"](Object.assign({block:Pe.el},Pe))}),pe["after:highlightBlock"]&&!pe["after:highlightElement"]&&(pe["after:highlightElement"]=Pe=>{pe["after:highlightBlock"](Object.assign({block:Pe.el},Pe))})}function Oo(pe){Qs(pe),De.push(pe)}function Rr(pe,Pe){const Ge=pe;De.forEach(function(it){it[Ge]&&it[Ge](Pe)})}function Sc(pe){return cr("10.7.0","highlightBlock will be removed entirely in v12.0"),cr("10.7.0","Please use highlightElement now."),Do(pe)}Object.assign(N,{highlight:nt,highlightAuto:No,highlightAll:ui,highlightElement:Do,highlightBlock:Sc,configure:xc,initHighlighting:js,initHighlightingOnLoad:kc,registerLanguage:ze,unregisterLanguage:nn,listLanguages:Rt,getLanguage:rn,registerAliases:jn,autoDetection:Io,inherit:vt,addPlugin:Oo}),N.debugMode=function(){ct=!1},N.safeMode=function(){ct=!0},N.versionString=Nf,N.regex={concat:w,lookahead:b,either:E,optional:y,anyNumberOfTimes:f};for(const pe in Ye)typeof Ye[pe]=="object"&&n.exports(Ye[pe]);return Object.assign(N,Ye),N}({});return W0=O,O.HighlightJS=O,O.default=O,W0}var gE=mE();const Rn=or(gE);function M_(n,e=[]){return n.flatMap(t=>{const r=[...e,...t.properties?t.properties.className:[]];return t.children?M_(t.children,r):{text:t.value,classes:r}})}function N_(n){return n.value||n.children||[]}function bE(n){return!!Rn.getLanguage(n)}function D_({doc:n,name:e,lowlight:t,defaultLanguage:r}){const i=[];return Bu(n,o=>o.type.name===e).forEach(o=>{var s;let a=o.pos+1;const l=o.node.attrs.language||r,c=t.listLanguages(),u=l&&(c.includes(l)||bE(l)||(s=t.registered)!=null&&s.call(t,l))?N_(t.highlight(l,o.node.textContent)):N_(t.highlightAuto(o.node.textContent));M_(u).forEach(d=>{const m=a+d.text.length;if(d.classes.length){const b=qt.inline(a,m,{class:d.classes.join(" ")});i.push(b)}a=m})}),ht.create(n,i)}function _E(n){return typeof n=="function"}function yE({name:n,lowlight:e,defaultLanguage:t}){if(!["highlight","highlightAuto","listLanguages"].every(i=>_E(e[i])))throw Error("You should provide an instance of lowlight to use the code-block-lowlight extension");const r=new at({key:new dt("lowlight"),state:{init:(i,{doc:o})=>D_({doc:o,name:n,lowlight:e,defaultLanguage:t}),apply:(i,o,s,a)=>{const l=s.selection.$head.parent.type.name,c=a.selection.$head.parent.type.name,u=Bu(s.doc,m=>m.type.name===n),d=Bu(a.doc,m=>m.type.name===n);return i.docChanged&&([l,c].includes(n)||d.length!==u.length||i.steps.some(m=>m.from!==void 0&&m.to!==void 0&&u.some(b=>b.pos>=m.from&&b.pos+b.node.nodeSize<=m.to)))?D_({doc:i.doc,name:n,lowlight:e,defaultLanguage:t}):o.map(i.mapping,i.doc)}},props:{decorations(i){return r.getState(i)}}});return r}var vE=Lb.extend({addOptions(){var n;return{...(n=this.parent)==null?void 0:n.call(this),lowlight:{},languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:4,HTMLAttributes:{}}},addProseMirrorPlugins(){var n;return[...((n=this.parent)==null?void 0:n.call(this))||[],yE({name:this.name,lowlight:this.options.lowlight,defaultLanguage:this.options.defaultLanguage})]}}),wE=vE;const Gt=(n,e)=>{const t=n.__vccOpts||n;for(const[r,i]of e)t[r]=i;return t},xE={components:{NodeViewWrapper:Mi,NodeViewContent:O1},props:{editor:{type:Object},node:{type:Object},decorations:{type:Array},selected:{type:Boolean},extension:{type:Object},getPos:{type:Function},updateAttributes:{type:Function},deleteNode:{type:Function}},data(){return{selectedLanguage:{},status:{copy:!1},timer:{copy:null}}},watch:{selectedLanguage(){this.updateAttributes({language:this.selectedLanguage.key})}},computed:{languages(){let n=this.extension.options.lowlight.listLanguages(),e=[];for(let t=0;t<n.length;t++)e.push({key:n[t],text:n[t][0].toUpperCase()+n[t].slice(1).toLowerCase()});return e.unshift({key:"",text:"Default"}),e}},mounted(){let n=this.languages.find(e=>e.key===this.node.attrs.language);n?this.selectedLanguage=n:this.selectedLanguage=this.languages[0]},methods:{copyCode(){if(this.status.copy)return;this.status.copy=!0;let n=this.node.textContent,e=document.createElement("textarea");e.value=n,document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e),this.timer.copy=setTimeout(()=>{this.status.copy=!1},3e3)}}},kE={contenteditable:"false",class:"power-editor-code-block-banner"},SE={class:"power-editor-code-block-banner-left-block"},CE={class:"power-editor-code-block-language"},EE={class:"power-editor-code-block-banner-right-block"},TE={key:0,contenteditable:"false",class:"power-editor-code-block-line-number-block"},AE=["title"];function ME(n,e,t,r,i,o){const s=v.resolveComponent("fv-combobox"),a=v.resolveComponent("fv-button"),l=v.resolveComponent("node-view-content"),c=v.resolveComponent("node-view-wrapper");return v.openBlock(),v.createBlock(c,{class:"power-editor-code-block"},{default:v.withCtx(()=>[v.createElementVNode("div",kE,[v.createElementVNode("div",SE,[v.createElementVNode("p",CE,v.toDisplayString(t.node.attrs.language),1)]),v.createElementVNode("div",EE,[v.withDirectives(v.createVNode(s,{modelValue:i.selectedLanguage,"onUpdate:modelValue":e[0]||(e[0]=u=>i.selectedLanguage=u),placeholder:"Select language",theme:"dark",options:o.languages,style:{width:"120px",height:"30px"}},null,8,["modelValue","options"]),[[v.vShow,t.editor.storage.defaultStorage.codeBlockLanguagesBox]]),v.createVNode(a,{theme:"dark",background:"rgba(36, 36, 36, 1)","is-box-shadow":!0,style:{width:"30px",height:"30px","margin-left":"5px"},title:i.status.copy?"Copied":"Copy",onClick:o.copyCode},{default:v.withCtx(()=>[v.createElementVNode("i",{class:v.normalizeClass(["ms-Icon",[`ms-Icon--${i.status.copy?"Accept":"Set"}`]])},null,2)]),_:1},8,["title","onClick"])])]),v.createElementVNode("pre",{class:v.normalizeClass(["power-editor-code-block-pre",[{lineNumber:t.editor.storage.defaultStorage.codeBlockLineNumbers}]])},[v.createElementVNode("code",null,[v.createVNode(l)])],2),t.editor.storage.defaultStorage.codeBlockLineNumbers?(v.openBlock(),v.createElementBlock("div",TE,[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(t.node.textContent.split(`
|
|
143
|
-
`),(u,d)=>(v.openBlock(),v.createElementBlock("div",{key:d,class:"power-editor-code-block-line-number-item",title:d+1},v.toDisplayString(d+1),9,AE))),128))])):v.createCommentVNode("",!0)]),_:1})}const NE=Gt(xE,[["render",ME]]);function Pl(n,e="language-"){var o,s,a;if(!n)return null;const t=((o=n.getAttribute)==null?void 0:o.call(n,"data-language"))||((s=n.getAttribute)==null?void 0:s.call(n,"language"))||((a=n.getAttribute)==null?void 0:a.call(n,"lang"));if(t)return t;if(!e)return null;const i=[...n.classList||[]].find(l=>l.startsWith(e));return i&&i.replace(e,"")||null}function DE(n){return
|
|
144
|
-
`)
|
|
142
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),It=pe,it=Pe),Ge===void 0&&(Ge=!0);const vn={code:it,language:It};Rr("before:highlight",vn);const Ln=vn.result?vn.result:W(vn.language,vn.code,Ge);return Ln.code=vn.code,Rr("after:highlight",Ln),Ln}function W(pe,Pe,Ge,it){const It=Object.create(null);function vn(xe,Ne){return xe.keywords[Ne]}function Ln(){if(!He.keywords){Ft.addText(gt);return}let xe=0;He.keywordPatternRe.lastIndex=0;let Ne=He.keywordPatternRe.exec(gt),K="";for(;Ne;){K+=gt.substring(xe,Ne.index);const Ie=At.case_insensitive?Ne[0].toLowerCase():Ne[0],Ct=vn(He,Ie);if(Ct){const[Ht,Pf]=Ct;if(Ft.addText(K),K="",It[Ie]=(It[Ie]||0)+1,It[Ie]<=M&&(Fo+=Pf),Ht.startsWith("_"))K+=Ne[0];else{const Bf=At.classNameAliases[Ht]||Ht;Ft.addKeyword(Ne[0],Bf)}}else K+=Ne[0];xe=He.keywordPatternRe.lastIndex,Ne=He.keywordPatternRe.exec(gt)}K+=gt.substring(xe),Ft.addText(K)}function Lo(){if(gt==="")return;let xe=null;if(typeof He.subLanguage=="string"){if(!ee[He.subLanguage]){Ft.addText(gt);return}xe=W(He.subLanguage,gt,!0,Zs[He.subLanguage]),Zs[He.subLanguage]=xe._top}else xe=No(gt,He.subLanguage.length?He.subLanguage:null);He.relevance>0&&(Fo+=xe.relevance),Ft.addSublanguage(xe._emitter,xe.language)}function on(){He.subLanguage!=null?Lo():Ln(),gt=""}function Ze(xe,Ne){let K=1;const Ie=Ne.length-1;for(;K<=Ie;){if(!xe._emit[K]){K++;continue}const Ct=At.classNameAliases[xe[K]]||xe[K],Ht=Ne[K];Ct?Ft.addKeyword(Ht,Ct):(gt=Ht,Ln(),gt=""),K++}}function ji(xe,Ne){return xe.scope&&typeof xe.scope=="string"&&Ft.openNode(At.classNameAliases[xe.scope]||xe.scope),xe.beginScope&&(xe.beginScope._wrap?(Ft.addKeyword(gt,At.classNameAliases[xe.beginScope._wrap]||xe.beginScope._wrap),gt=""):xe.beginScope._multi&&(Ze(xe.beginScope,Ne),gt="")),He=Object.create(xe,{parent:{value:He}}),He}function pn(xe,Ne,K){let Ie=D(xe.endRe,K);if(Ie){if(xe["on:end"]){const Ct=new t(xe);xe["on:end"](Ne,Ct),Ct.isMatchIgnored&&(Ie=!1)}if(Ie){for(;xe.endsParent&&xe.parent;)xe=xe.parent;return xe}}if(xe.endsWithParent)return pn(xe.parent,Ne,K)}function Rf(xe){return He.matcher.regexIndex===0?(gt+=xe[0],1):(zo=!0,0)}function If(xe){const Ne=xe[0],K=xe.rule,Ie=new t(K),Ct=[K.__beforeBegin,K["on:begin"]];for(const Ht of Ct)if(Ht&&(Ht(xe,Ie),Ie.isMatchIgnored))return Rf(Ne);return K.skip?gt+=Ne:(K.excludeBegin&&(gt+=Ne),on(),!K.returnBegin&&!K.excludeBegin&&(gt=Ne)),ji(K,xe),K.returnBegin?0:Ne.length}function Of(xe){const Ne=xe[0],K=Pe.substring(xe.index),Ie=pn(He,xe,K);if(!Ie)return C;const Ct=He;He.endScope&&He.endScope._wrap?(on(),Ft.addKeyword(Ne,He.endScope._wrap)):He.endScope&&He.endScope._multi?(on(),Ze(He.endScope,xe)):Ct.skip?gt+=Ne:(Ct.returnEnd||Ct.excludeEnd||(gt+=Ne),on(),Ct.excludeEnd&&(gt=Ne));do He.scope&&Ft.closeNode(),!He.skip&&!He.subLanguage&&(Fo+=He.relevance),He=He.parent;while(He!==Ie.parent);return Ie.starts&&ji(Ie.starts,xe),Ct.returnEnd?0:Ne.length}function Lf(){const xe=[];for(let Ne=He;Ne!==At;Ne=Ne.parent)Ne.scope&&xe.unshift(Ne.scope);xe.forEach(Ne=>Ft.openNode(Ne))}let Po={};function Bo(xe,Ne){const K=Ne&&Ne[0];if(gt+=xe,K==null)return on(),0;if(Po.type==="begin"&&Ne.type==="end"&&Po.index===Ne.index&&K===""){if(gt+=Pe.slice(Ne.index,Ne.index+1),!ct){const Ie=new Error(`0 width match regex (${pe})`);throw Ie.languageName=pe,Ie.badRule=Po.rule,Ie}return 1}if(Po=Ne,Ne.type==="begin")return If(Ne);if(Ne.type==="illegal"&&!Ge){const Ie=new Error('Illegal lexeme "'+K+'" for mode "'+(He.scope||"<unnamed>")+'"');throw Ie.mode=He,Ie}else if(Ne.type==="end"){const Ie=Of(Ne);if(Ie!==C)return Ie}if(Ne.type==="illegal"&&K==="")return 1;if(di>1e5&&di>Ne.index*3)throw new Error("potential infinite loop, way more iterations than matches");return gt+=K,K.length}const At=rn(pe);if(!At)throw tn(we.replace("{}",pe)),new Error('Unknown language: "'+pe+'"');const Cc=Ws(At);let Ys="",He=it||Cc;const Zs={},Ft=new _e.__emitter(_e);Lf();let gt="",Fo=0,Ir=0,di=0,zo=!1;try{for(He.matcher.considerAll();;){di++,zo?zo=!1:He.matcher.considerAll(),He.matcher.lastIndex=Ir;const xe=He.matcher.exec(Pe);if(!xe)break;const Ne=Pe.substring(Ir,xe.index),K=Bo(Ne,xe);Ir=xe.index+K}return Bo(Pe.substring(Ir)),Ft.closeAllNodes(),Ft.finalize(),Ys=Ft.toHTML(),{language:pe,value:Ys,relevance:Fo,illegal:!1,_emitter:Ft,_top:He}}catch(xe){if(xe.message&&xe.message.includes("Illegal"))return{language:pe,value:ci(Pe),illegal:!0,relevance:0,_illegalBy:{message:xe.message,index:Ir,context:Pe.slice(Ir-100,Ir+100),mode:xe.mode,resultSoFar:Ys},_emitter:Ft};if(ct)return{language:pe,value:ci(Pe),illegal:!1,relevance:0,errorRaised:xe,_emitter:Ft,_top:He};throw xe}}function Mo(pe){const Pe={value:ci(pe),illegal:!1,relevance:0,_top:me,_emitter:new _e.__emitter(_e)};return Pe._emitter.addText(pe),Pe}function No(pe,Pe){Pe=Pe||_e.languages||Object.keys(ee);const Ge=Mo(pe),it=Pe.filter(rn).filter(Io).map(on=>W(on,pe,!1));it.unshift(Ge);const It=it.sort((on,Ze)=>{if(on.relevance!==Ze.relevance)return Ze.relevance-on.relevance;if(on.language&&Ze.language){if(rn(on.language).supersetOf===Ze.language)return 1;if(rn(Ze.language).supersetOf===on.language)return-1}return 0}),[vn,Ln]=It,Lo=vn;return Lo.secondBest=Ln,Lo}function Ks(pe,Pe,Ge){const it=Pe&&J[Pe]||Ge;pe.classList.add("hljs"),pe.classList.add(`language-${it}`)}function Do(pe){let Pe=null;const Ge=V(pe);if(Le(Ge))return;if(Rr("before:highlightElement",{el:pe,language:Ge}),pe.children.length>0&&(_e.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(pe)),_e.throwUnescapedHTML))throw new Df("One of your code blocks includes unescaped HTML.",pe.innerHTML);Pe=pe;const it=Pe.textContent,It=Ge?nt(it,{language:Ge,ignoreIllegals:!0}):No(it);pe.innerHTML=It.value,Ks(pe,Ge,It.language),pe.result={language:It.language,re:It.relevance,relevance:It.relevance},It.secondBest&&(pe.secondBest={language:It.secondBest.language,relevance:It.secondBest.relevance}),Rr("after:highlightElement",{el:pe,result:It,text:it})}function xc(pe){_e=vt(_e,pe)}const js=()=>{ui(),cr("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function kc(){ui(),cr("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Ki=!1;function ui(){if(document.readyState==="loading"){Ki=!0;return}document.querySelectorAll(_e.cssSelector).forEach(Do)}function Ro(){Ki&&ui()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",Ro,!1);function ze(pe,Pe){let Ge=null;try{Ge=Pe(N)}catch(it){if(tn("Language definition for '{}' could not be registered.".replace("{}",pe)),ct)tn(it);else throw it;Ge=me}Ge.name||(Ge.name=pe),ee[pe]=Ge,Ge.rawDefinition=Pe.bind(null,N),Ge.aliases&&jn(Ge.aliases,{languageName:pe})}function nn(pe){delete ee[pe];for(const Pe of Object.keys(J))J[Pe]===pe&&delete J[Pe]}function Rt(){return Object.keys(ee)}function rn(pe){return pe=(pe||"").toLowerCase(),ee[pe]||ee[J[pe]]}function jn(pe,{languageName:Pe}){typeof pe=="string"&&(pe=[pe]),pe.forEach(Ge=>{J[Ge.toLowerCase()]=Pe})}function Io(pe){const Pe=rn(pe);return Pe&&!Pe.disableAutodetect}function Qs(pe){pe["before:highlightBlock"]&&!pe["before:highlightElement"]&&(pe["before:highlightElement"]=Pe=>{pe["before:highlightBlock"](Object.assign({block:Pe.el},Pe))}),pe["after:highlightBlock"]&&!pe["after:highlightElement"]&&(pe["after:highlightElement"]=Pe=>{pe["after:highlightBlock"](Object.assign({block:Pe.el},Pe))})}function Oo(pe){Qs(pe),De.push(pe)}function Rr(pe,Pe){const Ge=pe;De.forEach(function(it){it[Ge]&&it[Ge](Pe)})}function Sc(pe){return cr("10.7.0","highlightBlock will be removed entirely in v12.0"),cr("10.7.0","Please use highlightElement now."),Do(pe)}Object.assign(N,{highlight:nt,highlightAuto:No,highlightAll:ui,highlightElement:Do,highlightBlock:Sc,configure:xc,initHighlighting:js,initHighlightingOnLoad:kc,registerLanguage:ze,unregisterLanguage:nn,listLanguages:Rt,getLanguage:rn,registerAliases:jn,autoDetection:Io,inherit:vt,addPlugin:Oo}),N.debugMode=function(){ct=!1},N.safeMode=function(){ct=!0},N.versionString=Nf,N.regex={concat:w,lookahead:b,either:E,optional:y,anyNumberOfTimes:f};for(const pe in Ye)typeof Ye[pe]=="object"&&n.exports(Ye[pe]);return Object.assign(N,Ye),N}({});return W0=O,O.HighlightJS=O,O.default=O,W0}var gE=mE();const Rn=or(gE);function M_(n,e=[]){return n.flatMap(t=>{const r=[...e,...t.properties?t.properties.className:[]];return t.children?M_(t.children,r):{text:t.value,classes:r}})}function N_(n){return n.value||n.children||[]}function bE(n){return!!Rn.getLanguage(n)}function D_({doc:n,name:e,lowlight:t,defaultLanguage:r}){const i=[];return Bu(n,o=>o.type.name===e).forEach(o=>{var s;let a=o.pos+1;const l=o.node.attrs.language||r,c=t.listLanguages(),u=l&&(c.includes(l)||bE(l)||(s=t.registered)!=null&&s.call(t,l))?N_(t.highlight(l,o.node.textContent)):N_(t.highlightAuto(o.node.textContent));M_(u).forEach(d=>{const m=a+d.text.length;if(d.classes.length){const b=qt.inline(a,m,{class:d.classes.join(" ")});i.push(b)}a=m})}),ht.create(n,i)}function _E(n){return typeof n=="function"}function yE({name:n,lowlight:e,defaultLanguage:t}){if(!["highlight","highlightAuto","listLanguages"].every(i=>_E(e[i])))throw Error("You should provide an instance of lowlight to use the code-block-lowlight extension");const r=new at({key:new dt("lowlight"),state:{init:(i,{doc:o})=>D_({doc:o,name:n,lowlight:e,defaultLanguage:t}),apply:(i,o,s,a)=>{const l=s.selection.$head.parent.type.name,c=a.selection.$head.parent.type.name,u=Bu(s.doc,m=>m.type.name===n),d=Bu(a.doc,m=>m.type.name===n);return i.docChanged&&([l,c].includes(n)||d.length!==u.length||i.steps.some(m=>m.from!==void 0&&m.to!==void 0&&u.some(b=>b.pos>=m.from&&b.pos+b.node.nodeSize<=m.to)))?D_({doc:i.doc,name:n,lowlight:e,defaultLanguage:t}):o.map(i.mapping,i.doc)}},props:{decorations(i){return r.getState(i)}}});return r}var vE=Lb.extend({addOptions(){var n;return{...(n=this.parent)==null?void 0:n.call(this),lowlight:{},languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:4,HTMLAttributes:{}}},addProseMirrorPlugins(){var n;return[...((n=this.parent)==null?void 0:n.call(this))||[],yE({name:this.name,lowlight:this.options.lowlight,defaultLanguage:this.options.defaultLanguage})]}}),wE=vE;const Gt=(n,e)=>{const t=n.__vccOpts||n;for(const[r,i]of e)t[r]=i;return t},xE={components:{NodeViewWrapper:Mi,NodeViewContent:O1},props:{editor:{type:Object},node:{type:Object},decorations:{type:Array},selected:{type:Boolean},extension:{type:Object},getPos:{type:Function},updateAttributes:{type:Function},deleteNode:{type:Function}},data(){return{thisTheme:this.editor.storage.defaultStorage.theme,status:{copy:!1},timer:{copy:null}}},watch:{"editor.storage.defaultStorage.theme"(n){this.thisTheme=n}},computed:{actionButtonBackground(){return this.thisTheme==="dark"?"rgba(36, 36, 36, 1)":"rgba(255, 255, 255, 1)"},languages(){let n=this.extension.options.lowlight.listLanguages(),e=[];for(let t=0;t<n.length;t++)e.push({key:n[t],text:n[t][0].toUpperCase()+n[t].slice(1).toLowerCase()});return e.unshift({key:"auto",text:"Default"}),e},selectedLanguage:{get(){let n=this.languages.find(e=>e.key===this.node.attrs.language);return n?[n]:[this.languages[0]]},set(n){n.length!==0&&this.updateAttributes({language:n[0].key})}}},mounted(){},methods:{copyCode(){if(this.status.copy)return;this.status.copy=!0;let n=this.node.textContent,e=document.createElement("textarea");e.value=n,document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e),this.timer.copy=setTimeout(()=>{this.status.copy=!1},3e3)}}},kE={contenteditable:"false",class:"power-editor-code-block-banner"},SE={class:"power-editor-code-block-banner-left-block"},CE={class:"power-editor-code-block-language"},EE={class:"power-editor-code-block-banner-right-block"},TE={key:0,contenteditable:"false",class:"power-editor-code-block-line-number-block"},AE=["title"];function ME(n,e,t,r,i,o){const s=v.resolveComponent("fv-button"),a=v.resolveComponent("fv-DropDown"),l=v.resolveComponent("node-view-content"),c=v.resolveComponent("node-view-wrapper");return v.openBlock(),v.createBlock(c,{class:v.normalizeClass(["power-editor-code-block",[{dark:i.thisTheme==="dark"}]])},{default:v.withCtx(()=>[v.createElementVNode("div",kE,[v.createElementVNode("div",SE,[v.createElementVNode("p",CE,v.toDisplayString(t.node.attrs.language||"auto"),1)]),v.createElementVNode("div",EE,[v.withDirectives(v.createVNode(a,{modelValue:o.selectedLanguage,"onUpdate:modelValue":e[0]||(e[0]=u=>o.selectedLanguage=u),placeholder:"Select language",theme:i.thisTheme,options:o.languages,"max-height":"300px",style:{width:"120px",height:"25px"}},{"drop-carrier":v.withCtx(u=>[v.createVNode(s,{theme:u.theme,icon:"ChevronDown",background:o.actionButtonBackground,"font-size":"10",class:"power-editor-code-block-action-btn",title:o.selectedLanguage[0].text||"Select language","border-radius":"6",style:{width:"80px",float:"right"}},{default:v.withCtx(()=>[v.createTextVNode(v.toDisplayString(o.selectedLanguage[0].text||"Default"),1)]),_:2},1032,["theme","background","title"])]),_:1},8,["modelValue","theme","options"]),[[v.vShow,t.editor.storage.defaultStorage.codeBlockLanguagesBox]]),v.createVNode(s,{theme:i.thisTheme,background:o.actionButtonBackground,"font-size":"10",class:"power-editor-code-block-action-btn",title:i.status.copy?"Copied":"Copy","border-radius":"6",onClick:o.copyCode},{default:v.withCtx(()=>[v.createElementVNode("i",{class:v.normalizeClass(["ms-Icon",[`ms-Icon--${i.status.copy?"Accept":"Set"}`]])},null,2)]),_:1},8,["theme","background","title","onClick"])])]),v.createElementVNode("pre",{class:v.normalizeClass(["power-editor-code-block-pre",[{lineNumber:t.editor.storage.defaultStorage.codeBlockLineNumbers}]])},[v.createElementVNode("code",null,[v.createVNode(l)])],2),t.editor.storage.defaultStorage.codeBlockLineNumbers?(v.openBlock(),v.createElementBlock("div",TE,[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(t.node.textContent.split(`
|
|
143
|
+
`),(u,d)=>(v.openBlock(),v.createElementBlock("div",{key:d,class:"power-editor-code-block-line-number-item",title:d+1},v.toDisplayString(d+1),9,AE))),128))])):v.createCommentVNode("",!0)]),_:1},8,["class"])}const NE=Gt(xE,[["render",ME]]);function Pl(n,e="language-"){var o,s,a;if(!n)return null;const t=((o=n.getAttribute)==null?void 0:o.call(n,"data-language"))||((s=n.getAttribute)==null?void 0:s.call(n,"language"))||((a=n.getAttribute)==null?void 0:a.call(n,"lang"));if(t)return t;if(!e)return null;const i=[...n.classList||[]].find(l=>l.startsWith(e));return i&&i.replace(e,"")||null}function DE(n){if(!n)return"";const e=[],t=new Set(["DIV","P"]),r=i=>{if(!i)return;if(i.nodeType===Node.TEXT_NODE){e.push(i.nodeValue||"");return}if(i.nodeType!==Node.ELEMENT_NODE)return;if(i.tagName==="BR"){e.push(`
|
|
144
|
+
`);return}const o=e.length;Array.from(i.childNodes).forEach(r),t.has(i.tagName)&&e.length>o&&e[e.length-1]!==`
|
|
145
|
+
`&&e.push(`
|
|
146
|
+
`)};return r(n),e.join("").replace(/\r\n?/g,`
|
|
147
|
+
`).replace(/\n$/,"")}const RE=wE.extend({transformPastedHTML(n){if(!n||typeof DOMParser>"u")return n;const t=new DOMParser().parseFromString(n,"text/html"),{languageClassPrefix:r}=this.options;return t.querySelectorAll("[hidden], [aria-hidden='true'], script, style, meta, link").forEach(i=>i.remove()),t.querySelectorAll("pre").forEach(i=>{var d;const o=(d=i.querySelector("pre code"))==null?void 0:d.closest("pre");if(!o||o===i)return;const s=o.querySelector("code"),a=DE(s||o),l=Pl(s,r)||Pl(o,r),c=t.createElement("pre"),u=t.createElement("code");l&&r&&u.classList.add(`${r}${l}`),u.textContent=a,c.appendChild(u),i.replaceWith(c)}),t.querySelectorAll("pre").forEach(i=>{const o=i.querySelector("code"),s=Pl(o,r)||Pl(i,r);s&&o&&r&&![...o.classList].some(a=>a.startsWith(r))&&o.classList.add(`${r}${s}`)}),t.body.innerHTML},addNodeView(){return ti(NE)}});function Bl(n){return n==="left"||n==="right"||n==="center"?n:null}function IE(n){const e=(n.style.textAlign||"").trim().toLowerCase(),t=(n.getAttribute("align")||"").trim().toLowerCase();return Bl(e||t)}function OE(n){return Bl(n==null?void 0:n.align)}function R_(){return{default:null,parseHTML:n=>IE(n),renderHTML:n=>n.align?{style:`text-align: ${n.align}`}:{}}}var I_=xt.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:n=>{var e,t;const r=n.getAttribute("colwidth"),i=r?r.split(",").map(o=>parseInt(o,10)):null;if(!i){const o=(e=n.closest("table"))==null?void 0:e.querySelectorAll("colgroup > col"),s=Array.from(((t=n.parentElement)==null?void 0:t.children)||[]).indexOf(n);if(s&&s>-1&&o&&o[s]){const a=o[s].getAttribute("width");return a?[parseInt(a,10)]:null}}return i}},align:R_()}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:n}){return["td",$e(this.options.HTMLAttributes,n),0]}}),O_=xt.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:n=>{const e=n.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):null}},align:R_()}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:n}){return["th",$e(this.options.HTMLAttributes,n),0]}}),L_=xt.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:n}){return["tr",$e(this.options.HTMLAttributes,n),0]}});function K0(n,e){return e?["width",`${Math.max(e,n)}px`]:["min-width",`${n}px`]}function P_(n,e,t,r,i,o){var s;let a=0,l=!0,c=e.firstChild;const u=n.firstChild;if(u!==null)for(let m=0,b=0;m<u.childCount;m+=1){const{colspan:f,colwidth:y}=u.child(m).attrs;for(let w=0;w<f;w+=1,b+=1){const k=i===b?o:y&&y[w],E=k?`${k}px`:"";if(a+=k||r,k||(l=!1),c){if(c.style.width!==E){const[S,D]=K0(r,k);c.style.setProperty(S,D)}c=c.nextSibling}else{const S=document.createElement("col"),[D,R]=K0(r,k);S.style.setProperty(D,R),e.appendChild(S)}}}for(;c;){const m=c.nextSibling;(s=c.parentNode)==null||s.removeChild(c),c=m}const d=n.attrs.style&&typeof n.attrs.style=="string"&&/\bwidth\s*:/i.test(n.attrs.style);l&&!d?(t.style.width=`${a}px`,t.style.minWidth=""):(t.style.width="",t.style.minWidth=`${a}px`)}var LE=class{constructor(n,e){this.node=n,this.cellMinWidth=e,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),n.attrs.style&&(this.table.style.cssText=n.attrs.style),this.colgroup=this.table.appendChild(document.createElement("colgroup")),P_(n,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(n){return n.type!==this.node.type?!1:(this.node=n,P_(n,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(n){const e=n.target,t=this.dom.contains(e),r=this.contentDOM.contains(e);return!!(t&&!r&&(n.type==="attributes"||n.type==="childList"||n.type==="characterData"))}};function PE(n,e,t,r){let i=0,o=!0;const s=[],a=n.firstChild;if(!a)return{};for(let d=0,m=0;d<a.childCount;d+=1){const{colspan:b,colwidth:f}=a.child(d).attrs;for(let y=0;y<b;y+=1,m+=1){const w=t===m?r:f&&f[y];i+=w||e,w||(o=!1);const[k,E]=K0(e,w);s.push(["col",{style:`${k}: ${E}`}])}}const l=o?`${i}px`:"",c=o?"":`${i}px`;return{colgroup:["colgroup",{},...s],tableWidth:l,tableMinWidth:c}}function B_(n,e){return n.createAndFill()}function BE(n){if(n.cached.tableNodeTypes)return n.cached.tableNodeTypes;const e={};return Object.keys(n.nodes).forEach(t=>{const r=n.nodes[t];r.spec.tableRole&&(e[r.spec.tableRole]=r)}),n.cached.tableNodeTypes=e,e}function FE(n,e,t,r,i){const o=BE(n),s=[],a=[];for(let c=0;c<t;c+=1){const u=B_(o.cell);if(u&&a.push(u),r){const d=B_(o.header_cell);d&&s.push(d)}}const l=[];for(let c=0;c<e;c+=1)l.push(o.row.createChecked(null,r&&c===0?s:a));return o.table.createChecked(null,l)}function zE(n){return n instanceof ft}var Fl=({editor:n})=>{const{selection:e}=n.state;if(!zE(e))return!1;let t=0;const r=n1(e.ranges[0].$from,o=>o.type.name==="table");return r==null||r.node.descendants(o=>{if(o.type.name==="table")return!1;["tableCell","tableHeader"].includes(o.type.name)&&(t+=1)}),t===e.ranges.length?(n.commands.deleteTable(),!0):!1},qE="";function HE(n){return(n||"").replace(/\s+/g," ").trim()}function VE(n,e,t={}){var r;const i=(r=t.cellLineSeparator)!=null?r:qE;if(!n||!n.content||n.content.length===0)return"";const o=[];n.content.forEach(y=>{const w=[];y.content&&y.content.forEach(k=>{let E="";k.content&&Array.isArray(k.content)&&k.content.length>1?E=k.content.map(q=>e.renderChildren(q)).join(i):E=k.content?e.renderChildren(k.content):"";const S=HE(E),D=k.type==="tableHeader",R=OE(k.attrs);w.push({text:S,isHeader:D,align:R})}),o.push(w)});const s=o.reduce((y,w)=>Math.max(y,w.length),0);if(s===0)return"";const a=new Array(s).fill(0);o.forEach(y=>{var w;for(let k=0;k<s;k+=1){const S=(((w=y[k])==null?void 0:w.text)||"").length;S>a[k]&&(a[k]=S),a[k]<3&&(a[k]=3)}});const l=(y,w)=>y+" ".repeat(Math.max(0,w-y.length)),c=o[0],u=c.some(y=>y.isHeader),d=new Array(s).fill(null);o.forEach(y=>{var w;for(let k=0;k<s;k+=1)!d[k]&&((w=y[k])!=null&&w.align)&&(d[k]=y[k].align)});let m=`
|
|
145
148
|
`;const b=new Array(s).fill(0).map((y,w)=>u&&c[w]&&c[w].text||"");return m+=`| ${b.map((y,w)=>l(y,a[w])).join(" | ")} |
|
|
146
149
|
`,m+=`| ${a.map((y,w)=>{const k=Math.max(3,y),E=d[w];return E==="left"?`:${"-".repeat(k)}`:E==="right"?`${"-".repeat(k)}:`:E==="center"?`:${"-".repeat(k)}:`:"-".repeat(k)}).join(" | ")} |
|
|
147
150
|
`,(u?o.slice(1):o).forEach(y=>{m+=`| ${new Array(s).fill(0).map((w,k)=>l(y[k]&&y[k].text||"",a[k])).join(" | ")} |
|
|
@@ -429,7 +432,7 @@ M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},tt=function(){function A
|
|
|
429
432
|
|[ \r ]+
|
|
430
433
|
?)[ \r ]*`,ap="[̀-ͯ]",pP=new RegExp(ap+"+$"),mP="("+H3+"+)|"+(fP+"|")+"([!-\\[\\]-‧-豈-]"+(ap+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(ap+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+hP)+("|"+dP+")"),V3=function(){function A(p,g){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=p,this.settings=g,this.tokenRegex=new RegExp(mP,"g"),this.catcodes={"%":14,"~":13}}var h=A.prototype;return h.setCatcode=function(g,_){this.catcodes[g]=_},h.lex=function(){var g=this.input,_=this.tokenRegex.lastIndex;if(_===g.length)return new Yi("EOF",new Qn(this,_,_));var x=this.tokenRegex.exec(g);if(x===null||x.index!==_)throw new o("Unexpected character: '"+g[_]+"'",new Yi(g[_],new Qn(this,_,_+1)));var T=x[6]||x[3]||(x[2]?"\\ ":" ");if(this.catcodes[T]===14){var I=g.indexOf(`
|
|
431
434
|
`,this.tokenRegex.lastIndex);return I===-1?(this.tokenRegex.lastIndex=g.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=I+1,this.lex()}return new Yi(T,new Qn(this,_,this.tokenRegex.lastIndex))},A}(),gP=function(){function A(p,g){p===void 0&&(p={}),g===void 0&&(g={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=g,this.builtins=p,this.undefStack=[]}var h=A.prototype;return h.beginGroup=function(){this.undefStack.push({})},h.endGroup=function(){if(this.undefStack.length===0)throw new o("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var g=this.undefStack.pop();for(var _ in g)g.hasOwnProperty(_)&&(g[_]===void 0?delete this.current[_]:this.current[_]=g[_])},h.endGroups=function(){for(;this.undefStack.length>0;)this.endGroup()},h.has=function(g){return this.current.hasOwnProperty(g)||this.builtins.hasOwnProperty(g)},h.get=function(g){return this.current.hasOwnProperty(g)?this.current[g]:this.builtins[g]},h.set=function(g,_,x){if(x===void 0&&(x=!1),x){for(var T=0;T<this.undefStack.length;T++)delete this.undefStack[T][g];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][g]=_)}else{var I=this.undefStack[this.undefStack.length-1];I&&!I.hasOwnProperty(g)&&(I[g]=this.current[g])}this.current[g]=_},A}(),bP=N3,_P=bP;B("\\noexpand",function(A){var h=A.popToken();return A.isExpandable(h.text)&&(h.noexpand=!0,h.treatAsRelax=!0),{tokens:[h],numArgs:0}}),B("\\expandafter",function(A){var h=A.popToken();return A.expandOnce(!0),{tokens:[h],numArgs:0}}),B("\\@firstoftwo",function(A){var h=A.consumeArgs(2);return{tokens:h[0],numArgs:0}}),B("\\@secondoftwo",function(A){var h=A.consumeArgs(2);return{tokens:h[1],numArgs:0}}),B("\\@ifnextchar",function(A){var h=A.consumeArgs(3);A.consumeSpaces();var p=A.future();return h[0].length===1&&h[0][0].text===p.text?{tokens:h[1],numArgs:0}:{tokens:h[2],numArgs:0}}),B("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),B("\\TextOrMath",function(A){var h=A.consumeArgs(2);return A.mode==="text"?{tokens:h[0],numArgs:0}:{tokens:h[1],numArgs:0}});var U3={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};B("\\char",function(A){var h=A.popToken(),p,g="";if(h.text==="'")p=8,h=A.popToken();else if(h.text==='"')p=16,h=A.popToken();else if(h.text==="`")if(h=A.popToken(),h.text[0]==="\\")g=h.text.charCodeAt(1);else{if(h.text==="EOF")throw new o("\\char` missing argument");g=h.text.charCodeAt(0)}else p=10;if(p){if(g=U3[h.text],g==null||g>=p)throw new o("Invalid base-"+p+" digit "+h.text);for(var _;(_=U3[A.future().text])!=null&&_<p;)g*=p,g+=_,A.popToken()}return"\\@char{"+g+"}"});var lp=function(h,p,g){var _=h.consumeArg().tokens;if(_.length!==1)throw new o("\\newcommand's first argument must be a macro name");var x=_[0].text,T=h.isDefined(x);if(T&&!p)throw new o("\\newcommand{"+x+"} attempting to redefine "+(x+"; use \\renewcommand"));if(!T&&!g)throw new o("\\renewcommand{"+x+"} when command "+x+" does not yet exist; use \\newcommand");var I=0;if(_=h.consumeArg().tokens,_.length===1&&_[0].text==="["){for(var P="",z=h.expandNextToken();z.text!=="]"&&z.text!=="EOF";)P+=z.text,z=h.expandNextToken();if(!P.match(/^\s*[0-9]+\s*$/))throw new o("Invalid number of arguments: "+P);I=parseInt(P),_=h.consumeArg().tokens}return h.macros.set(x,{tokens:_,numArgs:I}),""};B("\\newcommand",function(A){return lp(A,!1,!0)}),B("\\renewcommand",function(A){return lp(A,!0,!1)}),B("\\providecommand",function(A){return lp(A,!0,!0)}),B("\\message",function(A){var h=A.consumeArgs(1)[0];return console.log(h.reverse().map(function(p){return p.text}).join("")),""}),B("\\errmessage",function(A){var h=A.consumeArgs(1)[0];return console.error(h.reverse().map(function(p){return p.text}).join("")),""}),B("\\show",function(A){var h=A.popToken(),p=h.text;return console.log(h,A.macros.get(p),pi[p],vt.math[p],vt.text[p]),""}),B("\\bgroup","{"),B("\\egroup","}"),B("~","\\nobreakspace"),B("\\lq","`"),B("\\rq","'"),B("\\aa","\\r a"),B("\\AA","\\r A"),B("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}"),B("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),B("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),B("ℬ","\\mathscr{B}"),B("ℰ","\\mathscr{E}"),B("ℱ","\\mathscr{F}"),B("ℋ","\\mathscr{H}"),B("ℐ","\\mathscr{I}"),B("ℒ","\\mathscr{L}"),B("ℳ","\\mathscr{M}"),B("ℛ","\\mathscr{R}"),B("ℭ","\\mathfrak{C}"),B("ℌ","\\mathfrak{H}"),B("ℨ","\\mathfrak{Z}"),B("\\Bbbk","\\Bbb{k}"),B("·","\\cdotp"),B("\\llap","\\mathllap{\\textrm{#1}}"),B("\\rlap","\\mathrlap{\\textrm{#1}}"),B("\\clap","\\mathclap{\\textrm{#1}}"),B("\\mathstrut","\\vphantom{(}"),B("\\underbar","\\underline{\\text{#1}}"),B("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}'),B("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),B("\\ne","\\neq"),B("≠","\\neq"),B("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),B("∉","\\notin"),B("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),B("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),B("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),B("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),B("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),B("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),B("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),B("⟂","\\perp"),B("‼","\\mathclose{!\\mkern-0.8mu!}"),B("∌","\\notni"),B("⌜","\\ulcorner"),B("⌝","\\urcorner"),B("⌞","\\llcorner"),B("⌟","\\lrcorner"),B("©","\\copyright"),B("®","\\textregistered"),B("️","\\textregistered"),B("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'),B("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'),B("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'),B("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'),B("\\vdots","\\mathord{\\varvdots\\rule{0pt}{15pt}}"),B("⋮","\\vdots"),B("\\varGamma","\\mathit{\\Gamma}"),B("\\varDelta","\\mathit{\\Delta}"),B("\\varTheta","\\mathit{\\Theta}"),B("\\varLambda","\\mathit{\\Lambda}"),B("\\varXi","\\mathit{\\Xi}"),B("\\varPi","\\mathit{\\Pi}"),B("\\varSigma","\\mathit{\\Sigma}"),B("\\varUpsilon","\\mathit{\\Upsilon}"),B("\\varPhi","\\mathit{\\Phi}"),B("\\varPsi","\\mathit{\\Psi}"),B("\\varOmega","\\mathit{\\Omega}"),B("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),B("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu"),B("\\boxed","\\fbox{$\\displaystyle{#1}$}"),B("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),B("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),B("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");var G3={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};B("\\dots",function(A){var h="\\dotso",p=A.expandAfterFuture().text;return p in G3?h=G3[p]:(p.substr(0,4)==="\\not"||p in vt.math&&k.contains(["bin","rel"],vt.math[p].group))&&(h="\\dotsb"),h});var cp={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};B("\\dotso",function(A){var h=A.future().text;return h in cp?"\\ldots\\,":"\\ldots"}),B("\\dotsc",function(A){var h=A.future().text;return h in cp&&h!==","?"\\ldots\\,":"\\ldots"}),B("\\cdots",function(A){var h=A.future().text;return h in cp?"\\@cdots\\,":"\\@cdots"}),B("\\dotsb","\\cdots"),B("\\dotsm","\\cdots"),B("\\dotsi","\\!\\cdots"),B("\\dotsx","\\ldots\\,"),B("\\DOTSI","\\relax"),B("\\DOTSB","\\relax"),B("\\DOTSX","\\relax"),B("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),B("\\,","\\tmspace+{3mu}{.1667em}"),B("\\thinspace","\\,"),B("\\>","\\mskip{4mu}"),B("\\:","\\tmspace+{4mu}{.2222em}"),B("\\medspace","\\:"),B("\\;","\\tmspace+{5mu}{.2777em}"),B("\\thickspace","\\;"),B("\\!","\\tmspace-{3mu}{.1667em}"),B("\\negthinspace","\\!"),B("\\negmedspace","\\tmspace-{4mu}{.2222em}"),B("\\negthickspace","\\tmspace-{5mu}{.277em}"),B("\\enspace","\\kern.5em "),B("\\enskip","\\hskip.5em\\relax"),B("\\quad","\\hskip1em\\relax"),B("\\qquad","\\hskip2em\\relax"),B("\\tag","\\@ifstar\\tag@literal\\tag@paren"),B("\\tag@paren","\\tag@literal{({#1})}"),B("\\tag@literal",function(A){if(A.macros.get("\\df@tag"))throw new o("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"}),B("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),B("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),B("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),B("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),B("\\pmb","\\html@mathml{\\@binrel{#1}{\\mathrlap{#1}\\kern0.5px#1}}{\\mathbf{#1}}"),B("\\newline","\\\\\\relax"),B("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var $3=On["Main-Regular"][84][1]-.7*On["Main-Regular"][65][1]+"em";B("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+$3+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}"),B("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+$3+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}"),B("\\hspace","\\@ifstar\\@hspacer\\@hspace"),B("\\@hspace","\\hskip #1\\relax"),B("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),B("\\ordinarycolon",":"),B("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),B("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),B("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),B("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),B("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),B("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),B("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),B("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),B("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),B("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),B("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),B("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),B("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),B("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),B("∷","\\dblcolon"),B("∹","\\eqcolon"),B("≔","\\coloneqq"),B("≕","\\eqqcolon"),B("⩴","\\Coloneqq"),B("\\ratio","\\vcentcolon"),B("\\coloncolon","\\dblcolon"),B("\\colonequals","\\coloneqq"),B("\\coloncolonequals","\\Coloneqq"),B("\\equalscolon","\\eqqcolon"),B("\\equalscoloncolon","\\Eqqcolon"),B("\\colonminus","\\coloneq"),B("\\coloncolonminus","\\Coloneq"),B("\\minuscolon","\\eqcolon"),B("\\minuscoloncolon","\\Eqcolon"),B("\\coloncolonapprox","\\Colonapprox"),B("\\coloncolonsim","\\Colonsim"),B("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),B("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),B("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),B("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),B("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),B("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),B("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),B("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),B("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),B("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),B("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),B("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),B("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),B("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}"),B("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}"),B("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}"),B("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}"),B("\\nleqq","\\html@mathml{\\@nleqq}{≰}"),B("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}"),B("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}"),B("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}"),B("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}"),B("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}"),B("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}"),B("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}"),B("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}"),B("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}"),B("\\imath","\\html@mathml{\\@imath}{ı}"),B("\\jmath","\\html@mathml{\\@jmath}{ȷ}"),B("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),B("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),B("⟦","\\llbracket"),B("⟧","\\rrbracket"),B("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),B("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),B("⦃","\\lBrace"),B("⦄","\\rBrace"),B("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),B("⦵","\\minuso"),B("\\darr","\\downarrow"),B("\\dArr","\\Downarrow"),B("\\Darr","\\Downarrow"),B("\\lang","\\langle"),B("\\rang","\\rangle"),B("\\uarr","\\uparrow"),B("\\uArr","\\Uparrow"),B("\\Uarr","\\Uparrow"),B("\\N","\\mathbb{N}"),B("\\R","\\mathbb{R}"),B("\\Z","\\mathbb{Z}"),B("\\alef","\\aleph"),B("\\alefsym","\\aleph"),B("\\Alpha","\\mathrm{A}"),B("\\Beta","\\mathrm{B}"),B("\\bull","\\bullet"),B("\\Chi","\\mathrm{X}"),B("\\clubs","\\clubsuit"),B("\\cnums","\\mathbb{C}"),B("\\Complex","\\mathbb{C}"),B("\\Dagger","\\ddagger"),B("\\diamonds","\\diamondsuit"),B("\\empty","\\emptyset"),B("\\Epsilon","\\mathrm{E}"),B("\\Eta","\\mathrm{H}"),B("\\exist","\\exists"),B("\\harr","\\leftrightarrow"),B("\\hArr","\\Leftrightarrow"),B("\\Harr","\\Leftrightarrow"),B("\\hearts","\\heartsuit"),B("\\image","\\Im"),B("\\infin","\\infty"),B("\\Iota","\\mathrm{I}"),B("\\isin","\\in"),B("\\Kappa","\\mathrm{K}"),B("\\larr","\\leftarrow"),B("\\lArr","\\Leftarrow"),B("\\Larr","\\Leftarrow"),B("\\lrarr","\\leftrightarrow"),B("\\lrArr","\\Leftrightarrow"),B("\\Lrarr","\\Leftrightarrow"),B("\\Mu","\\mathrm{M}"),B("\\natnums","\\mathbb{N}"),B("\\Nu","\\mathrm{N}"),B("\\Omicron","\\mathrm{O}"),B("\\plusmn","\\pm"),B("\\rarr","\\rightarrow"),B("\\rArr","\\Rightarrow"),B("\\Rarr","\\Rightarrow"),B("\\real","\\Re"),B("\\reals","\\mathbb{R}"),B("\\Reals","\\mathbb{R}"),B("\\Rho","\\mathrm{P}"),B("\\sdot","\\cdot"),B("\\sect","\\S"),B("\\spades","\\spadesuit"),B("\\sub","\\subset"),B("\\sube","\\subseteq"),B("\\supe","\\supseteq"),B("\\Tau","\\mathrm{T}"),B("\\thetasym","\\vartheta"),B("\\weierp","\\wp"),B("\\Zeta","\\mathrm{Z}"),B("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),B("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),B("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),B("\\bra","\\mathinner{\\langle{#1}|}"),B("\\ket","\\mathinner{|{#1}\\rangle}"),B("\\braket","\\mathinner{\\langle{#1}\\rangle}"),B("\\Bra","\\left\\langle#1\\right|"),B("\\Ket","\\left|#1\\right\\rangle"),B("\\angln","{\\angl n}"),B("\\blue","\\textcolor{##6495ed}{#1}"),B("\\orange","\\textcolor{##ffa500}{#1}"),B("\\pink","\\textcolor{##ff00af}{#1}"),B("\\red","\\textcolor{##df0030}{#1}"),B("\\green","\\textcolor{##28ae7b}{#1}"),B("\\gray","\\textcolor{gray}{#1}"),B("\\purple","\\textcolor{##9d38bd}{#1}"),B("\\blueA","\\textcolor{##ccfaff}{#1}"),B("\\blueB","\\textcolor{##80f6ff}{#1}"),B("\\blueC","\\textcolor{##63d9ea}{#1}"),B("\\blueD","\\textcolor{##11accd}{#1}"),B("\\blueE","\\textcolor{##0c7f99}{#1}"),B("\\tealA","\\textcolor{##94fff5}{#1}"),B("\\tealB","\\textcolor{##26edd5}{#1}"),B("\\tealC","\\textcolor{##01d1c1}{#1}"),B("\\tealD","\\textcolor{##01a995}{#1}"),B("\\tealE","\\textcolor{##208170}{#1}"),B("\\greenA","\\textcolor{##b6ffb0}{#1}"),B("\\greenB","\\textcolor{##8af281}{#1}"),B("\\greenC","\\textcolor{##74cf70}{#1}"),B("\\greenD","\\textcolor{##1fab54}{#1}"),B("\\greenE","\\textcolor{##0d923f}{#1}"),B("\\goldA","\\textcolor{##ffd0a9}{#1}"),B("\\goldB","\\textcolor{##ffbb71}{#1}"),B("\\goldC","\\textcolor{##ff9c39}{#1}"),B("\\goldD","\\textcolor{##e07d10}{#1}"),B("\\goldE","\\textcolor{##a75a05}{#1}"),B("\\redA","\\textcolor{##fca9a9}{#1}"),B("\\redB","\\textcolor{##ff8482}{#1}"),B("\\redC","\\textcolor{##f9685d}{#1}"),B("\\redD","\\textcolor{##e84d39}{#1}"),B("\\redE","\\textcolor{##bc2612}{#1}"),B("\\maroonA","\\textcolor{##ffbde0}{#1}"),B("\\maroonB","\\textcolor{##ff92c6}{#1}"),B("\\maroonC","\\textcolor{##ed5fa6}{#1}"),B("\\maroonD","\\textcolor{##ca337c}{#1}"),B("\\maroonE","\\textcolor{##9e034e}{#1}"),B("\\purpleA","\\textcolor{##ddd7ff}{#1}"),B("\\purpleB","\\textcolor{##c6b9fc}{#1}"),B("\\purpleC","\\textcolor{##aa87ff}{#1}"),B("\\purpleD","\\textcolor{##7854ab}{#1}"),B("\\purpleE","\\textcolor{##543b78}{#1}"),B("\\mintA","\\textcolor{##f5f9e8}{#1}"),B("\\mintB","\\textcolor{##edf2df}{#1}"),B("\\mintC","\\textcolor{##e0e5cc}{#1}"),B("\\grayA","\\textcolor{##f6f7f7}{#1}"),B("\\grayB","\\textcolor{##f0f1f2}{#1}"),B("\\grayC","\\textcolor{##e3e5e6}{#1}"),B("\\grayD","\\textcolor{##d6d8da}{#1}"),B("\\grayE","\\textcolor{##babec2}{#1}"),B("\\grayF","\\textcolor{##888d93}{#1}"),B("\\grayG","\\textcolor{##626569}{#1}"),B("\\grayH","\\textcolor{##3b3e40}{#1}"),B("\\grayI","\\textcolor{##21242c}{#1}"),B("\\kaBlue","\\textcolor{##314453}{#1}"),B("\\kaGreen","\\textcolor{##71B307}{#1}");var W3={"\\relax":!0,"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},yP=function(){function A(p,g,_){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=g,this.expansionCount=0,this.feed(p),this.macros=new gP(_P,g.macros),this.mode=_,this.stack=[]}var h=A.prototype;return h.feed=function(g){this.lexer=new V3(g,this.settings)},h.switchMode=function(g){this.mode=g},h.beginGroup=function(){this.macros.beginGroup()},h.endGroup=function(){this.macros.endGroup()},h.endGroups=function(){this.macros.endGroups()},h.future=function(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]},h.popToken=function(){return this.future(),this.stack.pop()},h.pushToken=function(g){this.stack.push(g)},h.pushTokens=function(g){var _;(_=this.stack).push.apply(_,g)},h.scanArgument=function(g){var _,x,T;if(g){if(this.consumeSpaces(),this.future().text!=="[")return null;_=this.popToken();var I=this.consumeArg(["]"]);T=I.tokens,x=I.end}else{var P=this.consumeArg();T=P.tokens,_=P.start,x=P.end}return this.pushToken(new Yi("EOF",x.loc)),this.pushTokens(T),_.range(x,"")},h.consumeSpaces=function(){for(;;){var g=this.future();if(g.text===" ")this.stack.pop();else break}},h.consumeArg=function(g){var _=[],x=g&&g.length>0;x||this.consumeSpaces();var T=this.future(),I,P=0,z=0;do{if(I=this.popToken(),_.push(I),I.text==="{")++P;else if(I.text==="}"){if(--P,P===-1)throw new o("Extra }",I)}else if(I.text==="EOF")throw new o("Unexpected end of input in a macro argument, expected '"+(g&&x?g[z]:"}")+"'",I);if(g&&x)if((P===0||P===1&&g[z]==="{")&&I.text===g[z]){if(++z,z===g.length){_.splice(-z,z);break}}else z=0}while(P!==0||x);return T.text==="{"&&_[_.length-1].text==="}"&&(_.pop(),_.shift()),_.reverse(),{tokens:_,start:T,end:I}},h.consumeArgs=function(g,_){if(_){if(_.length!==g+1)throw new o("The length of delimiters doesn't match the number of args!");for(var x=_[0],T=0;T<x.length;T++){var I=this.popToken();if(x[T]!==I.text)throw new o("Use of the macro doesn't match its definition",I)}}for(var P=[],z=0;z<g;z++)P.push(this.consumeArg(_&&_[z+1]).tokens);return P},h.expandOnce=function(g){var _=this.popToken(),x=_.text,T=_.noexpand?null:this._getExpansion(x);if(T==null||g&&T.unexpandable){if(g&&T==null&&x[0]==="\\"&&!this.isDefined(x))throw new o("Undefined control sequence: "+x);return this.pushToken(_),_}if(this.expansionCount++,this.expansionCount>this.settings.maxExpand)throw new o("Too many expansions: infinite loop or need to increase maxExpand setting");var I=T.tokens,P=this.consumeArgs(T.numArgs,T.delimiters);if(T.numArgs){I=I.slice();for(var z=I.length-1;z>=0;--z){var G=I[z];if(G.text==="#"){if(z===0)throw new o("Incomplete placeholder at end of macro body",G);if(G=I[--z],G.text==="#")I.splice(z+1,1);else if(/^[1-9]$/.test(G.text)){var Z;(Z=I).splice.apply(Z,[z,2].concat(P[+G.text-1]))}else throw new o("Not a valid argument number",G)}}}return this.pushTokens(I),I},h.expandAfterFuture=function(){return this.expandOnce(),this.future()},h.expandNextToken=function(){for(;;){var g=this.expandOnce();if(g instanceof Yi)if(g.text==="\\relax"||g.treatAsRelax)this.stack.pop();else return this.stack.pop()}throw new Error},h.expandMacro=function(g){return this.macros.has(g)?this.expandTokens([new Yi(g)]):void 0},h.expandTokens=function(g){var _=[],x=this.stack.length;for(this.pushTokens(g);this.stack.length>x;){var T=this.expandOnce(!0);T instanceof Yi&&(T.treatAsRelax&&(T.noexpand=!1,T.treatAsRelax=!1),_.push(this.stack.pop()))}return _},h.expandMacroAsText=function(g){var _=this.expandMacro(g);return _&&_.map(function(x){return x.text}).join("")},h._getExpansion=function(g){var _=this.macros.get(g);if(_==null)return _;if(g.length===1){var x=this.lexer.catcodes[g];if(x!=null&&x!==13)return}var T=typeof _=="function"?_(this):_;if(typeof T=="string"){var I=0;if(T.indexOf("#")!==-1)for(var P=T.replace(/##/g,"");P.indexOf("#"+(I+1))!==-1;)++I;for(var z=new V3(T,this.settings),G=[],Z=z.lex();Z.text!=="EOF";)G.push(Z),Z=z.lex();G.reverse();var oe={tokens:G,numArgs:I};return oe}return T},h.isDefined=function(g){return this.macros.has(g)||pi.hasOwnProperty(g)||vt.math.hasOwnProperty(g)||vt.text.hasOwnProperty(g)||W3.hasOwnProperty(g)},h.isExpandable=function(g){var _=this.macros.get(g);return _!=null?typeof _=="string"||typeof _=="function"||!_.unexpandable:pi.hasOwnProperty(g)&&!pi[g].primitive},A}(),up={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},K3={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"},j3=function(){function A(p,g){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new yP(p,g,this.mode),this.settings=g,this.leftrightDepth=0}var h=A.prototype;return h.expect=function(g,_){if(_===void 0&&(_=!0),this.fetch().text!==g)throw new o("Expected '"+g+"', got '"+this.fetch().text+"'",this.fetch());_&&this.consume()},h.consume=function(){this.nextToken=null},h.fetch=function(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken},h.switchMode=function(g){this.mode=g,this.gullet.switchMode(g)},h.parse=function(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var g=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),g}finally{this.gullet.endGroups()}},h.parseExpression=function(g,_){for(var x=[];;){this.mode==="math"&&this.consumeSpaces();var T=this.fetch();if(A.endOfExpression.indexOf(T.text)!==-1||_&&T.text===_||g&&pi[T.text]&&pi[T.text].infix)break;var I=this.parseAtom(_);if(I){if(I.type==="internal")continue}else break;x.push(I)}return this.mode==="text"&&this.formLigatures(x),this.handleInfixNodes(x)},h.handleInfixNodes=function(g){for(var _=-1,x,T=0;T<g.length;T++)if(g[T].type==="infix"){if(_!==-1)throw new o("only one infix operator per group",g[T].token);_=T,x=g[T].replaceWith}if(_!==-1&&x){var I,P,z=g.slice(0,_),G=g.slice(_+1);z.length===1&&z[0].type==="ordgroup"?I=z[0]:I={type:"ordgroup",mode:this.mode,body:z},G.length===1&&G[0].type==="ordgroup"?P=G[0]:P={type:"ordgroup",mode:this.mode,body:G};var Z;return x==="\\\\abovefrac"?Z=this.callFunction(x,[I,g[_],P],[]):Z=this.callFunction(x,[I,P],[]),[Z]}else return g},h.handleSupSubscript=function(g){var _=this.fetch(),x=_.text;this.consume(),this.consumeSpaces();var T=this.parseGroup(g);if(!T)throw new o("Expected group after '"+x+"'",_);return T},h.formatUnsupportedCmd=function(g){for(var _=[],x=0;x<g.length;x++)_.push({type:"textord",mode:"text",text:g[x]});var T={type:"text",mode:this.mode,body:_},I={type:"color",mode:this.mode,color:this.settings.errorColor,body:[T]};return I},h.parseAtom=function(g){var _=this.parseGroup("atom",g);if(this.mode==="text")return _;for(var x,T;;){this.consumeSpaces();var I=this.fetch();if(I.text==="\\limits"||I.text==="\\nolimits"){if(_&&_.type==="op"){var P=I.text==="\\limits";_.limits=P,_.alwaysHandleSupSub=!0}else if(_&&_.type==="operatorname")_.alwaysHandleSupSub&&(_.limits=I.text==="\\limits");else throw new o("Limit controls must follow a math operator",I);this.consume()}else if(I.text==="^"){if(x)throw new o("Double superscript",I);x=this.handleSupSubscript("superscript")}else if(I.text==="_"){if(T)throw new o("Double subscript",I);T=this.handleSupSubscript("subscript")}else if(I.text==="'"){if(x)throw new o("Double superscript",I);var z={type:"textord",mode:this.mode,text:"\\prime"},G=[z];for(this.consume();this.fetch().text==="'";)G.push(z),this.consume();this.fetch().text==="^"&&G.push(this.handleSupSubscript("superscript")),x={type:"ordgroup",mode:this.mode,body:G}}else break}return x||T?{type:"supsub",mode:this.mode,base:_,sup:x,sub:T}:_},h.parseFunction=function(g,_){var x=this.fetch(),T=x.text,I=pi[T];if(!I)return null;if(this.consume(),_&&_!=="atom"&&!I.allowedInArgument)throw new o("Got function '"+T+"' with no arguments"+(_?" as "+_:""),x);if(this.mode==="text"&&!I.allowedInText)throw new o("Can't use function '"+T+"' in text mode",x);if(this.mode==="math"&&I.allowedInMath===!1)throw new o("Can't use function '"+T+"' in math mode",x);var P=this.parseArguments(T,I),z=P.args,G=P.optArgs;return this.callFunction(T,z,G,x,g)},h.callFunction=function(g,_,x,T,I){var P={funcName:g,parser:this,token:T,breakOnTokenText:I},z=pi[g];if(z&&z.handler)return z.handler(P,_,x);throw new o("No function handler for "+g)},h.parseArguments=function(g,_){var x=_.numArgs+_.numOptionalArgs;if(x===0)return{args:[],optArgs:[]};for(var T=[],I=[],P=0;P<x;P++){var z=_.argTypes&&_.argTypes[P],G=P<_.numOptionalArgs;(_.primitive&&z==null||_.type==="sqrt"&&P===1&&I[0]==null)&&(z="primitive");var Z=this.parseGroupOfType("argument to '"+g+"'",z,G);if(G)I.push(Z);else if(Z!=null)T.push(Z);else throw new o("Null argument, please report this as a bug")}return{args:T,optArgs:I}},h.parseGroupOfType=function(g,_,x){switch(_){case"color":return this.parseColorGroup(x);case"size":return this.parseSizeGroup(x);case"url":return this.parseUrlGroup(x);case"math":case"text":return this.parseArgumentGroup(x,_);case"hbox":{var T=this.parseArgumentGroup(x,"text");return T!=null?{type:"styling",mode:T.mode,body:[T],style:"text"}:null}case"raw":{var I=this.parseStringGroup("raw",x);return I!=null?{type:"raw",mode:"text",string:I.text}:null}case"primitive":{if(x)throw new o("A primitive argument cannot be optional");var P=this.parseGroup(g);if(P==null)throw new o("Expected group as "+g,this.fetch());return P}case"original":case null:case void 0:return this.parseArgumentGroup(x);default:throw new o("Unknown group type as "+g,this.fetch())}},h.consumeSpaces=function(){for(;this.fetch().text===" ";)this.consume()},h.parseStringGroup=function(g,_){var x=this.gullet.scanArgument(_);if(x==null)return null;for(var T="",I;(I=this.fetch()).text!=="EOF";)T+=I.text,this.consume();return this.consume(),x.text=T,x},h.parseRegexGroup=function(g,_){for(var x=this.fetch(),T=x,I="",P;(P=this.fetch()).text!=="EOF"&&g.test(I+P.text);)T=P,I+=T.text,this.consume();if(I==="")throw new o("Invalid "+_+": '"+x.text+"'",x);return x.range(T,I)},h.parseColorGroup=function(g){var _=this.parseStringGroup("color",g);if(_==null)return null;var x=/^(#[a-f0-9]{3}|#?[a-f0-9]{6}|[a-z]+)$/i.exec(_.text);if(!x)throw new o("Invalid color: '"+_.text+"'",_);var T=x[0];return/^[0-9a-f]{6}$/i.test(T)&&(T="#"+T),{type:"color-token",mode:this.mode,color:T}},h.parseSizeGroup=function(g){var _,x=!1;if(this.gullet.consumeSpaces(),!g&&this.gullet.future().text!=="{"?_=this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size"):_=this.parseStringGroup("size",g),!_)return null;!g&&_.text.length===0&&(_.text="0pt",x=!0);var T=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(_.text);if(!T)throw new o("Invalid size: '"+_.text+"'",_);var I={number:+(T[1]+T[2]),unit:T[3]};if(!on(I))throw new o("Invalid unit: '"+I.unit+"'",_);return{type:"size",mode:this.mode,value:I,isBlank:x}},h.parseUrlGroup=function(g){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var _=this.parseStringGroup("url",g);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),_==null)return null;var x=_.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:x}},h.parseArgumentGroup=function(g,_){var x=this.gullet.scanArgument(g);if(x==null)return null;var T=this.mode;_&&this.switchMode(_),this.gullet.beginGroup();var I=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var P={type:"ordgroup",mode:this.mode,loc:x.loc,body:I};return _&&this.switchMode(T),P},h.parseGroup=function(g,_){var x=this.fetch(),T=x.text,I;if(T==="{"||T==="\\begingroup"){this.consume();var P=T==="{"?"}":"\\endgroup";this.gullet.beginGroup();var z=this.parseExpression(!1,P),G=this.fetch();this.expect(P),this.gullet.endGroup(),I={type:"ordgroup",mode:this.mode,loc:Qn.range(x,G),body:z,semisimple:T==="\\begingroup"||void 0}}else if(I=this.parseFunction(_,g)||this.parseSymbol(),I==null&&T[0]==="\\"&&!W3.hasOwnProperty(T)){if(this.settings.throwOnError)throw new o("Undefined control sequence: "+T,x);I=this.formatUnsupportedCmd(T),this.consume()}return I},h.formLigatures=function(g){for(var _=g.length-1,x=0;x<_;++x){var T=g[x],I=T.text;I==="-"&&g[x+1].text==="-"&&(x+1<_&&g[x+2].text==="-"?(g.splice(x,3,{type:"textord",mode:"text",loc:Qn.range(T,g[x+2]),text:"---"}),_-=2):(g.splice(x,2,{type:"textord",mode:"text",loc:Qn.range(T,g[x+1]),text:"--"}),_-=1)),(I==="'"||I==="`")&&g[x+1].text===I&&(g.splice(x,2,{type:"textord",mode:"text",loc:Qn.range(T,g[x+1]),text:I+I}),_-=1)}},h.parseSymbol=function(){var g=this.fetch(),_=g.text;if(/^\\verb[^a-zA-Z]/.test(_)){this.consume();var x=_.slice(5),T=x.charAt(0)==="*";if(T&&(x=x.slice(1)),x.length<2||x.charAt(0)!==x.slice(-1))throw new o(`\\verb assertion failed --
|
|
432
|
-
please report what input caused this bug`);return x=x.slice(1,-1),{type:"verb",mode:"text",body:x,star:T}}K3.hasOwnProperty(_[0])&&!vt[this.mode][_[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+_[0]+'" used in math mode',g),_=K3[_[0]]+_.substr(1));var I=pP.exec(_);I&&(_=_.substring(0,I.index),_==="i"?_="ı":_==="j"&&(_="ȷ"));var P;if(vt[this.mode][_]){this.settings.strict&&this.mode==="math"&&Io.indexOf(_)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+_[0]+'" used in math mode',g);var z=vt[this.mode][_].group,G=Qn.range(g),Z;if(Nf.hasOwnProperty(z)){var oe=z;Z={type:"atom",mode:this.mode,family:oe,loc:G,text:_}}else Z={type:z,mode:this.mode,loc:G,text:_};P=Z}else if(_.charCodeAt(0)>=128)this.settings.strict&&(Ce(_.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+_[0]+'" used in math mode',g):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+_[0]+'"'+(" ("+_.charCodeAt(0)+")"),g)),P={type:"textord",mode:"text",loc:Qn.range(g),text:_};else return null;if(this.consume(),I)for(var ae=0;ae<I[0].length;ae++){var le=I[0][ae];if(!up[le])throw new o("Unknown accent ' "+le+"'",g);var ge=up[le][this.mode]||up[le].text;if(!ge)throw new o("Accent "+le+" unsupported in "+this.mode+" mode",g);P={type:"accent",mode:this.mode,loc:Qn.range(g),label:ge,isStretchy:!1,isShifty:!0,base:P}}return P},A}();j3.endOfExpression=["}","\\endgroup","\\end","\\right","&"];var vP=function(h,p){if(!(typeof h=="string"||h instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var g=new j3(h,p);delete g.gullet.macros.current["\\df@tag"];var _=g.parse();if(delete g.gullet.macros.current["\\current@color"],delete g.gullet.macros.current["\\color"],g.gullet.macros.get("\\df@tag")){if(!p.displayMode)throw new o("\\tag works only in display equations");g.gullet.feed("\\df@tag"),_=[{type:"tag",mode:"text",body:_,tag:g.parse()}]}return _},dp=vP,Q3=function(h,p,g){p.textContent="";var _=hp(h,g).toNode();p.appendChild(_)};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),Q3=function(){throw new o("KaTeX doesn't work in quirks mode.")});var wP=function(h,p){var g=hp(h,p).toMarkup();return g},xP=function(h,p){var g=new E(p);return dp(h,g)},Y3=function(h,p,g){if(g.throwOnError||!(h instanceof o))throw h;var _=K.makeSpan(["katex-error"],[new cn(p)]);return _.setAttribute("title",h.toString()),_.setAttribute("style","color:"+g.errorColor),_},hp=function(h,p){var g=new E(p);try{var _=dp(h,g);return TL(_,h,g)}catch(x){return Y3(x,h,g)}},kP=function(h,p){var g=new E(p);try{var _=dp(h,g);return AL(_,h,g)}catch(x){return Y3(x,h,g)}},SP={version:"0.13.18",render:Q3,renderToString:wP,ParseError:o,__parse:xP,__renderToDomTree:hp,__renderToHTMLTree:kP,__setFontMetrics:Af,__defineSymbol:C,__defineMacro:B,__domTree:{Span:$i,Anchor:Eo,SymbolNode:cn,SvgNode:tn,PathNode:lr,LineNode:cr}},CP=SP;return r=r.default,r}()})}(tc)),tc.exports}var sN=oN();const Vv=or(sN),aN={components:{NodeViewWrapper:Mi},props:{editor:{type:Object},node:{type:Object},decorations:{type:Array},selected:{type:Boolean},extension:{type:Object},getPos:{type:Function},updateAttributes:{type:Function},deleteNode:{type:Function}},data(){return{left:0,top:100,thisValue:this.node.attrs.value,showPopper:!1,equationString:"",errorMsg:"",active:!1,outsideEvent:n=>{if(!this.showPopper)return 0;let e=n.target,t=!1;for(;e&&e.tagName&&e.tagName.toLowerCase()!="body";){if(e==this.$el){t=!0;break}e=e.parentNode}t||this.close(!1)},thisTheme:this.editor.storage.defaultStorage.theme,thisForeground:this.editor.storage.defaultStorage.foreground,getTitle:this.editor.storage.defaultStorage.getTitle,inputHight:"",lock:!1}},watch:{showPopper(n){n&&(this.showPos(),this.$nextTick(()=>{this.$refs.input&&(this.inputHight=this.$refs.input.scrollHeight)}))},thisValue(n){n===""?(this.equationString="",this.lock=!1):this.render(),this.$nextTick(()=>{this.$refs.input&&(this.inputHight=this.$refs.input.scrollHeight)})},"editor.storage.defaultStorage.theme"(n){this.thisTheme=n},"editor.storage.defaultStorage.foreground"(n){this.thisForeground=n},selected(n){n&&this.isCurrentNodeSelection()&&this.show()}},computed:{focusForeground(){try{let n=ec(this.thisForeground);return n=n.alpha(.3),n.cssa()}catch{return""}}},mounted(){this.outSideClickInit(),this.render(),this.$nextTick(()=>{this.node.attrs.value===""&&this.show()})},methods:{outSideClickInit(){window.addEventListener("click",this.outsideEvent)},render(){try{this.equationString=Vv.renderToString(this.thisValue.replace(/\\tag\{.*?\}/g,""),{throwOnError:!0,globalGroup:"my-katex-"}),this.lock=!1}catch(n){if(n instanceof Vv.ParseError)this.errorMsg=("Error in LaTeX '"+this.thisValue+"': "+n.message).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");else throw n;this.lock=!0}},showPos(){this.$nextTick(()=>{let n=this.$refs.target,e=n.getBoundingClientRect().bottom,t=n.getBoundingClientRect().left;e<50?this.top=-100:this.top=100,t+300>document.body.clientWidth?this.left=document.body-300-t:this.left=0})},show(){this.editor.isEditable&&(this.showPopper=!0,setTimeout(()=>{this.$refs.input&&this.$refs.input.focus()},300))},isCurrentNodeSelection(){const{selection:n}=this.editor.state;return n instanceof Te&&n.from===this.getPos()},close(n=!0){this.showPopper=!1,n?this.updateAttributes({value:this.thisValue}):this.thisValue=this.node.attrs.value,this.editor.commands.focus();const{tr:e}=this.editor.view.state;let t=null;this.$refs.input.selectionEnd===0?t=Ee.near(e.doc.resolve(this.getPos())):t=Ee.near(e.doc.resolve(this.getPos()+this.node.nodeSize-1)),e.setSelection(t),this.editor.view.dispatch(e)},closeWithLeftRight(n){let e=this.$refs.input.selectionStart,t=this.$refs.input.selectionEnd;e===t&&(n.key==="ArrowLeft"&&e===0&&this.close(!1),n.key==="ArrowRight"&&e===this.$refs.input.value.length&&this.close(!1),n.key==="ArrowUp"&&e===0&&this.close(!1),n.key==="ArrowDown"&&e===this.$refs.input.value.length&&this.close(!1))}},beforeUnmount(){window.removeEventListener("click",this.outsideEvent)}},lN=["placeholder"],cN=["placeholder","innerHTML"];function uN(n,e,t,r,i,o){const s=v.resolveComponent("fv-button"),a=v.resolveComponent("node-view-wrapper");return t.node?(v.openBlock(),v.createBlock(a,{key:0,as:t.node.attrs.tag,class:v.normalizeClass(["power-editor-equation-container",{dark:i.thisTheme==="dark",div:t.node.attrs.tag=="div",selected:t.selected}]),style:v.normalizeStyle({"--selected-bg":o.focusForeground})},{default:v.withCtx(()=>[v.createVNode(v.Transition,{name:"power-editor-equation-popper-fade"},{default:v.withCtx(()=>[v.withDirectives(v.createElementVNode("div",{class:"power-editor-equation-popper-container",style:v.normalizeStyle({left:`${i.left}px`,top:`${i.top}%`}),onKeyup:e[3]||(e[3]=v.withKeys(l=>i.lock?"":o.close(),["enter"]))},[v.withDirectives(v.createElementVNode("textarea",{"onUpdate:modelValue":e[0]||(e[0]=l=>i.thisValue=l),class:"power-editor-equation-popper-input",placeholder:t.node.attrs.placeholder,ref:"input",style:v.normalizeStyle({height:`${i.inputHight}px`}),onKeydown:[e[1]||(e[1]=v.withKeys(l=>l.preventDefault(),["enter"])),e[2]||(e[2]=l=>o.closeWithLeftRight(l))]},null,44,lN),[[v.vModelText,i.thisValue]]),v.createVNode(s,{class:"power-editor-equation-popper-btn",theme:"dark",disabled:i.lock,icon:"AcceptMedium",background:i.thisForeground,"is-box-shadow":!0,onClick:o.close},{default:v.withCtx(()=>[v.createTextVNode(v.toDisplayString(i.getTitle("Done")),1)]),_:1},8,["disabled","background","onClick"])],36),[[v.vShow,i.showPopper]])]),_:1}),t.node.attrs.tag=="div"?(v.openBlock(),v.createElementBlock("div",{key:0,draggable:"true","data-drag-handle":"",class:"power-editor-equation-drag-btn",onMousedown:e[4]||(e[4]=l=>i.active=!0),onMouseup:e[5]||(e[5]=l=>i.active=!1),onTouchstart:e[6]||(e[6]=l=>i.active=!0),onTouchend:e[7]||(e[7]=l=>i.active=!1)},e[9]||(e[9]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--GripperDotsVertical"},null,-1)]),32)):v.createCommentVNode("",!0),v.createElementVNode("span",{class:v.normalizeClass(["power-editor-equation-target",{empty:i.thisValue===""}]),placeholder:t.node.attrs.emptyPlaceholder,innerHTML:i.thisValue===""?t.node.attrs.emptyPlaceholder:i.equationString,ref:"target",style:v.normalizeStyle({color:`${i.lock?"red":""}`,"--selected-bg":o.focusForeground}),onClick:e[8]||(e[8]=(...l)=>o.show&&o.show(...l))},null,14,cN)]),_:1},8,["as","class","style"])):v.createCommentVNode("",!0)}const Uv=Gt(aN,[["render",uN]]),dN=/(\$\s|\\\(\s)$/,hN=/(\$|\\\()(.+?)(\$|\\\))/g,fN=xt.create({name:"inlineEquation",group:"inline",inline:!0,draggable:!0,addAttributes(){return{value:{default:""},tag:{default:"span"},placeholder:{default:"Y=WX^T+b"},emptyPlaceholder:{default:"New Equation"},showPopper:{default:!1}}},parseHTML(){return[{tag:"inline-equation"}]},renderHTML({HTMLAttributes:n}){return["inline-equation",$e(n)]},addNodeView(){return ti(Uv)},addInputRules(){return[qa({find:dN,type:this.type,getAttributes:()=>({theme:this.editor.storage.defaultStorage.theme})})]},addPasteRules(){return[Jl({find:hN,type:this.type,getAttributes:n=>({value:n[2],theme:this.editor.storage.defaultStorage.theme})})]},addKeyboardShortcuts(){return{"Alt-=":()=>{let n=this.editor.view.state,e=this.editor.view.state.selection,t=n.doc.textBetween(e.from,e.to," "),r=!0;if(t=t.trim(),t.startsWith("$$")&&t.endsWith("$$")?(t=t.slice(2,-2),r=!1):t.startsWith("$")&&t.endsWith("$")?t=t.slice(1,-1):t.startsWith("\\(")&&t.endsWith("\\)")?t=t.slice(2,-2):t.startsWith("\\[")&&t.endsWith("\\]")&&(t=t.slice(2,-2),r=!1),t=t.trim(),t.length>0)return r?this.editor.chain().focus().insertContent(`<inline-equation theme="${this.editor.storage.defaultStorage.theme}" value="${t}"></inline-equation>`).run():this.editor.chain().focus().insertContent(`<equation-block theme="${this.editor.storage.defaultStorage.theme}" value="${t}"></equation-block><p></p>`).run()}}}}),pN=/(\${2}\s|\\\[\s)$/,mN=/(\s*\${2}|\\\[)([\s\S]+?)(\${2}|\\\])/g,gN=xt.create({name:"equationBlock",group:"block",atom:!0,draggable:!0,addAttributes(){return{value:{default:""},tag:{default:"div"},placeholder:{default:"Y=WX^T+b"},emptyPlaceholder:{default:"New Equation"},showPopper:{default:!1}}},parseHTML(){return[{tag:"equation-block"}]},renderHTML({HTMLAttributes:n}){return["equation-block",$e(n)]},addNodeView(){return ti(Uv)},addInputRules(){return[qa({find:pN,type:this.type,getAttributes:()=>({theme:this.editor.storage.defaultStorage.theme})})]},addPasteRules(){return[Jl({find:mN,type:this.type,getAttributes:n=>({value:n[2],theme:this.editor.storage.defaultStorage.theme})})]}}),bN={components:{NodeViewWrapper:Mi},props:{editor:{type:Object},node:{type:Object},decorations:{type:Array},selected:{type:Boolean},extension:{type:Object},getPos:{type:Function},updateAttributes:{type:Function},deleteNode:{type:Function}},data(){return{left:0,top:100,showPopper:!1,outsideEvent:n=>{if(!this.showPopper)return 0;let e=n.target,t=!1;for(;e&&e.tagName&&e.tagName.toLowerCase()!="body";){if(e==this.$el){t=!0;break}e=e.parentNode}t||this.close()},filterItems:[],loading:!1,thisTheme:this.editor.storage.defaultStorage.theme,thisForeground:this.editor.storage.defaultStorage.mentionItemTools.headerForeground()}},watch:{showPopper(n){n&&this.$nextTick(()=>{this.showPos()})},"node.attrs.value"(){this.delRecover(),this.getFilterItems()},"editor.storage.defaultStorage.theme"(n){this.thisTheme=n},"editor.storage.defaultStorage.mentionItemTools.headerForeground"(){this.thisForeground=this.editor.storage.defaultStorage.mentionItemTools.headerForeground()}},computed:{focusForeground(){try{let n=ec(this.thisForeground);return n=n.alpha(.2),n.cssa()}catch{return""}},hoverForeground(){try{let n=ec(this.thisForeground);return n=n.alpha(.3),n.cssa()}catch{return""}},activeForeground(){try{let n=ec(this.thisForeground);return n=n.alpha(.4),n.cssa()}catch{return""}}},mounted(){this.outSideClickInit(),this.windowEventInit(),setTimeout(()=>{this.node.attrs.freeze||(this.show(),this.$refs.target.focus(),this.$refs.list.setFocus())},300),this.getFilterItems()},methods:{outSideClickInit(){window.addEventListener("click",this.outsideEvent)},windowEventInit(){window.addEventListener("scroll",this.showPos),this.editor.storage.defaultStorage.editorContainer.addEventListener("scroll",this.showPos)},showPos(){let n=this.$refs.target;if(!n||!n.getBoundingClientRect)return;const{left:e,top:t}=n.getBoundingClientRect();window.innerWidth-e<260?this.left=window.innerWidth-260:this.left=e-20,window.innerHeight-t<300?this.top=window.innerHeight-300:this.top=t+30},show(){this.editor.isEditable&&(this.showPopper=!0,setTimeout(()=>{this.$refs.target.focus()},300))},async getFilterItems(){this.loading=!0;let n=[],e=await this.editor.storage.defaultStorage.mentionItemTools.mentionList(this.node.attrs.value);for(let t of e)await this.editor.storage.defaultStorage.mentionItemTools.filterFunc(t,this.node.attrs.value)&&n.push(t);this.filterItems=n,this.loading=!1},chooseItem(n){this.updateAttributes({value:n.item.name,currentItem:n.item,freeze:!0}),this.editor.storage.defaultStorage.mentionItemTools.chooseItemCallback(n.item,this.node.attrs.value),this.close()},valueTrigger(n){return typeof n=="function"?n():n},delRecover(){this.node.attrs.value===""&&(this.deleteNode(),this.editor.commands.focus(),this.editor.commands.insertContent("@"))},skipNode(n){n.preventDefault(),this.editor.commands.focus()},close(){this.showPopper=!1,this.$refs.list.setBlur(),this.editor.commands.focus()},closeWithoutSelection(){this.close();const{tr:n}=this.editor.view.state;let e=null;this.$refs.target.selectionEnd===0?e=Ee.near(n.doc.resolve(this.getPos())):e=Ee.near(n.doc.resolve(this.getPos()+this.node.nodeSize-1)),n.setSelection(e),this.editor.view.dispatch(n),this.updateAttributes({freeze:!0})},closeWithLeftRight(n){if(!this.$refs.target)return;let e=this.$refs.target.selectionStart,t=this.$refs.target.selectionEnd;e===t&&(n.key==="ArrowLeft"&&e===0&&this.closeWithoutSelection(),n.key==="ArrowRight"&&e===this.$refs.target.value.length&&this.closeWithoutSelection())}},beforeUnmount(){window.removeEventListener("click",this.outsideEvent),window.removeEventListener("scroll",this.showPos),this.editor.storage.defaultStorage.editorContainer.removeEventListener("scroll",this.showPos)}},_N={class:"power-editor-mention-popper-list-loading-block"},yN=["src"],vN={key:0,class:"power-editor-mention-icon"},wN=["src"],xN=["placeholder","readonly","title"],kN=["title"];function SN(n,e,t,r,i,o){const s=v.resolveComponent("fv-progressRing"),a=v.resolveComponent("fv-list-view"),l=v.resolveComponent("node-view-wrapper");return t.node?(v.openBlock(),v.createBlock(l,{key:0,as:"span",class:v.normalizeClass(["power-editor-mention-container",{dark:i.thisTheme==="dark",selected:t.selected,showing:i.showPopper&&i.filterItems.length>0}]),style:v.normalizeStyle({"--selected-bg":o.focusForeground,"--selected-bg-hover":o.hoverForeground,"--selected-bg-active":o.activeForeground})},{default:v.withCtx(()=>[v.createVNode(v.Transition,{name:"power-editor-mention-popper-fade"},{default:v.withCtx(()=>[v.withDirectives(v.createElementVNode("div",{class:"power-editor-mention-popper-container",style:v.normalizeStyle({left:`${i.left}px`,top:`${i.top}px`})},[v.withDirectives(v.createElementVNode("div",_N,[v.createVNode(s,{loading:"true",r:"10",borderWidth:"2",foreground:i.thisForeground,background:"white"},null,8,["foreground"])],512),[[v.vShow,i.loading]]),v.createVNode(a,{modelValue:i.filterItems,theme:i.thisTheme,class:"power-editor-mention-popper-list-view",ref:"list",itemBorderRadius:"6",itemBorderWidth:1,itemBorderColor:"rgba(120, 120, 120, 0.1)",rowHeight:30,onChooseItem:o.chooseItem},{listItem:v.withCtx(c=>[c.item.image?(v.openBlock(),v.createElementBlock("img",{key:0,class:v.normalizeClass(["power-editor-mention-img",[{avatar:c.item.avatarImg}]]),src:c.valueTrigger(c.item.image),alt:"",style:v.normalizeStyle({width:`${c.item.imageWidth||"auto"}`})},null,14,yN)):v.createCommentVNode("",!0),c.item.icon?(v.openBlock(),v.createElementBlock("i",{key:1,class:v.normalizeClass(["ms-Icon",[`ms-Icon--${c.valueTrigger(c.item.icon)}`]]),style:v.normalizeStyle([{color:c.valueTrigger(c.item.iconColor)},{"margin-right":"15px"}])},null,6)):v.createCommentVNode("",!0),v.createElementVNode("p",{style:v.normalizeStyle([{color:c.valueTrigger(c.item.type)=="header"?i.thisForeground:c.item.color},{flex:"1","font-size":"12px"}])},v.toDisplayString(c.valueTrigger(c.item.name)),5)]),_:1},8,["modelValue","theme","onChooseItem"])],4),[[v.vShow,i.showPopper&&i.filterItems.length>0]])]),_:1}),v.createElementVNode("span",{class:"power-editor-mention-display-block",onClick:e[4]||(e[4]=c=>t.editor.storage.defaultStorage.mentionItemTools.mentionClickCallback(t.node.attrs.currentItem,t.node.attrs.value))},[!t.node.attrs.currentItem.image&&!t.node.attrs.currentItem.icon?(v.openBlock(),v.createElementBlock("p",vN,e[5]||(e[5]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--Accounts"},null,-1)]))):v.createCommentVNode("",!0),t.node.attrs.currentItem.image?(v.openBlock(),v.createElementBlock("img",{key:1,src:o.valueTrigger(t.node.attrs.currentItem.image),alt:"",class:"power-editor-mention-rendered-img",style:{height:"15px"}},null,8,wN)):v.createCommentVNode("",!0),t.node.attrs.currentItem.icon?(v.openBlock(),v.createElementBlock("i",{key:2,class:v.normalizeClass(["ms-Icon power-editor-mention-icon",[`ms-Icon--${o.valueTrigger(t.node.attrs.currentItem.icon)}`]]),style:v.normalizeStyle({color:o.valueTrigger(t.node.attrs.currentItem.iconColor)})},null,6)):v.createCommentVNode("",!0),v.withDirectives(v.createElementVNode("input",{"onUpdate:modelValue":e[0]||(e[0]=c=>t.node.attrs.value=c),class:v.normalizeClass(["power-editor-mention-input",[{freeze:t.node.attrs.freeze}]]),placeholder:t.node.attrs.placeholder,readonly:t.node.attrs.freeze,ref:"target",title:t.node.attrs.value,style:v.normalizeStyle({color:t.node.attrs.currentItem.color}),onKeydown:[e[1]||(e[1]=v.withKeys((...c)=>o.delRecover&&o.delRecover(...c),["backspace"])),e[2]||(e[2]=v.withKeys((...c)=>o.skipNode&&o.skipNode(...c),["tab"])),e[3]||(e[3]=c=>o.closeWithLeftRight(c))]},null,46,xN),[[v.vShow,!t.node.attrs.freeze],[v.vModelText,t.node.attrs.value]]),v.createElementVNode("p",{title:t.node.attrs.value,class:v.normalizeClass(["power-editor-mention-placeholder",[{show:t.node.attrs.freeze}]]),style:v.normalizeStyle({color:t.node.attrs.currentItem.color})},v.toDisplayString(t.node.attrs.value?t.node.attrs.value:t.node.attrs.placeholder),15,kN)])]),_:1},8,["class","style"])):v.createCommentVNode("",!0)}const CN=Gt(bN,[["render",SN]]),EN=/(@)$/,TN=xt.create({name:"mentionItem",group:"inline",inline:!0,draggable:!0,addAttributes(){return{value:{default:""},currentItem:{default:()=>({}),parseHTML:n=>{const e=n.getAttribute("data-current-item");if(!e||e==="[object Object]")return{};try{return JSON.parse(e)}catch{return{}}},renderHTML:n=>{const e=n.currentItem;return!e||typeof e!="object"||Array.isArray(e)||Object.keys(e).length===0?{}:{"data-current-item":JSON.stringify(e)}}},placeholder:{default:"mention"},freeze:{default:!1},showPopper:{default:!1}}},parseHTML(){return[{tag:"mention-item"}]},renderHTML({HTMLAttributes:n}){return["mention-item",$e(n)]},addNodeView(){return ti(CN)},addInputRules(){return[qa({find:EN,type:this.type,getAttributes:()=>({theme:this.editor.storage.defaultStorage.theme})})]}});var AN={value:()=>{}};function Gv(){for(var n=0,e=arguments.length,t={},r;n<e;++n){if(!(r=arguments[n]+"")||r in t||/[\s.]/.test(r))throw new Error("illegal type: "+r);t[r]=[]}return new nc(t)}function nc(n){this._=n}function MN(n,e){return n.trim().split(/^|\s+/).map(function(t){var r="",i=t.indexOf(".");if(i>=0&&(r=t.slice(i+1),t=t.slice(0,i)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:r}})}nc.prototype=Gv.prototype={constructor:nc,on:function(n,e){var t=this._,r=MN(n+"",t),i,o=-1,s=r.length;if(arguments.length<2){for(;++o<s;)if((i=(n=r[o]).type)&&(i=NN(t[i],n.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++o<s;)if(i=(n=r[o]).type)t[i]=$v(t[i],n.name,e);else if(e==null)for(i in t)t[i]=$v(t[i],n.name,null);return this},copy:function(){var n={},e=this._;for(var t in e)n[t]=e[t].slice();return new nc(n)},call:function(n,e){if((i=arguments.length-2)>0)for(var t=new Array(i),r=0,i,o;r<i;++r)t[r]=arguments[r+2];if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(o=this._[n],r=0,i=o.length;r<i;++r)o[r].value.apply(e,t)},apply:function(n,e,t){if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(var r=this._[n],i=0,o=r.length;i<o;++i)r[i].value.apply(e,t)}};function NN(n,e){for(var t=0,r=n.length,i;t<r;++t)if((i=n[t]).name===e)return i.value}function $v(n,e,t){for(var r=0,i=n.length;r<i;++r)if(n[r].name===e){n[r]=AN,n=n.slice(0,r).concat(n.slice(r+1));break}return t!=null&&n.push({name:e,value:t}),n}var lf="http://www.w3.org/1999/xhtml";const Wv={svg:"http://www.w3.org/2000/svg",xhtml:lf,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function rc(n){var e=n+="",t=e.indexOf(":");return t>=0&&(e=n.slice(0,t))!=="xmlns"&&(n=n.slice(t+1)),Wv.hasOwnProperty(e)?{space:Wv[e],local:n}:n}function DN(n){return function(){var e=this.ownerDocument,t=this.namespaceURI;return t===lf&&e.documentElement.namespaceURI===lf?e.createElement(n):e.createElementNS(t,n)}}function RN(n){return function(){return this.ownerDocument.createElementNS(n.space,n.local)}}function Kv(n){var e=rc(n);return(e.local?RN:DN)(e)}function IN(){}function cf(n){return n==null?IN:function(){return this.querySelector(n)}}function ON(n){typeof n!="function"&&(n=cf(n));for(var e=this._groups,t=e.length,r=new Array(t),i=0;i<t;++i)for(var o=e[i],s=o.length,a=r[i]=new Array(s),l,c,u=0;u<s;++u)(l=o[u])&&(c=n.call(l,l.__data__,u,o))&&("__data__"in l&&(c.__data__=l.__data__),a[u]=c);return new yn(r,this._parents)}function LN(n){return n==null?[]:Array.isArray(n)?n:Array.from(n)}function PN(){return[]}function jv(n){return n==null?PN:function(){return this.querySelectorAll(n)}}function BN(n){return function(){return LN(n.apply(this,arguments))}}function FN(n){typeof n=="function"?n=BN(n):n=jv(n);for(var e=this._groups,t=e.length,r=[],i=[],o=0;o<t;++o)for(var s=e[o],a=s.length,l,c=0;c<a;++c)(l=s[c])&&(r.push(n.call(l,l.__data__,c,s)),i.push(l));return new yn(r,i)}function Qv(n){return function(){return this.matches(n)}}function Yv(n){return function(e){return e.matches(n)}}var zN=Array.prototype.find;function qN(n){return function(){return zN.call(this.children,n)}}function HN(){return this.firstElementChild}function VN(n){return this.select(n==null?HN:qN(typeof n=="function"?n:Yv(n)))}var UN=Array.prototype.filter;function GN(){return Array.from(this.children)}function $N(n){return function(){return UN.call(this.children,n)}}function WN(n){return this.selectAll(n==null?GN:$N(typeof n=="function"?n:Yv(n)))}function KN(n){typeof n!="function"&&(n=Qv(n));for(var e=this._groups,t=e.length,r=new Array(t),i=0;i<t;++i)for(var o=e[i],s=o.length,a=r[i]=[],l,c=0;c<s;++c)(l=o[c])&&n.call(l,l.__data__,c,o)&&a.push(l);return new yn(r,this._parents)}function Zv(n){return new Array(n.length)}function jN(){return new yn(this._enter||this._groups.map(Zv),this._parents)}function ic(n,e){this.ownerDocument=n.ownerDocument,this.namespaceURI=n.namespaceURI,this._next=null,this._parent=n,this.__data__=e}ic.prototype={constructor:ic,appendChild:function(n){return this._parent.insertBefore(n,this._next)},insertBefore:function(n,e){return this._parent.insertBefore(n,e)},querySelector:function(n){return this._parent.querySelector(n)},querySelectorAll:function(n){return this._parent.querySelectorAll(n)}};function QN(n){return function(){return n}}function YN(n,e,t,r,i,o){for(var s=0,a,l=e.length,c=o.length;s<c;++s)(a=e[s])?(a.__data__=o[s],r[s]=a):t[s]=new ic(n,o[s]);for(;s<l;++s)(a=e[s])&&(i[s]=a)}function ZN(n,e,t,r,i,o,s){var a,l,c=new Map,u=e.length,d=o.length,m=new Array(u),b;for(a=0;a<u;++a)(l=e[a])&&(m[a]=b=s.call(l,l.__data__,a,e)+"",c.has(b)?i[a]=l:c.set(b,l));for(a=0;a<d;++a)b=s.call(n,o[a],a,o)+"",(l=c.get(b))?(r[a]=l,l.__data__=o[a],c.delete(b)):t[a]=new ic(n,o[a]);for(a=0;a<u;++a)(l=e[a])&&c.get(m[a])===l&&(i[a]=l)}function XN(n){return n.__data__}function JN(n,e){if(!arguments.length)return Array.from(this,XN);var t=e?ZN:YN,r=this._parents,i=this._groups;typeof n!="function"&&(n=QN(n));for(var o=i.length,s=new Array(o),a=new Array(o),l=new Array(o),c=0;c<o;++c){var u=r[c],d=i[c],m=d.length,b=eD(n.call(u,u&&u.__data__,c,r)),f=b.length,y=a[c]=new Array(f),w=s[c]=new Array(f),k=l[c]=new Array(m);t(u,d,y,w,k,b,e);for(var E=0,S=0,D,R;E<f;++E)if(D=y[E]){for(E>=S&&(S=E+1);!(R=w[S])&&++S<f;);D._next=R||null}}return s=new yn(s,r),s._enter=a,s._exit=l,s}function eD(n){return typeof n=="object"&&"length"in n?n:Array.from(n)}function tD(){return new yn(this._exit||this._groups.map(Zv),this._parents)}function nD(n,e,t){var r=this.enter(),i=this,o=this.exit();return typeof n=="function"?(r=n(r),r&&(r=r.selection())):r=r.append(n+""),e!=null&&(i=e(i),i&&(i=i.selection())),t==null?o.remove():t(o),r&&i?r.merge(i).order():i}function rD(n){for(var e=n.selection?n.selection():n,t=this._groups,r=e._groups,i=t.length,o=r.length,s=Math.min(i,o),a=new Array(i),l=0;l<s;++l)for(var c=t[l],u=r[l],d=c.length,m=a[l]=new Array(d),b,f=0;f<d;++f)(b=c[f]||u[f])&&(m[f]=b);for(;l<i;++l)a[l]=t[l];return new yn(a,this._parents)}function iD(){for(var n=this._groups,e=-1,t=n.length;++e<t;)for(var r=n[e],i=r.length-1,o=r[i],s;--i>=0;)(s=r[i])&&(o&&s.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(s,o),o=s);return this}function oD(n){n||(n=sD);function e(d,m){return d&&m?n(d.__data__,m.__data__):!d-!m}for(var t=this._groups,r=t.length,i=new Array(r),o=0;o<r;++o){for(var s=t[o],a=s.length,l=i[o]=new Array(a),c,u=0;u<a;++u)(c=s[u])&&(l[u]=c);l.sort(e)}return new yn(i,this._parents).order()}function sD(n,e){return n<e?-1:n>e?1:n>=e?0:NaN}function aD(){var n=arguments[0];return arguments[0]=this,n.apply(null,arguments),this}function lD(){return Array.from(this)}function cD(){for(var n=this._groups,e=0,t=n.length;e<t;++e)for(var r=n[e],i=0,o=r.length;i<o;++i){var s=r[i];if(s)return s}return null}function uD(){let n=0;for(const e of this)++n;return n}function dD(){return!this.node()}function hD(n){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var i=e[t],o=0,s=i.length,a;o<s;++o)(a=i[o])&&n.call(a,a.__data__,o,i);return this}function fD(n){return function(){this.removeAttribute(n)}}function pD(n){return function(){this.removeAttributeNS(n.space,n.local)}}function mD(n,e){return function(){this.setAttribute(n,e)}}function gD(n,e){return function(){this.setAttributeNS(n.space,n.local,e)}}function bD(n,e){return function(){var t=e.apply(this,arguments);t==null?this.removeAttribute(n):this.setAttribute(n,t)}}function _D(n,e){return function(){var t=e.apply(this,arguments);t==null?this.removeAttributeNS(n.space,n.local):this.setAttributeNS(n.space,n.local,t)}}function yD(n,e){var t=rc(n);if(arguments.length<2){var r=this.node();return t.local?r.getAttributeNS(t.space,t.local):r.getAttribute(t)}return this.each((e==null?t.local?pD:fD:typeof e=="function"?t.local?_D:bD:t.local?gD:mD)(t,e))}function Xv(n){return n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView}function vD(n){return function(){this.style.removeProperty(n)}}function wD(n,e,t){return function(){this.style.setProperty(n,e,t)}}function xD(n,e,t){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(n):this.style.setProperty(n,r,t)}}function kD(n,e,t){return arguments.length>1?this.each((e==null?vD:typeof e=="function"?xD:wD)(n,e,t??"")):xo(this.node(),n)}function xo(n,e){return n.style.getPropertyValue(e)||Xv(n).getComputedStyle(n,null).getPropertyValue(e)}function SD(n){return function(){delete this[n]}}function CD(n,e){return function(){this[n]=e}}function ED(n,e){return function(){var t=e.apply(this,arguments);t==null?delete this[n]:this[n]=t}}function TD(n,e){return arguments.length>1?this.each((e==null?SD:typeof e=="function"?ED:CD)(n,e)):this.node()[n]}function Jv(n){return n.trim().split(/^|\s+/)}function uf(n){return n.classList||new e2(n)}function e2(n){this._node=n,this._names=Jv(n.getAttribute("class")||"")}e2.prototype={add:function(n){var e=this._names.indexOf(n);e<0&&(this._names.push(n),this._node.setAttribute("class",this._names.join(" ")))},remove:function(n){var e=this._names.indexOf(n);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(n){return this._names.indexOf(n)>=0}};function t2(n,e){for(var t=uf(n),r=-1,i=e.length;++r<i;)t.add(e[r])}function n2(n,e){for(var t=uf(n),r=-1,i=e.length;++r<i;)t.remove(e[r])}function AD(n){return function(){t2(this,n)}}function MD(n){return function(){n2(this,n)}}function ND(n,e){return function(){(e.apply(this,arguments)?t2:n2)(this,n)}}function DD(n,e){var t=Jv(n+"");if(arguments.length<2){for(var r=uf(this.node()),i=-1,o=t.length;++i<o;)if(!r.contains(t[i]))return!1;return!0}return this.each((typeof e=="function"?ND:e?AD:MD)(t,e))}function RD(){this.textContent=""}function ID(n){return function(){this.textContent=n}}function OD(n){return function(){var e=n.apply(this,arguments);this.textContent=e??""}}function LD(n){return arguments.length?this.each(n==null?RD:(typeof n=="function"?OD:ID)(n)):this.node().textContent}function PD(){this.innerHTML=""}function BD(n){return function(){this.innerHTML=n}}function FD(n){return function(){var e=n.apply(this,arguments);this.innerHTML=e??""}}function zD(n){return arguments.length?this.each(n==null?PD:(typeof n=="function"?FD:BD)(n)):this.node().innerHTML}function qD(){this.nextSibling&&this.parentNode.appendChild(this)}function HD(){return this.each(qD)}function VD(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function UD(){return this.each(VD)}function GD(n){var e=typeof n=="function"?n:Kv(n);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function $D(){return null}function WD(n,e){var t=typeof n=="function"?n:Kv(n),r=e==null?$D:typeof e=="function"?e:cf(e);return this.select(function(){return this.insertBefore(t.apply(this,arguments),r.apply(this,arguments)||null)})}function KD(){var n=this.parentNode;n&&n.removeChild(this)}function jD(){return this.each(KD)}function QD(){var n=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(n,this.nextSibling):n}function YD(){var n=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(n,this.nextSibling):n}function ZD(n){return this.select(n?YD:QD)}function XD(n){return arguments.length?this.property("__data__",n):this.node().__data__}function JD(n){return function(e){n.call(this,e,this.__data__)}}function eR(n){return n.trim().split(/^|\s+/).map(function(e){var t="",r=e.indexOf(".");return r>=0&&(t=e.slice(r+1),e=e.slice(0,r)),{type:e,name:t}})}function tR(n){return function(){var e=this.__on;if(e){for(var t=0,r=-1,i=e.length,o;t<i;++t)o=e[t],(!n.type||o.type===n.type)&&o.name===n.name?this.removeEventListener(o.type,o.listener,o.options):e[++r]=o;++r?e.length=r:delete this.__on}}}function nR(n,e,t){return function(){var r=this.__on,i,o=JD(e);if(r){for(var s=0,a=r.length;s<a;++s)if((i=r[s]).type===n.type&&i.name===n.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=t),i.value=e;return}}this.addEventListener(n.type,o,t),i={type:n.type,name:n.name,value:e,listener:o,options:t},r?r.push(i):this.__on=[i]}}function rR(n,e,t){var r=eR(n+""),i,o=r.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,c=a.length,u;l<c;++l)for(i=0,u=a[l];i<o;++i)if((s=r[i]).type===u.type&&s.name===u.name)return u.value}return}for(a=e?nR:tR,i=0;i<o;++i)this.each(a(r[i],e,t));return this}function r2(n,e,t){var r=Xv(n),i=r.CustomEvent;typeof i=="function"?i=new i(e,t):(i=r.document.createEvent("Event"),t?(i.initEvent(e,t.bubbles,t.cancelable),i.detail=t.detail):i.initEvent(e,!1,!1)),n.dispatchEvent(i)}function iR(n,e){return function(){return r2(this,n,e)}}function oR(n,e){return function(){return r2(this,n,e.apply(this,arguments))}}function sR(n,e){return this.each((typeof e=="function"?oR:iR)(n,e))}function*aR(){for(var n=this._groups,e=0,t=n.length;e<t;++e)for(var r=n[e],i=0,o=r.length,s;i<o;++i)(s=r[i])&&(yield s)}var i2=[null];function yn(n,e){this._groups=n,this._parents=e}function Ps(){return new yn([[document.documentElement]],i2)}function lR(){return this}yn.prototype=Ps.prototype={constructor:yn,select:ON,selectAll:FN,selectChild:VN,selectChildren:WN,filter:KN,data:JN,enter:jN,exit:tD,join:nD,merge:rD,selection:lR,order:iD,sort:oD,call:aD,nodes:lD,node:cD,size:uD,empty:dD,each:hD,attr:yD,style:kD,property:TD,classed:DD,text:LD,html:zD,raise:HD,lower:UD,append:GD,insert:WD,remove:jD,clone:ZD,datum:XD,on:rR,dispatch:sR,[Symbol.iterator]:aR};function cR(n){return typeof n=="string"?new yn([[document.querySelector(n)]],[document.documentElement]):new yn([[n]],i2)}function o2(n){let e;for(;e=n.sourceEvent;)n=e;return n}function uR(n,e){if(n=o2(n),e===void 0&&(e=n.currentTarget),e){var t=e.ownerSVGElement||e;if(t.createSVGPoint){var r=t.createSVGPoint();return r.x=n.clientX,r.y=n.clientY,r=r.matrixTransform(e.getScreenCTM().inverse()),[r.x,r.y]}if(e.getBoundingClientRect){var i=e.getBoundingClientRect();return[n.clientX-i.left-e.clientLeft,n.clientY-i.top-e.clientTop]}}return[n.pageX,n.pageY]}function dR(n,e){return n.target&&(n=o2(n),e===void 0&&(e=n.currentTarget),n=n.touches||[n]),Array.from(n,t=>uR(t,e))}function df(n,e,t){n.prototype=e.prototype=t,t.constructor=n}function s2(n,e){var t=Object.create(n.prototype);for(var r in e)t[r]=e[r];return t}function Bs(){}var Fs=.7,oc=1/Fs,ko="\\s*([+-]?\\d+)\\s*",zs="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",sr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",hR=/^#([0-9a-f]{3,8})$/,fR=new RegExp(`^rgb\\(${ko},${ko},${ko}\\)$`),pR=new RegExp(`^rgb\\(${sr},${sr},${sr}\\)$`),mR=new RegExp(`^rgba\\(${ko},${ko},${ko},${zs}\\)$`),gR=new RegExp(`^rgba\\(${sr},${sr},${sr},${zs}\\)$`),bR=new RegExp(`^hsl\\(${zs},${sr},${sr}\\)$`),_R=new RegExp(`^hsla\\(${zs},${sr},${sr},${zs}\\)$`),a2={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};df(Bs,qs,{copy(n){return Object.assign(new this.constructor,this,n)},displayable(){return this.rgb().displayable()},hex:l2,formatHex:l2,formatHex8:yR,formatHsl:vR,formatRgb:c2,toString:c2});function l2(){return this.rgb().formatHex()}function yR(){return this.rgb().formatHex8()}function vR(){return p2(this).formatHsl()}function c2(){return this.rgb().formatRgb()}function qs(n){var e,t;return n=(n+"").trim().toLowerCase(),(e=hR.exec(n))?(t=e[1].length,e=parseInt(e[1],16),t===6?u2(e):t===3?new fn(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):t===8?sc(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):t===4?sc(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=fR.exec(n))?new fn(e[1],e[2],e[3],1):(e=pR.exec(n))?new fn(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=mR.exec(n))?sc(e[1],e[2],e[3],e[4]):(e=gR.exec(n))?sc(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=bR.exec(n))?f2(e[1],e[2]/100,e[3]/100,1):(e=_R.exec(n))?f2(e[1],e[2]/100,e[3]/100,e[4]):a2.hasOwnProperty(n)?u2(a2[n]):n==="transparent"?new fn(NaN,NaN,NaN,0):null}function u2(n){return new fn(n>>16&255,n>>8&255,n&255,1)}function sc(n,e,t,r){return r<=0&&(n=e=t=NaN),new fn(n,e,t,r)}function wR(n){return n instanceof Bs||(n=qs(n)),n?(n=n.rgb(),new fn(n.r,n.g,n.b,n.opacity)):new fn}function hf(n,e,t,r){return arguments.length===1?wR(n):new fn(n,e,t,r??1)}function fn(n,e,t,r){this.r=+n,this.g=+e,this.b=+t,this.opacity=+r}df(fn,hf,s2(Bs,{brighter(n){return n=n==null?oc:Math.pow(oc,n),new fn(this.r*n,this.g*n,this.b*n,this.opacity)},darker(n){return n=n==null?Fs:Math.pow(Fs,n),new fn(this.r*n,this.g*n,this.b*n,this.opacity)},rgb(){return this},clamp(){return new fn(qi(this.r),qi(this.g),qi(this.b),ac(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:d2,formatHex:d2,formatHex8:xR,formatRgb:h2,toString:h2}));function d2(){return`#${Hi(this.r)}${Hi(this.g)}${Hi(this.b)}`}function xR(){return`#${Hi(this.r)}${Hi(this.g)}${Hi(this.b)}${Hi((isNaN(this.opacity)?1:this.opacity)*255)}`}function h2(){const n=ac(this.opacity);return`${n===1?"rgb(":"rgba("}${qi(this.r)}, ${qi(this.g)}, ${qi(this.b)}${n===1?")":`, ${n})`}`}function ac(n){return isNaN(n)?1:Math.max(0,Math.min(1,n))}function qi(n){return Math.max(0,Math.min(255,Math.round(n)||0))}function Hi(n){return n=qi(n),(n<16?"0":"")+n.toString(16)}function f2(n,e,t,r){return r<=0?n=e=t=NaN:t<=0||t>=1?n=e=NaN:e<=0&&(n=NaN),new Wn(n,e,t,r)}function p2(n){if(n instanceof Wn)return new Wn(n.h,n.s,n.l,n.opacity);if(n instanceof Bs||(n=qs(n)),!n)return new Wn;if(n instanceof Wn)return n;n=n.rgb();var e=n.r/255,t=n.g/255,r=n.b/255,i=Math.min(e,t,r),o=Math.max(e,t,r),s=NaN,a=o-i,l=(o+i)/2;return a?(e===o?s=(t-r)/a+(t<r)*6:t===o?s=(r-e)/a+2:s=(e-t)/a+4,a/=l<.5?o+i:2-o-i,s*=60):a=l>0&&l<1?0:s,new Wn(s,a,l,n.opacity)}function kR(n,e,t,r){return arguments.length===1?p2(n):new Wn(n,e,t,r??1)}function Wn(n,e,t,r){this.h=+n,this.s=+e,this.l=+t,this.opacity=+r}df(Wn,kR,s2(Bs,{brighter(n){return n=n==null?oc:Math.pow(oc,n),new Wn(this.h,this.s,this.l*n,this.opacity)},darker(n){return n=n==null?Fs:Math.pow(Fs,n),new Wn(this.h,this.s,this.l*n,this.opacity)},rgb(){var n=this.h%360+(this.h<0)*360,e=isNaN(n)||isNaN(this.s)?0:this.s,t=this.l,r=t+(t<.5?t:1-t)*e,i=2*t-r;return new fn(ff(n>=240?n-240:n+120,i,r),ff(n,i,r),ff(n<120?n+240:n-120,i,r),this.opacity)},clamp(){return new Wn(m2(this.h),lc(this.s),lc(this.l),ac(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const n=ac(this.opacity);return`${n===1?"hsl(":"hsla("}${m2(this.h)}, ${lc(this.s)*100}%, ${lc(this.l)*100}%${n===1?")":`, ${n})`}`}}));function m2(n){return n=(n||0)%360,n<0?n+360:n}function lc(n){return Math.max(0,Math.min(1,n||0))}function ff(n,e,t){return(n<60?e+(t-e)*n/60:n<180?t:n<240?e+(t-e)*(240-n)/60:e)*255}const g2=n=>()=>n;function SR(n,e){return function(t){return n+t*e}}function CR(n,e,t){return n=Math.pow(n,t),e=Math.pow(e,t)-n,t=1/t,function(r){return Math.pow(n+r*e,t)}}function ER(n){return(n=+n)==1?b2:function(e,t){return t-e?CR(e,t,n):g2(isNaN(e)?t:e)}}function b2(n,e){var t=e-n;return t?SR(n,t):g2(isNaN(n)?e:n)}const _2=function n(e){var t=ER(e);function r(i,o){var s=t((i=hf(i)).r,(o=hf(o)).r),a=t(i.g,o.g),l=t(i.b,o.b),c=b2(i.opacity,o.opacity);return function(u){return i.r=s(u),i.g=a(u),i.b=l(u),i.opacity=c(u),i+""}}return r.gamma=n,r}(1);function li(n,e){return n=+n,e=+e,function(t){return n*(1-t)+e*t}}var pf=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,mf=new RegExp(pf.source,"g");function TR(n){return function(){return n}}function AR(n){return function(e){return n(e)+""}}function MR(n,e){var t=pf.lastIndex=mf.lastIndex=0,r,i,o,s=-1,a=[],l=[];for(n=n+"",e=e+"";(r=pf.exec(n))&&(i=mf.exec(e));)(o=i.index)>t&&(o=e.slice(t,o),a[s]?a[s]+=o:a[++s]=o),(r=r[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,l.push({i:s,x:li(r,i)})),t=mf.lastIndex;return t<e.length&&(o=e.slice(t),a[s]?a[s]+=o:a[++s]=o),a.length<2?l[0]?AR(l[0].x):TR(e):(e=l.length,function(c){for(var u=0,d;u<e;++u)a[(d=l[u]).i]=d.x(c);return a.join("")})}var y2=180/Math.PI,gf={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function v2(n,e,t,r,i,o){var s,a,l;return(s=Math.sqrt(n*n+e*e))&&(n/=s,e/=s),(l=n*t+e*r)&&(t-=n*l,r-=e*l),(a=Math.sqrt(t*t+r*r))&&(t/=a,r/=a,l/=a),n*r<e*t&&(n=-n,e=-e,l=-l,s=-s),{translateX:i,translateY:o,rotate:Math.atan2(e,n)*y2,skewX:Math.atan(l)*y2,scaleX:s,scaleY:a}}var cc;function NR(n){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(n+"");return e.isIdentity?gf:v2(e.a,e.b,e.c,e.d,e.e,e.f)}function DR(n){return n==null||(cc||(cc=document.createElementNS("http://www.w3.org/2000/svg","g")),cc.setAttribute("transform",n),!(n=cc.transform.baseVal.consolidate()))?gf:(n=n.matrix,v2(n.a,n.b,n.c,n.d,n.e,n.f))}function w2(n,e,t,r){function i(c){return c.length?c.pop()+" ":""}function o(c,u,d,m,b,f){if(c!==d||u!==m){var y=b.push("translate(",null,e,null,t);f.push({i:y-4,x:li(c,d)},{i:y-2,x:li(u,m)})}else(d||m)&&b.push("translate("+d+e+m+t)}function s(c,u,d,m){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),m.push({i:d.push(i(d)+"rotate(",null,r)-2,x:li(c,u)})):u&&d.push(i(d)+"rotate("+u+r)}function a(c,u,d,m){c!==u?m.push({i:d.push(i(d)+"skewX(",null,r)-2,x:li(c,u)}):u&&d.push(i(d)+"skewX("+u+r)}function l(c,u,d,m,b,f){if(c!==d||u!==m){var y=b.push(i(b)+"scale(",null,",",null,")");f.push({i:y-4,x:li(c,d)},{i:y-2,x:li(u,m)})}else(d!==1||m!==1)&&b.push(i(b)+"scale("+d+","+m+")")}return function(c,u){var d=[],m=[];return c=n(c),u=n(u),o(c.translateX,c.translateY,u.translateX,u.translateY,d,m),s(c.rotate,u.rotate,d,m),a(c.skewX,u.skewX,d,m),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,d,m),c=u=null,function(b){for(var f=-1,y=m.length,w;++f<y;)d[(w=m[f]).i]=w.x(b);return d.join("")}}}var RR=w2(NR,"px, ","px)","deg)"),IR=w2(DR,", ",")",")"),So=0,Hs=0,Vs=0,x2=1e3,uc,Us,dc=0,Vi=0,hc=0,Gs=typeof performance=="object"&&performance.now?performance:Date,k2=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(n){setTimeout(n,17)};function bf(){return Vi||(k2(OR),Vi=Gs.now()+hc)}function OR(){Vi=0}function fc(){this._call=this._time=this._next=null}fc.prototype=S2.prototype={constructor:fc,restart:function(n,e,t){if(typeof n!="function")throw new TypeError("callback is not a function");t=(t==null?bf():+t)+(e==null?0:+e),!this._next&&Us!==this&&(Us?Us._next=this:uc=this,Us=this),this._call=n,this._time=t,_f()},stop:function(){this._call&&(this._call=null,this._time=1/0,_f())}};function S2(n,e,t){var r=new fc;return r.restart(n,e,t),r}function LR(){bf(),++So;for(var n=uc,e;n;)(e=Vi-n._time)>=0&&n._call.call(void 0,e),n=n._next;--So}function C2(){Vi=(dc=Gs.now())+hc,So=Hs=0;try{LR()}finally{So=0,BR(),Vi=0}}function PR(){var n=Gs.now(),e=n-dc;e>x2&&(hc-=e,dc=n)}function BR(){for(var n,e=uc,t,r=1/0;e;)e._call?(r>e._time&&(r=e._time),n=e,e=e._next):(t=e._next,e._next=null,e=n?n._next=t:uc=t);Us=n,_f(r)}function _f(n){if(!So){Hs&&(Hs=clearTimeout(Hs));var e=n-Vi;e>24?(n<1/0&&(Hs=setTimeout(C2,n-Gs.now()-hc)),Vs&&(Vs=clearInterval(Vs))):(Vs||(dc=Gs.now(),Vs=setInterval(PR,x2)),So=1,k2(C2))}}function E2(n,e,t){var r=new fc;return e=e==null?0:+e,r.restart(i=>{r.stop(),n(i+e)},e,t),r}var FR=Gv("start","end","cancel","interrupt"),zR=[],T2=0,A2=1,yf=2,pc=3,M2=4,vf=5,mc=6;function gc(n,e,t,r,i,o){var s=n.__transition;if(!s)n.__transition={};else if(t in s)return;qR(n,t,{name:e,index:r,group:i,on:FR,tween:zR,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:T2})}function wf(n,e){var t=Kn(n,e);if(t.state>T2)throw new Error("too late; already scheduled");return t}function ar(n,e){var t=Kn(n,e);if(t.state>pc)throw new Error("too late; already running");return t}function Kn(n,e){var t=n.__transition;if(!t||!(t=t[e]))throw new Error("transition not found");return t}function qR(n,e,t){var r=n.__transition,i;r[e]=t,t.timer=S2(o,0,t.time);function o(c){t.state=A2,t.timer.restart(s,t.delay,t.time),t.delay<=c&&s(c-t.delay)}function s(c){var u,d,m,b;if(t.state!==A2)return l();for(u in r)if(b=r[u],b.name===t.name){if(b.state===pc)return E2(s);b.state===M2?(b.state=mc,b.timer.stop(),b.on.call("interrupt",n,n.__data__,b.index,b.group),delete r[u]):+u<e&&(b.state=mc,b.timer.stop(),b.on.call("cancel",n,n.__data__,b.index,b.group),delete r[u])}if(E2(function(){t.state===pc&&(t.state=M2,t.timer.restart(a,t.delay,t.time),a(c))}),t.state=yf,t.on.call("start",n,n.__data__,t.index,t.group),t.state===yf){for(t.state=pc,i=new Array(m=t.tween.length),u=0,d=-1;u<m;++u)(b=t.tween[u].value.call(n,n.__data__,t.index,t.group))&&(i[++d]=b);i.length=d+1}}function a(c){for(var u=c<t.duration?t.ease.call(null,c/t.duration):(t.timer.restart(l),t.state=vf,1),d=-1,m=i.length;++d<m;)i[d].call(n,u);t.state===vf&&(t.on.call("end",n,n.__data__,t.index,t.group),l())}function l(){t.state=mc,t.timer.stop(),delete r[e];for(var c in r)return;delete n.__transition}}function HR(n,e){var t=n.__transition,r,i,o=!0,s;if(t){e=e==null?null:e+"";for(s in t){if((r=t[s]).name!==e){o=!1;continue}i=r.state>yf&&r.state<vf,r.state=mc,r.timer.stop(),r.on.call(i?"interrupt":"cancel",n,n.__data__,r.index,r.group),delete t[s]}o&&delete n.__transition}}function VR(n){return this.each(function(){HR(this,n)})}function UR(n,e){var t,r;return function(){var i=ar(this,n),o=i.tween;if(o!==t){r=t=o;for(var s=0,a=r.length;s<a;++s)if(r[s].name===e){r=r.slice(),r.splice(s,1);break}}i.tween=r}}function GR(n,e,t){var r,i;if(typeof t!="function")throw new Error;return function(){var o=ar(this,n),s=o.tween;if(s!==r){i=(r=s).slice();for(var a={name:e,value:t},l=0,c=i.length;l<c;++l)if(i[l].name===e){i[l]=a;break}l===c&&i.push(a)}o.tween=i}}function $R(n,e){var t=this._id;if(n+="",arguments.length<2){for(var r=Kn(this.node(),t).tween,i=0,o=r.length,s;i<o;++i)if((s=r[i]).name===n)return s.value;return null}return this.each((e==null?UR:GR)(t,n,e))}function xf(n,e,t){var r=n._id;return n.each(function(){var i=ar(this,r);(i.value||(i.value={}))[e]=t.apply(this,arguments)}),function(i){return Kn(i,r).value[e]}}function N2(n,e){var t;return(typeof e=="number"?li:e instanceof qs?_2:(t=qs(e))?(e=t,_2):MR)(n,e)}function WR(n){return function(){this.removeAttribute(n)}}function KR(n){return function(){this.removeAttributeNS(n.space,n.local)}}function jR(n,e,t){var r,i=t+"",o;return function(){var s=this.getAttribute(n);return s===i?null:s===r?o:o=e(r=s,t)}}function QR(n,e,t){var r,i=t+"",o;return function(){var s=this.getAttributeNS(n.space,n.local);return s===i?null:s===r?o:o=e(r=s,t)}}function YR(n,e,t){var r,i,o;return function(){var s,a=t(this),l;return a==null?void this.removeAttribute(n):(s=this.getAttribute(n),l=a+"",s===l?null:s===r&&l===i?o:(i=l,o=e(r=s,a)))}}function ZR(n,e,t){var r,i,o;return function(){var s,a=t(this),l;return a==null?void this.removeAttributeNS(n.space,n.local):(s=this.getAttributeNS(n.space,n.local),l=a+"",s===l?null:s===r&&l===i?o:(i=l,o=e(r=s,a)))}}function XR(n,e){var t=rc(n),r=t==="transform"?IR:N2;return this.attrTween(n,typeof e=="function"?(t.local?ZR:YR)(t,r,xf(this,"attr."+n,e)):e==null?(t.local?KR:WR)(t):(t.local?QR:jR)(t,r,e))}function JR(n,e){return function(t){this.setAttribute(n,e.call(this,t))}}function eI(n,e){return function(t){this.setAttributeNS(n.space,n.local,e.call(this,t))}}function tI(n,e){var t,r;function i(){var o=e.apply(this,arguments);return o!==r&&(t=(r=o)&&eI(n,o)),t}return i._value=e,i}function nI(n,e){var t,r;function i(){var o=e.apply(this,arguments);return o!==r&&(t=(r=o)&&JR(n,o)),t}return i._value=e,i}function rI(n,e){var t="attr."+n;if(arguments.length<2)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;var r=rc(n);return this.tween(t,(r.local?tI:nI)(r,e))}function iI(n,e){return function(){wf(this,n).delay=+e.apply(this,arguments)}}function oI(n,e){return e=+e,function(){wf(this,n).delay=e}}function sI(n){var e=this._id;return arguments.length?this.each((typeof n=="function"?iI:oI)(e,n)):Kn(this.node(),e).delay}function aI(n,e){return function(){ar(this,n).duration=+e.apply(this,arguments)}}function lI(n,e){return e=+e,function(){ar(this,n).duration=e}}function cI(n){var e=this._id;return arguments.length?this.each((typeof n=="function"?aI:lI)(e,n)):Kn(this.node(),e).duration}function uI(n,e){if(typeof e!="function")throw new Error;return function(){ar(this,n).ease=e}}function dI(n){var e=this._id;return arguments.length?this.each(uI(e,n)):Kn(this.node(),e).ease}function hI(n,e){return function(){var t=e.apply(this,arguments);if(typeof t!="function")throw new Error;ar(this,n).ease=t}}function fI(n){if(typeof n!="function")throw new Error;return this.each(hI(this._id,n))}function pI(n){typeof n!="function"&&(n=Qv(n));for(var e=this._groups,t=e.length,r=new Array(t),i=0;i<t;++i)for(var o=e[i],s=o.length,a=r[i]=[],l,c=0;c<s;++c)(l=o[c])&&n.call(l,l.__data__,c,o)&&a.push(l);return new Nr(r,this._parents,this._name,this._id)}function mI(n){if(n._id!==this._id)throw new Error;for(var e=this._groups,t=n._groups,r=e.length,i=t.length,o=Math.min(r,i),s=new Array(r),a=0;a<o;++a)for(var l=e[a],c=t[a],u=l.length,d=s[a]=new Array(u),m,b=0;b<u;++b)(m=l[b]||c[b])&&(d[b]=m);for(;a<r;++a)s[a]=e[a];return new Nr(s,this._parents,this._name,this._id)}function gI(n){return(n+"").trim().split(/^|\s+/).every(function(e){var t=e.indexOf(".");return t>=0&&(e=e.slice(0,t)),!e||e==="start"})}function bI(n,e,t){var r,i,o=gI(e)?wf:ar;return function(){var s=o(this,n),a=s.on;a!==r&&(i=(r=a).copy()).on(e,t),s.on=i}}function _I(n,e){var t=this._id;return arguments.length<2?Kn(this.node(),t).on.on(n):this.each(bI(t,n,e))}function yI(n){return function(){var e=this.parentNode;for(var t in this.__transition)if(+t!==n)return;e&&e.removeChild(this)}}function vI(){return this.on("end.remove",yI(this._id))}function wI(n){var e=this._name,t=this._id;typeof n!="function"&&(n=cf(n));for(var r=this._groups,i=r.length,o=new Array(i),s=0;s<i;++s)for(var a=r[s],l=a.length,c=o[s]=new Array(l),u,d,m=0;m<l;++m)(u=a[m])&&(d=n.call(u,u.__data__,m,a))&&("__data__"in u&&(d.__data__=u.__data__),c[m]=d,gc(c[m],e,t,m,c,Kn(u,t)));return new Nr(o,this._parents,e,t)}function xI(n){var e=this._name,t=this._id;typeof n!="function"&&(n=jv(n));for(var r=this._groups,i=r.length,o=[],s=[],a=0;a<i;++a)for(var l=r[a],c=l.length,u,d=0;d<c;++d)if(u=l[d]){for(var m=n.call(u,u.__data__,d,l),b,f=Kn(u,t),y=0,w=m.length;y<w;++y)(b=m[y])&&gc(b,e,t,y,m,f);o.push(m),s.push(u)}return new Nr(o,s,e,t)}var kI=Ps.prototype.constructor;function SI(){return new kI(this._groups,this._parents)}function CI(n,e){var t,r,i;return function(){var o=xo(this,n),s=(this.style.removeProperty(n),xo(this,n));return o===s?null:o===t&&s===r?i:i=e(t=o,r=s)}}function D2(n){return function(){this.style.removeProperty(n)}}function EI(n,e,t){var r,i=t+"",o;return function(){var s=xo(this,n);return s===i?null:s===r?o:o=e(r=s,t)}}function TI(n,e,t){var r,i,o;return function(){var s=xo(this,n),a=t(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(n),xo(this,n))),s===l?null:s===r&&l===i?o:(i=l,o=e(r=s,a))}}function AI(n,e){var t,r,i,o="style."+e,s="end."+o,a;return function(){var l=ar(this,n),c=l.on,u=l.value[o]==null?a||(a=D2(e)):void 0;(c!==t||i!==u)&&(r=(t=c).copy()).on(s,i=u),l.on=r}}function MI(n,e,t){var r=(n+="")=="transform"?RR:N2;return e==null?this.styleTween(n,CI(n,r)).on("end.style."+n,D2(n)):typeof e=="function"?this.styleTween(n,TI(n,r,xf(this,"style."+n,e))).each(AI(this._id,n)):this.styleTween(n,EI(n,r,e),t).on("end.style."+n,null)}function NI(n,e,t){return function(r){this.style.setProperty(n,e.call(this,r),t)}}function DI(n,e,t){var r,i;function o(){var s=e.apply(this,arguments);return s!==i&&(r=(i=s)&&NI(n,s,t)),r}return o._value=e,o}function RI(n,e,t){var r="style."+(n+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;return this.tween(r,DI(n,e,t??""))}function II(n){return function(){this.textContent=n}}function OI(n){return function(){var e=n(this);this.textContent=e??""}}function LI(n){return this.tween("text",typeof n=="function"?OI(xf(this,"text",n)):II(n==null?"":n+""))}function PI(n){return function(e){this.textContent=n.call(this,e)}}function BI(n){var e,t;function r(){var i=n.apply(this,arguments);return i!==t&&(e=(t=i)&&PI(i)),e}return r._value=n,r}function FI(n){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(n==null)return this.tween(e,null);if(typeof n!="function")throw new Error;return this.tween(e,BI(n))}function zI(){for(var n=this._name,e=this._id,t=R2(),r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],a=s.length,l,c=0;c<a;++c)if(l=s[c]){var u=Kn(l,e);gc(l,n,t,c,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Nr(r,this._parents,n,t)}function qI(){var n,e,t=this,r=t._id,i=t.size();return new Promise(function(o,s){var a={value:s},l={value:function(){--i===0&&o()}};t.each(function(){var c=ar(this,r),u=c.on;u!==n&&(e=(n=u).copy(),e._.cancel.push(a),e._.interrupt.push(a),e._.end.push(l)),c.on=e}),i===0&&o()})}var HI=0;function Nr(n,e,t,r){this._groups=n,this._parents=e,this._name=t,this._id=r}function R2(){return++HI}var Dr=Ps.prototype;Nr.prototype={constructor:Nr,select:wI,selectAll:xI,selectChild:Dr.selectChild,selectChildren:Dr.selectChildren,filter:pI,merge:mI,selection:SI,transition:zI,call:Dr.call,nodes:Dr.nodes,node:Dr.node,size:Dr.size,empty:Dr.empty,each:Dr.each,on:_I,attr:XR,attrTween:rI,style:MI,styleTween:RI,text:LI,textTween:FI,remove:vI,tween:$R,delay:sI,duration:cI,ease:dI,easeVarying:fI,end:qI,[Symbol.iterator]:Dr[Symbol.iterator]};function VI(n){return((n*=2)<=1?n*n*n:(n-=2)*n*n+2)/2}var UI={time:null,delay:0,duration:250,ease:VI};function GI(n,e){for(var t;!(t=n.__transition)||!(t=t[e]);)if(!(n=n.parentNode))throw new Error(`transition ${e} not found`);return t}function $I(n){var e,t;n instanceof Nr?(e=n._id,n=n._name):(e=R2(),(t=UI).time=bf(),n=n==null?null:n+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],a=s.length,l,c=0;c<a;++c)(l=s[c])&&gc(l,n,e,c,s,t||GI(l,e));return new Nr(r,this._parents,n,e)}Ps.prototype.interrupt=VR,Ps.prototype.transition=$I;const kf=Math.PI,Sf=2*kf,Ui=1e-6,WI=Sf-Ui;function I2(n){this._+=n[0];for(let e=1,t=n.length;e<t;++e)this._+=arguments[e]+n[e]}function KI(n){let e=Math.floor(n);if(!(e>=0))throw new Error(`invalid digits: ${n}`);if(e>15)return I2;const t=10**e;return function(r){this._+=r[0];for(let i=1,o=r.length;i<o;++i)this._+=Math.round(arguments[i]*t)/t+r[i]}}class jI{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?I2:KI(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,r,i){this._append`Q${+e},${+t},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(e,t,r,i,o,s){this._append`C${+e},${+t},${+r},${+i},${this._x1=+o},${this._y1=+s}`}arcTo(e,t,r,i,o){if(e=+e,t=+t,r=+r,i=+i,o=+o,o<0)throw new Error(`negative radius: ${o}`);let s=this._x1,a=this._y1,l=r-e,c=i-t,u=s-e,d=a-t,m=u*u+d*d;if(this._x1===null)this._append`M${this._x1=e},${this._y1=t}`;else if(m>Ui)if(!(Math.abs(d*l-c*u)>Ui)||!o)this._append`L${this._x1=e},${this._y1=t}`;else{let b=r-s,f=i-a,y=l*l+c*c,w=b*b+f*f,k=Math.sqrt(y),E=Math.sqrt(m),S=o*Math.tan((kf-Math.acos((y+m-w)/(2*k*E)))/2),D=S/E,R=S/k;Math.abs(D-1)>Ui&&this._append`L${e+D*u},${t+D*d}`,this._append`A${o},${o},0,0,${+(d*b>u*f)},${this._x1=e+R*l},${this._y1=t+R*c}`}}arc(e,t,r,i,o,s){if(e=+e,t=+t,r=+r,s=!!s,r<0)throw new Error(`negative radius: ${r}`);let a=r*Math.cos(i),l=r*Math.sin(i),c=e+a,u=t+l,d=1^s,m=s?i-o:o-i;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>Ui||Math.abs(this._y1-u)>Ui)&&this._append`L${c},${u}`,r&&(m<0&&(m=m%Sf+Sf),m>WI?this._append`A${r},${r},0,1,${d},${e-a},${t-l}A${r},${r},0,1,${d},${this._x1=c},${this._y1=u}`:m>Ui&&this._append`A${r},${r},0,${+(m>=kf)},${d},${this._x1=e+r*Math.cos(o)},${this._y1=t+r*Math.sin(o)}`)}rect(e,t,r,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function Co(n){return function(){return n}}function QI(n){let e=3;return n.digits=function(t){if(!arguments.length)return e;if(t==null)e=null;else{const r=Math.floor(t);if(!(r>=0))throw new RangeError(`invalid digits: ${t}`);e=r}return n},()=>new jI(e)}function YI(n){return typeof n=="object"&&"length"in n?n:Array.from(n)}function O2(n){this._context=n}O2.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(n,e){switch(n=+n,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(n,e):this._context.moveTo(n,e);break;case 1:this._point=2;default:this._context.lineTo(n,e);break}}};function ZI(n){return new O2(n)}function XI(n){return n[0]}function JI(n){return n[1]}function eO(n,e){var t=Co(!0),r=null,i=ZI,o=null,s=QI(a);n=typeof n=="function"?n:n===void 0?XI:Co(n),e=typeof e=="function"?e:e===void 0?JI:Co(e);function a(l){var c,u=(l=YI(l)).length,d,m=!1,b;for(r==null&&(o=i(b=s())),c=0;c<=u;++c)!(c<u&&t(d=l[c],c,l))===m&&((m=!m)?o.lineStart():o.lineEnd()),m&&o.point(+n(d,c,l),+e(d,c,l));if(b)return o=null,b+""||null}return a.x=function(l){return arguments.length?(n=typeof l=="function"?l:Co(+l),a):n},a.y=function(l){return arguments.length?(e=typeof l=="function"?l:Co(+l),a):e},a.defined=function(l){return arguments.length?(t=typeof l=="function"?l:Co(!!l),a):t},a.curve=function(l){return arguments.length?(i=l,r!=null&&(o=i(r)),a):i},a.context=function(l){return arguments.length?(l==null?r=o=null:o=i(r=l),a):r},a}function L2(n,e,t){n._context.bezierCurveTo((2*n._x0+n._x1)/3,(2*n._y0+n._y1)/3,(n._x0+2*n._x1)/3,(n._y0+2*n._y1)/3,(n._x0+4*n._x1+e)/6,(n._y0+4*n._y1+t)/6)}function P2(n){this._context=n}P2.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:L2(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(n,e){switch(n=+n,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(n,e):this._context.moveTo(n,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:L2(this,n,e);break}this._x0=this._x1,this._x1=n,this._y0=this._y1,this._y1=e}};function tO(n){return new P2(n)}function $s(n,e,t){this.k=n,this.x=e,this.y=t}$s.prototype={constructor:$s,scale:function(n){return n===1?this:new $s(this.k*n,this.x,this.y)},translate:function(n,e){return n===0&e===0?this:new $s(this.k,this.x+this.k*n,this.y+this.k*e)},apply:function(n){return[n[0]*this.k+this.x,n[1]*this.k+this.y]},applyX:function(n){return n*this.k+this.x},applyY:function(n){return n*this.k+this.y},invert:function(n){return[(n[0]-this.x)/this.k,(n[1]-this.y)/this.k]},invertX:function(n){return(n-this.x)/this.k},invertY:function(n){return(n-this.y)/this.k},rescaleX:function(n){return n.copy().domain(n.range().map(this.invertX,this).map(n.invert,n))},rescaleY:function(n){return n.copy().domain(n.range().map(this.invertY,this).map(n.invert,n))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},$s.prototype;var Cf={exports:{}},B2;function nO(){return B2||(B2=1,function(n){(function(){function e(a,l){var c=a.x-l.x,u=a.y-l.y;return c*c+u*u}function t(a,l,c){var u=l.x,d=l.y,m=c.x-u,b=c.y-d;if(m!==0||b!==0){var f=((a.x-u)*m+(a.y-d)*b)/(m*m+b*b);f>1?(u=c.x,d=c.y):f>0&&(u+=m*f,d+=b*f)}return m=a.x-u,b=a.y-d,m*m+b*b}function r(a,l){for(var c=a[0],u=[c],d,m=1,b=a.length;m<b;m++)d=a[m],e(d,c)>l&&(u.push(d),c=d);return c!==d&&u.push(d),u}function i(a,l,c,u,d){for(var m=u,b,f=l+1;f<c;f++){var y=t(a[f],a[l],a[c]);y>m&&(b=f,m=y)}m>u&&(b-l>1&&i(a,l,b,u,d),d.push(a[b]),c-b>1&&i(a,b,c,u,d))}function o(a,l){var c=a.length-1,u=[a[0]];return i(a,0,c,l,u),u.push(a[c]),u}function s(a,l,c){if(a.length<=2)return a;var u=l!==void 0?l*l:1;return a=c?a:r(a,u),a=o(a,u),a}n.exports=s,n.exports.default=s})()}(Cf)),Cf.exports}var rO=nO();const iO=or(rO),oO={name:"drawingBlock",components:{NodeViewWrapper:Mi,mediaContainer:Bh},props:{editor:{type:Object},node:{type:Object},decorations:{type:Array},selected:{type:Boolean},extension:{type:Object},getPos:{type:Function},updateAttributes:{type:Function},deleteNode:{type:Function}},data(){return{color:"#000000",size:3,svg:null,path:null,points:[],drawing:!1,id:this.$SUtility.Guid(),colorList:[{name:"gray",color:"#787774"},{name:"purple",color:"#958DF1"},{name:"pink",color:"#f58eda"},{name:"red",color:"#F98181"},{name:"orange",color:"#FBBC88"},{name:"yellow",color:"#FAF594"},{name:"blue",color:"#4086cb"},{name:"teal",color:"#94FADB"},{name:"green",color:"#B9F18D"},{name:"rose",color:"#ee7686"},{name:"fresh_blue",color:"#70CFF8"},{name:"ice_blue",color:"#9fc2ca"},{name:"dark_blue",color:"#0c4a83"},{name:"fresh_green",color:"#55ddb6"}],activeErase:!1,mouseDown:!1,thisTheme:this.editor.storage.defaultStorage.theme,thisForeground:this.editor.storage.defaultStorage.foreground}},watch:{"editor.storage.defaultStorage.theme"(n){this.thisTheme=n},"editor.storage.defaultStorage.foreground"(n){this.thisForeground=n}},computed:{eraseBackground(){return this.activeErase?this.thisForeground:this.thisTheme==="dark"?"rgba(0, 0, 0, 1)":"rgba(255, 255, 255, 1)"}},methods:{onStartDrawing(n){if(this.mouseDown=!0,!this.editor.isEditable||this.activeErase)return;this.drawing=!0,this.points=[],this.path=this.svg.append("path").data([this.points]).attr("id",`id-${this.id}`).attr("stroke",this.color).attr("stroke-width",this.size);const e=n.type==="mousedown"?"mousemove":"touchmove";this.svg.on(e,this.onMove)},onMove(n){this.editor.isEditable&&(this.activeErase||(n.preventDefault(),this.points.push(dR(n)[0]),this.tick()))},onEndDrawing(){this.mouseDown=!1,this.editor.isEditable&&(this.activeErase||(this.svg.on("mousemove",null),this.svg.on("touchmove",null),this.drawing&&(this.drawing=!1,this.svg.select(`#id-${this.id}`).remove(),this.id=this.$SUtility.Guid())))},delMe(n){this.activeErase&&this.updateAttributes({lines:this.node.attrs.lines.filter(e=>e.id!==n.id)})},moveDelMe(n){this.mouseDown&&this.activeErase&&this.updateAttributes({lines:this.node.attrs.lines.filter(e=>e.id!==n.id)})},simplifyPoints(n){return iO(n.map(e=>({x:e[0],y:e[1]}))).map(e=>[e.x,e.y])},tick(){requestAnimationFrame(()=>{this.path.attr("d",n=>{const e=eO().curve(tO)(n),t=this.node.attrs.lines.filter(r=>r.id!==this.id);return this.updateAttributes({lines:[...t,{id:this.id,color:this.color,size:this.size,path:e}]}),e})})},clear(){this.updateAttributes({lines:[]})}},mounted(){this.svg=cR(this.$refs.canvas),this.svg.on("mousedown",this.onStartDrawing).on("mouseup",this.onEndDrawing).on("mouseleave",this.onEndDrawing).on("touchstart",this.onStartDrawing).on("touchend",this.onEndDrawing).on("touchleave",this.onEndDrawing)}},sO={class:"power-editor-d-b-container"},aO={class:"power-editor-d-b-block l1"},lO={style:{height:"100%","margin-left":"5px","font-size":"12px",display:"flex","align-items":"center"}},cO={class:"power-editor-d-b-block overlay"},uO={class:"power-editor-d-b-block"},dO=["d","id","stroke","stroke-width","onMousemove","onClick"];function hO(n,e,t,r,i,o){const s=v.resolveComponent("fv-button"),a=v.resolveComponent("fv-slider"),l=v.resolveComponent("media-container"),c=v.resolveComponent("node-view-wrapper");return v.openBlock(),v.createBlock(c,{class:v.normalizeClass(["power-editor-drawing-block-container",[{dark:i.thisTheme==="dark"}]]),style:v.normalizeStyle({"justify-content":t.node.attrs.alignCenter?"center":"flex-start"})},{default:v.withCtx(()=>[v.withDirectives(v.createElementVNode("div",sO,[v.createElementVNode("div",aO,[v.createVNode(s,{theme:i.thisTheme,"font-size":12,borderRadius:50,disabled:i.size<=1,background:i.thisTheme==="dark"?"rgba(0, 0, 0, 1)":"rgba(255, 255, 255, 1)",class:"power-editor-d-b-btn __size","border-color":"transparent",onClick:e[0]||(e[0]=u=>i.size=i.size>1?i.size-1:i.size)},{default:v.withCtx(()=>e[7]||(e[7]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--Remove"},null,-1)])),_:1,__:[7]},8,["theme","disabled","background"]),v.createVNode(a,{modelValue:i.size,"onUpdate:modelValue":e[1]||(e[1]=u=>i.size=u),theme:i.thisTheme,mininum:1,maxinum:10,icon:"RadioBullet",showLabel:!0,color:i.thisForeground,background:"rgba(245, 245, 245, 0.3)",style:{width:"150px",height:"100%","margin-left":"5px","margin-right":"5px"}},{default:v.withCtx(u=>[v.createElementVNode("span",lO,v.toDisplayString(u.modelValue),1)]),_:1},8,["modelValue","theme","color"]),v.createVNode(s,{theme:i.thisTheme,"font-size":12,borderRadius:50,disabled:i.size>=10,background:i.thisTheme==="dark"?"rgba(0, 0, 0, 1)":"rgba(255, 255, 255, 1)",class:"power-editor-d-b-btn __size","border-color":"transparent",onClick:e[2]||(e[2]=u=>i.size=i.size<10?i.size/1+1:i.size)},{default:v.withCtx(()=>e[8]||(e[8]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--Add"},null,-1)])),_:1,__:[8]},8,["theme","disabled","background"])]),v.createElementVNode("div",cO,[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.colorList,(u,d)=>(v.openBlock(),v.createBlock(s,{class:"power-editor-d-b-btn __color",key:"color:"+d,theme:"dark","font-size":12,borderRadius:50,background:u.color,isBoxShadow:i.color!==u.color,onClick:m=>i.color=u.color},{default:v.withCtx(()=>e[9]||(e[9]=[v.createTextVNode(v.toDisplayString(""))])),_:2,__:[9]},1032,["background","isBoxShadow","onClick"]))),128))]),v.createElementVNode("div",uO,[v.createVNode(s,{class:"power-editor-d-b-btn __clear","font-size":10,borderRadius:50,background:o.eraseBackground,theme:i.activeErase?"dark":i.thisTheme,"border-color":"transparent",style:{"margin-right":"5px"},onClick:e[3]||(e[3]=u=>i.activeErase^=!0)},{default:v.withCtx(()=>e[10]||(e[10]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--EraseTool"},null,-1)])),_:1,__:[10]},8,["background","theme"]),v.createVNode(s,{class:"power-editor-d-b-btn __clear","font-size":10,borderRadius:50,background:i.thisTheme==="dark"?"rgba(0, 0, 0, 1)":"rgba(255, 255, 255, 1)",theme:i.thisTheme,"border-color":"transparent",onClick:o.clear},{default:v.withCtx(()=>e[11]||(e[11]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--Refresh"},null,-1)])),_:1,__:[11]},8,["background","theme","onClick"])])],512),[[v.vShow,t.editor.isEditable]]),v.createVNode(l,{width:t.node.attrs.width,"onUpdate:width":e[4]||(e[4]=u=>t.node.attrs.width=u),caption:t.node.attrs.caption,alignCenter:t.node.attrs.alignCenter,"onUpdate:alignCenter":e[5]||(e[5]=u=>t.node.attrs.alignCenter=u),editor:t.editor,theme:i.thisTheme,foreground:i.thisForeground,node:t.node,getPos:t.getPos,"onUpdate:caption":e[6]||(e[6]=u=>t.updateAttributes({caption:u}))},{default:v.withCtx(()=>[(v.openBlock(),v.createElementBlock("svg",{class:v.normalizeClass(["canvas-svg",[{readonly:!t.editor.isEditable}]]),viewBox:"0 0 500 250",ref:"canvas"},[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(t.node.attrs.lines,u=>(v.openBlock(),v.createElementBlock(v.Fragment,null,[u.id!==i.id?(v.openBlock(),v.createElementBlock("path",{key:u.id,d:u.path,id:`id-${u.id}`,stroke:u.color,"stroke-width":u.size,onMousemove:d=>o.moveDelMe(u),onClick:d=>o.delMe(u)},null,40,dO)):v.createCommentVNode("",!0)],64))),256))],2))]),_:1},8,["width","caption","alignCenter","editor","theme","foreground","node","getPos"])]),_:1},8,["class","style"])}const fO=Gt(oO,[["render",hO]]),pO=xt.create({name:"drawingBlock",group:"block",draggable:!0,atom:!0,addAttributes(){return{lines:{default:[]},width:{default:"100%"},caption:{default:""},alignCenter:{default:!0}}},parseHTML(){return[{tag:"drawing-block"}]},renderHTML({HTMLAttributes:n}){return["drawing-block",$e(n)]},addNodeView(){return ti(fO)}}),mO=Je.create({name:"formatPainter",addOptions(){return{}},addStorage(){return{formatPainterStatus:"off",formatPainterList:{marks:[],attributes:[]}}},addCommands(){let n={bold:{func:"setBold",cancelFunc:"unsetBold"},italic:{func:"setItalic",cancelFunc:"unsetItalic"},underline:{func:"setUnderline",cancelFunc:"unsetUnderline"},strike:{func:"setStrike",cancelFunc:"unsetStrike"},blockquote:{func:"setBlockquote",cancelFunc:"unsetBlockquote"},superscript:{func:"setSuperscript",cancelFunc:"unsetSuperscript"},subscript:{func:"setSubscript",cancelFunc:"unsetSubscript"},powerTaskList:{func:"setPowerTaskList"},bulletList:{func:"setBulletList"},orderedList:{func:"setOrderedList"},textAlignLeft:{alias:"textAlign",func:"setTextAlign",value:"left"},textAlignCenter:{alias:"textAlign",func:"setTextAlign",value:"center"},textAlignRight:{alias:"textAlign",func:"setTextAlign",value:"right"},textAlignJustify:{alias:"textAlign",func:"setTextAlign",value:"justify"},code:{func:"setCode",cancelFunc:"unsetCode"},codeBlock:{func:"setCodeBlock"}},e={heading:{func:"setHeading",cancelFunc:"unsetHeading"},textStyle:{func:"setColor",deconstructKey:"color",cancelFunc:"unsetColor"},highlight:{func:"setHighlight",cancelFunc:"unsetHighlight"}};return{detectFormat:()=>({editor:t})=>{let r=[],i=[];for(let o in e){let s=t.getAttributes(o);if(Object.keys(s).length>0){let a=e[o];i.push({name:o,value:a.deconstructKey?s[a.deconstructKey]:s,func:a.func})}else if(e[o].cancelFunc){let a=e[o];i.push({name:o,func:a.cancelFunc})}}for(let o in n){let s=n[o].alias||o,a=!1;if(n[o].value){let l={};l[s]=n[o].value,a=t.isActive(l)}else a=t.isActive(o);if(a){let l={name:s,func:n[o].func};n[o].value&&(l.value=n[o].value),r.push(l)}else if(n[o].cancelFunc){let l={name:s,func:n[o].cancelFunc};r.push(l)}}return t.storage.formatPainter.formatPainterList={marks:r,attributes:i},{marks:r,attributes:i}},pasteFormat:()=>({editor:t,commands:r})=>{const{marks:i,attributes:o}=t.storage.formatPainter.formatPainterList;for(let s of i)s.value?r[s.func](s.value):r[s.func]();for(let s of o)s.value?r[s.func](s.value):r[s.func]();return!0},setFormatPainter:()=>({editor:t})=>{t.storage.formatPainter.formatPainterStatus="once"},stickyFormatPainter:()=>({editor:t})=>{t.storage.formatPainter.formatPainterStatus="on"},unsetFormatPainter:()=>({editor:t})=>{t.storage.formatPainter.formatPainterStatus="off"},unsetHeading:()=>({editor:t,commands:r})=>{let i=t.getAttributes("heading").level;if(i)return r.toggleHeading({level:i})},setBulletList:()=>({editor:t,commands:r})=>{if(!t.isActive("bulletList"))return r.toggleBulletList()},setOrderedList:()=>({editor:t,commands:r})=>{if(!t.isActive("orderedList"))return r.toggleOrderedList()}}},addKeyboardShortcuts(){return{"Alt-c":()=>this.editor.commands.detectFormat(),"Alt-v":()=>this.editor.commands.pasteFormat()}}}),gO={emits:["update:show"],props:{popperClass:{default:[]},title:{default:"Title"},show:{default:!1},mobileMode:{default:!1},foreground:{default:""},language:{default:"en"},theme:{default:"light"}},data(){return{thisShow:!1}},watch:{show(n){this.thisShow=n},thisShow(n){this.$emit("update:show",n)}},methods:{getTitle(n){return In(n,this.language)},triggerShow(){console.log(111),this.thisShow=!0}},beforeUnmount(){try{document.querySelector("body").removeChild(this.$el)}catch{}}},bO={style:{"font-size":"13.8px"}},_O={key:1},yO={class:"p-e-c-b-m-banner"},vO={class:"p-e-c-b-m-title"},wO={class:"main",style:{width:"100%",height:"100%"}};function xO(n,e,t,r,i,o){const s=v.resolveComponent("fv-callout"),a=v.resolveComponent("fv-drawer");return v.openBlock(),v.createElementBlock("div",{class:v.normalizeClass(["power-editor-callout-base-container",[{dark:t.theme==="dark"}]])},[t.mobileMode?v.createCommentVNode("",!0):(v.openBlock(),v.createBlock(s,{key:0,modelValue:i.thisShow,"onUpdate:modelValue":e[0]||(e[0]=l=>i.thisShow=l),lockScroll:!0,position:"bottomCenter",disabled:t.mobileMode,beak:12,space:8,theme:t.theme,effect:"click",popperClass:[...t.popperClass,"power-editor-callout-base-pc-container"],"popper-style":{background:t.theme==="dark"?"rgba(56, 56, 56, 1)":"rgba(250, 250, 250, 1)"},"border-radius":12},{header:v.withCtx(()=>[v.renderSlot(n.$slots,"header",{title:t.title},()=>[v.createElementVNode("p",bO,v.toDisplayString(t.title),1)])]),main:v.withCtx(()=>[v.renderSlot(n.$slots,"content",{index:"1"})]),default:v.withCtx(()=>[v.renderSlot(n.$slots,"trigger",{show:!1})]),_:3},8,["modelValue","disabled","theme","popperClass","popper-style"])),t.mobileMode?(v.openBlock(),v.createElementBlock("div",_O,[v.renderSlot(n.$slots,"trigger",{show:o.triggerShow}),v.createVNode(a,{modelValue:i.thisShow,"onUpdate:modelValue":e[2]||(e[2]=l=>i.thisShow=l),theme:t.theme,class:v.normalizeClass(["power-editor-callout-base-mobile-container",[{dark:t.theme==="dark"}]]),length:"calc(100% - 50px)",background:t.theme==="dark"?"rgba(56, 56, 56, 0.9)":"rgba(252, 252, 252, 0.9)","control-padding":"0px 12px",contentPadding:"0px 15px",appendBody:!0,"z-index":20},{header:v.withCtx(()=>[v.createElementVNode("div",yO,[v.renderSlot(n.$slots,"header",{title:t.title},()=>[e[3]||(e[3]=v.createElementVNode("p",{style:{width:"50px"}},null,-1)),v.createElementVNode("p",vO,v.toDisplayString(t.title),1)]),v.createElementVNode("p",{class:"p-e-c-b-m-close",style:v.normalizeStyle({color:t.theme==="dark"?"whitesmoke":t.foreground}),onClick:e[1]||(e[1]=l=>i.thisShow=!1)},v.toDisplayString(o.getTitle("Cancel")),5)])]),default:v.withCtx(()=>[v.createElementVNode("div",{class:v.normalizeClass(["p-e-c-b-m-content-block",t.popperClass])},[v.createElementVNode("div",wO,[v.renderSlot(n.$slots,"content",{index:"2"})])],2)]),_:3},8,["modelValue","theme","class","background"])])):v.createCommentVNode("",!0)],2)}const Gi=Gt(gO,[["render",xO]]),kO={components:{calloutBase:Gi},emits:["insert-link"],props:{mobileMode:{default:!1},foreground:{default:""},language:{default:"en"},theme:{default:"light"}},data(){return{link:"",caption:"",show:!1}},watch:{show(n){n?this.getSelection():(this.link="",this.caption="")}},methods:{insert(){if(this.link==="")return 0;this.caption=this.caption==""?this.link:this.caption,this.$emit("insert-link",`<a href="${this.link}">${this.caption}</a>`),this.show=!1},getSelection(){try{this.caption=window.getSelection().toString()}catch(n){console.log(n)}},getTitle(n){return In(n,this.language)}}},SO={class:"power-editor-l-c-control-block"};function CO(n,e,t,r,i,o){const s=v.resolveComponent("fv-text-box"),a=v.resolveComponent("fv-button"),l=v.resolveComponent("callout-base");return v.openBlock(),v.createBlock(l,{show:i.show,"onUpdate:show":e[2]||(e[2]=c=>i.show=c),mobileMode:t.mobileMode,title:o.getTitle("Insert Link"),foreground:t.foreground,theme:t.theme,language:t.language,popperClass:["power-editor-link-callout"]},{trigger:v.withCtx(c=>[v.renderSlot(n.$slots,"default",{show:c.show})]),content:v.withCtx(()=>[v.createElementVNode("div",{class:v.normalizeClass(["power-editor-l-c-block",[{dark:t.theme==="dark"}]])},[v.createCommentVNode("",!0),v.createVNode(s,{modelValue:i.caption,"onUpdate:modelValue":e[0]||(e[0]=c=>i.caption=c),placeholder:o.getTitle("Caption"),theme:t.theme,icon:"TextField",underline:"","border-width":2,"is-box-shadow":!0,"border-color":"rgba(200, 200, 200, 0.1)",background:t.theme==="dark"?"#1a1a1a":"#fff","focus-border-color":t.foreground,style:{width:"100%","margin-top":"5px"}},null,8,["modelValue","placeholder","theme","background","focus-border-color"]),v.createVNode(s,{modelValue:i.link,"onUpdate:modelValue":e[1]||(e[1]=c=>i.link=c),icon:"Link",placeholder:o.getTitle("Insert Link Url..."),theme:t.theme,underline:"","border-width":2,"is-box-shadow":!0,"border-color":"rgba(200, 200, 200, 0.1)",background:t.theme==="dark"?"#1a1a1a":"#fff","focus-border-color":t.foreground,style:{width:"100%","margin-top":"15px"}},null,8,["modelValue","placeholder","theme","background","focus-border-color"])],2),v.createElementVNode("div",SO,[v.createVNode(a,{theme:"dark",disabled:i.link==="",background:t.foreground,"border-radius":"6","is-box-shadow":!0,style:{width:"150px"},onClick:o.insert},{default:v.withCtx(()=>[v.createTextVNode(v.toDisplayString(o.getTitle("Insert")),1)]),_:1},8,["disabled","background","onClick"])])]),_:3},8,["show","mobileMode","title","foreground","theme","language"])}const EO=Gt(kO,[["render",CO]]),TO={components:{calloutBase:Gi},emits:["insert-embed"],props:{mobileMode:{default:!1},foreground:{default:""},language:{default:"en"},theme:{default:"light"}},data(){return{link:"",caption:"",show:!1}},watch:{show(n){n||(this.link="",this.caption="")}},methods:{insert(){if(this.link==="")return 0;this.$emit("insert-embed",`<embed-block src="${this.link}" caption="${this.caption}" theme="${this.theme}"></embed-block>`),this.show=!1},getTitle(n){return In(n,this.language)}}},AO={class:"power-editor-e-c-control-block"};function MO(n,e,t,r,i,o){const s=v.resolveComponent("fv-text-box"),a=v.resolveComponent("fv-button"),l=v.resolveComponent("callout-base");return v.openBlock(),v.createBlock(l,{show:i.show,"onUpdate:show":e[2]||(e[2]=c=>i.show=c),mobileMode:t.mobileMode,title:o.getTitle("Insert Embed"),foreground:t.foreground,theme:t.theme,language:t.language,popperClass:["power-editor-embed-callout"]},{trigger:v.withCtx(c=>[v.renderSlot(n.$slots,"default",{show:c.show})]),content:v.withCtx(()=>[v.createElementVNode("div",{class:v.normalizeClass(["power-editor-e-c-block",[{dark:t.theme==="dark"}]])},[v.createCommentVNode("",!0),v.createVNode(s,{modelValue:i.caption,"onUpdate:modelValue":e[0]||(e[0]=c=>i.caption=c),placeholder:o.getTitle("Caption"),theme:t.theme,icon:"TextField",underline:"","border-width":2,"is-box-shadow":!0,"border-color":"rgba(200, 200, 200, 0.1)","focus-border-color":t.foreground,background:t.theme==="dark"?"#1a1a1a":"#fff",style:{width:"100%","margin-top":"5px"}},null,8,["modelValue","placeholder","theme","focus-border-color","background"]),v.createVNode(s,{modelValue:i.link,"onUpdate:modelValue":e[1]||(e[1]=c=>i.link=c),icon:"Link",placeholder:o.getTitle("Insert Embed Url..."),theme:t.theme,underline:"","border-width":2,"is-box-shadow":!0,"border-color":"rgba(200, 200, 200, 0.1)","focus-border-color":t.foreground,background:t.theme==="dark"?"#1a1a1a":"#fff",style:{width:"100%","margin-top":"15px"}},null,8,["modelValue","placeholder","theme","focus-border-color","background"])],2),v.createElementVNode("div",AO,[v.createVNode(a,{theme:"dark",disabled:i.link==="",background:t.foreground,"border-radius":"6","is-box-shadow":!0,style:{width:"150px"},onClick:o.insert},{default:v.withCtx(()=>[v.createTextVNode(v.toDisplayString(o.getTitle("Insert")),1)]),_:1},8,["disabled","background","onClick"])])]),_:3},8,["show","mobileMode","title","foreground","theme","language"])}const NO=Gt(TO,[["render",MO]]),DO={components:{calloutBase:Gi},props:{foreground:{default:""},getBackground:{default:()=>{}},getForeground:{default:()=>{}},exec:{default:()=>{}},execMore:{default:()=>{}},editor:{default:null},mobileMode:{default:!1},language:{default:"en"},theme:{default:"light"}},data(){return{show:!1,colorList:[{name:"gray",color:"#787774"},{name:"purple",color:"#958DF1"},{name:"pink",color:"#f58eda"},{name:"red",color:"#F98181"},{name:"orange",color:"#FBBC88"},{name:"yellow",color:"#FAF594"},{name:"blue",color:"#4086cb"},{name:"teal",color:"#94FADB"},{name:"green",color:"#B9F18D"},{name:"rose",color:"#ee7686"},{name:"fresh_blue",color:"#70CFF8"},{name:"ice_blue",color:"#9fc2ca"},{name:"dark_blue",color:"#0c4a83"},{name:"fresh_green",color:"#55ddb6"}],highlightList:[{name:"red",color:"red"},{name:"red",color:"#ffa8a8"},{name:"yellow",color:"#FAF594"},{name:"orange",color:"#ffc078"},{name:"green",color:"#8ce99a"},{name:"blue",color:"#74c0fc"},{name:"purple",color:"#b197fc"},{name:"light_green",color:"#d1f6e7"},{name:"light_yellow",color:"#fdf0c6"},{name:"light_red",color:"#ffe3e3"},{name:"light_purple",color:"#e9e1f9"},{name:"light_orange",color:"#ffe5c7"}]}},watch:{},methods:{getTitle(n){return In(n,this.language)},execX(n){this.exec(n),this.mobileMode&&(this.show=!1)},execMoreX(n,e){this.execMore(n,e),this.mobileMode&&(this.show=!1)}}},RO={class:"peci-comment"},IO=["onClick"],OO={class:"peci-comment"},LO={class:"peci-comment"},PO=["onClick"],BO={class:"peci-comment"};function FO(n,e,t,r,i,o){const s=v.resolveComponent("callout-base");return v.openBlock(),v.createBlock(s,{show:i.show,"onUpdate:show":e[2]||(e[2]=a=>i.show=a),mobileMode:t.mobileMode,title:o.getTitle("Text Color"),foreground:t.foreground,theme:t.theme,language:t.language,popperClass:["power-editor-color-callout"]},{trigger:v.withCtx(a=>[v.renderSlot(n.$slots,"default",{show:a.show})]),content:v.withCtx(()=>[v.createElementVNode("p",{class:"power-menu-sec-title",style:v.normalizeStyle({"--power-menu-sec-title-background":t.foreground})},v.toDisplayString(o.getTitle("Foreground")),5),v.createElementVNode("div",{class:v.normalizeClass(["power-editor-color-item",[{dark:t.theme=="dark"}]]),onClick:e[0]||(e[0]=a=>o.execX("unsetColor"))},[e[3]||(e[3]=v.createElementVNode("p",{class:"peci-example"},"A",-1)),v.createElementVNode("p",RO,v.toDisplayString(o.getTitle("removeColor")),1)],2),(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.colorList,(a,l)=>(v.openBlock(),v.createElementBlock("div",{class:v.normalizeClass(["power-editor-color-item",[{dark:t.theme=="dark",choosen:t.editor.isActive("textStyle",{color:a.color})}]]),key:"color:"+l,onClick:c=>o.execMoreX("setColor",a.color)},[v.createElementVNode("p",{class:"peci-example",style:v.normalizeStyle({color:a.color})},"A",4),v.createElementVNode("p",OO,v.toDisplayString(o.getTitle(a.name)),1)],10,IO))),128)),v.createElementVNode("p",{class:"power-menu-sec-title",style:v.normalizeStyle({"--power-menu-sec-title-background":t.foreground})},v.toDisplayString(o.getTitle("Highlight Background")),5),v.createElementVNode("div",{class:v.normalizeClass(["power-editor-color-item",[{dark:t.theme=="dark"}]]),onClick:e[1]||(e[1]=a=>o.execX("unsetHighlight"))},[e[4]||(e[4]=v.createElementVNode("p",{class:"peci-example"},"A",-1)),v.createElementVNode("p",LO,v.toDisplayString(o.getTitle("removeHighlight")),1)],2),(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.highlightList,(a,l)=>(v.openBlock(),v.createElementBlock("div",{class:v.normalizeClass(["power-editor-color-item",[{dark:t.theme=="dark",choosen:t.editor.isActive("highlight",{color:a.color})}]]),key:"highlight:"+l,onClick:c=>o.execMoreX("setHighlight",{color:a.color})},[v.createElementVNode("p",{class:"peci-example",style:v.normalizeStyle({background:a.color})},"A",4),v.createElementVNode("p",BO,v.toDisplayString(o.getTitle(a.name)),1)],10,PO))),128))]),_:3},8,["show","mobileMode","title","foreground","theme","language"])}const F2=Gt(DO,[["render",FO]]),zO=[{name:"People and Fantasy",emojis:["😀","😃","😄","😁","😆","😅","😂","🤣","☺️","😊","😇","🙂","🙃","😉","😌","😍","🥰","😘","😗","😙","😚","😋","😛","😝","😜","🤪","🤨","🧐","🤓","😎","🤩","🥳","😏","😒","😞","😔","😟","😕","🙁","☹️","😣","😖","😫","😩","🥺","😢","😭","😤","😠","😡","🤬","🤯","😳","🥵","🥶","😱","😨","😰","😥","😓","🤗","🤔","🤭","🤫","🤥","😶","😐","😑","😬","🙄","😯","😦","😧","😮","😲","🥱","😴","🤤","😪","😵","🤐","🥴","🤢","🤮","🤧","😷","🤒","🤕","🤑","🤠","😈","👿","👹","👺","🤡","💩","👻","💀","☠️","👽","👾","🤖","🎃","😺","😸","😹","😻","😼","😽","🙀","😿","😾"]},{name:"Animals & Nature",emojis:["🐶","🐱","🐭","🐹","🐰","🦊","🐻","🐼","🐻","❄️","🐨","🐯","🦁","🐮","🐷","🐽","🐸","🐵","🙈","🙉","🙊","🐒","🐔","🐧","🐦","🐤","🐣","🐥","🦆","🦅","🦉","🦇","🐺","🐗","🐴","🦄","🐝","🐛","🦋","🐌","🐞","🐜","🦟","🦗","🕷","🕸","🦂","🐢","🐍","🦎","🦖","🦕","🐙","🦑","🦐","🦞","🦀","🐡","🐠","🐟","🐬","🐳","🐋","🦈","🐊","🐅","🐆","🦓","🦍","🦧","🐘","🦛","🦏","🐪","🐫","🦒","🦘","🐃","🐂","🐄","🐎","🐖","🐏","🐑","🦙","🐐","🦌","🐕","🐩","🦮","🐕🦺","🐈","🐓","🦃","🦚","🦜","🦢","🦩","🕊","🐇","🦝","🦨","🦡","🦦","🦥","🐁","🐀","🐿","🦔","🐾","🐉","🐲","🌵","🎄","🌲","🌳","🌴","🌱","🌿","☘️","🍀","🎍","🎋","🍃","🍂","🍁","🍄","🐚","🌾","💐","🌷","🌹","🥀","🌺","🌸","🌼","🌻","🌞","🌝","🌛","🌜","🌚","🌕","🌖","🌗","🌘","🌑","🌒","🌓","🌔","🌙","🌎","🌍","🌏","🪐","💫","⭐️","🌟","✨","⚡️","☄️","💥","🔥","🌪","🌈","☀️","🌤","⛅️","🌥","☁️","🌦","🌧","⛈","🌩","🌨","❄️","☃️","⛄️","🌬","💨","💧","💦","☔️","☂️","🌊","🌫"]},{name:"Food & Drink",emojis:["🍏","🍎","🍐","🍊","🍋","🍌","🍉","🍇","🍓","🍈","🍒","🍑","🥭","🍍","🥥","🥝","🍅","🍆","🥑","🥦","🥬","🥒","🌶","🌽","🥕","🧄","🧅","🥔","🍠","🥐","🥯","🍞","🥖","🥨","🧀","🥚","🍳","🧈","🥞","🧇","🥓","🥩","🍗","🍖","🦴","🌭","🍔","🍟","🍕","🥪","🥙","🧆","🌮","🌯","🥗","🥘","🥫","🍝","🍜","🍲","🍛","🍣","🍱","🥟","🦪","🍤","🍙","🍚","🍘","🍥","🥠","🥮","🍢","🍡","🍧","🍨","🍦","🥧","🧁","🍰","🎂","🍮","🍭","🍬","🍫","🍿","🍩","🍪","🌰","🥜","🍯","🥛","🍼","☕️","🍵","🧃","🥤","🍶","🍺","🍻","🥂","🍷","🥃","🍸","🍹","🧉","🍾","🧊","🥄","🍴","🍽","🥣","🥡","🥢","🧂",""]},{name:"Activity and Sports",emojis:["⚽️","🏀","🏈","⚾️","🥎","🎾","🏐","🏉","🥏","🎱","🪀","🏓","🏸","🏒","🏑","🥍","🏏","🥅","⛳️","🪁","🏹","🎣","🤿","🥊","🥋","🎽","🛹","🛷","⛸","🥌","🎿","⛷","🏂","🪂","🏋️♀️","🏋️","🏋️♂️","🤼♀️","🤼","🤼♂️","🤸♀️","🤸","🤸♂️","⛹️♀️","⛹️","⛹️♂️","🤺","🤾♀️","🤾","🤾♂️","🏌️♀️","🏌️","🏌️♂️","🏇","🧘♀️","🧘","🧘♂️","🏄♀️","🏄","🏄♂️","🏊♀️","🏊","🏊♂️","🤽♀️","🤽","🤽♂️","🚣♀️","🚣","🚣♂️","🧗♀️","🧗","🧗♂️","🚵♀️","🚵","🚵♂️","🚴♀️","🚴","🚴♂️","🏆","🥇","🥈","🥉","🏅","🎖","🏵","🎗","🎫","🎟","🎪","🤹","🤹♂️","🤹♀️","🎭","🩰","🎨","🎬","🎤","🎧","🎼","🎹","🥁","🪘","🎷","🎺","🎸","🪕","🎻","🎲","♟","🎯","🎳","🎮","🎰","🧩"]},{name:"Travel & Places",emojis:["🚗","🚕","🚙","🚌","🚎","🏎","🚓","🚑","🚒","🚐","🚚","🚛","🚜","🦯","🦽","🦼","🛴","🚲","🛵","🏍","🛺","🚨","🚔","🚍","🚘","🚖","🚡","🚠","🚟","🚃","🚋","🚞","🚝","🚄","🚅","🚈","🚂","🚆","🚇","🚊","🚉","✈️","🛫","🛬","🛩","💺","🛰","🚀","🛸","🚁","🛶","⛵️","🚤","🛥","🛳","⛴","🚢","⚓️","🪝","⛽️","🚧","🚦","🚥","🚏","🗺","🗿","🗽","🗼","🏰","🏯","🏟","🎡","🎢","🎠","⛲️","⛱","🏖","🏝","🏜","🌋","⛰","🏔","🗻","🏕","⛺️","🏠","🏡","🏘","🏚","🏗","🏭","🏢","🏬","🏣","🏤","🏥","🏦","🏨","🏪","🏫","🏩","💒","🏛","⛪️","🕌","🕍","🛕","🕋","⛩","🛤","🛣","🗾","🎑","🏞","🌅","🌄","🌠","🎇","🎆","🌇","🌆","🏙","🌃","🌌","🌉","🌁"]},{name:"Objects",emojis:["⌚️","📱","📲","💻","⌨️","🖥","🖨","🖱","🖲","🕹","🗜","💽","💾","💿","📀","📼","📷","📸","📹","🎥","📽","🎞","📞","☎️","📟","📠","📺","📻","🎙","🎚","🎛","🧭","⏱","⏲","⏰","🕰","⌛️","⏳","📡","🔋","🔌","💡","🔦","🕯","🪔","🧯","🛢","💸","💵","💴","💶","💷","💰","💳","💎","⚖️","🧰","🔧","🔨","⚒","🛠","⛏","🔩","⚙️","🧱","⛓","🧲","🔫","💣","🧨","🪓","🔪","🗡","⚔️","🛡","🚬","⚰️","⚱️","🏺","🔮","📿","🧿","💈","⚗️","🔭","🔬","🕳","🩹","🩺","💊","💉","🩸","🧬","🦠","🧫","🧪","🌡","🧹","🧺","🧻","🚽","🚰","🚿","🛁","🛀","🧼","🪒","🧽","🧴","🛎","🔑","🗝","🚪","🪑","🛋","🛏","🛌","🧸","🖼","🛍","🛒","🎁","🎈","🎏","🎀","🪄","🪅","🎊","🎉","🎎","🏮","🎐","🧧","✉️","📩","📨","📧","💌","📥","📤","📦","🏷","📪","📫","📬","📭","📮","📯","📜","📃","📄","📑","🧾","📊","📈","📉","🗒","🗓","📆","📅","🗑","📇","🗃","🗳","🗄","📋","📁","📂","🗂","🗞","📰","📓","📔","📒","📕","📗","📘","📙","📚","📖","🔖","🧷","🔗","📎","🖇","📐","📏","🧮","📌","📍","✂️","🖊","🖋","✒️","🖌","🖍","📝","✏️","🔍","🔎","🔏","🔐","🔒","🔓"]},{name:"Symbols",emojis:["❤️","🧡","💛","💚","💙","💜","🖤","🤍","🤎","💔","❣️","💕","💞","💓","💗","💖","💘","💝","💟","☮️","✝️","☪️","🕉","☸️","✡️","🔯","🕎","☯️","☦️","🛐","⛎","♈️","♉️","♊️","♋️","♌️","♍️","♎️","♏️","♐️","♑️","♒️","♓️","🆔","⚛️","🉑","☢️","☣️","📴","📳","🈶","🈚️","🈸","🈺","🈷️","✴️","🆚","💮","🉐","㊙️","㊗️","🈴","🈵","🈹","🈲","🅰️","🅱️","🆎","🆑","🅾️","🆘","❌","⭕️","🛑","⛔️","📛","🚫","💯","💢","♨️","🚷","🚯","🚳","🚱","🔞","📵","🚭","❗️","❕","❓","❔","‼️","⁉️","🔅","🔆","〽️","⚠️","🚸","🔱","⚜️","🔰","♻️","✅","🈯️","💹","❇️","✳️","❎","🌐","💠","Ⓜ️","🌀","💤","🏧","🚾","♿️","🅿️","🛗","🈳","🈂️","🛂","🛃","🛄","🛅","🚹","🚺","🚼","⚧","🚻","🚮","🎦","📶","🈁","🔣","ℹ️","🔤","🔡","🔠","🆖","🆗","🆙","🆒","🆕","🆓","0️⃣","1️⃣","2️⃣","3️⃣","4️⃣","5️⃣","6️⃣","7️⃣","8️⃣","9️⃣","🔟","🔢","#️⃣","*️⃣","⏏️","▶️","⏸","⏯","⏹","⏺","⏭","⏮","⏩","⏪","⏫","⏬","◀️","🔼","🔽","➡️","⬅️","⬆️","⬇️","↗️","↘️","↙️","↖️","↕️","↔️","↪️","↩️","⤴️","⤵️","🔀","🔁","🔂","🔄","🔃","🎵","🎶","➕","➖","➗","✖️","♾","💲","💱","™️","©️","®️","〰️","➰","➿","🔚","🔙","🔛","🔝","🔜","✔️","☑️","🔘","🔴","🟠","🟡","🟢","🔵","🟣","⚫️","⚪️","🟤","🔺","🔻","🔸","🔹","🔶","🔷","🔳","🔲","▪️","▫️","◾️","◽️","◼️","◻️","🟥","🟧","🟨","🟩","🟦","🟪","⬛️","⬜️","🟫","🔈","🔇","🔉","🔊","🔔","🔕","📣","📢","👁🗨","💬","💭","🗯","♠️","♣️","♥️","♦️","🃏","🎴","🀄️","🕐","🕑","🕒","🕓","🕔","🕕","🕖","🕗","🕘","🕙","🕚","🕛","🕜","🕝","🕞","🕟","🕠","🕡","🕢","🕣","🕤","🕥","🕦","🕧"]},{name:"Flags",emojis:["🏳️","🏴","🏁","🚩","🏳️🌈","🏳️","🏴☠️"]}],qO={components:{calloutBase:Gi},emits:["insert-emoji"],props:{editor:{default:null},foreground:{default:""},mobileMode:{default:!1},language:{default:"en"},theme:{default:"light"}},data(){return{emoji_list:zO,show:!1}},watch:{},methods:{getTitle(n){return In(n,this.language)},insertEmoji(n){this.$emit("insert-emoji",n),this.mobileMode&&(this.show=!1)},insertRandom(){let n=(Math.random()*(this.emoji_list.length-1)).toFixed(0),e=(Math.random()*(this.emoji_list[n].emojis.length-1)).toFixed(0);this.$emit("insert-emoji",this.emoji_list[n].emojis[e]),this.mobileMode&&(this.show=!1)}}},HO={class:"power-editor-emoji-banner"},VO={style:{width:"10px","font-size":"13.8px",flex:"1","font-weight":"bold","text-align":"center"}},UO={class:"title"},GO={class:"power-editor-emoji-group"},$O=["innerHTML","onClick"];function WO(n,e,t,r,i,o){const s=v.resolveComponent("fv-button"),a=v.resolveComponent("fv-infinite-scroll-view"),l=v.resolveComponent("callout-base");return v.openBlock(),v.createBlock(l,{show:i.show,"onUpdate:show":e[1]||(e[1]=c=>i.show=c),mobileMode:t.mobileMode,title:"Emoji",foreground:t.foreground,theme:t.theme,language:t.language,popperClass:["power-editor-emoji-callout"]},{trigger:v.withCtx(c=>[v.renderSlot(n.$slots,"default",{show:c.show})]),header:v.withCtx(c=>[v.createElementVNode("div",HO,[v.createElementVNode("p",VO,v.toDisplayString(o.getTitle(c.title)),1),v.createVNode(s,{theme:t.theme,icon:"Shuffle",background:t.theme==="dark"?"rgba(0, 0, 0, 0.2)":"rgba(255, 255, 255, 0.3)","font-size":"10","border-radius":"6",isBoxShadow:!0,onClick:o.insertRandom},{default:v.withCtx(()=>[v.createTextVNode(v.toDisplayString(o.getTitle("Random")),1)]),_:1},8,["theme","background","onClick"])])]),content:v.withCtx(()=>[v.createVNode(a,{modelValue:i.emoji_list,"onUpdate:modelValue":e[0]||(e[0]=c=>i.emoji_list=c),batchSize:1,style:{width:"100%",height:"100%"}},{default:v.withCtx(c=>[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(c.dynamicValue,(u,d)=>(v.openBlock(),v.createElementBlock("div",{class:"power-editor-emoji-list",key:`type:${d}`},[v.createElementVNode("p",UO,v.toDisplayString(o.getTitle(u.name)),1),v.createElementVNode("div",GO,[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(u.emojis,(m,b)=>(v.openBlock(),v.createElementBlock("i",{key:b,class:"emoji-item",innerHTML:m,onClick:f=>o.insertEmoji(m)},null,8,$O))),128))])]))),128))]),_:1},8,["modelValue"])]),_:3},8,["show","mobileMode","foreground","theme","language"])}const KO=Gt(qO,[["render",WO]]),jO={components:{calloutBase:Gi},emits:["insert-image"],props:{mobileMode:{default:!1},foreground:{default:""},language:{default:"en"},theme:{default:"light"}},data(){return{url:"",show:!1,contentName:["content-1","content-2"]}},watch:{show(n){n||(this.url="",this.mobileMode?this.$refs.img_local_2.value="":this.$refs.img_local_1.value="")}},methods:{insert(){if(this.url==="")return 0;this.$emit("insert-image",[this.url]),this.show=!1},async insertLocal(n){let e=this.$refs[`img_local_${n}`].files;if(e.length<1)return 0;let t=[];for(let r of e){let i=new FileReader;i.readAsDataURL(r);let o=await new Promise(s=>{i.onload=a=>{s(a.target.result)}});t.push(o)}this.$emit("insert-image",t),this.show=!1},getTitle(n){return In(n,this.language)}}},QO={class:"power-editor-i-c-title"},YO=["onClick"],ZO={class:"power-editor-i-c-t2"},XO=["onChange"],JO={class:"power-editor-i-c-title"},eL={class:"power-editor-i-c-control-block"};function tL(n,e,t,r,i,o){const s=v.resolveComponent("fv-text-box"),a=v.resolveComponent("fv-button"),l=v.resolveComponent("callout-base");return v.openBlock(),v.createBlock(l,{show:i.show,"onUpdate:show":e[1]||(e[1]=c=>i.show=c),mobileMode:t.mobileMode,title:o.getTitle("Insert Image"),foreground:t.foreground,theme:t.theme,language:t.language,popperClass:["power-editor-image-callout"]},{trigger:v.withCtx(c=>[v.renderSlot(n.$slots,"default",{show:c.show})]),content:v.withCtx(c=>[v.createElementVNode("div",{class:v.normalizeClass(["power-editor-i-c-block",[{dark:t.theme==="dark"}]])},[v.createElementVNode("p",QO,v.toDisplayString(o.getTitle("Method"))+" 1",1),v.createElementVNode("i",{class:"ms-Icon ms-Icon--Photo2Add power-editor-i-c-icon-1",style:v.normalizeStyle({color:t.foreground}),onClick:u=>n.$refs[`img_local_${c.index}`].click()},null,12,YO),v.createElementVNode("p",ZO,v.toDisplayString(o.getTitle("Choose Local Image as Base64 (multiple).")),1),v.createElementVNode("input",{type:"file",accept:"image/gif,image/png,image/jpeg,image/x-png,image/svg+xml",multiple:"true",style:{display:"none"},ref:`img_local_${c.index}`,onChange:u=>o.insertLocal(c.index)},null,40,XO)],2),v.createElementVNode("div",{class:v.normalizeClass(["power-editor-i-c-block",[{dark:t.theme==="dark"}]])},[v.createElementVNode("p",JO,v.toDisplayString(o.getTitle("Method"))+" 2",1),v.createVNode(s,{modelValue:i.url,"onUpdate:modelValue":e[0]||(e[0]=u=>i.url=u),placeholder:o.getTitle("Insert Image Url."),theme:t.theme,underline:"",icon:"Link","border-width":2,"is-box-shadow":!0,"border-color":"rgba(200, 200, 200, 0.1)","focus-border-color":t.foreground,background:t.theme==="dark"?"#1a1a1a":"#fff",style:{width:"90%",border:"thin",outline:"none"},ref:"img_link"},null,8,["modelValue","placeholder","theme","focus-border-color","background"])],2),v.createElementVNode("div",eL,[v.createVNode(a,{theme:"dark",disabled:i.url==="",background:t.foreground,"border-radius":"6","is-box-shadow":!0,style:{width:"150px"},onClick:o.insert},{default:v.withCtx(()=>[v.createTextVNode(v.toDisplayString(o.getTitle("Insert")),1)]),_:1},8,["disabled","background","onClick"])])]),_:3},8,["show","mobileMode","title","foreground","theme","language"])}const nL=Gt(jO,[["render",tL]]),rL={components:{calloutBase:Gi},props:{mobileMode:{default:!1},foreground:{default:""},getBackground:{default:()=>{}},getForeground:{default:()=>{}},execMore:{default:()=>{}},editor:{default:null},language:{default:"en"},theme:{default:"light"}},data(){return{show:!1}},watch:{},methods:{getTitle(n){return In(n,this.language)},execX(n){this.exec(n),this.mobileMode&&(this.show=!1)},execMoreX(n,e){this.execMore(n,e),this.mobileMode&&(this.show=!1)}}},iL=["onClick"],oL={class:"pehi-comment"};function sL(n,e,t,r,i,o){const s=v.resolveComponent("fv-button"),a=v.resolveComponent("callout-base");return v.openBlock(),v.createBlock(a,{show:i.show,"onUpdate:show":e[0]||(e[0]=l=>i.show=l),mobileMode:t.mobileMode,title:o.getTitle("Headers"),foreground:t.foreground,theme:t.theme,language:t.language,popperClass:["power-editor-header-callout"]},{trigger:v.withCtx(l=>[v.renderSlot(n.$slots,"default",{show:l.show})]),content:v.withCtx(()=>[(v.openBlock(),v.createElementBlock(v.Fragment,null,v.renderList(6,l=>v.createElementVNode("div",{class:v.normalizeClass(["power-editor-heading-item",[{dark:t.theme=="dark",choosen:t.editor.isActive("heading",{level:l})}]]),key:"color:"+l,onClick:c=>o.execMoreX("toggleHeading",{level:l})},[v.createVNode(s,{class:"power-editor-cmd-btn",theme:t.theme,isBoxShadow:!0,background:t.getBackground(t.editor.isActive("heading",{level:l})),foreground:t.getForeground(t.editor.isActive("heading",{level:l})),title:o.getTitle("Heading")+l},{default:v.withCtx(()=>[v.createTextVNode("H"+v.toDisplayString(l),1)]),_:2},1032,["theme","background","foreground","title"]),v.createElementVNode("p",oL,v.toDisplayString(o.getTitle("Heading"))+" "+v.toDisplayString(l),1)],10,iL)),64))]),_:3},8,["show","mobileMode","title","foreground","theme","language"])}const aL=Gt(rL,[["render",sL]]),lL={components:{calloutBase:Gi},props:{mobileMode:{default:!1},foreground:{default:""},getBackground:{default:()=>{}},getForeground:{default:()=>{}},exec:{default:()=>{}},execMore:{default:()=>{}},editor:{default:null},language:{default:"en"},theme:{default:"light"}},data(){return{row:"3",column:"3",show:!1}},watch:{},methods:{getTitle(n){return In(n,this.language)},execX(n){this.exec(n),this.mobileMode&&(this.show=!1)},execMoreX(n,e){this.execMore(n,e),this.mobileMode&&(this.show=!1)}}},cL={class:"power-editor-table-insert-block"},uL={class:"power-editor-table-control-block"};function dL(n,e,t,r,i,o){const s=v.resolveComponent("fv-text-box"),a=v.resolveComponent("fv-button"),l=v.resolveComponent("callout-base");return v.openBlock(),v.createBlock(l,{show:i.show,"onUpdate:show":e[13]||(e[13]=c=>i.show=c),mobileMode:t.mobileMode,title:o.getTitle("Table"),foreground:t.foreground,theme:t.theme,language:t.language,popperClass:["power-editor-table-callout"]},{trigger:v.withCtx(c=>[v.renderSlot(n.$slots,"default",{show:c.show})]),content:v.withCtx(()=>[v.createElementVNode("div",cL,[v.createVNode(s,{modelValue:i.row,"onUpdate:modelValue":e[0]||(e[0]=c=>i.row=c),placeholder:o.getTitle("Row"),theme:t.theme,class:"power-editor-table-text-box",underline:"","border-width":2,"is-box-shadow":!0,"border-color":"rgba(200, 200, 200, 0.1)",background:t.theme==="dark"?"#1a1a1a":"#fff","focus-border-color":t.foreground,onKeydown:e[1]||(e[1]=v.withKeys(c=>o.execMoreX("insertTable",{rows:parseInt(i.row),cols:parseInt(i.column),withHeaderRow:!0}),["enter"]))},null,8,["modelValue","placeholder","theme","background","focus-border-color"]),v.createVNode(s,{modelValue:i.column,"onUpdate:modelValue":e[2]||(e[2]=c=>i.column=c),placeholder:o.getTitle("Column"),theme:t.theme,class:"power-editor-table-text-box",underline:"","border-width":2,"is-box-shadow":!0,"border-color":"rgba(200, 200, 200, 0.1)",background:t.theme==="dark"?"#1a1a1a":"#fff","focus-border-color":t.foreground,onKeydown:e[3]||(e[3]=v.withKeys(c=>o.execMoreX("insertTable",{rows:parseInt(i.row),cols:parseInt(i.column),withHeaderRow:!0}),["enter"]))},null,8,["modelValue","placeholder","theme","background","focus-border-color"]),v.createVNode(a,{theme:"dark",disabled:!i.row||!i.column||isNaN(i.row)||isNaN(i.column),"is-box-shadow":!0,background:t.foreground,"border-radius":6,style:{width:"40px",height:"40px"},onClick:e[4]||(e[4]=c=>o.execMoreX("insertTable",{rows:parseInt(i.row),cols:parseInt(i.column),withHeaderRow:!0}))},{default:v.withCtx(()=>e[14]||(e[14]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--AddBold"},null,-1)])),_:1,__:[14]},8,["disabled","background"])]),v.createElementVNode("div",uL,[v.createVNode(a,{theme:"dark",class:"power-editor-table-control-item",background:"rgba(212, 78, 82, 1)","is-box-shadow":!0,title:o.getTitle("Delete Column"),onClick:e[5]||(e[5]=c=>t.exec("deleteColumn"))},{default:v.withCtx(()=>e[15]||(e[15]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--DockLeft"},null,-1)])),_:1,__:[15]},8,["title"]),v.createVNode(a,{theme:"dark",class:"power-editor-table-control-item",background:"rgba(212, 78, 82, 1)","is-box-shadow":!0,title:o.getTitle("Delete Row"),onClick:e[6]||(e[6]=c=>o.execX("deleteRow"))},{default:v.withCtx(()=>e[16]||(e[16]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--DockBottom"},null,-1)])),_:1,__:[16]},8,["title"]),e[23]||(e[23]=v.createElementVNode("hr",null,null,-1)),v.createVNode(a,{theme:"dark",class:"power-editor-table-control-item",background:t.foreground,"is-box-shadow":!0,title:o.getTitle("Add Row Before"),onClick:e[7]||(e[7]=c=>o.execX("addRowBefore"))},{default:v.withCtx(()=>e[17]||(e[17]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--UpArrowShiftKey"},null,-1)])),_:1,__:[17]},8,["background","title"]),v.createVNode(a,{theme:"dark",class:"power-editor-table-control-item",background:t.foreground,"is-box-shadow":!0,title:o.getTitle("Add Row After"),onClick:e[8]||(e[8]=c=>o.execX("addRowAfter"))},{default:v.withCtx(()=>e[18]||(e[18]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--UpArrowShiftKey",style:{transform:"rotate(180deg)"}},null,-1)])),_:1,__:[18]},8,["background","title"]),v.createVNode(a,{theme:"dark",class:"power-editor-table-control-item",background:t.foreground,"is-box-shadow":!0,title:o.getTitle("Add Column Before"),onClick:e[9]||(e[9]=c=>o.execX("addColumnBefore"))},{default:v.withCtx(()=>e[19]||(e[19]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--UpArrowShiftKey",style:{transform:"rotate(-90deg)"}},null,-1)])),_:1,__:[19]},8,["background","title"]),v.createVNode(a,{theme:"dark",class:"power-editor-table-control-item",background:t.foreground,"is-box-shadow":!0,title:o.getTitle("Add Column After"),onClick:e[10]||(e[10]=c=>o.execX("addColumnAfter"))},{default:v.withCtx(()=>e[20]||(e[20]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--UpArrowShiftKey",style:{transform:"rotate(90deg)"}},null,-1)])),_:1,__:[20]},8,["background","title"]),e[24]||(e[24]=v.createElementVNode("hr",null,null,-1)),v.createVNode(a,{theme:t.theme,class:"power-editor-table-control-item","is-box-shadow":!0,title:o.getTitle("Merge Cells"),onClick:e[11]||(e[11]=c=>o.execX("mergeCells"))},{default:v.withCtx(()=>e[21]||(e[21]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--PPSOneLandscape"},null,-1)])),_:1,__:[21]},8,["theme","title"]),v.createVNode(a,{theme:t.theme,class:"power-editor-table-control-item","is-box-shadow":!0,title:o.getTitle("Split Cell"),onClick:e[12]||(e[12]=c=>o.execX("splitCell"))},{default:v.withCtx(()=>e[22]||(e[22]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--PPSTwoPortrait"},null,-1)])),_:1,__:[22]},8,["theme","title"])])]),_:3},8,["show","mobileMode","title","foreground","theme","language"])}const z2=Gt(lL,[["render",dL]]),hL={components:{linkCallout:EO,embedCallout:NO,colorCallout:F2,emojiCallout:KO,imageCallout:nL,headingCallout:aL,TableCallout:z2},emits:["update:theme","save-click"],props:{editor:{default:()=>({})},showSave:{default:!0},mobileMode:{default:!1},tippyOptions:{default:100},toolbarHeight:{default:70},toolbarBorderRadius:{default:""},foreground:{default:""},language:{default:"en"},theme:{default:"light"}},data(){return{thisTheme:this.theme,timer:{formatPainter:null}}},watch:{theme(n){this.thisTheme=n},thisTheme(n){this.$emit("update:theme",n)}},computed:{highlightColor(){return this.thisTheme==="dark"?{f:"rgba(36, 36, 36, 1)",b:"whitesmoke"}:{f:"whitesmoke",b:"rgba(36, 36, 36, 1)"}},formatPainterStatus(){return!this.editor||!this.editor.storage||!this.editor.storage.formatPainter?"off":this.editor.storage.formatPainter.formatPainterStatus},showFormatPainter(){return this.formatPainterStatus!=="off"}},mounted(){this.thisTheme=this.theme},methods:{getTitle(n){return In(n,this.language)},getForeground(n,e={light:"rgba(65, 74, 90, 1)",dark:"rgba(245, 245, 245, 1)"}){return n?this.highlightColor.f:typeof e=="string"?e:e[this.thisTheme]},getBackground(n){return n?this.highlightColor.b:this.thisTheme==="dark"?"rgba(36, 36, 36, 0)":"rgba(255, 255, 255, 0)"},exec(n){n&&this.editor.chain().focus()[n]().run()},execMore(n,e){this.editor.chain().focus()[n](e).run()},insert(n){this.editor.commands.insertContent(n)},insertEmoji(n){this.editor.chain().focus().insertContent(n).run()},insertImg(n){n.forEach(e=>{this.insert(`<img src="${e}"></img>
|
|
435
|
+
please report what input caused this bug`);return x=x.slice(1,-1),{type:"verb",mode:"text",body:x,star:T}}K3.hasOwnProperty(_[0])&&!vt[this.mode][_[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+_[0]+'" used in math mode',g),_=K3[_[0]]+_.substr(1));var I=pP.exec(_);I&&(_=_.substring(0,I.index),_==="i"?_="ı":_==="j"&&(_="ȷ"));var P;if(vt[this.mode][_]){this.settings.strict&&this.mode==="math"&&Io.indexOf(_)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+_[0]+'" used in math mode',g);var z=vt[this.mode][_].group,G=Qn.range(g),Z;if(Nf.hasOwnProperty(z)){var oe=z;Z={type:"atom",mode:this.mode,family:oe,loc:G,text:_}}else Z={type:z,mode:this.mode,loc:G,text:_};P=Z}else if(_.charCodeAt(0)>=128)this.settings.strict&&(Ce(_.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+_[0]+'" used in math mode',g):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+_[0]+'"'+(" ("+_.charCodeAt(0)+")"),g)),P={type:"textord",mode:"text",loc:Qn.range(g),text:_};else return null;if(this.consume(),I)for(var ae=0;ae<I[0].length;ae++){var le=I[0][ae];if(!up[le])throw new o("Unknown accent ' "+le+"'",g);var ge=up[le][this.mode]||up[le].text;if(!ge)throw new o("Accent "+le+" unsupported in "+this.mode+" mode",g);P={type:"accent",mode:this.mode,loc:Qn.range(g),label:ge,isStretchy:!1,isShifty:!0,base:P}}return P},A}();j3.endOfExpression=["}","\\endgroup","\\end","\\right","&"];var vP=function(h,p){if(!(typeof h=="string"||h instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var g=new j3(h,p);delete g.gullet.macros.current["\\df@tag"];var _=g.parse();if(delete g.gullet.macros.current["\\current@color"],delete g.gullet.macros.current["\\color"],g.gullet.macros.get("\\df@tag")){if(!p.displayMode)throw new o("\\tag works only in display equations");g.gullet.feed("\\df@tag"),_=[{type:"tag",mode:"text",body:_,tag:g.parse()}]}return _},dp=vP,Q3=function(h,p,g){p.textContent="";var _=hp(h,g).toNode();p.appendChild(_)};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),Q3=function(){throw new o("KaTeX doesn't work in quirks mode.")});var wP=function(h,p){var g=hp(h,p).toMarkup();return g},xP=function(h,p){var g=new E(p);return dp(h,g)},Y3=function(h,p,g){if(g.throwOnError||!(h instanceof o))throw h;var _=K.makeSpan(["katex-error"],[new cn(p)]);return _.setAttribute("title",h.toString()),_.setAttribute("style","color:"+g.errorColor),_},hp=function(h,p){var g=new E(p);try{var _=dp(h,g);return TL(_,h,g)}catch(x){return Y3(x,h,g)}},kP=function(h,p){var g=new E(p);try{var _=dp(h,g);return AL(_,h,g)}catch(x){return Y3(x,h,g)}},SP={version:"0.13.18",render:Q3,renderToString:wP,ParseError:o,__parse:xP,__renderToDomTree:hp,__renderToHTMLTree:kP,__setFontMetrics:Af,__defineSymbol:C,__defineMacro:B,__domTree:{Span:$i,Anchor:Eo,SymbolNode:cn,SvgNode:tn,PathNode:lr,LineNode:cr}},CP=SP;return r=r.default,r}()})}(tc)),tc.exports}var sN=oN();const Vv=or(sN),aN={components:{NodeViewWrapper:Mi},props:{editor:{type:Object},node:{type:Object},decorations:{type:Array},selected:{type:Boolean},extension:{type:Object},getPos:{type:Function},updateAttributes:{type:Function},deleteNode:{type:Function}},data(){return{left:0,top:100,thisValue:this.node.attrs.value,showPopper:!1,equationString:"",errorMsg:"",active:!1,outsideEvent:n=>{if(!this.showPopper)return 0;let e=n.target,t=!1;for(;e&&e.tagName&&e.tagName.toLowerCase()!="body";){if(e==this.$el){t=!0;break}e=e.parentNode}t||this.close(!1)},thisTheme:this.editor.storage.defaultStorage.theme,thisForeground:this.editor.storage.defaultStorage.foreground,getTitle:this.editor.storage.defaultStorage.getTitle,inputHight:"",lock:!1}},watch:{showPopper(n){n&&(this.showPos(),this.$nextTick(()=>{this.$refs.input&&(this.inputHight=this.$refs.input.scrollHeight)}))},thisValue(n){n===""?(this.equationString="",this.lock=!1):this.render(),this.$nextTick(()=>{this.$refs.input&&(this.inputHight=this.$refs.input.scrollHeight)})},"editor.storage.defaultStorage.theme"(n){this.thisTheme=n},"editor.storage.defaultStorage.foreground"(n){this.thisForeground=n},selected(n){n&&this.isCurrentNodeSelection()&&this.show()}},computed:{focusForeground(){try{let n=ec(this.thisForeground);return n=n.alpha(.3),n.cssa()}catch{return""}}},mounted(){this.outSideClickInit(),this.render(),this.$nextTick(()=>{this.node.attrs.value===""&&this.show()})},methods:{outSideClickInit(){window.addEventListener("click",this.outsideEvent)},render(){try{this.equationString=Vv.renderToString(this.thisValue.replace(/\\tag\{.*?\}/g,""),{throwOnError:!0,globalGroup:"my-katex-"}),this.lock=!1}catch(n){if(n instanceof Vv.ParseError)this.errorMsg=("Error in LaTeX '"+this.thisValue+"': "+n.message).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");else throw n;this.lock=!0}},showPos(){this.$nextTick(()=>{let n=this.$refs.target,e=n.getBoundingClientRect().bottom,t=n.getBoundingClientRect().left;e<50?this.top=-100:this.top=100,t+300>document.body.clientWidth?this.left=document.body-300-t:this.left=0})},show(){this.editor.isEditable&&(this.showPopper=!0,setTimeout(()=>{this.$refs.input&&this.$refs.input.focus()},300))},isCurrentNodeSelection(){const{selection:n}=this.editor.state;return n instanceof Te&&n.from===this.getPos()},close(n=!0){this.showPopper=!1,n?this.updateAttributes({value:this.thisValue}):this.thisValue=this.node.attrs.value,this.editor.commands.focus();const{tr:e}=this.editor.view.state;let t=null;this.$refs.input.selectionEnd===0?t=Ee.near(e.doc.resolve(this.getPos())):t=Ee.near(e.doc.resolve(this.getPos()+this.node.nodeSize-1)),e.setSelection(t),this.editor.view.dispatch(e)},closeWithLeftRight(n){let e=this.$refs.input.selectionStart,t=this.$refs.input.selectionEnd;e===t&&(n.key==="ArrowLeft"&&e===0&&this.close(!1),n.key==="ArrowRight"&&e===this.$refs.input.value.length&&this.close(!1),n.key==="ArrowUp"&&e===0&&this.close(!1),n.key==="ArrowDown"&&e===this.$refs.input.value.length&&this.close(!1))}},beforeUnmount(){window.removeEventListener("click",this.outsideEvent)}},lN=["placeholder"],cN=["placeholder","innerHTML"];function uN(n,e,t,r,i,o){const s=v.resolveComponent("fv-button"),a=v.resolveComponent("node-view-wrapper");return t.node?(v.openBlock(),v.createBlock(a,{key:0,as:t.node.attrs.tag,class:v.normalizeClass(["power-editor-equation-container",{dark:i.thisTheme==="dark",div:t.node.attrs.tag=="div",selected:t.selected}]),style:v.normalizeStyle({"--selected-bg":o.focusForeground})},{default:v.withCtx(()=>[v.createVNode(v.Transition,{name:"power-editor-equation-popper-fade"},{default:v.withCtx(()=>[v.withDirectives(v.createElementVNode("div",{class:"power-editor-equation-popper-container",style:v.normalizeStyle({left:`${i.left}px`,top:`${i.top}%`}),onKeyup:e[3]||(e[3]=v.withKeys(l=>i.lock?"":o.close(),["enter"]))},[v.withDirectives(v.createElementVNode("textarea",{"onUpdate:modelValue":e[0]||(e[0]=l=>i.thisValue=l),class:"power-editor-equation-popper-input",placeholder:t.node.attrs.placeholder,ref:"input",style:v.normalizeStyle({height:`${i.inputHight}px`}),onKeydown:[e[1]||(e[1]=v.withKeys(l=>l.preventDefault(),["enter"])),e[2]||(e[2]=l=>o.closeWithLeftRight(l))]},null,44,lN),[[v.vModelText,i.thisValue]]),v.createVNode(s,{class:"power-editor-equation-popper-btn",theme:"dark",disabled:i.lock,icon:"AcceptMedium",background:i.thisForeground,"is-box-shadow":!0,onClick:o.close},{default:v.withCtx(()=>[v.createTextVNode(v.toDisplayString(i.getTitle("Done")),1)]),_:1},8,["disabled","background","onClick"])],36),[[v.vShow,i.showPopper]])]),_:1}),t.node.attrs.tag=="div"?(v.openBlock(),v.createElementBlock("div",{key:0,draggable:"true","data-drag-handle":"",class:"power-editor-equation-drag-btn",onMousedown:e[4]||(e[4]=l=>i.active=!0),onMouseup:e[5]||(e[5]=l=>i.active=!1),onTouchstart:e[6]||(e[6]=l=>i.active=!0),onTouchend:e[7]||(e[7]=l=>i.active=!1)},e[9]||(e[9]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--GripperDotsVertical"},null,-1)]),32)):v.createCommentVNode("",!0),v.createElementVNode("span",{class:v.normalizeClass(["power-editor-equation-target",{empty:i.thisValue===""}]),placeholder:t.node.attrs.emptyPlaceholder,innerHTML:i.thisValue===""?t.node.attrs.emptyPlaceholder:i.equationString,ref:"target",style:v.normalizeStyle({color:`${i.lock?"red":""}`,"--selected-bg":o.focusForeground}),onClick:e[8]||(e[8]=(...l)=>o.show&&o.show(...l))},null,14,cN)]),_:1},8,["as","class","style"])):v.createCommentVNode("",!0)}const Uv=Gt(aN,[["render",uN]]),dN=/(\$\s|\\\(\s)$/,hN=/(\$|\\\()(.+?)(\$|\\\))/g,fN=xt.create({name:"inlineEquation",group:"inline",inline:!0,draggable:!0,addAttributes(){return{value:{default:""},tag:{default:"span"},placeholder:{default:"Y=WX^T+b"},emptyPlaceholder:{default:"New Equation"},showPopper:{default:!1}}},parseHTML(){return[{tag:"inline-equation"}]},renderHTML({HTMLAttributes:n}){return["inline-equation",$e(n)]},addNodeView(){return ti(Uv)},addInputRules(){return[qa({find:dN,type:this.type,getAttributes:()=>({theme:this.editor.storage.defaultStorage.theme})})]},addPasteRules(){return[Jl({find:hN,type:this.type,getAttributes:n=>({value:n[2],theme:this.editor.storage.defaultStorage.theme})})]},addKeyboardShortcuts(){return{"Alt-=":()=>{let n=this.editor.view.state,e=this.editor.view.state.selection,t=n.doc.textBetween(e.from,e.to," "),r=!0;if(t=t.trim(),t.startsWith("$$")&&t.endsWith("$$")?(t=t.slice(2,-2),r=!1):t.startsWith("$")&&t.endsWith("$")?t=t.slice(1,-1):t.startsWith("\\(")&&t.endsWith("\\)")?t=t.slice(2,-2):t.startsWith("\\[")&&t.endsWith("\\]")&&(t=t.slice(2,-2),r=!1),t=t.trim(),t.length>0)return r?this.editor.chain().focus().insertContent(`<inline-equation theme="${this.editor.storage.defaultStorage.theme}" value="${t}"></inline-equation>`).run():this.editor.chain().focus().insertContent(`<equation-block theme="${this.editor.storage.defaultStorage.theme}" value="${t}"></equation-block><p></p>`).run()}}}}),pN=/(\${2}\s|\\\[\s)$/,mN=/(\s*\${2}|\\\[)([\s\S]+?)(\${2}|\\\])/g,gN=xt.create({name:"equationBlock",group:"block",atom:!0,draggable:!0,addAttributes(){return{value:{default:""},tag:{default:"div"},placeholder:{default:"Y=WX^T+b"},emptyPlaceholder:{default:"New Equation"},showPopper:{default:!1}}},parseHTML(){return[{tag:"equation-block"}]},renderHTML({HTMLAttributes:n}){return["equation-block",$e(n)]},addNodeView(){return ti(Uv)},addInputRules(){return[qa({find:pN,type:this.type,getAttributes:()=>({theme:this.editor.storage.defaultStorage.theme})})]},addPasteRules(){return[Jl({find:mN,type:this.type,getAttributes:n=>({value:n[2],theme:this.editor.storage.defaultStorage.theme})})]}}),bN={components:{NodeViewWrapper:Mi},props:{editor:{type:Object},node:{type:Object},decorations:{type:Array},selected:{type:Boolean},extension:{type:Object},getPos:{type:Function},updateAttributes:{type:Function},deleteNode:{type:Function}},data(){return{left:0,top:100,showPopper:!1,outsideEvent:n=>{if(!this.showPopper)return 0;let e=n.target,t=!1;for(;e&&e.tagName&&e.tagName.toLowerCase()!="body";){if(e==this.$el){t=!0;break}e=e.parentNode}t||this.close()},filterItems:[],loading:!1,thisTheme:this.editor.storage.defaultStorage.theme,thisForeground:this.editor.storage.defaultStorage.mentionItemTools.headerForeground()}},watch:{showPopper(n){n&&this.$nextTick(()=>{this.showPos()})},"node.attrs.value"(){this.delRecover(),this.getFilterItems()},"editor.storage.defaultStorage.theme"(n){this.thisTheme=n},"editor.storage.defaultStorage.mentionItemTools.headerForeground"(){this.thisForeground=this.editor.storage.defaultStorage.mentionItemTools.headerForeground()}},computed:{focusForeground(){try{let n=ec(this.thisForeground);return n=n.alpha(.2),n.cssa()}catch{return""}},hoverForeground(){try{let n=ec(this.thisForeground);return n=n.alpha(.3),n.cssa()}catch{return""}},activeForeground(){try{let n=ec(this.thisForeground);return n=n.alpha(.4),n.cssa()}catch{return""}}},mounted(){this.outSideClickInit(),this.windowEventInit(),setTimeout(()=>{this.node.attrs.freeze||(this.show(),this.$refs.target.focus(),this.$refs.list.setFocus())},300),this.getFilterItems()},methods:{outSideClickInit(){window.addEventListener("click",this.outsideEvent)},windowEventInit(){window.addEventListener("scroll",this.showPos),this.editor.storage.defaultStorage.editorContainer.addEventListener("scroll",this.showPos)},showPos(){let n=this.$refs.target;if(!n||!n.getBoundingClientRect)return;const{left:e,top:t}=n.getBoundingClientRect();window.innerWidth-e<260?this.left=window.innerWidth-260:this.left=e-20,window.innerHeight-t<300?this.top=window.innerHeight-300:this.top=t+30},show(){this.editor.isEditable&&(this.showPopper=!0,setTimeout(()=>{this.$refs.target.focus()},300))},async getFilterItems(){this.loading=!0;let n=[],e=await this.editor.storage.defaultStorage.mentionItemTools.mentionList(this.node.attrs.value);for(let t of e)await this.editor.storage.defaultStorage.mentionItemTools.filterFunc(t,this.node.attrs.value)&&n.push(t);this.filterItems=n,this.loading=!1},chooseItem(n){this.updateAttributes({value:n.item.name,currentItem:n.item,freeze:!0}),this.editor.storage.defaultStorage.mentionItemTools.chooseItemCallback(n.item,this.node.attrs.value),this.close()},valueTrigger(n){return typeof n=="function"?n():n},delRecover(){this.node.attrs.value===""&&(this.deleteNode(),this.editor.commands.focus(),this.editor.commands.insertContent("@"))},skipNode(n){n.preventDefault(),this.editor.commands.focus()},close(){this.showPopper=!1,this.$refs.list.setBlur(),this.editor.commands.focus()},closeWithoutSelection(){this.close();const{tr:n}=this.editor.view.state;let e=null;this.$refs.target.selectionEnd===0?e=Ee.near(n.doc.resolve(this.getPos())):e=Ee.near(n.doc.resolve(this.getPos()+this.node.nodeSize-1)),n.setSelection(e),this.editor.view.dispatch(n),this.updateAttributes({freeze:!0})},closeWithLeftRight(n){if(!this.$refs.target)return;let e=this.$refs.target.selectionStart,t=this.$refs.target.selectionEnd;e===t&&(n.key==="ArrowLeft"&&e===0&&this.closeWithoutSelection(),n.key==="ArrowRight"&&e===this.$refs.target.value.length&&this.closeWithoutSelection())}},beforeUnmount(){window.removeEventListener("click",this.outsideEvent),window.removeEventListener("scroll",this.showPos),this.editor.storage.defaultStorage.editorContainer.removeEventListener("scroll",this.showPos)}},_N={class:"power-editor-mention-popper-list-loading-block"},yN=["src"],vN={key:0,class:"power-editor-mention-icon"},wN=["src"],xN=["placeholder","readonly","title"],kN=["title"];function SN(n,e,t,r,i,o){const s=v.resolveComponent("fv-progressRing"),a=v.resolveComponent("fv-list-view"),l=v.resolveComponent("node-view-wrapper");return t.node?(v.openBlock(),v.createBlock(l,{key:0,as:"span",class:v.normalizeClass(["power-editor-mention-container",{dark:i.thisTheme==="dark",selected:t.selected,showing:i.showPopper&&i.filterItems.length>0}]),style:v.normalizeStyle({"--selected-bg":o.focusForeground,"--selected-bg-hover":o.hoverForeground,"--selected-bg-active":o.activeForeground})},{default:v.withCtx(()=>[v.createVNode(v.Transition,{name:"power-editor-mention-popper-fade"},{default:v.withCtx(()=>[v.withDirectives(v.createElementVNode("div",{class:"power-editor-mention-popper-container",style:v.normalizeStyle({left:`${i.left}px`,top:`${i.top}px`})},[v.withDirectives(v.createElementVNode("div",_N,[v.createVNode(s,{loading:"true",r:"10",borderWidth:"2",foreground:i.thisForeground,background:"white"},null,8,["foreground"])],512),[[v.vShow,i.loading]]),v.createVNode(a,{modelValue:i.filterItems,theme:i.thisTheme,class:"power-editor-mention-popper-list-view",ref:"list",itemBorderRadius:"6",itemBorderWidth:1,itemBorderColor:"rgba(120, 120, 120, 0.1)",rowHeight:30,onChooseItem:o.chooseItem},{listItem:v.withCtx(c=>[c.item.image?(v.openBlock(),v.createElementBlock("img",{key:0,class:v.normalizeClass(["power-editor-mention-img",[{avatar:c.item.avatarImg}]]),src:c.valueTrigger(c.item.image),alt:"",style:v.normalizeStyle({width:`${c.item.imageWidth||"auto"}`})},null,14,yN)):v.createCommentVNode("",!0),c.item.icon?(v.openBlock(),v.createElementBlock("i",{key:1,class:v.normalizeClass(["ms-Icon",[`ms-Icon--${c.valueTrigger(c.item.icon)}`]]),style:v.normalizeStyle([{color:c.valueTrigger(c.item.iconColor)},{"margin-right":"15px"}])},null,6)):v.createCommentVNode("",!0),v.createElementVNode("p",{style:v.normalizeStyle([{color:c.valueTrigger(c.item.type)=="header"?i.thisForeground:c.item.color},{flex:"1","font-size":"12px"}])},v.toDisplayString(c.valueTrigger(c.item.name)),5)]),_:1},8,["modelValue","theme","onChooseItem"])],4),[[v.vShow,i.showPopper&&i.filterItems.length>0]])]),_:1}),v.createElementVNode("span",{class:"power-editor-mention-display-block",onClick:e[4]||(e[4]=c=>t.editor.storage.defaultStorage.mentionItemTools.mentionClickCallback(t.node.attrs.currentItem,t.node.attrs.value))},[!t.node.attrs.currentItem.image&&!t.node.attrs.currentItem.icon?(v.openBlock(),v.createElementBlock("p",vN,e[5]||(e[5]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--Accounts"},null,-1)]))):v.createCommentVNode("",!0),t.node.attrs.currentItem.image?(v.openBlock(),v.createElementBlock("img",{key:1,src:o.valueTrigger(t.node.attrs.currentItem.image),alt:"",class:"power-editor-mention-rendered-img",style:{height:"15px"}},null,8,wN)):v.createCommentVNode("",!0),t.node.attrs.currentItem.icon?(v.openBlock(),v.createElementBlock("i",{key:2,class:v.normalizeClass(["ms-Icon power-editor-mention-icon",[`ms-Icon--${o.valueTrigger(t.node.attrs.currentItem.icon)}`]]),style:v.normalizeStyle({color:o.valueTrigger(t.node.attrs.currentItem.iconColor)})},null,6)):v.createCommentVNode("",!0),v.withDirectives(v.createElementVNode("input",{"onUpdate:modelValue":e[0]||(e[0]=c=>t.node.attrs.value=c),class:v.normalizeClass(["power-editor-mention-input",[{freeze:t.node.attrs.freeze}]]),placeholder:t.node.attrs.placeholder,readonly:t.node.attrs.freeze,ref:"target",title:t.node.attrs.value,style:v.normalizeStyle({color:t.node.attrs.currentItem.color}),onKeydown:[e[1]||(e[1]=v.withKeys((...c)=>o.delRecover&&o.delRecover(...c),["backspace"])),e[2]||(e[2]=v.withKeys((...c)=>o.skipNode&&o.skipNode(...c),["tab"])),e[3]||(e[3]=c=>o.closeWithLeftRight(c))]},null,46,xN),[[v.vShow,!t.node.attrs.freeze],[v.vModelText,t.node.attrs.value]]),v.createElementVNode("p",{title:t.node.attrs.value,class:v.normalizeClass(["power-editor-mention-placeholder",[{show:t.node.attrs.freeze}]]),style:v.normalizeStyle({color:t.node.attrs.currentItem.color})},v.toDisplayString(t.node.attrs.value?t.node.attrs.value:t.node.attrs.placeholder),15,kN)])]),_:1},8,["class","style"])):v.createCommentVNode("",!0)}const CN=Gt(bN,[["render",SN]]),EN=/(@)$/,TN=xt.create({name:"mentionItem",group:"inline",inline:!0,draggable:!0,addAttributes(){return{value:{default:""},currentItem:{default:()=>({}),parseHTML:n=>{const e=n.getAttribute("data-current-item");if(!e||e==="[object Object]")return{};try{return JSON.parse(e)}catch{return{}}},renderHTML:n=>{const e=n.currentItem;return!e||typeof e!="object"||Array.isArray(e)||Object.keys(e).length===0?{}:{"data-current-item":JSON.stringify(e)}}},placeholder:{default:"mention"},freeze:{default:!1},showPopper:{default:!1}}},parseHTML(){return[{tag:"mention-item"}]},renderHTML({HTMLAttributes:n}){return["mention-item",$e(n)]},addNodeView(){return ti(CN)},addInputRules(){return[qa({find:EN,type:this.type,getAttributes:()=>({theme:this.editor.storage.defaultStorage.theme})})]}});var AN={value:()=>{}};function Gv(){for(var n=0,e=arguments.length,t={},r;n<e;++n){if(!(r=arguments[n]+"")||r in t||/[\s.]/.test(r))throw new Error("illegal type: "+r);t[r]=[]}return new nc(t)}function nc(n){this._=n}function MN(n,e){return n.trim().split(/^|\s+/).map(function(t){var r="",i=t.indexOf(".");if(i>=0&&(r=t.slice(i+1),t=t.slice(0,i)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:r}})}nc.prototype=Gv.prototype={constructor:nc,on:function(n,e){var t=this._,r=MN(n+"",t),i,o=-1,s=r.length;if(arguments.length<2){for(;++o<s;)if((i=(n=r[o]).type)&&(i=NN(t[i],n.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++o<s;)if(i=(n=r[o]).type)t[i]=$v(t[i],n.name,e);else if(e==null)for(i in t)t[i]=$v(t[i],n.name,null);return this},copy:function(){var n={},e=this._;for(var t in e)n[t]=e[t].slice();return new nc(n)},call:function(n,e){if((i=arguments.length-2)>0)for(var t=new Array(i),r=0,i,o;r<i;++r)t[r]=arguments[r+2];if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(o=this._[n],r=0,i=o.length;r<i;++r)o[r].value.apply(e,t)},apply:function(n,e,t){if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(var r=this._[n],i=0,o=r.length;i<o;++i)r[i].value.apply(e,t)}};function NN(n,e){for(var t=0,r=n.length,i;t<r;++t)if((i=n[t]).name===e)return i.value}function $v(n,e,t){for(var r=0,i=n.length;r<i;++r)if(n[r].name===e){n[r]=AN,n=n.slice(0,r).concat(n.slice(r+1));break}return t!=null&&n.push({name:e,value:t}),n}var lf="http://www.w3.org/1999/xhtml";const Wv={svg:"http://www.w3.org/2000/svg",xhtml:lf,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function rc(n){var e=n+="",t=e.indexOf(":");return t>=0&&(e=n.slice(0,t))!=="xmlns"&&(n=n.slice(t+1)),Wv.hasOwnProperty(e)?{space:Wv[e],local:n}:n}function DN(n){return function(){var e=this.ownerDocument,t=this.namespaceURI;return t===lf&&e.documentElement.namespaceURI===lf?e.createElement(n):e.createElementNS(t,n)}}function RN(n){return function(){return this.ownerDocument.createElementNS(n.space,n.local)}}function Kv(n){var e=rc(n);return(e.local?RN:DN)(e)}function IN(){}function cf(n){return n==null?IN:function(){return this.querySelector(n)}}function ON(n){typeof n!="function"&&(n=cf(n));for(var e=this._groups,t=e.length,r=new Array(t),i=0;i<t;++i)for(var o=e[i],s=o.length,a=r[i]=new Array(s),l,c,u=0;u<s;++u)(l=o[u])&&(c=n.call(l,l.__data__,u,o))&&("__data__"in l&&(c.__data__=l.__data__),a[u]=c);return new yn(r,this._parents)}function LN(n){return n==null?[]:Array.isArray(n)?n:Array.from(n)}function PN(){return[]}function jv(n){return n==null?PN:function(){return this.querySelectorAll(n)}}function BN(n){return function(){return LN(n.apply(this,arguments))}}function FN(n){typeof n=="function"?n=BN(n):n=jv(n);for(var e=this._groups,t=e.length,r=[],i=[],o=0;o<t;++o)for(var s=e[o],a=s.length,l,c=0;c<a;++c)(l=s[c])&&(r.push(n.call(l,l.__data__,c,s)),i.push(l));return new yn(r,i)}function Qv(n){return function(){return this.matches(n)}}function Yv(n){return function(e){return e.matches(n)}}var zN=Array.prototype.find;function qN(n){return function(){return zN.call(this.children,n)}}function HN(){return this.firstElementChild}function VN(n){return this.select(n==null?HN:qN(typeof n=="function"?n:Yv(n)))}var UN=Array.prototype.filter;function GN(){return Array.from(this.children)}function $N(n){return function(){return UN.call(this.children,n)}}function WN(n){return this.selectAll(n==null?GN:$N(typeof n=="function"?n:Yv(n)))}function KN(n){typeof n!="function"&&(n=Qv(n));for(var e=this._groups,t=e.length,r=new Array(t),i=0;i<t;++i)for(var o=e[i],s=o.length,a=r[i]=[],l,c=0;c<s;++c)(l=o[c])&&n.call(l,l.__data__,c,o)&&a.push(l);return new yn(r,this._parents)}function Zv(n){return new Array(n.length)}function jN(){return new yn(this._enter||this._groups.map(Zv),this._parents)}function ic(n,e){this.ownerDocument=n.ownerDocument,this.namespaceURI=n.namespaceURI,this._next=null,this._parent=n,this.__data__=e}ic.prototype={constructor:ic,appendChild:function(n){return this._parent.insertBefore(n,this._next)},insertBefore:function(n,e){return this._parent.insertBefore(n,e)},querySelector:function(n){return this._parent.querySelector(n)},querySelectorAll:function(n){return this._parent.querySelectorAll(n)}};function QN(n){return function(){return n}}function YN(n,e,t,r,i,o){for(var s=0,a,l=e.length,c=o.length;s<c;++s)(a=e[s])?(a.__data__=o[s],r[s]=a):t[s]=new ic(n,o[s]);for(;s<l;++s)(a=e[s])&&(i[s]=a)}function ZN(n,e,t,r,i,o,s){var a,l,c=new Map,u=e.length,d=o.length,m=new Array(u),b;for(a=0;a<u;++a)(l=e[a])&&(m[a]=b=s.call(l,l.__data__,a,e)+"",c.has(b)?i[a]=l:c.set(b,l));for(a=0;a<d;++a)b=s.call(n,o[a],a,o)+"",(l=c.get(b))?(r[a]=l,l.__data__=o[a],c.delete(b)):t[a]=new ic(n,o[a]);for(a=0;a<u;++a)(l=e[a])&&c.get(m[a])===l&&(i[a]=l)}function XN(n){return n.__data__}function JN(n,e){if(!arguments.length)return Array.from(this,XN);var t=e?ZN:YN,r=this._parents,i=this._groups;typeof n!="function"&&(n=QN(n));for(var o=i.length,s=new Array(o),a=new Array(o),l=new Array(o),c=0;c<o;++c){var u=r[c],d=i[c],m=d.length,b=eD(n.call(u,u&&u.__data__,c,r)),f=b.length,y=a[c]=new Array(f),w=s[c]=new Array(f),k=l[c]=new Array(m);t(u,d,y,w,k,b,e);for(var E=0,S=0,D,R;E<f;++E)if(D=y[E]){for(E>=S&&(S=E+1);!(R=w[S])&&++S<f;);D._next=R||null}}return s=new yn(s,r),s._enter=a,s._exit=l,s}function eD(n){return typeof n=="object"&&"length"in n?n:Array.from(n)}function tD(){return new yn(this._exit||this._groups.map(Zv),this._parents)}function nD(n,e,t){var r=this.enter(),i=this,o=this.exit();return typeof n=="function"?(r=n(r),r&&(r=r.selection())):r=r.append(n+""),e!=null&&(i=e(i),i&&(i=i.selection())),t==null?o.remove():t(o),r&&i?r.merge(i).order():i}function rD(n){for(var e=n.selection?n.selection():n,t=this._groups,r=e._groups,i=t.length,o=r.length,s=Math.min(i,o),a=new Array(i),l=0;l<s;++l)for(var c=t[l],u=r[l],d=c.length,m=a[l]=new Array(d),b,f=0;f<d;++f)(b=c[f]||u[f])&&(m[f]=b);for(;l<i;++l)a[l]=t[l];return new yn(a,this._parents)}function iD(){for(var n=this._groups,e=-1,t=n.length;++e<t;)for(var r=n[e],i=r.length-1,o=r[i],s;--i>=0;)(s=r[i])&&(o&&s.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(s,o),o=s);return this}function oD(n){n||(n=sD);function e(d,m){return d&&m?n(d.__data__,m.__data__):!d-!m}for(var t=this._groups,r=t.length,i=new Array(r),o=0;o<r;++o){for(var s=t[o],a=s.length,l=i[o]=new Array(a),c,u=0;u<a;++u)(c=s[u])&&(l[u]=c);l.sort(e)}return new yn(i,this._parents).order()}function sD(n,e){return n<e?-1:n>e?1:n>=e?0:NaN}function aD(){var n=arguments[0];return arguments[0]=this,n.apply(null,arguments),this}function lD(){return Array.from(this)}function cD(){for(var n=this._groups,e=0,t=n.length;e<t;++e)for(var r=n[e],i=0,o=r.length;i<o;++i){var s=r[i];if(s)return s}return null}function uD(){let n=0;for(const e of this)++n;return n}function dD(){return!this.node()}function hD(n){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var i=e[t],o=0,s=i.length,a;o<s;++o)(a=i[o])&&n.call(a,a.__data__,o,i);return this}function fD(n){return function(){this.removeAttribute(n)}}function pD(n){return function(){this.removeAttributeNS(n.space,n.local)}}function mD(n,e){return function(){this.setAttribute(n,e)}}function gD(n,e){return function(){this.setAttributeNS(n.space,n.local,e)}}function bD(n,e){return function(){var t=e.apply(this,arguments);t==null?this.removeAttribute(n):this.setAttribute(n,t)}}function _D(n,e){return function(){var t=e.apply(this,arguments);t==null?this.removeAttributeNS(n.space,n.local):this.setAttributeNS(n.space,n.local,t)}}function yD(n,e){var t=rc(n);if(arguments.length<2){var r=this.node();return t.local?r.getAttributeNS(t.space,t.local):r.getAttribute(t)}return this.each((e==null?t.local?pD:fD:typeof e=="function"?t.local?_D:bD:t.local?gD:mD)(t,e))}function Xv(n){return n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView}function vD(n){return function(){this.style.removeProperty(n)}}function wD(n,e,t){return function(){this.style.setProperty(n,e,t)}}function xD(n,e,t){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(n):this.style.setProperty(n,r,t)}}function kD(n,e,t){return arguments.length>1?this.each((e==null?vD:typeof e=="function"?xD:wD)(n,e,t??"")):xo(this.node(),n)}function xo(n,e){return n.style.getPropertyValue(e)||Xv(n).getComputedStyle(n,null).getPropertyValue(e)}function SD(n){return function(){delete this[n]}}function CD(n,e){return function(){this[n]=e}}function ED(n,e){return function(){var t=e.apply(this,arguments);t==null?delete this[n]:this[n]=t}}function TD(n,e){return arguments.length>1?this.each((e==null?SD:typeof e=="function"?ED:CD)(n,e)):this.node()[n]}function Jv(n){return n.trim().split(/^|\s+/)}function uf(n){return n.classList||new e2(n)}function e2(n){this._node=n,this._names=Jv(n.getAttribute("class")||"")}e2.prototype={add:function(n){var e=this._names.indexOf(n);e<0&&(this._names.push(n),this._node.setAttribute("class",this._names.join(" ")))},remove:function(n){var e=this._names.indexOf(n);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(n){return this._names.indexOf(n)>=0}};function t2(n,e){for(var t=uf(n),r=-1,i=e.length;++r<i;)t.add(e[r])}function n2(n,e){for(var t=uf(n),r=-1,i=e.length;++r<i;)t.remove(e[r])}function AD(n){return function(){t2(this,n)}}function MD(n){return function(){n2(this,n)}}function ND(n,e){return function(){(e.apply(this,arguments)?t2:n2)(this,n)}}function DD(n,e){var t=Jv(n+"");if(arguments.length<2){for(var r=uf(this.node()),i=-1,o=t.length;++i<o;)if(!r.contains(t[i]))return!1;return!0}return this.each((typeof e=="function"?ND:e?AD:MD)(t,e))}function RD(){this.textContent=""}function ID(n){return function(){this.textContent=n}}function OD(n){return function(){var e=n.apply(this,arguments);this.textContent=e??""}}function LD(n){return arguments.length?this.each(n==null?RD:(typeof n=="function"?OD:ID)(n)):this.node().textContent}function PD(){this.innerHTML=""}function BD(n){return function(){this.innerHTML=n}}function FD(n){return function(){var e=n.apply(this,arguments);this.innerHTML=e??""}}function zD(n){return arguments.length?this.each(n==null?PD:(typeof n=="function"?FD:BD)(n)):this.node().innerHTML}function qD(){this.nextSibling&&this.parentNode.appendChild(this)}function HD(){return this.each(qD)}function VD(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function UD(){return this.each(VD)}function GD(n){var e=typeof n=="function"?n:Kv(n);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function $D(){return null}function WD(n,e){var t=typeof n=="function"?n:Kv(n),r=e==null?$D:typeof e=="function"?e:cf(e);return this.select(function(){return this.insertBefore(t.apply(this,arguments),r.apply(this,arguments)||null)})}function KD(){var n=this.parentNode;n&&n.removeChild(this)}function jD(){return this.each(KD)}function QD(){var n=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(n,this.nextSibling):n}function YD(){var n=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(n,this.nextSibling):n}function ZD(n){return this.select(n?YD:QD)}function XD(n){return arguments.length?this.property("__data__",n):this.node().__data__}function JD(n){return function(e){n.call(this,e,this.__data__)}}function eR(n){return n.trim().split(/^|\s+/).map(function(e){var t="",r=e.indexOf(".");return r>=0&&(t=e.slice(r+1),e=e.slice(0,r)),{type:e,name:t}})}function tR(n){return function(){var e=this.__on;if(e){for(var t=0,r=-1,i=e.length,o;t<i;++t)o=e[t],(!n.type||o.type===n.type)&&o.name===n.name?this.removeEventListener(o.type,o.listener,o.options):e[++r]=o;++r?e.length=r:delete this.__on}}}function nR(n,e,t){return function(){var r=this.__on,i,o=JD(e);if(r){for(var s=0,a=r.length;s<a;++s)if((i=r[s]).type===n.type&&i.name===n.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=t),i.value=e;return}}this.addEventListener(n.type,o,t),i={type:n.type,name:n.name,value:e,listener:o,options:t},r?r.push(i):this.__on=[i]}}function rR(n,e,t){var r=eR(n+""),i,o=r.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,c=a.length,u;l<c;++l)for(i=0,u=a[l];i<o;++i)if((s=r[i]).type===u.type&&s.name===u.name)return u.value}return}for(a=e?nR:tR,i=0;i<o;++i)this.each(a(r[i],e,t));return this}function r2(n,e,t){var r=Xv(n),i=r.CustomEvent;typeof i=="function"?i=new i(e,t):(i=r.document.createEvent("Event"),t?(i.initEvent(e,t.bubbles,t.cancelable),i.detail=t.detail):i.initEvent(e,!1,!1)),n.dispatchEvent(i)}function iR(n,e){return function(){return r2(this,n,e)}}function oR(n,e){return function(){return r2(this,n,e.apply(this,arguments))}}function sR(n,e){return this.each((typeof e=="function"?oR:iR)(n,e))}function*aR(){for(var n=this._groups,e=0,t=n.length;e<t;++e)for(var r=n[e],i=0,o=r.length,s;i<o;++i)(s=r[i])&&(yield s)}var i2=[null];function yn(n,e){this._groups=n,this._parents=e}function Ps(){return new yn([[document.documentElement]],i2)}function lR(){return this}yn.prototype=Ps.prototype={constructor:yn,select:ON,selectAll:FN,selectChild:VN,selectChildren:WN,filter:KN,data:JN,enter:jN,exit:tD,join:nD,merge:rD,selection:lR,order:iD,sort:oD,call:aD,nodes:lD,node:cD,size:uD,empty:dD,each:hD,attr:yD,style:kD,property:TD,classed:DD,text:LD,html:zD,raise:HD,lower:UD,append:GD,insert:WD,remove:jD,clone:ZD,datum:XD,on:rR,dispatch:sR,[Symbol.iterator]:aR};function cR(n){return typeof n=="string"?new yn([[document.querySelector(n)]],[document.documentElement]):new yn([[n]],i2)}function o2(n){let e;for(;e=n.sourceEvent;)n=e;return n}function uR(n,e){if(n=o2(n),e===void 0&&(e=n.currentTarget),e){var t=e.ownerSVGElement||e;if(t.createSVGPoint){var r=t.createSVGPoint();return r.x=n.clientX,r.y=n.clientY,r=r.matrixTransform(e.getScreenCTM().inverse()),[r.x,r.y]}if(e.getBoundingClientRect){var i=e.getBoundingClientRect();return[n.clientX-i.left-e.clientLeft,n.clientY-i.top-e.clientTop]}}return[n.pageX,n.pageY]}function dR(n,e){return n.target&&(n=o2(n),e===void 0&&(e=n.currentTarget),n=n.touches||[n]),Array.from(n,t=>uR(t,e))}function df(n,e,t){n.prototype=e.prototype=t,t.constructor=n}function s2(n,e){var t=Object.create(n.prototype);for(var r in e)t[r]=e[r];return t}function Bs(){}var Fs=.7,oc=1/Fs,ko="\\s*([+-]?\\d+)\\s*",zs="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",sr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",hR=/^#([0-9a-f]{3,8})$/,fR=new RegExp(`^rgb\\(${ko},${ko},${ko}\\)$`),pR=new RegExp(`^rgb\\(${sr},${sr},${sr}\\)$`),mR=new RegExp(`^rgba\\(${ko},${ko},${ko},${zs}\\)$`),gR=new RegExp(`^rgba\\(${sr},${sr},${sr},${zs}\\)$`),bR=new RegExp(`^hsl\\(${zs},${sr},${sr}\\)$`),_R=new RegExp(`^hsla\\(${zs},${sr},${sr},${zs}\\)$`),a2={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};df(Bs,qs,{copy(n){return Object.assign(new this.constructor,this,n)},displayable(){return this.rgb().displayable()},hex:l2,formatHex:l2,formatHex8:yR,formatHsl:vR,formatRgb:c2,toString:c2});function l2(){return this.rgb().formatHex()}function yR(){return this.rgb().formatHex8()}function vR(){return p2(this).formatHsl()}function c2(){return this.rgb().formatRgb()}function qs(n){var e,t;return n=(n+"").trim().toLowerCase(),(e=hR.exec(n))?(t=e[1].length,e=parseInt(e[1],16),t===6?u2(e):t===3?new fn(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):t===8?sc(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):t===4?sc(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=fR.exec(n))?new fn(e[1],e[2],e[3],1):(e=pR.exec(n))?new fn(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=mR.exec(n))?sc(e[1],e[2],e[3],e[4]):(e=gR.exec(n))?sc(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=bR.exec(n))?f2(e[1],e[2]/100,e[3]/100,1):(e=_R.exec(n))?f2(e[1],e[2]/100,e[3]/100,e[4]):a2.hasOwnProperty(n)?u2(a2[n]):n==="transparent"?new fn(NaN,NaN,NaN,0):null}function u2(n){return new fn(n>>16&255,n>>8&255,n&255,1)}function sc(n,e,t,r){return r<=0&&(n=e=t=NaN),new fn(n,e,t,r)}function wR(n){return n instanceof Bs||(n=qs(n)),n?(n=n.rgb(),new fn(n.r,n.g,n.b,n.opacity)):new fn}function hf(n,e,t,r){return arguments.length===1?wR(n):new fn(n,e,t,r??1)}function fn(n,e,t,r){this.r=+n,this.g=+e,this.b=+t,this.opacity=+r}df(fn,hf,s2(Bs,{brighter(n){return n=n==null?oc:Math.pow(oc,n),new fn(this.r*n,this.g*n,this.b*n,this.opacity)},darker(n){return n=n==null?Fs:Math.pow(Fs,n),new fn(this.r*n,this.g*n,this.b*n,this.opacity)},rgb(){return this},clamp(){return new fn(qi(this.r),qi(this.g),qi(this.b),ac(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:d2,formatHex:d2,formatHex8:xR,formatRgb:h2,toString:h2}));function d2(){return`#${Hi(this.r)}${Hi(this.g)}${Hi(this.b)}`}function xR(){return`#${Hi(this.r)}${Hi(this.g)}${Hi(this.b)}${Hi((isNaN(this.opacity)?1:this.opacity)*255)}`}function h2(){const n=ac(this.opacity);return`${n===1?"rgb(":"rgba("}${qi(this.r)}, ${qi(this.g)}, ${qi(this.b)}${n===1?")":`, ${n})`}`}function ac(n){return isNaN(n)?1:Math.max(0,Math.min(1,n))}function qi(n){return Math.max(0,Math.min(255,Math.round(n)||0))}function Hi(n){return n=qi(n),(n<16?"0":"")+n.toString(16)}function f2(n,e,t,r){return r<=0?n=e=t=NaN:t<=0||t>=1?n=e=NaN:e<=0&&(n=NaN),new Wn(n,e,t,r)}function p2(n){if(n instanceof Wn)return new Wn(n.h,n.s,n.l,n.opacity);if(n instanceof Bs||(n=qs(n)),!n)return new Wn;if(n instanceof Wn)return n;n=n.rgb();var e=n.r/255,t=n.g/255,r=n.b/255,i=Math.min(e,t,r),o=Math.max(e,t,r),s=NaN,a=o-i,l=(o+i)/2;return a?(e===o?s=(t-r)/a+(t<r)*6:t===o?s=(r-e)/a+2:s=(e-t)/a+4,a/=l<.5?o+i:2-o-i,s*=60):a=l>0&&l<1?0:s,new Wn(s,a,l,n.opacity)}function kR(n,e,t,r){return arguments.length===1?p2(n):new Wn(n,e,t,r??1)}function Wn(n,e,t,r){this.h=+n,this.s=+e,this.l=+t,this.opacity=+r}df(Wn,kR,s2(Bs,{brighter(n){return n=n==null?oc:Math.pow(oc,n),new Wn(this.h,this.s,this.l*n,this.opacity)},darker(n){return n=n==null?Fs:Math.pow(Fs,n),new Wn(this.h,this.s,this.l*n,this.opacity)},rgb(){var n=this.h%360+(this.h<0)*360,e=isNaN(n)||isNaN(this.s)?0:this.s,t=this.l,r=t+(t<.5?t:1-t)*e,i=2*t-r;return new fn(ff(n>=240?n-240:n+120,i,r),ff(n,i,r),ff(n<120?n+240:n-120,i,r),this.opacity)},clamp(){return new Wn(m2(this.h),lc(this.s),lc(this.l),ac(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const n=ac(this.opacity);return`${n===1?"hsl(":"hsla("}${m2(this.h)}, ${lc(this.s)*100}%, ${lc(this.l)*100}%${n===1?")":`, ${n})`}`}}));function m2(n){return n=(n||0)%360,n<0?n+360:n}function lc(n){return Math.max(0,Math.min(1,n||0))}function ff(n,e,t){return(n<60?e+(t-e)*n/60:n<180?t:n<240?e+(t-e)*(240-n)/60:e)*255}const g2=n=>()=>n;function SR(n,e){return function(t){return n+t*e}}function CR(n,e,t){return n=Math.pow(n,t),e=Math.pow(e,t)-n,t=1/t,function(r){return Math.pow(n+r*e,t)}}function ER(n){return(n=+n)==1?b2:function(e,t){return t-e?CR(e,t,n):g2(isNaN(e)?t:e)}}function b2(n,e){var t=e-n;return t?SR(n,t):g2(isNaN(n)?e:n)}const _2=function n(e){var t=ER(e);function r(i,o){var s=t((i=hf(i)).r,(o=hf(o)).r),a=t(i.g,o.g),l=t(i.b,o.b),c=b2(i.opacity,o.opacity);return function(u){return i.r=s(u),i.g=a(u),i.b=l(u),i.opacity=c(u),i+""}}return r.gamma=n,r}(1);function li(n,e){return n=+n,e=+e,function(t){return n*(1-t)+e*t}}var pf=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,mf=new RegExp(pf.source,"g");function TR(n){return function(){return n}}function AR(n){return function(e){return n(e)+""}}function MR(n,e){var t=pf.lastIndex=mf.lastIndex=0,r,i,o,s=-1,a=[],l=[];for(n=n+"",e=e+"";(r=pf.exec(n))&&(i=mf.exec(e));)(o=i.index)>t&&(o=e.slice(t,o),a[s]?a[s]+=o:a[++s]=o),(r=r[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,l.push({i:s,x:li(r,i)})),t=mf.lastIndex;return t<e.length&&(o=e.slice(t),a[s]?a[s]+=o:a[++s]=o),a.length<2?l[0]?AR(l[0].x):TR(e):(e=l.length,function(c){for(var u=0,d;u<e;++u)a[(d=l[u]).i]=d.x(c);return a.join("")})}var y2=180/Math.PI,gf={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function v2(n,e,t,r,i,o){var s,a,l;return(s=Math.sqrt(n*n+e*e))&&(n/=s,e/=s),(l=n*t+e*r)&&(t-=n*l,r-=e*l),(a=Math.sqrt(t*t+r*r))&&(t/=a,r/=a,l/=a),n*r<e*t&&(n=-n,e=-e,l=-l,s=-s),{translateX:i,translateY:o,rotate:Math.atan2(e,n)*y2,skewX:Math.atan(l)*y2,scaleX:s,scaleY:a}}var cc;function NR(n){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(n+"");return e.isIdentity?gf:v2(e.a,e.b,e.c,e.d,e.e,e.f)}function DR(n){return n==null||(cc||(cc=document.createElementNS("http://www.w3.org/2000/svg","g")),cc.setAttribute("transform",n),!(n=cc.transform.baseVal.consolidate()))?gf:(n=n.matrix,v2(n.a,n.b,n.c,n.d,n.e,n.f))}function w2(n,e,t,r){function i(c){return c.length?c.pop()+" ":""}function o(c,u,d,m,b,f){if(c!==d||u!==m){var y=b.push("translate(",null,e,null,t);f.push({i:y-4,x:li(c,d)},{i:y-2,x:li(u,m)})}else(d||m)&&b.push("translate("+d+e+m+t)}function s(c,u,d,m){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),m.push({i:d.push(i(d)+"rotate(",null,r)-2,x:li(c,u)})):u&&d.push(i(d)+"rotate("+u+r)}function a(c,u,d,m){c!==u?m.push({i:d.push(i(d)+"skewX(",null,r)-2,x:li(c,u)}):u&&d.push(i(d)+"skewX("+u+r)}function l(c,u,d,m,b,f){if(c!==d||u!==m){var y=b.push(i(b)+"scale(",null,",",null,")");f.push({i:y-4,x:li(c,d)},{i:y-2,x:li(u,m)})}else(d!==1||m!==1)&&b.push(i(b)+"scale("+d+","+m+")")}return function(c,u){var d=[],m=[];return c=n(c),u=n(u),o(c.translateX,c.translateY,u.translateX,u.translateY,d,m),s(c.rotate,u.rotate,d,m),a(c.skewX,u.skewX,d,m),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,d,m),c=u=null,function(b){for(var f=-1,y=m.length,w;++f<y;)d[(w=m[f]).i]=w.x(b);return d.join("")}}}var RR=w2(NR,"px, ","px)","deg)"),IR=w2(DR,", ",")",")"),So=0,Hs=0,Vs=0,x2=1e3,uc,Us,dc=0,Vi=0,hc=0,Gs=typeof performance=="object"&&performance.now?performance:Date,k2=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(n){setTimeout(n,17)};function bf(){return Vi||(k2(OR),Vi=Gs.now()+hc)}function OR(){Vi=0}function fc(){this._call=this._time=this._next=null}fc.prototype=S2.prototype={constructor:fc,restart:function(n,e,t){if(typeof n!="function")throw new TypeError("callback is not a function");t=(t==null?bf():+t)+(e==null?0:+e),!this._next&&Us!==this&&(Us?Us._next=this:uc=this,Us=this),this._call=n,this._time=t,_f()},stop:function(){this._call&&(this._call=null,this._time=1/0,_f())}};function S2(n,e,t){var r=new fc;return r.restart(n,e,t),r}function LR(){bf(),++So;for(var n=uc,e;n;)(e=Vi-n._time)>=0&&n._call.call(void 0,e),n=n._next;--So}function C2(){Vi=(dc=Gs.now())+hc,So=Hs=0;try{LR()}finally{So=0,BR(),Vi=0}}function PR(){var n=Gs.now(),e=n-dc;e>x2&&(hc-=e,dc=n)}function BR(){for(var n,e=uc,t,r=1/0;e;)e._call?(r>e._time&&(r=e._time),n=e,e=e._next):(t=e._next,e._next=null,e=n?n._next=t:uc=t);Us=n,_f(r)}function _f(n){if(!So){Hs&&(Hs=clearTimeout(Hs));var e=n-Vi;e>24?(n<1/0&&(Hs=setTimeout(C2,n-Gs.now()-hc)),Vs&&(Vs=clearInterval(Vs))):(Vs||(dc=Gs.now(),Vs=setInterval(PR,x2)),So=1,k2(C2))}}function E2(n,e,t){var r=new fc;return e=e==null?0:+e,r.restart(i=>{r.stop(),n(i+e)},e,t),r}var FR=Gv("start","end","cancel","interrupt"),zR=[],T2=0,A2=1,yf=2,pc=3,M2=4,vf=5,mc=6;function gc(n,e,t,r,i,o){var s=n.__transition;if(!s)n.__transition={};else if(t in s)return;qR(n,t,{name:e,index:r,group:i,on:FR,tween:zR,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:T2})}function wf(n,e){var t=Kn(n,e);if(t.state>T2)throw new Error("too late; already scheduled");return t}function ar(n,e){var t=Kn(n,e);if(t.state>pc)throw new Error("too late; already running");return t}function Kn(n,e){var t=n.__transition;if(!t||!(t=t[e]))throw new Error("transition not found");return t}function qR(n,e,t){var r=n.__transition,i;r[e]=t,t.timer=S2(o,0,t.time);function o(c){t.state=A2,t.timer.restart(s,t.delay,t.time),t.delay<=c&&s(c-t.delay)}function s(c){var u,d,m,b;if(t.state!==A2)return l();for(u in r)if(b=r[u],b.name===t.name){if(b.state===pc)return E2(s);b.state===M2?(b.state=mc,b.timer.stop(),b.on.call("interrupt",n,n.__data__,b.index,b.group),delete r[u]):+u<e&&(b.state=mc,b.timer.stop(),b.on.call("cancel",n,n.__data__,b.index,b.group),delete r[u])}if(E2(function(){t.state===pc&&(t.state=M2,t.timer.restart(a,t.delay,t.time),a(c))}),t.state=yf,t.on.call("start",n,n.__data__,t.index,t.group),t.state===yf){for(t.state=pc,i=new Array(m=t.tween.length),u=0,d=-1;u<m;++u)(b=t.tween[u].value.call(n,n.__data__,t.index,t.group))&&(i[++d]=b);i.length=d+1}}function a(c){for(var u=c<t.duration?t.ease.call(null,c/t.duration):(t.timer.restart(l),t.state=vf,1),d=-1,m=i.length;++d<m;)i[d].call(n,u);t.state===vf&&(t.on.call("end",n,n.__data__,t.index,t.group),l())}function l(){t.state=mc,t.timer.stop(),delete r[e];for(var c in r)return;delete n.__transition}}function HR(n,e){var t=n.__transition,r,i,o=!0,s;if(t){e=e==null?null:e+"";for(s in t){if((r=t[s]).name!==e){o=!1;continue}i=r.state>yf&&r.state<vf,r.state=mc,r.timer.stop(),r.on.call(i?"interrupt":"cancel",n,n.__data__,r.index,r.group),delete t[s]}o&&delete n.__transition}}function VR(n){return this.each(function(){HR(this,n)})}function UR(n,e){var t,r;return function(){var i=ar(this,n),o=i.tween;if(o!==t){r=t=o;for(var s=0,a=r.length;s<a;++s)if(r[s].name===e){r=r.slice(),r.splice(s,1);break}}i.tween=r}}function GR(n,e,t){var r,i;if(typeof t!="function")throw new Error;return function(){var o=ar(this,n),s=o.tween;if(s!==r){i=(r=s).slice();for(var a={name:e,value:t},l=0,c=i.length;l<c;++l)if(i[l].name===e){i[l]=a;break}l===c&&i.push(a)}o.tween=i}}function $R(n,e){var t=this._id;if(n+="",arguments.length<2){for(var r=Kn(this.node(),t).tween,i=0,o=r.length,s;i<o;++i)if((s=r[i]).name===n)return s.value;return null}return this.each((e==null?UR:GR)(t,n,e))}function xf(n,e,t){var r=n._id;return n.each(function(){var i=ar(this,r);(i.value||(i.value={}))[e]=t.apply(this,arguments)}),function(i){return Kn(i,r).value[e]}}function N2(n,e){var t;return(typeof e=="number"?li:e instanceof qs?_2:(t=qs(e))?(e=t,_2):MR)(n,e)}function WR(n){return function(){this.removeAttribute(n)}}function KR(n){return function(){this.removeAttributeNS(n.space,n.local)}}function jR(n,e,t){var r,i=t+"",o;return function(){var s=this.getAttribute(n);return s===i?null:s===r?o:o=e(r=s,t)}}function QR(n,e,t){var r,i=t+"",o;return function(){var s=this.getAttributeNS(n.space,n.local);return s===i?null:s===r?o:o=e(r=s,t)}}function YR(n,e,t){var r,i,o;return function(){var s,a=t(this),l;return a==null?void this.removeAttribute(n):(s=this.getAttribute(n),l=a+"",s===l?null:s===r&&l===i?o:(i=l,o=e(r=s,a)))}}function ZR(n,e,t){var r,i,o;return function(){var s,a=t(this),l;return a==null?void this.removeAttributeNS(n.space,n.local):(s=this.getAttributeNS(n.space,n.local),l=a+"",s===l?null:s===r&&l===i?o:(i=l,o=e(r=s,a)))}}function XR(n,e){var t=rc(n),r=t==="transform"?IR:N2;return this.attrTween(n,typeof e=="function"?(t.local?ZR:YR)(t,r,xf(this,"attr."+n,e)):e==null?(t.local?KR:WR)(t):(t.local?QR:jR)(t,r,e))}function JR(n,e){return function(t){this.setAttribute(n,e.call(this,t))}}function eI(n,e){return function(t){this.setAttributeNS(n.space,n.local,e.call(this,t))}}function tI(n,e){var t,r;function i(){var o=e.apply(this,arguments);return o!==r&&(t=(r=o)&&eI(n,o)),t}return i._value=e,i}function nI(n,e){var t,r;function i(){var o=e.apply(this,arguments);return o!==r&&(t=(r=o)&&JR(n,o)),t}return i._value=e,i}function rI(n,e){var t="attr."+n;if(arguments.length<2)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;var r=rc(n);return this.tween(t,(r.local?tI:nI)(r,e))}function iI(n,e){return function(){wf(this,n).delay=+e.apply(this,arguments)}}function oI(n,e){return e=+e,function(){wf(this,n).delay=e}}function sI(n){var e=this._id;return arguments.length?this.each((typeof n=="function"?iI:oI)(e,n)):Kn(this.node(),e).delay}function aI(n,e){return function(){ar(this,n).duration=+e.apply(this,arguments)}}function lI(n,e){return e=+e,function(){ar(this,n).duration=e}}function cI(n){var e=this._id;return arguments.length?this.each((typeof n=="function"?aI:lI)(e,n)):Kn(this.node(),e).duration}function uI(n,e){if(typeof e!="function")throw new Error;return function(){ar(this,n).ease=e}}function dI(n){var e=this._id;return arguments.length?this.each(uI(e,n)):Kn(this.node(),e).ease}function hI(n,e){return function(){var t=e.apply(this,arguments);if(typeof t!="function")throw new Error;ar(this,n).ease=t}}function fI(n){if(typeof n!="function")throw new Error;return this.each(hI(this._id,n))}function pI(n){typeof n!="function"&&(n=Qv(n));for(var e=this._groups,t=e.length,r=new Array(t),i=0;i<t;++i)for(var o=e[i],s=o.length,a=r[i]=[],l,c=0;c<s;++c)(l=o[c])&&n.call(l,l.__data__,c,o)&&a.push(l);return new Nr(r,this._parents,this._name,this._id)}function mI(n){if(n._id!==this._id)throw new Error;for(var e=this._groups,t=n._groups,r=e.length,i=t.length,o=Math.min(r,i),s=new Array(r),a=0;a<o;++a)for(var l=e[a],c=t[a],u=l.length,d=s[a]=new Array(u),m,b=0;b<u;++b)(m=l[b]||c[b])&&(d[b]=m);for(;a<r;++a)s[a]=e[a];return new Nr(s,this._parents,this._name,this._id)}function gI(n){return(n+"").trim().split(/^|\s+/).every(function(e){var t=e.indexOf(".");return t>=0&&(e=e.slice(0,t)),!e||e==="start"})}function bI(n,e,t){var r,i,o=gI(e)?wf:ar;return function(){var s=o(this,n),a=s.on;a!==r&&(i=(r=a).copy()).on(e,t),s.on=i}}function _I(n,e){var t=this._id;return arguments.length<2?Kn(this.node(),t).on.on(n):this.each(bI(t,n,e))}function yI(n){return function(){var e=this.parentNode;for(var t in this.__transition)if(+t!==n)return;e&&e.removeChild(this)}}function vI(){return this.on("end.remove",yI(this._id))}function wI(n){var e=this._name,t=this._id;typeof n!="function"&&(n=cf(n));for(var r=this._groups,i=r.length,o=new Array(i),s=0;s<i;++s)for(var a=r[s],l=a.length,c=o[s]=new Array(l),u,d,m=0;m<l;++m)(u=a[m])&&(d=n.call(u,u.__data__,m,a))&&("__data__"in u&&(d.__data__=u.__data__),c[m]=d,gc(c[m],e,t,m,c,Kn(u,t)));return new Nr(o,this._parents,e,t)}function xI(n){var e=this._name,t=this._id;typeof n!="function"&&(n=jv(n));for(var r=this._groups,i=r.length,o=[],s=[],a=0;a<i;++a)for(var l=r[a],c=l.length,u,d=0;d<c;++d)if(u=l[d]){for(var m=n.call(u,u.__data__,d,l),b,f=Kn(u,t),y=0,w=m.length;y<w;++y)(b=m[y])&&gc(b,e,t,y,m,f);o.push(m),s.push(u)}return new Nr(o,s,e,t)}var kI=Ps.prototype.constructor;function SI(){return new kI(this._groups,this._parents)}function CI(n,e){var t,r,i;return function(){var o=xo(this,n),s=(this.style.removeProperty(n),xo(this,n));return o===s?null:o===t&&s===r?i:i=e(t=o,r=s)}}function D2(n){return function(){this.style.removeProperty(n)}}function EI(n,e,t){var r,i=t+"",o;return function(){var s=xo(this,n);return s===i?null:s===r?o:o=e(r=s,t)}}function TI(n,e,t){var r,i,o;return function(){var s=xo(this,n),a=t(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(n),xo(this,n))),s===l?null:s===r&&l===i?o:(i=l,o=e(r=s,a))}}function AI(n,e){var t,r,i,o="style."+e,s="end."+o,a;return function(){var l=ar(this,n),c=l.on,u=l.value[o]==null?a||(a=D2(e)):void 0;(c!==t||i!==u)&&(r=(t=c).copy()).on(s,i=u),l.on=r}}function MI(n,e,t){var r=(n+="")=="transform"?RR:N2;return e==null?this.styleTween(n,CI(n,r)).on("end.style."+n,D2(n)):typeof e=="function"?this.styleTween(n,TI(n,r,xf(this,"style."+n,e))).each(AI(this._id,n)):this.styleTween(n,EI(n,r,e),t).on("end.style."+n,null)}function NI(n,e,t){return function(r){this.style.setProperty(n,e.call(this,r),t)}}function DI(n,e,t){var r,i;function o(){var s=e.apply(this,arguments);return s!==i&&(r=(i=s)&&NI(n,s,t)),r}return o._value=e,o}function RI(n,e,t){var r="style."+(n+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;return this.tween(r,DI(n,e,t??""))}function II(n){return function(){this.textContent=n}}function OI(n){return function(){var e=n(this);this.textContent=e??""}}function LI(n){return this.tween("text",typeof n=="function"?OI(xf(this,"text",n)):II(n==null?"":n+""))}function PI(n){return function(e){this.textContent=n.call(this,e)}}function BI(n){var e,t;function r(){var i=n.apply(this,arguments);return i!==t&&(e=(t=i)&&PI(i)),e}return r._value=n,r}function FI(n){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(n==null)return this.tween(e,null);if(typeof n!="function")throw new Error;return this.tween(e,BI(n))}function zI(){for(var n=this._name,e=this._id,t=R2(),r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],a=s.length,l,c=0;c<a;++c)if(l=s[c]){var u=Kn(l,e);gc(l,n,t,c,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Nr(r,this._parents,n,t)}function qI(){var n,e,t=this,r=t._id,i=t.size();return new Promise(function(o,s){var a={value:s},l={value:function(){--i===0&&o()}};t.each(function(){var c=ar(this,r),u=c.on;u!==n&&(e=(n=u).copy(),e._.cancel.push(a),e._.interrupt.push(a),e._.end.push(l)),c.on=e}),i===0&&o()})}var HI=0;function Nr(n,e,t,r){this._groups=n,this._parents=e,this._name=t,this._id=r}function R2(){return++HI}var Dr=Ps.prototype;Nr.prototype={constructor:Nr,select:wI,selectAll:xI,selectChild:Dr.selectChild,selectChildren:Dr.selectChildren,filter:pI,merge:mI,selection:SI,transition:zI,call:Dr.call,nodes:Dr.nodes,node:Dr.node,size:Dr.size,empty:Dr.empty,each:Dr.each,on:_I,attr:XR,attrTween:rI,style:MI,styleTween:RI,text:LI,textTween:FI,remove:vI,tween:$R,delay:sI,duration:cI,ease:dI,easeVarying:fI,end:qI,[Symbol.iterator]:Dr[Symbol.iterator]};function VI(n){return((n*=2)<=1?n*n*n:(n-=2)*n*n+2)/2}var UI={time:null,delay:0,duration:250,ease:VI};function GI(n,e){for(var t;!(t=n.__transition)||!(t=t[e]);)if(!(n=n.parentNode))throw new Error(`transition ${e} not found`);return t}function $I(n){var e,t;n instanceof Nr?(e=n._id,n=n._name):(e=R2(),(t=UI).time=bf(),n=n==null?null:n+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],a=s.length,l,c=0;c<a;++c)(l=s[c])&&gc(l,n,e,c,s,t||GI(l,e));return new Nr(r,this._parents,n,e)}Ps.prototype.interrupt=VR,Ps.prototype.transition=$I;const kf=Math.PI,Sf=2*kf,Ui=1e-6,WI=Sf-Ui;function I2(n){this._+=n[0];for(let e=1,t=n.length;e<t;++e)this._+=arguments[e]+n[e]}function KI(n){let e=Math.floor(n);if(!(e>=0))throw new Error(`invalid digits: ${n}`);if(e>15)return I2;const t=10**e;return function(r){this._+=r[0];for(let i=1,o=r.length;i<o;++i)this._+=Math.round(arguments[i]*t)/t+r[i]}}class jI{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?I2:KI(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,r,i){this._append`Q${+e},${+t},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(e,t,r,i,o,s){this._append`C${+e},${+t},${+r},${+i},${this._x1=+o},${this._y1=+s}`}arcTo(e,t,r,i,o){if(e=+e,t=+t,r=+r,i=+i,o=+o,o<0)throw new Error(`negative radius: ${o}`);let s=this._x1,a=this._y1,l=r-e,c=i-t,u=s-e,d=a-t,m=u*u+d*d;if(this._x1===null)this._append`M${this._x1=e},${this._y1=t}`;else if(m>Ui)if(!(Math.abs(d*l-c*u)>Ui)||!o)this._append`L${this._x1=e},${this._y1=t}`;else{let b=r-s,f=i-a,y=l*l+c*c,w=b*b+f*f,k=Math.sqrt(y),E=Math.sqrt(m),S=o*Math.tan((kf-Math.acos((y+m-w)/(2*k*E)))/2),D=S/E,R=S/k;Math.abs(D-1)>Ui&&this._append`L${e+D*u},${t+D*d}`,this._append`A${o},${o},0,0,${+(d*b>u*f)},${this._x1=e+R*l},${this._y1=t+R*c}`}}arc(e,t,r,i,o,s){if(e=+e,t=+t,r=+r,s=!!s,r<0)throw new Error(`negative radius: ${r}`);let a=r*Math.cos(i),l=r*Math.sin(i),c=e+a,u=t+l,d=1^s,m=s?i-o:o-i;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>Ui||Math.abs(this._y1-u)>Ui)&&this._append`L${c},${u}`,r&&(m<0&&(m=m%Sf+Sf),m>WI?this._append`A${r},${r},0,1,${d},${e-a},${t-l}A${r},${r},0,1,${d},${this._x1=c},${this._y1=u}`:m>Ui&&this._append`A${r},${r},0,${+(m>=kf)},${d},${this._x1=e+r*Math.cos(o)},${this._y1=t+r*Math.sin(o)}`)}rect(e,t,r,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function Co(n){return function(){return n}}function QI(n){let e=3;return n.digits=function(t){if(!arguments.length)return e;if(t==null)e=null;else{const r=Math.floor(t);if(!(r>=0))throw new RangeError(`invalid digits: ${t}`);e=r}return n},()=>new jI(e)}function YI(n){return typeof n=="object"&&"length"in n?n:Array.from(n)}function O2(n){this._context=n}O2.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(n,e){switch(n=+n,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(n,e):this._context.moveTo(n,e);break;case 1:this._point=2;default:this._context.lineTo(n,e);break}}};function ZI(n){return new O2(n)}function XI(n){return n[0]}function JI(n){return n[1]}function eO(n,e){var t=Co(!0),r=null,i=ZI,o=null,s=QI(a);n=typeof n=="function"?n:n===void 0?XI:Co(n),e=typeof e=="function"?e:e===void 0?JI:Co(e);function a(l){var c,u=(l=YI(l)).length,d,m=!1,b;for(r==null&&(o=i(b=s())),c=0;c<=u;++c)!(c<u&&t(d=l[c],c,l))===m&&((m=!m)?o.lineStart():o.lineEnd()),m&&o.point(+n(d,c,l),+e(d,c,l));if(b)return o=null,b+""||null}return a.x=function(l){return arguments.length?(n=typeof l=="function"?l:Co(+l),a):n},a.y=function(l){return arguments.length?(e=typeof l=="function"?l:Co(+l),a):e},a.defined=function(l){return arguments.length?(t=typeof l=="function"?l:Co(!!l),a):t},a.curve=function(l){return arguments.length?(i=l,r!=null&&(o=i(r)),a):i},a.context=function(l){return arguments.length?(l==null?r=o=null:o=i(r=l),a):r},a}function L2(n,e,t){n._context.bezierCurveTo((2*n._x0+n._x1)/3,(2*n._y0+n._y1)/3,(n._x0+2*n._x1)/3,(n._y0+2*n._y1)/3,(n._x0+4*n._x1+e)/6,(n._y0+4*n._y1+t)/6)}function P2(n){this._context=n}P2.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:L2(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(n,e){switch(n=+n,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(n,e):this._context.moveTo(n,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:L2(this,n,e);break}this._x0=this._x1,this._x1=n,this._y0=this._y1,this._y1=e}};function tO(n){return new P2(n)}function $s(n,e,t){this.k=n,this.x=e,this.y=t}$s.prototype={constructor:$s,scale:function(n){return n===1?this:new $s(this.k*n,this.x,this.y)},translate:function(n,e){return n===0&e===0?this:new $s(this.k,this.x+this.k*n,this.y+this.k*e)},apply:function(n){return[n[0]*this.k+this.x,n[1]*this.k+this.y]},applyX:function(n){return n*this.k+this.x},applyY:function(n){return n*this.k+this.y},invert:function(n){return[(n[0]-this.x)/this.k,(n[1]-this.y)/this.k]},invertX:function(n){return(n-this.x)/this.k},invertY:function(n){return(n-this.y)/this.k},rescaleX:function(n){return n.copy().domain(n.range().map(this.invertX,this).map(n.invert,n))},rescaleY:function(n){return n.copy().domain(n.range().map(this.invertY,this).map(n.invert,n))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},$s.prototype;var Cf={exports:{}},B2;function nO(){return B2||(B2=1,function(n){(function(){function e(a,l){var c=a.x-l.x,u=a.y-l.y;return c*c+u*u}function t(a,l,c){var u=l.x,d=l.y,m=c.x-u,b=c.y-d;if(m!==0||b!==0){var f=((a.x-u)*m+(a.y-d)*b)/(m*m+b*b);f>1?(u=c.x,d=c.y):f>0&&(u+=m*f,d+=b*f)}return m=a.x-u,b=a.y-d,m*m+b*b}function r(a,l){for(var c=a[0],u=[c],d,m=1,b=a.length;m<b;m++)d=a[m],e(d,c)>l&&(u.push(d),c=d);return c!==d&&u.push(d),u}function i(a,l,c,u,d){for(var m=u,b,f=l+1;f<c;f++){var y=t(a[f],a[l],a[c]);y>m&&(b=f,m=y)}m>u&&(b-l>1&&i(a,l,b,u,d),d.push(a[b]),c-b>1&&i(a,b,c,u,d))}function o(a,l){var c=a.length-1,u=[a[0]];return i(a,0,c,l,u),u.push(a[c]),u}function s(a,l,c){if(a.length<=2)return a;var u=l!==void 0?l*l:1;return a=c?a:r(a,u),a=o(a,u),a}n.exports=s,n.exports.default=s})()}(Cf)),Cf.exports}var rO=nO();const iO=or(rO),oO={name:"drawingBlock",components:{NodeViewWrapper:Mi,mediaContainer:Bh},props:{editor:{type:Object},node:{type:Object},decorations:{type:Array},selected:{type:Boolean},extension:{type:Object},getPos:{type:Function},updateAttributes:{type:Function},deleteNode:{type:Function}},data(){return{color:"#000000",size:3,svg:null,path:null,points:[],drawing:!1,id:this.$SUtility.Guid(),colorList:[{name:"gray",color:"#787774"},{name:"purple",color:"#958DF1"},{name:"pink",color:"#f58eda"},{name:"red",color:"#F98181"},{name:"orange",color:"#FBBC88"},{name:"yellow",color:"#FAF594"},{name:"blue",color:"#4086cb"},{name:"teal",color:"#94FADB"},{name:"green",color:"#B9F18D"},{name:"rose",color:"#ee7686"},{name:"fresh_blue",color:"#70CFF8"},{name:"ice_blue",color:"#9fc2ca"},{name:"dark_blue",color:"#0c4a83"},{name:"fresh_green",color:"#55ddb6"}],activeErase:!1,mouseDown:!1,thisTheme:this.editor.storage.defaultStorage.theme,thisForeground:this.editor.storage.defaultStorage.foreground}},watch:{"editor.storage.defaultStorage.theme"(n){this.thisTheme=n},"editor.storage.defaultStorage.foreground"(n){this.thisForeground=n}},computed:{eraseBackground(){return this.activeErase?this.thisForeground:this.thisTheme==="dark"?"rgba(0, 0, 0, 1)":"rgba(255, 255, 255, 1)"}},methods:{onStartDrawing(n){if(this.mouseDown=!0,!this.editor.isEditable||this.activeErase)return;this.drawing=!0,this.points=[],this.path=this.svg.append("path").data([this.points]).attr("id",`id-${this.id}`).attr("stroke",this.color).attr("stroke-width",this.size);const e=n.type==="mousedown"?"mousemove":"touchmove";this.svg.on(e,this.onMove)},onMove(n){this.editor.isEditable&&(this.activeErase||(n.preventDefault(),this.points.push(dR(n)[0]),this.tick()))},onEndDrawing(){this.mouseDown=!1,this.editor.isEditable&&(this.activeErase||(this.svg.on("mousemove",null),this.svg.on("touchmove",null),this.drawing&&(this.drawing=!1,this.svg.select(`#id-${this.id}`).remove(),this.id=this.$SUtility.Guid())))},delMe(n){this.activeErase&&this.updateAttributes({lines:this.node.attrs.lines.filter(e=>e.id!==n.id)})},moveDelMe(n){this.mouseDown&&this.activeErase&&this.updateAttributes({lines:this.node.attrs.lines.filter(e=>e.id!==n.id)})},simplifyPoints(n){return iO(n.map(e=>({x:e[0],y:e[1]}))).map(e=>[e.x,e.y])},tick(){requestAnimationFrame(()=>{this.path.attr("d",n=>{const e=eO().curve(tO)(n),t=this.node.attrs.lines.filter(r=>r.id!==this.id);return this.updateAttributes({lines:[...t,{id:this.id,color:this.color,size:this.size,path:e}]}),e})})},clear(){this.updateAttributes({lines:[]})}},mounted(){this.svg=cR(this.$refs.canvas),this.svg.on("mousedown",this.onStartDrawing).on("mouseup",this.onEndDrawing).on("mouseleave",this.onEndDrawing).on("touchstart",this.onStartDrawing).on("touchend",this.onEndDrawing).on("touchleave",this.onEndDrawing)}},sO={class:"power-editor-d-b-container"},aO={class:"power-editor-d-b-block l1"},lO={style:{height:"100%","margin-left":"5px","font-size":"12px",display:"flex","align-items":"center"}},cO={class:"power-editor-d-b-block overlay"},uO={class:"power-editor-d-b-block"},dO=["d","id","stroke","stroke-width","onMousemove","onClick"];function hO(n,e,t,r,i,o){const s=v.resolveComponent("fv-button"),a=v.resolveComponent("fv-slider"),l=v.resolveComponent("media-container"),c=v.resolveComponent("node-view-wrapper");return v.openBlock(),v.createBlock(c,{class:v.normalizeClass(["power-editor-drawing-block-container",[{dark:i.thisTheme==="dark"}]]),style:v.normalizeStyle({"justify-content":t.node.attrs.alignCenter?"center":"flex-start"})},{default:v.withCtx(()=>[v.withDirectives(v.createElementVNode("div",sO,[v.createElementVNode("div",aO,[v.createVNode(s,{theme:i.thisTheme,"font-size":12,borderRadius:50,disabled:i.size<=1,background:i.thisTheme==="dark"?"rgba(0, 0, 0, 1)":"rgba(255, 255, 255, 1)",class:"power-editor-d-b-btn __size","border-color":"transparent",onClick:e[0]||(e[0]=u=>i.size=i.size>1?i.size-1:i.size)},{default:v.withCtx(()=>e[7]||(e[7]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--Remove"},null,-1)])),_:1,__:[7]},8,["theme","disabled","background"]),v.createVNode(a,{modelValue:i.size,"onUpdate:modelValue":e[1]||(e[1]=u=>i.size=u),theme:i.thisTheme,mininum:1,maxinum:10,icon:"RadioBullet",showLabel:!0,color:i.thisForeground,background:"rgba(245, 245, 245, 0.3)",style:{width:"150px",height:"100%","margin-left":"5px","margin-right":"5px"}},{default:v.withCtx(u=>[v.createElementVNode("span",lO,v.toDisplayString(u.modelValue),1)]),_:1},8,["modelValue","theme","color"]),v.createVNode(s,{theme:i.thisTheme,"font-size":12,borderRadius:50,disabled:i.size>=10,background:i.thisTheme==="dark"?"rgba(0, 0, 0, 1)":"rgba(255, 255, 255, 1)",class:"power-editor-d-b-btn __size","border-color":"transparent",onClick:e[2]||(e[2]=u=>i.size=i.size<10?i.size/1+1:i.size)},{default:v.withCtx(()=>e[8]||(e[8]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--Add"},null,-1)])),_:1,__:[8]},8,["theme","disabled","background"])]),v.createElementVNode("div",cO,[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.colorList,(u,d)=>(v.openBlock(),v.createBlock(s,{class:"power-editor-d-b-btn __color",key:"color:"+d,theme:"dark","font-size":12,borderRadius:50,background:u.color,isBoxShadow:i.color!==u.color,onClick:m=>i.color=u.color},{default:v.withCtx(()=>e[9]||(e[9]=[v.createTextVNode(v.toDisplayString(""))])),_:2,__:[9]},1032,["background","isBoxShadow","onClick"]))),128))]),v.createElementVNode("div",uO,[v.createVNode(s,{class:"power-editor-d-b-btn __clear","font-size":10,borderRadius:50,background:o.eraseBackground,theme:i.activeErase?"dark":i.thisTheme,"border-color":"transparent",style:{"margin-right":"5px"},onClick:e[3]||(e[3]=u=>i.activeErase^=!0)},{default:v.withCtx(()=>e[10]||(e[10]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--EraseTool"},null,-1)])),_:1,__:[10]},8,["background","theme"]),v.createVNode(s,{class:"power-editor-d-b-btn __clear","font-size":10,borderRadius:50,background:i.thisTheme==="dark"?"rgba(0, 0, 0, 1)":"rgba(255, 255, 255, 1)",theme:i.thisTheme,"border-color":"transparent",onClick:o.clear},{default:v.withCtx(()=>e[11]||(e[11]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--Refresh"},null,-1)])),_:1,__:[11]},8,["background","theme","onClick"])])],512),[[v.vShow,t.editor.isEditable]]),v.createVNode(l,{width:t.node.attrs.width,"onUpdate:width":e[4]||(e[4]=u=>t.node.attrs.width=u),caption:t.node.attrs.caption,alignCenter:t.node.attrs.alignCenter,"onUpdate:alignCenter":e[5]||(e[5]=u=>t.node.attrs.alignCenter=u),editor:t.editor,theme:i.thisTheme,foreground:i.thisForeground,node:t.node,getPos:t.getPos,"onUpdate:caption":e[6]||(e[6]=u=>t.updateAttributes({caption:u}))},{default:v.withCtx(()=>[(v.openBlock(),v.createElementBlock("svg",{class:v.normalizeClass(["canvas-svg",[{readonly:!t.editor.isEditable}]]),viewBox:"0 0 500 250",ref:"canvas"},[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(t.node.attrs.lines,u=>(v.openBlock(),v.createElementBlock(v.Fragment,null,[u.id!==i.id?(v.openBlock(),v.createElementBlock("path",{key:u.id,d:u.path,id:`id-${u.id}`,stroke:u.color,"stroke-width":u.size,onMousemove:d=>o.moveDelMe(u),onClick:d=>o.delMe(u)},null,40,dO)):v.createCommentVNode("",!0)],64))),256))],2))]),_:1},8,["width","caption","alignCenter","editor","theme","foreground","node","getPos"])]),_:1},8,["class","style"])}const fO=Gt(oO,[["render",hO]]),pO=xt.create({name:"drawingBlock",group:"block",draggable:!0,atom:!0,addAttributes(){return{lines:{default:[]},width:{default:"100%"},caption:{default:""},alignCenter:{default:!0}}},parseHTML(){return[{tag:"drawing-block"}]},renderHTML({HTMLAttributes:n}){return["drawing-block",$e(n)]},addNodeView(){return ti(fO)}}),mO=Je.create({name:"formatPainter",addOptions(){return{}},addStorage(){return{formatPainterStatus:"off",formatPainterList:{marks:[],attributes:[]}}},addCommands(){let n={bold:{func:"setBold",cancelFunc:"unsetBold"},italic:{func:"setItalic",cancelFunc:"unsetItalic"},underline:{func:"setUnderline",cancelFunc:"unsetUnderline"},strike:{func:"setStrike",cancelFunc:"unsetStrike"},blockquote:{func:"setBlockquote",cancelFunc:"unsetBlockquote"},superscript:{func:"setSuperscript",cancelFunc:"unsetSuperscript"},subscript:{func:"setSubscript",cancelFunc:"unsetSubscript"},powerTaskList:{func:"setPowerTaskList"},bulletList:{func:"setBulletList"},orderedList:{func:"setOrderedList"},textAlignLeft:{alias:"textAlign",func:"setTextAlign",value:"left"},textAlignCenter:{alias:"textAlign",func:"setTextAlign",value:"center"},textAlignRight:{alias:"textAlign",func:"setTextAlign",value:"right"},textAlignJustify:{alias:"textAlign",func:"setTextAlign",value:"justify"},code:{func:"setCode",cancelFunc:"unsetCode"},codeBlock:{func:"setCodeBlock"}},e={heading:{func:"setHeading",cancelFunc:"unsetHeading"},textStyle:{func:"setColor",deconstructKey:"color",cancelFunc:"unsetColor"},highlight:{func:"setHighlight",cancelFunc:"unsetHighlight"}};return{detectFormat:()=>({editor:t})=>{let r=[],i=[];for(let o in e){let s=t.getAttributes(o);if(Object.keys(s).length>0){let a=e[o];i.push({name:o,value:a.deconstructKey?s[a.deconstructKey]:s,func:a.func})}else if(e[o].cancelFunc){let a=e[o];i.push({name:o,func:a.cancelFunc})}}for(let o in n){let s=n[o].alias||o,a=!1;if(n[o].value){let l={};l[s]=n[o].value,a=t.isActive(l)}else a=t.isActive(o);if(a){let l={name:s,func:n[o].func};n[o].value&&(l.value=n[o].value),r.push(l)}else if(n[o].cancelFunc){let l={name:s,func:n[o].cancelFunc};r.push(l)}}return t.storage.formatPainter.formatPainterList={marks:r,attributes:i},{marks:r,attributes:i}},pasteFormat:()=>({editor:t,commands:r})=>{const{marks:i,attributes:o}=t.storage.formatPainter.formatPainterList;for(let s of i)s.value?r[s.func](s.value):r[s.func]();for(let s of o)s.value?r[s.func](s.value):r[s.func]();return!0},setFormatPainter:()=>({editor:t})=>{t.storage.formatPainter.formatPainterStatus="once"},stickyFormatPainter:()=>({editor:t})=>{t.storage.formatPainter.formatPainterStatus="on"},unsetFormatPainter:()=>({editor:t})=>{t.storage.formatPainter.formatPainterStatus="off"},unsetHeading:()=>({editor:t,commands:r})=>{let i=t.getAttributes("heading").level;if(i)return r.toggleHeading({level:i})},setBulletList:()=>({editor:t,commands:r})=>{if(!t.isActive("bulletList"))return r.toggleBulletList()},setOrderedList:()=>({editor:t,commands:r})=>{if(!t.isActive("orderedList"))return r.toggleOrderedList()}}},addKeyboardShortcuts(){return{"Alt-c":()=>this.editor.commands.detectFormat(),"Alt-v":()=>this.editor.commands.pasteFormat()}}}),gO={emits:["update:show"],props:{popperClass:{default:[]},title:{default:"Title"},show:{default:!1},mobileMode:{default:!1},foreground:{default:""},language:{default:"en"},theme:{default:"light"}},data(){return{thisShow:!1}},watch:{show(n){this.thisShow=n},thisShow(n){this.$emit("update:show",n)}},methods:{getTitle(n){return In(n,this.language)},triggerShow(){console.log(111),this.thisShow=!0}},beforeUnmount(){try{document.querySelector("body").removeChild(this.$el)}catch{}}},bO={style:{"font-size":"13.8px"}},_O={key:1},yO={class:"p-e-c-b-m-banner"},vO={class:"p-e-c-b-m-title"},wO={class:"main",style:{width:"100%",height:"100%"}};function xO(n,e,t,r,i,o){const s=v.resolveComponent("fv-callout"),a=v.resolveComponent("fv-drawer");return v.openBlock(),v.createElementBlock("div",{class:v.normalizeClass(["power-editor-callout-base-container",[{dark:t.theme==="dark"}]])},[t.mobileMode?v.createCommentVNode("",!0):(v.openBlock(),v.createBlock(s,{key:0,modelValue:i.thisShow,"onUpdate:modelValue":e[0]||(e[0]=l=>i.thisShow=l),lockScroll:!0,position:"bottomCenter",disabled:t.mobileMode,beak:12,space:8,theme:t.theme,effect:"click",popperClass:[...t.popperClass,"power-editor-callout-base-pc-container"],"popper-style":{background:t.theme==="dark"?"rgba(56, 56, 56, 1)":"rgba(250, 250, 250, 1)"},"border-radius":12},{header:v.withCtx(()=>[v.renderSlot(n.$slots,"header",{title:t.title},()=>[v.createElementVNode("p",bO,v.toDisplayString(t.title),1)])]),main:v.withCtx(()=>[v.renderSlot(n.$slots,"content",{index:"1"})]),default:v.withCtx(()=>[v.renderSlot(n.$slots,"trigger",{show:!1})]),_:3},8,["modelValue","disabled","theme","popperClass","popper-style"])),t.mobileMode?(v.openBlock(),v.createElementBlock("div",_O,[v.renderSlot(n.$slots,"trigger",{show:o.triggerShow}),v.createVNode(a,{modelValue:i.thisShow,"onUpdate:modelValue":e[2]||(e[2]=l=>i.thisShow=l),theme:t.theme,class:v.normalizeClass(["power-editor-callout-base-mobile-container",[{dark:t.theme==="dark"}]]),length:"calc(100% - 50px)",background:t.theme==="dark"?"rgba(56, 56, 56, 0.9)":"rgba(252, 252, 252, 0.9)","control-padding":"0px 12px",contentPadding:"0px 15px",appendBody:!0,"z-index":20},{header:v.withCtx(()=>[v.createElementVNode("div",yO,[v.renderSlot(n.$slots,"header",{title:t.title},()=>[e[3]||(e[3]=v.createElementVNode("p",{style:{width:"50px"}},null,-1)),v.createElementVNode("p",vO,v.toDisplayString(t.title),1)]),v.createElementVNode("p",{class:"p-e-c-b-m-close",style:v.normalizeStyle({color:t.theme==="dark"?"whitesmoke":t.foreground}),onClick:e[1]||(e[1]=l=>i.thisShow=!1)},v.toDisplayString(o.getTitle("Cancel")),5)])]),default:v.withCtx(()=>[v.createElementVNode("div",{class:v.normalizeClass(["p-e-c-b-m-content-block",t.popperClass])},[v.createElementVNode("div",wO,[v.renderSlot(n.$slots,"content",{index:"2"})])],2)]),_:3},8,["modelValue","theme","class","background"])])):v.createCommentVNode("",!0)],2)}const Gi=Gt(gO,[["render",xO]]),kO={components:{calloutBase:Gi},emits:["insert-link"],props:{mobileMode:{default:!1},foreground:{default:""},language:{default:"en"},theme:{default:"light"}},data(){return{link:"",caption:"",show:!1}},watch:{show(n){n?this.getSelection():(this.link="",this.caption="")}},methods:{insert(){if(this.link==="")return 0;this.caption=this.caption==""?this.link:this.caption,this.$emit("insert-link",`<a href="${this.link}">${this.caption}</a>`),this.show=!1},getSelection(){try{this.caption=window.getSelection().toString()}catch(n){console.log(n)}},getTitle(n){return In(n,this.language)}}},SO={class:"power-editor-l-c-control-block"};function CO(n,e,t,r,i,o){const s=v.resolveComponent("fv-text-box"),a=v.resolveComponent("fv-button"),l=v.resolveComponent("callout-base");return v.openBlock(),v.createBlock(l,{show:i.show,"onUpdate:show":e[2]||(e[2]=c=>i.show=c),mobileMode:t.mobileMode,title:o.getTitle("Insert Link"),foreground:t.foreground,theme:t.theme,language:t.language,popperClass:["power-editor-link-callout"]},{trigger:v.withCtx(c=>[v.renderSlot(n.$slots,"default",{show:c.show})]),content:v.withCtx(()=>[v.createElementVNode("div",{class:v.normalizeClass(["power-editor-l-c-block",[{dark:t.theme==="dark"}]])},[v.createCommentVNode("",!0),v.createVNode(s,{modelValue:i.caption,"onUpdate:modelValue":e[0]||(e[0]=c=>i.caption=c),placeholder:o.getTitle("Caption"),theme:t.theme,icon:"TextField",underline:"","border-width":2,"is-box-shadow":!0,"border-color":"rgba(200, 200, 200, 0.1)",background:t.theme==="dark"?"#1a1a1a":"#fff","focus-border-color":t.foreground,style:{width:"100%","margin-top":"5px"}},null,8,["modelValue","placeholder","theme","background","focus-border-color"]),v.createVNode(s,{modelValue:i.link,"onUpdate:modelValue":e[1]||(e[1]=c=>i.link=c),icon:"Link",placeholder:o.getTitle("Insert Link Url..."),theme:t.theme,underline:"","border-width":2,"is-box-shadow":!0,"border-color":"rgba(200, 200, 200, 0.1)",background:t.theme==="dark"?"#1a1a1a":"#fff","focus-border-color":t.foreground,style:{width:"100%","margin-top":"15px"}},null,8,["modelValue","placeholder","theme","background","focus-border-color"])],2),v.createElementVNode("div",SO,[v.createVNode(a,{theme:"dark",disabled:i.link==="",background:t.foreground,"border-radius":"6","is-box-shadow":!0,style:{width:"150px"},onClick:o.insert},{default:v.withCtx(()=>[v.createTextVNode(v.toDisplayString(o.getTitle("Insert")),1)]),_:1},8,["disabled","background","onClick"])])]),_:3},8,["show","mobileMode","title","foreground","theme","language"])}const EO=Gt(kO,[["render",CO]]),TO={components:{calloutBase:Gi},emits:["insert-embed"],props:{mobileMode:{default:!1},foreground:{default:""},language:{default:"en"},theme:{default:"light"}},data(){return{link:"",caption:"",show:!1}},watch:{show(n){n||(this.link="",this.caption="")}},methods:{insert(){if(this.link==="")return 0;this.$emit("insert-embed",`<embed-block src="${this.link}" caption="${this.caption}" theme="${this.theme}"></embed-block>`),this.show=!1},getTitle(n){return In(n,this.language)}}},AO={class:"power-editor-e-c-control-block"};function MO(n,e,t,r,i,o){const s=v.resolveComponent("fv-text-box"),a=v.resolveComponent("fv-button"),l=v.resolveComponent("callout-base");return v.openBlock(),v.createBlock(l,{show:i.show,"onUpdate:show":e[2]||(e[2]=c=>i.show=c),mobileMode:t.mobileMode,title:o.getTitle("Insert Embed"),foreground:t.foreground,theme:t.theme,language:t.language,popperClass:["power-editor-embed-callout"]},{trigger:v.withCtx(c=>[v.renderSlot(n.$slots,"default",{show:c.show})]),content:v.withCtx(()=>[v.createElementVNode("div",{class:v.normalizeClass(["power-editor-e-c-block",[{dark:t.theme==="dark"}]])},[v.createCommentVNode("",!0),v.createVNode(s,{modelValue:i.caption,"onUpdate:modelValue":e[0]||(e[0]=c=>i.caption=c),placeholder:o.getTitle("Caption"),theme:t.theme,icon:"TextField",underline:"","border-width":2,"is-box-shadow":!0,"border-color":"rgba(200, 200, 200, 0.1)","focus-border-color":t.foreground,background:t.theme==="dark"?"#1a1a1a":"#fff",style:{width:"100%","margin-top":"5px"}},null,8,["modelValue","placeholder","theme","focus-border-color","background"]),v.createVNode(s,{modelValue:i.link,"onUpdate:modelValue":e[1]||(e[1]=c=>i.link=c),icon:"Link",placeholder:o.getTitle("Insert Embed Url..."),theme:t.theme,underline:"","border-width":2,"is-box-shadow":!0,"border-color":"rgba(200, 200, 200, 0.1)","focus-border-color":t.foreground,background:t.theme==="dark"?"#1a1a1a":"#fff",style:{width:"100%","margin-top":"15px"}},null,8,["modelValue","placeholder","theme","focus-border-color","background"])],2),v.createElementVNode("div",AO,[v.createVNode(a,{theme:"dark",disabled:i.link==="",background:t.foreground,"border-radius":"6","is-box-shadow":!0,style:{width:"150px"},onClick:o.insert},{default:v.withCtx(()=>[v.createTextVNode(v.toDisplayString(o.getTitle("Insert")),1)]),_:1},8,["disabled","background","onClick"])])]),_:3},8,["show","mobileMode","title","foreground","theme","language"])}const NO=Gt(TO,[["render",MO]]),DO={components:{calloutBase:Gi},props:{foreground:{default:""},getBackground:{default:()=>{}},getForeground:{default:()=>{}},exec:{default:()=>{}},execMore:{default:()=>{}},editor:{default:null},mobileMode:{default:!1},language:{default:"en"},theme:{default:"light"}},data(){return{show:!1,colorList:[{name:"gray",color:"#787774"},{name:"purple",color:"#958DF1"},{name:"pink",color:"#f58eda"},{name:"red",color:"#F98181"},{name:"orange",color:"#FBBC88"},{name:"yellow",color:"#FAF594"},{name:"blue",color:"#4086cb"},{name:"teal",color:"#94FADB"},{name:"green",color:"#B9F18D"},{name:"rose",color:"#ee7686"},{name:"fresh_blue",color:"#70CFF8"},{name:"ice_blue",color:"#9fc2ca"},{name:"dark_blue",color:"#0c4a83"},{name:"fresh_green",color:"#55ddb6"}],highlightList:[{name:"red",color:"red"},{name:"red",color:"#ffa8a8"},{name:"yellow",color:"#FAF594"},{name:"orange",color:"#ffc078"},{name:"green",color:"#8ce99a"},{name:"blue",color:"#74c0fc"},{name:"purple",color:"#b197fc"},{name:"light_green",color:"#d1f6e7"},{name:"light_yellow",color:"#fdf0c6"},{name:"light_red",color:"#ffe3e3"},{name:"light_purple",color:"#e9e1f9"},{name:"light_orange",color:"#ffe5c7"}]}},watch:{},methods:{getTitle(n){return In(n,this.language)},execX(n){this.exec(n),this.mobileMode&&(this.show=!1)},execMoreX(n,e){this.execMore(n,e),this.mobileMode&&(this.show=!1)}}},RO={class:"peci-comment"},IO=["onClick"],OO={class:"peci-comment"},LO={class:"peci-comment"},PO=["onClick"],BO={class:"peci-comment"};function FO(n,e,t,r,i,o){const s=v.resolveComponent("callout-base");return v.openBlock(),v.createBlock(s,{show:i.show,"onUpdate:show":e[2]||(e[2]=a=>i.show=a),mobileMode:t.mobileMode,title:o.getTitle("Text Color"),foreground:t.foreground,theme:t.theme,language:t.language,popperClass:["power-editor-color-callout"]},{trigger:v.withCtx(a=>[v.renderSlot(n.$slots,"default",{show:a.show})]),content:v.withCtx(()=>[v.createElementVNode("p",{class:"power-menu-sec-title",style:v.normalizeStyle({"--power-menu-sec-title-background":t.foreground})},v.toDisplayString(o.getTitle("Foreground")),5),v.createElementVNode("div",{class:v.normalizeClass(["power-editor-color-item",[{dark:t.theme=="dark"}]]),onClick:e[0]||(e[0]=a=>o.execX("unsetColor"))},[e[3]||(e[3]=v.createElementVNode("p",{class:"peci-example"},"A",-1)),v.createElementVNode("p",RO,v.toDisplayString(o.getTitle("removeColor")),1)],2),(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.colorList,(a,l)=>(v.openBlock(),v.createElementBlock("div",{class:v.normalizeClass(["power-editor-color-item",[{dark:t.theme=="dark",choosen:t.editor.isActive("textStyle",{color:a.color})}]]),key:"color:"+l,onClick:c=>o.execMoreX("setColor",a.color)},[v.createElementVNode("p",{class:"peci-example",style:v.normalizeStyle({color:a.color})},"A",4),v.createElementVNode("p",OO,v.toDisplayString(o.getTitle(a.name)),1)],10,IO))),128)),v.createElementVNode("p",{class:"power-menu-sec-title",style:v.normalizeStyle({"--power-menu-sec-title-background":t.foreground})},v.toDisplayString(o.getTitle("Highlight Background")),5),v.createElementVNode("div",{class:v.normalizeClass(["power-editor-color-item",[{dark:t.theme=="dark"}]]),onClick:e[1]||(e[1]=a=>o.execX("unsetHighlight"))},[e[4]||(e[4]=v.createElementVNode("p",{class:"peci-example"},"A",-1)),v.createElementVNode("p",LO,v.toDisplayString(o.getTitle("removeHighlight")),1)],2),(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.highlightList,(a,l)=>(v.openBlock(),v.createElementBlock("div",{class:v.normalizeClass(["power-editor-color-item",[{dark:t.theme=="dark",choosen:t.editor.isActive("highlight",{color:a.color})}]]),key:"highlight:"+l,onClick:c=>o.execMoreX("setHighlight",{color:a.color})},[v.createElementVNode("p",{class:"peci-example",style:v.normalizeStyle({background:a.color})},"A",4),v.createElementVNode("p",BO,v.toDisplayString(o.getTitle(a.name)),1)],10,PO))),128))]),_:3},8,["show","mobileMode","title","foreground","theme","language"])}const F2=Gt(DO,[["render",FO]]),zO=[{name:"People and Fantasy",emojis:["😀","😃","😄","😁","😆","😅","😂","🤣","☺️","😊","😇","🙂","🙃","😉","😌","😍","🥰","😘","😗","😙","😚","😋","😛","😝","😜","🤪","🤨","🧐","🤓","😎","🤩","🥳","😏","😒","😞","😔","😟","😕","🙁","☹️","😣","😖","😫","😩","🥺","😢","😭","😤","😠","😡","🤬","🤯","😳","🥵","🥶","😱","😨","😰","😥","😓","🤗","🤔","🤭","🤫","🤥","😶","😐","😑","😬","🙄","😯","😦","😧","😮","😲","🥱","😴","🤤","😪","😵","🤐","🥴","🤢","🤮","🤧","😷","🤒","🤕","🤑","🤠","😈","👿","👹","👺","🤡","💩","👻","💀","☠️","👽","👾","🤖","🎃","😺","😸","😹","😻","😼","😽","🙀","😿","😾"]},{name:"Animals & Nature",emojis:["🐶","🐱","🐭","🐹","🐰","🦊","🐻","🐼","🐻","❄️","🐨","🐯","🦁","🐮","🐷","🐽","🐸","🐵","🙈","🙉","🙊","🐒","🐔","🐧","🐦","🐤","🐣","🐥","🦆","🦅","🦉","🦇","🐺","🐗","🐴","🦄","🐝","🐛","🦋","🐌","🐞","🐜","🦟","🦗","🕷","🕸","🦂","🐢","🐍","🦎","🦖","🦕","🐙","🦑","🦐","🦞","🦀","🐡","🐠","🐟","🐬","🐳","🐋","🦈","🐊","🐅","🐆","🦓","🦍","🦧","🐘","🦛","🦏","🐪","🐫","🦒","🦘","🐃","🐂","🐄","🐎","🐖","🐏","🐑","🦙","🐐","🦌","🐕","🐩","🦮","🐕🦺","🐈","🐓","🦃","🦚","🦜","🦢","🦩","🕊","🐇","🦝","🦨","🦡","🦦","🦥","🐁","🐀","🐿","🦔","🐾","🐉","🐲","🌵","🎄","🌲","🌳","🌴","🌱","🌿","☘️","🍀","🎍","🎋","🍃","🍂","🍁","🍄","🐚","🌾","💐","🌷","🌹","🥀","🌺","🌸","🌼","🌻","🌞","🌝","🌛","🌜","🌚","🌕","🌖","🌗","🌘","🌑","🌒","🌓","🌔","🌙","🌎","🌍","🌏","🪐","💫","⭐️","🌟","✨","⚡️","☄️","💥","🔥","🌪","🌈","☀️","🌤","⛅️","🌥","☁️","🌦","🌧","⛈","🌩","🌨","❄️","☃️","⛄️","🌬","💨","💧","💦","☔️","☂️","🌊","🌫"]},{name:"Food & Drink",emojis:["🍏","🍎","🍐","🍊","🍋","🍌","🍉","🍇","🍓","🍈","🍒","🍑","🥭","🍍","🥥","🥝","🍅","🍆","🥑","🥦","🥬","🥒","🌶","🌽","🥕","🧄","🧅","🥔","🍠","🥐","🥯","🍞","🥖","🥨","🧀","🥚","🍳","🧈","🥞","🧇","🥓","🥩","🍗","🍖","🦴","🌭","🍔","🍟","🍕","🥪","🥙","🧆","🌮","🌯","🥗","🥘","🥫","🍝","🍜","🍲","🍛","🍣","🍱","🥟","🦪","🍤","🍙","🍚","🍘","🍥","🥠","🥮","🍢","🍡","🍧","🍨","🍦","🥧","🧁","🍰","🎂","🍮","🍭","🍬","🍫","🍿","🍩","🍪","🌰","🥜","🍯","🥛","🍼","☕️","🍵","🧃","🥤","🍶","🍺","🍻","🥂","🍷","🥃","🍸","🍹","🧉","🍾","🧊","🥄","🍴","🍽","🥣","🥡","🥢","🧂",""]},{name:"Activity and Sports",emojis:["⚽️","🏀","🏈","⚾️","🥎","🎾","🏐","🏉","🥏","🎱","🪀","🏓","🏸","🏒","🏑","🥍","🏏","🥅","⛳️","🪁","🏹","🎣","🤿","🥊","🥋","🎽","🛹","🛷","⛸","🥌","🎿","⛷","🏂","🪂","🏋️♀️","🏋️","🏋️♂️","🤼♀️","🤼","🤼♂️","🤸♀️","🤸","🤸♂️","⛹️♀️","⛹️","⛹️♂️","🤺","🤾♀️","🤾","🤾♂️","🏌️♀️","🏌️","🏌️♂️","🏇","🧘♀️","🧘","🧘♂️","🏄♀️","🏄","🏄♂️","🏊♀️","🏊","🏊♂️","🤽♀️","🤽","🤽♂️","🚣♀️","🚣","🚣♂️","🧗♀️","🧗","🧗♂️","🚵♀️","🚵","🚵♂️","🚴♀️","🚴","🚴♂️","🏆","🥇","🥈","🥉","🏅","🎖","🏵","🎗","🎫","🎟","🎪","🤹","🤹♂️","🤹♀️","🎭","🩰","🎨","🎬","🎤","🎧","🎼","🎹","🥁","🪘","🎷","🎺","🎸","🪕","🎻","🎲","♟","🎯","🎳","🎮","🎰","🧩"]},{name:"Travel & Places",emojis:["🚗","🚕","🚙","🚌","🚎","🏎","🚓","🚑","🚒","🚐","🚚","🚛","🚜","🦯","🦽","🦼","🛴","🚲","🛵","🏍","🛺","🚨","🚔","🚍","🚘","🚖","🚡","🚠","🚟","🚃","🚋","🚞","🚝","🚄","🚅","🚈","🚂","🚆","🚇","🚊","🚉","✈️","🛫","🛬","🛩","💺","🛰","🚀","🛸","🚁","🛶","⛵️","🚤","🛥","🛳","⛴","🚢","⚓️","🪝","⛽️","🚧","🚦","🚥","🚏","🗺","🗿","🗽","🗼","🏰","🏯","🏟","🎡","🎢","🎠","⛲️","⛱","🏖","🏝","🏜","🌋","⛰","🏔","🗻","🏕","⛺️","🏠","🏡","🏘","🏚","🏗","🏭","🏢","🏬","🏣","🏤","🏥","🏦","🏨","🏪","🏫","🏩","💒","🏛","⛪️","🕌","🕍","🛕","🕋","⛩","🛤","🛣","🗾","🎑","🏞","🌅","🌄","🌠","🎇","🎆","🌇","🌆","🏙","🌃","🌌","🌉","🌁"]},{name:"Objects",emojis:["⌚️","📱","📲","💻","⌨️","🖥","🖨","🖱","🖲","🕹","🗜","💽","💾","💿","📀","📼","📷","📸","📹","🎥","📽","🎞","📞","☎️","📟","📠","📺","📻","🎙","🎚","🎛","🧭","⏱","⏲","⏰","🕰","⌛️","⏳","📡","🔋","🔌","💡","🔦","🕯","🪔","🧯","🛢","💸","💵","💴","💶","💷","💰","💳","💎","⚖️","🧰","🔧","🔨","⚒","🛠","⛏","🔩","⚙️","🧱","⛓","🧲","🔫","💣","🧨","🪓","🔪","🗡","⚔️","🛡","🚬","⚰️","⚱️","🏺","🔮","📿","🧿","💈","⚗️","🔭","🔬","🕳","🩹","🩺","💊","💉","🩸","🧬","🦠","🧫","🧪","🌡","🧹","🧺","🧻","🚽","🚰","🚿","🛁","🛀","🧼","🪒","🧽","🧴","🛎","🔑","🗝","🚪","🪑","🛋","🛏","🛌","🧸","🖼","🛍","🛒","🎁","🎈","🎏","🎀","🪄","🪅","🎊","🎉","🎎","🏮","🎐","🧧","✉️","📩","📨","📧","💌","📥","📤","📦","🏷","📪","📫","📬","📭","📮","📯","📜","📃","📄","📑","🧾","📊","📈","📉","🗒","🗓","📆","📅","🗑","📇","🗃","🗳","🗄","📋","📁","📂","🗂","🗞","📰","📓","📔","📒","📕","📗","📘","📙","📚","📖","🔖","🧷","🔗","📎","🖇","📐","📏","🧮","📌","📍","✂️","🖊","🖋","✒️","🖌","🖍","📝","✏️","🔍","🔎","🔏","🔐","🔒","🔓"]},{name:"Symbols",emojis:["❤️","🧡","💛","💚","💙","💜","🖤","🤍","🤎","💔","❣️","💕","💞","💓","💗","💖","💘","💝","💟","☮️","✝️","☪️","🕉","☸️","✡️","🔯","🕎","☯️","☦️","🛐","⛎","♈️","♉️","♊️","♋️","♌️","♍️","♎️","♏️","♐️","♑️","♒️","♓️","🆔","⚛️","🉑","☢️","☣️","📴","📳","🈶","🈚️","🈸","🈺","🈷️","✴️","🆚","💮","🉐","㊙️","㊗️","🈴","🈵","🈹","🈲","🅰️","🅱️","🆎","🆑","🅾️","🆘","❌","⭕️","🛑","⛔️","📛","🚫","💯","💢","♨️","🚷","🚯","🚳","🚱","🔞","📵","🚭","❗️","❕","❓","❔","‼️","⁉️","🔅","🔆","〽️","⚠️","🚸","🔱","⚜️","🔰","♻️","✅","🈯️","💹","❇️","✳️","❎","🌐","💠","Ⓜ️","🌀","💤","🏧","🚾","♿️","🅿️","🛗","🈳","🈂️","🛂","🛃","🛄","🛅","🚹","🚺","🚼","⚧","🚻","🚮","🎦","📶","🈁","🔣","ℹ️","🔤","🔡","🔠","🆖","🆗","🆙","🆒","🆕","🆓","0️⃣","1️⃣","2️⃣","3️⃣","4️⃣","5️⃣","6️⃣","7️⃣","8️⃣","9️⃣","🔟","🔢","#️⃣","*️⃣","⏏️","▶️","⏸","⏯","⏹","⏺","⏭","⏮","⏩","⏪","⏫","⏬","◀️","🔼","🔽","➡️","⬅️","⬆️","⬇️","↗️","↘️","↙️","↖️","↕️","↔️","↪️","↩️","⤴️","⤵️","🔀","🔁","🔂","🔄","🔃","🎵","🎶","➕","➖","➗","✖️","♾","💲","💱","™️","©️","®️","〰️","➰","➿","🔚","🔙","🔛","🔝","🔜","✔️","☑️","🔘","🔴","🟠","🟡","🟢","🔵","🟣","⚫️","⚪️","🟤","🔺","🔻","🔸","🔹","🔶","🔷","🔳","🔲","▪️","▫️","◾️","◽️","◼️","◻️","🟥","🟧","🟨","🟩","🟦","🟪","⬛️","⬜️","🟫","🔈","🔇","🔉","🔊","🔔","🔕","📣","📢","👁🗨","💬","💭","🗯","♠️","♣️","♥️","♦️","🃏","🎴","🀄️","🕐","🕑","🕒","🕓","🕔","🕕","🕖","🕗","🕘","🕙","🕚","🕛","🕜","🕝","🕞","🕟","🕠","🕡","🕢","🕣","🕤","🕥","🕦","🕧"]},{name:"Flags",emojis:["🏳️","🏴","🏁","🚩","🏳️🌈","🏳️","🏴☠️"]}],qO={components:{calloutBase:Gi},emits:["insert-emoji"],props:{editor:{default:null},foreground:{default:""},mobileMode:{default:!1},language:{default:"en"},theme:{default:"light"}},data(){return{emoji_list:zO,show:!1}},watch:{},methods:{getTitle(n){return In(n,this.language)},insertEmoji(n){this.$emit("insert-emoji",n),this.mobileMode&&(this.show=!1)},insertRandom(){let n=(Math.random()*(this.emoji_list.length-1)).toFixed(0),e=(Math.random()*(this.emoji_list[n].emojis.length-1)).toFixed(0);this.$emit("insert-emoji",this.emoji_list[n].emojis[e]),this.mobileMode&&(this.show=!1)}}},HO={class:"power-editor-emoji-banner"},VO={class:"emoji-title"},UO={class:"title"},GO={class:"power-editor-emoji-group"},$O=["innerHTML","onClick"];function WO(n,e,t,r,i,o){const s=v.resolveComponent("fv-button"),a=v.resolveComponent("fv-infinite-scroll-view"),l=v.resolveComponent("callout-base");return v.openBlock(),v.createBlock(l,{show:i.show,"onUpdate:show":e[1]||(e[1]=c=>i.show=c),mobileMode:t.mobileMode,title:"Emoji",foreground:t.foreground,theme:t.theme,language:t.language,popperClass:["power-editor-emoji-callout"]},{trigger:v.withCtx(c=>[v.renderSlot(n.$slots,"default",{show:c.show})]),header:v.withCtx(c=>[v.createElementVNode("div",HO,[v.createElementVNode("p",VO,v.toDisplayString(o.getTitle(c.title)),1),v.createVNode(s,{theme:t.theme,icon:"Shuffle",background:t.theme==="dark"?"rgba(0, 0, 0, 0.2)":"rgba(255, 255, 255, 0.3)","font-size":"10","border-radius":"6",isBoxShadow:!0,onClick:o.insertRandom},{default:v.withCtx(()=>[v.createTextVNode(v.toDisplayString(o.getTitle("Random")),1)]),_:1},8,["theme","background","onClick"])])]),content:v.withCtx(()=>[v.createVNode(a,{modelValue:i.emoji_list,"onUpdate:modelValue":e[0]||(e[0]=c=>i.emoji_list=c),batchSize:1,style:{width:"100%",height:"100%"}},{default:v.withCtx(c=>[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(c.dynamicValue,(u,d)=>(v.openBlock(),v.createElementBlock("div",{class:"power-editor-emoji-list",key:`type:${d}`},[v.createElementVNode("p",UO,v.toDisplayString(o.getTitle(u.name)),1),v.createElementVNode("div",GO,[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(u.emojis,(m,b)=>(v.openBlock(),v.createElementBlock("i",{key:b,class:"emoji-item",innerHTML:m,onClick:f=>o.insertEmoji(m)},null,8,$O))),128))])]))),128))]),_:1},8,["modelValue"])]),_:3},8,["show","mobileMode","foreground","theme","language"])}const KO=Gt(qO,[["render",WO]]),jO={components:{calloutBase:Gi},emits:["insert-image"],props:{mobileMode:{default:!1},foreground:{default:""},language:{default:"en"},theme:{default:"light"}},data(){return{url:"",show:!1,contentName:["content-1","content-2"]}},watch:{show(n){n||(this.url="",this.mobileMode?this.$refs.img_local_2.value="":this.$refs.img_local_1.value="")}},methods:{insert(){if(this.url==="")return 0;this.$emit("insert-image",[this.url]),this.show=!1},async insertLocal(n){let e=this.$refs[`img_local_${n}`].files;if(e.length<1)return 0;let t=[];for(let r of e){let i=new FileReader;i.readAsDataURL(r);let o=await new Promise(s=>{i.onload=a=>{s(a.target.result)}});t.push(o)}this.$emit("insert-image",t),this.show=!1},getTitle(n){return In(n,this.language)}}},QO={class:"power-editor-i-c-title"},YO=["onClick"],ZO={class:"power-editor-i-c-t2"},XO=["onChange"],JO={class:"power-editor-i-c-title"},eL={class:"power-editor-i-c-control-block"};function tL(n,e,t,r,i,o){const s=v.resolveComponent("fv-text-box"),a=v.resolveComponent("fv-button"),l=v.resolveComponent("callout-base");return v.openBlock(),v.createBlock(l,{show:i.show,"onUpdate:show":e[1]||(e[1]=c=>i.show=c),mobileMode:t.mobileMode,title:o.getTitle("Insert Image"),foreground:t.foreground,theme:t.theme,language:t.language,popperClass:["power-editor-image-callout"]},{trigger:v.withCtx(c=>[v.renderSlot(n.$slots,"default",{show:c.show})]),content:v.withCtx(c=>[v.createElementVNode("div",{class:v.normalizeClass(["power-editor-i-c-block",[{dark:t.theme==="dark"}]])},[v.createElementVNode("p",QO,v.toDisplayString(o.getTitle("Method"))+" 1",1),v.createElementVNode("i",{class:"ms-Icon ms-Icon--Photo2Add power-editor-i-c-icon-1",style:v.normalizeStyle({color:t.foreground}),onClick:u=>n.$refs[`img_local_${c.index}`].click()},null,12,YO),v.createElementVNode("p",ZO,v.toDisplayString(o.getTitle("Choose Local Image as Base64 (multiple).")),1),v.createElementVNode("input",{type:"file",accept:"image/gif,image/png,image/jpeg,image/x-png,image/svg+xml",multiple:"true",style:{display:"none"},ref:`img_local_${c.index}`,onChange:u=>o.insertLocal(c.index)},null,40,XO)],2),v.createElementVNode("div",{class:v.normalizeClass(["power-editor-i-c-block",[{dark:t.theme==="dark"}]])},[v.createElementVNode("p",JO,v.toDisplayString(o.getTitle("Method"))+" 2",1),v.createVNode(s,{modelValue:i.url,"onUpdate:modelValue":e[0]||(e[0]=u=>i.url=u),placeholder:o.getTitle("Insert Image Url."),theme:t.theme,underline:"",icon:"Link","border-width":2,"is-box-shadow":!0,"border-color":"rgba(200, 200, 200, 0.1)","focus-border-color":t.foreground,background:t.theme==="dark"?"#1a1a1a":"#fff",style:{width:"90%",border:"thin",outline:"none"},ref:"img_link"},null,8,["modelValue","placeholder","theme","focus-border-color","background"])],2),v.createElementVNode("div",eL,[v.createVNode(a,{theme:"dark",disabled:i.url==="",background:t.foreground,"border-radius":"6","is-box-shadow":!0,style:{width:"150px"},onClick:o.insert},{default:v.withCtx(()=>[v.createTextVNode(v.toDisplayString(o.getTitle("Insert")),1)]),_:1},8,["disabled","background","onClick"])])]),_:3},8,["show","mobileMode","title","foreground","theme","language"])}const nL=Gt(jO,[["render",tL]]),rL={components:{calloutBase:Gi},props:{mobileMode:{default:!1},foreground:{default:""},getBackground:{default:()=>{}},getForeground:{default:()=>{}},execMore:{default:()=>{}},editor:{default:null},language:{default:"en"},theme:{default:"light"}},data(){return{show:!1}},watch:{},methods:{getTitle(n){return In(n,this.language)},execX(n){this.exec(n),this.mobileMode&&(this.show=!1)},execMoreX(n,e){this.execMore(n,e),this.mobileMode&&(this.show=!1)}}},iL=["onClick"],oL={class:"pehi-comment"};function sL(n,e,t,r,i,o){const s=v.resolveComponent("fv-button"),a=v.resolveComponent("callout-base");return v.openBlock(),v.createBlock(a,{show:i.show,"onUpdate:show":e[0]||(e[0]=l=>i.show=l),mobileMode:t.mobileMode,title:o.getTitle("Headers"),foreground:t.foreground,theme:t.theme,language:t.language,popperClass:["power-editor-header-callout"]},{trigger:v.withCtx(l=>[v.renderSlot(n.$slots,"default",{show:l.show})]),content:v.withCtx(()=>[(v.openBlock(),v.createElementBlock(v.Fragment,null,v.renderList(6,l=>v.createElementVNode("div",{class:v.normalizeClass(["power-editor-heading-item",[{dark:t.theme=="dark",choosen:t.editor.isActive("heading",{level:l})}]]),key:"color:"+l,onClick:c=>o.execMoreX("toggleHeading",{level:l})},[v.createVNode(s,{class:"power-editor-cmd-btn",theme:t.theme,isBoxShadow:!0,background:t.getBackground(t.editor.isActive("heading",{level:l})),foreground:t.getForeground(t.editor.isActive("heading",{level:l})),title:o.getTitle("Heading")+l},{default:v.withCtx(()=>[v.createTextVNode("H"+v.toDisplayString(l),1)]),_:2},1032,["theme","background","foreground","title"]),v.createElementVNode("p",oL,v.toDisplayString(o.getTitle("Heading"))+" "+v.toDisplayString(l),1)],10,iL)),64))]),_:3},8,["show","mobileMode","title","foreground","theme","language"])}const aL=Gt(rL,[["render",sL]]),lL={components:{calloutBase:Gi},props:{mobileMode:{default:!1},foreground:{default:""},getBackground:{default:()=>{}},getForeground:{default:()=>{}},exec:{default:()=>{}},execMore:{default:()=>{}},editor:{default:null},language:{default:"en"},theme:{default:"light"}},data(){return{row:"3",column:"3",show:!1}},watch:{},methods:{getTitle(n){return In(n,this.language)},execX(n){this.exec(n),this.mobileMode&&(this.show=!1)},execMoreX(n,e){this.execMore(n,e),this.mobileMode&&(this.show=!1)}}},cL={class:"power-editor-table-insert-block"},uL={class:"power-editor-table-control-block"};function dL(n,e,t,r,i,o){const s=v.resolveComponent("fv-text-box"),a=v.resolveComponent("fv-button"),l=v.resolveComponent("callout-base");return v.openBlock(),v.createBlock(l,{show:i.show,"onUpdate:show":e[13]||(e[13]=c=>i.show=c),mobileMode:t.mobileMode,title:o.getTitle("Table"),foreground:t.foreground,theme:t.theme,language:t.language,popperClass:["power-editor-table-callout"]},{trigger:v.withCtx(c=>[v.renderSlot(n.$slots,"default",{show:c.show})]),content:v.withCtx(()=>[v.createElementVNode("div",cL,[v.createVNode(s,{modelValue:i.row,"onUpdate:modelValue":e[0]||(e[0]=c=>i.row=c),placeholder:o.getTitle("Row"),theme:t.theme,class:"power-editor-table-text-box",underline:"","border-width":2,"is-box-shadow":!0,"border-color":"rgba(200, 200, 200, 0.1)",background:t.theme==="dark"?"#1a1a1a":"#fff","focus-border-color":t.foreground,onKeydown:e[1]||(e[1]=v.withKeys(c=>o.execMoreX("insertTable",{rows:parseInt(i.row),cols:parseInt(i.column),withHeaderRow:!0}),["enter"]))},null,8,["modelValue","placeholder","theme","background","focus-border-color"]),v.createVNode(s,{modelValue:i.column,"onUpdate:modelValue":e[2]||(e[2]=c=>i.column=c),placeholder:o.getTitle("Column"),theme:t.theme,class:"power-editor-table-text-box",underline:"","border-width":2,"is-box-shadow":!0,"border-color":"rgba(200, 200, 200, 0.1)",background:t.theme==="dark"?"#1a1a1a":"#fff","focus-border-color":t.foreground,onKeydown:e[3]||(e[3]=v.withKeys(c=>o.execMoreX("insertTable",{rows:parseInt(i.row),cols:parseInt(i.column),withHeaderRow:!0}),["enter"]))},null,8,["modelValue","placeholder","theme","background","focus-border-color"]),v.createVNode(a,{theme:"dark",disabled:!i.row||!i.column||isNaN(i.row)||isNaN(i.column),"is-box-shadow":!0,background:t.foreground,"border-radius":6,style:{width:"40px",height:"40px"},onClick:e[4]||(e[4]=c=>o.execMoreX("insertTable",{rows:parseInt(i.row),cols:parseInt(i.column),withHeaderRow:!0}))},{default:v.withCtx(()=>e[14]||(e[14]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--AddBold"},null,-1)])),_:1,__:[14]},8,["disabled","background"])]),v.createElementVNode("div",uL,[v.createVNode(a,{theme:"dark",class:"power-editor-table-control-item",background:"rgba(212, 78, 82, 1)","is-box-shadow":!0,title:o.getTitle("Delete Column"),onClick:e[5]||(e[5]=c=>t.exec("deleteColumn"))},{default:v.withCtx(()=>e[15]||(e[15]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--DockLeft"},null,-1)])),_:1,__:[15]},8,["title"]),v.createVNode(a,{theme:"dark",class:"power-editor-table-control-item",background:"rgba(212, 78, 82, 1)","is-box-shadow":!0,title:o.getTitle("Delete Row"),onClick:e[6]||(e[6]=c=>o.execX("deleteRow"))},{default:v.withCtx(()=>e[16]||(e[16]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--DockBottom"},null,-1)])),_:1,__:[16]},8,["title"]),e[23]||(e[23]=v.createElementVNode("hr",null,null,-1)),v.createVNode(a,{theme:"dark",class:"power-editor-table-control-item",background:t.foreground,"is-box-shadow":!0,title:o.getTitle("Add Row Before"),onClick:e[7]||(e[7]=c=>o.execX("addRowBefore"))},{default:v.withCtx(()=>e[17]||(e[17]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--UpArrowShiftKey"},null,-1)])),_:1,__:[17]},8,["background","title"]),v.createVNode(a,{theme:"dark",class:"power-editor-table-control-item",background:t.foreground,"is-box-shadow":!0,title:o.getTitle("Add Row After"),onClick:e[8]||(e[8]=c=>o.execX("addRowAfter"))},{default:v.withCtx(()=>e[18]||(e[18]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--UpArrowShiftKey",style:{transform:"rotate(180deg)"}},null,-1)])),_:1,__:[18]},8,["background","title"]),v.createVNode(a,{theme:"dark",class:"power-editor-table-control-item",background:t.foreground,"is-box-shadow":!0,title:o.getTitle("Add Column Before"),onClick:e[9]||(e[9]=c=>o.execX("addColumnBefore"))},{default:v.withCtx(()=>e[19]||(e[19]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--UpArrowShiftKey",style:{transform:"rotate(-90deg)"}},null,-1)])),_:1,__:[19]},8,["background","title"]),v.createVNode(a,{theme:"dark",class:"power-editor-table-control-item",background:t.foreground,"is-box-shadow":!0,title:o.getTitle("Add Column After"),onClick:e[10]||(e[10]=c=>o.execX("addColumnAfter"))},{default:v.withCtx(()=>e[20]||(e[20]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--UpArrowShiftKey",style:{transform:"rotate(90deg)"}},null,-1)])),_:1,__:[20]},8,["background","title"]),e[24]||(e[24]=v.createElementVNode("hr",null,null,-1)),v.createVNode(a,{theme:t.theme,class:"power-editor-table-control-item","is-box-shadow":!0,title:o.getTitle("Merge Cells"),onClick:e[11]||(e[11]=c=>o.execX("mergeCells"))},{default:v.withCtx(()=>e[21]||(e[21]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--PPSOneLandscape"},null,-1)])),_:1,__:[21]},8,["theme","title"]),v.createVNode(a,{theme:t.theme,class:"power-editor-table-control-item","is-box-shadow":!0,title:o.getTitle("Split Cell"),onClick:e[12]||(e[12]=c=>o.execX("splitCell"))},{default:v.withCtx(()=>e[22]||(e[22]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--PPSTwoPortrait"},null,-1)])),_:1,__:[22]},8,["theme","title"])])]),_:3},8,["show","mobileMode","title","foreground","theme","language"])}const z2=Gt(lL,[["render",dL]]),hL={components:{linkCallout:EO,embedCallout:NO,colorCallout:F2,emojiCallout:KO,imageCallout:nL,headingCallout:aL,TableCallout:z2},emits:["update:theme","save-click"],props:{editor:{default:()=>({})},showSave:{default:!0},mobileMode:{default:!1},tippyOptions:{default:100},toolbarHeight:{default:70},toolbarBorderRadius:{default:""},foreground:{default:""},language:{default:"en"},theme:{default:"light"}},data(){return{thisTheme:this.theme,timer:{formatPainter:null}}},watch:{theme(n){this.thisTheme=n},thisTheme(n){this.$emit("update:theme",n)}},computed:{highlightColor(){return this.thisTheme==="dark"?{f:"rgba(36, 36, 36, 1)",b:"whitesmoke"}:{f:"whitesmoke",b:"rgba(36, 36, 36, 1)"}},formatPainterStatus(){return!this.editor||!this.editor.storage||!this.editor.storage.formatPainter?"off":this.editor.storage.formatPainter.formatPainterStatus},showFormatPainter(){return this.formatPainterStatus!=="off"}},mounted(){this.thisTheme=this.theme},methods:{getTitle(n){return In(n,this.language)},getForeground(n,e={light:"rgba(65, 74, 90, 1)",dark:"rgba(245, 245, 245, 1)"}){return n?this.highlightColor.f:typeof e=="string"?e:e[this.thisTheme]},getBackground(n){return n?this.highlightColor.b:this.thisTheme==="dark"?"rgba(36, 36, 36, 0)":"rgba(255, 255, 255, 0)"},exec(n){n&&this.editor.chain().focus()[n]().run()},execMore(n,e){this.editor.chain().focus()[n](e).run()},insert(n){this.editor.commands.insertContent(n)},insertEmoji(n){this.editor.chain().focus().insertContent(n).run()},insertImg(n){n.forEach(e=>{this.insert(`<img src="${e}"></img>
|
|
433
436
|
`)})},insertLink(n){this.editor.chain().focus().insertContent(n).run()},insertEmbed(n){this.editor.chain().focus().insertContent(n).run()},insertInlineEquation(n=""){this.editor.chain().focus().insertContent({type:"inlineEquation",attrs:{theme:this.theme,value:n}}).run()},insertEquationBlock(){this.editor.chain().focus().insertContent({type:"equationBlock",attrs:{theme:this.theme}}).run()},insertEquation(){let n=this.editor.view.state,e=this.editor.view.state.selection,t=n.doc.textBetween(e.from,e.to," ");t.length>0?this.insertInlineEquation(t):this.insertEquationBlock()},insertDrawingBlock(){this.editor.chain().focus().insertContent("<drawing-block></drawing-block>").run()},formatPainterClick(){this.editor.storage.formatPainter.formatPainterStatus==="off"?(this.editor.commands.setFormatPainter(),this.editor.commands.detectFormat()):(clearTimeout(this.timer.formatPainter),this.timer.formatPainter=setTimeout(()=>{this.editor.commands.unsetFormatPainter()},300))},formatPainterDoubleClick(){clearTimeout(this.timer.formatPainter),this.editor.commands.stickyFormatPainter(),this.editor.commands.detectFormat()},save(){this.$emit("save-click")}}};function fL(n,e,t,r,i,o){const s=v.resolveComponent("fv-button"),a=v.resolveComponent("heading-callout"),l=v.resolveComponent("color-callout"),c=v.resolveComponent("emoji-callout"),u=v.resolveComponent("table-callout"),d=v.resolveComponent("image-callout"),m=v.resolveComponent("link-callout"),b=v.resolveComponent("embed-callout");return v.openBlock(),v.createElementBlock("div",{class:v.normalizeClass(["power-editor-tool-bar-container",[{dark:i.thisTheme==="dark"}]]),style:v.normalizeStyle({height:`${t.toolbarHeight}px`,"border-radius":`${t.toolbarBorderRadius}px`})},[v.renderSlot(n.$slots,"custom-buttons-front",{defaultClass:"power-editor-cmd-btn"}),v.withDirectives(v.createVNode(s,{class:"power-editor-cmd-btn",theme:i.thisTheme,"border-color":"transparent",background:o.getBackground(!1),foreground:o.getForeground(!1,{light:"rgba(147, 79, 125, 1)",dark:"rgba(169, 58, 132, 1)"}),title:o.getTitle("Save"),onClick:o.save},{default:v.withCtx(()=>e[23]||(e[23]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--Save"},null,-1)])),_:1,__:[23]},8,["theme","background","foreground","title","onClick"]),[[v.vShow,t.showSave]]),v.renderSlot(n.$slots,"custom-buttons-0",{defaultClass:"power-editor-cmd-btn"}),v.createVNode(s,{class:"power-editor-cmd-btn",theme:i.thisTheme,"border-color":"transparent",background:o.getBackground(!1),foreground:o.getForeground(!1,t.foreground),title:o.getTitle("Undo"),onClick:e[0]||(e[0]=f=>o.exec("undo"))},{default:v.withCtx(()=>e[24]||(e[24]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--Undo"},null,-1)])),_:1,__:[24]},8,["theme","background","foreground","title"]),v.createVNode(s,{class:"power-editor-cmd-btn",theme:i.thisTheme,"border-color":"transparent",background:o.getBackground(!1),foreground:o.getForeground(!1,t.foreground),title:o.getTitle("Redo"),onClick:e[1]||(e[1]=f=>o.exec("redo"))},{default:v.withCtx(()=>e[25]||(e[25]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--Redo"},null,-1)])),_:1,__:[25]},8,["theme","background","foreground","title"]),v.createVNode(s,{class:"power-editor-cmd-btn",theme:i.thisTheme,"border-color":"transparent",background:o.getBackground(t.editor.isActive("bold")),foreground:o.getForeground(t.editor.isActive("bold")),title:o.getTitle("Bold"),onClick:e[2]||(e[2]=f=>o.exec("toggleBold"))},{default:v.withCtx(()=>e[26]||(e[26]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--Bold"},null,-1)])),_:1,__:[26]},8,["theme","background","foreground","title"]),v.createVNode(s,{class:"power-editor-cmd-btn",theme:i.thisTheme,"border-color":"transparent",background:o.getBackground(t.editor.isActive("italic")),foreground:o.getForeground(t.editor.isActive("italic")),title:o.getTitle("Italic"),onClick:e[3]||(e[3]=f=>o.exec("toggleItalic"))},{default:v.withCtx(()=>e[27]||(e[27]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--Italic"},null,-1)])),_:1,__:[27]},8,["theme","background","foreground","title"]),v.createVNode(s,{class:"power-editor-cmd-btn",theme:i.thisTheme,"border-color":"transparent",background:o.getBackground(t.editor.isActive("strike")),foreground:o.getForeground(t.editor.isActive("strike")),title:o.getTitle("Strikethrough"),onClick:e[4]||(e[4]=f=>o.exec("toggleStrike"))},{default:v.withCtx(()=>e[28]||(e[28]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--Strikethrough"},null,-1)])),_:1,__:[28]},8,["theme","background","foreground","title"]),v.createVNode(s,{class:"power-editor-cmd-btn",theme:i.thisTheme,"border-color":"transparent",background:o.getBackground(t.editor.isActive("underline")),foreground:o.getForeground(t.editor.isActive("underline")),title:o.getTitle("Underline"),onClick:e[5]||(e[5]=f=>o.exec("toggleUnderline"))},{default:v.withCtx(()=>e[29]||(e[29]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--Underline"},null,-1)])),_:1,__:[29]},8,["theme","background","foreground","title"]),v.createVNode(s,{class:"power-editor-cmd-btn",theme:i.thisTheme,"border-color":"transparent",background:o.getBackground(o.showFormatPainter),foreground:o.getForeground(o.showFormatPainter),title:o.getTitle("Format Painter"),onClick:o.formatPainterClick,onDblclickCapture:o.formatPainterDoubleClick},{default:v.withCtx(()=>e[30]||(e[30]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--Personalize"},null,-1)])),_:1,__:[30]},8,["theme","background","foreground","title","onClick","onDblclickCapture"]),v.renderSlot(n.$slots,"custom-buttons-1",{defaultClass:"power-editor-cmd-btn"}),e[57]||(e[57]=v.createElementVNode("hr",null,null,-1)),v.createVNode(s,{class:"power-editor-cmd-btn",theme:i.thisTheme,"border-color":"transparent",background:o.getBackground(t.editor.isActive("blockquote")),foreground:o.getForeground(t.editor.isActive("blockquote")),title:o.getTitle("Block Quote"),onClick:e[6]||(e[6]=f=>o.exec("toggleBlockquote"))},{default:v.withCtx(()=>e[31]||(e[31]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--LeftDoubleQuote"},null,-1)])),_:1,__:[31]},8,["theme","background","foreground","title"]),v.createVNode(s,{class:"power-editor-cmd-btn",theme:i.thisTheme,"border-color":"transparent",background:o.getBackground(!1),foreground:o.getForeground(!1),title:o.getTitle("Horizontal Rule"),onClick:e[7]||(e[7]=f=>o.exec("setHorizontalRule"))},{default:v.withCtx(()=>e[32]||(e[32]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--ChromeMinimize"},null,-1)])),_:1,__:[32]},8,["theme","background","foreground","title"]),v.createVNode(a,{mobileMode:t.mobileMode,foreground:t.foreground,theme:i.thisTheme,language:t.language,editor:t.editor,getBackground:o.getBackground,getForeground:o.getForeground,execMore:o.execMore},{default:v.withCtx(f=>[v.createVNode(s,{class:"power-editor-cmd-btn",theme:i.thisTheme,"border-color":"transparent",background:o.getBackground(!1),foreground:o.getForeground(!1),title:o.getTitle("Header"),onClick:y=>f.show!==!1?f.show():""},{default:v.withCtx(()=>e[33]||(e[33]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--Header1"},null,-1)])),_:2,__:[33]},1032,["theme","background","foreground","title","onClick"])]),_:1},8,["mobileMode","foreground","theme","language","editor","getBackground","getForeground","execMore"]),v.createVNode(s,{class:"power-editor-cmd-btn",theme:i.thisTheme,"border-color":"transparent",background:o.getBackground(t.editor.isActive("superscript")),foreground:o.getForeground(t.editor.isActive("superscript")),title:o.getTitle("Task"),onClick:e[8]||(e[8]=f=>o.exec("toggleSuperscript"))},{default:v.withCtx(()=>e[34]||(e[34]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--Superscript"},null,-1)])),_:1,__:[34]},8,["theme","background","foreground","title"]),v.createVNode(s,{class:"power-editor-cmd-btn",theme:i.thisTheme,"border-color":"transparent",background:o.getBackground(t.editor.isActive("subscript")),foreground:o.getForeground(t.editor.isActive("subscript")),title:o.getTitle("Task"),onClick:e[9]||(e[9]=f=>o.exec("toggleSubscript"))},{default:v.withCtx(()=>e[35]||(e[35]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--Subscript"},null,-1)])),_:1,__:[35]},8,["theme","background","foreground","title"]),v.createVNode(s,{class:"power-editor-cmd-btn",theme:i.thisTheme,"border-color":"transparent",background:o.getBackground(t.editor.isActive("powerTaskList")),foreground:o.getForeground(t.editor.isActive("powerTaskList")),title:o.getTitle("Task"),onClick:e[10]||(e[10]=f=>o.exec("togglePowerTaskList"))},{default:v.withCtx(()=>e[36]||(e[36]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--TaskLogo"},null,-1)])),_:1,__:[36]},8,["theme","background","foreground","title"]),v.createVNode(s,{class:"power-editor-cmd-btn",theme:i.thisTheme,"border-color":"transparent",background:o.getBackground(!1),foreground:o.getForeground(!1),title:o.getTitle("ClearFormatting"),onClick:e[11]||(e[11]=()=>{o.exec("clearNodes"),o.exec("unsetAllMarks")})},{default:v.withCtx(()=>e[37]||(e[37]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--ClearFormatting"},null,-1)])),_:1,__:[37]},8,["theme","background","foreground","title"]),v.renderSlot(n.$slots,"custom-buttons-2",{defaultClass:"power-editor-cmd-btn"}),e[58]||(e[58]=v.createElementVNode("hr",null,null,-1)),v.createVNode(s,{class:"power-editor-cmd-btn",theme:i.thisTheme,"border-color":"transparent",background:o.getBackground(t.editor.isActive("bulletList")),foreground:o.getForeground(t.editor.isActive("bulletList")),title:o.getTitle("BulletedList"),onClick:e[12]||(e[12]=f=>o.exec("toggleBulletList"))},{default:v.withCtx(()=>e[38]||(e[38]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--BulletedList"},null,-1)])),_:1,__:[38]},8,["theme","background","foreground","title"]),v.createVNode(s,{class:"power-editor-cmd-btn",theme:i.thisTheme,"border-color":"transparent",background:o.getBackground(t.editor.isActive("orderedList")),foreground:o.getForeground(t.editor.isActive("orderedList")),title:o.getTitle("NumberedList"),onClick:e[13]||(e[13]=f=>o.exec("toggleOrderedList"))},{default:v.withCtx(()=>e[39]||(e[39]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--NumberedList"},null,-1)])),_:1,__:[39]},8,["theme","background","foreground","title"]),v.createCommentVNode("",!0),v.renderSlot(n.$slots,"custom-buttons-3",{defaultClass:"power-editor-cmd-btn"}),e[59]||(e[59]=v.createElementVNode("hr",null,null,-1)),v.createVNode(s,{class:"power-editor-cmd-btn",theme:i.thisTheme,"border-color":"transparent",background:o.getBackground(t.editor.isActive({textAlign:"left"})),foreground:o.getForeground(t.editor.isActive({textAlign:"left"})),title:o.getTitle("AlignLeft"),onClick:e[15]||(e[15]=f=>o.execMore("setTextAlign","left"))},{default:v.withCtx(()=>e[41]||(e[41]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--AlignLeft"},null,-1)])),_:1,__:[41]},8,["theme","background","foreground","title"]),v.createVNode(s,{class:"power-editor-cmd-btn",theme:i.thisTheme,"border-color":"transparent",background:o.getBackground(t.editor.isActive({textAlign:"center"})),foreground:o.getForeground(t.editor.isActive({textAlign:"center"})),title:o.getTitle("AlignCenter"),onClick:e[16]||(e[16]=f=>o.execMore("setTextAlign","center"))},{default:v.withCtx(()=>e[42]||(e[42]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--AlignCenter"},null,-1)])),_:1,__:[42]},8,["theme","background","foreground","title"]),v.createVNode(s,{class:"power-editor-cmd-btn",theme:i.thisTheme,"border-color":"transparent",background:o.getBackground(t.editor.isActive({textAlign:"right"})),foreground:o.getForeground(t.editor.isActive({textAlign:"right"})),title:o.getTitle("AlignRight"),onClick:e[17]||(e[17]=f=>o.execMore("setTextAlign","right"))},{default:v.withCtx(()=>e[43]||(e[43]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--AlignRight"},null,-1)])),_:1,__:[43]},8,["theme","background","foreground","title"]),v.createVNode(s,{class:"power-editor-cmd-btn",theme:i.thisTheme,"border-color":"transparent",background:o.getBackground(t.editor.isActive({textAlign:"justify"})),foreground:o.getForeground(t.editor.isActive({textAlign:"justify"})),title:o.getTitle("AlignJustify"),onClick:e[18]||(e[18]=f=>o.execMore("setTextAlign","justify"))},{default:v.withCtx(()=>e[44]||(e[44]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--AlignJustify"},null,-1)])),_:1,__:[44]},8,["theme","background","foreground","title"]),v.createCommentVNode("",!0),v.createCommentVNode("",!0),v.createCommentVNode("",!0),v.renderSlot(n.$slots,"custom-buttons-4",{defaultClass:"power-editor-cmd-btn"}),e[60]||(e[60]=v.createElementVNode("hr",null,null,-1)),v.createVNode(l,{mobileMode:t.mobileMode,foreground:t.foreground,theme:i.thisTheme,language:t.language,editor:t.editor,getBackground:o.getBackground,getForeground:o.getForeground,exec:o.exec,execMore:o.execMore},{default:v.withCtx(f=>[v.createVNode(s,{class:"power-editor-cmd-btn",theme:i.thisTheme,"border-color":"transparent",background:o.getBackground(!1),foreground:o.getForeground(!1,"rgba(239, 107, 87, 1)"),title:o.getTitle("Color"),onClick:y=>f.show!==!1?f.show():""},{default:v.withCtx(()=>e[47]||(e[47]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--FontColor"},null,-1)])),_:2,__:[47]},1032,["theme","background","foreground","title","onClick"])]),_:1},8,["mobileMode","foreground","theme","language","editor","getBackground","getForeground","exec","execMore"]),v.createVNode(s,{class:"power-editor-cmd-btn",theme:i.thisTheme,"border-color":"transparent",background:o.getBackground(!1),foreground:o.getForeground(!1,"rgba(222, 81, 140, 1)"),title:o.getTitle("Draw"),onClick:o.insertDrawingBlock},{default:v.withCtx(()=>e[48]||(e[48]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--StrokeErase2"},null,-1)])),_:1,__:[48]},8,["theme","background","foreground","title","onClick"]),v.createVNode(c,{mobileMode:t.mobileMode,foreground:t.foreground,theme:i.thisTheme,language:t.language,editor:t.editor,onInsertEmoji:o.insertEmoji},{default:v.withCtx(f=>[v.createVNode(s,{class:"power-editor-cmd-btn",theme:i.thisTheme,"border-color":"transparent",background:o.getBackground(!1),foreground:o.getForeground(!1,"rgba(255, 180, 0, 1)"),title:o.getTitle("Emoji"),onClick:y=>f.show!==!1?f.show():""},{default:v.withCtx(()=>e[49]||(e[49]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--Emoji2"},null,-1)])),_:2,__:[49]},1032,["theme","background","foreground","title","onClick"])]),_:1},8,["mobileMode","foreground","theme","language","editor","onInsertEmoji"]),v.createVNode(u,{mobileMode:t.mobileMode,foreground:t.foreground,theme:i.thisTheme,language:t.language,editor:t.editor,exec:o.exec,execMore:o.execMore},{default:v.withCtx(f=>[v.createVNode(s,{class:"power-editor-cmd-btn",theme:i.thisTheme,"border-color":"transparent",background:o.getBackground(!1),foreground:o.getForeground(!1,"rgba(56, 171, 127, 1)"),title:o.getTitle("Table"),onClick:y=>f.show!==!1?f.show():""},{default:v.withCtx(()=>e[50]||(e[50]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--TiltDown"},null,-1)])),_:2,__:[50]},1032,["theme","background","foreground","title","onClick"])]),_:1},8,["mobileMode","foreground","theme","language","editor","exec","execMore"]),v.createVNode(s,{class:"power-editor-cmd-btn",theme:i.thisTheme,"border-color":"transparent",background:o.getBackground(t.editor.isActive("code")),foreground:o.getForeground(t.editor.isActive("code")),title:o.getTitle("Code"),onClick:e[21]||(e[21]=f=>o.exec("toggleCode"))},{default:v.withCtx(()=>e[51]||(e[51]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--CSharp"},null,-1)])),_:1,__:[51]},8,["theme","background","foreground","title"]),v.createVNode(s,{class:"power-editor-cmd-btn",theme:i.thisTheme,"border-color":"transparent",background:o.getBackground(t.editor.isActive("equationBlock")),foreground:o.getForeground(t.editor.isActive("equationBlock")),title:o.getTitle("Equation"),onClick:o.insertEquation},{default:v.withCtx(()=>e[52]||(e[52]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--Variable"},null,-1)])),_:1,__:[52]},8,["theme","background","foreground","title","onClick"]),v.createVNode(s,{class:"power-editor-cmd-btn",theme:i.thisTheme,"border-color":"transparent",background:o.getBackground(t.editor.isActive("codeBlock")),foreground:o.getForeground(t.editor.isActive("codeBlock")),title:o.getTitle("Code Block"),onClick:e[22]||(e[22]=f=>o.exec("toggleCodeBlock"))},{default:v.withCtx(()=>e[53]||(e[53]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--Code"},null,-1)])),_:1,__:[53]},8,["theme","background","foreground","title"]),v.createVNode(d,{mobileMode:t.mobileMode,foreground:t.foreground,theme:i.thisTheme,language:t.language,onInsertImage:o.insertImg},{default:v.withCtx(f=>[v.createVNode(s,{class:"power-editor-cmd-btn",theme:i.thisTheme,"border-color":"transparent",background:o.getBackground(!1),foreground:o.getForeground(!1),title:o.getTitle("Image"),onClick:y=>f.show!==!1?f.show():""},{default:v.withCtx(()=>e[54]||(e[54]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--Photo2"},null,-1)])),_:2,__:[54]},1032,["theme","background","foreground","title","onClick"])]),_:1},8,["mobileMode","foreground","theme","language","onInsertImage"]),v.createVNode(m,{mobileMode:t.mobileMode,foreground:t.foreground,theme:i.thisTheme,language:t.language,onInsertLink:o.insertLink},{default:v.withCtx(f=>[v.createVNode(s,{class:"power-editor-cmd-btn",theme:i.thisTheme,"border-color":"transparent",background:o.getBackground(!1),foreground:o.getForeground(!1),title:o.getTitle("Link"),onClick:y=>f.show!==!1?f.show():""},{default:v.withCtx(()=>e[55]||(e[55]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--Link"},null,-1)])),_:2,__:[55]},1032,["theme","background","foreground","title","onClick"])]),_:1},8,["mobileMode","foreground","theme","language","onInsertLink"]),v.createVNode(b,{mobileMode:t.mobileMode,foreground:t.foreground,theme:i.thisTheme,language:t.language,onInsertEmbed:o.insertEmbed},{default:v.withCtx(f=>[v.createVNode(s,{class:"power-editor-cmd-btn",theme:i.thisTheme,"border-color":"transparent",background:o.getBackground(!1),foreground:o.getForeground(!1),title:o.getTitle("Embed"),onClick:y=>f.show!==!1?f.show():""},{default:v.withCtx(()=>e[56]||(e[56]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--FileHTML"},null,-1)])),_:2,__:[56]},1032,["theme","background","foreground","title","onClick"])]),_:1},8,["mobileMode","foreground","theme","language","onInsertEmbed"]),v.renderSlot(n.$slots,"custom-buttons",{defaultClass:"power-editor-cmd-btn"})],6)}const q2=Gt(hL,[["render",fL]]),pL={components:{colorCallout:F2,TableCallout:z2},emits:["update:theme","save-click"],props:{editor:{default:()=>({})},showSave:{default:!0},mobileMode:{default:!1},foreground:{default:""},language:{default:"en"},theme:{default:"light"}},data(){return{thisTheme:this.theme,timer:{formatPainter:null}}},watch:{theme(n){this.thisTheme=n},thisTheme(n){this.$emit("update:theme",n)}},computed:{highlightColor(){return this.thisTheme==="dark"?{f:"rgba(36, 36, 36, 1)",b:"whitesmoke"}:{f:"whitesmoke",b:"rgba(36, 36, 36, 1)"}},formatPainterStatus(){return!this.editor||!this.editor.storage||!this.editor.storage.formatPainter?"off":this.editor.storage.formatPainter.formatPainterStatus},showFormatPainter(){return this.formatPainterStatus!=="off"}},mounted(){this.thisTheme=this.theme},methods:{getTitle(n){return In(n,this.language)},getForeground(n,e={light:"rgba(65, 74, 90, 1)",dark:"rgba(245, 245, 245, 1)"}){return n?this.highlightColor.f:typeof e=="string"?e:e[this.thisTheme]},getBackground(n){return n?this.highlightColor.b:this.thisTheme==="dark"?"rgba(50, 50, 50, 1)":"rgba(239, 239, 239, 1)"},exec(n){n&&this.editor.chain().focus()[n]().run()},execMore(n,e){this.editor.chain().focus()[n](e).run()},insert(n){this.editor.commands.insertContent(n)},insertEmoji(n){this.editor.chain().focus().insertContent(n).run()},insertImg(n){n.forEach(e=>{this.insert(`<img src="${e}"></img>
|
|
434
|
-
`)})},insertLink(n){this.editor.chain().focus().insertContent(n).run()},insertEmbed(n){this.editor.chain().focus().insertContent(n).run()},insertInlineEquation(n=""){this.editor.chain().focus().insertContent({type:"inlineEquation",attrs:{theme:this.theme,value:n}}).run()},insertEquationBlock(){this.editor.chain().focus().insertContent({type:"equationBlock",attrs:{theme:this.theme}}).run()},insertEquation(){let n=this.editor.view.state,e=this.editor.view.state.selection,t=n.doc.textBetween(e.from,e.to," ");t.length>0?this.insertInlineEquation(t):this.insertEquationBlock()},insertDrawingBlock(){this.editor.chain().focus().insertContent("<drawing-block></drawing-block>").run()},formatPainterClick(){this.editor.storage.formatPainter.formatPainterStatus==="off"?(this.editor.commands.setFormatPainter(),this.editor.commands.detectFormat()):(clearTimeout(this.timer.formatPainter),this.timer.formatPainter=setTimeout(()=>{this.editor.commands.unsetFormatPainter()},300))},formatPainterDoubleClick(){clearTimeout(this.timer.formatPainter),this.editor.commands.stickyFormatPainter(),this.editor.commands.detectFormat()},save(){this.$emit("save-click")}}};function mL(n,e,t,r,i,o){const s=v.resolveComponent("fv-button"),a=v.resolveComponent("color-callout"),l=v.resolveComponent("table-callout");return v.openBlock(),v.createElementBlock("div",{class:v.normalizeClass(["power-editor-bubble-tool-bar-container",[{dark:i.thisTheme==="dark"}]])},[v.createVNode(s,{class:"power-editor-bubble-cmd-btn",theme:i.thisTheme,background:o.getBackground(t.editor.isActive("bold")),foreground:o.getForeground(t.editor.isActive("bold")),"border-color":"transparent",title:o.getTitle("Bold"),onClick:e[0]||(e[0]=c=>o.exec("toggleBold"))},{default:v.withCtx(()=>e[7]||(e[7]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--Bold"},null,-1)])),_:1,__:[7]},8,["theme","background","foreground","title"]),v.createVNode(s,{class:"power-editor-bubble-cmd-btn",theme:i.thisTheme,background:o.getBackground(t.editor.isActive("italic")),foreground:o.getForeground(t.editor.isActive("italic")),"border-color":"transparent",title:o.getTitle("Italic"),onClick:e[1]||(e[1]=c=>o.exec("toggleItalic"))},{default:v.withCtx(()=>e[8]||(e[8]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--Italic"},null,-1)])),_:1,__:[8]},8,["theme","background","foreground","title"]),v.createVNode(s,{class:"power-editor-bubble-cmd-btn",theme:i.thisTheme,background:o.getBackground(t.editor.isActive("strike")),foreground:o.getForeground(t.editor.isActive("strike")),"border-color":"transparent",title:o.getTitle("Strikethrough"),onClick:e[2]||(e[2]=c=>o.exec("toggleStrike"))},{default:v.withCtx(()=>e[9]||(e[9]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--Strikethrough"},null,-1)])),_:1,__:[9]},8,["theme","background","foreground","title"]),v.createVNode(s,{class:"power-editor-bubble-cmd-btn",theme:i.thisTheme,background:o.getBackground(t.editor.isActive("underline")),foreground:o.getForeground(t.editor.isActive("underline")),"border-color":"transparent",title:o.getTitle("Underline"),onClick:e[3]||(e[3]=c=>o.exec("toggleUnderline"))},{default:v.withCtx(()=>e[10]||(e[10]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--Underline"},null,-1)])),_:1,__:[10]},8,["theme","background","foreground","title"]),e[18]||(e[18]=v.createElementVNode("hr",null,null,-1)),v.createVNode(s,{class:"power-editor-bubble-cmd-btn",theme:i.thisTheme,background:o.getBackground(o.showFormatPainter),foreground:o.getForeground(o.showFormatPainter),"border-color":"transparent",title:o.getTitle("Format Painter"),onClick:o.formatPainterClick,onDblclickCapture:o.formatPainterDoubleClick},{default:v.withCtx(()=>e[11]||(e[11]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--Personalize"},null,-1)])),_:1,__:[11]},8,["theme","background","foreground","title","onClick","onDblclickCapture"]),v.createVNode(s,{class:"power-editor-bubble-cmd-btn",theme:i.thisTheme,background:o.getBackground(!1),foreground:o.getForeground(!1),"border-color":"transparent",title:o.getTitle("ClearFormatting"),onClick:e[4]||(e[4]=()=>{o.exec("clearNodes"),o.exec("unsetAllMarks")})},{default:v.withCtx(()=>e[12]||(e[12]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--ClearFormatting"},null,-1)])),_:1,__:[12]},8,["theme","background","foreground","title"]),v.createVNode(a,{mobileMode:t.mobileMode,foreground:t.foreground,theme:i.thisTheme,language:t.language,editor:t.editor,getBackground:o.getBackground,getForeground:o.getForeground,exec:o.exec,execMore:o.execMore},{default:v.withCtx(c=>[v.createVNode(s,{class:"power-editor-bubble-cmd-btn",theme:i.thisTheme,background:o.getBackground(!1),foreground:o.getForeground(!1,"rgba(239, 107, 87, 1)"),"border-color":"transparent",title:o.getTitle("Color"),onClick:u=>c.show!==!1?c.show():""},{default:v.withCtx(()=>e[13]||(e[13]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--FontColor"},null,-1)])),_:2,__:[13]},1032,["theme","background","foreground","title","onClick"])]),_:1},8,["mobileMode","foreground","theme","language","editor","getBackground","getForeground","exec","execMore"]),v.createVNode(l,{mobileMode:t.mobileMode,foreground:t.foreground,theme:i.thisTheme,language:t.language,editor:t.editor,exec:o.exec,execMore:o.execMore},{default:v.withCtx(c=>[v.createVNode(s,{class:"power-editor-bubble-cmd-btn",theme:i.thisTheme,background:o.getBackground(!1),foreground:o.getForeground(!1,"rgba(56, 171, 127, 1)"),"border-color":"transparent",title:o.getTitle("Table"),onClick:u=>c.show!==!1?c.show():""},{default:v.withCtx(()=>e[14]||(e[14]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--TiltDown"},null,-1)])),_:2,__:[14]},1032,["theme","background","foreground","title","onClick"])]),_:1},8,["mobileMode","foreground","theme","language","editor","exec","execMore"]),v.createVNode(s,{class:"power-editor-bubble-cmd-btn",theme:i.thisTheme,background:o.getBackground(t.editor.isActive("code")),foreground:o.getForeground(t.editor.isActive("code")),"border-color":"transparent",title:o.getTitle("Code"),onClick:e[5]||(e[5]=c=>o.exec("toggleCode"))},{default:v.withCtx(()=>e[15]||(e[15]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--CSharp"},null,-1)])),_:1,__:[15]},8,["theme","background","foreground","title"]),v.createVNode(s,{class:"power-editor-bubble-cmd-btn",theme:i.thisTheme,background:o.getBackground(t.editor.isActive("equationBlock")),foreground:o.getForeground(t.editor.isActive("equationBlock")),"border-color":"transparent",title:o.getTitle("Equation"),onClick:o.insertEquation},{default:v.withCtx(()=>e[16]||(e[16]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--Variable"},null,-1)])),_:1,__:[16]},8,["theme","background","foreground","title","onClick"]),v.createVNode(s,{class:"power-editor-bubble-cmd-btn",theme:i.thisTheme,background:o.getBackground(t.editor.isActive("codeBlock")),foreground:o.getForeground(t.editor.isActive("codeBlock")),"border-color":"transparent",title:o.getTitle("Code Block"),onClick:e[6]||(e[6]=c=>o.exec("toggleCodeBlock"))},{default:v.withCtx(()=>e[17]||(e[17]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--Code"},null,-1)])),_:1,__:[17]},8,["theme","background","foreground","title"])],2)}const H2=Gt(pL,[["render",mL]]),gL=Object.assign({name:"PowerEditor",components:{EditorContent:I1,TiptapBubbleMenu:Ob,toolBar:q2,bubbleToolBar:H2},data(){return{editor:null,mobileMode:!1,timer:{widthTimer:{}}}},watch:{modelValue(n){this.editor.commands.setContent(n),this.propsSync(),this.$emit("content-change",n)},editable(){this.editor.setEditable(this.editable)},language(){this.propsSync()},theme(){this.propsSync()}},computed:{formatPainterStatus(){return!this.editor||!this.editor.storage||!this.editor.storage.formatPainter?"off":this.editor.storage.formatPainter.formatPainterStatus},showFormatPainter(){return this.formatPainterStatus!=="off"}},mounted(){this.init(),this.eventInit(),this.propsSync(),this.widthTimerInit(),this.$emit("on-mounted",this.editor)},methods:{init(){let n=this;const e=[k_.configure({dropcursor:{color:this.foreground,width:3,class:"power-editor-drop-cursor-custom"},codeBlock:!1,...this.starterKit}),vC,JC.configure({types:["heading","paragraph"]}),C_,cE.configure({multicolor:!0}),E_,X7,dE,fE,RE.configure({lowlight:Re,HTMLAttributes:{class:"tiptap-code"},languageClassPrefix:"language-"}),SM,MM,RM,FM,fN,gN,TN,pO,j0.configure({HTMLAttributes:{},resizable:!0}),F_,q_,z_,this.defaultStorageInit(),mO,...this.extensions];this.disabledPlaceholder==!1&&e.push(pE.configure({emptyEditorClass:"is-editor-empty",placeholder:()=>this.placeholder})),this.editor=new m8({editable:this.editable,content:this.modelValue,extensions:e,editorProps:{},onUpdate(){n.$emit("change")}})},eventInit(){this.$refs.container.addEventListener("scroll",n=>{this.$refs.container&&this.$emit("container-scroll",{el:this.$refs.container,oriEvent:n})}),this.$refs.container.addEventListener("mouseup",()=>{let n=this.editor.storage.formatPainter.formatPainterStatus;n!=="off"&&(this.editor.commands.pasteFormat(),n==="once"&&(this.editor.storage.formatPainter.formatPainterStatus="off"))})},bubbleMenuShouldShow({editor:n,view:e,state:t,from:r,to:i}){const o=r!==i,s=!!t.doc.textBetween(r,i," ").trim().length;return!e.hasFocus()||!o||!s?!1:!(n.isActive("imageblock")||n.isActive("equationBlock")||n.isActive("embedblock")||n.isActive("drawingBlock"))},defaultStorageInit(){return Je.create({name:"defaultStorage",addStorage(){return{showControlOnReadonly:!1,language:"en",theme:"light"}}})},propsSync(){this.editor.storage.defaultStorage.codeBlockLanguagesBox=this.codeBlockLanguagesBox,this.editor.storage.defaultStorage.codeBlockLineNumbers=this.codeBlockLineNumbers,this.editor.storage.defaultStorage.showControlOnReadonly=this.showControlOnReadonly,this.editor.storage.defaultStorage.imgLazyLoad=this.imgLazyLoad,this.editor.storage.defaultStorage.imgPreview=this.imgPreview,this.editor.storage.defaultStorage.foreground=this.foreground,this.editor.storage.defaultStorage.language=this.language,this.editor.storage.defaultStorage.theme=this.theme,this.editor.storage.defaultStorage.getTitle=e=>In(e,this.language),this.editor.storage.defaultStorage.editorContainer=this.$refs.container,this.editor.storage.defaultStorage.imgInterceptor=this.imgInterceptor;let n={mentionList:()=>[],filterFunc:()=>!0,chooseItemCallback:()=>{console.log("chooseItemCallback")},mentionClickCallback:()=>{console.log("mentionClickCallback")},headerForeground:()=>this.foreground};this.editor.storage.defaultStorage.mentionItemTools=Object.assign(n,this.mentionItemAttr)},insert(n){this.editor.commands.insertContent(n)},insertImg(n){n.forEach(e=>{this.insert(`<img src="${e}" theme="${this.theme}"></img>
|
|
437
|
+
`)})},insertLink(n){this.editor.chain().focus().insertContent(n).run()},insertEmbed(n){this.editor.chain().focus().insertContent(n).run()},insertInlineEquation(n=""){this.editor.chain().focus().insertContent({type:"inlineEquation",attrs:{theme:this.theme,value:n}}).run()},insertEquationBlock(){this.editor.chain().focus().insertContent({type:"equationBlock",attrs:{theme:this.theme}}).run()},insertEquation(){let n=this.editor.view.state,e=this.editor.view.state.selection,t=n.doc.textBetween(e.from,e.to," ");t.length>0?this.insertInlineEquation(t):this.insertEquationBlock()},insertDrawingBlock(){this.editor.chain().focus().insertContent("<drawing-block></drawing-block>").run()},formatPainterClick(){this.editor.storage.formatPainter.formatPainterStatus==="off"?(this.editor.commands.setFormatPainter(),this.editor.commands.detectFormat()):(clearTimeout(this.timer.formatPainter),this.timer.formatPainter=setTimeout(()=>{this.editor.commands.unsetFormatPainter()},300))},formatPainterDoubleClick(){clearTimeout(this.timer.formatPainter),this.editor.commands.stickyFormatPainter(),this.editor.commands.detectFormat()},save(){this.$emit("save-click")}}};function mL(n,e,t,r,i,o){const s=v.resolveComponent("fv-button"),a=v.resolveComponent("color-callout"),l=v.resolveComponent("table-callout");return v.openBlock(),v.createElementBlock("div",{class:v.normalizeClass(["power-editor-bubble-tool-bar-container",[{dark:i.thisTheme==="dark"}]])},[v.createVNode(s,{class:"power-editor-bubble-cmd-btn",theme:i.thisTheme,background:o.getBackground(t.editor.isActive("bold")),foreground:o.getForeground(t.editor.isActive("bold")),"border-color":"transparent",title:o.getTitle("Bold"),onClick:e[0]||(e[0]=c=>o.exec("toggleBold"))},{default:v.withCtx(()=>e[7]||(e[7]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--Bold"},null,-1)])),_:1,__:[7]},8,["theme","background","foreground","title"]),v.createVNode(s,{class:"power-editor-bubble-cmd-btn",theme:i.thisTheme,background:o.getBackground(t.editor.isActive("italic")),foreground:o.getForeground(t.editor.isActive("italic")),"border-color":"transparent",title:o.getTitle("Italic"),onClick:e[1]||(e[1]=c=>o.exec("toggleItalic"))},{default:v.withCtx(()=>e[8]||(e[8]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--Italic"},null,-1)])),_:1,__:[8]},8,["theme","background","foreground","title"]),v.createVNode(s,{class:"power-editor-bubble-cmd-btn",theme:i.thisTheme,background:o.getBackground(t.editor.isActive("strike")),foreground:o.getForeground(t.editor.isActive("strike")),"border-color":"transparent",title:o.getTitle("Strikethrough"),onClick:e[2]||(e[2]=c=>o.exec("toggleStrike"))},{default:v.withCtx(()=>e[9]||(e[9]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--Strikethrough"},null,-1)])),_:1,__:[9]},8,["theme","background","foreground","title"]),v.createVNode(s,{class:"power-editor-bubble-cmd-btn",theme:i.thisTheme,background:o.getBackground(t.editor.isActive("underline")),foreground:o.getForeground(t.editor.isActive("underline")),"border-color":"transparent",title:o.getTitle("Underline"),onClick:e[3]||(e[3]=c=>o.exec("toggleUnderline"))},{default:v.withCtx(()=>e[10]||(e[10]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--Underline"},null,-1)])),_:1,__:[10]},8,["theme","background","foreground","title"]),e[18]||(e[18]=v.createElementVNode("hr",null,null,-1)),v.createVNode(s,{class:"power-editor-bubble-cmd-btn",theme:i.thisTheme,background:o.getBackground(o.showFormatPainter),foreground:o.getForeground(o.showFormatPainter),"border-color":"transparent",title:o.getTitle("Format Painter"),onClick:o.formatPainterClick,onDblclickCapture:o.formatPainterDoubleClick},{default:v.withCtx(()=>e[11]||(e[11]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--Personalize"},null,-1)])),_:1,__:[11]},8,["theme","background","foreground","title","onClick","onDblclickCapture"]),v.createVNode(s,{class:"power-editor-bubble-cmd-btn",theme:i.thisTheme,background:o.getBackground(!1),foreground:o.getForeground(!1),"border-color":"transparent",title:o.getTitle("ClearFormatting"),onClick:e[4]||(e[4]=()=>{o.exec("clearNodes"),o.exec("unsetAllMarks")})},{default:v.withCtx(()=>e[12]||(e[12]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--ClearFormatting"},null,-1)])),_:1,__:[12]},8,["theme","background","foreground","title"]),v.createVNode(a,{mobileMode:t.mobileMode,foreground:t.foreground,theme:i.thisTheme,language:t.language,editor:t.editor,getBackground:o.getBackground,getForeground:o.getForeground,exec:o.exec,execMore:o.execMore},{default:v.withCtx(c=>[v.createVNode(s,{class:"power-editor-bubble-cmd-btn",theme:i.thisTheme,background:o.getBackground(!1),foreground:o.getForeground(!1,"rgba(239, 107, 87, 1)"),"border-color":"transparent",title:o.getTitle("Color"),onClick:u=>c.show!==!1?c.show():""},{default:v.withCtx(()=>e[13]||(e[13]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--FontColor"},null,-1)])),_:2,__:[13]},1032,["theme","background","foreground","title","onClick"])]),_:1},8,["mobileMode","foreground","theme","language","editor","getBackground","getForeground","exec","execMore"]),v.createVNode(l,{mobileMode:t.mobileMode,foreground:t.foreground,theme:i.thisTheme,language:t.language,editor:t.editor,exec:o.exec,execMore:o.execMore},{default:v.withCtx(c=>[v.createVNode(s,{class:"power-editor-bubble-cmd-btn",theme:i.thisTheme,background:o.getBackground(!1),foreground:o.getForeground(!1,"rgba(56, 171, 127, 1)"),"border-color":"transparent",title:o.getTitle("Table"),onClick:u=>c.show!==!1?c.show():""},{default:v.withCtx(()=>e[14]||(e[14]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--TiltDown"},null,-1)])),_:2,__:[14]},1032,["theme","background","foreground","title","onClick"])]),_:1},8,["mobileMode","foreground","theme","language","editor","exec","execMore"]),v.createVNode(s,{class:"power-editor-bubble-cmd-btn",theme:i.thisTheme,background:o.getBackground(t.editor.isActive("code")),foreground:o.getForeground(t.editor.isActive("code")),"border-color":"transparent",title:o.getTitle("Code"),onClick:e[5]||(e[5]=c=>o.exec("toggleCode"))},{default:v.withCtx(()=>e[15]||(e[15]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--CSharp"},null,-1)])),_:1,__:[15]},8,["theme","background","foreground","title"]),v.createVNode(s,{class:"power-editor-bubble-cmd-btn",theme:i.thisTheme,background:o.getBackground(t.editor.isActive("equationBlock")),foreground:o.getForeground(t.editor.isActive("equationBlock")),"border-color":"transparent",title:o.getTitle("Equation"),onClick:o.insertEquation},{default:v.withCtx(()=>e[16]||(e[16]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--Variable"},null,-1)])),_:1,__:[16]},8,["theme","background","foreground","title","onClick"]),v.createVNode(s,{class:"power-editor-bubble-cmd-btn",theme:i.thisTheme,background:o.getBackground(t.editor.isActive("codeBlock")),foreground:o.getForeground(t.editor.isActive("codeBlock")),"border-color":"transparent",title:o.getTitle("Code Block"),onClick:e[6]||(e[6]=c=>o.exec("toggleCodeBlock"))},{default:v.withCtx(()=>e[17]||(e[17]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--Code"},null,-1)])),_:1,__:[17]},8,["theme","background","foreground","title"])],2)}const H2=Gt(pL,[["render",mL]]),gL=Object.assign({name:"PowerEditor",components:{EditorContent:I1,TiptapBubbleMenu:Ob,toolBar:q2,bubbleToolBar:H2},data(){return{editor:null,mobileMode:!1,timer:{widthTimer:{}}}},watch:{modelValue(n){this.editor.commands.setContent(n),this.propsSync(),this.$emit("content-change",n)},editable(){this.editor.setEditable(this.editable)},language(){this.propsSync()},theme(){var n;this.propsSync(),(n=this.editor)!=null&&n.view&&this.editor.view.dispatch(this.editor.state.tr.setMeta("theme-change",this.theme))}},computed:{formatPainterStatus(){return!this.editor||!this.editor.storage||!this.editor.storage.formatPainter?"off":this.editor.storage.formatPainter.formatPainterStatus},showFormatPainter(){return this.formatPainterStatus!=="off"}},mounted(){this.init(),this.eventInit(),this.propsSync(),this.widthTimerInit(),this.$emit("on-mounted",this.editor)},methods:{init(){let n=this;const e=[k_.configure({dropcursor:{color:this.foreground,width:3,class:"power-editor-drop-cursor-custom"},codeBlock:!1,...this.starterKit}),vC,JC.configure({types:["heading","paragraph"]}),C_,cE.configure({multicolor:!0}),E_,X7,dE,fE,RE.configure({lowlight:Re,HTMLAttributes:{class:"tiptap-code"},languageClassPrefix:"language-"}),SM,MM,RM,FM,fN,gN,TN,pO,j0.configure({HTMLAttributes:{},resizable:!0}),F_,q_,z_,this.defaultStorageInit(),mO,...this.extensions];this.disabledPlaceholder==!1&&e.push(pE.configure({emptyEditorClass:"is-editor-empty",placeholder:()=>this.placeholder})),this.editor=new m8({editable:this.editable,content:this.modelValue,extensions:e,editorProps:{},onUpdate(){n.$emit("change")}})},eventInit(){this.$refs.container.addEventListener("scroll",n=>{this.$refs.container&&this.$emit("container-scroll",{el:this.$refs.container,oriEvent:n})}),this.$refs.container.addEventListener("mouseup",()=>{let n=this.editor.storage.formatPainter.formatPainterStatus;n!=="off"&&(this.editor.commands.pasteFormat(),n==="once"&&(this.editor.storage.formatPainter.formatPainterStatus="off"))})},bubbleMenuShouldShow({editor:n,view:e,state:t,from:r,to:i}){const o=r!==i,s=!!t.doc.textBetween(r,i," ").trim().length;return!e.hasFocus()||!o||!s?!1:!(n.isActive("imageblock")||n.isActive("equationBlock")||n.isActive("embedblock")||n.isActive("drawingBlock"))},defaultStorageInit(){return Je.create({name:"defaultStorage",addStorage(){return{showControlOnReadonly:!1,language:"en",theme:"light"}}})},propsSync(){this.editor.storage.defaultStorage.codeBlockLanguagesBox=this.codeBlockLanguagesBox,this.editor.storage.defaultStorage.codeBlockLineNumbers=this.codeBlockLineNumbers,this.editor.storage.defaultStorage.showControlOnReadonly=this.showControlOnReadonly,this.editor.storage.defaultStorage.imgLazyLoad=this.imgLazyLoad,this.editor.storage.defaultStorage.imgPreview=this.imgPreview,this.editor.storage.defaultStorage.foreground=this.foreground,this.editor.storage.defaultStorage.language=this.language,this.editor.storage.defaultStorage.theme=this.theme,this.editor.storage.defaultStorage.getTitle=e=>In(e,this.language),this.editor.storage.defaultStorage.editorContainer=this.$refs.container,this.editor.storage.defaultStorage.imgInterceptor=this.imgInterceptor;let n={mentionList:()=>[],filterFunc:()=>!0,chooseItemCallback:()=>{console.log("chooseItemCallback")},mentionClickCallback:()=>{console.log("mentionClickCallback")},headerForeground:()=>this.foreground};this.editor.storage.defaultStorage.mentionItemTools=Object.assign(n,this.mentionItemAttr)},insert(n){this.editor.commands.insertContent(n)},insertImg(n){n.forEach(e=>{this.insert(`<img src="${e}" theme="${this.theme}"></img>
|
|
435
438
|
`)})},widthTimerInit(){this.timer.widthTimer=setInterval(()=>{this.$el.clientWidth<this.mobileDisplayWidth?this.mobileMode=!0:this.mobileMode=!1},300)},async customPaste(n){let e=[],t=!1,r=!1,o=(n.clipboardData||window.clipboardData).items;for(let s=0;s<o.length;s++)if(o[s].type.indexOf("html")>-1&&(t=o[s]),o[s].type.indexOf("plain")>-1&&(r=o[s]),o[s].kind==="file"&&o[s].type.indexOf("image")>-1){let a=o[s].getAsFile(),l=new FileReader;l.readAsDataURL(a);let c=new Promise(u=>{l.onload=d=>{u(d.target.result)}});e.push(c)}if(t!==!1){let s=await new Promise(m=>{t.getAsString(b=>{m(b)})}),a=new DOMParser,l=a.parseFromString(s,"text/html");console.log(l);let c=a.parseFromString("","text/html"),u=[];l.body.children.forEach(m=>{let b=this.dfsDiv(m);u=u.concat(b)}),c.body.append(...u);let d=c.querySelectorAll("img");for(let m=0;m<d.length;m++){let b=d[m],f=d[m];for(;b&&b.parentNode!=c.body;)b=b.parentNode;b.parentNode.insertBefore(f,b)}console.log(c.body.innerHTML),this.insert(c.body.innerHTML)}else r!==!1?r.getAsString(s=>{const a=this.editor.state.tr.insertText(s);this.editor.view.dispatch(a)}):Promise.all(e).then(s=>{this.insertImg(s)})},dfsDiv(n){if(n.tagName.toUpperCase()!=="DIV")return[n];let e=n.children,t=[];return e.forEach(r=>{t=t.concat(this.dfsDiv(r))}),t},focus(){this.editor.commands.focus()},computeMarkdown(n){return new uM([k_,j0,F_,q_,z_]).encoder(n)},insertMarkdown(n){let e=this.computeMarkdown(n);return this.editor.commands.setContent(e),e},saveMarkdown(){return new hM(this.mdDecNodeFuncsPlugins,this.mdFlags).decode(this.editor.getJSON())},save(){this.$emit("save-json",this.editor.getJSON()),this.$emit("save-html",this.editor.getHTML())}},beforeUnmount(){this.editor&&this.editor.destroy();for(let n in this.timer)clearInterval(this.timer[n])}},{props:{modelValue:{default:""},editable:{default:!0},placeholder:{default:"Write something …"},disabledPlaceholder:{default:!1,type:Boolean},contentMaxWidth:{default:"900px",type:String},foreground:{default:"#958DF1"},linkColor:{default:"#958DF1"},selectionBackground:{default:"rgba(144, 145, 234, 0.3)"},selectionForeground:{default:""},tableDragColor:{default:"rgba(144, 145, 234, 0.6)"},codeColor:{default:""},editorBackground:{default:""},editorOutSideBackground:{default:""},mobileDisplayWidth:{default:768},showToolBar:{default:!0},toolbarHeight:{default:65},toolbarBackground:{default:""},toolbarBorderRadius:{default:8},editablePaddingTop:{default:!1},readOnlyPaddingTop:{default:5},editablePaddingBottom:{default:315},readOnlyPaddingBottom:{default:55},codeBlockLanguagesBox:{default:!0},codeBlockLineNumbers:{default:!1},imgPreview:{default:!0},imgInterceptor:{default:null},mentionItemAttr:{default:()=>({})},imgLazyLoad:{default:!0},extensions:{default:()=>[]},starterKit:{default:()=>{}},showControlOnReadonly:{default:!0},mdDecNodeFuncsPlugins:{default:()=>({})},mdFlags:{default:()=>({})},showSave:{default:!0},language:{default:"cn"},theme:{default:"light"}},emits:["content-change","on-mounted","change","container-scroll","save-json","save-html"],setup(n,{expose:e,emit:t}){const{ref:r,proxy:i}=v.getCurrentInstance();return e({save:(...o)=>i.save(...o),saveMarkdown:(...o)=>i.saveMarkdown(...o),computeMarkdown:(...o)=>i.computeMarkdown(...o),insertMarkdown:(...o)=>i.insertMarkdown(...o),editor:()=>i.$data.editor,focus:()=>i.focus()}),(o,s)=>(v.openBlock(),v.createElementBlock("div",{class:v.normalizeClass(["power-editor-container",[{dark:n.theme==="dark"}]])},[v.createVNode(v.Transition,{name:"power-editor-tool-bar-fade-in"},{default:v.withCtx(()=>[o.editor&&n.editable?v.withDirectives((v.openBlock(),v.createBlock(q2,{key:0,editor:o.editor,theme:n.theme,foreground:n.foreground,language:n.language,toolbarHeight:n.toolbarHeight,toolbarBorderRadius:n.toolbarBorderRadius,mobileMode:o.mobileMode,showSave:n.showSave,onSaveClick:o.save},{"custom-buttons":v.withCtx(a=>[v.renderSlot(o.$slots,"custom-buttons",{editor:o.editor,defaultClass:a.defaultClass})]),"custom-buttons-front":v.withCtx(a=>[v.renderSlot(o.$slots,"custom-buttons-front",{editor:o.editor,defaultClass:a.defaultClass})]),"custom-buttons-0":v.withCtx(a=>[v.renderSlot(o.$slots,"custom-buttons-0",{editor:o.editor,defaultClass:a.defaultClass})]),"custom-buttons-1":v.withCtx(a=>[v.renderSlot(o.$slots,"custom-buttons-1",{editor:o.editor,defaultClass:a.defaultClass})]),"custom-buttons-2":v.withCtx(a=>[v.renderSlot(o.$slots,"custom-buttons-2",{editor:o.editor,defaultClass:a.defaultClass})]),"custom-buttons-3":v.withCtx(a=>[v.renderSlot(o.$slots,"custom-buttons-3",{editor:o.editor,defaultClass:a.defaultClass})]),"custom-buttons-4":v.withCtx(a=>[v.renderSlot(o.$slots,"custom-buttons-4",{editor:o.editor,defaultClass:a.defaultClass})]),_:3},8,["editor","theme","foreground","language","toolbarHeight","toolbarBorderRadius","mobileMode","showSave","onSaveClick"])),[[v.vShow,n.showToolBar]]):v.createCommentVNode("",!0)]),_:3}),o.editor&&n.editable?v.withDirectives((v.openBlock(),v.createElementBlock("div",{key:0,class:"power-editor-tool-bar-acrylic-background",style:v.normalizeStyle({height:`${n.toolbarHeight}px`,background:n.toolbarBackground,"border-radius":`${n.toolbarBorderRadius}px`})},null,4)),[[v.vShow,n.showToolBar]]):v.createCommentVNode("",!0),v.createElementVNode("div",{class:v.normalizeClass([[{"read-only":!n.editable||!n.showToolBar}],"tip-tap-editor-container"]),ref:"container",style:v.normalizeStyle({"padding-top":n.editable&&n.showToolBar?`${n.editablePaddingTop?n.editablePaddingTop:n.toolbarHeight+10}px`:`${n.readOnlyPaddingTop}px`,background:n.editorOutSideBackground,"--link-color":n.linkColor,"--selection-background":n.selectionBackground,"--selection-color":n.selectionForeground,"--table-drag-color":n.tableDragColor,"--code-color":n.codeColor})},[v.renderSlot(o.$slots,"front-content"),v.createVNode(v.unref(I1),{class:v.normalizeClass(["tip-tap-editor",[{"format-painter":o.showFormatPainter}]]),editor:o.editor,theme:n.theme,ref:"editor",style:v.normalizeStyle({"padding-bottom":n.editable?`${n.editablePaddingBottom}px`:`${n.readOnlyPaddingBottom}px`,background:n.editorBackground,"max-width":n.contentMaxWidth})},null,8,["class","editor","theme","style"])],6),o.editor&&n.editable?(v.openBlock(),v.createBlock(v.unref(Ob),{key:1,editor:o.editor,options:{placement:"top",offset:8},"should-show":o.bubbleMenuShouldShow},{default:v.withCtx(()=>[v.createVNode(H2,{editor:o.editor,theme:n.theme,foreground:n.foreground,language:n.language,mobileMode:o.mobileMode,showSave:n.showSave},null,8,["editor","theme","foreground","language","mobileMode","showSave"])]),_:1},8,["editor","should-show"])):v.createCommentVNode("",!0)],2))}}),V2=n=>(n.install=e=>{e.component(n.name,n)},n),bL=V2(gL),_L={class:"dev-c-container"},yL=V2(Object.assign({name:"DevC",data(){return{message:"Welcome to Dev C!"}},mounted(){console.log(this.message)}},{props:{title:{type:[String],default:"Dev C"}},setup(n){return(e,t)=>{const r=v.resolveComponent("fv-button");return v.openBlock(),v.createElementBlock("div",_L,[v.createElementVNode("h1",null,v.toDisplayString(n.title),1),v.createElementVNode("p",null,v.toDisplayString(e.message),1),v.createVNode(r,null,{default:v.withCtx(()=>t[0]||(t[0]=[v.createTextVNode("Confirm")])),_:1,__:[0]})])}}})),vL=[bL,yL],U2={install(n,e){for(const t of vL)n.use(t)}};Fr.PowerEditorPlugins=U2,Fr.default=U2,Object.defineProperties(Fr,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|