vdc-editor 0.1.205 → 0.1.206

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.
@@ -287,10 +287,10 @@ https://github.com/highlightjs/highlight.js/issues/2277`),ne=P,Y=q),J===void 0&&
287
287
  3. "-" cannot repeat`);Kt.customSchemes.push([t,e])}function MW(){Kt.scanner=CW(Kt.customSchemes);for(let t=0;t<Kt.tokenQueue.length;t++)Kt.tokenQueue[t][1]({scanner:Kt.scanner});Kt.parser=kW(Kt.scanner.tokens);for(let t=0;t<Kt.pluginQueue.length;t++)Kt.pluginQueue[t][1]({scanner:Kt.scanner,parser:Kt.parser});return Kt.initialized=!0,Kt}function R1(t){return Kt.initialized||MW(),_W(Kt.parser.start,t,v8(Kt.scanner.start,t))}R1.scan=v8;function k8(t,e=null,n=null){if(e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const r=new B1(n),o=R1(t),s=[];for(let a=0;a<o.length;a++){const l=o[a];l.isLink&&(!e||l.t===e)&&r.check(l)&&s.push(l.toFormattedObject(r))}return s}function BW(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function IW(t){return new Ne({key:new Et("autolink"),appendTransaction:(e,n,r)=>{const o=e.some(c=>c.docChanged)&&!n.doc.eq(r.doc),s=e.some(c=>c.getMeta("preventAutolink"));if(!o||s)return;const{tr:a}=r,l=CO(n.doc,[...e]);if(_O(l).forEach(({newRange:c})=>{const f=a4(r.doc,c,g=>g.isTextblock);let p,m;if(f.length>1?(p=f[0],m=r.doc.textBetween(p.pos,p.pos+p.node.nodeSize,void 0," ")):f.length&&r.doc.textBetween(c.from,c.to," "," ").endsWith(" ")&&(p=f[0],m=r.doc.textBetween(p.pos,c.to,void 0," ")),p&&m){const g=m.split(" ").filter(x=>x!=="");if(g.length<=0)return!1;const b=g[g.length-1],y=p.pos+m.lastIndexOf(b);if(!b)return!1;const w=R1(b).map(x=>x.toObject(t.defaultProtocol));if(!BW(w))return!1;w.filter(x=>x.isLink).map(x=>({...x,from:y+x.start+1,to:y+x.end+1})).filter(x=>r.schema.marks.code?!r.doc.rangeHasMark(x.from,x.to,r.schema.marks.code):!0).filter(x=>t.validate(x.value)).filter(x=>t.shouldAutoLink(x.value)).forEach(x=>{Jm(x.from,x.to,r.doc).some(E=>E.mark.type===t.type)||a.addMark(x.from,x.to,t.type.create({href:x.href}))})}}),!!a.steps.length)return a}})}function RW(t){return new Ne({key:new Et("handleClickLink"),props:{handleClick:(e,n,r)=>{var o,s;if(r.button!==0||!e.editable)return!1;let a=r.target;const l=[];for(;a.nodeName!=="DIV";)l.push(a),a=a.parentNode;if(!l.find(m=>m.nodeName==="A"))return!1;const u=c4(e.state,t.type.name),c=r.target,f=(o=c==null?void 0:c.href)!==null&&o!==void 0?o:u.href,p=(s=c==null?void 0:c.target)!==null&&s!==void 0?s:u.target;return c&&f?(window.open(f,p),!0):!1}}})}function LW(t){return new Ne({key:new Et("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{state:o}=e,{selection:s}=o,{empty:a}=s;if(a)return!1;let l="";r.content.forEach(c=>{l+=c.textContent});const u=k8(l,{defaultProtocol:t.defaultProtocol}).find(c=>c.isLink&&c.value===l);return!l||!u?!1:t.editor.commands.setMark(t.type,{href:u.href})}}})}const PW=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function oa(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const o=typeof r=="string"?r:r.scheme;o&&n.push(o)}),!t||t.replace(PW,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const DW=Pn.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){S8(t);return}S8(t.scheme,t.optionalSlashes)})},onDestroy(){OW()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!oa(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>!!t}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:n=>!!oa(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!oa(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",vt(this.options.HTMLAttributes,t),0]:["a",vt(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!oa(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!oa(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[Hi({find:t=>{const e=[];if(t){const{protocols:n,defaultProtocol:r}=this.options,o=k8(t).filter(s=>s.isLink&&this.options.isAllowedUri(s.value,{defaultValidate:a=>!!oa(a,n),protocols:n,defaultProtocol:r}));o.length&&o.forEach(s=>e.push({text:s.value,data:{href:s.href},index:s.start}))}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(IW({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:o=>!!oa(o,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&t.push(RW({type:this.type})),this.options.linkOnPaste&&t.push(LW({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}}),VW={class:"flex w-full max-w-sm items-center gap-1.5"},FW={class:"relative w-full max-w-sm items-center"},$W={class:"flex w-full max-w-sm items-center gap-1.5"},zW={class:"relative w-full max-w-sm items-center"},HW={class:"absolute start-0 inset-y-0 flex items-center justify-center px-2"},_8=i.defineComponent({__name:"LinkEditBlock",props:{editor:{}},emits:["onSetLink","onClickOutside"],setup(t,{emit:e}){const n=t,r=e,{t:o}=Tt();let s=i.reactive({text:"",link:""});const a=i.ref(null),{focused:l}=gt.useFocus(a),u=i.ref(!0),c=i.ref(null);gt.onClickOutside(c,m=>r("onClickOutside",m)),i.watchEffect(()=>{const{href:m,target:g}=n.editor.getAttributes("link"),{from:b,to:y}=n.editor.state.selection,w=n.editor.state.doc.textBetween(b,y," ");s={link:m,text:w}});function f(){const m=p(s.link);r("onSetLink",m,s.text,u.value)}function p(m){if(!m)return m;const g=m.trim();return/^https?:\/\//i.test(g)||/^[a-zA-Z][a-zA-Z0-9+.\-]*:/i.test(g)?g:"http://"+g}return i.onMounted(()=>{l.value=!0}),(m,g)=>(i.openBlock(),i.createElementBlock("div",{ref_key:"target",ref:c,class:"p-2 bg-white rounded-lg dark:bg-black shadow-sm border border-neutral-200 dark:border-neutral-800"},[i.createElementVNode("form",{class:"flex flex-col gap-2",onSubmit:i.withModifiers(f,["prevent"])},[i.createVNode(i.unref(Vg),null,{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("editor.link.dialog.text")),1)]),_:1}),i.createElementVNode("div",VW,[i.createElementVNode("div",FW,[i.createVNode(i.unref(dl),{modelValue:i.unref(s).text,"onUpdate:modelValue":g[0]||(g[0]=b=>i.unref(s).text=b),type:"text",required:"",placeholder:"텍스트"},null,8,["modelValue"])])]),i.createVNode(i.unref(Vg),null,{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("editor.link.dialog.link")),1)]),_:1}),i.createElementVNode("div",$W,[i.createElementVNode("div",zW,[i.createVNode(i.unref(dl),{ref_key:"inputRef",ref:a,modelValue:i.unref(s).link,"onUpdate:modelValue":g[1]||(g[1]=b=>i.unref(s).link=b),type:"text",required:"",class:"pl-10"},null,8,["modelValue"]),i.createElementVNode("span",HW,[i.createVNode(i.unref(Ft),{class:"size-5 text-ed-muted-foreground",name:"Link"})])])]),i.createVNode(i.unref(yn),{class:"mt-2 self-end"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("editor.link.dialog.button.apply")),1)]),_:1})],32)],512))}}),UW=i.defineComponent({__name:"LinkEditPopover",props:{editor:{},icon:{default:void 0},title:{default:void 0},tooltip:{default:void 0},disabled:{type:Boolean,default:!1},shortcutKeys:{default:void 0},isActive:{type:Function,default:void 0},action:{type:Function,default:void 0}},setup(t){const e=t;function n(r,o,s){e.action&&e.action({link:r,text:o,openInNewTab:s})}return(r,o)=>(i.openBlock(),i.createBlock(i.unref(ul),null,{default:i.withCtx(({open:s})=>[i.createVNode(i.unref(fl),{disabled:r.disabled},{default:i.withCtx(()=>[i.createVNode(Ke,{icon:r.icon,tooltip:r.tooltip,"is-active":r.isActive,"is-pressed":s,disabled:r.disabled},null,8,["icon","tooltip","is-active","is-pressed","disabled"])]),_:2},1032,["disabled"]),i.createVNode(i.unref(cl),{"as-child":"",class:"w-80",align:"start",side:"bottom"},{default:i.withCtx(()=>[i.createVNode(_8,{editor:r.editor,onOnSetLink:n},null,8,["editor"])]),_:1})]),_:1}))}}),L1=DW.extend({inclusive:!1,parseHTML(){return[{tag:'a[href]:not([data-type="button"]):not([href *= "javascript:" i])'}]},renderHTML({HTMLAttributes:t}){return["a",vt(this.options.HTMLAttributes,t,{class:"link"}),0]},addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),openOnClick:!0,button:({editor:e,t:n})=>({component:UW,componentProps:{action:r=>{const{link:o,text:s,openInNewTab:a}=r;e.chain().extendMarkRange("link").insertContent({type:"text",text:s,marks:[{type:"link",attrs:{href:o,target:a?"_blank":""}}]}).setLink({href:o}).focus().run()},isActive:()=>e.isActive("link")||!1,disabled:!e.can().setLink({href:""}),icon:"Link",tooltip:n("editor.link.tooltip")}})}},addProseMirrorPlugins(){return[new Ne({props:{handleClick:(t,e)=>{const{schema:n,doc:r,tr:o}=t.state,s=bd(r.resolve(e),n.marks.link);if(!s)return!1;const a=r.resolve(s.from),l=r.resolve(s.to),u=o.setSelection(new Ae(a,l));t.dispatch(u)}}})]}}),WW=Bt.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",vt(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{const{selection:n}=e,{$from:r,$to:o}=n,s=t();return r.parentOffset===0?s.insertContentAt({from:Math.max(r.pos-1,0),to:o.pos},{type:this.name}):d4(n)?s.insertContentAt(o.pos,{type:this.name}):s.insertContent({type:this.name}),s.command(({tr:a,dispatch:l})=>{var u;if(l){const{$to:c}=a.selection,f=c.end();if(c.nodeAfter)c.nodeAfter.isTextblock?a.setSelection(Ae.create(a.doc,c.pos+1)):c.nodeAfter.isBlock?a.setSelection(Le.create(a.doc,c.pos)):a.setSelection(Ae.create(a.doc,c.pos));else{const p=(u=c.parent.type.contentMatch.defaultType)===null||u===void 0?void 0:u.create();p&&(a.insert(f,p),a.setSelection(Ae.create(a.doc,f+1)))}a.scrollIntoView()}return!0}).run()}}},addInputRules(){return[h4({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}).extend({renderHTML(){return["div",vt(this.options.HTMLAttributes,{"data-type":this.name}),["hr"]]},addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,t:n})=>({component:Ke,componentProps:{action:()=>e.commands.setHorizontalRule(),disabled:!e.can().setHorizontalRule(),icon:"Minus",shortcutKeys:["mod","alt","S"],tooltip:n("editor.horizontalrule.tooltip")}})}},addKeyboardShortcuts(){return{"Mod-Alt-s":()=>this.editor.commands.setHorizontalRule()}}});var hp=200,xn=function(){};xn.prototype.append=function(e){return e.length?(e=xn.from(e),!this.length&&e||e.length<hp&&this.leafAppend(e)||this.length<hp&&e.leafPrepend(this)||this.appendInner(e)):this},xn.prototype.prepend=function(e){return e.length?xn.from(e).append(this):this},xn.prototype.appendInner=function(e){return new jW(this,e)},xn.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?xn.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))},xn.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},xn.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)},xn.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var o=[];return this.forEach(function(s,a){return o.push(e(s,a))},n,r),o},xn.from=function(e){return e instanceof xn?e:e&&e.length?new T8(e):xn.empty};var T8=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(o,s){return o==0&&s==this.length?this:new e(this.values.slice(o,s))},e.prototype.getInner=function(o){return this.values[o]},e.prototype.forEachInner=function(o,s,a,l){for(var u=s;u<a;u++)if(o(this.values[u],l+u)===!1)return!1},e.prototype.forEachInvertedInner=function(o,s,a,l){for(var u=s-1;u>=a;u--)if(o(this.values[u],l+u)===!1)return!1},e.prototype.leafAppend=function(o){if(this.length+o.length<=hp)return new e(this.values.concat(o.flatten()))},e.prototype.leafPrepend=function(o){if(this.length+o.length<=hp)return new e(o.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(xn);xn.empty=new T8([]);var jW=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.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,o,s,a){var l=this.left.length;if(o<l&&this.left.forEachInner(r,o,Math.min(s,l),a)===!1||s>l&&this.right.forEachInner(r,Math.max(o-l,0),Math.min(this.length,s)-l,a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,o,s,a){var l=this.left.length;if(o>l&&this.right.forEachInvertedInner(r,o-l,Math.max(s,l)-l,a+l)===!1||s<l&&this.left.forEachInvertedInner(r,Math.min(o,l),s,a)===!1)return!1},e.prototype.sliceInner=function(r,o){if(r==0&&o==this.length)return this;var s=this.left.length;return o<=s?this.left.slice(r,o):r>=s?this.right.slice(r-s,o-s):this.left.slice(r,s).append(this.right.slice(0,o-s))},e.prototype.leafAppend=function(r){var o=this.right.leafAppend(r);if(o)return new e(this.left,o)},e.prototype.leafPrepend=function(r){var o=this.left.leafPrepend(r);if(o)return new e(o,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}(xn);const qW=500;class lo{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let o,s;n&&(o=this.remapping(r,this.items.length),s=o.maps.length);let a=e.tr,l,u,c=[],f=[];return this.items.forEach((p,m)=>{if(!p.step){o||(o=this.remapping(r,m+1),s=o.maps.length),s--,f.push(p);return}if(o){f.push(new Fo(p.map));let g=p.step.map(o.slice(s)),b;g&&a.maybeStep(g).doc&&(b=a.mapping.maps[a.mapping.maps.length-1],c.push(new Fo(b,void 0,void 0,c.length+f.length))),s--,b&&o.appendMap(b,s)}else a.maybeStep(p.step);if(p.selection)return l=o?p.selection.map(o.slice(s)):p.selection,u=new lo(this.items.slice(0,r).append(f.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:u,transform:a,selection:l}}addTransform(e,n,r,o){let s=[],a=this.eventCount,l=this.items,u=!o&&l.length?l.get(l.length-1):null;for(let f=0;f<e.steps.length;f++){let p=e.steps[f].invert(e.docs[f]),m=new Fo(e.mapping.maps[f],p,n),g;(g=u&&u.merge(m))&&(m=g,f?s.pop():l=l.slice(0,l.length-1)),s.push(m),n&&(a++,n=void 0),o||(u=m)}let c=a-r.depth;return c>GW&&(l=KW(l,c),a-=c),new lo(l.append(s),a)}remapping(e,n){let r=new Zl;return this.items.forEach((o,s)=>{let a=o.mirrorOffset!=null&&s-o.mirrorOffset>=e?r.maps.length-o.mirrorOffset:void 0;r.appendMap(o.map,a)},e,n),r}addMaps(e){return this.eventCount==0?this:new lo(this.items.append(e.map(n=>new Fo(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],o=Math.max(0,this.items.length-n),s=e.mapping,a=e.steps.length,l=this.eventCount;this.items.forEach(m=>{m.selection&&l--},o);let u=n;this.items.forEach(m=>{let g=s.getMirror(--u);if(g==null)return;a=Math.min(a,g);let b=s.maps[g];if(m.step){let y=e.steps[g].invert(e.docs[g]),w=m.selection&&m.selection.map(s.slice(u+1,g));w&&l++,r.push(new Fo(b,y,w))}else r.push(new Fo(b))},o);let c=[];for(let m=n;m<a;m++)c.push(new Fo(s.maps[m]));let f=this.items.slice(0,o).append(c).append(r),p=new lo(f,l);return p.emptyItemCount()>qW&&(p=p.compress(this.items.length-r.length)),p}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,o=[],s=0;return this.items.forEach((a,l)=>{if(l>=e)o.push(a),a.selection&&s++;else if(a.step){let u=a.step.map(n.slice(r)),c=u&&u.getMap();if(r--,c&&n.appendMap(c,r),u){let f=a.selection&&a.selection.map(n.slice(r));f&&s++;let p=new Fo(c.invert(),u,f),m,g=o.length-1;(m=o.length&&o[g].merge(p))?o[g]=m:o.push(p)}}else a.map&&r--},this.items.length,0),new lo(xn.from(o.reverse()),s)}}lo.empty=new lo(xn.empty,0);function KW(t,e){let n;return t.forEach((r,o)=>{if(r.selection&&e--==0)return n=o,!1}),t.slice(n)}class Fo{constructor(e,n,r,o){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=o}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new Fo(n.getMap().invert(),n,this.selection)}}}class is{constructor(e,n,r,o,s){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=o,this.prevComposition=s}}const GW=20;function XW(t,e,n,r){let o=n.getMeta(ia),s;if(o)return o.historyState;n.getMeta(ZW)&&(t=new is(t.done,t.undone,null,0,-1));let a=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(a&&a.getMeta(ia))return a.getMeta(ia).redo?new is(t.done.addTransform(n,void 0,r,mp(e)),t.undone,A8(n.mapping.maps),t.prevTime,t.prevComposition):new is(t.done,t.undone.addTransform(n,void 0,r,mp(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),u=t.prevTime==0||!a&&t.prevComposition!=l&&(t.prevTime<(n.time||0)-r.newGroupDelay||!YW(n,t.prevRanges)),c=a?P1(t.prevRanges,n.mapping):A8(n.mapping.maps);return new is(t.done.addTransform(n,u?e.selection.getBookmark():void 0,r,mp(e)),lo.empty,c,n.time,l??t.prevComposition)}else return(s=n.getMeta("rebased"))?new is(t.done.rebased(n,s),t.undone.rebased(n,s),P1(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new is(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),P1(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function YW(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,o)=>{for(let s=0;s<e.length;s+=2)r<=e[s+1]&&o>=e[s]&&(n=!0)}),n}function A8(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,o,s,a)=>e.push(s,a));return e}function P1(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let o=e.map(t[r],1),s=e.map(t[r+1],-1);o<=s&&n.push(o,s)}return n}function JW(t,e,n){let r=mp(e),o=ia.get(e).spec.config,s=(n?t.undone:t.done).popEvent(e,r);if(!s)return null;let a=s.selection.resolve(s.transform.doc),l=(n?t.done:t.undone).addTransform(s.transform,e.selection.getBookmark(),o,r),u=new is(n?l:s.remaining,n?s.remaining:l,null,0,-1);return s.transform.setSelection(a).setMeta(ia,{redo:n,historyState:u})}let D1=!1,O8=null;function mp(t){let e=t.plugins;if(O8!=e){D1=!1,O8=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){D1=!0;break}}return D1}const ia=new Et("history"),ZW=new Et("closeHistory");function QW(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Ne({key:ia,state:{init(){return new is(lo.empty,lo.empty,null,0,-1)},apply(e,n,r){return XW(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,o=r=="historyUndo"?B8:r=="historyRedo"?I8:null;return o?(n.preventDefault(),o(e.state,e.dispatch)):!1}}}})}function M8(t,e){return(n,r)=>{let o=ia.getState(n);if(!o||(t?o.undone:o.done).eventCount==0)return!1;if(r){let s=JW(o,n,t);s&&r(e?s.scrollIntoView():s)}return!0}}const B8=M8(!1,!0),I8=M8(!0,!0),NW=Ze.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>B8(t,e),redo:()=>({state:t,dispatch:e})=>I8(t,e)}},addProseMirrorPlugins(){return[QW(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()}}}),R8={HISTORY_TRANSACTION:"history$",ADD_TO_HISTORY_TRANSACTION:"addToHistory"},V1=NW.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),depth:10,button:({editor:e,t:n})=>["undo","redo"].map(o=>({component:Ke,componentProps:{action:()=>{o==="undo"&&e.commands.undo(),o==="redo"&&e.commands.redo()},shortcutKeys:o==="undo"?["mod","Z"]:["shift","mod","Z"],disabled:!e.can()[o](),icon:o==="undo"?"Undo2":"Redo2",tooltip:n(`editor.${o}.tooltip`)}}))}}}),{isFullscreen:F1,toggleFullscreen:$1}=wn(),ej=Ze.create({name:"fullscreen",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,extension:n,t:r})=>({component:Ke,componentProps:{tooltip:F1.value?r("editor.fullscreen.tooltip.exit"):r("editor.fullscreen.tooltip.fullscreen"),action:()=>$1(),icon:F1.value?"Minimize":"Maximize",isActive:()=>F1.value}})}},addKeyboardShortcuts(){return{F11:()=>($1(),!0),"Mod-F11":()=>($1(),!0)}}}),tj=Ze.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc;if(((t==null?void 0:t.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=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc,n=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let t=!1;return[new Ne({key:new Et("characterCount"),appendTransaction:(e,n,r)=>{if(t)return;const o=this.options.limit;if(o==null||o===0){t=!0;return}const s=this.storage.characters({node:r.doc});if(s>o){const a=s-o,l=0,u=a;console.warn(`[CharacterCount] Initial content exceeded limit of ${o} characters. Content was automatically trimmed.`);const c=r.tr.deleteRange(l,u);return t=!0,c}t=!0},filterTransaction:(e,n)=>{const r=this.options.limit;if(!e.docChanged||r===0||r===null||r===void 0)return!0;const o=this.storage.characters({node:n.doc}),s=this.storage.characters({node:e.doc});if(s<=r||o>r&&s>r&&s<=o)return!0;if(o>r&&s>r&&s>o||!e.getMeta("paste"))return!1;const l=e.selection.$head.pos,u=s-r,c=l-u,f=l;return e.deleteRange(c,f),!(this.storage.characters({node:e.doc})>r)}})]}});function nj(t={}){return new Ne({view(e){return new rj(e,t)}})}class rj{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(o=>{let s=a=>{this[o](a)};return e.dom.addEventListener(o,s),{name:o,handler:s}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.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),n=!e.parent.inlineContent,r;if(n){let l=e.nodeBefore,u=e.nodeAfter;if(l||u){let c=this.editorView.nodeDOM(this.cursorPos-(l?l.nodeSize:0));if(c){let f=c.getBoundingClientRect(),p=l?f.bottom:f.top;l&&u&&(p=(p+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:f.left,right:f.right,top:p-this.width/2,bottom:p+this.width/2}}}}if(!r){let l=this.editorView.coordsAtPos(this.cursorPos);r={left:l.left-this.width/2,right:l.left+this.width/2,top:l.top,bottom:l.bottom}}let o=this.editorView.dom.offsetParent;this.element||(this.element=o.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let s,a;if(!o||o==document.body&&getComputedStyle(o).position=="static")s=-pageXOffset,a=-pageYOffset;else{let l=o.getBoundingClientRect();s=l.left-o.scrollLeft,a=l.top-o.scrollTop}this.element.style.left=r.left-s+"px",this.element.style.top=r.top-a+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),o=r&&r.type.spec.disableDropCursor,s=typeof o=="function"?o(this.editorView,n,e):o;if(n&&!s){let a=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=ay(this.editorView.state.doc,a,this.editorView.dragging.slice);l!=null&&(a=l)}this.setCursor(a),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}const oj=Ze.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[nj(this.options)]}}),ij=Ze.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new Ne({key:new Et("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:o}=e,s=[];if(!n||!r)return ht.create(t,[]);let a=0;this.options.mode==="deepest"&&t.descendants((u,c)=>{if(u.isText)return;if(!(o>=c&&o<=c+u.nodeSize-1))return!1;a+=1});let l=0;return t.descendants((u,c)=>{if(u.isText||!(o>=c&&o<=c+u.nodeSize-1))return!1;if(l+=1,this.options.mode==="deepest"&&a-l>0||this.options.mode==="shallowest"&&l>1)return this.options.mode==="deepest";s.push(qt.node(c,c+u.nodeSize,{class:this.options.className}))}),ht.create(t,s)}}})]}});class nn extends De{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return nn.valid(r)?new nn(r):De.near(r)}content(){return Ee.empty}eq(e){return e instanceof nn&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new nn(e.resolve(n.pos))}getBookmark(){return new z1(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!sj(e)||!aj(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let o=n.contentMatchAt(e.index()).defaultType;return o&&o.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&nn.valid(e))return e;let o=e.pos,s=null;for(let a=e.depth;;a--){let l=e.node(a);if(n>0?e.indexAfter(a)<l.childCount:e.index(a)>0){s=l.child(n>0?e.indexAfter(a):e.index(a)-1);break}else if(a==0)return null;o+=n;let u=e.doc.resolve(o);if(nn.valid(u))return u}for(;;){let a=n>0?s.firstChild:s.lastChild;if(!a){if(s.isAtom&&!s.isText&&!Le.isSelectable(s)){e=e.doc.resolve(o+s.nodeSize*n),r=!1;continue e}break}s=a,o+=n;let l=e.doc.resolve(o);if(nn.valid(l))return l}return null}}}nn.prototype.visible=!1,nn.findFrom=nn.findGapCursorFrom,De.jsonID("gapcursor",nn);class z1{constructor(e){this.pos=e}map(e){return new z1(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return nn.valid(n)?new nn(n):De.near(n)}}function sj(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n-1);;o=o.lastChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function aj(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n);;o=o.firstChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function lj(){return new Ne({props:{decorations:fj,createSelectionBetween(t,e,n){return e.pos==n.pos&&nn.valid(n)?new nn(n):null},handleClick:cj,handleKeyDown:uj,handleDOMEvents:{beforeinput:dj}}})}const uj=Dm({ArrowLeft:gp("horiz",-1),ArrowRight:gp("horiz",1),ArrowUp:gp("vert",-1),ArrowDown:gp("vert",1)});function gp(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,o,s){let a=r.selection,l=e>0?a.$to:a.$from,u=a.empty;if(a instanceof Ae){if(!s.endOfTextblock(n)||l.depth==0)return!1;u=!1,l=r.doc.resolve(e>0?l.after():l.before())}let c=nn.findGapCursorFrom(l,e,u);return c?(o&&o(r.tr.setSelection(new nn(c))),!0):!1}}function cj(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!nn.valid(r))return!1;let o=t.posAtCoords({left:n.clientX,top:n.clientY});return o&&o.inside>-1&&Le.isSelectable(t.state.doc.nodeAt(o.inside))?!1:(t.dispatch(t.state.tr.setSelection(new nn(r))),!0)}function dj(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof nn))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let o=de.empty;for(let a=r.length-1;a>=0;a--)o=de.from(r[a].createAndFill(null,o));let s=t.state.tr.replace(n.pos,n.pos,new Ee(o,0,0));return s.setSelection(Ae.near(s.doc.resolve(n.pos+1))),t.dispatch(s),!1}function fj(t){if(!(t.selection instanceof nn))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",ht.create(t.doc,[qt.widget(t.selection.head,e,{key:"gapcursor"})])}const pj=Ze.create({name:"gapCursor",addProseMirrorPlugins(){return[lj()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=ut(Re(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}}),L8=Bt.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",vt(this.options.HTMLAttributes,t)]},renderText(){return`
288
288
  `},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:o,storedMarks:s}=n;if(o.$from.parent.type.spec.isolating)return!1;const{keepMarks:a}=this.options,{splittableMarks:l}=r.extensionManager,u=s||o.$to.parentOffset&&o.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:f})=>{if(f&&u&&a){const p=u.filter(m=>l.includes(m.type.name));c.ensureMarks(p)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),hj=Bt.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",vt(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),P8=Bt.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",vt(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),D8=Ze.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new Ne({key:new Et("placeholder"),props:{decorations:({doc:t,selection:e})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=e,o=[];if(!n)return null;const s=this.editor.isEmpty;return t.descendants((a,l)=>{const u=r>=l&&r<=l+a.nodeSize,c=!a.isLeaf&&Ed(a);if((u||!this.options.showOnlyCurrent)&&c){const f=[this.options.emptyNodeClass];s&&f.push(this.options.emptyEditorClass);const p=qt.node(l,l+a.nodeSize,{class:f.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:a,pos:l,hasAnchor:u}):this.options.placeholder});o.push(p)}return this.options.includeChildren}),ht.create(t,o)}}})]}}),V8=Bt.create({name:"text",group:"inline"}),F8=Bt.create({name:"doc",topNode:!0,content:"block+"}),$8=F8.extend({content(){var e;return!!((e=this.editor)!=null&&e.options.extensions.find(n=>n.name==="columns"))?"(block|columns)+":"block+"}}),mj=Ze.create({name:"selection",addProseMirrorPlugins(){const{editor:t}=this;return[new Ne({key:new Et("selection"),props:{decorations(e){return e.selection.empty?null:ht.create(e.doc,[qt.inline(e.selection.from,e.selection.to,{class:"selection"})])}}})]}}),gj=t=>{const e=["size-small","size-medium","size-large"],n=["SizeS","SizeM","SizeL"];return e.map((r,o)=>({type:`video-${r}`,component:Ke,componentProps:{tooltip:`editor.${r.replace("-",".")}.tooltip`,icon:n[o],action:()=>t.commands.updateVideo({width:Ld[r]}),isActive:()=>t.isActive("video",{width:Ld[r]})}}))},bj=t=>[...gj(t),{type:"remove",component:Ke,componentProps:{tooltip:"editor.remove",icon:"Trash2",action:()=>{const{state:e,dispatch:n}=t.view;du(e,n)}}}],vj=(t,e,{editor:n,extension:r,t:o})=>{const{extensions:s=[]}=n.extensionManager,a={};for(const l of Object.keys(t)){const u=t[l];if(!u)continue;const c=[];for(const m of u){if(m==="divider"){const y=c[c.length-1];if((y==null?void 0:y.type)==="divider")continue;c.push({type:"divider",component:void 0,componentProps:{}});continue}const g=e.find(y=>y.type===m);if(g){c.push({...g,componentProps:{...g.componentProps,tooltip:g.componentProps.tooltip?o(g.componentProps.tooltip):void 0},componentSlots:g.componentSlots});continue}const b=s.find(y=>y.name===m);if(b){const{button:y}=b.options,w=y({editor:n,extension:b,t:o});c.push({type:m,component:w.component,componentProps:w.componentProps,componentSlots:w.componentSlots});continue}}const f=c[c.length-1],p=c[0];(f==null?void 0:f.type)==="divider"&&c.pop(),(p==null?void 0:p.type)==="divider"&&c.shift(),a[l]=c}return a},yj=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(t=>t.charCodeAt(0))),wj=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(t=>t.charCodeAt(0)));var H1;const xj=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),Cj=(H1=String.fromCodePoint)!==null&&H1!==void 0?H1:function(t){let e="";return t>65535&&(t-=65536,e+=String.fromCharCode(t>>>10&1023|55296),t=56320|t&1023),e+=String.fromCharCode(t),e};function Ej(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=xj.get(t))!==null&&e!==void 0?e:t}var Cn;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(Cn||(Cn={}));const Sj=32;var ss;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(ss||(ss={}));function U1(t){return t>=Cn.ZERO&&t<=Cn.NINE}function kj(t){return t>=Cn.UPPER_A&&t<=Cn.UPPER_F||t>=Cn.LOWER_A&&t<=Cn.LOWER_F}function _j(t){return t>=Cn.UPPER_A&&t<=Cn.UPPER_Z||t>=Cn.LOWER_A&&t<=Cn.LOWER_Z||U1(t)}function Tj(t){return t===Cn.EQUALS||_j(t)}var En;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(En||(En={}));var as;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(as||(as={}));class Aj{constructor(e,n,r){this.decodeTree=e,this.emitCodePoint=n,this.errors=r,this.state=En.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=as.Strict}startEntity(e){this.decodeMode=e,this.state=En.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,n){switch(this.state){case En.EntityStart:return e.charCodeAt(n)===Cn.NUM?(this.state=En.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=En.NamedEntity,this.stateNamedEntity(e,n));case En.NumericStart:return this.stateNumericStart(e,n);case En.NumericDecimal:return this.stateNumericDecimal(e,n);case En.NumericHex:return this.stateNumericHex(e,n);case En.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|Sj)===Cn.LOWER_X?(this.state=En.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=En.NumericDecimal,this.stateNumericDecimal(e,n))}addToNumericResult(e,n,r,o){if(n!==r){const s=r-n;this.result=this.result*Math.pow(o,s)+Number.parseInt(e.substr(n,s),o),this.consumed+=s}}stateNumericHex(e,n){const r=n;for(;n<e.length;){const o=e.charCodeAt(n);if(U1(o)||kj(o))n+=1;else return this.addToNumericResult(e,r,n,16),this.emitNumericEntity(o,3)}return this.addToNumericResult(e,r,n,16),-1}stateNumericDecimal(e,n){const r=n;for(;n<e.length;){const o=e.charCodeAt(n);if(U1(o))n+=1;else return this.addToNumericResult(e,r,n,10),this.emitNumericEntity(o,2)}return this.addToNumericResult(e,r,n,10),-1}emitNumericEntity(e,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===Cn.SEMI)this.consumed+=1;else if(this.decodeMode===as.Strict)return 0;return this.emitCodePoint(Ej(this.result),this.consumed),this.errors&&(e!==Cn.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,n){const{decodeTree:r}=this;let o=r[this.treeIndex],s=(o&ss.VALUE_LENGTH)>>14;for(;n<e.length;n++,this.excess++){const a=e.charCodeAt(n);if(this.treeIndex=Oj(r,o,this.treeIndex+Math.max(1,s),a),this.treeIndex<0)return this.result===0||this.decodeMode===as.Attribute&&(s===0||Tj(a))?0:this.emitNotTerminatedNamedEntity();if(o=r[this.treeIndex],s=(o&ss.VALUE_LENGTH)>>14,s!==0){if(a===Cn.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==as.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:n,decodeTree:r}=this,o=(r[n]&ss.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,o,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,n,r){const{decodeTree:o}=this;return this.emitCodePoint(n===1?o[e]&~ss.VALUE_LENGTH:o[e+1],r),n===3&&this.emitCodePoint(o[e+2],r),r}end(){var e;switch(this.state){case En.NamedEntity:return this.result!==0&&(this.decodeMode!==as.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case En.NumericDecimal:return this.emitNumericEntity(0,2);case En.NumericHex:return this.emitNumericEntity(0,3);case En.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case En.EntityStart:return 0}}}function z8(t){let e="";const n=new Aj(t,r=>e+=Cj(r));return function(o,s){let a=0,l=0;for(;(l=o.indexOf("&",l))>=0;){e+=o.slice(a,l),n.startEntity(s);const c=n.write(o,l+1);if(c<0){a=l+n.end();break}a=l+c,l=c===0?a+1:a}const u=e+o.slice(a);return e="",u}}function Oj(t,e,n,r){const o=(e&ss.BRANCH_LENGTH)>>7,s=e&ss.JUMP_TABLE;if(o===0)return s!==0&&r===s?n:-1;if(s){const u=r-s;return u<0||u>=o?-1:t[n+u]-1}let a=n,l=a+o-1;for(;a<=l;){const u=a+l>>>1,c=t[u];if(c<r)a=u+1;else if(c>r)l=u-1;else return t[u+o]}return-1}const Mj=z8(yj);z8(wj);function Bj(t,e=as.Legacy){return Mj(t,e)}var Nt;(function(t){t.Attribute="attribute",t.Pseudo="pseudo",t.PseudoElement="pseudo-element",t.Tag="tag",t.Universal="universal",t.Adjacent="adjacent",t.Child="child",t.Descendant="descendant",t.Parent="parent",t.Sibling="sibling",t.ColumnCombinator="column-combinator"})(Nt||(Nt={}));var zr;(function(t){t.Any="any",t.Element="element",t.End="end",t.Equals="equals",t.Exists="exists",t.Hyphen="hyphen",t.Not="not",t.Start="start"})(zr||(zr={}));const H8=/^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/,Ij=/\\([\da-f]{1,6}\s?|(\s)|.)/gi,Rj=new Map([[126,zr.Element],[94,zr.Start],[36,zr.End],[42,zr.Any],[33,zr.Not],[124,zr.Hyphen]]),Lj=new Set(["has","not","matches","is","where","host","host-context"]);function Pj(t){switch(t.type){case Nt.Adjacent:case Nt.Child:case Nt.Descendant:case Nt.Parent:case Nt.Sibling:case Nt.ColumnCombinator:return!0;default:return!1}}const Dj=new Set(["contains","icontains"]);function Vj(t,e,n){const r=parseInt(e,16)-65536;return r!==r||n?e:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,r&1023|56320)}function lc(t){return t.replace(Ij,Vj)}function W1(t){return t===39||t===34}function U8(t){return t===32||t===9||t===10||t===12||t===13}function Fj(t){const e=[],n=W8(e,`${t}`,0);if(n<t.length)throw new Error(`Unmatched selector: ${t.slice(n)}`);return e}function W8(t,e,n){let r=[];function o(m){const g=e.slice(n+m).match(H8);if(!g)throw new Error(`Expected name, found ${e.slice(n)}`);const[b]=g;return n+=m+b.length,lc(b)}function s(m){for(n+=m;n<e.length&&U8(e.charCodeAt(n));)n++}function a(){n+=1;const m=n;let g=1;for(;g>0&&n<e.length;n++)e.charCodeAt(n)===40&&!l(n)?g++:e.charCodeAt(n)===41&&!l(n)&&g--;if(g)throw new Error("Parenthesis not matched");return lc(e.slice(m,n-1))}function l(m){let g=0;for(;e.charCodeAt(--m)===92;)g++;return(g&1)===1}function u(){if(r.length>0&&Pj(r[r.length-1]))throw new Error("Did not expect successive traversals.")}function c(m){if(r.length>0&&r[r.length-1].type===Nt.Descendant){r[r.length-1].type=m;return}u(),r.push({type:m})}function f(m,g){r.push({type:Nt.Attribute,name:m,action:g,value:o(1),namespace:null,ignoreCase:"quirks"})}function p(){if(r.length&&r[r.length-1].type===Nt.Descendant&&r.pop(),r.length===0)throw new Error("Empty sub-selector");t.push(r)}if(s(0),e.length===n)return n;e:for(;n<e.length;){const m=e.charCodeAt(n);switch(m){case 32:case 9:case 10:case 12:case 13:{(r.length===0||r[0].type!==Nt.Descendant)&&(u(),r.push({type:Nt.Descendant})),s(1);break}case 62:{c(Nt.Child),s(1);break}case 60:{c(Nt.Parent),s(1);break}case 126:{c(Nt.Sibling),s(1);break}case 43:{c(Nt.Adjacent),s(1);break}case 46:{f("class",zr.Element);break}case 35:{f("id",zr.Equals);break}case 91:{s(1);let g,b=null;e.charCodeAt(n)===124?g=o(1):e.startsWith("*|",n)?(b="*",g=o(2)):(g=o(0),e.charCodeAt(n)===124&&e.charCodeAt(n+1)!==61&&(b=g,g=o(1))),s(0);let y=zr.Exists;const w=Rj.get(e.charCodeAt(n));if(w){if(y=w,e.charCodeAt(n+1)!==61)throw new Error("Expected `=`");s(2)}else e.charCodeAt(n)===61&&(y=zr.Equals,s(1));let x="",E=null;if(y!=="exists"){if(W1(e.charCodeAt(n))){const _=e.charCodeAt(n);let T=n+1;for(;T<e.length&&(e.charCodeAt(T)!==_||l(T));)T+=1;if(e.charCodeAt(T)!==_)throw new Error("Attribute value didn't end");x=lc(e.slice(n+1,T)),n=T+1}else{const _=n;for(;n<e.length&&(!U8(e.charCodeAt(n))&&e.charCodeAt(n)!==93||l(n));)n+=1;x=lc(e.slice(_,n))}s(0);const C=e.charCodeAt(n)|32;C===115?(E=!1,s(1)):C===105&&(E=!0,s(1))}if(e.charCodeAt(n)!==93)throw new Error("Attribute selector didn't terminate");n+=1;const S={type:Nt.Attribute,name:g,action:y,value:x,namespace:b,ignoreCase:E};r.push(S);break}case 58:{if(e.charCodeAt(n+1)===58){r.push({type:Nt.PseudoElement,name:o(2).toLowerCase(),data:e.charCodeAt(n)===40?a():null});continue}const g=o(1).toLowerCase();let b=null;if(e.charCodeAt(n)===40)if(Lj.has(g)){if(W1(e.charCodeAt(n+1)))throw new Error(`Pseudo-selector ${g} cannot be quoted`);if(b=[],n=W8(b,e,n+1),e.charCodeAt(n)!==41)throw new Error(`Missing closing parenthesis in :${g} (${e})`);n+=1}else{if(b=a(),Dj.has(g)){const y=b.charCodeAt(0);y===b.charCodeAt(b.length-1)&&W1(y)&&(b=b.slice(1,-1))}b=lc(b)}r.push({type:Nt.Pseudo,name:g,data:b});break}case 44:{p(),r=[],s(1);break}default:{if(e.startsWith("/*",n)){const y=e.indexOf("*/",n+2);if(y<0)throw new Error("Comment was not terminated");n=y+2,r.length===0&&s(0);break}let g=null,b;if(m===42)n+=1,b="*";else if(m===124){if(b="",e.charCodeAt(n+1)===124){c(Nt.ColumnCombinator),s(2);break}}else if(H8.test(e.slice(n)))b=o(0);else break e;e.charCodeAt(n)===124&&e.charCodeAt(n+1)!==124&&(g=b,e.charCodeAt(n+1)===42?(b="*",n+=2):b=o(1)),r.push(b==="*"?{type:Nt.Universal,namespace:g}:{type:Nt.Tag,name:b,namespace:g})}}}return p(),n}function j1(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&apos;").replace(/"/g,"&quot;").replace(/\xA0/g,"&nbsp;").replace(/\xAD/g,"&shy;")}var j8=t=>Bj(t);function $j(t,e,n,r){if(typeof e=="function")return e({props:{...n,children:r},attrs:n,children:r,h:t.h,context:t});{let o=!0,s;if(e?e.toLowerCase()==="fragment"?(s=t.document.createDocumentFragment(),o=!1):s=t.document.createElement(e):s=t.document.createElement("div"),n&&o){const a=s;for(let[l,u]of Object.entries(n)){l=l.toString();const c=l.toLowerCase();c==="classname"?a.className=u:c==="on"?Object.entries(u).forEach(([f,p])=>{a.setAttribute(`on${f}`,String(p))}):u!==!1&&u!=null&&(u===!0?a.setAttribute(l,l):a.setAttribute(l,u.toString()))}}if(r)for(const a of r){const l=Array.isArray(a)?[...a]:[a];for(const u of l)u&&u!==!1&&u!=null&&(typeof u!="object"?s.appendChild(t.document.createTextNode(u.toString())):s.appendChild(u))}return s}}function q8(t,e,...n){return typeof t=="object"&&(t="fragment",n=t.children,e=t.attrs),Array.isArray(e)?(n=[e],e={}):e?e.attrs&&(e={...e.attrs,...e},delete e.attrs):e={},{tag:t,attrs:e,children:typeof n[0]=="string"?n:n.flat(Number.POSITIVE_INFINITY)}}function zj(t){return t.h=function(n,r,...o){const{tag:s,attrs:a,children:l}=q8(n,r,o);return $j(t,s,a,l)},t.h}var K8={};function Hj(t){let e=K8[t];return e==null&&(e=Fj(t),K8[t]=e),e}function Uj(t,e,{debug:n=!1}={}){for(const r of Hj(t)){const o=(s,a)=>{var u,c,f,p;let l=!1;for(const m of a){const{type:g,name:b,action:y,value:w,_ignoreCase:x=!0,data:E}=m;if(g==="attribute")y==="equals"?l=s.getAttribute(b)===w:y==="start"?l=!!((u=s.getAttribute(b))!=null&&u.startsWith(w)):y==="end"?l=!!((c=s.getAttribute(b))!=null&&c.endsWith(w)):y==="element"?b==="class"?l=s.classList.contains(w):l=!!((f=s.getAttribute(b))!=null&&f.includes(w)):y==="exists"?l=s.hasAttribute(b):y==="any"?l=!!((p=s.getAttribute(b))!=null&&p.includes(w)):console.warn("Unknown CSS selector action",y);else if(g==="tag")l=s.tagName===b.toUpperCase();else if(g==="universal")l=!0;else if(g==="pseudo"){if(b==="not"){let S=!0;E.forEach(C=>{o(s,C)||(S=!1)}),l=!S}}else console.warn("Unknown CSS selector type",g,t,a);if(!l)break}return l};if(o(e,r))return!0}return!1}var Wj=Symbol.for("nodejs.util.inspect.custom"),G8={fontWeight:"bold"},X8={fontStyle:"italic"},Y8={backgroundColor:"rgb(255, 250, 165)"},J8={textDecorations:"underline"},q1={textDecorations:"line-through"},jj={b:G8,strong:G8,em:X8,i:X8,mark:Y8,u:J8,a:J8,s:q1,del:q1,ins:Y8,strike:q1};function Z8(t){return t.toLowerCase().replace(/[^a-z0-9]+(.)/gi,(e,n)=>n.toUpperCase())}var pi=class Uh{constructor(){this.append=this.appendChild,this._parentNode=null,this._childNodes=[]}get nodeType(){return console.error("Subclasses should define nodeType!"),0}get nodeName(){return console.error("Subclasses should define nodeName!"),""}get nodeValue(){return null}cloneNode(e=!1){const n=new this.constructor;return e&&(n._childNodes=this._childNodes.map(r=>r.cloneNode(!0)),n._fixChildNodesParent()),n}_fixChildNodesParent(){this._childNodes.forEach(e=>e._parentNode=this)}insertBefore(e,n){if(e!==n){let r=n?this._childNodes.indexOf(n):0;r<0&&(r=0),this._childNodes.splice(r,0,e),this._fixChildNodesParent()}}appendChild(e){if(e!=null){if(e===this){console.warn("Cannot appendChild to self");return}if(e instanceof G1&&console.warn("No defined how to append a document to a node!",e),e instanceof K1)for(const n of[...e._childNodes])this.appendChild(n);else if(Array.isArray(e))for(const n of[...e])this.appendChild(n);else if(e instanceof Uh)e.remove(),this._childNodes.push(e);else try{const n=typeof e=="string"?e:JSON.stringify(e,null,2);this._childNodes.push(new Cl(n))}catch(n){console.error(`The data ${e} to be added to ${this.render()} is problematic: ${n}`)}this._fixChildNodesParent()}}removeChild(e){const n=this._childNodes.indexOf(e);n>=0&&(e._parentNode=null,this._childNodes.splice(n,1),this._fixChildNodesParent())}remove(){var e;return(e=this==null?void 0:this.parentNode)==null||e.removeChild(this),this}replaceChildren(...e){this._childNodes=e.map(n=>typeof n=="string"?new Cl(n):n.remove()),this._fixChildNodesParent()}replaceWith(...e){const n=this._parentNode;if(n){const r=this._indexInParent();r>=0&&(e=e.map(o=>typeof o=="string"?new Cl(o):o.remove()),n._childNodes.splice(r,1,...e),this._parentNode=null,n._fixChildNodesParent())}}_indexInParent(){return this._parentNode?this._parentNode.childNodes.indexOf(this):-1}get parentNode(){return this._parentNode}get childNodes(){return this._childNodes||[]}get children(){return this._childNodes||[]}get firstChild(){return this._childNodes[0]}get lastChild(){return this._childNodes[this._childNodes.length-1]}get nextSibling(){const e=this._indexInParent();return e!=null&&this.parentNode.childNodes[e+1]||null}get previousSibling(){const e=this._indexInParent();return e>0&&this.parentNode.childNodes[e-1]||null}flatten(){const e=[];this instanceof uo&&e.push(this);for(const n of this._childNodes)e.push(...n.flatten());return e}flattenNodes(){const e=[];e.push(this);for(const n of this._childNodes)e.push(...n.flattenNodes());return e}render(){return""}get textContent(){return this._childNodes.map(e=>e.textContent).join("")}set textContent(e){this._childNodes=[],e&&this.appendChild(new Cl(e.toString()))}contains(e){return e===this?!0:this._childNodes.some(n=>n.contains(e))}get ownerDocument(){var e;return this.nodeType===Uh.DOCUMENT_NODE||this.nodeType===Uh.DOCUMENT_FRAGMENT_NODE?this:(e=this==null?void 0:this._parentNode)==null?void 0:e.ownerDocument}toString(){return`${this.nodeName}`}[Wj](){return`${this.constructor.name} "${this.render()}"`}};pi.ELEMENT_NODE=1,pi.TEXT_NODE=3,pi.CDATA_SECTION_NODE=4,pi.PROCESSING_INSTRUCTION_NODE=7,pi.COMMENT_NODE=8,pi.DOCUMENT_NODE=9,pi.DOCUMENT_TYPE_NODE=10,pi.DOCUMENT_FRAGMENT_NODE=11;var ls=pi,Cl=class extends ls{get nodeType(){return ls.TEXT_NODE}get nodeName(){return"#text"}get nodeValue(){return this._text||""}get textContent(){return this.nodeValue}constructor(t=""){super(),this._text=t}render(){var e;const t=(e=this.parentNode)==null?void 0:e.tagName;return t==="SCRIPT"||t==="STYLE"?this._text:j1(this._text)}cloneNode(t=!1){const e=super.cloneNode(t);return e._text=this._text,e}},Q8=class extends ls{getElementById(t){return this.flatten().find(e=>e._attributes.id===t)}getElementsByClassName(t){return this.flatten().filter(e=>e.classList.contains(t))}matches(t){return Uj(t,this)}querySelectorAll(t){return this.flatten().filter(e=>e.matches(t))}querySelector(t){return this.flatten().find(e=>e.matches(t))}parent(t){var e;return this.matches(t)?this:this.parentNode==null?null:(e=this.parentNode)==null?void 0:e.parent(t)}handle(t,e){let n=0;for(const r of this.querySelectorAll(t))e(r,n++)}},uo=class extends Q8{get nodeType(){return ls.ELEMENT_NODE}get nodeName(){return this._nodeName}constructor(t="div",e={}){super(),this._originalTagName=t,this._nodeName=(t||"").toUpperCase(),this._attributes=e||{}}cloneNode(t=!1){const e=super.cloneNode(t);return e._originalTagName=this._originalTagName,e._nodeName=this._nodeName,e._attributes=Object.assign({},this._attributes),e}get attributes(){return Object.entries(this._attributes).map(([t,e])=>({name:t,value:e}))}get attributesObject(){return{...this._attributes}}_findAttributeName(t){const e=t.toLowerCase();return Object.keys(this._attributes).find(n=>e===n.toLowerCase())||null}setAttribute(t,e){this.removeAttribute(t),this._attributes[t]=e,this._styles=void 0,this._dataset=void 0}getAttribute(t){const e=this._findAttributeName(t),n=e?this._attributes[e]:null;return n==null?null:typeof n=="string"?n:""}removeAttribute(t){this._findAttributeName(String(t))&&delete this._attributes[t]}hasAttribute(t){const e=this._findAttributeName(t);return e?this._attributes[e]!=null:!1}get style(){if(this._styles==null){const t={};let e=0;const n=this.getAttribute("style");if(n){let r;const o=/\s*([\w-]+)\s*:\s*((url\(.*?\)[^;]*|[^;]+))/gi;for(;r=o.exec(n);){++e;const s=r[1],a=r[2].trim();t[s]=a,t[Z8(s)]=a}}this._styles={get length(){return e},getPropertyValue(r){return t[r]},...jj[this.tagName.toLowerCase()],...t}}return this._styles}get dataset(){if(this._dataset==null){const t={};for(const[e,n]of Object.entries(this._attributes))e.startsWith("data-")&&(t[e.slice(5)]=n,t[Z8(e.slice(5))]=n);this._dataset=t}return this._dataset}get tagName(){return this._nodeName}setTagName(t){this._nodeName=t.toUpperCase()}get id(){return this._attributes.id||null}set id(t){t==null?delete this._attributes.id:this._attributes.id=t}get src(){return this._attributes.src}set src(t){t==null?delete this._attributes.src:this._attributes.src=t}getElementsByTagName(t){t=t.toUpperCase();const e=this.flatten();return t!=="*"?e.filter(n=>n.tagName===t):e}setInnerHTML(t){}get innerHTML(){return this._childNodes.map(t=>t.render(bp)).join("")}set innerHTML(t){this.setInnerHTML(t)}get outerHTML(){return this.render(vp)}get className(){return this._attributes.class||""}set className(t){Array.isArray(t)?t=t.filter(e=>!!e).join(" "):typeof t=="object"&&(t=Object.entries(t).filter(([e,n])=>!!n).map(([e,n])=>e).join(" ")),this._attributes.class=t}get classList(){const t=String(this.className??"").trim().split(/\s+/g)||[];return{contains(e){return t.includes(e)},add:e=>{t.includes(e)||(t.push(e),this.className=t)},remove:e=>{const n=t.indexOf(e);n>=0&&(t.splice(n,1),this.className=t)}}}render(t=vp){return t(this._originalTagName||this.tagName,this._attributes,this._childNodes.map(e=>e.render(t)).join(""))}},N8=class B_ extends ls{get nodeName(){return super.nodeName}get nodeValue(){return super.nodeValue}get nodeType(){return B_.DOCUMENT_TYPE_NODE}render(){return"<!DOCTYPE html>"}},K1=class I_ extends Q8{get nodeType(){return ls.DOCUMENT_FRAGMENT_NODE}get nodeName(){return"#document-fragment"}render(e=vp){return this._childNodes.map(n=>n.render(e)||[]).join("")}get innerHTML(){return this._childNodes.map(e=>e.render(bp)).join("")}createElement(e,n={}){return new uo(e,n)}createDocumentFragment(){return new I_}createTextNode(e){return new Cl(e)}},G1=class extends K1{get nodeType(){return ls.DOCUMENT_NODE}get nodeName(){return"#document"}get documentElement(){return this.firstChild}render(t=vp){let e=super.render(t);return this.docType&&(e=this.docType.render()+e),e}},eE=class extends G1{constructor(t=!1){if(super(),this.docType=new N8,!t){const e=new uo("html"),n=new uo("body"),r=new uo("head"),o=new uo("title");e.appendChild(r),r.appendChild(o),e.appendChild(n),this.appendChild(e)}}get body(){let t=this.querySelector("body");if(!t){let e=this.querySelector("html");e||(e=new uo("html"),this.appendChild(e)),t=new uo("body"),e.appendChild(e)}return t}get title(){var t;return((t=this.querySelector("title"))==null?void 0:t.textContent)||""}set title(t){const e=this.querySelector("title");e&&(e.textContent=t)}get head(){let t=this.querySelector("head");if(!t){let e=this.querySelector("html");e||(e=new uo("html"),this.appendChild(e)),t=new uo("head"),e.insertBefore(e)}return t}};function qj(){return new G1}function Kj(){return new eE}var tE=qj();zj({document:tE});var Gj={},Xj=Gj.hasOwnProperty;function nE(t,e){return Xj.call(t,e)}var rE=["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr","command"];function oE(t,e,n={},r){const o=!(typeof r=="string"&&r===""||Array.isArray(r)&&(r.length===0||r.length===1&&r[0]==="")||r==null),s=[];if(e=e.replace(/__/g,":"),e!=="noop"&&e!==""){e!=="cdata"?s.push(`<${e}`):s.push("<![CDATA[");for(let a in n)if(a&&nE(n,a)){const l=n[a];if(a==="html")continue;a.toLowerCase()==="classname"&&(a="class"),a=a.replace(/__/g,":"),l===!0?s.push(` ${a}`):a==="style"&&typeof l=="object"?s.push(` ${a}="${Object.keys(l).filter(u=>l[u]!=null).map(u=>{let c=l[u];return c=typeof c=="number"?`${c}px`:c,`${u.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}:${c}`}).join(";")}"`):l!==!1&&l!=null&&s.push(` ${a}="${j1(l.toString())}"`)}if(e!=="cdata"){if(t&&!o)return s.push(" />"),s.join("");s.push(">")}if(!t&&rE.includes(e))return s.join("")}if(o){if(typeof r=="string")s.push(r);else if(r&&r.length>0){for(let a of r)if(a!=null&&a!==!1){Array.isArray(a)||(a=[a]);for(const l of a)l.startsWith("<")&&l.endsWith(">")||e==="script"||e==="style"?s.push(l):s.push(j1(l.toString()))}}}return n.html&&s.push(n.html),e!=="noop"&&e!==""&&(e!=="cdata"?s.push(`</${e}>`):s.push("]]>")),s.join("")}function bp(t,e,...n){const{tag:r,attrs:o,children:s}=q8(t,e,n);return oE(!1,r,o,s)}var vp=oE.bind(null,!1);bp.firstLine="<!DOCTYPE html>",bp.html=!0;var Yj=/([^=\s]+)(\s*=\s*(("([^"]*)")|('([^']*)')|[^>\s]+))?/g,Jj=/^<\/([^>\s]+)[^>]*>/m,Zj=/^<([^>\s/]+)((\s+[^=>\s]+(\s*=\s*(("[^"]*")|('[^']*')|[^>\s]+))?)*)\s*(?:\/\s*)?>/m,Qj=/\s*\/\s*>\s*$/m,Nj=class{constructor(t={}){this.attrRe=Yj,this.endTagRe=Jj,this.startTagRe=Zj,this.defaults={ignoreWhitespaceText:!1},t.scanner&&(this.scanner=t.scanner),this.options=Object.assign({},this.defaults,t)}parse(t){let e=!1,n,r,o;for(;t.length;){if(t.substring(0,4)==="<!--")n=t.indexOf("-->"),n!==-1?(this.scanner.comment(t.substring(4,n)),t=t.substring(n+3),e=!1):e=!0;else if(t.substring(0,2)==="</")r=this.endTagRe.exec(t),r?(t=RegExp.rightContext,e=!1,this.parseEndTag(RegExp.lastMatch,r[1])):e=!0;else if(t.charAt(0)==="<")if(r=this.startTagRe.exec(t),r){t=RegExp.rightContext,e=!1;const s=this.parseStartTag(RegExp.lastMatch,r[1],r);(s==="script"||s==="style")&&(n=t.search(new RegExp(`</${s}`,"i")),n!==-1?(this.scanner.characters(t.substring(0,n)),t=t.substring(n),e=!1):e=!0)}else e=!0;if(e){n=t.indexOf("<");let s=n;n===0&&(n=t.substring(1).indexOf("<"),s=s+1),n===-1?(o=t,t=""):(o=t.substring(0,s),t=t.substring(s)),(!this.options.ignoreWhitespaceText||!/^\s*$/.test(o))&&this.scanner.characters(o)}e=!0,r=null}}parseStartTag(t,e,n){const r=Qj.test(t);let o=n[2];r&&(o=o.replace(/\s*\/\s*$/,""));const s=this.parseAttributes(e,o);return this.scanner.startElement(e,s,r,n[0]),e.toLocaleLowerCase()}parseEndTag(t,e){this.scanner.endElement(e)}parseAttributes(t,e){const n={};return e.replace(this.attrRe,(...r)=>{const[o,s,a,l,u,c,f,p]=r;n[s]=p??c??l??!0}),n}};function eq(t){if(typeof t!="string")throw console.error("parseHTML requires string, found",t),new Error("parseHTML requires string");const e=t.indexOf("<!")===0?new eE(!0):new K1,n=[e];return new Nj({scanner:{startElement(o,s,a){if(o.toLowerCase()==="!doctype"){e.docType=new N8;return}for(const c in s)if(nE(s,c)){const f=s[c];typeof f=="string"&&(s[c]=j8(f))}const u=n[n.length-1];if(u){const c=tE.createElement(o,s);u.appendChild(c),rE.includes(o.toLowerCase())||a||n.push(c)}},endElement(o){n.pop()},characters(o){var a;o=j8(o);const s=n[n.length-1];((a=s==null?void 0:s.lastChild)==null?void 0:a.nodeType)===ls.TEXT_NODE?s.lastChild._text+=o:s&&s.appendChild(new Cl(o))},comment(o){}}}).parse(t),e}uo.prototype.setInnerHTML=function(t){const e=eq(t);this._childNodes=e._childNodes,this._fixChildNodesParent()};function tq(t,e,n){return vo.fromSchema(e).serializeFragment(t.content,{document:Kj()}).render()}function nq(t,e){const n=Zr.fromJSON(e,t);return tq(n,e)}function rq(t,e){const n=document.getElementById(t.attrs.id)??X1.getElementById(t.attrs.id);if(!n)return null;const r=iE(n),{lastChild:o}=t,{childCount:s}=t,a=t.content.content.slice(0,s);if(!o)return!1;o.isText&&a.push(e.text("gg"));const l=nq(oq(t.type.create(t.attrs,a,t.marks)),e);return sq(l,t.attrs.id,!1)>r}function oq(t){return{type:"doc",content:[t.toJSON()]}}let iq=null,X1=null;const Y1=new Map;function sq(t,e,n=!0){if(n&&Y1.has(t))return Y1.get(t);const r=X1.getElementById("computeddiv");if(r){r.innerHTML=`<p>&nbsp;</p>${t}`;const o=X1.getElementById(e),{height:s}=iE(o);return r.innerHTML="&nbsp;",n&&Y1.set(t,s),s}return 0}function iE(t){const e=window.getComputedStyle(t)||iq.contentWindow.getComputedStyle(t),n=e.getPropertyValue("margin-top"),r=e.getPropertyValue("margin-bottom"),o=parseFloat(n)+parseFloat(r),{height:s}=t.getBoundingClientRect();return{margin:o,height:o+t.offsetHeight+parseFloat(e.borderWidth)}}function J1(){return li(10)}const yp="paragraph",Hr="page",sE="Extend",El="Node",aq=El+sE,lq="CC",Z1="heading",wp="bulletList",Q1="listItem",aE="taskList",uq="taskItem",xp="orderedList",us="table",N1="tableHeader",eb="tableRow",cq="tableCell",tb="column",sa="columns",nb="textBox",cs="image",ds="imageUpload",dq="iframe",fq="file",rb="codeBlock",ob="blockquote",pq="audio",hq="toc",lE="video",mq="horizontalrule",ib="pagination",gq=[us,xp,wp,aE],bq=[lE,cs],uc="link",vq="placeholder",yq="focus",wq="text",xq="text-bubble",Cq="gapCursor",Eq="dropCursor",Sq="characterCount",kq="hardBreak",_q="textStyle",Tq="selection",uE="superText",sb="configPlan",Aq="fontSize",Oq="fontFamily",Mq="bold",Bq="italic",Iq="underline",Rq="strike",Lq="color",Pq="highlight",Dq="moreMark",Vq="textAlign",Fq="indent",$q="lineHeight",zq="painter",Hq="clear",cc="spellchecker",cE="fontSizeIncreaseDecrease",Uq=Object.freeze(Object.defineProperty({__proto__:null,AUDIO:pq,BLOCKQUOTE:ob,BOLD:Mq,BULLETLIST:wp,CASSIE_BLOCK:El,CASSIE_BLOCK_EXTEND:aq,CC:lq,CHARACTER_COUNT:Sq,CLEAR:Hq,CODE_BLOCK:rb,COLOR:Lq,COLUMN:tb,COLUMNS:sa,CONFIG_PLAN:sb,DROP_CURSOR:Eq,EXTEND:sE,FILE:fq,FOCUS:yq,FONTSIZEINCREASEDECREASE:cE,FONT_FAMILY:Oq,FONT_SIZE:Aq,GAP_CURSOR:Cq,HARD_BREAK:kq,HEADING:Z1,HIGHLIGHT:Pq,HORIZONTALRULE:mq,IFRAME:dq,IMAGE:cs,IMAGE_UPLOAD:ds,INDENT:Fq,ITALIC:Bq,LINE_HEIGHT:$q,LINK:uc,LISTITEM:Q1,LIST_MEDIA:bq,LIST_TYPE:gq,MORE_MARK:Dq,ORDEREDLIST:xp,PAGE:Hr,PAGEBREAK:ib,PAINTER:zq,PARAGRAPH:yp,PLACEHOLDER:vq,SELECTION:Tq,SPELLCHECKER:cc,STRIKE:Rq,SUPER_TEXT:uE,TABLE:us,TABLEHEADER:N1,TABLE_CELL:cq,TABLE_ROW:eb,TASKITEM:uq,TASKLIST:aE,TEXT:wq,TEXT_ALIGN:Vq,TEXT_BOX:nb,TEXT_BUBBLE:xq,TEXT_STYLE:_q,TOC:hq,UNDERLINE:Iq,VIDEO:lE},Symbol.toStringTag,{value:"Module"})),ab=i.defineComponent({__name:"ContextMenu",props:{dir:{},modal:{type:Boolean}},emits:["update:open"],setup(t,{emit:e}){const o=Pt(t,e);return(s,a)=>(i.openBlock(),i.createBlock(i.unref(UL),i.normalizeProps(i.guardReactiveProps(i.unref(o))),{default:i.withCtx(()=>[i.renderSlot(s.$slots,"default")]),_:3},16))}}),lb=i.defineComponent({__name:"ContextMenuContent",props:{forceMount:{type:Boolean},loop:{type:Boolean},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},sticky:{},hideWhenDetached:{type:Boolean},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","closeAutoFocus"],setup(t,{emit:e}){const n=t,r=e,o=i.computed(()=>{const{class:a,...l}=n;return l}),s=Pt(o,r);return(a,l)=>(i.openBlock(),i.createBlock(i.unref(jL),null,{default:i.withCtx(()=>[i.createVNode(i.unref(qL),i.mergeProps(i.unref(s),{class:i.unref(Te)("z-50 min-w-32 overflow-hidden rounded-md border bg-ed-popover p-1 text-ed-popover-foreground shadow-md animate-in fade-in-80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n.class)}),{default:i.withCtx(()=>[i.renderSlot(a.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),ub=i.defineComponent({__name:"ContextMenuItem",props:{disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{},inset:{type:Boolean}},emits:["select"],setup(t,{emit:e}){const n=t,r=e,o=i.computed(()=>{const{class:a,...l}=n;return l}),s=Pt(o,r);return(a,l)=>(i.openBlock(),i.createBlock(i.unref(KL),i.mergeProps(i.unref(s),{class:i.unref(Te)("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-ed-accent focus:text-ed-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n.inset&&"pl-8",n.class)}),{default:i.withCtx(()=>[i.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),cb=i.defineComponent({__name:"ContextMenuTrigger",props:{disabled:{type:Boolean},asChild:{type:Boolean},as:{}},setup(t){const n=Gn(t);return(r,o)=>(i.openBlock(),i.createBlock(i.unref(WL),i.normalizeProps(i.guardReactiveProps(i.unref(n))),{default:i.withCtx(()=>[i.renderSlot(r.$slots,"default")]),_:3},16))}}),Cp=i.defineComponent({__name:"Dialog",props:{open:{type:Boolean},defaultOpen:{type:Boolean},modal:{type:Boolean}},emits:["update:open"],setup(t,{emit:e}){const o=Pt(t,e);return(s,a)=>(i.openBlock(),i.createBlock(i.unref(IR),i.normalizeProps(i.guardReactiveProps(i.unref(o))),{default:i.withCtx(()=>[i.renderSlot(s.$slots,"default")]),_:3},16))}}),Ep=i.defineComponent({__name:"DialogContent",props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{},class:{},isOverlayTransparent:{type:Boolean}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:e}){const n=t,r=e,o=i.computed(()=>{const{isOverlayTransparent:a,class:l,...u}=n;return u}),s=Pt(o,r);return(a,l)=>(i.openBlock(),i.createBlock(i.unref(G0),null,{default:i.withCtx(()=>[i.createVNode(i.unref(N0),{class:i.normalizeClass(i.unref(Te)("fixed inset-0 z-[60] bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a.isOverlayTransparent&&"bg-transparent"))},null,8,["class"]),i.createVNode(i.unref(tL),i.mergeProps(i.unref(s),{class:i.unref(Te)("fixed left-1/2 top-1/2 z-[60] grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border bg-ed-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",n.class)}),{default:i.withCtx(()=>[i.renderSlot(a.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),db=i.defineComponent({__name:"DialogFooter",props:{class:{}},setup(t){const e=t;return(n,r)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(i.unref(Te)("flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-x-2",e.class))},[i.renderSlot(n.$slots,"default")],2))}}),Sp=i.defineComponent({__name:"DialogHeader",props:{class:{}},setup(t){const e=t;return(n,r)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(i.unref(Te)("flex flex-col gap-y-1.5 text-center sm:text-left",e.class))},[i.renderSlot(n.$slots,"default")],2))}}),kp=i.defineComponent({__name:"DialogClose",props:{asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,r)=>(i.openBlock(),i.createBlock(i.unref(rL),i.normalizeProps(i.guardReactiveProps(e)),{default:i.withCtx(()=>[i.renderSlot(n.$slots,"default")]),_:3},16))}}),_p=i.defineComponent({__name:"DialogTitle",props:{asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,n=i.computed(()=>{const{class:o,...s}=e;return s}),r=Gn(n);return(o,s)=>(i.openBlock(),i.createBlock(i.unref(oL),i.mergeProps(i.unref(r),{class:i.unref(Te)("text-lg font-semibold leading-none tracking-tight",e.class)}),{default:i.withCtx(()=>[i.renderSlot(o.$slots,"default")]),_:3},16,["class"]))}}),Wq={class:"sr-only"},jq={class:"m-2.5 p-2.5 space-y-2.5"},qq=i.defineComponent({__name:"SuperInputDialogAlert",props:{open:{type:Boolean}},emits:["close"],setup(t,{emit:e}){const n=e,{t:r}=Tt(),o=wn(),s=t,a=i.computed(()=>r(o.textAlert.value||"editor.alert")),l=i.reactive({x:0,y:0}),u=i.ref(!1),c={x:0,y:0},f=()=>{n("close")},p=b=>{u.value=!0,c.x=b.clientX-l.x,c.y=b.clientY-l.y,document.addEventListener("mousemove",m),document.addEventListener("mouseup",g)},m=b=>{u.value&&(l.x=b.clientX-c.x,l.y=b.clientY-c.y)},g=()=>{u.value=!1,document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",g)};return i.watch(()=>s.open,async b=>{if(b){await i.nextTick();const y=document.querySelector(".draggable-dialog");if(y){const{width:w,height:x}=y.getBoundingClientRect(),E=window.innerWidth,S=window.innerHeight;l.x=(E-w)/2+250,l.y=(S-x)/2-50}}},{immediate:!0}),i.onUnmounted(()=>{document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",g)}),(b,y)=>{const w=_p,x=kp,E=Sp,S=db,C=Ep,_=Cp;return i.openBlock(),i.createBlock(_,{open:b.open},{default:i.withCtx(()=>[i.createVNode(i.unref(G0),null,{default:i.withCtx(()=>[i.createVNode(i.unref(N0),{class:"!pointer-events-none bg-black/30"}),i.createVNode(C,{"is-overlay-transparent":"",class:"p-0 gap-0 !animate-none !transition-none","as-child":""},{default:i.withCtx(()=>[i.createElementVNode("div",{class:"draggable-dialog fixed z-[70] pointer-events-auto",style:i.normalizeStyle({transform:`translate(${i.unref(l).x}px, ${i.unref(l).y}px)`,top:"0px",left:"0px"})},[i.createVNode(E,{class:"bg-blue-500 text-white p-2.5 rounded-t-[5px] cursor-move",onMousedown:i.withModifiers(p,["prevent"])},{default:i.withCtx(()=>[i.createVNode(w,null,{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(r)("editor.alertConfirm")),1)]),_:1}),i.createVNode(x,{class:"absolute right-3 top-3 text-white",onClick:f},{default:i.withCtx(()=>[i.createVNode(i.unref(Df),{class:"w-5 h-5"}),i.createElementVNode("span",Wq,i.toDisplayString(b.$t("editor.close")),1)]),_:1})]),_:1}),i.createElementVNode("div",jq,i.toDisplayString(i.unref(a)),1),i.createVNode(S,{class:"sm:justify-center pb-3.5 pt-1"},{default:i.withCtx(()=>[i.createVNode(yn,{as:"button",variant:"default",class:"bg-blue-500 hover:bg-blue-500/90",onClick:f},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(r)("editor.alertYes")),1)]),_:1})]),_:1})],4)]),_:1})]),_:1})]),_:1},8,["open"])}}}),dE=i.defineComponent({__name:"Checkbox",props:{defaultChecked:{type:Boolean},checked:{type:[Boolean,String]},disabled:{type:Boolean},required:{type:Boolean},name:{},value:{},id:{},asChild:{type:Boolean},as:{},class:{}},emits:["update:checked"],setup(t,{emit:e}){const n=t,r=e,o=i.computed(()=>{const{class:a,...l}=n;return l}),s=Pt(o,r);return(a,l)=>(i.openBlock(),i.createBlock(i.unref(uL),i.mergeProps(i.unref(s),{class:i.unref(Te)("peer h-5 w-5 shrink-0 rounded-sm border border-ed-border shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ed-ring disabled:cursor-not-allowed disabled:opacity-50 text-ed-blue",n.class)}),{default:i.withCtx(()=>[i.createVNode(i.unref(cL),{class:"flex h-full w-full items-center justify-center"},{default:i.withCtx(()=>[i.renderSlot(a.$slots,"default",{},()=>[i.createVNode(i.unref(Jg),{icon:"fa-solid:check"})])]),_:3})]),_:3},16,["class"]))}}),fb=i.defineComponent({__name:"SimpleEditor",props:{modelValue:{default:""},parentEditor:{},isReadOnly:{type:Boolean}},emits:["update:modelValue"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.inject("isMobile",!1),a=i.inject("minCharSuperInput",0),l=[F8,P8,V8,L8,D8.configure({placeholder:"수퍼를 입력하세요"})],u=i.ref(!0),c=i.computed(()=>{var _;return(_=r.parentEditor)==null?void 0:_.extensionManager.extensions.find(T=>T.name==="spellchecker")}),f=i.computed(()=>{var _,T,A,L,I,M,W;return rS.configure({proofreader:new zS({api:(T=(_=c.value)==null?void 0:_.options.proofreader)==null?void 0:T.api,limit:(L=(A=c.value)==null?void 0:A.options.proofreader)==null?void 0:L.limit,transfer:(M=(I=c.value)==null?void 0:I.options.proofreader)==null?void 0:M.transfer,enabled:u.value}),uiStrings:(W=c.value)==null?void 0:W.options.uiStrings})}),p=new ei({enablePasteRules:!1,enableInputRules:!1,content:r.modelValue,extensions:l.concat(f.value),editable:!r.isReadOnly,autofocus:!0,onUpdate:({editor:_})=>{o("update:modelValue",_.getHTML())},parseOptions:{preserveWhitespace:"full"}});i.watch(()=>r.isReadOnly,_=>{var T;p.setEditable(!_),(T=p==null?void 0:p.commands)!=null&&T.setIsEnableSuggestion&&p.commands.setIsEnableSuggestion(!_)},{immediate:!0});function m(_){const{view:T}=p,{from:A}=T.state.selection;p.commands.insertContentAt(A,_),p.commands.focus()}function g(){var _;u.value=!u.value,p.commands.handleActiveSpellCheck(u.value),(_=p==null?void 0:p.commands)!=null&&_.setIsEnableSuggestion&&p.commands.setIsEnableSuggestion(u.value)}const{contentInner:b,measuredMinWidth:y,measure:w}=Dd({minChars:a,fontSize:"",editor:p});i.watch(()=>r.modelValue,()=>{w()});const x=i.computed(()=>s?{}:{width:`${y.value}px`}),S=document.createElement("canvas").getContext("2d");function C(){if(!y.value||!(b.value instanceof Element)||!S)return;const _=p.getText({blockSeparator:`
289
289
  `}),T=getComputedStyle(b.value);S.font=T.font;const A=20,L=()=>Math.max(0,(y.value||0)-A);function I(K,se){let z=1,V=K.length,P=0;for(;z<=V;){const q=Math.floor((z+V)/2);S.measureText(K.slice(0,q)).width<=se?(P=q,z=q+1):V=q-1}return P}let M="";const W=[];for(const K of _){if(K===`
290
- `){W.push(M),M="";continue}if(M+=K,S.measureText(M).width>L())for(;S.measureText(M).width>L();){const se=I(M,L());se<=0?(W.push(M.charAt(0)),M=M.slice(1)):(W.push(M.slice(0,se)),M=M.slice(se))}}return W.push(M),W.map(K=>`<p>${K}</p>`).join("")}return e({insertSpecialCharater:m,isChecked:u,toggleSpellCheck:g,wrapText:C}),(_,T)=>(i.openBlock(),i.createElementBlock("div",{ref_key:"contentInner",ref:b,style:i.normalizeStyle(i.unref(x)),class:i.normalizeClass(i.unref(Te)("h-40 overflow-y-auto border focus-within:border-ed-input-focus rounded-[3px] p-2.5",i.unref(s)&&"h-20 border-ed-gray rounded-lg",_.isReadOnly&&"border-none"))},[i.createVNode(i.unref(So),{id:"editor-panel",editor:i.unref(p),class:i.normalizeClass(i.unref(Te)("vdc-editor relative h-full"))},null,8,["editor","class"])],6))}}),Kq={class:"sr-only"},Gq={class:"grid m-2.5 p-2.5 gap-y-2.5 rounded border border-gray-200"},Xq={class:"grid grid-cols-[70px,1fr] gap-x-2"},Yq={class:"flex gap-x-7"},Jq={class:"flex items-center space-x-2 text-xs font-normal"},Zq={for:"spellcheck",class:"select-none whitespace-nowrap"},Qq={class:"flex gap-x-1"},Nq={class:"grid grid-cols-[70px,1fr] gap-x-2"},eK={class:"text-right text-sm p-2"},tK={class:"grid grid-cols-[70px,1fr] gap-x-2"},dc=i.defineComponent({__name:"SuperInputDialog",props:{editor:{},open:{type:Boolean},superTextInit:{},superTextElementId:{}},emits:["close","save"],setup(t,{emit:e}){var W,j;const n=e,r=t,{t:o}=Tt(),s=i.ref(""),a=i.ref(""),l=i.ref(null),u=i.ref(!1),c=i.reactive({x:0,y:0}),f=i.ref(!1),p={x:0,y:0},m=i.ref(!1),g=i.ref(!1),b=K=>{f.value=!0,p.x=K.clientX-c.x,p.y=K.clientY-c.y,document.addEventListener("mousemove",y),document.addEventListener("mouseup",w)},y=K=>{f.value&&(c.x=K.clientX-p.x,c.y=K.clientY-p.y)},w=()=>{f.value=!1,document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",w)};i.watch(()=>r.open,async K=>{if(K){g.value=!1,r.superTextInit&&(s.value=r.superTextInit,r.superTextElementId&&(a.value=r.superTextElementId)),await i.nextTick();const se=document.querySelector(".draggable-dialog");if(se){const{width:z,height:V}=se.getBoundingClientRect(),P=window.innerHeight;c.x=0,c.y=(P-V)/2}}},{immediate:!0});const x=()=>{n("close"),s.value="",a.value="",u.value=!1},E=()=>{s.value=l.value.wrapText(),a.value="",g.value?m.value=!0:n("close"),n("save",s.value),s.value=""},S=()=>{m.value=!1,n("close")},C=(j=(W=r.editor)==null?void 0:W.extensionManager.extensions.find(K=>K.name==="superText"))==null?void 0:j.options.specialCharModal,_=gt.useLocalStorage("recentSpecialChars",[]),T=K=>{if(!K)return;const se=(_.value??[]).filter(z=>z!==K);se.unshift(K),_.value=se.slice(0,5)},A=K=>{var se;(se=l.value)==null||se.insertSpecialCharater(K)},L=(K,se)=>{var z;se&&((z=l.value)==null||z.insertSpecialCharater(K),T(K))},I=i.computed(()=>{var K;return(K=l.value)==null?void 0:K.isChecked}),M=()=>{var K;(K=l.value)==null||K.toggleSpellCheck()};return i.onUnmounted(()=>{document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",w)}),i.watch(s,K=>{!r.superTextElementId||r.superTextElementId===""||(g.value=K!==(r.superTextInit??""))}),(K,se)=>{const z=_p,V=kp,P=Sp,q=db,J=Ep,Y=Cp,ne=qq;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createVNode(Y,{open:K.open},{default:i.withCtx(()=>[i.createVNode(i.unref(G0),null,{default:i.withCtx(()=>[i.createVNode(i.unref(N0),{class:"!pointer-events-none bg-black/30"}),i.createVNode(J,{"is-overlay-transparent":"",class:"p-0 gap-0 !animate-none !transition-none max-w-max","as-child":""},{default:i.withCtx(()=>{var we,xe,Ve;return[i.createElementVNode("div",{class:"draggable-dialog fixed z-[70] pointer-events-auto",style:i.normalizeStyle({transform:`translate(${c.x}px, ${c.y}px)`,top:"0px",left:"auto",right:"15px"})},[i.createVNode(P,{class:"bg-blue-500 text-white p-2.5 rounded-t-[5px] cursor-move",onMousedown:i.withModifiers(b,["prevent"])},{default:i.withCtx(()=>[i.createVNode(z,null,{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("editor.superinput")),1)]),_:1}),i.createVNode(V,{class:"absolute right-3 top-3 text-white",onClick:x},{default:i.withCtx(()=>[i.createVNode(i.unref(Df),{class:"w-5 h-5"}),i.createElementVNode("span",Kq,i.toDisplayString(K.$t("editor.close")),1)]),_:1})]),_:1}),i.createElementVNode("div",Gq,[i.createElementVNode("div",Xq,[se[4]||(se[4]=i.createElementVNode("label",null," ",-1)),i.createElementVNode("div",Yq,[i.createVNode(yn,{class:"text-[#65558F] bg-[#ECE6F0] hover:bg-[#ECE6F0]/90 shadow text-xs rounded font-normal h-[25px] px-3",onClick:se[0]||(se[0]=Se=>u.value=!0)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("editor.insert.symbol")),1)]),_:1}),i.createElementVNode("div",Jq,[i.createVNode(dE,{id:"spellcheck",checked:i.unref(I),"onUpdate:checked":M},null,8,["checked"]),i.createElementVNode("label",Zq,i.toDisplayString(i.unref(o)("editor.menubar.menu.spellCheck")),1)]),i.createElementVNode("div",Qq,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref(_),Se=>(i.openBlock(),i.createBlock(yn,{key:Se,variant:"outline",size:"xs",class:"h-[25px] w-[25px] p-0",onClick:We=>A(Se)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(Se),1)]),_:2},1032,["onClick"]))),128))])]),u.value?(i.openBlock(),i.createBlock(i.resolveDynamicComponent((we=i.unref(C))==null?void 0:we.component),{key:0,"custom-class":"!z-[70] !pointer-events-auto",class:i.normalizeClass((Ve=(xe=i.unref(C))==null?void 0:xe.componentProps)==null?void 0:Ve.class),onSelectedChar:L,onClose:se[1]||(se[1]=Se=>u.value=!1)},null,40,["class"])):i.createCommentVNode("",!0)]),i.createElementVNode("div",Nq,[i.createElementVNode("label",eK,i.toDisplayString(i.unref(o)("editor.detail")),1),i.createVNode(fb,{ref_key:"simpleEditorRef",ref:l,modelValue:s.value,"onUpdate:modelValue":se[2]||(se[2]=Se=>s.value=Se),"parent-editor":K.editor,class:""},null,8,["modelValue","parent-editor"])]),i.createElementVNode("div",tK,[se[5]||(se[5]=i.createElementVNode("label",{class:"text-right text-sm p-2"},"ID",-1)),i.createVNode(dl,{modelValue:a.value,"onUpdate:modelValue":se[3]||(se[3]=Se=>a.value=Se),class:"rounded-none","default-value":a.value,disabled:""},null,8,["modelValue","default-value"])])]),i.createVNode(q,{class:"sm:justify-center pb-3.5 pt-1"},{default:i.withCtx(()=>[i.createVNode(yn,{as:"button",variant:"default",class:"bg-blue-500 hover:bg-blue-500/90",onClick:E},{default:i.withCtx(()=>[i.createVNode(i.unref(s1),{class:"w-5 h-5 mr-2"}),i.createTextVNode(" "+i.toDisplayString(i.unref(o)("editor.check")),1)]),_:1}),i.createVNode(yn,{as:"button",variant:"destructive",onClick:x},{default:i.withCtx(()=>[i.createVNode(i.unref(Df),{class:"w-5 h-5 mr-2"}),i.createTextVNode(" "+i.toDisplayString(K.$t("editor.close")),1)]),_:1})]),_:1})],4)]}),_:1})]),_:1})]),_:1},8,["open"]),i.createVNode(ne,{open:m.value,onClose:S},null,8,["open"])],64)}}}),pb=i.defineComponent({__name:"SelectContextMenu",props:{editor:{},mode:{},superTextStore:{},disabled:{type:Boolean},disableSuperInput:{type:Boolean}},setup(t,{expose:e}){const n=t,{t:r}=Tt(),o=i.ref(!1),s=i.reactive({from:0,to:0,text:""}),a=i.inject("isEditable",i.ref(!0)),l=i.inject("canEditSuper",i.ref(!0)),u=i.computed(()=>n.mode===Fe.EDITOR||n.mode===Fe.PLAIN_TEXT||!l.value||n.disableSuperInput);function c(){if(!n.editor)return"";const{from:E,to:S}=n.editor.state.selection,C=n.editor.state.doc.cut(E,S),T=vo.fromSchema(n.editor.schema).serializeFragment(C.content),A=document.createElement("div");return A.appendChild(T),A.innerHTML}const f=()=>{const{view:E}=n.editor,{from:S,to:C}=E.state.selection,_=c();s.text=_,s.from=S,s.to=C},p=()=>o.value=!o.value,m=()=>{u.value||(o.value=!0,f())},g=()=>o.value=!1,b=E=>{const S=n==null?void 0:n.superTextStore.addMoreSuperText(E);n.editor&&n.editor.commands.insertContentAt(s.from,{type:"superText",attrs:{"data-id":S,"data-text":E}}),o.value=!1,requestAnimationFrame(()=>{n.editor.commands.setTextSelection(s.from+1),n.editor.view.focus()})},y=i.ref(!1),w=async E=>{var S,C;if(E){const _=await((C=(S=n.editor).hasClipboard)==null?void 0:C.call(S));y.value=!!_}},x=()=>{if(u.value||!n.editor)return;const{view:E,state:S}=n.editor,{from:C,to:_}=S.selection;s.from=C,s.to=_,s.text="",E.dom.blur(),o.value=!0};return e({toggleDialog:p,openDialog:m,closeDialog:g}),(E,S)=>{const C=dc,_=cb,T=ub,A=lb,L=ab;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createVNode(C,{open:o.value,editor:E.editor,"super-text-init":s.text,onClose:p,onSave:b},null,8,["open","editor","super-text-init"]),i.createVNode(L,{"onUpdate:open":w},{default:i.withCtx(()=>[i.createVNode(_,{as:"template",class:"relative",disabled:i.unref(u),onDblclick:i.withModifiers(x,["prevent","stop"])},{default:i.withCtx(()=>[i.renderSlot(E.$slots,"default")]),_:3},8,["disabled"]),i.createVNode(A,null,{default:i.withCtx(()=>[E.disableSuperInput?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(T,{key:0,onSelect:m},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(r)("editor.inputSuper")),1)]),_:1})),i.unref(a)?(i.openBlock(),i.createBlock(T,{key:1,onSelect:S[0]||(S[0]=I=>{var M;return(M=E.editor)==null?void 0:M.commands.cutContent()})},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(r)("editor.cut")),1)]),_:1})):i.createCommentVNode("",!0),i.unref(a)?(i.openBlock(),i.createBlock(T,{key:2,onSelect:S[1]||(S[1]=I=>{var M;return(M=E.editor)==null?void 0:M.commands.copyContent()})},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(r)("editor.copy")),1)]),_:1})):i.createCommentVNode("",!0),i.unref(a)?(i.openBlock(),i.createBlock(T,{key:3,disabled:!y.value,onSelect:S[2]||(S[2]=I=>{var M;return(M=E.editor)==null?void 0:M.commands.pasteContent()})},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(r)("editor.paste")),1)]),_:1},8,["disabled"])):i.createCommentVNode("",!0)]),_:1})]),_:3})],64)}}});var ir=(t=>(t.TOGGLE_SUPER_TEXT="toggle-super-text",t.SUPER_TEXT_UPDATE_POSITION="SUPER_TEXT_UPDATE_POSITION",t.RENDER_SUPER_TEXT="RENDER_SUPER_TEXT",t.SUPER_VIEW_PAGE="SUPER_VIEW_PAGE",t.INCREASE_DECREASE_FONTSIZE="increase-decrease-fontsize",t))(ir||{});const nK={id:"editor-panel",class:"flex relative w-full h-full"},rK=To(i.defineComponent({__name:"PageNode",props:zs,setup(t){const{state:e,page:n,superTextStore:r}=wn(),{size:o,pagination:s,margin:a}=n.value,l=i.ref(null),u=i.ref(t.node.attrs.viewSuperTextArea),c=i.computed(()=>u.value&&t.editor.storage.page.mode!=="editor"),f=i.computed(()=>t.editor.storage.page.mode===Fe.REPORT),{width:p,height:m}=o,g=i.computed(()=>s?`calc(${m} - ${(a==null?void 0:a.top)??0} - ${(a==null?void 0:a.bottom)??0}`:"max-content"),b=gt.useEventBus(ir.SUPER_VIEW_PAGE);return i.watch(()=>t.node.attrs,y=>{b.emit(y.pageNumber)},{immediate:!0}),(y,w)=>{var E,S,C,_;const x=pb;return i.openBlock(),i.createBlock(i.unref($s),{id:y.node.attrs.id,ref_key:"containerRef",ref:l,"page-number":y.node.attrs.pageNumber,class:"overflow-hidden umo-page-node-view w-full border rounded-[3px] border-[#999999]",style:i.normalizeStyle({"--umo-page-margin-top":((E=i.unref(a))==null?void 0:E.top)??"0","--umo-page-margin-bottom":((S=i.unref(a))==null?void 0:S.bottom)??"0","--umo-page-margin-left":((C=i.unref(a))==null?void 0:C.left)??"0","--umo-page-margin-right":((_=i.unref(a))==null?void 0:_.right)??"0","--umo-page-width":i.unref(p),"--umo-page-height":i.unref(m),"--empty-node-left":"0px",left:100,"min-height":typeof i.unref(m)=="number"?`${i.unref(m)}px`:i.unref(m),height:f.value?typeof i.unref(m)=="number"?`${i.unref(m)}px`:i.unref(m):"auto"})},{default:i.withCtx(()=>[i.createElementVNode("div",nK,[i.createVNode(x,{mode:c.value?i.unref(Fe).REPORT:i.unref(Fe).EDITOR,editor:y.editor,"super-text-store":i.unref(r)},{default:i.withCtx(()=>[i.createVNode(i.unref(iw),{class:"umo-page-node-content",style:i.normalizeStyle({height:g.value})},null,8,["style"])]),_:1},8,["mode","editor","super-text-store"])])]),_:1},8,["id","page-number","style"])}}}),[["__scopeId","data-v-7d55d7ea"]]);function fE(t,e){const n=t.storedMarks??(t.selection.$to.parentOffset&&t.selection.$from.marks());if(n){const r=n.filter(o=>e==null?void 0:e.includes(o.type.name));t.tr.ensureMarks(r)}}const oK=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:o})=>{const{selection:s,doc:a}=e,{$from:l,$to:u}=s,c=o.extensionManager.attributes,f=Tp(c,l.node().type.name,l.node().attrs);if(f.id=J1(),f.extend&&(f.extend=!1),s instanceof Le&&s.node.isBlock)return!l.parentOffset||!pr(a,l.pos)?!1:(r&&(t&&fE(n,o.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;if(r){const p=u.parentOffset===u.parent.content.size;s instanceof Ae&&e.deleteSelection();const m=l.depth===0?void 0:s4(l.node(-1).contentMatchAt(l.indexAfter(-1)));let g=p&&m?[{type:m,attrs:f}]:void 0,b=pr(e.doc,e.mapping.map(l.pos),1,g);if(!g&&!b&&pr(e.doc,e.mapping.map(l.pos),1,m?[{type:m}]:void 0)&&(b=!0,g=m?[{type:m,attrs:f}]:void 0),b&&(g||(g=[{type:l.node().type,attrs:f}]),e.split(e.mapping.map(l.pos),1,g),m&&!p&&!l.parentOffset&&l.parent.type!==m)){const y=e.mapping.map(l.before()),w=e.doc.resolve(y);l.node(-1).canReplaceWith(w.index(),w.index()+1,m)&&e.setNodeMarkup(e.mapping.map(l.before()),m)}t&&fE(n,o.extensionManager.splittableMarks),e.scrollIntoView()}return!0},iK=t=>({tr:e,state:n,dispatch:r,editor:o})=>{var y;const s=hn(t,n.schema),{$from:a,$to:l}=n.selection,u=n.selection instanceof Le?n.selection.node:null;if(u!=null&&u.isBlock||a.depth<2||!a.sameParent(l))return!1;const c=a.node(-1);if(c.type!==s)return!1;const f=o.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==s||a.index(-2)!==a.node(-2).childCount-1)return!1;if(r){let w=de.empty;const x=a.index(-1)?1:a.index(-2)?2:3;for(let A=a.depth-x;A>=a.depth-3;A-=1)w=de.from(a.node(A).copy(w));const E=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,S=Tp(f,a.node().type.name,a.node().attrs),C=((y=s.contentMatch.defaultType)==null?void 0:y.createAndFill(S))??void 0;w=w.append(de.from(s.createAndFill(null,C)??void 0));const _=a.before(a.depth-(x-1));e.replace(_,a.after(-E),new Ee(w,4-x,0));let T=-1;e.doc.nodesBetween(_,e.doc.content.size,(A,L)=>{if(T>-1)return!1;A.isTextblock&&A.content.size===0&&(T=L+1)}),T>-1&&e.setSelection(Ae.near(e.doc.resolve(T))),e.scrollIntoView()}return!0}const p=l.pos===a.end()?c.contentMatchAt(0).defaultType:null,m=Tp(f,c.type.name,c.attrs),g=Tp(f,a.node().type.name,a.node().attrs);m.id=J1(),g.id=J1(),e.delete(a.pos,l.pos);const b=p?[{type:s,attrs:m},{type:p,attrs:g}]:[{type:s,attrs:m}];if(!pr(e.doc,a.pos,2))return!1;if(r){const{selection:w,storedMarks:x}=n,{splittableMarks:E}=o.extensionManager,S=x??(w.$to.parentOffset&&w.$from.marks());if(e.split(a.pos,2,b).scrollIntoView(),!S||!r)return!0;const C=S.filter(_=>E.includes(_.type.name));e.ensureMarks(C)}return!0},sK=[Z1,yp,wp,Q1,xp,us,eb,El,nb,ob,tb,sa,cs,ds,rb,ib,N1,Hr],aK=Bt.create({priority:200,name:`${Hr}`,content:"block*",group:`${Hr}`,isolating:!0,selectable:!1,draggable:!1,isLeaf:!0,addOptions(){return{SystemAttributes:{},nodesComputed:{},View:Hs(rK),types:[],slots:{}}},addAttributes(){return{HTMLAttributes:{},id:{default:li(10)},pageNumber:{default:1},force:{default:!1},viewSuperTextArea:{default:!0},slots:{default:this.options.slots,renderHTML:()=>({})}}},parseHTML(){return[{tag:`div[data-type="${this.name}"]`}]},renderHTML({node:t,HTMLAttributes:e}){return["div",{...vt(e),"data-type":this.name},0]},addCommands(){return{splitBlock:oK,splitListItem:iK,autoPaging:(t=!0)=>({tr:e,state:n,dispatch:r,editor:o})=>(r&&e.setMeta("runState",t),!0),setPageBreak:()=>({tr:t,state:e,dispatch:n,editor:r})=>(n&&t.setMeta("splitPage",!0),!0),togglePagePlugin:t=>({tr:e,dispatch:n})=>(e.setMeta("disablePage",t),n&&n(e),!0)}},addGlobalAttributes(){return[{types:sK.concat(this.options.types||[]),attributes:{id:{default:null},extend:{default:!1}}}]},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.first(({commands:r})=>[()=>r.undoInputRule(),()=>r.command(({tr:o})=>{const{selection:s,doc:a}=o,{empty:l,$anchor:u}=s,{pos:c,parent:f}=u,p=De.atStart(a).from===c;return!l||!p||!f.type.isTextblock||f.textContent.length?!1:r.clearNodes()}),()=>pE(r),()=>r.joinBackward(),()=>r.selectNodeBackward(),()=>r.command(({editor:o,tr:s})=>{const{selection:a,doc:l}=s,{$anchor:u}=a,{pos:c}=u;if(l.childCount===1)return!1;if(De.atEnd(l).from===c&&!u.parentOffset)return r.deleteNode(Hr);const f=Zo(p=>p.type.name===Hr)(a);if(f){if(!f.node.firstChild)return r.deleteNode(Hr);const p=f.node.firstChild.type;if(f.start+De.atStart(f.node).from===c){const g=Ae.create(l,f.start-2,f.start-2),b=Zo(y=>y.type.name===Hr)(g);if(b){const y=De.atEnd(b.node).from+b.start,w=Ae.create(l,y,y);if(p===b.node.lastChild.type){const{parent:x}=w.$anchor;return rq(x,o.schema)?s.setSelection(w):s.step(new pn(y,c,Ee.empty)),!0}s.setSelection(w)}return!0}}return!1})]),Delete:()=>this.editor.commands.first(({commands:r})=>[()=>pE(r),()=>r.command(({tr:o})=>{const{selection:s,doc:a}=o,{$anchor:l}=s,u=l.node(),c=Zo(f=>f.type.name===El)(s);return c&&c.start+De.atStart(c.node).from===l.pos&&c.node.childCount===1&&u.content.size===0?!0:r.joinForward()}),()=>r.selectNodeForward(),()=>r.command(({tr:o})=>{const{selection:s,doc:a}=o,{$anchor:l}=s,{pos:u}=l;if(a.childCount===1)return!1;if(De.atEnd(a).from===u)return r.deleteNode(Hr);const c=Zo(f=>f.type.name===Hr)(s);if(c&&c.start+De.atEnd(c.node).from===u){const p=Ae.create(a,u+2,u+2),m=Zo(g=>g.type.name===Hr)(p);if(m){const g=De.atStart(m.node).from+m.start,b=Ae.create(a,g,g);if(Zo(w=>w.attrs.extend)(b))return o.step(new pn(u,g,Ee.empty)),!0}}return!1})]),Tab:()=>this.editor.commands.first(({commands:r})=>[()=>!0]),"Mod-Enter":()=>this.editor.commands.setPageBreak()}},addNodeView(){return this.options.View}});function Tp(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const o=t.find(s=>s.type===e&&s.name===r);return o?o.attribute.keepOnSplit:!1}))}const pE=t=>t.command(({tr:e})=>{const{selection:n,doc:r}=e,o=a4(r,{from:n.from,to:n.to},s=>s.type.name===El);for(const s of o){const a=s.pos+s.node.nodeSize;if(n.from<s.pos||n.to>a)return!0}return t.deleteSelection()}),lK=Ze.create({name:"fontFamily",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:t=>t.style.fontFamily,renderHTML:t=>t.fontFamily?{style:`font-family: ${t.fontFamily}`}:{}}}}]},addCommands(){return{setFontFamily:t=>({chain:e})=>e().setMark("textStyle",{fontFamily:t}).run(),unsetFontFamily:()=>({chain:t})=>t().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}}}),uK=["data-font"],cK=i.defineComponent({__name:"FontFamilyMenuButton",props:{editor:{},disabled:{type:Boolean,default:!1},color:{default:void 0},shortcutKeys:{default:void 0},maxHeight:{default:void 0},tooltip:{default:""},items:{default:()=>[]},customClass:{default:""}},setup(t){const e=t,n=i.computed(()=>e.editor.extensionStorage["base-kit"].mode===Fe.EDITOR),{t:r}=Tt(),o=[{label:r("editor.fontFamily.gulim"),value:"Gulim"},{label:r("editor.fontFamily.dotum"),value:"Dotum"},{label:r("editor.fontFamily.gungsuh"),value:"Gungsuh"}],s=i.inject("fontFamily"),a=i.computed(()=>{const p=e.editor.extensionManager.extensions.find(g=>g.name==="fontFamily").options;return nt.isEmpty(p.fontFamilyMap)&&(p.fontFamilyMap=o),[{label:r("editor.fontFamily.default"),value:r("editor.fontFamily.default")},...p.fontFamilyMap]}),l=i.computed(()=>{const p={label:r("editor.fontFamily.default"),value:r("editor.fontFamily.default")};return n.value?Xm(e.editor.state,"textStyle").fontFamily||p.value:s.value||p.value}),u=gt.useEventBus("fontFamily");function c(p){p.value===l.value||p.value===r("editor.fontFamily.default")?(e.editor.commands.unsetFontFamily(),s.value=null):(s.value=p.value,e.editor.commands.setFontFamily(p.value),u.emit())}const f=i.computed(()=>{var p;return(p=a.value.find(m=>m.value===l.value))==null?void 0:p.label});return(p,m)=>(i.openBlock(),i.createBlock(na,{disabled:p.disabled,tooltip:p.tooltip,title:f.value,btn_class:`min-w-24 ${p.customClass}`},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value,(g,b)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:b},[i.createVNode(i.unref(yl),{checked:l.value===g.value,onClick:y=>c(g)},{default:i.withCtx(()=>[i.createElementVNode("span",{class:"ml-1 h-full","data-font":g.label,style:i.normalizeStyle({fontFamily:g.value??void 0})},i.toDisplayString(g.label),13,uK)]),_:2},1032,["checked","onClick"]),g.label===i.unref(r)("editor.fontFamily.default")?(i.openBlock(),i.createBlock(i.unref(u1),{key:0})):i.createCommentVNode("",!0)],64))),128))]),_:1},8,["disabled","tooltip","title","btn_class"]))}}),hE=lK.extend({name:"fontFamily",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),types:["textStyle"],fontFamilyMap:[],button({editor:e,extension:n,t:r}){return{component:cK,componentProps:{editor:e,disabled:!e.can().setFontFamily(""),tooltip:r("editor.fontFamily.tooltip"),customClass:"border border-gray-300 rounded-none text-gray-500 px-2.5 h-[26px]"}}}}},addGlobalAttributes(){return[{types:["paragraph","heading","textStyle"],attributes:{style:{default:null,parseHTML:t=>t.style.fontFamily||null,renderHTML:t=>t.style?{style:`font-family: ${t.style}`}:{}},fontFamily:{default:null,parseHTML:t=>t.style.fontFamily.replace(/['"]/g,""),renderHTML:t=>t.fontFamily?{style:`font-family: ${t.fontFamily}`}:{}}}}]},addCommands(){return{setFontFamily:t=>({chain:e})=>e().setMark("textStyle",{fontFamily:t}).run(),unsetFontFamily:()=>({chain:t})=>t().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}},addStorage(){return{value:null}},onUpdate(){this.storage.value=this.editor.getAttributes("textStyle").fontFamily}}),dK={class:"flex gap-2"},fK=["disabled"],pK=To(i.defineComponent({__name:"FontSizeIncreaseDecrease",props:{editor:Object},setup(t){const e=i.inject("fontSize"),n=i.computed(()=>e.value?parseInt(e.value)===parseInt(x0[0])||parseInt(e.value)<parseInt(x0[0]):!1),r=gt.useEventBus(ir.INCREASE_DECREASE_FONTSIZE),o=s=>{r.emit(s)};return(s,a)=>{const l=hl,u=pl,c=ml;return i.openBlock(),i.createElementBlock("div",dK,[i.createVNode(c,null,{default:i.withCtx(()=>[i.createVNode(u,{"delay-duration":0},{default:i.withCtx(()=>[i.createVNode(l,null,{default:i.withCtx(()=>[i.createElementVNode("button",{class:"btn",onClick:a[0]||(a[0]=f=>o(!0))},[i.createVNode(i.unref(Ft),{name:"Plus",class:"w-6 h-6"})])]),_:1}),i.createVNode(i.unref(Qs),null,{default:i.withCtx(()=>a[2]||(a[2]=[i.createTextVNode(" 글꼴 크기 크게 ")])),_:1})]),_:1})]),_:1}),i.createVNode(c,null,{default:i.withCtx(()=>[i.createVNode(u,{"delay-duration":0},{default:i.withCtx(()=>[i.createVNode(l,null,{default:i.withCtx(()=>[i.createElementVNode("button",{class:"btn",onClick:a[1]||(a[1]=f=>o(!1)),disabled:i.unref(n)},[i.createVNode(i.unref(Ft),{name:"Minus",class:"w-6 h-6"})],8,fK)]),_:1}),i.createVNode(i.unref(Qs),null,{default:i.withCtx(()=>a[3]||(a[3]=[i.createTextVNode(" 글꼴 크기 작게 ")])),_:1})]),_:1})]),_:1})])}}}),[["__scopeId","data-v-250d04b3"]]),hK=Pn.create({name:"fontSizeIncreaseDecrease",addOptions(){return{defaultSize:"14px",button({editor:t}){return{component:pK,componentProps:{editor:t}}}}},addAttributes(){return{size:{default:this.options.defaultSize,parseHTML:t=>t.style.fontSize||this.options.defaultSize,renderHTML:t=>t.size?{style:`font-size: ${t.size}`}:{}}}},addCommands(){return{setFontSizeIncreaseDecrease:t=>({commands:e})=>e.setMark("textStyle",{fontSize:t})}}}),hb=Ze.create({name:"painter",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,extension:n,t:r})=>({component:Ke,componentProps:{action:()=>{e.commands.setPainter(e==null?void 0:e.state.selection.$head.marks())},icon:"PaintRoller",tooltip:r("editor.format")}})}},addCommands(){return{setPainter:t=>({view:{dispatch:e,state:{tr:n},dom:r}})=>{const a=`url("data:image/svg+xml;utf8,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="#000" d="M9 22v-6H4V7q0-1.65 1.175-2.825T8 3h12v13h-5v6zM6 10h12V5h-1v4h-2V5h-1v2h-2V5H8q-.825 0-1.412.588T6 7zm0 4h12v-2H6zm0 0v-2z"/></svg>')}"), auto`;return r.style.cursor=a,e(n.setMeta("painterAction",{type:"start",marks:t})),!0}}},addProseMirrorPlugins(){return[new Ne({key:new Et("format-painter"),state:{init:()=>[],apply:(t,e)=>{const n=t.getMeta("painterAction");return n&&n.type==="start"?e=n.marks:n&&n.type==="end"&&(e=[]),e}},props:{handleDOMEvents:{mousedown(t,e){const n=this.getState(t.state);if(!n||n.length==0)return t.dom.style.cursor="",!1;const r=()=>{document.removeEventListener("mouseup",r);const{dispatch:o,state:{selection:s},dom:a}=t;let l=t.state.tr;a.style.cursor="",l=l.removeMark(s.from,s.to);for(const u of n)u.type.name!="link"&&(l=l.addMark(s.from,s.to,u));o(l.setMeta("painterAction",{type:"end"}))};return document.addEventListener("mouseup",r),!0}}}})]}}),mb=()=>li(10),mE=new Et("attrkey"),mK=t=>new Ne({key:mE,state:{init:()=>!1,apply:n=>n.getMeta("initSplit")},appendTransaction(n,r,o){const{tr:s}=o;let a=!1;const l=mE.getState(o);if(n.some(c=>c.getMeta("composition")))return null;if(l||n.some(c=>c.docChanged)){const c=[];o.doc.descendants((f,p,m,g)=>{const{attrs:b}=f,y=c.includes(b.id)?mb():b.id||mb();t.includes(f.type.name)&&(s.setNodeMarkup(p,void 0,{...b,id:y,"number-line":g+1}),a=!0),c.push(y)})}return a?s:null}}),gE=[Z1,yp,wp,Q1,xp,us,eb,El,nb,ob,tb,sa,cs,ds,rb,ib,N1,Hr],gK=Ze.create({name:"autoId",addGlobalAttributes(){return[{types:gE.concat(this.options.types||[]),attributes:{id:{default:mb()},extend:{default:!1},class:{default:null},"number-line":{default:null}}}]},addProseMirrorPlugins(){return[mK(gE.concat(this.options.types||[]))]}}),bK=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,vK=Bt.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",vt(this.options.HTMLAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[h4({find:bK,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}}),yK=["src","alt"],wK={key:0,class:"image-resizer"},xK=["onMousedown","onTouchstart"],CK=i.defineComponent({__name:"ImageView",props:{...zs,selected:{type:Boolean,required:!0}},setup(t){const e=t,n={TOP_LEFT:"tl",TOP_RIGHT:"tr",BOTTOM_LEFT:"bl",BOTTOM_RIGHT:"br"},r=i.ref({width:aw,height:aw}),o=i.ref({width:0,height:0}),s=i.ref(!1),a=i.ref({x:0,y:0,w:0,h:0,dir:""}),l=i.computed(()=>{const{src:S,alt:C,width:_,height:T,flipX:A,flipY:L}=e.node.attrs,I=[];A&&I.push("rotateX(180deg)"),L&&I.push("rotateY(180deg)");const M=I.join(" ");return{src:S||void 0,alt:C||void 0,style:{width:C0(_)?`${_}px`:_,height:C0(T)?`${T}px`:T,transform:M||"none"}}});i.computed(()=>({width:i.unref(l).style.width==="100%"?"100%":void 0}));const u=i.ref(null),c=new ResizeObserver(S=>{for(const C of S){const{width:_,height:T}=C.contentRect;o.value={width:_,height:T},e.updateAttributes({originWidth:_,originHeight:T})}});function f(){const{editor:S,getPos:C}=e;S.commands.setNodeSelection(C())}const p=nt.throttle(()=>{const{editor:S}=e;r.value.width=parseInt(getComputedStyle(S.view.dom).width,10)},lw);function m(S,C){S.preventDefault(),S.stopPropagation();let _=0,T=0;const A=document.querySelector(".image-resizer");if(A&&(A.style.borderColor="#3b82f6"),"touches"in S&&S.touches.length>0)_=S.touches[0].clientX,T=S.touches[0].clientY;else if("clientX"in S)_=S.clientX,T=S.clientY;else return;const{width:L,height:I}=i.unref(o),M=L/I;let W=Number(e.node.attrs.width)||L,j=Number(e.node.attrs.height)||Math.round(W/M);const K=i.unref(r).width;W=Math.min(W>K?K:W,K),j=Math.round(W/M),Object.assign(a.value,{x:_,y:T,w:W,h:j,dir:C}),s.value=!0,y()}const g=nt.throttle(S=>{if(!i.unref(s))return;let C=0;if("touches"in S&&S.touches.length>0)C=S.touches[0].clientX;else if("clientX"in S)C=S.clientX;else return;const{x:_,w:T,dir:A}=i.unref(a),L=(C-_)*(/l/.test(A)?-1:1),I=WB(T+L,PB,i.unref(r).width);e.updateAttributes({width:I})},lw),b=S=>{S.preventDefault(),S.stopPropagation();const C=document.querySelector(".image-resizer");C&&(C.style.borderColor=""),i.unref(s)&&(s.value=!1,Object.assign(a.value,{x:0,y:0,w:0,h:0,dir:""}),w(),f())};function y(){document.addEventListener("mousemove",g,!0),document.addEventListener("mouseup",b,!0),document.addEventListener("touchmove",g,!0),document.addEventListener("touchend",b,!0)}function w(){document.removeEventListener("mousemove",g,!0),document.removeEventListener("mouseup",b,!0),document.removeEventListener("touchmove",g,!0),document.removeEventListener("touchend",b,!0)}const x=new ResizeObserver(p),E=i.computed(()=>{const{textAlign:S}=e.node.attrs;return{left:"margin-right: auto;",right:"margin-left: auto;",center:"margin-left: auto; margin-right: auto;"}[S]||""});return i.onMounted(()=>{u.value&&c.observe(u.value),x.observe(e.editor.view.dom)}),i.onBeforeUnmount(()=>{w(),c.disconnect(),x.disconnect()}),(S,C)=>(i.openBlock(),i.createBlock(i.unref($s),{class:"node-image"},{default:i.withCtx(()=>[i.createElementVNode("div",{class:"image-view",style:i.normalizeStyle([{width:l.value.style.width,height:l.value.style.height},E.value])},[i.createElementVNode("div",{draggable:"true","data-drag-handle":"",class:i.normalizeClass([{"image-view__body--focused":t.selected,"image-view__body--resizing":s.value},"image-view__body"])},[i.createElementVNode("img",{ref_key:"imageRef",ref:u,src:l.value.src,alt:l.value.alt,class:"block w-full image-view__body__image",style:i.normalizeStyle([{transform:l.value.style.transform}]),onClick:f},null,12,yK),S.editor.view.editable?i.withDirectives((i.openBlock(),i.createElementBlock("div",wK,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(Object.values(n),_=>(i.openBlock(),i.createElementBlock("span",{key:_,class:i.normalizeClass([`image-resizer__handler--${_}`,"image-resizer__handler"]),onMousedown:T=>m(T,_),onTouchstart:i.withModifiers(T=>m(T,_),["prevent"])},null,42,xK))),128))],512)),[[i.vShow,t.selected||s.value]]):i.createCommentVNode("",!0)],2)],4)]),_:1}))}}),EK=To(CK,[["__scopeId","data-v-6435a6f3"]]),gb=vK.extend({group:"block",defining:!0,isolating:!0,addAttributes(){var t;return{...(t=this.parent)==null?void 0:t.call(this),flipX:{default:!1},flipY:{default:!1},originWidth:{default:null},originHeight:{default:null},textAlign:{default:"left",parseHTML:e=>e.style.textAlign||e.getAttribute("textAlign")||null,renderHTML:e=>({textAlign:e.textAlign})},width:{default:"100%",parseHTML:e=>{const n=e.style.width||e.getAttribute("width")||null;return n&&n.endsWith("%")?n:n==null?null:parseInt(n,10)},renderHTML:e=>({width:e.width})}}},addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this)}},addNodeView(){return Hs(EK)},addCommands(){var t;return{...(t=this.parent)==null?void 0:t.call(this),updateImage:e=>({commands:n,editor:r})=>n.updateAttributes(this.name,e)}},renderHTML({node:t,HTMLAttributes:e}){const{textAlign:n,flipX:r,flipY:o}=t.attrs,l=`${{left:"margin-right: auto;",right:"margin-left: auto;",center:"margin-left: auto; margin-right: auto;"}[n]||""} ${r||o?`transform: rotateX(${r?"180":"0"}deg) rotateY(${o?"180":"0"}deg);`:""}`;return["img",vt({height:"auto",style:l},this.options.HTMLAttributes,e)]},parseHTML(){return[{tag:"img[src]"}]},addProseMirrorPlugins(){return[new Ne({props:{handleTextInput(t){const{selection:e}=t.state;return e instanceof Le&&e.node.type.name==="image"},handlePaste(t){const{selection:e}=t.state;return e instanceof Le&&e.node.type.name==="image"}}})]}}),SK=["paragraph","heading","list_item","todo_item"];function kK(t,e){const{selection:n,doc:r}=t;if(!n||!r||!(n instanceof Ae||n instanceof In))return t;const{from:o,to:s}=n,a=[],l=e&&e!==uw?e:null;return r.nodesBetween(o,s,(u,c)=>{const f=u.type;return SK.includes(f.name)?((u.attrs.lineHeight||null)!==l&&a.push({node:u,pos:c,nodeType:f}),f.name!=="list_item"&&f.name!=="todo_item"):!0}),a.length&&a.forEach(u=>{const{node:c,pos:f,nodeType:p}=u;let{attrs:m}=c;m={...m,lineHeight:l},t=t.setNodeMarkup(f,p,m,c.marks)}),t}function _K(t){return({state:e,dispatch:n})=>{const{selection:r}=e;let{tr:o}=e;return o=o.setSelection(r),o=kK(o,t),o.docChanged?(n&&n(o),!0):!1}}const TK=i.defineComponent({__name:"LineHeightDropdown",props:{editor:{},icon:{default:void 0},tooltip:{default:void 0},disabled:{type:Boolean,default:!1},action:{type:Function,default:void 0},isActive:{type:Function,default:void 0}},setup(t){const{t:e}=Tt();function n(l){return parseFloat(l.replace("%",""))/100}const r=i.computed(()=>{const c=s.editor.extensionManager.extensions.find(f=>f.name==="lineHeight").options.lineHeights.map(f=>({label:n(f),value:f}));return c.unshift({label:i.unref(e)("editor.default"),value:"default"}),c}),o=i.ref("default"),s=t;function a(l){l==="default"?s.editor.commands.unsetLineHeight():s.editor.commands.setLineHeight(l),o.value=l}return(l,u)=>(i.openBlock(),i.createBlock(na,{icon:l.icon,tooltip:l.tooltip,disabled:l.disabled},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.value,(c,f)=>(i.openBlock(),i.createBlock(i.unref(yl),{key:f,checked:c.value===o.value,onClick:p=>a(c.value)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(c.label),1)]),_:2},1032,["checked","onClick"]))),128))]),_:1},8,["icon","tooltip","disabled"]))}}),bE=Ze.create({name:"lineHeight",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),types:["paragraph","heading","list_item","todo_item"],lineHeights:["100%","115%","150%","200%","250%","300%"],defaultHeight:uw,button({editor:e,t:n}){return{component:TK,componentProps:{editor:e,icon:"LineHeight",tooltip:n("editor.lineheight.tooltip")}}}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:t=>t.style.lineHeight||this.options.defaultHeight,renderHTML:t=>t.lineHeight===this.options.defaultHeight||!t.lineHeight?{}:{style:`line-height: ${t.lineHeight}`}}}}]},addCommands(){return{setLineHeight:t=>_K(t),unsetLineHeight:()=>({commands:t})=>this.options.types.every(e=>t.resetAttributes(e,"lineHeight"))}}}),AK=Bt.create({name:"column",content:"block+",isolating:!0,addAttributes(){return{position:{default:"",parseHTML:t=>t.getAttribute("data-position"),renderHTML:t=>({"data-position":t.position})}}},renderHTML({HTMLAttributes:t}){return["div",vt(t,{"data-type":"column"}),0]},parseHTML(){return[{tag:'div[data-type="column"]'}]}});var aa=(t=>(t.SidebarLeft="sidebar-left",t.SidebarRight="sidebar-right",t.TwoColumn="two-column",t))(aa||{});const bb=Bt.create({name:"columns",group:"columns",content:"column+",defining:!0,isolating:!0,addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),layout:"two-column"}},addAttributes(){return{layout:{default:"two-column"}}},addCommands(){return{setColumns:()=>({commands:t})=>(t.insertContent('<div data-type="columns"><div data-type="column" data-position="left"><p></p></div><div data-type="column" data-position="right"><p></p></div></div>'),!0),setLayout:t=>({commands:e})=>e.updateAttributes("columns",{layout:t})}},renderHTML({HTMLAttributes:t}){return["div",{"data-type":"columns",class:`layout-${t.layout}`},0]},parseHTML(){return[{tag:'div[data-type="columns"]'}]},addExtensions(){return[AK.configure(this.options.columnOptions)]}}),vE=i.defineComponent({__name:"DialogDescription",props:{asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,n=i.computed(()=>{const{class:o,...s}=e;return s}),r=Gn(n);return(o,s)=>(i.openBlock(),i.createBlock(i.unref(iL),i.mergeProps(i.unref(r),{class:i.unref(Te)("text-sm text-ed-muted-foreground",e.class)}),{default:i.withCtx(()=>[i.renderSlot(o.$slots,"default")]),_:3},16,["class"]))}}),OK={class:"flex gap-x-2 items-center"},MK={class:"sr-only"},BK={class:"flex justify-end gap-x-2.5 flex-1"},IK=["disabled"],Ap=To(i.defineComponent({__name:"SuperInputDialogMoblie",props:{editor:{},open:{type:Boolean},superTextInit:{},superTextId:{},superTextElementId:{},isViewMode:{type:Boolean},title:{}},emits:["close","save","delete"],setup(t,{emit:e}){const n=e,r=t,{t:o}=Tt(),s=i.ref(""),a=i.ref(!1),l=i.ref(r.isViewMode??!1),u=i.ref(!1);i.watch(()=>r.isViewMode,g=>{l.value=g,g||(s.value="")});const c=i.computed(()=>{var b;if(!s.value)return!0;const g=document.createElement("div");return g.innerHTML=s.value,((b=g==null?void 0:g.textContent)==null?void 0:b.trim())===""});i.watch(()=>r.open,()=>{r.open&&r.superTextInit&&(s.value=r.superTextInit)});const f=()=>{n("close"),a.value=!1,l.value=!0,u.value=!1},p=()=>{n("save",s.value),s.value="",l.value=!0,u.value=!1},m=()=>{u.value=!0,l.value=!1};return(g,b)=>{const y=_p,w=kp,x=Sp,E=vE,S=db,C=Ep,_=Cp;return i.openBlock(),i.createBlock(_,{open:g.open},{default:i.withCtx(()=>[i.createVNode(C,{isOverlayTransparent:"",class:"p-2.5 gap-0 gap-y-2.5 border-none w-[calc(100%-40px)] !shadow-ed rounded-[5px]"},{default:i.withCtx(()=>[i.createVNode(x,{class:"text-left flex-row justify-between"},{default:i.withCtx(()=>[i.createVNode(y,{class:"text-base font-normal"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(g.title?g.title:i.unref(o)("editor.superinput")),1)]),_:1}),i.createElementVNode("div",OK,[i.withDirectives(i.createElementVNode("button",{onClick:m},[i.createVNode(i.unref(Jg),{icon:"lucide:edit-2"})],512),[[i.vShow,l.value]]),i.createVNode(w,{class:"outline-none",onClick:f},{default:i.withCtx(()=>[i.createVNode(i.unref(Df),{class:"w-5 h-5"}),i.createElementVNode("span",MK,i.toDisplayString(i.unref(o)("editor.close")),1)]),_:1})])]),_:1}),i.createVNode(E,{class:"hidden"}),i.createVNode(fb,{isReadOnly:l.value,modelValue:s.value,"onUpdate:modelValue":b[0]||(b[0]=T=>s.value=T),"parent-editor":g.editor},null,8,["isReadOnly","modelValue","parent-editor"]),i.createVNode(S,{class:"flex-row justify-between"},{default:i.withCtx(()=>[i.withDirectives(i.createElementVNode("button",{onClick:b[1]||(b[1]=T=>n("delete"))},i.toDisplayString(i.unref(o)("editor.delete")),513),[[i.vShow,u.value]]),i.withDirectives(i.createElementVNode("div",BK,[i.createElementVNode("button",{onClick:f},i.toDisplayString(i.unref(o)("editor.menubar.menu.cancel")),1),i.createElementVNode("button",{onClick:p,disabled:i.unref(c),class:i.normalizeClass({"cursor-not-allowed":i.unref(c)})},i.toDisplayString(i.unref(o)("editor.menubar.menu.save")),11,IK)],512),[[i.vShow,u.value||!l.value]])]),_:1})]),_:1})]),_:1},8,["open"])}}}),[["__scopeId","data-v-5e572fda"]]);function RK(t){let e=t;for(;e&&e!==document.body;){if(e.nodeType===1){const n=e;if(n.id==="editor-panel")return n}e=e.parentNode}return null}const vb=t=>{var n;if(!t)return!0;const e=document.createElement("div");return e.innerHTML=t,((n=e==null?void 0:e.textContent)==null?void 0:n.trim())===""},yE=8;function LK(t){const e=i.ref(!1);let n=!1,r=null,o=null,s=null,a=null,l=0,u=0;function c(x){const E=x.cloneNode(!0);return E.style.position="fixed",E.style.pointerEvents="none",E.style.opacity="0.9",E.style.zIndex="9999",E.style.transform="translate(-50%, -50%)",E.style.left="0px",E.style.top="0px",document.body.appendChild(E),E}function f(){o&&o.parentElement&&o.parentElement.removeChild(o),o=null}function p(){try{if(typeof t.getPos=="function"){const x=t.getPos();if(typeof x=="number"&&x>=0)return x}}catch{}return null}function m(x,E){e.value||(a=p(),document.body.style.userSelect="none",document.body.style.touchAction="none",E&&(o=c(E),o.style.left=`${x.clientX}px`,o.style.top=`${x.clientY}px`),e.value=!0,n=!1,s=null)}function g(){r=null,a=null,s=null,n=!1,e.value=!1,f(),document.body.style.userSelect="",document.body.style.touchAction=""}function b(x){if(e.value)return;const E=x.changedTouches[0];r=E.identifier,l=E.clientX,u=E.clientY,n=!0,a=null,s=null}function y(x){var T;if(!n&&!e.value||r===null)return;const E=Array.from(x.changedTouches).find(A=>A.identifier===r);if(!E)return;const S=E.clientX-l,C=E.clientY-u,_=S*S+C*C;if(!e.value&&n&&_>=yE*yE){const A=x.currentTarget||x.target||null;m(E,A)}if(e.value){o&&(o.style.left=`${E.clientX}px`,o.style.top=`${E.clientY}px`);try{const A=(T=t.editor)==null?void 0:T.view;if(!A){s=null;return}const L=A.posAtCoords({left:E.clientX,top:E.clientY});L&&typeof L.pos=="number"?s=L.pos:s=null}catch{s=null}}}async function w(x){var E;if(e.value){if(document.body.style.userSelect="",document.body.style.touchAction="",f(),e.value=!1,a===null||s===null){g();return}const S=(E=t.editor)==null?void 0:E.view;if(!S){g();return}const C=S.state.doc.nodeAt(a);if(!C){g();return}const _=C.nodeSize,T=a,A=T+_,L=s;if(L>=T&&L<=A){g();return}let I=L;L>T&&(I=L-_);const M=S.state.doc.content.size;I<0&&(I=0),I>M&&(I=M);const W=C.type.create(C.attrs),j=S.state.tr;j.delete(T,A),j.insert(I,W),S.dispatch(j),g();return}if(n){g();return}}return{onTouchStart:b,onTouchMove:y,onTouchEnd:w}}const PK=["book-mark-node-id","page-id","page-number","book-mark-content","node-id","element-id","line-id"],DK=i.defineComponent({__name:"SuperText",props:zs,setup(t){const e=t,n=i.ref(!1),r=i.ref(null),{selection:o,doc:s}=e.editor.state,a=i.ref(!1),l=i.inject("isMobile",!1),u=gt.useEventBus(ir.RENDER_SUPER_TEXT),{onTouchStart:c,onTouchMove:f,onTouchEnd:p}=LK(e),m=i.computed(()=>{var M,W;const T=s.resolve(o.from),A=T==null?void 0:T.node(-1),L=(M=A==null?void 0:A.attrs)==null?void 0:M.id,I=(W=A==null?void 0:A.attrs)==null?void 0:W.pageNumber;return{pageId:L,pageNumber:I}}),g=i.computed(()=>{const T=e.getPos(),A=e.editor.state.doc.resolve(T);for(let L=A.depth;L>0;L--){const I=A.node(L);if(I.type.name==="paragraph")return I}return null}),b=i.computed(()=>{var T;return((T=g.value)==null?void 0:T.attrs.id)||""}),y=i.inject("canEditSuper",i.ref(!0));function w(T){var j,K;if(vb(T)){S();return}const A=e.getPos(),L=(j=e.editor)==null?void 0:j.state.doc.nodeAt(A),I=T.trim(),{[tt.ELEMENT_ID]:M,...W}=(L==null?void 0:L.attrs)||{};(K=e.editor)==null||K.view.dispatch(e.editor.state.tr.setNodeMarkup(A,void 0,{...W,[tt.TEXT]:I})),requestAnimationFrame(()=>{e.editor.commands.setTextSelection(A+1),e.editor.view.focus()})}function x(T){const A=e.node.attrs[tt.TEXT],L=e.node.attrs[tt.ID],M={lineId:T.target.querySelector(`[node-id="${L}"]`).getAttribute("line-id"),dataId:L,text:A};u.emit({action:"hover",payload:M})}function E(T){const A=e.node.attrs[tt.ID],I={lineId:T.target.querySelector(`[node-id="${A}"]`).getAttribute("line-id"),dataId:A,text:""};u.emit({action:"hover",payload:I})}function S(){const{getPos:T,node:A,editor:L}=e,I=T(),M=I+1;L.commands.deleteRange({from:I,to:M})}function C(){if(!y.value)return;const{attributes:T}=e.editor.options.editorProps;if(T&&T.id===nr.COMMENT){const A=document.getElementById(nr.COMMENT);if((A==null?void 0:A.getAttribute(nr.DISABLE_SUPER_INPUT))==="true")return}e.editor.view.dom.blur(),n.value=!0}function _(){l&&(a.value=!0,C())}return(T,A)=>{const L=yn,I=cb,M=ub,W=lb,j=ab,K=dc;return i.openBlock(),i.createBlock(i.unref($s),{as:"span",class:i.normalizeClass(["w-fit text-inherit super-text align-middle",{"text-red-600 !leading-[13px]":i.unref(l)}]),"data-drag-handle":"",draggable:i.unref(y),contenteditable:"false",onPointerdown:A[3]||(A[3]=i.withModifiers(()=>{},["stop"])),onTouchstartPassive:i.unref(c),onTouchmovePassive:i.unref(f),onTouchendPassive:i.unref(p),onTouchcancelPassive:i.unref(p)},{default:i.withCtx(()=>[i.createVNode(j,null,{default:i.withCtx(()=>[i.createVNode(I,{as:"template",class:"relative",disabled:!i.unref(y)||i.unref(l)},{default:i.withCtx(()=>[i.createVNode(L,{class:i.normalizeClass([{"pointer-events-none":!i.unref(y)},"!p-0 !m-0 !h-fit"]),variant:"ghost",onDblclick:i.withModifiers(C,["stop"]),onClick:_,onMouseenter:x,onMouseleave:E},{default:i.withCtx(()=>[i.createVNode(i.unref(Ft),{name:"fileEdit",class:i.normalizeClass({"w-[13px] h-auto":i.unref(l)})},null,8,["class"]),i.createElementVNode("div",{ref_key:"bookMarkRef",ref:r,"book-mark-node-id":e.node.attrs[i.unref(tt).ID],"page-id":m.value.pageId,"page-number":m.value.pageNumber,"book-mark-content":e.node.attrs[i.unref(tt).TEXT],"node-id":e.node.attrs[i.unref(tt).ID],"element-id":e.node.attrs[i.unref(tt).ELEMENT_ID],"line-id":b.value},null,8,PK)]),_:1},8,["class"])]),_:1},8,["disabled"]),i.createVNode(W,null,{default:i.withCtx(()=>[i.createVNode(M,{onSelect:A[0]||(A[0]=se=>n.value=!0)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(T.$t("editor.super.edit")),1)]),_:1}),i.createVNode(M,{onSelect:S},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(T.$t("editor.super.delete")),1)]),_:1})]),_:1})]),_:1}),i.unref(l)?(i.openBlock(),i.createBlock(Ap,{key:1,open:n.value,"is-view-mode":a.value,editor:e.editor,"super-text-init":e.node.attrs[i.unref(tt).TEXT],"super-text-id":e.node.attrs[i.unref(tt).ID],"super-text-element-id":e.node.attrs[i.unref(tt).ELEMENT_ID],onClose:A[2]||(A[2]=se=>n.value=!1),onSave:w,onDelete:S},null,8,["open","is-view-mode","editor","super-text-init","super-text-id","super-text-element-id"])):(i.openBlock(),i.createBlock(K,{key:0,open:n.value,editor:e.editor,"super-text-init":e.node.attrs[i.unref(tt).TEXT],"super-text-element-id":e.node.attrs[i.unref(tt).ELEMENT_ID],onClose:A[1]||(A[1]=se=>n.value=!1),onSave:w},null,8,["open","editor","super-text-init","super-text-element-id"]))]),_:1},8,["class","draggable","onTouchstartPassive","onTouchmovePassive","onTouchendPassive","onTouchcancelPassive"])}}}),VK=new Ne({props:{handleKeyDown(t,e){var n;if(e.key==="Backspace"){const{state:r,dispatch:o}=t,{$from:s}=r.selection;if(s.parentOffset===1){const u=s.nodeAfter;if(u&&u.type.name==="superText"){const c=r.tr;c.delete(s.pos-1,s.pos);const f=r.schema.text("​");return c.insert(s.pos-1,de.from(f)),c.setSelection(Ae.create(c.doc,s.pos)),o(c),e.preventDefault(),!0}}const a=s.nodeBefore,l=s.nodeAfter;if(a&&a.isText&&((n=a.text)==null?void 0:n.length)===1&&l&&l.type.name==="superText"){const u=s.parent.childBefore(s.parentOffset-1).node;if(u&&u.type.name==="superText"){const c=r.tr;return c.delete(s.pos-1,s.pos),c.setSelection(Ae.create(c.doc,s.pos-1)),o(c),e.preventDefault(),!0}}}return!1}}}),FK=new Ne({appendTransaction(t,e,n){const r=new Set;let o=n.tr,s=!1;return n.doc.descendants((a,l)=>{if(a.type.name===fc){const u=a.attrs[tt.ID];if(!u||r.has(u)){const c=li();o=o.setNodeMarkup(l,void 0,{...a.attrs,[tt.ID]:c}),s=!0,r.add(c)}else r.add(u)}}),s?o:null}}),fc="superText",wE={UPDATE:"superTextUpdate"},xE=Bt.create({name:"superText",inline:!0,group:"inline",selectable:!1,defining:!0,draggable:!0,addStorage(){return{enable:!0,isShowSuperInputMoblie:!1,view:!0,items:[],toggleSuperViewMobileCallBack:this.options.toggleSuperViewMobileCallBack}},addOptions(){return{specialCharModal:null,button:({editor:t,t:e,isMobile:n})=>[...n?[{component:Ke,componentProps:{action:()=>{t.commands.toggleSuperInputMoblie()},isActive:()=>{},icon:"fileEdit",title:e("editor.menubar.menu.insertSuper"),tooltip:e("editor.menubar.menu.insertSuper"),customClass:"whitespace-nowrap !bg-ed-blue active:!bg-ed-blue/90 !transition-none !text-white !font-normal rounded-[3px] h-[26px] ml-auto",customClassTooltip:"ml-auto"}}]:[],{component:Ke,componentProps:{action:()=>t.commands.toggleSuperText(n),isActive:()=>t.storage.superText.enable,title:e("editor.menubar.menu.superView"),customClass:`whitespace-nowrap !text-white !font-normal rounded-[3px] h-[26px]
290
+ `){W.push(M),M="";continue}if(M+=K,S.measureText(M).width>L())for(;S.measureText(M).width>L();){const se=I(M,L());se<=0?(W.push(M.charAt(0)),M=M.slice(1)):(W.push(M.slice(0,se)),M=M.slice(se))}}return W.push(M),W.map(K=>`<p>${K}</p>`).join("")}return e({insertSpecialCharater:m,isChecked:u,toggleSpellCheck:g,wrapText:C}),(_,T)=>(i.openBlock(),i.createElementBlock("div",{ref_key:"contentInner",ref:b,style:i.normalizeStyle(i.unref(x)),class:i.normalizeClass(i.unref(Te)("h-40 overflow-y-auto border focus-within:border-ed-input-focus rounded-[3px] p-2.5",i.unref(s)&&"h-20 border-ed-gray rounded-lg",_.isReadOnly&&"border-none"))},[i.createVNode(i.unref(So),{id:"editor-panel",editor:i.unref(p),class:i.normalizeClass(i.unref(Te)("vdc-editor relative h-full"))},null,8,["editor","class"])],6))}}),Kq={class:"sr-only"},Gq={class:"grid m-2.5 p-2.5 gap-y-2.5 rounded border border-gray-200"},Xq={class:"grid grid-cols-[70px,1fr] gap-x-2"},Yq={class:"flex gap-x-7"},Jq={class:"flex items-center space-x-2 text-xs font-normal"},Zq={for:"spellcheck",class:"select-none whitespace-nowrap"},Qq={class:"flex gap-x-1"},Nq={class:"grid grid-cols-[70px,1fr] gap-x-2"},eK={class:"text-right text-sm p-2"},tK={class:"grid grid-cols-[70px,1fr] gap-x-2"},dc=i.defineComponent({__name:"SuperInputDialog",props:{editor:{},open:{type:Boolean},superTextInit:{},superTextElementId:{}},emits:["close","save"],setup(t,{emit:e}){var W,j;const n=e,r=t,{t:o}=Tt(),s=i.ref(""),a=i.ref(""),l=i.ref(null),u=i.ref(!1),c=i.reactive({x:0,y:0}),f=i.ref(!1),p={x:0,y:0},m=i.ref(!1),g=i.ref(!1),b=K=>{f.value=!0,p.x=K.clientX-c.x,p.y=K.clientY-c.y,document.addEventListener("mousemove",y),document.addEventListener("mouseup",w)},y=K=>{f.value&&(c.x=K.clientX-p.x,c.y=K.clientY-p.y)},w=()=>{f.value=!1,document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",w)};i.watch(()=>r.open,async K=>{if(K){g.value=!1,r.superTextInit&&(s.value=r.superTextInit,r.superTextElementId&&(a.value=r.superTextElementId)),await i.nextTick();const se=document.querySelector(".draggable-dialog");if(se){const{width:z,height:V}=se.getBoundingClientRect(),P=window.innerHeight;c.x=0,c.y=(P-V)/2}}},{immediate:!0});const x=()=>{n("close"),s.value="",a.value="",u.value=!1},E=()=>{s.value=l.value.wrapText(),a.value="",g.value?m.value=!0:n("close"),n("save",s.value),s.value=""},S=()=>{m.value=!1,n("close")},C=(j=(W=r.editor)==null?void 0:W.extensionManager.extensions.find(K=>K.name==="superText"))==null?void 0:j.options.specialCharModal,_=gt.useLocalStorage("recentSpecialChars",[]),T=K=>{if(!K)return;const se=(_.value??[]).filter(z=>z!==K);se.unshift(K),_.value=se.slice(0,5)},A=K=>{var se;(se=l.value)==null||se.insertSpecialCharater(K)},L=(K,se)=>{var z;se&&((z=l.value)==null||z.insertSpecialCharater(K),T(K))},I=i.computed(()=>{var K;return(K=l.value)==null?void 0:K.isChecked}),M=()=>{var K;(K=l.value)==null||K.toggleSpellCheck()};return i.onUnmounted(()=>{document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",w)}),i.watch(s,K=>{!r.superTextElementId||r.superTextElementId===""||(g.value=K!==(r.superTextInit??""))}),(K,se)=>{const z=_p,V=kp,P=Sp,q=db,J=Ep,Y=Cp,ne=qq;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createVNode(Y,{open:K.open},{default:i.withCtx(()=>[i.createVNode(i.unref(G0),null,{default:i.withCtx(()=>[i.createVNode(i.unref(N0),{class:"!pointer-events-none bg-black/30"}),i.createVNode(J,{"is-overlay-transparent":"",class:"p-0 gap-0 !animate-none !transition-none max-w-max","as-child":""},{default:i.withCtx(()=>{var we,xe,Ve;return[i.createElementVNode("div",{class:"draggable-dialog fixed z-[70] pointer-events-auto",style:i.normalizeStyle({transform:`translate(${c.x}px, ${c.y}px)`,top:"0px",left:"auto",right:"15px"})},[i.createVNode(P,{class:"bg-blue-500 text-white p-2.5 rounded-t-[5px] cursor-move",onMousedown:i.withModifiers(b,["prevent"])},{default:i.withCtx(()=>[i.createVNode(z,null,{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("editor.superinput")),1)]),_:1}),i.createVNode(V,{class:"absolute right-3 top-3 text-white",onClick:x},{default:i.withCtx(()=>[i.createVNode(i.unref(Df),{class:"w-5 h-5"}),i.createElementVNode("span",Kq,i.toDisplayString(K.$t("editor.close")),1)]),_:1})]),_:1}),i.createElementVNode("div",Gq,[i.createElementVNode("div",Xq,[se[4]||(se[4]=i.createElementVNode("label",null," ",-1)),i.createElementVNode("div",Yq,[i.createVNode(yn,{class:"text-[#65558F] bg-[#ECE6F0] hover:bg-[#ECE6F0]/90 shadow text-xs rounded font-normal h-[25px] px-3",onClick:se[0]||(se[0]=Se=>u.value=!0)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("editor.insert.symbol")),1)]),_:1}),i.createElementVNode("div",Jq,[i.createVNode(dE,{id:"spellcheck",checked:i.unref(I),"onUpdate:checked":M},null,8,["checked"]),i.createElementVNode("label",Zq,i.toDisplayString(i.unref(o)("editor.menubar.menu.spellCheck")),1)]),i.createElementVNode("div",Qq,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref(_),Se=>(i.openBlock(),i.createBlock(yn,{key:Se,variant:"outline",size:"xs",class:"h-[25px] w-[25px] p-0",onClick:We=>A(Se)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(Se),1)]),_:2},1032,["onClick"]))),128))])]),u.value?(i.openBlock(),i.createBlock(i.resolveDynamicComponent((we=i.unref(C))==null?void 0:we.component),{key:0,"custom-class":"!z-[70] !pointer-events-auto",class:i.normalizeClass((Ve=(xe=i.unref(C))==null?void 0:xe.componentProps)==null?void 0:Ve.class),onSelectedChar:L,onClose:se[1]||(se[1]=Se=>u.value=!1)},null,40,["class"])):i.createCommentVNode("",!0)]),i.createElementVNode("div",Nq,[i.createElementVNode("label",eK,i.toDisplayString(i.unref(o)("editor.detail")),1),i.createVNode(fb,{ref_key:"simpleEditorRef",ref:l,modelValue:s.value,"onUpdate:modelValue":se[2]||(se[2]=Se=>s.value=Se),"parent-editor":K.editor,class:""},null,8,["modelValue","parent-editor"])]),i.createElementVNode("div",tK,[se[5]||(se[5]=i.createElementVNode("label",{class:"text-right text-sm p-2"},"ID",-1)),i.createVNode(dl,{modelValue:a.value,"onUpdate:modelValue":se[3]||(se[3]=Se=>a.value=Se),class:"rounded-none","default-value":a.value,disabled:""},null,8,["modelValue","default-value"])])]),i.createVNode(q,{class:"sm:justify-center pb-3.5 pt-1"},{default:i.withCtx(()=>[i.createVNode(yn,{as:"button",variant:"default",class:"bg-blue-500 hover:bg-blue-500/90",onClick:E},{default:i.withCtx(()=>[i.createVNode(i.unref(s1),{class:"w-5 h-5 mr-2"}),i.createTextVNode(" "+i.toDisplayString(i.unref(o)("editor.check")),1)]),_:1}),i.createVNode(yn,{as:"button",variant:"destructive",onClick:x},{default:i.withCtx(()=>[i.createVNode(i.unref(Df),{class:"w-5 h-5 mr-2"}),i.createTextVNode(" "+i.toDisplayString(K.$t("editor.close")),1)]),_:1})]),_:1})],4)]}),_:1})]),_:1})]),_:1},8,["open"]),i.createVNode(ne,{open:m.value,onClose:S},null,8,["open"])],64)}}}),pb=i.defineComponent({__name:"SelectContextMenu",props:{editor:{},mode:{},superTextStore:{},disabled:{type:Boolean},disableSuperInput:{type:Boolean}},setup(t,{expose:e}){const n=t,{t:r}=Tt(),o=i.ref(!1),s=i.reactive({from:0,to:0,text:""}),a=i.inject("isEditable",i.ref(!0)),l=i.inject("canEditSuper",i.ref(!0)),u=i.computed(()=>n.mode===Fe.EDITOR||n.mode===Fe.PLAIN_TEXT||!l.value||n.disableSuperInput);function c(){if(!n.editor)return"";const{from:E,to:S}=n.editor.state.selection,C=n.editor.state.doc.cut(E,S),T=vo.fromSchema(n.editor.schema).serializeFragment(C.content),A=document.createElement("div");return A.appendChild(T),A.innerHTML}const f=()=>{const{view:E}=n.editor,{from:S,to:C}=E.state.selection,_=c();s.text=_,s.from=S,s.to=C},p=()=>o.value=!o.value,m=()=>{u.value||(o.value=!0,f())},g=()=>o.value=!1,b=E=>{const S=n==null?void 0:n.superTextStore.addMoreSuperText(E);n.editor&&n.editor.commands.insertContentAt(s.from,{type:"superText",attrs:{"data-id":S,"data-text":E}}),o.value=!1,requestAnimationFrame(()=>{n.editor.commands.setTextSelection(s.from+1),n.editor.view.focus()})},y=i.ref(!1),w=async E=>{var S,C;if(E){const _=await((C=(S=n.editor).hasClipboard)==null?void 0:C.call(S));y.value=!!_}},x=()=>{if(u.value||!n.editor)return;const{view:E,state:S}=n.editor,{from:C,to:_}=S.selection;s.from=C,s.to=_,s.text="",E.dom.blur(),o.value=!0};return e({toggleDialog:p,openDialog:m,closeDialog:g}),(E,S)=>{const C=dc,_=cb,T=ub,A=lb,L=ab;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createVNode(C,{open:o.value,editor:E.editor,"super-text-init":s.text,onClose:p,onSave:b},null,8,["open","editor","super-text-init"]),i.createVNode(L,{"onUpdate:open":w},{default:i.withCtx(()=>[i.createVNode(_,{as:"template",class:"relative",disabled:i.unref(u),onDblclick:i.withModifiers(x,["prevent","stop"])},{default:i.withCtx(()=>[i.renderSlot(E.$slots,"default")]),_:3},8,["disabled"]),i.createVNode(A,null,{default:i.withCtx(()=>[E.disableSuperInput?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(T,{key:0,onSelect:m},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(r)("editor.inputSuper")),1)]),_:1})),i.unref(a)?(i.openBlock(),i.createBlock(T,{key:1,onSelect:S[0]||(S[0]=I=>{var M;return(M=E.editor)==null?void 0:M.commands.cutContent()})},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(r)("editor.cut")),1)]),_:1})):i.createCommentVNode("",!0),i.unref(a)?(i.openBlock(),i.createBlock(T,{key:2,onSelect:S[1]||(S[1]=I=>{var M;return(M=E.editor)==null?void 0:M.commands.copyContent()})},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(r)("editor.copy")),1)]),_:1})):i.createCommentVNode("",!0),i.unref(a)?(i.openBlock(),i.createBlock(T,{key:3,disabled:!y.value,onSelect:S[2]||(S[2]=I=>{var M;return(M=E.editor)==null?void 0:M.commands.pasteContent()})},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(r)("editor.paste")),1)]),_:1},8,["disabled"])):i.createCommentVNode("",!0)]),_:1})]),_:3})],64)}}});var ir=(t=>(t.TOGGLE_SUPER_TEXT="toggle-super-text",t.SUPER_TEXT_UPDATE_POSITION="SUPER_TEXT_UPDATE_POSITION",t.RENDER_SUPER_TEXT="RENDER_SUPER_TEXT",t.SUPER_VIEW_PAGE="SUPER_VIEW_PAGE",t.INCREASE_DECREASE_FONTSIZE="increase-decrease-fontsize",t))(ir||{});const nK={id:"editor-panel",class:"flex relative w-full h-full"},rK=To(i.defineComponent({__name:"PageNode",props:zs,setup(t){const{state:e,page:n,superTextStore:r}=wn(),{size:o,pagination:s,margin:a}=n.value,l=i.ref(null),u=i.ref(t.node.attrs.viewSuperTextArea),c=i.computed(()=>u.value&&t.editor.storage.page.mode!=="editor"),f=i.computed(()=>t.editor.storage.page.mode===Fe.REPORT),{width:p,height:m}=o,g=i.computed(()=>s?`calc(${m} - ${(a==null?void 0:a.top)??0} - ${(a==null?void 0:a.bottom)??0}`:"max-content"),b=gt.useEventBus(ir.SUPER_VIEW_PAGE);return i.watch(()=>t.node.attrs,y=>{b.emit(y.pageNumber)},{immediate:!0}),(y,w)=>{var E,S,C,_;const x=pb;return i.openBlock(),i.createBlock(i.unref($s),{id:y.node.attrs.id,ref_key:"containerRef",ref:l,"page-number":y.node.attrs.pageNumber,class:"overflow-hidden umo-page-node-view w-full border rounded-[3px] border-[#999999]",style:i.normalizeStyle({"--umo-page-margin-top":((E=i.unref(a))==null?void 0:E.top)??"0","--umo-page-margin-bottom":((S=i.unref(a))==null?void 0:S.bottom)??"0","--umo-page-margin-left":((C=i.unref(a))==null?void 0:C.left)??"0","--umo-page-margin-right":((_=i.unref(a))==null?void 0:_.right)??"0","--umo-page-width":i.unref(p),"--umo-page-height":i.unref(m),"--empty-node-left":"0px",left:100,"min-height":typeof i.unref(m)=="number"?`${i.unref(m)}px`:i.unref(m),height:f.value?typeof i.unref(m)=="number"?`${i.unref(m)}px`:i.unref(m):"auto"})},{default:i.withCtx(()=>[i.createElementVNode("div",nK,[i.createVNode(x,{mode:c.value?i.unref(Fe).REPORT:i.unref(Fe).EDITOR,editor:y.editor,"super-text-store":i.unref(r)},{default:i.withCtx(()=>[i.createVNode(i.unref(iw),{class:"umo-page-node-content",style:i.normalizeStyle({height:g.value})},null,8,["style"])]),_:1},8,["mode","editor","super-text-store"])])]),_:1},8,["id","page-number","style"])}}}),[["__scopeId","data-v-7d55d7ea"]]);function fE(t,e){const n=t.storedMarks??(t.selection.$to.parentOffset&&t.selection.$from.marks());if(n){const r=n.filter(o=>e==null?void 0:e.includes(o.type.name));t.tr.ensureMarks(r)}}const oK=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:o})=>{const{selection:s,doc:a}=e,{$from:l,$to:u}=s,c=o.extensionManager.attributes,f=Tp(c,l.node().type.name,l.node().attrs);if(f.id=J1(),f.extend&&(f.extend=!1),s instanceof Le&&s.node.isBlock)return!l.parentOffset||!pr(a,l.pos)?!1:(r&&(t&&fE(n,o.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;if(r){const p=u.parentOffset===u.parent.content.size;s instanceof Ae&&e.deleteSelection();const m=l.depth===0?void 0:s4(l.node(-1).contentMatchAt(l.indexAfter(-1)));let g=p&&m?[{type:m,attrs:f}]:void 0,b=pr(e.doc,e.mapping.map(l.pos),1,g);if(!g&&!b&&pr(e.doc,e.mapping.map(l.pos),1,m?[{type:m}]:void 0)&&(b=!0,g=m?[{type:m,attrs:f}]:void 0),b&&(g||(g=[{type:l.node().type,attrs:f}]),e.split(e.mapping.map(l.pos),1,g),m&&!p&&!l.parentOffset&&l.parent.type!==m)){const y=e.mapping.map(l.before()),w=e.doc.resolve(y);l.node(-1).canReplaceWith(w.index(),w.index()+1,m)&&e.setNodeMarkup(e.mapping.map(l.before()),m)}t&&fE(n,o.extensionManager.splittableMarks),e.scrollIntoView()}return!0},iK=t=>({tr:e,state:n,dispatch:r,editor:o})=>{var y;const s=hn(t,n.schema),{$from:a,$to:l}=n.selection,u=n.selection instanceof Le?n.selection.node:null;if(u!=null&&u.isBlock||a.depth<2||!a.sameParent(l))return!1;const c=a.node(-1);if(c.type!==s)return!1;const f=o.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==s||a.index(-2)!==a.node(-2).childCount-1)return!1;if(r){let w=de.empty;const x=a.index(-1)?1:a.index(-2)?2:3;for(let A=a.depth-x;A>=a.depth-3;A-=1)w=de.from(a.node(A).copy(w));const E=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,S=Tp(f,a.node().type.name,a.node().attrs),C=((y=s.contentMatch.defaultType)==null?void 0:y.createAndFill(S))??void 0;w=w.append(de.from(s.createAndFill(null,C)??void 0));const _=a.before(a.depth-(x-1));e.replace(_,a.after(-E),new Ee(w,4-x,0));let T=-1;e.doc.nodesBetween(_,e.doc.content.size,(A,L)=>{if(T>-1)return!1;A.isTextblock&&A.content.size===0&&(T=L+1)}),T>-1&&e.setSelection(Ae.near(e.doc.resolve(T))),e.scrollIntoView()}return!0}const p=l.pos===a.end()?c.contentMatchAt(0).defaultType:null,m=Tp(f,c.type.name,c.attrs),g=Tp(f,a.node().type.name,a.node().attrs);m.id=J1(),g.id=J1(),e.delete(a.pos,l.pos);const b=p?[{type:s,attrs:m},{type:p,attrs:g}]:[{type:s,attrs:m}];if(!pr(e.doc,a.pos,2))return!1;if(r){const{selection:w,storedMarks:x}=n,{splittableMarks:E}=o.extensionManager,S=x??(w.$to.parentOffset&&w.$from.marks());if(e.split(a.pos,2,b).scrollIntoView(),!S||!r)return!0;const C=S.filter(_=>E.includes(_.type.name));e.ensureMarks(C)}return!0},sK=[Z1,yp,wp,Q1,xp,us,eb,El,nb,ob,tb,sa,cs,ds,rb,ib,N1,Hr],aK=Bt.create({priority:200,name:`${Hr}`,content:"block*",group:`${Hr}`,isolating:!0,selectable:!1,draggable:!1,isLeaf:!0,addOptions(){return{SystemAttributes:{},nodesComputed:{},View:Hs(rK),types:[],slots:{}}},addAttributes(){return{HTMLAttributes:{},id:{default:li(10)},pageNumber:{default:1},force:{default:!1},viewSuperTextArea:{default:!0},slots:{default:this.options.slots,renderHTML:()=>({})}}},parseHTML(){return[{tag:`div[data-type="${this.name}"]`}]},renderHTML({node:t,HTMLAttributes:e}){return["div",{...vt(e),"data-type":this.name},0]},addCommands(){return{splitBlock:oK,splitListItem:iK,autoPaging:(t=!0)=>({tr:e,state:n,dispatch:r,editor:o})=>(r&&e.setMeta("runState",t),!0),setPageBreak:()=>({tr:t,state:e,dispatch:n,editor:r})=>(n&&t.setMeta("splitPage",!0),!0),togglePagePlugin:t=>({tr:e,dispatch:n})=>(e.setMeta("disablePage",t),n&&n(e),!0)}},addGlobalAttributes(){return[{types:sK.concat(this.options.types||[]),attributes:{id:{default:null},extend:{default:!1}}}]},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.first(({commands:r})=>[()=>r.undoInputRule(),()=>r.command(({tr:o})=>{const{selection:s,doc:a}=o,{empty:l,$anchor:u}=s,{pos:c,parent:f}=u,p=De.atStart(a).from===c;return!l||!p||!f.type.isTextblock||f.textContent.length?!1:r.clearNodes()}),()=>pE(r),()=>r.joinBackward(),()=>r.selectNodeBackward(),()=>r.command(({editor:o,tr:s})=>{const{selection:a,doc:l}=s,{$anchor:u}=a,{pos:c}=u;if(l.childCount===1)return!1;if(De.atEnd(l).from===c&&!u.parentOffset)return r.deleteNode(Hr);const f=Zo(p=>p.type.name===Hr)(a);if(f){if(!f.node.firstChild)return r.deleteNode(Hr);const p=f.node.firstChild.type;if(f.start+De.atStart(f.node).from===c){const g=Ae.create(l,f.start-2,f.start-2),b=Zo(y=>y.type.name===Hr)(g);if(b){const y=De.atEnd(b.node).from+b.start,w=Ae.create(l,y,y);if(p===b.node.lastChild.type){const{parent:x}=w.$anchor;return rq(x,o.schema)?s.setSelection(w):s.step(new pn(y,c,Ee.empty)),!0}s.setSelection(w)}return!0}}return!1})]),Delete:()=>this.editor.commands.first(({commands:r})=>[()=>pE(r),()=>r.command(({tr:o})=>{const{selection:s,doc:a}=o,{$anchor:l}=s,u=l.node(),c=Zo(f=>f.type.name===El)(s);return c&&c.start+De.atStart(c.node).from===l.pos&&c.node.childCount===1&&u.content.size===0?!0:r.joinForward()}),()=>r.selectNodeForward(),()=>r.command(({tr:o})=>{const{selection:s,doc:a}=o,{$anchor:l}=s,{pos:u}=l;if(a.childCount===1)return!1;if(De.atEnd(a).from===u)return r.deleteNode(Hr);const c=Zo(f=>f.type.name===Hr)(s);if(c&&c.start+De.atEnd(c.node).from===u){const p=Ae.create(a,u+2,u+2),m=Zo(g=>g.type.name===Hr)(p);if(m){const g=De.atStart(m.node).from+m.start,b=Ae.create(a,g,g);if(Zo(w=>w.attrs.extend)(b))return o.step(new pn(u,g,Ee.empty)),!0}}return!1})]),Tab:()=>this.editor.commands.first(({commands:r})=>[()=>!0]),"Mod-Enter":()=>this.editor.commands.setPageBreak()}},addNodeView(){return this.options.View}});function Tp(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const o=t.find(s=>s.type===e&&s.name===r);return o?o.attribute.keepOnSplit:!1}))}const pE=t=>t.command(({tr:e})=>{const{selection:n,doc:r}=e,o=a4(r,{from:n.from,to:n.to},s=>s.type.name===El);for(const s of o){const a=s.pos+s.node.nodeSize;if(n.from<s.pos||n.to>a)return!0}return t.deleteSelection()}),lK=Ze.create({name:"fontFamily",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:t=>t.style.fontFamily,renderHTML:t=>t.fontFamily?{style:`font-family: ${t.fontFamily}`}:{}}}}]},addCommands(){return{setFontFamily:t=>({chain:e})=>e().setMark("textStyle",{fontFamily:t}).run(),unsetFontFamily:()=>({chain:t})=>t().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}}}),uK=["data-font"],cK=i.defineComponent({__name:"FontFamilyMenuButton",props:{editor:{},disabled:{type:Boolean,default:!1},color:{default:void 0},shortcutKeys:{default:void 0},maxHeight:{default:void 0},tooltip:{default:""},items:{default:()=>[]},customClass:{default:""}},setup(t){const e=t,n=i.computed(()=>e.editor.extensionStorage["base-kit"].mode===Fe.EDITOR),{t:r}=Tt(),o=[{label:r("editor.fontFamily.gulim"),value:"Gulim"},{label:r("editor.fontFamily.dotum"),value:"Dotum"},{label:r("editor.fontFamily.gungsuh"),value:"Gungsuh"}],s=i.inject("fontFamily"),a=i.computed(()=>{const p=e.editor.extensionManager.extensions.find(g=>g.name==="fontFamily").options;return nt.isEmpty(p.fontFamilyMap)&&(p.fontFamilyMap=o),[{label:r("editor.fontFamily.default"),value:r("editor.fontFamily.default")},...p.fontFamilyMap]}),l=i.computed(()=>{const p={label:r("editor.fontFamily.default"),value:r("editor.fontFamily.default")};return n.value?Xm(e.editor.state,"textStyle").fontFamily||p.value:s.value||p.value}),u=gt.useEventBus("fontFamily");function c(p){p.value===l.value||p.value===r("editor.fontFamily.default")?(e.editor.commands.unsetFontFamily(),s.value=null):(s.value=p.value,e.editor.commands.setFontFamily(p.value),u.emit())}const f=i.computed(()=>{var p;return(p=a.value.find(m=>m.value===l.value))==null?void 0:p.label});return(p,m)=>(i.openBlock(),i.createBlock(na,{disabled:p.disabled,tooltip:p.tooltip,title:f.value,btn_class:`min-w-24 ${p.customClass}`},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value,(g,b)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:b},[i.createVNode(i.unref(yl),{checked:l.value===g.value,onClick:y=>c(g)},{default:i.withCtx(()=>[i.createElementVNode("span",{class:"ml-1 h-full","data-font":g.label,style:i.normalizeStyle({fontFamily:g.value??void 0})},i.toDisplayString(g.label),13,uK)]),_:2},1032,["checked","onClick"]),g.label===i.unref(r)("editor.fontFamily.default")?(i.openBlock(),i.createBlock(i.unref(u1),{key:0})):i.createCommentVNode("",!0)],64))),128))]),_:1},8,["disabled","tooltip","title","btn_class"]))}}),hE=lK.extend({name:"fontFamily",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),types:["textStyle"],fontFamilyMap:[],button({editor:e,extension:n,t:r}){return{component:cK,componentProps:{editor:e,disabled:!e.can().setFontFamily(""),tooltip:r("editor.fontFamily.tooltip"),customClass:"border border-gray-300 rounded-none text-gray-500 px-2.5 h-[26px]"}}}}},addGlobalAttributes(){return[{types:["paragraph","heading","textStyle"],attributes:{style:{default:null,parseHTML:t=>t.style.fontFamily||null,renderHTML:t=>t.style?{style:`font-family: ${t.style}`}:{}},fontFamily:{default:null,parseHTML:t=>t.style.fontFamily.replace(/['"]/g,""),renderHTML:t=>t.fontFamily?{style:`font-family: ${t.fontFamily}`}:{}}}}]},addCommands(){return{setFontFamily:t=>({chain:e})=>e().setMark("textStyle",{fontFamily:t}).run(),unsetFontFamily:()=>({chain:t})=>t().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}},addStorage(){return{value:null}},onUpdate(){this.storage.value=this.editor.getAttributes("textStyle").fontFamily}}),dK={class:"flex gap-2"},fK=["disabled"],pK=To(i.defineComponent({__name:"FontSizeIncreaseDecrease",props:{editor:Object},setup(t){const e=i.inject("fontSize"),n=i.computed(()=>e.value?parseInt(e.value)===parseInt(x0[0])||parseInt(e.value)<parseInt(x0[0]):!1),r=gt.useEventBus(ir.INCREASE_DECREASE_FONTSIZE),o=s=>{r.emit(s)};return(s,a)=>{const l=hl,u=pl,c=ml;return i.openBlock(),i.createElementBlock("div",dK,[i.createVNode(c,null,{default:i.withCtx(()=>[i.createVNode(u,{"delay-duration":0},{default:i.withCtx(()=>[i.createVNode(l,null,{default:i.withCtx(()=>[i.createElementVNode("button",{class:"btn",onClick:a[0]||(a[0]=f=>o(!0))},[i.createVNode(i.unref(Ft),{name:"Plus",class:"w-6 h-6"})])]),_:1}),i.createVNode(i.unref(Qs),null,{default:i.withCtx(()=>a[2]||(a[2]=[i.createTextVNode(" 글꼴 크기 크게 ")])),_:1})]),_:1})]),_:1}),i.createVNode(c,null,{default:i.withCtx(()=>[i.createVNode(u,{"delay-duration":0},{default:i.withCtx(()=>[i.createVNode(l,null,{default:i.withCtx(()=>[i.createElementVNode("button",{class:"btn",onClick:a[1]||(a[1]=f=>o(!1)),disabled:i.unref(n)},[i.createVNode(i.unref(Ft),{name:"Minus",class:"w-6 h-6"})],8,fK)]),_:1}),i.createVNode(i.unref(Qs),null,{default:i.withCtx(()=>a[3]||(a[3]=[i.createTextVNode(" 글꼴 크기 작게 ")])),_:1})]),_:1})]),_:1})])}}}),[["__scopeId","data-v-250d04b3"]]),hK=Pn.create({name:"fontSizeIncreaseDecrease",addOptions(){return{defaultSize:"14px",button({editor:t}){return{component:pK,componentProps:{editor:t}}}}},addAttributes(){return{size:{default:this.options.defaultSize,parseHTML:t=>t.style.fontSize||this.options.defaultSize,renderHTML:t=>t.size?{style:`font-size: ${t.size}`}:{}}}},addCommands(){return{setFontSizeIncreaseDecrease:t=>({commands:e})=>e.setMark("textStyle",{fontSize:t})}}}),hb=Ze.create({name:"painter",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,extension:n,t:r})=>({component:Ke,componentProps:{action:()=>{e.commands.setPainter(e==null?void 0:e.state.selection.$head.marks())},icon:"PaintRoller",tooltip:r("editor.format")}})}},addCommands(){return{setPainter:t=>({view:{dispatch:e,state:{tr:n},dom:r}})=>{const a=`url("data:image/svg+xml;utf8,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="#000" d="M9 22v-6H4V7q0-1.65 1.175-2.825T8 3h12v13h-5v6zM6 10h12V5h-1v4h-2V5h-1v2h-2V5H8q-.825 0-1.412.588T6 7zm0 4h12v-2H6zm0 0v-2z"/></svg>')}"), auto`;return r.style.cursor=a,e(n.setMeta("painterAction",{type:"start",marks:t})),!0}}},addProseMirrorPlugins(){return[new Ne({key:new Et("format-painter"),state:{init:()=>[],apply:(t,e)=>{const n=t.getMeta("painterAction");return n&&n.type==="start"?e=n.marks:n&&n.type==="end"&&(e=[]),e}},props:{handleDOMEvents:{mousedown(t,e){const n=this.getState(t.state);if(!n||n.length==0)return t.dom.style.cursor="",!1;const r=()=>{document.removeEventListener("mouseup",r);const{dispatch:o,state:{selection:s},dom:a}=t;let l=t.state.tr;a.style.cursor="",l=l.removeMark(s.from,s.to);for(const u of n)u.type.name!="link"&&(l=l.addMark(s.from,s.to,u));o(l.setMeta("painterAction",{type:"end"}))};return document.addEventListener("mouseup",r),!0}}}})]}}),mb=()=>li(10),mE=new Et("attrkey"),mK=t=>new Ne({key:mE,state:{init:()=>!1,apply:n=>n.getMeta("initSplit")},appendTransaction(n,r,o){const{tr:s}=o;let a=!1;const l=mE.getState(o);if(n.some(c=>c.getMeta("composition")))return null;if(l||n.some(c=>c.docChanged)){const c=[];o.doc.descendants((f,p,m,g)=>{const{attrs:b}=f,y=c.includes(b.id)?mb():b.id||mb();t.includes(f.type.name)&&(s.setNodeMarkup(p,void 0,{...b,id:y,"number-line":g+1}),a=!0),c.push(y)})}return a?s:null}}),gE=[Z1,yp,wp,Q1,xp,us,eb,El,nb,ob,tb,sa,cs,ds,rb,ib,N1,Hr],gK=Ze.create({name:"autoId",addGlobalAttributes(){return[{types:gE.concat(this.options.types||[]),attributes:{id:{default:mb()},extend:{default:!1},class:{default:null},"number-line":{default:null}}}]},addProseMirrorPlugins(){return[mK(gE.concat(this.options.types||[]))]}}),bK=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,vK=Bt.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",vt(this.options.HTMLAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[h4({find:bK,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}}),yK=["src","alt"],wK={key:0,class:"image-resizer"},xK=["onMousedown","onTouchstart"],CK=i.defineComponent({__name:"ImageView",props:{...zs,selected:{type:Boolean,required:!0}},setup(t){const e=t,n={TOP_LEFT:"tl",TOP_RIGHT:"tr",BOTTOM_LEFT:"bl",BOTTOM_RIGHT:"br"},r=i.ref({width:aw,height:aw}),o=i.ref({width:0,height:0}),s=i.ref(!1),a=i.ref({x:0,y:0,w:0,h:0,dir:""}),l=i.computed(()=>{const{src:S,alt:C,width:_,height:T,flipX:A,flipY:L}=e.node.attrs,I=[];A&&I.push("rotateX(180deg)"),L&&I.push("rotateY(180deg)");const M=I.join(" ");return{src:S||void 0,alt:C||void 0,style:{width:C0(_)?`${_}px`:_,height:C0(T)?`${T}px`:T,transform:M||"none"}}});i.computed(()=>({width:i.unref(l).style.width==="100%"?"100%":void 0}));const u=i.ref(null),c=new ResizeObserver(S=>{for(const C of S){const{width:_,height:T}=C.contentRect;o.value={width:_,height:T},e.updateAttributes({originWidth:_,originHeight:T})}});function f(){const{editor:S,getPos:C}=e;S.commands.setNodeSelection(C())}const p=nt.throttle(()=>{const{editor:S}=e;r.value.width=parseInt(getComputedStyle(S.view.dom).width,10)},lw);function m(S,C){S.preventDefault(),S.stopPropagation();let _=0,T=0;const A=document.querySelector(".image-resizer");if(A&&(A.style.borderColor="#3b82f6"),"touches"in S&&S.touches.length>0)_=S.touches[0].clientX,T=S.touches[0].clientY;else if("clientX"in S)_=S.clientX,T=S.clientY;else return;const{width:L,height:I}=i.unref(o),M=L/I;let W=Number(e.node.attrs.width)||L,j=Number(e.node.attrs.height)||Math.round(W/M);const K=i.unref(r).width;W=Math.min(W>K?K:W,K),j=Math.round(W/M),Object.assign(a.value,{x:_,y:T,w:W,h:j,dir:C}),s.value=!0,y()}const g=nt.throttle(S=>{if(!i.unref(s))return;let C=0;if("touches"in S&&S.touches.length>0)C=S.touches[0].clientX;else if("clientX"in S)C=S.clientX;else return;const{x:_,w:T,dir:A}=i.unref(a),L=(C-_)*(/l/.test(A)?-1:1),I=WB(T+L,PB,i.unref(r).width);e.updateAttributes({width:I})},lw),b=S=>{S.preventDefault(),S.stopPropagation();const C=document.querySelector(".image-resizer");C&&(C.style.borderColor=""),i.unref(s)&&(s.value=!1,Object.assign(a.value,{x:0,y:0,w:0,h:0,dir:""}),w(),f())};function y(){document.addEventListener("mousemove",g,!0),document.addEventListener("mouseup",b,!0),document.addEventListener("touchmove",g,!0),document.addEventListener("touchend",b,!0)}function w(){document.removeEventListener("mousemove",g,!0),document.removeEventListener("mouseup",b,!0),document.removeEventListener("touchmove",g,!0),document.removeEventListener("touchend",b,!0)}const x=new ResizeObserver(p),E=i.computed(()=>{const{textAlign:S}=e.node.attrs;return{left:"margin-right: auto;",right:"margin-left: auto;",center:"margin-left: auto; margin-right: auto;"}[S]||""});return i.onMounted(()=>{u.value&&c.observe(u.value),x.observe(e.editor.view.dom)}),i.onBeforeUnmount(()=>{w(),c.disconnect(),x.disconnect()}),(S,C)=>(i.openBlock(),i.createBlock(i.unref($s),{class:"node-image"},{default:i.withCtx(()=>[i.createElementVNode("div",{class:"image-view",style:i.normalizeStyle([{width:l.value.style.width,height:l.value.style.height},E.value])},[i.createElementVNode("div",{draggable:"true","data-drag-handle":"",class:i.normalizeClass([{"image-view__body--focused":t.selected,"image-view__body--resizing":s.value},"image-view__body"])},[i.createElementVNode("img",{ref_key:"imageRef",ref:u,src:l.value.src,alt:l.value.alt,class:"block w-full image-view__body__image",style:i.normalizeStyle([{transform:l.value.style.transform}]),onClick:f},null,12,yK),S.editor.view.editable?i.withDirectives((i.openBlock(),i.createElementBlock("div",wK,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(Object.values(n),_=>(i.openBlock(),i.createElementBlock("span",{key:_,class:i.normalizeClass([`image-resizer__handler--${_}`,"image-resizer__handler"]),onMousedown:T=>m(T,_),onTouchstart:i.withModifiers(T=>m(T,_),["prevent"])},null,42,xK))),128))],512)),[[i.vShow,t.selected||s.value]]):i.createCommentVNode("",!0)],2)],4)]),_:1}))}}),EK=To(CK,[["__scopeId","data-v-6435a6f3"]]),gb=vK.extend({group:"block",defining:!0,isolating:!0,addAttributes(){var t;return{...(t=this.parent)==null?void 0:t.call(this),flipX:{default:!1},flipY:{default:!1},originWidth:{default:null},originHeight:{default:null},textAlign:{default:"left",parseHTML:e=>e.style.textAlign||e.getAttribute("textAlign")||null,renderHTML:e=>({textAlign:e.textAlign})},width:{default:"100%",parseHTML:e=>{const n=e.style.width||e.getAttribute("width")||null;return n&&n.endsWith("%")?n:n==null?null:parseInt(n,10)},renderHTML:e=>({width:e.width})},class:{default:"",parseHTML:e=>e.getAttribute("class")||"",renderHTML:e=>({class:e.class})},"data-memo":{default:"",parseHTML:e=>e.getAttribute("data-memo")||"",renderHTML:e=>({"data-memo":e["data-memo"]})}}},addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this)}},addNodeView(){return Hs(EK)},addCommands(){var t;return{...(t=this.parent)==null?void 0:t.call(this),updateImage:e=>({commands:n,editor:r})=>n.updateAttributes(this.name,e)}},renderHTML({node:t,HTMLAttributes:e}){const{textAlign:n,flipX:r,flipY:o}=t.attrs,l=`${{left:"margin-right: auto;",right:"margin-left: auto;",center:"margin-left: auto; margin-right: auto;"}[n]||""} ${r||o?`transform: rotateX(${r?"180":"0"}deg) rotateY(${o?"180":"0"}deg);`:""}`;return["img",vt({height:"auto",style:l},this.options.HTMLAttributes,e)]},parseHTML(){return[{tag:"img[src]"}]},addProseMirrorPlugins(){return[new Ne({props:{handleTextInput(t){const{selection:e}=t.state;return e instanceof Le&&e.node.type.name==="image"},handlePaste(t){const{selection:e}=t.state;return e instanceof Le&&e.node.type.name==="image"}}})]}}),SK=["paragraph","heading","list_item","todo_item"];function kK(t,e){const{selection:n,doc:r}=t;if(!n||!r||!(n instanceof Ae||n instanceof In))return t;const{from:o,to:s}=n,a=[],l=e&&e!==uw?e:null;return r.nodesBetween(o,s,(u,c)=>{const f=u.type;return SK.includes(f.name)?((u.attrs.lineHeight||null)!==l&&a.push({node:u,pos:c,nodeType:f}),f.name!=="list_item"&&f.name!=="todo_item"):!0}),a.length&&a.forEach(u=>{const{node:c,pos:f,nodeType:p}=u;let{attrs:m}=c;m={...m,lineHeight:l},t=t.setNodeMarkup(f,p,m,c.marks)}),t}function _K(t){return({state:e,dispatch:n})=>{const{selection:r}=e;let{tr:o}=e;return o=o.setSelection(r),o=kK(o,t),o.docChanged?(n&&n(o),!0):!1}}const TK=i.defineComponent({__name:"LineHeightDropdown",props:{editor:{},icon:{default:void 0},tooltip:{default:void 0},disabled:{type:Boolean,default:!1},action:{type:Function,default:void 0},isActive:{type:Function,default:void 0}},setup(t){const{t:e}=Tt();function n(l){return parseFloat(l.replace("%",""))/100}const r=i.computed(()=>{const c=s.editor.extensionManager.extensions.find(f=>f.name==="lineHeight").options.lineHeights.map(f=>({label:n(f),value:f}));return c.unshift({label:i.unref(e)("editor.default"),value:"default"}),c}),o=i.ref("default"),s=t;function a(l){l==="default"?s.editor.commands.unsetLineHeight():s.editor.commands.setLineHeight(l),o.value=l}return(l,u)=>(i.openBlock(),i.createBlock(na,{icon:l.icon,tooltip:l.tooltip,disabled:l.disabled},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.value,(c,f)=>(i.openBlock(),i.createBlock(i.unref(yl),{key:f,checked:c.value===o.value,onClick:p=>a(c.value)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(c.label),1)]),_:2},1032,["checked","onClick"]))),128))]),_:1},8,["icon","tooltip","disabled"]))}}),bE=Ze.create({name:"lineHeight",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),types:["paragraph","heading","list_item","todo_item"],lineHeights:["100%","115%","150%","200%","250%","300%"],defaultHeight:uw,button({editor:e,t:n}){return{component:TK,componentProps:{editor:e,icon:"LineHeight",tooltip:n("editor.lineheight.tooltip")}}}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:t=>t.style.lineHeight||this.options.defaultHeight,renderHTML:t=>t.lineHeight===this.options.defaultHeight||!t.lineHeight?{}:{style:`line-height: ${t.lineHeight}`}}}}]},addCommands(){return{setLineHeight:t=>_K(t),unsetLineHeight:()=>({commands:t})=>this.options.types.every(e=>t.resetAttributes(e,"lineHeight"))}}}),AK=Bt.create({name:"column",content:"block+",isolating:!0,addAttributes(){return{position:{default:"",parseHTML:t=>t.getAttribute("data-position"),renderHTML:t=>({"data-position":t.position})}}},renderHTML({HTMLAttributes:t}){return["div",vt(t,{"data-type":"column"}),0]},parseHTML(){return[{tag:'div[data-type="column"]'}]}});var aa=(t=>(t.SidebarLeft="sidebar-left",t.SidebarRight="sidebar-right",t.TwoColumn="two-column",t))(aa||{});const bb=Bt.create({name:"columns",group:"columns",content:"column+",defining:!0,isolating:!0,addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),layout:"two-column"}},addAttributes(){return{layout:{default:"two-column"}}},addCommands(){return{setColumns:()=>({commands:t})=>(t.insertContent('<div data-type="columns"><div data-type="column" data-position="left"><p></p></div><div data-type="column" data-position="right"><p></p></div></div>'),!0),setLayout:t=>({commands:e})=>e.updateAttributes("columns",{layout:t})}},renderHTML({HTMLAttributes:t}){return["div",{"data-type":"columns",class:`layout-${t.layout}`},0]},parseHTML(){return[{tag:'div[data-type="columns"]'}]},addExtensions(){return[AK.configure(this.options.columnOptions)]}}),vE=i.defineComponent({__name:"DialogDescription",props:{asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,n=i.computed(()=>{const{class:o,...s}=e;return s}),r=Gn(n);return(o,s)=>(i.openBlock(),i.createBlock(i.unref(iL),i.mergeProps(i.unref(r),{class:i.unref(Te)("text-sm text-ed-muted-foreground",e.class)}),{default:i.withCtx(()=>[i.renderSlot(o.$slots,"default")]),_:3},16,["class"]))}}),OK={class:"flex gap-x-2 items-center"},MK={class:"sr-only"},BK={class:"flex justify-end gap-x-2.5 flex-1"},IK=["disabled"],Ap=To(i.defineComponent({__name:"SuperInputDialogMoblie",props:{editor:{},open:{type:Boolean},superTextInit:{},superTextId:{},superTextElementId:{},isViewMode:{type:Boolean},title:{}},emits:["close","save","delete"],setup(t,{emit:e}){const n=e,r=t,{t:o}=Tt(),s=i.ref(""),a=i.ref(!1),l=i.ref(r.isViewMode??!1),u=i.ref(!1);i.watch(()=>r.isViewMode,g=>{l.value=g,g||(s.value="")});const c=i.computed(()=>{var b;if(!s.value)return!0;const g=document.createElement("div");return g.innerHTML=s.value,((b=g==null?void 0:g.textContent)==null?void 0:b.trim())===""});i.watch(()=>r.open,()=>{r.open&&r.superTextInit&&(s.value=r.superTextInit)});const f=()=>{n("close"),a.value=!1,l.value=!0,u.value=!1},p=()=>{n("save",s.value),s.value="",l.value=!0,u.value=!1},m=()=>{u.value=!0,l.value=!1};return(g,b)=>{const y=_p,w=kp,x=Sp,E=vE,S=db,C=Ep,_=Cp;return i.openBlock(),i.createBlock(_,{open:g.open},{default:i.withCtx(()=>[i.createVNode(C,{isOverlayTransparent:"",class:"p-2.5 gap-0 gap-y-2.5 border-none w-[calc(100%-40px)] !shadow-ed rounded-[5px]"},{default:i.withCtx(()=>[i.createVNode(x,{class:"text-left flex-row justify-between"},{default:i.withCtx(()=>[i.createVNode(y,{class:"text-base font-normal"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(g.title?g.title:i.unref(o)("editor.superinput")),1)]),_:1}),i.createElementVNode("div",OK,[i.withDirectives(i.createElementVNode("button",{onClick:m},[i.createVNode(i.unref(Jg),{icon:"lucide:edit-2"})],512),[[i.vShow,l.value]]),i.createVNode(w,{class:"outline-none",onClick:f},{default:i.withCtx(()=>[i.createVNode(i.unref(Df),{class:"w-5 h-5"}),i.createElementVNode("span",MK,i.toDisplayString(i.unref(o)("editor.close")),1)]),_:1})])]),_:1}),i.createVNode(E,{class:"hidden"}),i.createVNode(fb,{isReadOnly:l.value,modelValue:s.value,"onUpdate:modelValue":b[0]||(b[0]=T=>s.value=T),"parent-editor":g.editor},null,8,["isReadOnly","modelValue","parent-editor"]),i.createVNode(S,{class:"flex-row justify-between"},{default:i.withCtx(()=>[i.withDirectives(i.createElementVNode("button",{onClick:b[1]||(b[1]=T=>n("delete"))},i.toDisplayString(i.unref(o)("editor.delete")),513),[[i.vShow,u.value]]),i.withDirectives(i.createElementVNode("div",BK,[i.createElementVNode("button",{onClick:f},i.toDisplayString(i.unref(o)("editor.menubar.menu.cancel")),1),i.createElementVNode("button",{onClick:p,disabled:i.unref(c),class:i.normalizeClass({"cursor-not-allowed":i.unref(c)})},i.toDisplayString(i.unref(o)("editor.menubar.menu.save")),11,IK)],512),[[i.vShow,u.value||!l.value]])]),_:1})]),_:1})]),_:1},8,["open"])}}}),[["__scopeId","data-v-5e572fda"]]);function RK(t){let e=t;for(;e&&e!==document.body;){if(e.nodeType===1){const n=e;if(n.id==="editor-panel")return n}e=e.parentNode}return null}const vb=t=>{var n;if(!t)return!0;const e=document.createElement("div");return e.innerHTML=t,((n=e==null?void 0:e.textContent)==null?void 0:n.trim())===""},yE=8;function LK(t){const e=i.ref(!1);let n=!1,r=null,o=null,s=null,a=null,l=0,u=0;function c(x){const E=x.cloneNode(!0);return E.style.position="fixed",E.style.pointerEvents="none",E.style.opacity="0.9",E.style.zIndex="9999",E.style.transform="translate(-50%, -50%)",E.style.left="0px",E.style.top="0px",document.body.appendChild(E),E}function f(){o&&o.parentElement&&o.parentElement.removeChild(o),o=null}function p(){try{if(typeof t.getPos=="function"){const x=t.getPos();if(typeof x=="number"&&x>=0)return x}}catch{}return null}function m(x,E){e.value||(a=p(),document.body.style.userSelect="none",document.body.style.touchAction="none",E&&(o=c(E),o.style.left=`${x.clientX}px`,o.style.top=`${x.clientY}px`),e.value=!0,n=!1,s=null)}function g(){r=null,a=null,s=null,n=!1,e.value=!1,f(),document.body.style.userSelect="",document.body.style.touchAction=""}function b(x){if(e.value)return;const E=x.changedTouches[0];r=E.identifier,l=E.clientX,u=E.clientY,n=!0,a=null,s=null}function y(x){var T;if(!n&&!e.value||r===null)return;const E=Array.from(x.changedTouches).find(A=>A.identifier===r);if(!E)return;const S=E.clientX-l,C=E.clientY-u,_=S*S+C*C;if(!e.value&&n&&_>=yE*yE){const A=x.currentTarget||x.target||null;m(E,A)}if(e.value){o&&(o.style.left=`${E.clientX}px`,o.style.top=`${E.clientY}px`);try{const A=(T=t.editor)==null?void 0:T.view;if(!A){s=null;return}const L=A.posAtCoords({left:E.clientX,top:E.clientY});L&&typeof L.pos=="number"?s=L.pos:s=null}catch{s=null}}}async function w(x){var E;if(e.value){if(document.body.style.userSelect="",document.body.style.touchAction="",f(),e.value=!1,a===null||s===null){g();return}const S=(E=t.editor)==null?void 0:E.view;if(!S){g();return}const C=S.state.doc.nodeAt(a);if(!C){g();return}const _=C.nodeSize,T=a,A=T+_,L=s;if(L>=T&&L<=A){g();return}let I=L;L>T&&(I=L-_);const M=S.state.doc.content.size;I<0&&(I=0),I>M&&(I=M);const W=C.type.create(C.attrs),j=S.state.tr;j.delete(T,A),j.insert(I,W),S.dispatch(j),g();return}if(n){g();return}}return{onTouchStart:b,onTouchMove:y,onTouchEnd:w}}const PK=["book-mark-node-id","page-id","page-number","book-mark-content","node-id","element-id","line-id"],DK=i.defineComponent({__name:"SuperText",props:zs,setup(t){const e=t,n=i.ref(!1),r=i.ref(null),{selection:o,doc:s}=e.editor.state,a=i.ref(!1),l=i.inject("isMobile",!1),u=gt.useEventBus(ir.RENDER_SUPER_TEXT),{onTouchStart:c,onTouchMove:f,onTouchEnd:p}=LK(e),m=i.computed(()=>{var M,W;const T=s.resolve(o.from),A=T==null?void 0:T.node(-1),L=(M=A==null?void 0:A.attrs)==null?void 0:M.id,I=(W=A==null?void 0:A.attrs)==null?void 0:W.pageNumber;return{pageId:L,pageNumber:I}}),g=i.computed(()=>{const T=e.getPos(),A=e.editor.state.doc.resolve(T);for(let L=A.depth;L>0;L--){const I=A.node(L);if(I.type.name==="paragraph")return I}return null}),b=i.computed(()=>{var T;return((T=g.value)==null?void 0:T.attrs.id)||""}),y=i.inject("canEditSuper",i.ref(!0));function w(T){var j,K;if(vb(T)){S();return}const A=e.getPos(),L=(j=e.editor)==null?void 0:j.state.doc.nodeAt(A),I=T.trim(),{[tt.ELEMENT_ID]:M,...W}=(L==null?void 0:L.attrs)||{};(K=e.editor)==null||K.view.dispatch(e.editor.state.tr.setNodeMarkup(A,void 0,{...W,[tt.TEXT]:I})),requestAnimationFrame(()=>{e.editor.commands.setTextSelection(A+1),e.editor.view.focus()})}function x(T){const A=e.node.attrs[tt.TEXT],L=e.node.attrs[tt.ID],M={lineId:T.target.querySelector(`[node-id="${L}"]`).getAttribute("line-id"),dataId:L,text:A};u.emit({action:"hover",payload:M})}function E(T){const A=e.node.attrs[tt.ID],I={lineId:T.target.querySelector(`[node-id="${A}"]`).getAttribute("line-id"),dataId:A,text:""};u.emit({action:"hover",payload:I})}function S(){const{getPos:T,node:A,editor:L}=e,I=T(),M=I+1;L.commands.deleteRange({from:I,to:M})}function C(){if(!y.value)return;const{attributes:T}=e.editor.options.editorProps;if(T&&T.id===nr.COMMENT){const A=document.getElementById(nr.COMMENT);if((A==null?void 0:A.getAttribute(nr.DISABLE_SUPER_INPUT))==="true")return}e.editor.view.dom.blur(),n.value=!0}function _(){l&&(a.value=!0,C())}return(T,A)=>{const L=yn,I=cb,M=ub,W=lb,j=ab,K=dc;return i.openBlock(),i.createBlock(i.unref($s),{as:"span",class:i.normalizeClass(["w-fit text-inherit super-text align-middle",{"text-red-600 !leading-[13px]":i.unref(l)}]),"data-drag-handle":"",draggable:i.unref(y),contenteditable:"false",onPointerdown:A[3]||(A[3]=i.withModifiers(()=>{},["stop"])),onTouchstartPassive:i.unref(c),onTouchmovePassive:i.unref(f),onTouchendPassive:i.unref(p),onTouchcancelPassive:i.unref(p)},{default:i.withCtx(()=>[i.createVNode(j,null,{default:i.withCtx(()=>[i.createVNode(I,{as:"template",class:"relative",disabled:!i.unref(y)||i.unref(l)},{default:i.withCtx(()=>[i.createVNode(L,{class:i.normalizeClass([{"pointer-events-none":!i.unref(y)},"!p-0 !m-0 !h-fit"]),variant:"ghost",onDblclick:i.withModifiers(C,["stop"]),onClick:_,onMouseenter:x,onMouseleave:E},{default:i.withCtx(()=>[i.createVNode(i.unref(Ft),{name:"fileEdit",class:i.normalizeClass({"w-[13px] h-auto":i.unref(l)})},null,8,["class"]),i.createElementVNode("div",{ref_key:"bookMarkRef",ref:r,"book-mark-node-id":e.node.attrs[i.unref(tt).ID],"page-id":m.value.pageId,"page-number":m.value.pageNumber,"book-mark-content":e.node.attrs[i.unref(tt).TEXT],"node-id":e.node.attrs[i.unref(tt).ID],"element-id":e.node.attrs[i.unref(tt).ELEMENT_ID],"line-id":b.value},null,8,PK)]),_:1},8,["class"])]),_:1},8,["disabled"]),i.createVNode(W,null,{default:i.withCtx(()=>[i.createVNode(M,{onSelect:A[0]||(A[0]=se=>n.value=!0)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(T.$t("editor.super.edit")),1)]),_:1}),i.createVNode(M,{onSelect:S},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(T.$t("editor.super.delete")),1)]),_:1})]),_:1})]),_:1}),i.unref(l)?(i.openBlock(),i.createBlock(Ap,{key:1,open:n.value,"is-view-mode":a.value,editor:e.editor,"super-text-init":e.node.attrs[i.unref(tt).TEXT],"super-text-id":e.node.attrs[i.unref(tt).ID],"super-text-element-id":e.node.attrs[i.unref(tt).ELEMENT_ID],onClose:A[2]||(A[2]=se=>n.value=!1),onSave:w,onDelete:S},null,8,["open","is-view-mode","editor","super-text-init","super-text-id","super-text-element-id"])):(i.openBlock(),i.createBlock(K,{key:0,open:n.value,editor:e.editor,"super-text-init":e.node.attrs[i.unref(tt).TEXT],"super-text-element-id":e.node.attrs[i.unref(tt).ELEMENT_ID],onClose:A[1]||(A[1]=se=>n.value=!1),onSave:w},null,8,["open","editor","super-text-init","super-text-element-id"]))]),_:1},8,["class","draggable","onTouchstartPassive","onTouchmovePassive","onTouchendPassive","onTouchcancelPassive"])}}}),VK=new Ne({props:{handleKeyDown(t,e){var n;if(e.key==="Backspace"){const{state:r,dispatch:o}=t,{$from:s}=r.selection;if(s.parentOffset===1){const u=s.nodeAfter;if(u&&u.type.name==="superText"){const c=r.tr;c.delete(s.pos-1,s.pos);const f=r.schema.text("​");return c.insert(s.pos-1,de.from(f)),c.setSelection(Ae.create(c.doc,s.pos)),o(c),e.preventDefault(),!0}}const a=s.nodeBefore,l=s.nodeAfter;if(a&&a.isText&&((n=a.text)==null?void 0:n.length)===1&&l&&l.type.name==="superText"){const u=s.parent.childBefore(s.parentOffset-1).node;if(u&&u.type.name==="superText"){const c=r.tr;return c.delete(s.pos-1,s.pos),c.setSelection(Ae.create(c.doc,s.pos-1)),o(c),e.preventDefault(),!0}}}return!1}}}),FK=new Ne({appendTransaction(t,e,n){const r=new Set;let o=n.tr,s=!1;return n.doc.descendants((a,l)=>{if(a.type.name===fc){const u=a.attrs[tt.ID];if(!u||r.has(u)){const c=li();o=o.setNodeMarkup(l,void 0,{...a.attrs,[tt.ID]:c}),s=!0,r.add(c)}else r.add(u)}}),s?o:null}}),fc="superText",wE={UPDATE:"superTextUpdate"},xE=Bt.create({name:"superText",inline:!0,group:"inline",selectable:!1,defining:!0,draggable:!0,addStorage(){return{enable:!0,isShowSuperInputMoblie:!1,view:!0,items:[],toggleSuperViewMobileCallBack:this.options.toggleSuperViewMobileCallBack}},addOptions(){return{specialCharModal:null,button:({editor:t,t:e,isMobile:n})=>[...n?[{component:Ke,componentProps:{action:()=>{t.commands.toggleSuperInputMoblie()},isActive:()=>{},icon:"fileEdit",title:e("editor.menubar.menu.insertSuper"),tooltip:e("editor.menubar.menu.insertSuper"),customClass:"whitespace-nowrap !bg-ed-blue active:!bg-ed-blue/90 !transition-none !text-white !font-normal rounded-[3px] h-[26px] ml-auto",customClassTooltip:"ml-auto"}}]:[],{component:Ke,componentProps:{action:()=>t.commands.toggleSuperText(n),isActive:()=>t.storage.superText.enable,title:e("editor.menubar.menu.superView"),customClass:`whitespace-nowrap !text-white !font-normal rounded-[3px] h-[26px]
291
291
  ${n?"!bg-ed-blue":t.storage.superText.enable?"!bg-blue-700":"!bg-blue-500"}
292
292
  `,tooltip:"수퍼 보기"}}]}},addAttributes(){return{[tt.ID]:{default:null},[tt.TEXT]:{default:""},[tt.POSITION]:{default:"0"},[tt.ELEMENT_ID]:{default:""}}},addCommands(){return{toggleSuperText:t=>({editor:e})=>t?e.storage.superText.toggleSuperViewMobileCallBack():e.storage.superText.enable=!e.storage.superText.enable,toggleSuperInputMoblie:()=>({editor:t})=>t.storage.superText.isShowSuperInputMoblie=!t.storage.superText.isShowSuperInputMoblie}},parseHTML(){return[{tag:"button.super-text"}]},renderHTML({HTMLAttributes:t}){return["button",vt(t,{class:"super-text"})]},addNodeView(){return Hs(DK)},addProseMirrorPlugins(){return[new Ne({appendTransaction(t,e,n){let r=n.tr,o=!1;return n.doc.descendants((s,a)=>{if(s.type.name==="superText"){const l=s.attrs[tt.POSITION],u=String(a);l!==u&&(r=r.setNodeMarkup(a,void 0,{...s.attrs,[tt.POSITION]:u}),o=!0)}}),o?r:null}}),new Ne({filterTransaction(t,e){return t.steps.some(r=>{if(r.toJSON&&r.toJSON().stepType==="replace"){const o=r.toJSON();return o.slice&&o.slice.content&&o.slice.content.some(s=>s.type===fc)}return!1})&&t.setMeta(wE.UPDATE,!0),!0}}),VK,FK]}}),$K=["innerHTML"],zK=["book-mark-node-id","page-id","page-number","book-mark-content","node-id","line-id"],HK=i.defineComponent({__name:"ConfigPlan",props:zs,setup(t){const e=t,n=i.ref(!1),r=i.ref(null),{selection:o,doc:s}=e.editor.state,a=i.inject("isMobile"),l=i.ref(!1),u=gt.useEventBus(ir.RENDER_SUPER_TEXT),c=i.computed(()=>{var _,T;const x=s.resolve(o.from),E=x==null?void 0:x.node(-1),S=(_=E==null?void 0:E.attrs)==null?void 0:_.id,C=(T=E==null?void 0:E.attrs)==null?void 0:T.pageNumber;return{pageId:S,pageNumber:C}}),f=i.computed(()=>{const x=e.getPos(),E=e.editor.state.doc.resolve(x);for(let S=E.depth;S>0;S--){const C=E.node(S);if(C.type.name==="paragraph")return C}return null}),p=i.computed(()=>{var x;return((x=f.value)==null?void 0:x.attrs.id)||""});function m(x){e.updateAttributes({"data-text":x}),n.value=!1}function g(x){const E=e.node.attrs[tt.TEXT],S=e.node.attrs[tt.ID],_={lineId:x.target.querySelector(`[node-id="${S}"]`).getAttribute("line-id"),text:E};u.emit({action:"hover",payload:_})}function b(x){const E=e.node.attrs[tt.ID],C={lineId:x.target.querySelector(`[node-id="${E}"]`).getAttribute("line-id"),text:""};u.emit({action:"hover",payload:C})}function y(){const{getPos:x,node:E,editor:S}=e,C=x(),_=C+1;S.commands.deleteRange({from:C,to:_})}function w(){n.value=!0,a&&(l.value=!0)}return(x,E)=>{const S=yn,C=cb,_=ub,T=lb,A=ab,L=dc;return i.openBlock(),i.createBlock(i.unref($s),{as:"span",class:i.normalizeClass(["w-fit text-inherit super-text align-middle",{"!leading-[9px] [&_*]:!leading-[9px]":i.unref(a)}]),"data-drag-handle":"",draggable:"true",contenteditable:"false"},{default:i.withCtx(()=>[i.createVNode(A,null,{default:i.withCtx(()=>[i.createVNode(C,{as:"template",class:"relative"},{default:i.withCtx(()=>[i.createVNode(S,{variant:"ghost",class:"!p-0 !m-0 !h-fit font-normal !text-ed-blue",onClick:w,onMouseenter:g,onMouseleave:b},{default:i.withCtx(()=>[i.createVNode(i.unref(Ft),{name:"plan",class:i.normalizeClass({"w-[18px] h-auto pr-1":i.unref(a)})},null,8,["class"]),E[3]||(E[3]=i.createTextVNode(" [")),i.createElementVNode("span",{class:"[&_*]:inline",innerHTML:e.node.attrs[i.unref(tt).TEXT]},null,8,$K),E[4]||(E[4]=i.createTextVNode("] ")),i.createElementVNode("div",{ref_key:"bookMarkRef",ref:r,"book-mark-node-id":e.node.attrs[i.unref(tt).ID],"page-id":c.value.pageId,"page-number":c.value.pageNumber,"book-mark-content":e.node.attrs[i.unref(tt).TEXT],"node-id":e.node.attrs[i.unref(tt).ID],"line-id":p.value},null,8,zK)]),_:1})]),_:1}),i.createVNode(T,null,{default:i.withCtx(()=>[i.createVNode(_,{onSelect:E[0]||(E[0]=I=>n.value=!0)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(x.$t("editor.configPlan.edit")),1)]),_:1}),i.createVNode(_,{onSelect:y},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(x.$t("editor.configPlan.delete")),1)]),_:1})]),_:1})]),_:1}),i.unref(a)?(i.openBlock(),i.createBlock(Ap,{key:1,title:x.$t("editor.configPlan"),open:n.value,"is-view-mode":l.value,editor:e.editor,"super-text-init":e.node.attrs[i.unref(tt).TEXT],"super-text-id":e.node.attrs[i.unref(tt).ID],onClose:E[2]||(E[2]=I=>n.value=!1),onSave:m,onDelete:y},null,8,["title","open","is-view-mode","editor","super-text-init","super-text-id"])):(i.openBlock(),i.createBlock(L,{key:0,open:n.value,editor:e.editor,"super-text-init":e.node.attrs[i.unref(tt).TEXT],"super-text-element-id":e.node.attrs[i.unref(tt).ELEMENT_ID],onClose:E[1]||(E[1]=I=>n.value=!1),onSave:m},null,8,["open","editor","super-text-init","super-text-element-id"]))]),_:1},8,["class"])}}}),CE=Bt.create({name:"configPlan",inline:!0,group:"inline",atom:!0,draggable:!0,addStorage(){return{isShowConfigPlanInput:!1}},addOptions(){return{specialCharModal:null,button:({editor:t,t:e,isMobile:n})=>[...n?[{component:Ke,componentProps:{action:()=>{t.commands.toggleConfigPlanInput()},isActive:()=>{},icon:"plan",title:e("editor.insertConfigPlan"),tooltip:e("editor.insertConfigPlan"),customClass:"whitespace-nowrap !bg-ed-blue !text-white !font-normal rounded-[3px] h-[26px] gap-x-1 ml-auto",customClassTooltip:"ml-auto"}}]:[]]}},addAttributes(){return{"data-id":{default:null},"data-text":{default:""},"data-position":{default:"0"}}},addCommands(){return{toggleConfigPlanInput:()=>({editor:t})=>t.storage.configPlan.isShowConfigPlanInput=!t.storage.configPlan.isShowConfigPlanInput}},parseHTML(){return[{tag:"button.config-plan"}]},renderHTML({HTMLAttributes:t}){return["button",vt(t,{class:"config-plan"})]},addNodeView(){return Hs(HK)},addProseMirrorPlugins(){return[new Ne({appendTransaction(t,e,n){let r=n.tr,o=!1;return n.doc.descendants((s,a)=>{if(s.type.name==="configPlan"){const l=s.attrs["data-position"],u=String(a);l!==u&&(r=r.setNodeMarkup(a,void 0,{...s.attrs,"data-position":u}),o=!0)}}),o?r:null}})]}});var yb,wb;if(typeof WeakMap<"u"){let t=new WeakMap;yb=e=>t.get(e),wb=(e,n)=>(t.set(e,n),n)}else{const t=[];let n=0;yb=r=>{for(let o=0;o<t.length;o+=2)if(t[o]==r)return t[o+1]},wb=(r,o)=>(n==10&&(n=0),t[n++]=r,t[n++]=o)}var rn=class{constructor(t,e,n,r){this.width=t,this.height=e,this.map=n,this.problems=r}findCell(t){for(let e=0;e<this.map.length;e++){const n=this.map[e];if(n!=t)continue;const r=e%this.width,o=e/this.width|0;let s=r+1,a=o+1;for(let l=1;s<this.width&&this.map[e+l]==n;l++)s++;for(let l=1;a<this.height&&this.map[e+this.width*l]==n;l++)a++;return{left:r,top:o,right:s,bottom:a}}throw new RangeError(`No cell with offset ${t} found`)}colCount(t){for(let e=0;e<this.map.length;e++)if(this.map[e]==t)return e%this.width;throw new RangeError(`No cell with offset ${t} found`)}nextCell(t,e,n){const{left:r,right:o,top:s,bottom:a}=this.findCell(t);return e=="horiz"?(n<0?r==0:o==this.width)?null:this.map[s*this.width+(n<0?r-1:o)]:(n<0?s==0:a==this.height)?null:this.map[r+this.width*(n<0?s-1:a)]}rectBetween(t,e){const{left:n,right:r,top:o,bottom:s}=this.findCell(t),{left:a,right:l,top:u,bottom:c}=this.findCell(e);return{left:Math.min(n,a),top:Math.min(o,u),right:Math.max(r,l),bottom:Math.max(s,c)}}cellsInRect(t){const e=[],n={};for(let r=t.top;r<t.bottom;r++)for(let o=t.left;o<t.right;o++){const s=r*this.width+o,a=this.map[s];n[a]||(n[a]=!0,!(o==t.left&&o&&this.map[s-1]==a||r==t.top&&r&&this.map[s-this.width]==a)&&e.push(a))}return e}positionAt(t,e,n){for(let r=0,o=0;;r++){const s=o+n.child(r).nodeSize;if(r==t){let a=e+t*this.width;const l=(t+1)*this.width;for(;a<l&&this.map[a]<o;)a++;return a==l?s-1:this.map[a]}o=s}}static get(t){return yb(t)||wb(t,UK(t))}};function UK(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);const e=WK(t),n=t.childCount,r=[];let o=0,s=null;const a=[];for(let c=0,f=e*n;c<f;c++)r[c]=0;for(let c=0,f=0;c<n;c++){const p=t.child(c);f++;for(let b=0;;b++){for(;o<r.length&&r[o]!=0;)o++;if(b==p.childCount)break;const y=p.child(b),{colspan:w,rowspan:x,colwidth:E}=y.attrs;for(let S=0;S<x;S++){if(S+c>=n){(s||(s=[])).push({type:"overlong_rowspan",pos:f,n:x-S});break}const C=o+S*e;for(let _=0;_<w;_++){r[C+_]==0?r[C+_]=f:(s||(s=[])).push({type:"collision",row:c,pos:f,n:w-_});const T=E&&E[_];if(T){const A=(C+_)%e*2,L=a[A];L==null||L!=T&&a[A+1]==1?(a[A]=T,a[A+1]=1):L==T&&a[A+1]++}}}o+=w,f+=y.nodeSize}const m=(c+1)*e;let g=0;for(;o<m;)r[o++]==0&&g++;g&&(s||(s=[])).push({type:"missing",row:c,n:g}),f++}(e===0||n===0)&&(s||(s=[])).push({type:"zero_sized"});const l=new rn(e,n,r,s);let u=!1;for(let c=0;!u&&c<a.length;c+=2)a[c]!=null&&a[c+1]<n&&(u=!0);return u&&jK(l,a,t),l}function WK(t){let e=-1,n=!1;for(let r=0;r<t.childCount;r++){const o=t.child(r);let s=0;if(n)for(let a=0;a<r;a++){const l=t.child(a);for(let u=0;u<l.childCount;u++){const c=l.child(u);a+c.attrs.rowspan>r&&(s+=c.attrs.colspan)}}for(let a=0;a<o.childCount;a++){const l=o.child(a);s+=l.attrs.colspan,l.attrs.rowspan>1&&(n=!0)}e==-1?e=s:e!=s&&(e=Math.max(e,s))}return e}function jK(t,e,n){t.problems||(t.problems=[]);const r={};for(let o=0;o<t.map.length;o++){const s=t.map[o];if(r[s])continue;r[s]=!0;const a=n.nodeAt(s);if(!a)throw new RangeError(`No cell with offset ${s} found`);let l=null;const u=a.attrs;for(let c=0;c<u.colspan;c++){const f=(o+c)%t.width,p=e[f*2];p!=null&&(!u.colwidth||u.colwidth[c]!=p)&&((l||(l=qK(u)))[c]=p)}l&&t.problems.unshift({type:"colwidth mismatch",pos:s,colwidth:l})}}function qK(t){if(t.colwidth)return t.colwidth.slice();const e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}function $n(t){let e=t.cached.tableNodeTypes;if(!e){e=t.cached.tableNodeTypes={};for(const n in t.nodes){const r=t.nodes[n],o=r.spec.tableRole;o&&(e[o]=r)}}return e}var fs=new Et("selectingCells");function Sl(t){for(let e=t.depth-1;e>0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}function KK(t){for(let e=t.depth;e>0;e--){const n=t.node(e).type.spec.tableRole;if(n==="cell"||n==="header_cell")return t.node(e)}return null}function co(t){const e=t.selection.$head;for(let n=e.depth;n>0;n--)if(e.node(n).type.spec.tableRole=="row")return!0;return!1}function Op(t){const e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const n=Sl(e.$head)||GK(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function GK(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n-e.nodeSize)}}function xb(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function XK(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function Cb(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function EE(t,e,n){const r=t.node(-1),o=rn.get(r),s=t.start(-1),a=o.nextCell(t.pos-s,e,n);return a==null?null:t.node(0).resolve(s+a)}function la(t,e,n=1){const r={...t,colspan:t.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some(o=>o>0)||(r.colwidth=null)),r}function SE(t,e,n=1){const r={...t,colspan:t.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let o=0;o<n;o++)r.colwidth.splice(e,0,0)}return r}function YK(t,e,n){const r=$n(e.type.schema).header_cell;for(let o=0;o<t.height;o++)if(e.nodeAt(t.map[n+o*t.width]).type!=r)return!1;return!0}var $t=class _i extends De{constructor(e,n=e){const r=e.node(-1),o=rn.get(r),s=e.start(-1),a=o.rectBetween(e.pos-s,n.pos-s),l=e.node(0),u=o.cellsInRect(a).filter(f=>f!=n.pos-s);u.unshift(n.pos-s);const c=u.map(f=>{const p=r.nodeAt(f);if(!p)throw RangeError(`No cell with offset ${f} found`);const m=s+f+1;return new fy(l.resolve(m),l.resolve(m+p.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=n}map(e,n){const r=e.resolve(n.map(this.$anchorCell.pos)),o=e.resolve(n.map(this.$headCell.pos));if(xb(r)&&xb(o)&&Cb(r,o)){const s=this.$anchorCell.node(-1)!=r.node(-1);return s&&this.isRowSelection()?_i.rowSelection(r,o):s&&this.isColSelection()?_i.colSelection(r,o):new _i(r,o)}return Ae.between(r,o)}content(){const e=this.$anchorCell.node(-1),n=rn.get(e),r=this.$anchorCell.start(-1),o=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),s={},a=[];for(let u=o.top;u<o.bottom;u++){const c=[];for(let f=u*n.width+o.left,p=o.left;p<o.right;p++,f++){const m=n.map[f];if(s[m])continue;s[m]=!0;const g=n.findCell(m);let b=e.nodeAt(m);if(!b)throw RangeError(`No cell with offset ${m} found`);const y=o.left-g.left,w=g.right-o.right;if(y>0||w>0){let x=b.attrs;if(y>0&&(x=la(x,0,y)),w>0&&(x=la(x,x.colspan-w,w)),g.left<o.left){if(b=b.type.createAndFill(x),!b)throw RangeError(`Could not create cell with attrs ${JSON.stringify(x)}`)}else b=b.type.create(x,b.content)}if(g.top<o.top||g.bottom>o.bottom){const x={...b.attrs,rowspan:Math.min(g.bottom,o.bottom)-Math.max(g.top,o.top)};g.top<o.top?b=b.type.createAndFill(x):b=b.type.create(x,b.content)}c.push(b)}a.push(e.child(u).copy(de.from(c)))}const l=this.isColSelection()&&this.isRowSelection()?e:a;return new Ee(de.from(l),1,1)}replace(e,n=Ee.empty){const r=e.steps.length,o=this.ranges;for(let a=0;a<o.length;a++){const{$from:l,$to:u}=o[a],c=e.mapping.slice(r);e.replace(c.map(l.pos),c.map(u.pos),a?Ee.empty:n)}const s=De.findFrom(e.doc.resolve(e.mapping.slice(r).map(this.to)),-1);s&&e.setSelection(s)}replaceWith(e,n){this.replace(e,new Ee(de.from(n),0,0))}forEachCell(e){const n=this.$anchorCell.node(-1),r=rn.get(n),o=this.$anchorCell.start(-1),s=r.cellsInRect(r.rectBetween(this.$anchorCell.pos-o,this.$headCell.pos-o));for(let a=0;a<s.length;a++)e(n.nodeAt(s[a]),o+s[a])}isColSelection(){const e=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(e,n)>0)return!1;const r=e+this.$anchorCell.nodeAfter.attrs.rowspan,o=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,o)==this.$headCell.node(-1).childCount}static colSelection(e,n=e){const r=e.node(-1),o=rn.get(r),s=e.start(-1),a=o.findCell(e.pos-s),l=o.findCell(n.pos-s),u=e.node(0);return a.top<=l.top?(a.top>0&&(e=u.resolve(s+o.map[a.left])),l.bottom<o.height&&(n=u.resolve(s+o.map[o.width*(o.height-1)+l.right-1]))):(l.top>0&&(n=u.resolve(s+o.map[l.left])),a.bottom<o.height&&(e=u.resolve(s+o.map[o.width*(o.height-1)+a.right-1]))),new _i(e,n)}isRowSelection(){const e=this.$anchorCell.node(-1),n=rn.get(e),r=this.$anchorCell.start(-1),o=n.colCount(this.$anchorCell.pos-r),s=n.colCount(this.$headCell.pos-r);if(Math.min(o,s)>0)return!1;const a=o+this.$anchorCell.nodeAfter.attrs.colspan,l=s+this.$headCell.nodeAfter.attrs.colspan;return Math.max(a,l)==n.width}eq(e){return e instanceof _i&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){const r=e.node(-1),o=rn.get(r),s=e.start(-1),a=o.findCell(e.pos-s),l=o.findCell(n.pos-s),u=e.node(0);return a.left<=l.left?(a.left>0&&(e=u.resolve(s+o.map[a.top*o.width])),l.right<o.width&&(n=u.resolve(s+o.map[o.width*(l.top+1)-1]))):(l.left>0&&(n=u.resolve(s+o.map[l.top*o.width])),a.right<o.width&&(e=u.resolve(s+o.map[o.width*(a.top+1)-1]))),new _i(e,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,n){return new _i(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){return new _i(e.resolve(n),e.resolve(r))}getBookmark(){return new JK(this.$anchorCell.pos,this.$headCell.pos)}};$t.prototype.visible=!1,De.jsonID("cell",$t);var JK=class R_{constructor(e,n){this.anchor=e,this.head=n}map(e){return new R_(e.map(this.anchor),e.map(this.head))}resolve(e){const n=e.resolve(this.anchor),r=e.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&r.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&r.index()<r.parent.childCount&&Cb(n,r)?new $t(n,r):De.near(r,1)}};function ZK(t){if(!(t.selection instanceof $t))return null;const e=[];return t.selection.forEachCell((n,r)=>{e.push(qt.node(r,r+n.nodeSize,{class:"selectedCell"}))}),ht.create(t.doc,e)}function QK({$from:t,$to:e}){if(t.pos==e.pos||t.pos<e.pos-6)return!1;let n=t.pos,r=e.pos,o=t.depth;for(;o>=0&&!(t.after(o+1)<t.end(o));o--,n++);for(let s=e.depth;s>=0&&!(e.before(s+1)>e.start(s));s--,r--);return n==r&&/row|table/.test(t.node(o).type.spec.tableRole)}function NK({$from:t,$to:e}){let n,r;for(let o=t.depth;o>0;o--){const s=t.node(o);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){n=s;break}}for(let o=e.depth;o>0;o--){const s=e.node(o);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){r=s;break}}return n!==r&&e.parentOffset===0}function eG(t,e,n){const r=(e||t).selection,o=(e||t).doc;let s,a;if(r instanceof Le&&(a=r.node.type.spec.tableRole)){if(a=="cell"||a=="header_cell")s=$t.create(o,r.from);else if(a=="row"){const l=o.resolve(r.from+1);s=$t.rowSelection(l,l)}else if(!n){const l=rn.get(r.node),u=r.from+1,c=u+l.map[l.width*l.height-1];s=$t.create(o,u+1,c)}}else r instanceof Ae&&QK(r)?s=Ae.create(o,r.from):r instanceof Ae&&NK(r)&&(s=Ae.create(o,r.$from.start(),r.$from.end()));return s&&(e||(e=t.tr)).setSelection(s),e}var tG=new Et("fix-tables");function kE(t,e,n,r){const o=t.childCount,s=e.childCount;e:for(let a=0,l=0;a<s;a++){const u=e.child(a);for(let c=l,f=Math.min(o,a+3);c<f;c++)if(t.child(c)==u){l=c+1,n+=u.nodeSize;continue e}r(u,n),l<o&&t.child(l).sameMarkup(u)?kE(t.child(l),u,n+1,r):u.nodesBetween(0,u.content.size,r,n+1),n+=u.nodeSize}}function _E(t,e){let n;const r=(o,s)=>{o.type.spec.tableRole=="table"&&(n=nG(t,o,s,n))};return e?e.doc!=t.doc&&kE(e.doc,t.doc,0,r):t.doc.descendants(r),n}function nG(t,e,n,r){const o=rn.get(e);if(!o.problems)return r;r||(r=t.tr);const s=[];for(let u=0;u<o.height;u++)s.push(0);for(let u=0;u<o.problems.length;u++){const c=o.problems[u];if(c.type=="collision"){const f=e.nodeAt(c.pos);if(!f)continue;const p=f.attrs;for(let m=0;m<p.rowspan;m++)s[c.row+m]+=c.n;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,la(p,p.colspan-c.n,c.n))}else if(c.type=="missing")s[c.row]+=c.n;else if(c.type=="overlong_rowspan"){const f=e.nodeAt(c.pos);if(!f)continue;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,{...f.attrs,rowspan:f.attrs.rowspan-c.n})}else if(c.type=="colwidth mismatch"){const f=e.nodeAt(c.pos);if(!f)continue;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,{...f.attrs,colwidth:c.colwidth})}else if(c.type=="zero_sized"){const f=r.mapping.map(n);r.delete(f,f+e.nodeSize)}}let a,l;for(let u=0;u<s.length;u++)s[u]&&(a==null&&(a=u),l=u);for(let u=0,c=n+1;u<o.height;u++){const f=e.child(u),p=c+f.nodeSize,m=s[u];if(m>0){let g="cell";f.firstChild&&(g=f.firstChild.type.spec.tableRole);const b=[];for(let w=0;w<m;w++){const x=$n(t.schema)[g].createAndFill();x&&b.push(x)}const y=(u==0||a==u-1)&&l==u?c+1:p-1;r.insert(r.mapping.map(y),b)}c=p}return r.setMeta(tG,{fixTables:!0})}function $o(t){const e=t.selection,n=Op(t),r=n.node(-1),o=n.start(-1),s=rn.get(r);return{...e instanceof $t?s.rectBetween(e.$anchorCell.pos-o,e.$headCell.pos-o):s.findCell(n.pos-o),tableStart:o,map:s,table:r}}function TE(t,{map:e,tableStart:n,table:r},o){let s=o>0?-1:0;YK(e,r,o+s)&&(s=o==0||o==e.width?null:0);for(let a=0;a<e.height;a++){const l=a*e.width+o;if(o>0&&o<e.width&&e.map[l-1]==e.map[l]){const u=e.map[l],c=r.nodeAt(u);t.setNodeMarkup(t.mapping.map(n+u),null,SE(c.attrs,o-e.colCount(u))),a+=c.attrs.rowspan-1}else{const u=s==null?$n(r.type.schema).cell:r.nodeAt(e.map[l+s]).type,c=e.positionAt(a,o,r);t.insert(t.mapping.map(n+c),u.createAndFill())}}return t}function rG(t,e){if(!co(t))return!1;if(e){const n=$o(t);e(TE(t.tr,n,n.left))}return!0}function oG(t,e){if(!co(t))return!1;if(e){const n=$o(t);e(TE(t.tr,n,n.right))}return!0}function iG(t,{map:e,table:n,tableStart:r},o){const s=t.mapping.maps.length;for(let a=0;a<e.height;){const l=a*e.width+o,u=e.map[l],c=n.nodeAt(u),f=c.attrs;if(o>0&&e.map[l-1]==u||o<e.width-1&&e.map[l+1]==u)t.setNodeMarkup(t.mapping.slice(s).map(r+u),null,la(f,o-e.colCount(u)));else{const p=t.mapping.slice(s).map(r+u);t.delete(p,p+c.nodeSize)}a+=f.rowspan}}function sG(t,e){if(!co(t))return!1;if(e){const n=$o(t),r=t.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let o=n.right-1;iG(r,n,o),o!=n.left;o--){const s=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!s)throw RangeError("No table found");n.table=s,n.map=rn.get(s)}e(r)}return!0}function aG(t,e,n){var r;const o=$n(e.type.schema).header_cell;for(let s=0;s<t.width;s++)if(((r=e.nodeAt(t.map[s+n*t.width]))==null?void 0:r.type)!=o)return!1;return!0}function AE(t,{map:e,tableStart:n,table:r},o){var s;let a=n;for(let c=0;c<o;c++)a+=r.child(c).nodeSize;const l=[];let u=o>0?-1:0;aG(e,r,o+u)&&(u=o==0||o==e.height?null:0);for(let c=0,f=e.width*o;c<e.width;c++,f++)if(o>0&&o<e.height&&e.map[f]==e.map[f-e.width]){const p=e.map[f],m=r.nodeAt(p).attrs;t.setNodeMarkup(n+p,null,{...m,rowspan:m.rowspan+1}),c+=m.colspan-1}else{const p=u==null?$n(r.type.schema).cell:(s=r.nodeAt(e.map[f+u*e.width]))==null?void 0:s.type,m=p==null?void 0:p.createAndFill();m&&l.push(m)}return t.insert(a,$n(r.type.schema).row.create(null,l)),t}function lG(t,e){if(!co(t))return!1;if(e){const n=$o(t);e(AE(t.tr,n,n.top))}return!0}function uG(t,e){if(!co(t))return!1;if(e){const n=$o(t);e(AE(t.tr,n,n.bottom))}return!0}function cG(t,{map:e,table:n,tableStart:r},o){let s=0;for(let c=0;c<o;c++)s+=n.child(c).nodeSize;const a=s+n.child(o).nodeSize,l=t.mapping.maps.length;t.delete(s+r,a+r);const u=new Set;for(let c=0,f=o*e.width;c<e.width;c++,f++){const p=e.map[f];if(!u.has(p)){if(u.add(p),o>0&&p==e.map[f-e.width]){const m=n.nodeAt(p).attrs;t.setNodeMarkup(t.mapping.slice(l).map(p+r),null,{...m,rowspan:m.rowspan-1}),c+=m.colspan-1}else if(o<e.height&&p==e.map[f+e.width]){const m=n.nodeAt(p),g=m.attrs,b=m.type.create({...g,rowspan:m.attrs.rowspan-1},m.content),y=e.positionAt(o+1,c,n);t.insert(t.mapping.slice(l).map(r+y),b),c+=g.colspan-1}}}}function dG(t,e){if(!co(t))return!1;if(e){const n=$o(t),r=t.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let o=n.bottom-1;cG(r,n,o),o!=n.top;o--){const s=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!s)throw RangeError("No table found");n.table=s,n.map=rn.get(n.table)}e(r)}return!0}function OE(t){const e=t.content;return e.childCount==1&&e.child(0).isTextblock&&e.child(0).childCount==0}function fG({width:t,height:e,map:n},r){let o=r.top*t+r.left,s=o,a=(r.bottom-1)*t+r.left,l=o+(r.right-r.left-1);for(let u=r.top;u<r.bottom;u++){if(r.left>0&&n[s]==n[s-1]||r.right<t&&n[l]==n[l+1])return!0;s+=t,l+=t}for(let u=r.left;u<r.right;u++){if(r.top>0&&n[o]==n[o-t]||r.bottom<e&&n[a]==n[a+t])return!0;o++,a++}return!1}function ME(t,e){const n=t.selection;if(!(n instanceof $t)||n.$anchorCell.pos==n.$headCell.pos)return!1;const r=$o(t),{map:o}=r;if(fG(o,r))return!1;if(e){const s=t.tr,a={};let l=de.empty,u,c;for(let f=r.top;f<r.bottom;f++)for(let p=r.left;p<r.right;p++){const m=o.map[f*o.width+p],g=r.table.nodeAt(m);if(!(a[m]||!g))if(a[m]=!0,u==null)u=m,c=g;else{OE(g)||(l=l.append(g.content));const b=s.mapping.map(m+r.tableStart);s.delete(b,b+g.nodeSize)}}if(u==null||c==null)return!0;if(s.setNodeMarkup(u+r.tableStart,null,{...SE(c.attrs,c.attrs.colspan,r.right-r.left-c.attrs.colspan),rowspan:r.bottom-r.top}),l.size){const f=u+1+c.content.size,p=OE(c)?u+1:f;s.replaceWith(p+r.tableStart,f+r.tableStart,l)}s.setSelection(new $t(s.doc.resolve(u+r.tableStart))),e(s)}return!0}function BE(t,e){const n=$n(t.schema);return pG(({node:r})=>n[r.type.spec.tableRole])(t,e)}function pG(t){return(e,n)=>{var r;const o=e.selection;let s,a;if(o instanceof $t){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;s=o.$anchorCell.nodeAfter,a=o.$anchorCell.pos}else{if(s=KK(o.$from),!s)return!1;a=(r=Sl(o.$from))==null?void 0:r.pos}if(s==null||a==null||s.attrs.colspan==1&&s.attrs.rowspan==1)return!1;if(n){let l=s.attrs;const u=[],c=l.colwidth;l.rowspan>1&&(l={...l,rowspan:1}),l.colspan>1&&(l={...l,colspan:1});const f=$o(e),p=e.tr;for(let g=0;g<f.right-f.left;g++)u.push(c?{...l,colwidth:c&&c[g]?[c[g]]:null}:l);let m;for(let g=f.top;g<f.bottom;g++){let b=f.map.positionAt(g,f.left,f.table);g==f.top&&(b+=s.nodeSize);for(let y=f.left,w=0;y<f.right;y++,w++)y==f.left&&g==f.top||p.insert(m=p.mapping.map(b+f.tableStart,1),t({node:s,row:g,col:y}).createAndFill(u[w]))}p.setNodeMarkup(a,t({node:s,row:f.top,col:f.left}),u[0]),o instanceof $t&&p.setSelection(new $t(p.doc.resolve(o.$anchorCell.pos),m?p.doc.resolve(m):void 0)),n(p)}return!0}}function hG(t,e){return function(n,r){if(!co(n))return!1;const o=Op(n);if(o.nodeAfter.attrs[t]===e)return!1;if(r){const s=n.tr;n.selection instanceof $t?n.selection.forEachCell((a,l)=>{a.attrs[t]!==e&&s.setNodeMarkup(l,null,{...a.attrs,[t]:e})}):s.setNodeMarkup(o.pos,null,{...o.nodeAfter.attrs,[t]:e}),r(s)}return!0}}function mG(t){return function(e,n){if(!co(e))return!1;if(n){const r=$n(e.schema),o=$o(e),s=e.tr,a=o.map.cellsInRect(t=="column"?{left:o.left,top:0,right:o.right,bottom:o.map.height}:t=="row"?{left:0,top:o.top,right:o.map.width,bottom:o.bottom}:o),l=a.map(u=>o.table.nodeAt(u));for(let u=0;u<a.length;u++)l[u].type==r.header_cell&&s.setNodeMarkup(o.tableStart+a[u],r.cell,l[u].attrs);if(s.steps.length==0)for(let u=0;u<a.length;u++)s.setNodeMarkup(o.tableStart+a[u],r.header_cell,l[u].attrs);n(s)}return!0}}function IE(t,e,n){const r=e.map.cellsInRect({left:0,top:0,right:t=="row"?e.map.width:1,bottom:t=="column"?e.map.height:1});for(let o=0;o<r.length;o++){const s=e.table.nodeAt(r[o]);if(s&&s.type!==n.header_cell)return!1}return!0}function pc(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?mG(t):function(n,r){if(!co(n))return!1;if(r){const o=$n(n.schema),s=$o(n),a=n.tr,l=IE("row",s,o),u=IE("column",s,o),f=(t==="column"?l:t==="row"?u:!1)?1:0,p=t=="column"?{left:0,top:f,right:1,bottom:s.map.height}:t=="row"?{left:f,top:0,right:s.map.width,bottom:1}:s,m=t=="column"?u?o.cell:o.header_cell:t=="row"?l?o.cell:o.header_cell:o.cell;s.map.cellsInRect(p).forEach(g=>{const b=g+s.tableStart,y=a.doc.nodeAt(b);y&&a.setNodeMarkup(b,m,y.attrs)}),r(a)}return!0}}pc("row",{useDeprecatedLogic:!0}),pc("column",{useDeprecatedLogic:!0});var gG=pc("cell",{useDeprecatedLogic:!0});function bG(t,e){if(e<0){const n=t.nodeBefore;if(n)return t.pos-n.nodeSize;for(let r=t.index(-1)-1,o=t.before();r>=0;r--){const s=t.node(-1).child(r),a=s.lastChild;if(a)return o-1-a.nodeSize;o-=s.nodeSize}}else{if(t.index()<t.parent.childCount-1)return t.pos+t.nodeAfter.nodeSize;const n=t.node(-1);for(let r=t.indexAfter(-1),o=t.after();r<n.childCount;r++){const s=n.child(r);if(s.childCount)return o+1;o+=s.nodeSize}}return null}function RE(t){return function(e,n){if(!co(e))return!1;const r=bG(Op(e),t);if(r==null)return!1;if(n){const o=e.doc.resolve(r);n(e.tr.setSelection(Ae.between(o,XK(o))).scrollIntoView())}return!0}}function vG(t,e){const n=t.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole=="table")return e&&e(t.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function Mp(t,e){const n=t.selection;if(!(n instanceof $t))return!1;if(e){const r=t.tr,o=$n(t.schema).cell.createAndFill().content;n.forEachCell((s,a)=>{s.content.eq(o)||r.replace(r.mapping.map(a+1),r.mapping.map(a+s.nodeSize-1),new Ee(o,0,0))}),r.docChanged&&e(r)}return!0}function yG(t){if(!t.size)return null;let{content:e,openStart:n,openEnd:r}=t;for(;e.childCount==1&&(n>0&&r>0||e.child(0).type.spec.tableRole=="table");)n--,r--,e=e.child(0).content;const o=e.child(0),s=o.type.spec.tableRole,a=o.type.schema,l=[];if(s=="row")for(let u=0;u<e.childCount;u++){let c=e.child(u).content;const f=u?0:Math.max(0,n-1),p=u<e.childCount-1?0:Math.max(0,r-1);(f||p)&&(c=Eb($n(a).row,new Ee(c,f,p)).content),l.push(c)}else if(s=="cell"||s=="header_cell")l.push(n||r?Eb($n(a).row,new Ee(e,n,r)).content:e);else return null;return wG(a,l)}function wG(t,e){const n=[];for(let o=0;o<e.length;o++){const s=e[o];for(let a=s.childCount-1;a>=0;a--){const{rowspan:l,colspan:u}=s.child(a).attrs;for(let c=o;c<o+l;c++)n[c]=(n[c]||0)+u}}let r=0;for(let o=0;o<n.length;o++)r=Math.max(r,n[o]);for(let o=0;o<n.length;o++)if(o>=e.length&&e.push(de.empty),n[o]<r){const s=$n(t).cell.createAndFill(),a=[];for(let l=n[o];l<r;l++)a.push(s);e[o]=e[o].append(de.from(a))}return{height:e.length,width:r,rows:e}}function Eb(t,e){const n=t.createAndFill();return new im(n).replace(0,n.content.size,e).doc}function xG({width:t,height:e,rows:n},r,o){if(t!=r){const s=[],a=[];for(let l=0;l<n.length;l++){const u=n[l],c=[];for(let f=s[l]||0,p=0;f<r;p++){let m=u.child(p%u.childCount);f+m.attrs.colspan>r&&(m=m.type.createChecked(la(m.attrs,m.attrs.colspan,f+m.attrs.colspan-r),m.content)),c.push(m),f+=m.attrs.colspan;for(let g=1;g<m.attrs.rowspan;g++)s[l+g]=(s[l+g]||0)+m.attrs.colspan}a.push(de.from(c))}n=a,t=r}if(e!=o){const s=[];for(let a=0,l=0;a<o;a++,l++){const u=[],c=n[l%e];for(let f=0;f<c.childCount;f++){let p=c.child(f);a+p.attrs.rowspan>o&&(p=p.type.create({...p.attrs,rowspan:Math.max(1,o-p.attrs.rowspan)},p.content)),u.push(p)}s.push(de.from(u))}n=s,e=o}return{width:t,height:e,rows:n}}function CG(t,e,n,r,o,s,a){const l=t.doc.type.schema,u=$n(l);let c,f;if(o>e.width)for(let p=0,m=0;p<e.height;p++){const g=n.child(p);m+=g.nodeSize;const b=[];let y;g.lastChild==null||g.lastChild.type==u.cell?y=c||(c=u.cell.createAndFill()):y=f||(f=u.header_cell.createAndFill());for(let w=e.width;w<o;w++)b.push(y);t.insert(t.mapping.slice(a).map(m-1+r),b)}if(s>e.height){const p=[];for(let b=0,y=(e.height-1)*e.width;b<Math.max(e.width,o);b++){const w=b>=e.width?!1:n.nodeAt(e.map[y+b]).type==u.header_cell;p.push(w?f||(f=u.header_cell.createAndFill()):c||(c=u.cell.createAndFill()))}const m=u.row.create(null,de.from(p)),g=[];for(let b=e.height;b<s;b++)g.push(m);t.insert(t.mapping.slice(a).map(r+n.nodeSize-2),g)}return!!(c||f)}function LE(t,e,n,r,o,s,a,l){if(a==0||a==e.height)return!1;let u=!1;for(let c=o;c<s;c++){const f=a*e.width+c,p=e.map[f];if(e.map[f-e.width]==p){u=!0;const m=n.nodeAt(p),{top:g,left:b}=e.findCell(p);t.setNodeMarkup(t.mapping.slice(l).map(p+r),null,{...m.attrs,rowspan:a-g}),t.insert(t.mapping.slice(l).map(e.positionAt(a,b,n)),m.type.createAndFill({...m.attrs,rowspan:g+m.attrs.rowspan-a})),c+=m.attrs.colspan-1}}return u}function PE(t,e,n,r,o,s,a,l){if(a==0||a==e.width)return!1;let u=!1;for(let c=o;c<s;c++){const f=c*e.width+a,p=e.map[f];if(e.map[f-1]==p){u=!0;const m=n.nodeAt(p),g=e.colCount(p),b=t.mapping.slice(l).map(p+r);t.setNodeMarkup(b,null,la(m.attrs,a-g,m.attrs.colspan-(a-g))),t.insert(b+m.nodeSize,m.type.createAndFill(la(m.attrs,0,a-g))),c+=m.attrs.rowspan-1}}return u}function DE(t,e,n,r,o){let s=n?t.doc.nodeAt(n-1):t.doc;if(!s)throw new Error("No table found");let a=rn.get(s);const{top:l,left:u}=r,c=u+o.width,f=l+o.height,p=t.tr;let m=0;function g(){if(s=n?p.doc.nodeAt(n-1):p.doc,!s)throw new Error("No table found");a=rn.get(s),m=p.mapping.maps.length}CG(p,a,s,n,c,f,m)&&g(),LE(p,a,s,n,u,c,l,m)&&g(),LE(p,a,s,n,u,c,f,m)&&g(),PE(p,a,s,n,l,f,u,m)&&g(),PE(p,a,s,n,l,f,c,m)&&g();for(let b=l;b<f;b++){const y=a.positionAt(b,u,s),w=a.positionAt(b,c,s);p.replace(p.mapping.slice(m).map(y+n),p.mapping.slice(m).map(w+n),new Ee(o.rows[b-l],0,0))}g(),p.setSelection(new $t(p.doc.resolve(n+a.positionAt(l,u,s)),p.doc.resolve(n+a.positionAt(f-1,c-1,s)))),e(p)}var EG=Dm({ArrowLeft:Ip("horiz",-1),ArrowRight:Ip("horiz",1),ArrowUp:Ip("vert",-1),ArrowDown:Ip("vert",1),"Shift-ArrowLeft":Rp("horiz",-1),"Shift-ArrowRight":Rp("horiz",1),"Shift-ArrowUp":Rp("vert",-1),"Shift-ArrowDown":Rp("vert",1),Backspace:Mp,"Mod-Backspace":Mp,Delete:Mp,"Mod-Delete":Mp});function Bp(t,e,n){return n.eq(t.selection)?!1:(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function Ip(t,e){return(n,r,o)=>{if(!o)return!1;const s=n.selection;if(s instanceof $t)return Bp(n,r,De.near(s.$headCell,e));if(t!="horiz"&&!s.empty)return!1;const a=VE(o,t,e);if(a==null)return!1;if(t=="horiz")return Bp(n,r,De.near(n.doc.resolve(s.head+e),e));{const l=n.doc.resolve(a),u=EE(l,t,e);let c;return u?c=De.near(u,1):e<0?c=De.near(n.doc.resolve(l.before(-1)),-1):c=De.near(n.doc.resolve(l.after(-1)),1),Bp(n,r,c)}}}function Rp(t,e){return(n,r,o)=>{if(!o)return!1;const s=n.selection;let a;if(s instanceof $t)a=s;else{const u=VE(o,t,e);if(u==null)return!1;a=new $t(n.doc.resolve(u))}const l=EE(a.$headCell,t,e);return l?Bp(n,r,new $t(a.$anchorCell,l)):!1}}function SG(t,e){const n=t.state.doc,r=Sl(n.resolve(e));return r?(t.dispatch(t.state.tr.setSelection(new $t(r))),!0):!1}function kG(t,e,n){if(!co(t.state))return!1;let r=yG(n);const o=t.state.selection;if(o instanceof $t){r||(r={width:1,height:1,rows:[de.from(Eb($n(t.state.schema).cell,n))]});const s=o.$anchorCell.node(-1),a=o.$anchorCell.start(-1),l=rn.get(s).rectBetween(o.$anchorCell.pos-a,o.$headCell.pos-a);return r=xG(r,l.right-l.left,l.bottom-l.top),DE(t.state,t.dispatch,a,l,r),!0}else if(r){const s=Op(t.state),a=s.start(-1);return DE(t.state,t.dispatch,a,rn.get(s.node(-1)).findCell(s.pos-a),r),!0}else return!1}function _G(t,e){var n;if(e.ctrlKey||e.metaKey)return;const r=FE(t,e.target);let o;if(e.shiftKey&&t.state.selection instanceof $t)s(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&r&&(o=Sl(t.state.selection.$anchor))!=null&&((n=Sb(t,e))==null?void 0:n.pos)!=o.pos)s(o,e),e.preventDefault();else if(!r)return;function s(u,c){let f=Sb(t,c);const p=fs.getState(t.state)==null;if(!f||!Cb(u,f))if(p)f=u;else return;const m=new $t(u,f);if(p||!t.state.selection.eq(m)){const g=t.state.tr.setSelection(m);p&&g.setMeta(fs,u.pos),t.dispatch(g)}}function a(){t.root.removeEventListener("mouseup",a),t.root.removeEventListener("dragstart",a),t.root.removeEventListener("mousemove",l),fs.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(fs,-1))}function l(u){const c=u,f=fs.getState(t.state);let p;if(f!=null)p=t.state.doc.resolve(f);else if(FE(t,c.target)!=r&&(p=Sb(t,e),!p))return a();p&&s(p,c)}t.root.addEventListener("mouseup",a),t.root.addEventListener("dragstart",a),t.root.addEventListener("mousemove",l)}function VE(t,e,n){if(!(t.state.selection instanceof Ae))return null;const{$head:r}=t.state.selection;for(let o=r.depth-1;o>=0;o--){const s=r.node(o);if((n<0?r.index(o):r.indexAfter(o))!=(n<0?0:s.childCount))return null;if(s.type.spec.tableRole=="cell"||s.type.spec.tableRole=="header_cell"){const l=r.before(o),u=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(u)?l:null}}return null}function FE(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function Sb(t,e){const n=t.posAtCoords({left:e.clientX,top:e.clientY});return n&&n?Sl(t.state.doc.resolve(n.pos)):null}var TG=class{constructor(e,n){this.node=e,this.defaultCellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${n}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),kb(e,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!=this.node.type?!1:(this.node=e,kb(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function kb(t,e,n,r,o,s){var a;let l=0,u=!0,c=e.firstChild;const f=t.firstChild;if(f){for(let p=0,m=0;p<f.childCount;p++){const{colspan:g,colwidth:b}=f.child(p).attrs;for(let y=0;y<g;y++,m++){const w=o==m?s:b&&b[y],x=w?w+"px":"";if(l+=w||r,w||(u=!1),c)c.style.width!=x&&(c.style.width=x),c=c.nextSibling;else{const E=document.createElement("col");E.style.width=x,e.appendChild(E)}}}for(;c;){const p=c.nextSibling;(a=c.parentNode)==null||a.removeChild(c),c=p}u?(n.style.width=l+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=l+"px")}}var yr=new Et("tableColumnResizing");function AG({handleWidth:t=5,cellMinWidth:e=25,defaultCellMinWidth:n=100,View:r=TG,lastColumnResizable:o=!0}={}){const s=new Ne({key:yr,state:{init(a,l){var u,c;const f=(c=(u=s.spec)==null?void 0:u.props)==null?void 0:c.nodeViews,p=$n(l.schema).table.name;return r&&f&&(f[p]=(m,g)=>new r(m,n,g)),new OG(-1,!1)},apply(a,l){return l.apply(a)}},props:{attributes:a=>{const l=yr.getState(a);return l&&l.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(a,l)=>{MG(a,l,t,o)},mouseleave:a=>{BG(a)},mousedown:(a,l)=>{IG(a,l,e,n)}},decorations:a=>{const l=yr.getState(a);if(l&&l.activeHandle>-1)return VG(a,l.activeHandle)},nodeViews:{}}});return s}var OG=class Wh{constructor(e,n){this.activeHandle=e,this.dragging=n}apply(e){const n=this,r=e.getMeta(yr);if(r&&r.setHandle!=null)return new Wh(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new Wh(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&e.docChanged){let o=e.mapping.map(n.activeHandle,-1);return xb(e.doc.resolve(o))||(o=-1),new Wh(o,n.dragging)}return n}};function MG(t,e,n,r){if(!t.editable)return;const o=yr.getState(t.state);if(o&&!o.dragging){const s=LG(e.target);let a=-1;if(s){const{left:l,right:u}=s.getBoundingClientRect();e.clientX-l<=n?a=$E(t,e,"left",n):u-e.clientX<=n&&(a=$E(t,e,"right",n))}if(a!=o.activeHandle){if(!r&&a!==-1){const l=t.state.doc.resolve(a),u=l.node(-1),c=rn.get(u),f=l.start(-1);if(c.colCount(l.pos-f)+l.nodeAfter.attrs.colspan-1==c.width-1)return}HE(t,a)}}}function BG(t){if(!t.editable)return;const e=yr.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&HE(t,-1)}function IG(t,e,n,r){var o;if(!t.editable)return!1;const s=(o=t.dom.ownerDocument.defaultView)!=null?o:window,a=yr.getState(t.state);if(!a||a.activeHandle==-1||a.dragging)return!1;const l=t.state.doc.nodeAt(a.activeHandle),u=RG(t,a.activeHandle,l.attrs);t.dispatch(t.state.tr.setMeta(yr,{setDragging:{startX:e.clientX,startWidth:u}}));function c(p){s.removeEventListener("mouseup",c),s.removeEventListener("mousemove",f);const m=yr.getState(t.state);m!=null&&m.dragging&&(PG(t,m.activeHandle,zE(m.dragging,p,n)),t.dispatch(t.state.tr.setMeta(yr,{setDragging:null})))}function f(p){if(!p.which)return c(p);const m=yr.getState(t.state);if(m&&m.dragging){const g=zE(m.dragging,p,n);UE(t,m.activeHandle,g,r)}}return UE(t,a.activeHandle,u,r),s.addEventListener("mouseup",c),s.addEventListener("mousemove",f),e.preventDefault(),!0}function RG(t,e,{colspan:n,colwidth:r}){const o=r&&r[r.length-1];if(o)return o;const s=t.domAtPos(e);let l=s.node.childNodes[s.offset].offsetWidth,u=n;if(r)for(let c=0;c<n;c++)r[c]&&(l-=r[c],u--);return l/u}function LG(t){for(;t&&t.nodeName!="TD"&&t.nodeName!="TH";)t=t.classList&&t.classList.contains("ProseMirror")?null:t.parentNode;return t}function $E(t,e,n,r){const o=n=="right"?-r:r,s=t.posAtCoords({left:e.clientX+o,top:e.clientY});if(!s)return-1;const{pos:a}=s,l=Sl(t.state.doc.resolve(a));if(!l)return-1;if(n=="right")return l.pos;const u=rn.get(l.node(-1)),c=l.start(-1),f=u.map.indexOf(l.pos-c);return f%u.width==0?-1:c+u.map[f-1]}function zE(t,e,n){const r=e.clientX-t.startX;return Math.max(n,t.startWidth+r)}function HE(t,e){t.dispatch(t.state.tr.setMeta(yr,{setHandle:e}))}function PG(t,e,n){const r=t.state.doc.resolve(e),o=r.node(-1),s=rn.get(o),a=r.start(-1),l=s.colCount(r.pos-a)+r.nodeAfter.attrs.colspan-1,u=t.state.tr;for(let c=0;c<s.height;c++){const f=c*s.width+l;if(c&&s.map[f]==s.map[f-s.width])continue;const p=s.map[f],m=o.nodeAt(p).attrs,g=m.colspan==1?0:l-s.colCount(p);if(m.colwidth&&m.colwidth[g]==n)continue;const b=m.colwidth?m.colwidth.slice():DG(m.colspan);b[g]=n,u.setNodeMarkup(a+p,null,{...m,colwidth:b})}u.docChanged&&t.dispatch(u)}function UE(t,e,n,r){const o=t.state.doc.resolve(e),s=o.node(-1),a=o.start(-1),l=rn.get(s).colCount(o.pos-a)+o.nodeAfter.attrs.colspan-1;let u=t.domAtPos(o.start(-1)).node;for(;u&&u.nodeName!="TABLE";)u=u.parentNode;u&&kb(s,u.firstChild,u,r,l,n)}function DG(t){return Array(t).fill(0)}function VG(t,e){var n;const r=[],o=t.doc.resolve(e),s=o.node(-1);if(!s)return ht.empty;const a=rn.get(s),l=o.start(-1),u=a.colCount(o.pos-l)+o.nodeAfter.attrs.colspan-1;for(let c=0;c<a.height;c++){const f=u+c*a.width;if((u==a.width-1||a.map[f]!=a.map[f+1])&&(c==0||a.map[f]!=a.map[f-a.width])){const p=a.map[f],m=l+p+s.nodeAt(p).nodeSize-1,g=document.createElement("div");g.className="column-resize-handle",(n=yr.getState(t))!=null&&n.dragging&&r.push(qt.node(l+p,l+p+s.nodeAt(p).nodeSize,{class:"column-resize-dragging"})),r.push(qt.widget(m,g))}}return ht.create(t.doc,r)}function FG({allowTableNodeSelection:t=!1}={}){return new Ne({key:fs,state:{init(){return null},apply(e,n){const r=e.getMeta(fs);if(r!=null)return r==-1?null:r;if(n==null||!e.docChanged)return n;const{deleted:o,pos:s}=e.mapping.mapResult(n);return o?null:s}},props:{decorations:ZK,handleDOMEvents:{mousedown:_G},createSelectionBetween(e){return fs.getState(e.state)!=null?e.state.selection:null},handleTripleClick:SG,handleKeyDown:EG,handlePaste:kG},appendTransaction(e,n,r){return eG(r,_E(r,n),t)}})}const $G=(t,e,n)=>{if(!t.doc)return t;const r=t.doc.nodeAt(e);if(!r||n===r.attrs.backgroundColor)return t;const o={...r.attrs,backgroundColor:n};return t.setNodeMarkup(e,r.type,o,r.marks)},zG=(t,e,n)=>{const{doc:r,selection:o}=t;return!r||!o||!(o instanceof $t)||o.forEachCell((s,a)=>{t=$G(t,a,n)}),t},WE=(t,e)=>({tr:n,state:r,dispatch:o})=>{const{selection:s}=r;return n=n.setSelection(s),n=zG(n,e,t),n.docChanged?(o==null||o(n),!0):!1},HG=Ze.create({name:"tableCellBackground",addOptions(){return{types:["tableCell"],HTMLAttributes:{}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{backgroundColor:{parseHTML:t=>t.style.backgroundColor||"",renderHTML:t=>!t.backgroundColor||t.backgroundColor===""?{}:{style:`background-color: ${t.backgroundColor}`}}}}]},addCommands(){return{setTableCellBackground:t=>WE(t,this.options),unsetTableCellBackground:()=>WE("",this.options)}}}),UG=Bt.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",vt(this.options.HTMLAttributes,t),0]}}),WG=Bt.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",vt(this.options.HTMLAttributes,t),0]}}),jG=Bt.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",vt(this.options.HTMLAttributes,t),0]}});function _b(t,e){return e?["width",`${Math.max(e,t)}px`]:["min-width",`${t}px`]}function jE(t,e,n,r,o,s){var a;let l=0,u=!0,c=e.firstChild;const f=t.firstChild;if(f!==null)for(let p=0,m=0;p<f.childCount;p+=1){const{colspan:g,colwidth:b}=f.child(p).attrs;for(let y=0;y<g;y+=1,m+=1){const w=o===m?s:b&&b[y],x=w?`${w}px`:"";if(l+=w||r,w||(u=!1),c){if(c.style.width!==x){const[E,S]=_b(r,w);c.style.setProperty(E,S)}c=c.nextSibling}else{const E=document.createElement("col"),[S,C]=_b(r,w);E.style.setProperty(S,C),e.appendChild(E)}}}for(;c;){const p=c.nextSibling;(a=c.parentNode)===null||a===void 0||a.removeChild(c),c=p}u?(n.style.width=`${l}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${l}px`)}class qG{constructor(e,n){this.node=e,this.cellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),jE(e,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!==this.node.type?!1:(this.node=e,jE(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){return e.type==="attributes"&&(e.target===this.table||this.colgroup.contains(e.target))}}function KG(t,e,n,r){let o=0,s=!0;const a=[],l=t.firstChild;if(!l)return{};for(let p=0,m=0;p<l.childCount;p+=1){const{colspan:g,colwidth:b}=l.child(p).attrs;for(let y=0;y<g;y+=1,m+=1){const w=n===m?r:b&&b[y];o+=w||e,w||(s=!1);const[x,E]=_b(e,w);a.push(["col",{style:`${x}: ${E}`}])}}const u=s?`${o}px`:"",c=s?"":`${o}px`;return{colgroup:["colgroup",{},...a],tableWidth:u,tableMinWidth:c}}function qE(t,e){return t.createAndFill()}function GG(t){if(t.cached.tableNodeTypes)return t.cached.tableNodeTypes;const e={};return Object.keys(t.nodes).forEach(n=>{const r=t.nodes[n];r.spec.tableRole&&(e[r.spec.tableRole]=r)}),t.cached.tableNodeTypes=e,e}function XG(t,e,n,r,o){const s=GG(t),a=[],l=[];for(let c=0;c<n;c+=1){const f=qE(s.cell);if(f&&l.push(f),r){const p=qE(s.header_cell);p&&a.push(p)}}const u=[];for(let c=0;c<e;c+=1)u.push(s.row.createChecked(null,r&&c===0?a:l));return s.table.createChecked(null,u)}function YG(t){return t instanceof $t}const Lp=({editor:t})=>{const{selection:e}=t.state;if(!YG(e))return!1;let n=0;const r=l4(e.ranges[0].$from,s=>s.type.name==="table");return r==null||r.node.descendants(s=>{if(s.type.name==="table")return!1;["tableCell","tableHeader"].includes(s.type.name)&&(n+=1)}),n===e.ranges.length?(t.commands.deleteTable(),!0):!1},JG=Bt.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,View:qG,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:t,HTMLAttributes:e}){const{colgroup:n,tableWidth:r,tableMinWidth:o}=KG(t,this.options.cellMinWidth);return["table",vt(this.options.HTMLAttributes,e,{style:r?`width: ${r}`:`min-width: ${o}`}),n,["tbody",0]]},addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:o,editor:s})=>{const a=XG(s.schema,t,e,n);if(o){const l=r.selection.from+1;r.replaceSelectionWith(a).scrollIntoView().setSelection(Ae.near(r.doc.resolve(l)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>rG(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>oG(t,e),deleteColumn:()=>({state:t,dispatch:e})=>sG(t,e),addRowBefore:()=>({state:t,dispatch:e})=>lG(t,e),addRowAfter:()=>({state:t,dispatch:e})=>uG(t,e),deleteRow:()=>({state:t,dispatch:e})=>dG(t,e),deleteTable:()=>({state:t,dispatch:e})=>vG(t,e),mergeCells:()=>({state:t,dispatch:e})=>ME(t,e),splitCell:()=>({state:t,dispatch:e})=>BE(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>pc("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>pc("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>gG(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>ME(t,e)?!0:BE(t,e),setCellAttribute:(t,e)=>({state:n,dispatch:r})=>hG(t,e)(n,r),goToNextCell:()=>({state:t,dispatch:e})=>RE(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>RE(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&_E(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>{if(n){const r=$t.create(e.doc,t.anchorCell,t.headCell);e.setSelection(r)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:Lp,"Mod-Backspace":Lp,Delete:Lp,"Mod-Delete":Lp}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[AG({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],FG({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(t){const e={name:t.name,options:t.options,storage:t.storage};return{tableRole:ut(Re(t,"tableRole",e))}}}),ZG=["disabled"],QG={"content-class":"table-grid-size-editor","content-style":"padding:0"},NG={class:"flex flex-col flex-wrap gap-1 justify-between"},eX=["onMouseover","onMousedown"],tX={class:"text-center text-sm text-zinc-600 mt-2"},nX=i.defineComponent({__name:"CreateTablePopover",props:{disabled:{type:Boolean,default:!1}},emits:["create-table"],setup(t,{emit:e}){const n=e,r=i.ref(!1),o=i.ref(!0),s=i.reactive({rows:df()?Id:Bd,cols:df()?Id:Bd}),a=i.reactive({rows:Rd,cols:Rd});function l(f,p){f===s.rows&&(s.rows=Math.min(f+1,Id)),p===s.cols&&(s.cols=Math.min(p+1,Id)),a.rows=f,a.cols=p}function u(f,p){n("create-table",{rows:f,cols:p,withHeaderRow:i.unref(o)}),c()}function c(){r.value=!1,o.value=!1,s.rows=Bd,s.cols=Bd,a.rows=Rd,a.cols=Rd}return(f,p)=>(i.openBlock(),i.createBlock(i.unref(ul),null,{default:i.withCtx(()=>[i.createVNode(i.unref(fl),{"as-child":""},{default:i.withCtx(()=>[i.createElementVNode("button",{disabled:t.disabled,class:"m-0 p-0"},[i.renderSlot(f.$slots,"trigger")],8,ZG)]),_:3}),i.createVNode(i.unref(cl),{class:"w-full",align:"start",side:"bottom"},{default:i.withCtx(()=>[i.createElementVNode("div",QG,[i.createElementVNode("div",NG,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.rows,m=>(i.openBlock(),i.createElementBlock("div",{key:"r"+m,class:"flex gap-1"},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.cols,g=>(i.openBlock(),i.createElementBlock("div",{key:"c"+g,class:i.normalizeClass([[g<=a.cols&&m<=a.rows&&"bg-ed-foreground border-ed-border","cursor-pointer"],"pa-1"]),onMouseover:b=>l(m,g),onMousedown:b=>u(m,g)},p[0]||(p[0]=[i.createElementVNode("div",{class:"w-4 h-4 p-1 border box-border"},null,-1)]),42,eX))),128))]))),128))]),i.createElementVNode("div",tX,i.toDisplayString(a.rows)+" x "+i.toDisplayString(a.cols),1)])]),_:1})]),_:3}))}}),rX={style:{display:"flex"}},oX=i.defineComponent({__name:"TableActionButton",props:{editor:{},icon:{default:void 0},tooltip:{default:void 0},disabled:{type:Boolean,default:!1},color:{default:void 0},action:{type:Function,default:void 0},isActive:{type:Function,default:void 0}},setup(t){const e=t;function n(r){e.editor.isActive("table")||e.editor.chain().focus().insertTable({...r,withHeaderRow:!1}).run()}return(r,o)=>(i.openBlock(),i.createBlock(nX,{disabled:r.editor.isActive("table"),onCreateTable:n},{trigger:i.withCtx(()=>[i.createElementVNode("div",rX,[i.createVNode(Ke,{icon:r.icon,tooltip:r.tooltip,disabled:r.disabled,color:r.color,action:r.action,"is-active":r.isActive},null,8,["icon","tooltip","disabled","color","action","is-active"])])]),_:1},8,["disabled"]))}}),Tb=JG.extend({addStorage(){return{isTableMenuOpen:!1}},addCommands(){var t;return{...(t=this.parent)==null?void 0:t.call(this),toggleTableEditor:e=>({editor:n})=>n.storage.table?(n.storage.table.isTableEditorOpen=e,!0):!1}},addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),resizable:!0,lastColumnResizable:!0,allowTableNodeSelection:!1,button:({editor:e,t:n})=>({component:oX,componentProps:{icon:"Table",tooltip:n("editor.table.tooltip"),action:()=>{var o;const r=((o=e.storage.table)==null?void 0:o.isTableEditorOpen)??!1;e.commands.toggleTableEditor(!r)}}})}},addExtensions(){return[WG.configure(this.options.tableRow),UG.configure(this.options.tableHeader),jG.configure(this.options.tableCell),HG.configure(this.options.tableCellBackground)]}}),iX={class:"flex items-center gap-2 px-2"},sX=i.defineComponent({__name:"TextDropdown",props:{editor:{},disabled:{type:Boolean,default:!1},color:{default:void 0},maxHeight:{default:void 0},icon:{default:void 0},tooltip:{default:""}},setup(t){const e=t,{t:n}=Tt(),r=i.computed(()=>[{name:"paragraph",label:n("editor.paragraph.tooltip"),iconName:"Paragraph",isActive:()=>e.editor.isActive("paragraph")&&!e.editor.isActive("orderedList")&&!e.editor.isActive("bulletList")&&!e.editor.isActive("taskList"),action:()=>e.editor.chain().focus().clearNodes().run()},{name:"heading1",label:n("editor.heading.h1.tooltip"),isActive:()=>e.editor.isActive("heading",{level:1}),iconName:"Heading1",action:()=>e.editor.chain().focus().clearNodes().toggleHeading({level:1}).run()},{name:"heading2",label:n("editor.heading.h2.tooltip"),isActive:()=>e.editor.isActive("heading",{level:2}),iconName:"Heading2",action:()=>e.editor.chain().focus().clearNodes().toggleHeading({level:2}).run()},{name:"heading3",label:n("editor.heading.h3.tooltip"),isActive:()=>e.editor.isActive("heading",{level:3}),iconName:"Heading3",action:()=>e.editor.chain().focus().clearNodes().toggleHeading({level:3}).run()},{name:"bulletList",label:n("editor.bulletlist.tooltip"),isActive:()=>e.editor.isActive("bulletList"),iconName:"List",action:()=>e.editor.chain().focus().clearNodes().toggleBulletList().run()},{name:"numberedList",label:n("editor.orderedlist.tooltip"),isActive:()=>e.editor.isActive("orderedList"),iconName:"ListOrdered",action:()=>e.editor.chain().focus().clearNodes().toggleOrderedList().run()},{name:"taskList",label:n("editor.tasklist.tooltip"),isActive:()=>e.editor.isActive("taskList"),iconName:"ListTodo",action:()=>e.editor.chain().focus().clearNodes().toggleTaskList().run()},{name:"blockquote",label:n("editor.blockquote.tooltip"),isActive:()=>e.editor.isActive("blockquote"),iconName:"TextQuote",action:()=>e.editor.chain().focus().clearNodes().toggleBlockquote().run()},{name:"codeBlock",label:n("editor.codeblock.tooltip"),isActive:()=>e.editor.isActive("codeBlock"),iconName:"Code2",action:()=>e.editor.chain().focus().clearNodes().toggleCodeBlock().run()}]),o=i.computed(()=>r.value.filter(s=>s.isActive()).pop()??{label:n("editor.modify")});return(s,a)=>{var l;return i.openBlock(),i.createBlock(na,{title:(l=o.value)==null?void 0:l.label,"side-offset":5},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.value,(u,c)=>{var f;return i.openBlock(),i.createBlock(i.unref(yl),{key:c,class:"cursor-pointer",checked:((f=u.isActive)==null?void 0:f.call(u))||!1,onClick:u.action},{default:i.withCtx(()=>[i.createElementVNode("div",iX,[i.createVNode(i.unref(Ft),{name:u.iconName,class:"h3 w-3"},null,8,["name"]),i.createElementVNode("span",null,i.toDisplayString(u.label),1)])]),_:2},1032,["checked","onClick"])}),128))]),_:1},8,["title"])}}}),aX=Ze.create({name:"text-bubble",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),toolbar:!1,button:()=>({component:sX,componentProps:{}})}}}),lX=[{label:"복합 표현 - 요일과 시간대",examples:["다음 월요일 저녁","이번 토요일 오전"],pattern:"(이번|다음)?\\s?(월|화|수|목|금|토|일)요일(\\s?(오전|오후|저녁|밤|새벽))?"},{label:"시각 표현",examples:["오전 10시","오후 3시 30분","정오","자정","새벽 2시"],pattern:"((오전|오후|새벽|밤|저녁)\\s?\\d{1,2}(시(\\s?\\d{1,2}분)?)?|정오|자정)"},{label:"시간 표현 - 이른/늦은",examples:["이른 아침","늦은 밤"],pattern:"(이른\\s아침|늦은\\s밤)"},{label:"연도+월",examples:["2019년 6월","2025년12월","2024년 01월"],pattern:"\\d{4}년\\s?\\d{1,2}월"},{label:"오늘/내일/어제",examples:["오늘","내일","모레","어제","그제","그끄제"],pattern:"(오늘|내일|모레|어제|그제|그끄제)"},{label:"상대적 주 단위",examples:["이번 주","다음 주","지난 주"],pattern:"(이번|다음|지난)\\s?주"},{label:"상대적 월 단위",examples:["이번 달","다음 달","지난 달"],pattern:"(이번|다음|지난)\\s?달"},{label:"상대적 연도",examples:["올해","내년","작년","재작년","내후년"],pattern:"(올해|내년|작년|재작년|내후년)"},{label:"복합 표현 - 날짜와 시간대",examples:["1월 1일 오전","12월25일 저녁","다음 주 금요일 오전"],pattern:"(내년|올해|작년)?\\s?\\d{1,2}\\s?월\\s?\\d{1,2}\\s?일(\\s?(오전|오후|저녁|밤|새벽))?"},{label:"정확한 날짜",examples:["1월1일","1월 1일","12월 25일","01월 01일"],pattern:"\\d{1,2}\\s?월\\s?\\d{1,2}\\s?일"},{label:"요일",examples:["월요일","화요일","이번 금요일","다음 화요일"],pattern:"(이번|다음)?\\s?(월|화|수|목|금|토|일)요일"},{label:"시간대",examples:["오전","오후","저녁","밤","새벽"],pattern:"(오전|오후|저녁|밤|새벽)"},{label:"짧은 시간 표현",examples:["방금","조금 전","금방","곧","잠시 후"],pattern:"(방금|조금\\s전|금방|곧|잠시\\s후)"},{label:"연도",examples:["2015년","2024년","1998년"],pattern:"\\d{4}년"}],uX=t=>{const e=[...t||[],...lX.map(n=>n.pattern)].join("|");return new RegExp(e,"gu")},cX=Ze.create({name:"time-highlighter",addOptions(){return{additionalTimeWords:[]}},addStorage(){return{cachedRegex:null,cachedAdditionalWords:null}},addProseMirrorPlugins(){return[new Ne({props:{decorations:t=>{const e=[];return(this.storage.cachedAdditionalWords!==this.options.additionalTimeWords||!this.storage.cachedRegex)&&(this.storage.cachedAdditionalWords=this.options.additionalTimeWords,this.storage.cachedRegex=uX(this.options.additionalTimeWords)),t.doc.descendants((n,r)=>{if(!n.isText)return;let o;const s=this.storage.cachedRegex;for(;o=s.exec(n.text||"");){const a=r+o.index,l=a+o[0].length;e.push(qt.inline(a,l,{class:"time-highlight"}))}}),ht.create(t.doc,e)}}})]}}),dX=Ze.create({name:"invalidCharFocus",addOptions(){return{invalidChars:["{","}"]}},addCommands(){return{focusInvalidChar:()=>({state:t,dispatch:e,view:n})=>{let r=null;if(t.doc.descendants((s,a)=>{if(!s.isText)return!0;const l=s.text??"";for(let u=0;u<l.length;u++)if(this.options.invalidChars.includes(l[u])){const c=a+u+1;(r==null||c<r)&&(r=c)}return!0}),r==null)return!1;const o=t.tr.setSelection(Ae.create(t.doc,r));return e&&e(o.scrollIntoView()),n&&n.focus(),!0}}}});function Ab(t){const e=JSON.stringify(t),n=window.ReactNativeWebView;if(n){n.postMessage(e);return}console.warn("[clipboardBridge] no bridge found")}function fX(){return new Promise(t=>{const e=window.receiveDriverData;window.receiveDriverData=n=>{var o;e&&e(n);let r;try{r=typeof n=="string"?JSON.parse(n):n}catch{return}(r==null?void 0:r.type)==="CLIPBOARD_STATE"&&t(!!((o=r.data)!=null&&o.hasClipboard))},Ab({type:"REQUEST_CLIPBOARD_STATE"})})}function pX(){return new Promise(t=>{const e=window.receiveDriverData;window.receiveDriverData=n=>{var o;e&&e(n);let r;try{r=typeof n=="string"?JSON.parse(n):n}catch{return}(r==null?void 0:r.type)==="PASTE_RESULT"&&t(((o=r.data)==null?void 0:o.text)??null)},Ab({type:"PASTE"})})}function hX(t,e){Ab({type:"COPY",data:{html:t,text:e}})}async function mX(t,e){try{const n=new ClipboardItem({"text/html":new Blob([t],{type:"text/html"}),"text/plain":new Blob([e],{type:"text/plain"})});await navigator.clipboard.write([n])}catch(n){console.error("navigator clipboard write failed:",n)}}async function gX(){try{if("read"in navigator.clipboard){const t=await navigator.clipboard.read();for(const e of t){if(e.types.includes("text/html"))return await(await e.getType("text/html")).text();if(e.types.includes("text/plain"))return await(await e.getType("text/plain")).text()}}}catch(t){console.warn("navigator clipboard read failed:",t)}}const bX=Ze.create({name:"clipboard",addCommands(){return{copyContent:()=>({editor:t,state:e})=>{const{from:n,to:r}=e.selection;return n===r?!1:((async()=>{try{const o=e.doc.slice(n,r),a=vo.fromSchema(t.schema).serializeFragment(o.content),l=document.createElement("div");l.appendChild(a);const u=l.innerHTML,c=e.doc.textBetween(n,r,`
293
- `);t.storage.deviceEnv.isMobile?hX(u,c):await mX(u,c)}catch(o){console.warn("[clipboard] copy failed",o)}})(),!0)},cutContent:()=>({editor:t})=>((async()=>{try{await t.commands.copyContent(),t.chain().focus().deleteSelection().run()}catch(e){console.warn("[clipboard] cut failed",e)}})(),!0),pasteContent:()=>({editor:t})=>((async()=>{try{t.chain().focus().run();const e=t.storage.deviceEnv.isMobile?await pX():await gX();if(!e)return;const n=new DataTransfer;n.setData("text/html",e),n.setData("text/plain",e);const r=new ClipboardEvent("paste",{bubbles:!0,cancelable:!0});Object.defineProperty(r,"clipboardData",{value:n}),t.view.dom.dispatchEvent(r)}catch(e){console.warn("Clipboard paste failed:",e)}})(),!0)}},onCreate(){const t=this.editor;t.hasClipboard=async()=>{try{return!!(t.storage.deviceEnv.isMobile?await fX():await navigator.clipboard.readText())}catch(e){return console.warn("[clipboard] check failed",e),!1}}}}),vX=Ze.create({name:"deviceEnv",addOptions(){return{initial:!1}},addStorage(){return{isMobile:this.options.initial}},addCommands(){return{setIsMobile:t=>({editor:e})=>{var n;return e.storage.deviceEnv.isMobile=t,(n=e.storage.spellchecker)==null||n.spellchecker.setIsMobile(t),!0}}}}),Pp=i.defineComponent({__name:"TabsContent",props:{value:{},forceMount:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,n=i.computed(()=>{const{class:r,...o}=e;return o});return(r,o)=>(i.openBlock(),i.createBlock(i.unref(aD),i.mergeProps({class:i.unref(Te)("mt-2 ring-offset-ed-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ed-ring focus-visible:ring-offset-2",e.class)},n.value),{default:i.withCtx(()=>[i.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),yX={class:"flex items-center w-full p-3 my-3 hover:bg-ed-accent border border-ed-border text-ed-muted-foreground cursor-pointer rounded-sm transition-all"},wX={key:0,class:"flex justify-center items-center gap-3 text-s"},xX={key:1,class:"flex justify-between items-center w-full"},CX={class:"flex justify-center items-center gap-3"},EX={class:"text-sm"},SX={class:"flex items-center gap-2"},kX=i.defineComponent({__name:"VideoUploader",props:{...zs},setup(t){const e=t,n=i.ref(""),r=i.ref(!1),o=i.ref(),{t:s}=Tt();function a(f){var y;r.value=!0;const p=f.target,m=Array.from((p==null?void 0:p.files)||[]),g=(y=e.editor.extensionManager.extensions.find(w=>w.name==="videoUpload"))==null?void 0:y.options;if(!e.editor||e.editor.isDestroyed||m.length===0||typeof(g==null?void 0:g.upload)!="function")return;const b=m[0];g.upload(b).then(w=>{e.editor.chain().setVideo({src:w}).deleteRange({from:e.getPos(),to:e.getPos()}).insertContentAt(e.getPos()+1,{type:"paragraph"}).focus().run(),r.value=!1})}function l(){e.editor.chain().setVideo({src:n.value,width:640}).deleteRange({from:e.getPos(),to:e.getPos()}).insertContentAt(e.getPos()+1,{type:"paragraph"}).focus().run()}function u(){e.deleteNode()}function c(){var f;(f=o.value)==null||f.click()}return(f,p)=>(i.openBlock(),i.createBlock(i.unref($s),{as:"div","data-drag-handle":""},{default:i.withCtx(()=>[i.createVNode(i.unref(ul),{"default-open":""},{default:i.withCtx(()=>[i.createVNode(i.unref(fl),{"as-child":""},{default:i.withCtx(()=>[i.createElementVNode("div",yX,[r.value?(i.openBlock(),i.createElementBlock("div",wX,[i.createVNode(i.unref(Ft),{class:"animate-spin w-6 h-6",name:"LoaderCircle"}),i.createElementVNode("span",null,i.toDisplayString(i.unref(s)("editor.video.dialog.uploading"))+"...",1)])):(i.openBlock(),i.createElementBlock("div",xX,[i.createElementVNode("div",CX,[i.createVNode(i.unref(Ft),{name:"Video",class:"w-6 h-6"}),i.createElementVNode("span",EX,i.toDisplayString(i.unref(s)("editor.video.dialog.title")),1)]),i.createVNode(i.unref(Ft),{name:"Trash2",class:"hover:text-ed-foreground",onClick:i.withModifiers(u,["stop"])})]))])]),_:1}),i.createVNode(i.unref(cl),{"trap-focus":"",class:"w-full","on-open-auto-focus":m=>m.preventDefault()},{default:i.withCtx(()=>[i.createVNode(i.unref(Pg),{"default-value":"upload",class:"w-[300px] sm:w-[400px]","activation-mode":"manual"},{default:i.withCtx(()=>[i.createVNode(i.unref(Dg),{class:"grid w-full grid-cols-2"},{default:i.withCtx(()=>[i.createVNode(i.unref($u),{value:"upload"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(s)("editor.video.dialog.tab.upload")),1)]),_:1}),i.createVNode(i.unref($u),{value:"link",disabled:r.value},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(s)("editor.video.dialog.link")),1)]),_:1},8,["disabled"])]),_:1}),i.createVNode(i.unref(Pp),{value:"upload"},{default:i.withCtx(()=>[i.createVNode(i.unref(yn),{class:"w-full mt-1",size:"sm",disabled:r.value,onClick:c},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(s)("editor.video.dialog.tab.upload")),1)]),_:1},8,["disabled"]),i.createElementVNode("input",{ref_key:"fileInput",ref:o,type:"file",accept:"video/*",hidden:"",onChange:a},null,544)]),_:1}),i.createVNode(i.unref(Pp),{value:"link"},{default:i.withCtx(()=>[i.createElementVNode("div",SX,[i.createVNode(i.unref(dl),{modelValue:n.value,"onUpdate:modelValue":p[0]||(p[0]=m=>n.value=m),type:"url",autofocus:"",required:"",placeholder:i.unref(s)("editor.video.dialog.placeholder")},null,8,["modelValue","placeholder"]),i.createVNode(i.unref(yn),{onClick:l},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(s)("editor.video.dialog.button.apply")),1)]),_:1})])]),_:1})]),_:1})]),_:1},8,["on-open-auto-focus"])]),_:1})]),_:1}))}}),KE=Bt.create({name:"videoUpload",isolating:!0,defining:!0,group:"block",draggable:!0,selectable:!0,inline:!1,parseHTML(){return[{tag:`div[data-type="${this.name}"]`}]},renderHTML(){return["div",{"data-type":this.name}]},addCommands(){return{setVideoUpload:()=>({commands:t})=>t.insertContent(`<div data-type="${this.name}"></div>`)}},addNodeView(){return Hs(kX)},addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),upload:()=>Promise.reject("link video not found"),button:({editor:e,t:n})=>{var r,o;return{component:Ke,componentProps:{action:()=>e.commands.setVideoUpload(),isActive:()=>e.isActive("video")||!1,disabled:!((o=(r=e.can()).setVideo)!=null&&o.call(r,{})),icon:"Video",tooltip:n("editor.video.tooltip")}}}}}});function _X(t){return t=t.replace("https://youtu.be/","https://www.youtube.com/watch?v=").replace("watch?v=","embed/"),t=t.replace("https://vimeo.com/","https://player.vimeo.com/video/"),/^https?:\/\/www.bilibili.com\/video\/.*/i.test(t)&&(t=t.replace(/\?.*$/i,"").replace("https://www.bilibili.com/video/","https://player.bilibili.com/player.html?bvid=")),t.includes("drive.google.com")&&(t=t.replace("/view","/preview")),t}function TX(t){return t?t.includes("youtube.com/embed")||t.includes("player.vimeo.com")||t.includes("player.bilibili.com")||t.includes("drive.google.com"):!1}const GE=Bt.create({name:"video",group:"block",atom:!0,draggable:!0,addOptions(){return{divider:!1,spacer:!1,allowFullscreen:!0,upload:void 0,width:Ld["size-medium"],controls:!0,autoplay:!1,HTMLAttributes:{class:"iframe-wrapper",style:"display: flex;justify-content: center;"}}},addAttributes(){return{src:{default:null,renderHTML:({src:t})=>({src:t?_X(t):null})},width:{default:this.options.width,renderHTML:({width:t})=>({width:an(t)})},allowfullscreen:{default:this.options.allowFullscreen,parseHTML:()=>this.options.allowFullscreen},controls:{default:this.options.controls}}},parseHTML(){return[{tag:"video"},{tag:"iframe"}]},renderHTML({HTMLAttributes:t}){const{src:e,width:n,controls:r,allowfullscreen:o}=t??{},s=`max-width: ${an(n)};`;return TX(e)?["iframe",{src:e,style:s,...o&&{allowfullscreen:o}}]:["video",{src:e?e.replace(/\\/g,"/"):"",style:s,...r&&{controls:r}}]},addCommands(){return{setVideo:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t}),updateVideo:t=>({commands:e})=>e.updateAttributes(this.name,t)}}}),kl=new Et("upload-image"),AX=()=>new Ne({key:kl,state:{init(){return ht.empty},apply(t,e){e=e.map(t.mapping,t.doc);const n=t.getMeta(kl);return n!=null&&n.add?n.add.forEach(({id:r,pos:o,src:s})=>{const a=OX(s),l=qt.widget(o,a,{id:r});e=e.add(t.doc,[l])}):n!=null&&n.remove&&n.remove.forEach(r=>{e=e.remove(e.find(void 0,void 0,o=>o.id===r))}),e}},props:{decorations(t){return this.getState(t)}}});function OX(t){const e=document.createElement("div"),n=document.createElement("img");return n.setAttribute("class","opacity-50"),n.src=t,n.onload=()=>{e.setAttribute("class","img-placeholder")},e.appendChild(n),e}function MX(t,e){var o;const r=kl.getState(t).find(void 0,void 0,s=>s.id===e);return r.length?(o=r[0])==null?void 0:o.from:null}const XE=({validateFn:t,onUpload:e})=>(n,r,o,s)=>{n.forEach(a=>{if(t&&!t(a))return;s||(s=li(6));const l=r.state.tr;l.selection.empty||l.deleteSelection();let u=null;r.state.doc.descendants((p,m)=>{p.type.name===ds&&p.attrs.id===s&&(u=m)});const c=URL.createObjectURL(a);l.setMeta(kl,{add:[{id:s,pos:o,src:c}]}),r.dispatch(l);const f=MX(r.state,s)||u;e(a).then(p=>{var w;const{schema:m}=r.state;if(f===null)throw new Error("Not found placeholderPos");const g=typeof p=="object"?c:p,b=(w=m.nodes.image)==null?void 0:w.create({src:g});if(!b)return;const y=r.state.tr.replaceWith(f,f,b).setMeta(kl,{remove:[s]});r.dispatch(y)},()=>{const p=r.state.tr.delete(o,o).setMeta(kl,{remove:[s]});r.dispatch(p)})})},BX=(t,e,n)=>{var o;const r=Array.from(((o=e.clipboardData)==null?void 0:o.files)||[]);if(r.length){e.preventDefault();const s=t.state.selection.from;return n(r,t,s+1),!0}return!1},IX=(t,e,n,r)=>{var s;const o=Array.from(((s=e.dataTransfer)==null?void 0:s.files)||[]);if(!n&&o.length){e.preventDefault();const a=t.posAtCoords({left:e.clientX,top:e.clientY});if(a)return r(o,t,a.pos+1),!0}return!1},RX={class:"flex items-center w-full p-3 my-3 transition-all border rounded-sm cursor-pointer hover:bg-ed-accent border-ed-border text-ed-muted-foreground"},LX={class:"flex items-center justify-between w-full"},PX={class:"flex items-center justify-center gap-3"},DX={class:"text-sm"},VX={class:"flex items-center gap-2"},FX=i.defineComponent({__name:"ImageUploader",props:{...zs},setup(t){const e=t,n=i.ref(""),r=i.ref(),{t:o}=Tt(),s=i.inject("isEditable",i.ref(!0));function a(f){var y,w;const p=(y=f==null?void 0:f.target)==null?void 0:y.files;if(!e.editor||e.editor.isDestroyed||p.length===0)return;const m=p[0],g=(w=e.editor.extensionManager.extensions.find(x=>x.name==="imageUpload"))==null?void 0:w.options;XE({validateFn:x=>!0,onUpload:g.upload})([m],e.editor.view,e.getPos(),e.node.attrs.id)}function l(){e.editor.chain().setImage({src:n.value}).deleteRange({from:e.getPos(),to:e.getPos()}).focus().run()}function u(){s.value&&e.deleteNode()}function c(){var f;(f=r.value)==null||f.click()}return(f,p)=>(i.openBlock(),i.createBlock(i.unref($s),{id:f.node.attrs.id,class:"p-0 m-0","data-drag-handle":""},{default:i.withCtx(()=>[i.createVNode(i.unref(ul),{"default-open":""},{default:i.withCtx(()=>[i.createVNode(i.unref(fl),{"as-child":""},{default:i.withCtx(()=>[i.createElementVNode("div",RX,[i.createElementVNode("div",LX,[i.createElementVNode("div",PX,[i.createVNode(i.unref(Ft),{name:"ImageUp",class:"w-6 h-6"}),i.createElementVNode("span",DX,i.toDisplayString(i.unref(o)("editor.image.dialog.title")),1)]),i.createVNode(i.unref(Ft),{name:"Trash2",class:"hover:text-ed-foreground",onClick:i.withModifiers(u,["stop"])})])])]),_:1}),i.unref(s)?(i.openBlock(),i.createBlock(i.unref(cl),{key:0,"trap-focus":"",class:"w-full","on-open-auto-focus":m=>m.preventDefault()},{default:i.withCtx(()=>[i.createVNode(i.unref(Pg),{"default-value":"upload",class:"w-[300px] sm:w-[400px]","activation-mode":"manual"},{default:i.withCtx(()=>[i.createVNode(i.unref(Dg),{class:"grid w-full grid-cols-2"},{default:i.withCtx(()=>[i.createVNode(i.unref($u),{value:"upload"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("editor.image.dialog.tab.upload")),1)]),_:1}),i.createVNode(i.unref($u),{value:"link"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("editor.image.dialog.tab.url")),1)]),_:1})]),_:1}),i.createVNode(i.unref(Pp),{value:"upload"},{default:i.withCtx(()=>[i.createVNode(i.unref(yn),{class:"w-full mt-1",size:"sm",onClick:c},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("editor.image.dialog.tab.upload")),1)]),_:1}),i.createElementVNode("input",{ref_key:"fileInput",ref:r,type:"file",accept:"image/*",multiple:"",hidden:"",onChange:a},null,544)]),_:1}),i.createVNode(i.unref(Pp),{value:"link"},{default:i.withCtx(()=>[i.createElementVNode("div",VX,[i.createVNode(i.unref(dl),{modelValue:n.value,"onUpdate:modelValue":p[0]||(p[0]=m=>n.value=m),type:"url",autofocus:"",required:"",placeholder:i.unref(o)("editor.image.dialog.placeholder")},null,8,["modelValue","placeholder"]),i.createVNode(i.unref(yn),{onClick:l},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("editor.image.dialog.button.apply")),1)]),_:1})])]),_:1})]),_:1})]),_:1},8,["on-open-auto-focus"])):i.createCommentVNode("",!0)]),_:1})]),_:1},8,["id"]))}}),$X=1,zX=1e6,hi={ADD_TOAST:"ADD_TOAST",UPDATE_TOAST:"UPDATE_TOAST",DISMISS_TOAST:"DISMISS_TOAST",REMOVE_TOAST:"REMOVE_TOAST"};let Ob=0;function HX(){return Ob=(Ob+1)%Number.MAX_VALUE,Ob.toString()}const Mb=new Map;function YE(t){if(Mb.has(t))return;const e=setTimeout(()=>{Mb.delete(t),hc({type:hi.REMOVE_TOAST,toastId:t})},zX);Mb.set(t,e)}const fo=i.ref({toasts:[]});function hc(t){switch(t.type){case hi.ADD_TOAST:fo.value.toasts=[t.toast,...fo.value.toasts].slice(0,$X);break;case hi.UPDATE_TOAST:fo.value.toasts=fo.value.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e);break;case hi.DISMISS_TOAST:{const{toastId:e}=t;e?YE(e):fo.value.toasts.forEach(n=>{YE(n.id)}),fo.value.toasts=fo.value.toasts.map(n=>n.id===e||e===void 0?{...n,open:!1}:n);break}case hi.REMOVE_TOAST:t.toastId===void 0?fo.value.toasts=[]:fo.value.toasts=fo.value.toasts.filter(e=>e.id!==t.toastId);break}}function Bb(){return{toasts:i.computed(()=>fo.value.toasts),toast:UX,dismiss:t=>hc({type:hi.DISMISS_TOAST,toastId:t})}}function UX(t){const e=HX(),n=o=>hc({type:hi.UPDATE_TOAST,toast:{...o,id:e}}),r=()=>hc({type:hi.DISMISS_TOAST,toastId:e});return hc({type:hi.ADD_TOAST,toast:{...t,id:e,open:!0,onOpenChange:o=>{o||r()}}}),{id:e,dismiss:r,update:n}}const WX={acceptMimes:["image/jpeg","image/gif","image/png","image/jpg"],maxSize:1024*1024*5},jX=t=>`${(t/1024/1024).toFixed(2)}MB`,JE=Bt.create({name:"imageUpload",isolating:!0,defining:!0,group:"block",draggable:!1,selectable:!0,inline:!1,onCreate(){if(typeof this.options.upload!="function")throw new Error("Image upload function should be a function")},parseHTML(){return[{tag:`div[data-type="${this.name}"]`}]},renderHTML(){return["div",{"data-type":this.name}]},addAttributes(){return{id:{default:li(6),parseHTML:t=>t.getAttribute("id"),renderHTML:t=>t.id?{id:t.id}:{}}}},addCommands(){return{setImageUpload:()=>({commands:t})=>t.insertContent(`<div data-type="${this.name}"></div>`)}},addNodeView(){return Hs(FX)},addOptions(){var t;return{...WX,...(t=this.parent)==null?void 0:t.call(this),upload:()=>Promise.reject("Image Upload Function"),button:({editor:e,extension:n,t:r})=>{var o,s;return{component:Ke,componentProps:{action:()=>e.commands.setImageUpload(),disabled:!((s=(o=e.can()).setImage)!=null&&s.call(o,{})),icon:"ImageUp",tooltip:r("editor.image.tooltip")}}}}},addProseMirrorPlugins(){const{toast:t}=Bb(),{t:e}=Tt(),r=XE({validateFn:o=>this.options.acceptMimes.includes(o.type)?o.size>this.options.maxSize?(t({description:`${e("editor.imageUpload.fileSizeTooBig")} ${jX(this.options.maxSize)}.`,duration:2e3}),!1):!0:(t({description:e("editor.imageUpload.fileTypeNotSupported"),duration:2e3}),!1),onUpload:this.options.upload});return[new Ne({props:{handlePaste:(o,s)=>!s.clipboardData||Array.from(s.clipboardData.items||[]).some(l=>l.type==="text/html")?!1:BX(o,s,r),handleDrop:(o,s,a,l)=>(!(s instanceof DragEvent)||!s.dataTransfer||IX(o,s,l,r),!1)}}),AX()]}}),qX=Ze.create({name:"searchHighlight",addGlobalAttributes(){return[{types:["textStyle"],attributes:{searchHighlight:{default:null,parseHTML:t=>{const e=t,n=e.style.color,r=e.style.backgroundColor;return!n||!r?null:{color:n,backgroundColor:r}},renderHTML:t=>{if(!t.searchHighlight)return{};const{color:e,backgroundColor:n}=t.searchHighlight;return{style:`color: ${e}; background-color: ${n}`}}}}}]}}),ZE=Ze.create({name:"base-kit",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),timeHighlighter:{additionalTimeWords:[]},bubble:{list:FB,defaultBubbleList:bj,button:({editor:e,extension:n,t:r})=>{var l;const{list:o={},defaultBubbleList:s}=((l=n.options)==null?void 0:l.bubble)??{},a=(s==null?void 0:s(e))??[];return vj(o,a,{editor:e,extension:n,t:r})}}}},addExtensions(){var n,r,o,s,a;const{t}=Tt(),e=[];this.options.placeholder!==!1&&e.push(D8.configure({placeholder:({node:l,pos:u})=>{var f;const c=(f=l==null?void 0:l.type)==null?void 0:f.name;return c==="heading"?`${t(`editor.heading.h${l.attrs.level}.tooltip`)}`:c==="table"||c==="codeBlock"?"":u===0?t("editor.content"):""},...this.options.placeholder})),this.options.focus!==!1&&e.push(ij.configure({className:"focus",...this.options.focus})),this.options.document!==!1&&(this.options.page?(e.push($8.configure().extend({content:"page+"})),e.push(aK.configure({types:((r=(n=this.options.page)==null?void 0:n.nodesComputedOption)==null?void 0:r.types)??[],slots:i.useSlots()}))):e.push($8.configure())),this.options.dropcursor!==!1&&e.push(oj.configure({...this.options.dropcursor,width:2,class:"ProseMirror-dropcursor border-black"})),this.options.characterCount!==!1&&e.push(tj.configure(this.options.characterCount)),this.options.paragraph!==!1&&e.push(P8.configure(this.options.paragraph)),this.options.hardBreak!==!1&&e.push(L8.configure(this.options.hardBreak)),this.options.listItem!==!1&&e.push(hj.configure(this.options.listItem)),this.options.textStyle!==!1&&e.push(HU.configure(this.options.textStyle)),this.options.imageUpload!==!1&&e.push(JE.configure(this.options.imageUpload)),this.options.video!==!1&&e.push(GE.configure(this.options.video)),this.options.videoUpload!==!1&&e.push(KE.configure(this.options.videoUpload)),this.options.history!==!1&&e.push(V1.configure(this.options.history)),this.options.fontSize!==!1&&e.push(n8.configure(this.options.fontSize)),this.options.fontFamily!==!1&&e.push(hE.configure(this.options.fontFamily)),this.options.mode!==Fe.EDITOR&&e.push(hK),this.options.superText!==!1&&this.options.mode!==Fe.PLAIN_TEXT&&(typeof this.options.superText=="boolean"?e.push(xE.configure()):e.push(xE.configure({specialCharModal:(o=this.options.superText)==null?void 0:o.specialCharModal,toggleSuperViewMobileCallBack:(s=this.options.superText)==null?void 0:s.toggleSuperViewMobileCallBack,bottomSheetComponent:this.options.superText.bottomSheetComponent}))),this.options.mode===Fe.EDITOR&&(this.options.image!==!1&&e.push(gb.configure()),e.push(e8.configure({spacer:!0}),SC,EC,kC,L1,Tb,_C,r8.configure({spacer:!0}),t8.configure({types:["heading","paragraph"],spacer:!0}),bE)),this.options.mode!==Fe.EDITOR&&this.options.configPlan!==!1&&this.options.mode!==Fe.PLAIN_TEXT&&(typeof this.options.configPlan=="boolean"?e.push(CE.configure()):e.push(CE.configure({specialCharModal:(a=this.options.configPlan)==null?void 0:a.specialCharModal}))),this.options.mode!==Fe.EDITOR&&this.options.mode!==Fe.PLAIN_TEXT&&e.push(gK),(this.options.mode===Fe.STRAIGHT||this.options.mode===Fe.REPORT||this.options.mode===Fe.EDITOR)&&this.options.timeHighlighter&&e.push(cX.configure(this.options.timeHighlighter)),this.options.invalidCharFocus!==!1&&e.push(dX.configure(this.options.invalidCharFocus)),this.options.disabled&&e.push(qX),e.push(mj,V8.configure(),aX.configure(),pj.configure(),bb,hb,c1,bX,vX,o8.configure({multicolor:!0}));for(const l in this.options.excludes)Object.prototype.hasOwnProperty.call(this.options.excludes,l)&&this.options.excludes[l]&&nt.remove(e,({name:c})=>c===l);return e},addStorage(){return{mode:this.options.mode}}}),QE=Pn.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(t){return t!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sub",vt(this.options.HTMLAttributes,t),0]},addCommands(){return{setSubscript:()=>({commands:t})=>t.setMark(this.name),toggleSubscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSubscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),NE=Pn.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(t){return t!=="super"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sup",vt(this.options.HTMLAttributes,t),0]},addCommands(){return{setSuperscript:()=>({commands:t})=>t.setMark(this.name),toggleSuperscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSuperscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),KX=Ze.create({name:"subAndSuperScript",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,extension:n,t:r})=>{const o=n.options.subscript,s=n.options.superscript,a={component:Ke,componentProps:{action:()=>e.commands.toggleSubscript(),isActive:()=>e.isActive("subscript")||!1,disabled:!e.can().toggleSubscript(),icon:"Subscript",tooltip:r("editor.subscript.tooltip")}},l={component:Ke,componentProps:{action:()=>e.commands.toggleSuperscript(),isActive:()=>e.isActive("superscript")||!1,disabled:!e.can().toggleSuperscript(),icon:"Superscript",tooltip:r("editor.superscript.tooltip")}},u=[];return o!==!1&&u.push(a),s!==!1&&u.push(l),u}}},addExtensions(){const t=[];return this.options.subscript!==!1&&t.push(QE.configure(this.options.subscript)),this.options.superscript!==!1&&t.push(NE.configure(this.options.superscript)),t}}),GX={class:"ml-1"},XX=i.defineComponent({__name:"ActionMoreButton",props:{editor:{},disabled:{type:Boolean,default:!1},color:{default:void 0},maxHeight:{default:void 0},icon:{default:void 0},tooltip:{default:""},items:{default:()=>[]}},setup(t){const e=t,n=i.computed(()=>{const r=e.items.find(s=>s.isActive());return r&&!r.default?{...r,icon:r.icon?r.icon:e.icon}:{title:e.tooltip,icon:e.icon,isActive:()=>!1}});return(r,o)=>(i.openBlock(),i.createBlock(na,{icon:r.icon,tooltip:r.tooltip,disabled:r.disabled},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.items,(s,a)=>(i.openBlock(),i.createBlock(i.unref(yl),{key:a,checked:n.value.title===s.title,disabled:s.disabled,class:"flex gap-3 items-center",onClick:s.action},{default:i.withCtx(()=>[s.icon?(i.openBlock(),i.createBlock(i.unref(Ft),{key:0,name:s.icon},null,8,["name"])):i.createCommentVNode("",!0),i.createElementVNode("span",GX,i.toDisplayString(s.title),1),s.shortcutKeys?(i.openBlock(),i.createBlock(i.unref(NC),{key:1,class:"ml-auto"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref($6)(s.shortcutKeys)),1)]),_:2},1024)):i.createCommentVNode("",!0)]),_:2},1032,["checked","disabled","onClick"]))),128))]),_:1},8,["icon","tooltip","disabled"]))}}),YX=Ze.create({name:"moreMark",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button({editor:e,extension:n,t:r}){const o=n.options.subscript,s=n.options.superscript,a={action:()=>e.commands.toggleSubscript(),isActive:()=>e.isActive("subscript")||!1,disabled:!e.can().toggleSubscript(),icon:"Subscript",title:r("editor.subscript.tooltip"),shortcutKeys:["mod","."]},l={action:()=>e.commands.toggleSuperscript(),isActive:()=>e.isActive("superscript")||!1,disabled:!e.can().toggleSuperscript(),icon:"Superscript",title:r("editor.superscript.tooltip"),shortcutKeys:["mod",","]},u=S0(e,"code"),c=[];if(o!==!1&&c.push(a),s!==!1&&c.push(l),u){const f={action:()=>e.commands.toggleCode(),isActive:()=>e.isActive("code")||!1,disabled:!e.can().toggleCode(),icon:"Code",title:r("editor.code.tooltip"),shortcutKeys:["mod","E"]};u&&c.push(f)}return{component:XX,componentProps:{icon:"Type",tooltip:r("editor.moremark"),disabled:!e.isEditable||c.every(f=>f.disabled),items:c}}}}},addExtensions(){const t=[];return this.options.subscript!==!1&&t.push(QE.configure(this.options.subscript)),this.options.superscript!==!1&&t.push(NE.configure(this.options.superscript)),t}});var ua=(t=>(t[t.max=7]="max",t[t.min=0]="min",t[t.more=1]="more",t[t.less=-1]="less",t))(ua||{});function JX(t,e,n){return t<e?e:t>n?n:t}function ZX(t,e,n,r){const{doc:o,selection:s}=t;if(!o||!s||!(s instanceof Ae||s instanceof In))return t;const{from:a,to:l}=s;return o.nodesBetween(a,l,(u,c)=>{const f=u.type;return n.includes(f.name)?(t=QX(t,c,e),!1):!Nm(u.type.name,r.extensionManager.extensions)}),t}function QX(t,e,n){if(!t.doc)return t;const r=t.doc.nodeAt(e);if(!r)return t;const a=JX((r.attrs.indent||0)+n,0,7);if(a===r.attrs.indent)return t;const l={...r.attrs,indent:a};return t.setNodeMarkup(e,r.type,l,r.marks)}function eS({delta:t,types:e}){return({state:n,dispatch:r,editor:o})=>{const{selection:s}=n;let{tr:a}=n;return a=a.setSelection(s),a=ZX(a,t,e,o),a.docChanged?(r&&r(a),!0):!1}}const NX=Ze.create({name:"indent",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),types:["paragraph","heading","blockquote"],minIndent:ua.min,maxIndent:ua.max,button({editor:e,t:n}){var s,a;const{selection:r}=e.state,o=r.$anchor.parent;return[{component:Ke,componentProps:{action:()=>{e.commands.indent()},disabled:((s=o==null?void 0:o.attrs)==null?void 0:s.indent)>=ua.max||!e.can().indent(),shortcutKeys:["Tab"],icon:"IndentIncrease",tooltip:n("editor.indent.tooltip")}},{component:Ke,componentProps:{action:()=>{e.commands.outdent()},shortcutKeys:["Shift","Tab"],disabled:((a=o==null?void 0:o.attrs)==null?void 0:a.indent)<=ua.min||!e.can().outdent(),icon:"IndentDecrease",tooltip:n("editor.outdent.tooltip")}}]}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{indent:{default:0,parseHTML:t=>{const e=t.getAttribute("data-indent");return(e?parseInt(e,10):0)||0},renderHTML:t=>t.indent?{"data-indent":t.indent}:{}}}}]},addCommands(){return{indent:()=>eS({delta:ua.more,types:this.options.types}),outdent:()=>eS({delta:ua.less,types:this.options.types})}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.indent(),"Shift-Tab":()=>this.editor.commands.outdent()}}});function eY(t){var e;const{char:n,allowSpaces:r,allowToIncludeChar:o,allowedPrefixes:s,startOfLine:a,$position:l}=t,u=r&&!o,c=XO(n),f=new RegExp(`\\s${c}$`),p=a?"^":"",m=o?"":c,g=u?new RegExp(`${p}${c}.*?(?=\\s${m}|$)`,"gm"):new RegExp(`${p}(?:^)?${c}[^\\s${m}]*`,"gm"),b=((e=l.nodeBefore)===null||e===void 0?void 0:e.isText)&&l.nodeBefore.text;if(!b)return null;const y=l.pos-b.length,w=Array.from(b.matchAll(g)).pop();if(!w||w.input===void 0||w.index===void 0)return null;const x=w.input.slice(Math.max(0,w.index-1),w.index),E=new RegExp(`^[${s==null?void 0:s.join("")}\0]?$`).test(x);if(s!==null&&!E)return null;const S=y+w.index;let C=S+w[0].length;return u&&f.test(b.slice(C-1,C+1))&&(w[0]+=" ",C+=1),S<l.pos&&C>=l.pos?{range:{from:S,to:C},query:w[0].slice(n.length),text:w[0]}:null}const tY=new Et("suggestion");function nY({pluginKey:t=tY,editor:e,char:n="@",allowSpaces:r=!1,allowToIncludeChar:o=!1,allowedPrefixes:s=[" "],startOfLine:a=!1,decorationTag:l="span",decorationClass:u="suggestion",command:c=()=>null,items:f=()=>[],render:p=()=>({}),allow:m=()=>!0,findSuggestionMatch:g=eY}){let b;const y=p==null?void 0:p(),w=new Ne({key:t,view(){return{update:async(x,E)=>{var S,C,_,T,A,L,I;const M=(S=this.key)===null||S===void 0?void 0:S.getState(E),W=(C=this.key)===null||C===void 0?void 0:C.getState(x.state),j=M.active&&W.active&&M.range.from!==W.range.from,K=!M.active&&W.active,se=M.active&&!W.active,z=!K&&!se&&M.query!==W.query,V=K||j&&z,P=z||j,q=se||j&&z;if(!V&&!P&&!q)return;const J=q&&!V?M:W,Y=x.dom.querySelector(`[data-decoration-id="${J.decorationId}"]`);b={editor:e,range:J.range,query:J.query,text:J.text,items:[],command:ne=>c({editor:e,range:J.range,props:ne}),decorationNode:Y,clientRect:Y?()=>{var ne;const{decorationId:we}=(ne=this.key)===null||ne===void 0?void 0:ne.getState(e.state),xe=x.dom.querySelector(`[data-decoration-id="${we}"]`);return(xe==null?void 0:xe.getBoundingClientRect())||null}:null},V&&((_=y==null?void 0:y.onBeforeStart)===null||_===void 0||_.call(y,b)),P&&((T=y==null?void 0:y.onBeforeUpdate)===null||T===void 0||T.call(y,b)),(P||V)&&(b.items=await f({editor:e,query:J.query})),q&&((A=y==null?void 0:y.onExit)===null||A===void 0||A.call(y,b)),P&&((L=y==null?void 0:y.onUpdate)===null||L===void 0||L.call(y,b)),V&&((I=y==null?void 0:y.onStart)===null||I===void 0||I.call(y,b))},destroy:()=>{var x;b&&((x=y==null?void 0:y.onExit)===null||x===void 0||x.call(y,b))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(x,E,S,C){const{isEditable:_}=e,{composing:T}=e.view,{selection:A}=x,{empty:L,from:I}=A,M={...E};if(M.composing=T,_&&(L||e.view.composing)){(I<E.range.from||I>E.range.to)&&!T&&!E.composing&&(M.active=!1);const W=g({char:n,allowSpaces:r,allowToIncludeChar:o,allowedPrefixes:s,startOfLine:a,$position:A.$from}),j=`id_${Math.floor(Math.random()*4294967295)}`;W&&m({editor:e,state:C,range:W.range,isActive:E.active})?(M.active=!0,M.decorationId=E.decorationId?E.decorationId:j,M.range=W.range,M.query=W.query,M.text=W.text):M.active=!1}else M.active=!1;return M.active||(M.decorationId=null,M.range={from:0,to:0},M.query=null,M.text=null),M}},props:{handleKeyDown(x,E){var S;const{active:C,range:_}=w.getState(x.state);return C&&((S=y==null?void 0:y.onKeyDown)===null||S===void 0?void 0:S.call(y,{view:x,event:E,range:_}))||!1},decorations(x){const{active:E,range:S,decorationId:C}=w.getState(x);return E?ht.create(x.doc,[qt.inline(S.from,S.to,{nodeName:l,class:u,"data-decoration-id":C})]):null}}});return w}const rY=[{label:"优酷",value:"youku",icon:"Youku"},{label:"哔哩哔哩",value:"bilibili",icon:"BiliBili"},{label:"腾讯视频",value:"qqvideo",icon:"QQVideo"}],oY=[{label:"高德地图",value:"amap",icon:"Gaode"},{label:"百度地图",value:"baidu_map",icon:"Baidu"}],iY=[{label:"墨刀",value:"modao",icon:"Modao"},{label:"蓝湖",value:"lanhu",icon:"Lanhu"},{label:"Figma",value:"figma",icon:"Figma"},{label:"Canva",value:"canva",icon:"Canva"},{label:"ProcessOn",value:"processon",icon:"Processon"}],sY=[{label:"CodePen",value:"codepen",icon:"Codepen"}],aY=[{label:"金数据",value:"jinshuju",icon:"Jinshuju"}],lY=[],uY=[...rY,...oY,...iY,...sY,...aY,...lY];function cY(t){const{t:e}=Tt(),n=[{name:"format",title:e("editor.slash.format"),commands:[{name:"paragraph",label:e("editor.paragraph.tooltip"),aliases:["paragraph","zw"],iconName:"Paragraph",action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).setHeading({level:1}).run()}},{name:"heading1",label:e("editor.heading.h1.tooltip"),aliases:["h1","bt","bt1"],iconName:"Heading1",action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).setHeading({level:1}).run()}},{name:"heading2",label:e("editor.heading.h2.tooltip"),aliases:["h2","bt","bt2"],iconName:"Heading2",action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).setNode("heading",{level:2}).run()}},{name:"heading3",label:e("editor.heading.h3.tooltip"),aliases:["h3","bt","bt3","heading3"],iconName:"Heading3",action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).setNode("heading",{level:3}).run()}},{name:"bulletList",label:e("editor.bulletlist.tooltip"),aliases:["ul","yxlb","bulletList"],iconName:"List",action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).toggleBulletList().run()}},{name:"numberedList",label:e("editor.orderedlist.tooltip"),aliases:["ol","yxlb"],iconName:"ListOrdered",action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).toggleOrderedList().run()}},{name:"codeBlock",label:e("editor.codeblock.tooltip"),iconName:"Code2",aliases:["codeBlock"],description:"Code block with syntax highlighting",shouldBeHidden:o=>o.isActive("columns"),action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).setCodeBlock().run()}},{name:"blockquote",label:e("editor.blockquote.tooltip"),description:"插入引入格式",aliases:["yr"],iconName:"TextQuote",action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).setBlockquote().run()}},{name:"horizontalrule",label:e("editor.horizontalrule.tooltip"),aliases:["fgx","horizontalRule"],iconName:"Minus",action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).setHorizontalRule().run()}},{name:"link",label:e("editor.link.tooltip"),aliases:["link","lianjie","lj"],iconName:"Link",action:({editor:o,range:s})=>{o.chain().deleteRange(s).extendMarkRange("link").insertContent({type:"text",text:"link",marks:[{type:"link",attrs:{href:"",target:"_blank"}}]}).setLink({href:""}).focus().run()}}]},{name:"insert",title:e("editor.slash.insert"),commands:[{name:"image",label:e("editor.image.tooltip"),iconName:"ImageUp",description:"Insert a image",aliases:["image","tp","tupian"],shouldBeHidden:o=>o.isActive("columns"),action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).setImageUpload().run()}},{name:"table",label:e("editor.table.tooltip"),iconName:"Table",description:"Insert a table",aliases:["table","bg","biaoge","biao"],shouldBeHidden:o=>o.isActive("columns"),action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).insertTable({rows:3,cols:3,withHeaderRow:!1}).run()}},{name:"video",label:e("editor.video.tooltip"),iconName:"Video",description:"Insert a video",aliases:["video","sp","shipin"],shouldBeHidden:o=>o.isActive("columns"),action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).setVideoUpload().run()}},{name:"taskList",label:e("editor.tasklist.tooltip"),iconName:"ListTodo",description:"Task list with todo items",aliases:["todo"],action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).toggleTaskList().run()}},{name:"columns",label:e("editor.columns.tooltip"),iconName:"Columns2",description:"Add two column content",aliases:["columns","cols","2cols"],shouldBeHidden:o=>o.isActive("columns"),action:({editor:o,range:s})=>{o.chain().deleteRange(s).setColumns().focus(o.state.selection.head-1).run()}}]}];if(S0(t,"iframes")){const o=uY;n.push({name:"others",title:e("editor.slash.embed"),commands:o.map(s=>({name:s.value,label:s.label,iconName:s.icon,aliases:[s.value,s.label],shouldBeHidden:a=>a.isActive("columns"),action:({editor:a,range:l})=>{a.chain().deleteRange(l).focus().setIframe({src:"",service:s.value}).run()}}))})}return n}const dY={key:0,class:"grid grid-cols-1 gap-0.5 min-w-48"},fY={className:"text-neutral-500 text-[0.65rem] col-[1/-1] mx-2 mt-2 font-semibold tracking-wider select-none uppercase first:mt-0.5"},pY=["onClick"],hY=["src"],mY={key:1,class:"p-3"},gY={class:"text-xs text-gray-800 dark:text-gray-400"},bY=i.defineComponent({__name:"CommandsList",props:{editor:{},items:{default:void 0},command:{type:Function,default:void 0}},setup(t,{expose:e}){const n=i.ref(0),r=i.ref(0),o=i.ref(null),{t:s}=Tt(),a=i.ref([]),l=t;e({onKeyDown:u}),i.watch([()=>n.value,()=>r.value],async()=>{if(!o.value)return;await i.nextTick();const y=r.value*1e3+n.value,w=a.value[y];w&&w.scrollIntoView({behavior:"smooth",block:"nearest"})});function u({event:y}){return y.key==="ArrowUp"?(c(),!0):y.key==="ArrowDown"?(f(),!0):y.key==="Enter"?(p(),!0):!1}function c(){var x;if(!l.items.length)return!1;let y=n.value-1,w=r.value;y<0&&(w=r.value-1,y=((x=l.items[w])==null?void 0:x.commands.length)-1||0),w<0&&(w=l.items.length-1,y=l.items[w].commands.length-1),n.value=y,r.value=w}function f(){if(!l.items.length)return!1;const y=l.items[r.value].commands;let w=n.value+1,x=r.value;y.length-1<w&&(w=0,x=r.value+1),l.items.length-1<x&&(x=0),n.value=w,r.value=x}function p(){if(!l.items.length||r.value===-1||n.value===-1)return!1;m(r.value,n.value)}function m(y,w){const x=l.items[y].commands[w];l.command(x)}function g(y,w){m(y,w)}function b(y,w,x){a.value[y*1e3+w]=x}return(y,w)=>{var x;return i.openBlock(),i.createElementBlock("div",{ref_key:"scrollContainer",ref:o,class:"bg-white rounded-lg dark:bg-black shadow-sm border border-neutral-200 dark:border-neutral-800 text-black max-h-[min(80vh,24rem)] overflow-auto flex-wrap mb-8 p-1"},[(x=y.items)!=null&&x.length?(i.openBlock(),i.createElementBlock("div",dY,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(y.items,(E,S)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:E.title},[i.createElementVNode("div",fY,i.toDisplayString(E.title),1),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(E.commands,(C,_)=>(i.openBlock(),i.createElementBlock("button",{ref_for:!0,ref:T=>b(S,_,T),key:_,class:i.normalizeClass(["flex items-center gap-3 px-2 py-1.5 text-sm text-neutral-800 dark:text-neutral-200 text-left w-full rounded-sm outline-none transition-colors",[r.value===S&&n.value===_?"bg-ed-accent text-neutral-800 dark:bg-neutral-900 dark:text-neutral-200":"hover:bg-ed-accent hover:text-neutral-800 dark:hover:bg-neutral-900 dark:hover:text-neutral-200"]]),onClick:T=>g(S,_)},[C.iconUrl?(i.openBlock(),i.createElementBlock("img",{key:0,class:"w-6 h-6",src:C.iconUrl},null,8,hY)):i.createCommentVNode("",!0),C.iconName?(i.openBlock(),i.createBlock(i.unref(Ft),{key:1,name:C.iconName,class:"mr-1 text-lg"},null,8,["name"])):i.createCommentVNode("",!0),i.createTextVNode(" "+i.toDisplayString(C.label),1)],10,pY))),128))],64))),128))])):(i.openBlock(),i.createElementBlock("div",mY,[i.createElementVNode("span",gY,i.toDisplayString(i.unref(s)("editor.slash.empty")),1)]))],512)}}}),ca="slashCommand";let Rt;const vY=Ze.create({name:ca,priority:200,onCreate(){Rt=Fs("body",{interactive:!0,trigger:"manual",placement:"bottom-start",theme:"slash-command",maxWidth:"16rem",offset:[16,8],popperOptions:{strategy:"fixed",modifiers:[{name:"flip",enabled:!1}]}})},addProseMirrorPlugins(){return[nY({editor:this.editor,char:"/",allowSpaces:!0,startOfLine:!0,pluginKey:new Et(ca),allow:({state:t,range:e})=>{var c,f,p;const n=t.doc.resolve(e.from),r=n.depth===1,o=n.parent.type.name==="paragraph",s=((c=n.parent.textContent)==null?void 0:c.charAt(0))==="/",a=this.editor.isActive("column"),l=(p=n.parent.textContent)==null?void 0:p.substring((f=n.parent.textContent)==null?void 0:f.indexOf("/")),u=!(l!=null&&l.endsWith(" "));return(r&&o&&s||a&&o&&s)&&u},command:({editor:t,range:e,props:n})=>{const{view:r}=t;n.action({editor:t,range:e}),r.focus()},items:({query:t})=>cY(this.editor).map(s=>({...s,commands:s.commands.filter(a=>{const l=a.label.toLowerCase().trim(),u=t.toLowerCase().trim();if(a.aliases){const c=a.aliases.map(m=>m.toLowerCase().trim()),f=l.match(u),p=c.some(m=>m.match(u));return f||p}return l.match(u)}).filter(a=>a.shouldBeHidden?!a.shouldBeHidden(this.editor):!0)})).filter(s=>s.commands.length>0).map(s=>({...s,commands:s.commands.map(a=>({...a,isEnabled:!0}))})),render:()=>{let t,e=null;return{onStart:n=>{var s;t=new sw(bY,{props:n,editor:n.editor});const{view:r}=n.editor,o=()=>{if(!n.clientRect)return n.editor.storage[ca].rect;const a=n.clientRect();if(!a)return n.editor.storage[ca].rect;let l=a.y;if(t.element instanceof HTMLElement&&a.top+t.element.offsetHeight+40>window.innerHeight){const u=a.top+t.element.offsetHeight-window.innerHeight+40;l=a.y-u}return new DOMRect(a.x,l,a.width,a.height)};e=()=>{Rt==null||Rt[0].setProps({getReferenceClientRect:o})},(s=r.dom.parentElement)==null||s.addEventListener("scroll",e),t.element&&(Rt==null||Rt[0].setProps({getReferenceClientRect:o,appendTo:()=>document.body,content:t.element})),Rt==null||Rt[0].show()},onUpdate(n){var a;t.updateProps(n);const{view:r}=n.editor,o=()=>{if(!n.clientRect)return n.editor.storage[ca].rect;const l=n.clientRect();return l?new DOMRect(l.x,l.y,l.width,l.height):n.editor.storage[ca].rect},s=()=>{Rt==null||Rt[0].setProps({getReferenceClientRect:o})};(a=r.dom.parentElement)==null||a.addEventListener("scroll",s),n.editor.storage[ca].rect=n.clientRect?o():{width:0,height:0,left:0,top:0,right:0,bottom:0},Rt==null||Rt[0].setProps({getReferenceClientRect:o})},onKeyDown(n){var r;return n.event.key==="Escape"?(Rt==null||Rt[0].hide(),!0):(Rt!=null&&Rt[0].state.isShown||Rt==null||Rt[0].show(),(r=t.ref)==null?void 0:r.onKeyDown(n))},onExit(n){var r;if(Rt==null||Rt[0].hide(),e){const{view:o}=n.editor;(r=o.dom.parentElement)==null||r.removeEventListener("scroll",e)}t.destroy()}}}})]},addStorage(){return{rect:{width:0,height:0,left:0,top:0,right:0,bottom:0}}}}),yY=i.defineComponent({__name:"AIButton",props:{editor:{},icon:{default:void 0},title:{default:void 0},tooltip:{default:void 0},disabled:{type:Boolean,default:!1},shortcutKeys:{default:void 0},customClass:{default:""},loading:{type:Boolean,default:!1},tooltipOptions:{default:void 0},color:{default:void 0},action:{type:Function,default:void 0},isActive:{type:Function,default:void 0}},setup(t){const e=t,n=wn(),{toast:r}=Bb();function o(){var a,l,u;const s=(l=(a=e.editor.extensionManager.extensions.find(c=>c.name==="AI"))==null?void 0:a.options)==null?void 0:l.completions;if(typeof s!="function"){r({title:"AI completions method is not set or is not a valid function",variant:"destructive"});return}if(s.constructor.name!=="AsyncFunction"){r({title:"AI completions method must be an asynchronous function",variant:"destructive"});return}n.state.AIMenu=!0,(u=e.editor)==null||u.commands.focus()}return(s,a)=>(i.openBlock(),i.createBlock(Ke,{action:o,title:"AI",disabled:s.disabled,icon:s.icon,tooltip:s.tooltip},null,8,["disabled","icon","tooltip"]))}}),wY=Bt.create({name:"AI",group:"block",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),toolbar:!1,button:({editor:e,t:n})=>({component:yY,componentProps:{icon:"Sparkles",tooltip:n("editor.AI.ask")}})}}});function xY(t,e){const n=atob(t.split(",")[1]),r=new Array(n.length);for(let s=0;s<n.length;s++)r[s]=n.charCodeAt(s);const o=new Uint8Array(r);return new Blob([o],{type:e})}function CY(t,e){return new File([t],e,{type:t.type})}const EY=Ze.create({name:"importWord",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),upload:void 0,convert:void 0,limit:1024*1024*10,button:({editor:e,extension:n,t:r})=>({component:Ke,componentProps:{action:()=>{var o;return(o=e.commands)==null?void 0:o.toggleImportWord()},disabled:!e.can().setHorizontalRule(),icon:"Word",tooltip:r("editor.importWord.tooltip")}})}},addCommands(){return{toggleImportWord:()=>({chain:t,editor:e})=>{const{toast:n}=Bb(),{t:r}=Tt();async function o(u){var g;const f=new DOMParser().parseFromString(u,"text/html"),p=f.querySelectorAll("img");if(!p.length)return f.body.innerHTML;if(S0(e,"image")){const b=(g=e.extensionManager.extensions.find(y=>y.name==="importWord"))==null?void 0:g.options;if(b&&typeof b.upload=="function"){const y=[];for(const x of p){const E=x.getAttribute("src"),S=xY(E,"image/jpeg"),C=CY(S,"image.jpeg");y.push(C)}const w=await b.upload(y);for(let x=0;x<p.length;x++){const E=p[x];E.setAttribute("src",w[x].src);const S=E.parentElement;(S==null?void 0:S.tagName)==="P"&&(S.insertAdjacentElement("beforebegin",E),!S.hasChildNodes()&&S.textContent===""&&S.remove())}return f.body.innerHTML}else return console.warn("Image Upload method found, skip image conversion"),f.body.innerHTML}else return console.error("Image extension not found, unable to convert image"),f.body.innerHTML}async function s(u){const c=await o(u);e.chain().setContent(c.toString(),!0).run(),n({title:r("editor.importWord.success")})}const{open:a,onChange:l}=gt.useFileDialog({accept:".docx",reset:!0,multiple:!1});return a(),l(async u=>{const[c]=Array.from(u??[]);if(c){if(c.size>this.options.limit){n({title:r("editor.importWord.fileTooLarge"),variant:"destructive"});return}if(this.options.convert){const f=await this.options.convert(c);s(f)}else{const f=new FormData,p=JSON.stringify({collaboration_features:{comments:!0,user_id:"e3",track_changes:!0},formatting:{resets:"none",defaults:"inline",styles:"inline",comments:"basic"}});f.append("config",p),f.append("file",c),fetch("https://docx-converter.cke-cs.com/v2/convert/docx-html",{method:"POST",body:f}).then(m=>m.json()).then(async m=>{s(m.html)}).catch(m=>{n({title:r("editor.importWord.error"),variant:"destructive"}),console.error("Error:",m)})}}}),!1}}}}),Ib=wn(),SY=Ze.create({name:"preview",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({t:e})=>({component:Ke,componentProps:{icon:"Eye",action:()=>{Ib.togglePreview()},tooltip:e("editor.preview.tooltip"),isActive:()=>Ib.state.showPreview}})}},addCommands(){return{togglePreview:()=>()=>(Ib.togglePreview(),!0)}}}),tS=wn(),kY=(t,e,n)=>RegExp(e?t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"):t,n?"gu":"gui");function _Y(t,e,n,r){const o=[],s=[];let a=[],l=0;if(!e)return{decorationsToReturn:ht.empty,results:[]};t==null||t.descendants((u,c)=>{u.isText?a[l]?a[l]={text:a[l].text+u.text,pos:a[l].pos}:a[l]={text:`${u.text}`,pos:c}:l+=1}),a=a.filter(Boolean);for(const u of a){const{text:c,pos:f}=u,p=Array.from(c.matchAll(e)).filter(([m])=>m.trim());for(const m of p){if(m[0]==="")break;m.index!==void 0&&s.push({from:f+m.index,to:f+m.index+m[0].length})}}for(let u=0;u<s.length;u+=1){const c=s[u],f=u===r?`${n} ${n}-current`:n,p=qt.inline(c.from,c.to,{class:f});o.push(p)}return{decorationsToReturn:ht.create(t,o),results:s}}const TY=(t,e,{state:n,dispatch:r})=>{if(!e[0])return;const{from:s,to:a}=e[0];r&&r(n.tr.insertText(t,s,a))},AY=(t,e,n,r)=>{const o=e+1;if(!r[o])return null;const{from:s,to:a}=r[e],l=a-s-t.length+n,{from:u,to:c}=r[o];return r[o]={to:c-l,from:u-l},[l,r]},OY=(t,e,{tr:n,dispatch:r})=>{let o=0,s=e.slice();if(s.length){for(let a=0;a<s.length;a+=1){const{from:l,to:u}=s[a];n.insertText(t,l,u);const c=AY(t,a,o,s);c&&(o=c[0],s=c[1])}r&&r(n)}},MY=new Et("findAndReplacePlugin"),BY=Ze.create({name:"findAndReplace",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),searchResultClass:"vdc-editor-search-result",disableRegex:!0,button:({editor:e,extension:n,t:r})=>({component:Ke,componentProps:{icon:"DocSearch",tooltip:r("editor.findAndReplace.tooltip"),action:()=>{tS.toggleFindAndReplace()},isActive:()=>tS.state.findAndReplace}})}},addStorage(){return{searchTerm:"",replaceTerm:"",results:[],lastSearchTerm:"",caseSensitive:!1,lastCaseSensitive:!1,resultIndex:0,lastResultIndex:0}},addCommands(){return{setSearchTerm:t=>({editor:e})=>(e.storage.findAndReplace.searchTerm=t,!1),setReplaceTerm:t=>({editor:e})=>(e.storage.findAndReplace.replaceTerm=t,!1),setCaseSensitive:t=>({editor:e})=>(e.storage.findAndReplace.caseSensitive=t,!1),resetIndex:()=>({editor:t})=>(t.storage.findAndReplace.resultIndex=0,!1),nextSearchResult:()=>({editor:t})=>{const{results:e,resultIndex:n}=t.storage.findAndReplace,r=n+1;return e[r]?t.storage.findAndReplace.resultIndex=r:t.storage.findAndReplace.resultIndex=0,!1},previousSearchResult:()=>({editor:t})=>{const{results:e,resultIndex:n}=t.storage.findAndReplace,r=n-1;return e[r]?t.storage.findAndReplace.resultIndex=r:t.storage.findAndReplace.resultIndex=e.length-1,!1},replace:()=>({editor:t,state:e,dispatch:n})=>{const{replaceTerm:r,results:o}=t.storage.findAndReplace;return TY(r,o,{state:e,dispatch:n}),!1},replaceAll:()=>({editor:t,tr:e,dispatch:n})=>{const{replaceTerm:r,results:o}=t.storage.findAndReplace;return OY(r,o,{tr:e,dispatch:n}),!1}}},addProseMirrorPlugins(){const t=this.editor,{searchResultClass:e,disableRegex:n}=this.options,r=a=>t.storage.findAndReplace.lastSearchTerm=a,o=a=>t.storage.findAndReplace.lastCaseSensitive=a,s=a=>t.storage.findAndReplace.lastResultIndex=a;return[new Ne({key:MY,state:{init:()=>ht.empty,apply({doc:a,docChanged:l},u){const{searchTerm:c,lastSearchTerm:f,caseSensitive:p,lastCaseSensitive:m,resultIndex:g,lastResultIndex:b}=t.storage.findAndReplace;if(!l&&f===c&&m===p&&b===g)return u;if(r(c),o(p),s(g),!c)return t.storage.findAndReplace.results=[],ht.empty;const{decorationsToReturn:y,results:w}=_Y(a,kY(c,n,p),e,g);return t.storage.findAndReplace.results=w,y}},props:{decorations(a){return this.getState(a)}}})]}}),{togglePrinter:IY,state:RY}=wn(),LY=Ze.create({name:"printer",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({t:e})=>({component:Ke,componentProps:{tooltip:e("editor.printer.tooltip"),action:()=>IY(),icon:"Printer",shortcutKeys:["mod","P"],isActive:()=>RY.printer}})}}}),Rb="spell-check";class PY{constructor(e,n,r,o=1e3){Xt(this,"debouncedGetMatchAndSetDecorations",nt.debounce(this.getMatchAndSetDecorations.bind(this),300));Xt(this,"debouncedGetMatchAndSetDecorationsList",nt.debounce(this.getMatchAndSetDecorationsList.bind(this),300));Xt(this,"debouncedClickEventsListener",nt.debounce(this.clickEventsListener.bind(this),0));Xt(this,"debouncedAcceptSuggestionEventsListener",nt.debounce(this.acceptSuggestionListener.bind(this),0));Xt(this,"debouncedProofreadChangedNodes",nt.debounce(this.proofreadChangedNodes.bind(this),300));Xt(this,"proofreader");Xt(this,"uiStrings");Xt(this,"showSuggestionsEvent");Xt(this,"decorationSet");Xt(this,"editorView");Xt(this,"isInitialProofreadingDone",!1);Xt(this,"lastOriginalFrom",0);Xt(this,"lastClickedDecoration",null);Xt(this,"suggestionBox");Xt(this,"isEnableSuggestion");Xt(this,"isMobile");Xt(this,"limit",1e3);Xt(this,"_debouncedProofreadDoc",nt.debounce((e,n)=>{this.proofreadDoc(e),n&&n()},500));Xt(this,"_debouncedHandleEnterKey",nt.debounce((e,n,r)=>{this.handleEnterKey(e,n),r&&r()},500));this.proofreader=e,this.uiStrings=n,this.showSuggestionsEvent=r,this.decorationSet=ht.empty,this.limit=o,this.suggestionBox=document.createElement("div"),this.suggestionBox.id="suggestions-box",this.suggestionBox.tabIndex=0,this.isEnableSuggestion=!0,this.isMobile=!1,this.hideSuggestionBox()}get completeProofreadingDone(){return this.isInitialProofreadingDone}getProofreader(){return this.proofreader}toggleIsEnabledSpellCheck(){this.proofreader.toggleIsEnabled()}setEnabledProofreadText(e){this.proofreader.setEnabled(e)}getIsEnabledSpellCheck(){return this.proofreader.getIsEnabled()}setDecorationSet(e){this.decorationSet=e}getDecorationSet(){return this.decorationSet}setEditorView(e){this.editorView=e}getEditorView(){return this.editorView}getSuggestionBox(){return this.suggestionBox}hideSuggestionBox(){this.suggestionBox.textContent="",this.suggestionBox.style.display="none"}setIsEnableSuggestion(e){if(this.isEnableSuggestion=e,this.isEnableSuggestion){this.addEventListenersToDecorations();return}this.hideSuggestionBox(),this.removeEventListenersFromDecorations()}setIsMobile(e){this.isMobile=e}getChangedNodesFromTransaction(e,n=!1,r=!1){const o=[],s=new Set;let a=!1;return e.steps.forEach(l=>{var p,m,g;const u=l;if(u.from===void 0||u.to===void 0||n&&u.structure)return;((m=(p=u.slice)==null?void 0:p.content[0])==null?void 0:m.type.name)===fc&&(a=!0);const c=u.from-(r?1:0);let f=Math.max(u.to,u.from+(((g=u.slice)==null?void 0:g.size)||0))-(r?1:0);f>e.doc.content.size&&(f=e.doc.content.size),e.doc.nodesBetween(c,f,(b,y)=>{b&&(b.isText&&!s.has(y)&&(o.push({node:b,pos:y}),s.add(y)),b.type.name===fc&&(a=!0))})}),{changedNodes:o,isChangedSuperText:a}}debouncedProofreadDoc(e,n){this._debouncedProofreadDoc(e,n)}isSuperTextAlone(e,n){let r=!1;return e.descendants((o,s,a)=>o===n?(a&&a.type.name==="paragraph"&&a.childCount===1&&a.firstChild===n&&(r=!0),!1):!0),r}proofreadDoc(e){let n=[],r=0;e==null||e.descendants((u,c)=>{if(u.isText){const f={text:u.text??"",from:c,to:c+u.nodeSize};return n[r]&&(f.text=n[r].text+f.text,f.from=n[r].from),n[r]=f,r+=1,!1}return u.type.name!==fc}),n=n.filter(Boolean);let o="",s=1;for(const{text:u,from:c,to:f}of n){const p=c-s;p>0&&(o+=Array(p+1).join(`
293
+ `);t.storage.deviceEnv.isMobile?hX(u,c):await mX(u,c)}catch(o){console.warn("[clipboard] copy failed",o)}})(),!0)},cutContent:()=>({editor:t})=>((async()=>{try{await t.commands.copyContent(),t.chain().focus().deleteSelection().run()}catch(e){console.warn("[clipboard] cut failed",e)}})(),!0),pasteContent:()=>({editor:t})=>((async()=>{try{t.chain().focus().run();const e=t.storage.deviceEnv.isMobile?await pX():await gX();if(!e)return;const n=new DataTransfer;n.setData("text/html",e),n.setData("text/plain",e);const r=new ClipboardEvent("paste",{bubbles:!0,cancelable:!0});Object.defineProperty(r,"clipboardData",{value:n}),t.view.dom.dispatchEvent(r)}catch(e){console.warn("Clipboard paste failed:",e)}})(),!0)}},onCreate(){const t=this.editor;t.hasClipboard=async()=>{try{return!!(t.storage.deviceEnv.isMobile?await fX():await navigator.clipboard.readText())}catch(e){return console.warn("[clipboard] check failed",e),!1}}}}),vX=Ze.create({name:"deviceEnv",addOptions(){return{initial:!1}},addStorage(){return{isMobile:this.options.initial}},addCommands(){return{setIsMobile:t=>({editor:e})=>{var n;return e.storage.deviceEnv.isMobile=t,(n=e.storage.spellchecker)==null||n.spellchecker.setIsMobile(t),!0}}}}),Pp=i.defineComponent({__name:"TabsContent",props:{value:{},forceMount:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,n=i.computed(()=>{const{class:r,...o}=e;return o});return(r,o)=>(i.openBlock(),i.createBlock(i.unref(aD),i.mergeProps({class:i.unref(Te)("mt-2 ring-offset-ed-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ed-ring focus-visible:ring-offset-2",e.class)},n.value),{default:i.withCtx(()=>[i.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),yX={class:"flex items-center w-full p-3 my-3 hover:bg-ed-accent border border-ed-border text-ed-muted-foreground cursor-pointer rounded-sm transition-all"},wX={key:0,class:"flex justify-center items-center gap-3 text-s"},xX={key:1,class:"flex justify-between items-center w-full"},CX={class:"flex justify-center items-center gap-3"},EX={class:"text-sm"},SX={class:"flex items-center gap-2"},kX=i.defineComponent({__name:"VideoUploader",props:{...zs},setup(t){const e=t,n=i.ref(""),r=i.ref(!1),o=i.ref(),{t:s}=Tt();function a(f){var y;r.value=!0;const p=f.target,m=Array.from((p==null?void 0:p.files)||[]),g=(y=e.editor.extensionManager.extensions.find(w=>w.name==="videoUpload"))==null?void 0:y.options;if(!e.editor||e.editor.isDestroyed||m.length===0||typeof(g==null?void 0:g.upload)!="function")return;const b=m[0];g.upload(b).then(w=>{e.editor.chain().setVideo({src:w}).deleteRange({from:e.getPos(),to:e.getPos()}).insertContentAt(e.getPos()+1,{type:"paragraph"}).focus().run(),r.value=!1})}function l(){e.editor.chain().setVideo({src:n.value,width:640}).deleteRange({from:e.getPos(),to:e.getPos()}).insertContentAt(e.getPos()+1,{type:"paragraph"}).focus().run()}function u(){e.deleteNode()}function c(){var f;(f=o.value)==null||f.click()}return(f,p)=>(i.openBlock(),i.createBlock(i.unref($s),{as:"div","data-drag-handle":""},{default:i.withCtx(()=>[i.createVNode(i.unref(ul),{"default-open":""},{default:i.withCtx(()=>[i.createVNode(i.unref(fl),{"as-child":""},{default:i.withCtx(()=>[i.createElementVNode("div",yX,[r.value?(i.openBlock(),i.createElementBlock("div",wX,[i.createVNode(i.unref(Ft),{class:"animate-spin w-6 h-6",name:"LoaderCircle"}),i.createElementVNode("span",null,i.toDisplayString(i.unref(s)("editor.video.dialog.uploading"))+"...",1)])):(i.openBlock(),i.createElementBlock("div",xX,[i.createElementVNode("div",CX,[i.createVNode(i.unref(Ft),{name:"Video",class:"w-6 h-6"}),i.createElementVNode("span",EX,i.toDisplayString(i.unref(s)("editor.video.dialog.title")),1)]),i.createVNode(i.unref(Ft),{name:"Trash2",class:"hover:text-ed-foreground",onClick:i.withModifiers(u,["stop"])})]))])]),_:1}),i.createVNode(i.unref(cl),{"trap-focus":"",class:"w-full","on-open-auto-focus":m=>m.preventDefault()},{default:i.withCtx(()=>[i.createVNode(i.unref(Pg),{"default-value":"upload",class:"w-[300px] sm:w-[400px]","activation-mode":"manual"},{default:i.withCtx(()=>[i.createVNode(i.unref(Dg),{class:"grid w-full grid-cols-2"},{default:i.withCtx(()=>[i.createVNode(i.unref($u),{value:"upload"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(s)("editor.video.dialog.tab.upload")),1)]),_:1}),i.createVNode(i.unref($u),{value:"link",disabled:r.value},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(s)("editor.video.dialog.link")),1)]),_:1},8,["disabled"])]),_:1}),i.createVNode(i.unref(Pp),{value:"upload"},{default:i.withCtx(()=>[i.createVNode(i.unref(yn),{class:"w-full mt-1",size:"sm",disabled:r.value,onClick:c},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(s)("editor.video.dialog.tab.upload")),1)]),_:1},8,["disabled"]),i.createElementVNode("input",{ref_key:"fileInput",ref:o,type:"file",accept:"video/*",hidden:"",onChange:a},null,544)]),_:1}),i.createVNode(i.unref(Pp),{value:"link"},{default:i.withCtx(()=>[i.createElementVNode("div",SX,[i.createVNode(i.unref(dl),{modelValue:n.value,"onUpdate:modelValue":p[0]||(p[0]=m=>n.value=m),type:"url",autofocus:"",required:"",placeholder:i.unref(s)("editor.video.dialog.placeholder")},null,8,["modelValue","placeholder"]),i.createVNode(i.unref(yn),{onClick:l},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(s)("editor.video.dialog.button.apply")),1)]),_:1})])]),_:1})]),_:1})]),_:1},8,["on-open-auto-focus"])]),_:1})]),_:1}))}}),KE=Bt.create({name:"videoUpload",isolating:!0,defining:!0,group:"block",draggable:!0,selectable:!0,inline:!1,parseHTML(){return[{tag:`div[data-type="${this.name}"]`}]},renderHTML(){return["div",{"data-type":this.name}]},addCommands(){return{setVideoUpload:()=>({commands:t})=>t.insertContent(`<div data-type="${this.name}"></div>`)}},addNodeView(){return Hs(kX)},addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),upload:()=>Promise.reject("link video not found"),button:({editor:e,t:n})=>{var r,o;return{component:Ke,componentProps:{action:()=>e.commands.setVideoUpload(),isActive:()=>e.isActive("video")||!1,disabled:!((o=(r=e.can()).setVideo)!=null&&o.call(r,{})),icon:"Video",tooltip:n("editor.video.tooltip")}}}}}});function _X(t){return t=t.replace("https://youtu.be/","https://www.youtube.com/watch?v=").replace("watch?v=","embed/"),t=t.replace("https://vimeo.com/","https://player.vimeo.com/video/"),/^https?:\/\/www.bilibili.com\/video\/.*/i.test(t)&&(t=t.replace(/\?.*$/i,"").replace("https://www.bilibili.com/video/","https://player.bilibili.com/player.html?bvid=")),t.includes("drive.google.com")&&(t=t.replace("/view","/preview")),t}function TX(t){return t?t.includes("youtube.com/embed")||t.includes("player.vimeo.com")||t.includes("player.bilibili.com")||t.includes("drive.google.com"):!1}const GE=Bt.create({name:"video",group:"block",atom:!0,draggable:!0,addOptions(){return{divider:!1,spacer:!1,allowFullscreen:!0,upload:void 0,width:Ld["size-medium"],controls:!0,autoplay:!1,HTMLAttributes:{class:"iframe-wrapper",style:"display: flex;justify-content: center;"}}},addAttributes(){return{src:{default:null,renderHTML:({src:t})=>({src:t?_X(t):null})},width:{default:this.options.width,renderHTML:({width:t})=>({width:an(t)})},allowfullscreen:{default:this.options.allowFullscreen,parseHTML:()=>this.options.allowFullscreen},controls:{default:this.options.controls}}},parseHTML(){return[{tag:"video"},{tag:"iframe"}]},renderHTML({HTMLAttributes:t}){const{src:e,width:n,controls:r,allowfullscreen:o}=t??{},s=`max-width: ${an(n)};`;return TX(e)?["iframe",{src:e,style:s,...o&&{allowfullscreen:o}}]:["video",{src:e?e.replace(/\\/g,"/"):"",style:s,...r&&{controls:r}}]},addCommands(){return{setVideo:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t}),updateVideo:t=>({commands:e})=>e.updateAttributes(this.name,t)}}}),kl=new Et("upload-image"),AX=()=>new Ne({key:kl,state:{init(){return ht.empty},apply(t,e){e=e.map(t.mapping,t.doc);const n=t.getMeta(kl);return n!=null&&n.add?n.add.forEach(({id:r,pos:o,src:s})=>{const a=OX(s),l=qt.widget(o,a,{id:r});e=e.add(t.doc,[l])}):n!=null&&n.remove&&n.remove.forEach(r=>{e=e.remove(e.find(void 0,void 0,o=>o.id===r))}),e}},props:{decorations(t){return this.getState(t)}}});function OX(t){const e=document.createElement("div"),n=document.createElement("img");return n.setAttribute("class","opacity-50"),n.src=t,n.onload=()=>{e.setAttribute("class","img-placeholder")},e.appendChild(n),e}function MX(t,e){var o;const r=kl.getState(t).find(void 0,void 0,s=>s.id===e);return r.length?(o=r[0])==null?void 0:o.from:null}const XE=({validateFn:t,onUpload:e})=>(n,r,o,s)=>{n.forEach(a=>{if(t&&!t(a))return;s||(s=li(6));const l=r.state.tr;l.selection.empty||l.deleteSelection();let u=null;r.state.doc.descendants((p,m)=>{p.type.name===ds&&p.attrs.id===s&&(u=m)});const c=URL.createObjectURL(a);l.setMeta(kl,{add:[{id:s,pos:o,src:c}]}),r.dispatch(l);const f=MX(r.state,s)||u;e(a).then(p=>{var E,S;const{schema:m}=r.state;if(f===null)throw new Error("Not found placeholderPos");const g=typeof p=="object"?c:p,b=(E=m.nodes.image)==null?void 0:E.create({src:g}),y=(S=m.nodes.paragraph)==null?void 0:S.create();if(!b||!y)return;const w=r.state.tr.replaceWith(f,f,b).insert(f+b.nodeSize,y).setMeta(kl,{remove:[s]}),x=f+b.nodeSize+1;w.setSelection(Ae.create(w.doc,x)),r.dispatch(w),r.focus()},()=>{const p=r.state.tr.delete(o,o).setMeta(kl,{remove:[s]});r.dispatch(p)})})},BX=(t,e,n)=>{var o;const r=Array.from(((o=e.clipboardData)==null?void 0:o.files)||[]);if(r.length){e.preventDefault();const s=t.state.selection.from;return n(r,t,s+1),!0}return!1},IX=(t,e,n,r)=>{var s;const o=Array.from(((s=e.dataTransfer)==null?void 0:s.files)||[]);if(!n&&o.length){e.preventDefault();const a=t.posAtCoords({left:e.clientX,top:e.clientY});if(a)return r(o,t,a.pos+1),!0}return!1},RX={class:"flex items-center w-full p-3 my-3 transition-all border rounded-sm cursor-pointer hover:bg-ed-accent border-ed-border text-ed-muted-foreground"},LX={class:"flex items-center justify-between w-full"},PX={class:"flex items-center justify-center gap-3"},DX={class:"text-sm"},VX={class:"flex items-center gap-2"},FX=i.defineComponent({__name:"ImageUploader",props:{...zs},setup(t){const e=t,n=i.ref(""),r=i.ref(),{t:o}=Tt(),s=i.inject("isEditable",i.ref(!0));function a(f){var y,w;const p=(y=f==null?void 0:f.target)==null?void 0:y.files;if(!e.editor||e.editor.isDestroyed||p.length===0)return;const m=p[0],g=(w=e.editor.extensionManager.extensions.find(x=>x.name==="imageUpload"))==null?void 0:w.options;XE({validateFn:x=>!0,onUpload:g.upload})([m],e.editor.view,e.getPos(),e.node.attrs.id)}function l(){e.editor.chain().setImage({src:n.value}).deleteRange({from:e.getPos(),to:e.getPos()}).insertContentAt(e.getPos()+1,{type:"paragraph"}).focus().run()}function u(){s.value&&e.deleteNode()}function c(){var f;(f=r.value)==null||f.click()}return(f,p)=>(i.openBlock(),i.createBlock(i.unref($s),{id:f.node.attrs.id,class:"p-0 m-0","data-drag-handle":""},{default:i.withCtx(()=>[i.createVNode(i.unref(ul),{"default-open":""},{default:i.withCtx(()=>[i.createVNode(i.unref(fl),{"as-child":""},{default:i.withCtx(()=>[i.createElementVNode("div",RX,[i.createElementVNode("div",LX,[i.createElementVNode("div",PX,[i.createVNode(i.unref(Ft),{name:"ImageUp",class:"w-6 h-6"}),i.createElementVNode("span",DX,i.toDisplayString(i.unref(o)("editor.image.dialog.title")),1)]),i.createVNode(i.unref(Ft),{name:"Trash2",class:"hover:text-ed-foreground",onClick:i.withModifiers(u,["stop"])})])])]),_:1}),i.unref(s)?(i.openBlock(),i.createBlock(i.unref(cl),{key:0,"trap-focus":"",class:"w-full","on-open-auto-focus":m=>m.preventDefault()},{default:i.withCtx(()=>[i.createVNode(i.unref(Pg),{"default-value":"upload",class:"w-[300px] sm:w-[400px]","activation-mode":"manual"},{default:i.withCtx(()=>[i.createVNode(i.unref(Dg),{class:"grid w-full grid-cols-2"},{default:i.withCtx(()=>[i.createVNode(i.unref($u),{value:"upload"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("editor.image.dialog.tab.upload")),1)]),_:1}),i.createVNode(i.unref($u),{value:"link"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("editor.image.dialog.tab.url")),1)]),_:1})]),_:1}),i.createVNode(i.unref(Pp),{value:"upload"},{default:i.withCtx(()=>[i.createVNode(i.unref(yn),{class:"w-full mt-1",size:"sm",onClick:c},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("editor.image.dialog.tab.upload")),1)]),_:1}),i.createElementVNode("input",{ref_key:"fileInput",ref:r,type:"file",accept:"image/*",multiple:"",hidden:"",onChange:a},null,544)]),_:1}),i.createVNode(i.unref(Pp),{value:"link"},{default:i.withCtx(()=>[i.createElementVNode("div",VX,[i.createVNode(i.unref(dl),{modelValue:n.value,"onUpdate:modelValue":p[0]||(p[0]=m=>n.value=m),type:"url",autofocus:"",required:"",placeholder:i.unref(o)("editor.image.dialog.placeholder")},null,8,["modelValue","placeholder"]),i.createVNode(i.unref(yn),{onClick:l},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("editor.image.dialog.button.apply")),1)]),_:1})])]),_:1})]),_:1})]),_:1},8,["on-open-auto-focus"])):i.createCommentVNode("",!0)]),_:1})]),_:1},8,["id"]))}}),$X=1,zX=1e6,hi={ADD_TOAST:"ADD_TOAST",UPDATE_TOAST:"UPDATE_TOAST",DISMISS_TOAST:"DISMISS_TOAST",REMOVE_TOAST:"REMOVE_TOAST"};let Ob=0;function HX(){return Ob=(Ob+1)%Number.MAX_VALUE,Ob.toString()}const Mb=new Map;function YE(t){if(Mb.has(t))return;const e=setTimeout(()=>{Mb.delete(t),hc({type:hi.REMOVE_TOAST,toastId:t})},zX);Mb.set(t,e)}const fo=i.ref({toasts:[]});function hc(t){switch(t.type){case hi.ADD_TOAST:fo.value.toasts=[t.toast,...fo.value.toasts].slice(0,$X);break;case hi.UPDATE_TOAST:fo.value.toasts=fo.value.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e);break;case hi.DISMISS_TOAST:{const{toastId:e}=t;e?YE(e):fo.value.toasts.forEach(n=>{YE(n.id)}),fo.value.toasts=fo.value.toasts.map(n=>n.id===e||e===void 0?{...n,open:!1}:n);break}case hi.REMOVE_TOAST:t.toastId===void 0?fo.value.toasts=[]:fo.value.toasts=fo.value.toasts.filter(e=>e.id!==t.toastId);break}}function Bb(){return{toasts:i.computed(()=>fo.value.toasts),toast:UX,dismiss:t=>hc({type:hi.DISMISS_TOAST,toastId:t})}}function UX(t){const e=HX(),n=o=>hc({type:hi.UPDATE_TOAST,toast:{...o,id:e}}),r=()=>hc({type:hi.DISMISS_TOAST,toastId:e});return hc({type:hi.ADD_TOAST,toast:{...t,id:e,open:!0,onOpenChange:o=>{o||r()}}}),{id:e,dismiss:r,update:n}}const WX={acceptMimes:["image/jpeg","image/gif","image/png","image/jpg"],maxSize:1024*1024*5},jX=t=>`${(t/1024/1024).toFixed(2)}MB`,JE=Bt.create({name:"imageUpload",isolating:!0,defining:!0,group:"block",draggable:!1,selectable:!0,inline:!1,onCreate(){if(typeof this.options.upload!="function")throw new Error("Image upload function should be a function")},parseHTML(){return[{tag:`div[data-type="${this.name}"]`}]},renderHTML(){return["div",{"data-type":this.name}]},addAttributes(){return{id:{default:li(6),parseHTML:t=>t.getAttribute("id"),renderHTML:t=>t.id?{id:t.id}:{}}}},addCommands(){return{setImageUpload:()=>({commands:t})=>t.insertContent(`<div data-type="${this.name}"></div>`)}},addNodeView(){return Hs(FX)},addOptions(){var t;return{...WX,...(t=this.parent)==null?void 0:t.call(this),upload:()=>Promise.reject("Image Upload Function"),button:({editor:e,extension:n,t:r})=>{var o,s;return{component:Ke,componentProps:{action:()=>e.commands.setImageUpload(),disabled:!((s=(o=e.can()).setImage)!=null&&s.call(o,{})),icon:"ImageUp",tooltip:r("editor.image.tooltip")}}}}},addProseMirrorPlugins(){const{toast:t}=Bb(),{t:e}=Tt(),r=XE({validateFn:o=>this.options.acceptMimes.includes(o.type)?o.size>this.options.maxSize?(t({description:`${e("editor.imageUpload.fileSizeTooBig")} ${jX(this.options.maxSize)}.`,duration:2e3}),!1):!0:(t({description:e("editor.imageUpload.fileTypeNotSupported"),duration:2e3}),!1),onUpload:this.options.upload});return[new Ne({props:{handlePaste:(o,s)=>!s.clipboardData||Array.from(s.clipboardData.items||[]).some(l=>l.type==="text/html")?!1:BX(o,s,r),handleDrop:(o,s,a,l)=>(!(s instanceof DragEvent)||!s.dataTransfer||IX(o,s,l,r),!1)}}),AX()]}}),qX=Ze.create({name:"searchHighlight",addGlobalAttributes(){return[{types:["textStyle"],attributes:{searchHighlight:{default:null,parseHTML:t=>{const e=t,n=e.style.color,r=e.style.backgroundColor;return!n||!r?null:{color:n,backgroundColor:r}},renderHTML:t=>{if(!t.searchHighlight)return{};const{color:e,backgroundColor:n}=t.searchHighlight;return{style:`color: ${e}; background-color: ${n}`}}}}}]}}),ZE=Ze.create({name:"base-kit",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),timeHighlighter:{additionalTimeWords:[]},bubble:{list:FB,defaultBubbleList:bj,button:({editor:e,extension:n,t:r})=>{var l;const{list:o={},defaultBubbleList:s}=((l=n.options)==null?void 0:l.bubble)??{},a=(s==null?void 0:s(e))??[];return vj(o,a,{editor:e,extension:n,t:r})}}}},addExtensions(){var n,r,o,s,a;const{t}=Tt(),e=[];this.options.placeholder!==!1&&e.push(D8.configure({placeholder:({node:l,pos:u})=>{var f;const c=(f=l==null?void 0:l.type)==null?void 0:f.name;return c==="heading"?`${t(`editor.heading.h${l.attrs.level}.tooltip`)}`:c==="table"||c==="codeBlock"?"":u===0?t("editor.content"):""},...this.options.placeholder})),this.options.focus!==!1&&e.push(ij.configure({className:"focus",...this.options.focus})),this.options.document!==!1&&(this.options.page?(e.push($8.configure().extend({content:"page+"})),e.push(aK.configure({types:((r=(n=this.options.page)==null?void 0:n.nodesComputedOption)==null?void 0:r.types)??[],slots:i.useSlots()}))):e.push($8.configure())),this.options.dropcursor!==!1&&e.push(oj.configure({...this.options.dropcursor,width:2,class:"ProseMirror-dropcursor border-black"})),this.options.characterCount!==!1&&e.push(tj.configure(this.options.characterCount)),this.options.paragraph!==!1&&e.push(P8.configure(this.options.paragraph)),this.options.hardBreak!==!1&&e.push(L8.configure(this.options.hardBreak)),this.options.listItem!==!1&&e.push(hj.configure(this.options.listItem)),this.options.textStyle!==!1&&e.push(HU.configure(this.options.textStyle)),this.options.imageUpload!==!1&&e.push(JE.configure(this.options.imageUpload)),this.options.video!==!1&&e.push(GE.configure(this.options.video)),this.options.videoUpload!==!1&&e.push(KE.configure(this.options.videoUpload)),this.options.history!==!1&&e.push(V1.configure(this.options.history)),this.options.fontSize!==!1&&e.push(n8.configure(this.options.fontSize)),this.options.fontFamily!==!1&&e.push(hE.configure(this.options.fontFamily)),this.options.mode!==Fe.EDITOR&&e.push(hK),this.options.superText!==!1&&this.options.mode!==Fe.PLAIN_TEXT&&(typeof this.options.superText=="boolean"?e.push(xE.configure()):e.push(xE.configure({specialCharModal:(o=this.options.superText)==null?void 0:o.specialCharModal,toggleSuperViewMobileCallBack:(s=this.options.superText)==null?void 0:s.toggleSuperViewMobileCallBack,bottomSheetComponent:this.options.superText.bottomSheetComponent}))),this.options.mode===Fe.EDITOR&&(this.options.image!==!1&&e.push(gb.configure()),e.push(e8.configure({spacer:!0}),SC,EC,kC,L1,Tb,_C,r8.configure({spacer:!0}),t8.configure({types:["heading","paragraph"],spacer:!0}),bE)),this.options.mode!==Fe.EDITOR&&this.options.configPlan!==!1&&this.options.mode!==Fe.PLAIN_TEXT&&(typeof this.options.configPlan=="boolean"?e.push(CE.configure()):e.push(CE.configure({specialCharModal:(a=this.options.configPlan)==null?void 0:a.specialCharModal}))),this.options.mode!==Fe.EDITOR&&this.options.mode!==Fe.PLAIN_TEXT&&e.push(gK),(this.options.mode===Fe.STRAIGHT||this.options.mode===Fe.REPORT||this.options.mode===Fe.EDITOR)&&this.options.timeHighlighter&&e.push(cX.configure(this.options.timeHighlighter)),this.options.invalidCharFocus!==!1&&e.push(dX.configure(this.options.invalidCharFocus)),this.options.disabled&&e.push(qX),e.push(mj,V8.configure(),aX.configure(),pj.configure(),bb,hb,c1,bX,vX,o8.configure({multicolor:!0}));for(const l in this.options.excludes)Object.prototype.hasOwnProperty.call(this.options.excludes,l)&&this.options.excludes[l]&&nt.remove(e,({name:c})=>c===l);return e},addStorage(){return{mode:this.options.mode}}}),QE=Pn.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(t){return t!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sub",vt(this.options.HTMLAttributes,t),0]},addCommands(){return{setSubscript:()=>({commands:t})=>t.setMark(this.name),toggleSubscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSubscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),NE=Pn.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(t){return t!=="super"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sup",vt(this.options.HTMLAttributes,t),0]},addCommands(){return{setSuperscript:()=>({commands:t})=>t.setMark(this.name),toggleSuperscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSuperscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),KX=Ze.create({name:"subAndSuperScript",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,extension:n,t:r})=>{const o=n.options.subscript,s=n.options.superscript,a={component:Ke,componentProps:{action:()=>e.commands.toggleSubscript(),isActive:()=>e.isActive("subscript")||!1,disabled:!e.can().toggleSubscript(),icon:"Subscript",tooltip:r("editor.subscript.tooltip")}},l={component:Ke,componentProps:{action:()=>e.commands.toggleSuperscript(),isActive:()=>e.isActive("superscript")||!1,disabled:!e.can().toggleSuperscript(),icon:"Superscript",tooltip:r("editor.superscript.tooltip")}},u=[];return o!==!1&&u.push(a),s!==!1&&u.push(l),u}}},addExtensions(){const t=[];return this.options.subscript!==!1&&t.push(QE.configure(this.options.subscript)),this.options.superscript!==!1&&t.push(NE.configure(this.options.superscript)),t}}),GX={class:"ml-1"},XX=i.defineComponent({__name:"ActionMoreButton",props:{editor:{},disabled:{type:Boolean,default:!1},color:{default:void 0},maxHeight:{default:void 0},icon:{default:void 0},tooltip:{default:""},items:{default:()=>[]}},setup(t){const e=t,n=i.computed(()=>{const r=e.items.find(s=>s.isActive());return r&&!r.default?{...r,icon:r.icon?r.icon:e.icon}:{title:e.tooltip,icon:e.icon,isActive:()=>!1}});return(r,o)=>(i.openBlock(),i.createBlock(na,{icon:r.icon,tooltip:r.tooltip,disabled:r.disabled},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.items,(s,a)=>(i.openBlock(),i.createBlock(i.unref(yl),{key:a,checked:n.value.title===s.title,disabled:s.disabled,class:"flex gap-3 items-center",onClick:s.action},{default:i.withCtx(()=>[s.icon?(i.openBlock(),i.createBlock(i.unref(Ft),{key:0,name:s.icon},null,8,["name"])):i.createCommentVNode("",!0),i.createElementVNode("span",GX,i.toDisplayString(s.title),1),s.shortcutKeys?(i.openBlock(),i.createBlock(i.unref(NC),{key:1,class:"ml-auto"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref($6)(s.shortcutKeys)),1)]),_:2},1024)):i.createCommentVNode("",!0)]),_:2},1032,["checked","disabled","onClick"]))),128))]),_:1},8,["icon","tooltip","disabled"]))}}),YX=Ze.create({name:"moreMark",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button({editor:e,extension:n,t:r}){const o=n.options.subscript,s=n.options.superscript,a={action:()=>e.commands.toggleSubscript(),isActive:()=>e.isActive("subscript")||!1,disabled:!e.can().toggleSubscript(),icon:"Subscript",title:r("editor.subscript.tooltip"),shortcutKeys:["mod","."]},l={action:()=>e.commands.toggleSuperscript(),isActive:()=>e.isActive("superscript")||!1,disabled:!e.can().toggleSuperscript(),icon:"Superscript",title:r("editor.superscript.tooltip"),shortcutKeys:["mod",","]},u=S0(e,"code"),c=[];if(o!==!1&&c.push(a),s!==!1&&c.push(l),u){const f={action:()=>e.commands.toggleCode(),isActive:()=>e.isActive("code")||!1,disabled:!e.can().toggleCode(),icon:"Code",title:r("editor.code.tooltip"),shortcutKeys:["mod","E"]};u&&c.push(f)}return{component:XX,componentProps:{icon:"Type",tooltip:r("editor.moremark"),disabled:!e.isEditable||c.every(f=>f.disabled),items:c}}}}},addExtensions(){const t=[];return this.options.subscript!==!1&&t.push(QE.configure(this.options.subscript)),this.options.superscript!==!1&&t.push(NE.configure(this.options.superscript)),t}});var ua=(t=>(t[t.max=7]="max",t[t.min=0]="min",t[t.more=1]="more",t[t.less=-1]="less",t))(ua||{});function JX(t,e,n){return t<e?e:t>n?n:t}function ZX(t,e,n,r){const{doc:o,selection:s}=t;if(!o||!s||!(s instanceof Ae||s instanceof In))return t;const{from:a,to:l}=s;return o.nodesBetween(a,l,(u,c)=>{const f=u.type;return n.includes(f.name)?(t=QX(t,c,e),!1):!Nm(u.type.name,r.extensionManager.extensions)}),t}function QX(t,e,n){if(!t.doc)return t;const r=t.doc.nodeAt(e);if(!r)return t;const a=JX((r.attrs.indent||0)+n,0,7);if(a===r.attrs.indent)return t;const l={...r.attrs,indent:a};return t.setNodeMarkup(e,r.type,l,r.marks)}function eS({delta:t,types:e}){return({state:n,dispatch:r,editor:o})=>{const{selection:s}=n;let{tr:a}=n;return a=a.setSelection(s),a=ZX(a,t,e,o),a.docChanged?(r&&r(a),!0):!1}}const NX=Ze.create({name:"indent",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),types:["paragraph","heading","blockquote"],minIndent:ua.min,maxIndent:ua.max,button({editor:e,t:n}){var s,a;const{selection:r}=e.state,o=r.$anchor.parent;return[{component:Ke,componentProps:{action:()=>{e.commands.indent()},disabled:((s=o==null?void 0:o.attrs)==null?void 0:s.indent)>=ua.max||!e.can().indent(),shortcutKeys:["Tab"],icon:"IndentIncrease",tooltip:n("editor.indent.tooltip")}},{component:Ke,componentProps:{action:()=>{e.commands.outdent()},shortcutKeys:["Shift","Tab"],disabled:((a=o==null?void 0:o.attrs)==null?void 0:a.indent)<=ua.min||!e.can().outdent(),icon:"IndentDecrease",tooltip:n("editor.outdent.tooltip")}}]}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{indent:{default:0,parseHTML:t=>{const e=t.getAttribute("data-indent");return(e?parseInt(e,10):0)||0},renderHTML:t=>t.indent?{"data-indent":t.indent}:{}}}}]},addCommands(){return{indent:()=>eS({delta:ua.more,types:this.options.types}),outdent:()=>eS({delta:ua.less,types:this.options.types})}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.indent(),"Shift-Tab":()=>this.editor.commands.outdent()}}});function eY(t){var e;const{char:n,allowSpaces:r,allowToIncludeChar:o,allowedPrefixes:s,startOfLine:a,$position:l}=t,u=r&&!o,c=XO(n),f=new RegExp(`\\s${c}$`),p=a?"^":"",m=o?"":c,g=u?new RegExp(`${p}${c}.*?(?=\\s${m}|$)`,"gm"):new RegExp(`${p}(?:^)?${c}[^\\s${m}]*`,"gm"),b=((e=l.nodeBefore)===null||e===void 0?void 0:e.isText)&&l.nodeBefore.text;if(!b)return null;const y=l.pos-b.length,w=Array.from(b.matchAll(g)).pop();if(!w||w.input===void 0||w.index===void 0)return null;const x=w.input.slice(Math.max(0,w.index-1),w.index),E=new RegExp(`^[${s==null?void 0:s.join("")}\0]?$`).test(x);if(s!==null&&!E)return null;const S=y+w.index;let C=S+w[0].length;return u&&f.test(b.slice(C-1,C+1))&&(w[0]+=" ",C+=1),S<l.pos&&C>=l.pos?{range:{from:S,to:C},query:w[0].slice(n.length),text:w[0]}:null}const tY=new Et("suggestion");function nY({pluginKey:t=tY,editor:e,char:n="@",allowSpaces:r=!1,allowToIncludeChar:o=!1,allowedPrefixes:s=[" "],startOfLine:a=!1,decorationTag:l="span",decorationClass:u="suggestion",command:c=()=>null,items:f=()=>[],render:p=()=>({}),allow:m=()=>!0,findSuggestionMatch:g=eY}){let b;const y=p==null?void 0:p(),w=new Ne({key:t,view(){return{update:async(x,E)=>{var S,C,_,T,A,L,I;const M=(S=this.key)===null||S===void 0?void 0:S.getState(E),W=(C=this.key)===null||C===void 0?void 0:C.getState(x.state),j=M.active&&W.active&&M.range.from!==W.range.from,K=!M.active&&W.active,se=M.active&&!W.active,z=!K&&!se&&M.query!==W.query,V=K||j&&z,P=z||j,q=se||j&&z;if(!V&&!P&&!q)return;const J=q&&!V?M:W,Y=x.dom.querySelector(`[data-decoration-id="${J.decorationId}"]`);b={editor:e,range:J.range,query:J.query,text:J.text,items:[],command:ne=>c({editor:e,range:J.range,props:ne}),decorationNode:Y,clientRect:Y?()=>{var ne;const{decorationId:we}=(ne=this.key)===null||ne===void 0?void 0:ne.getState(e.state),xe=x.dom.querySelector(`[data-decoration-id="${we}"]`);return(xe==null?void 0:xe.getBoundingClientRect())||null}:null},V&&((_=y==null?void 0:y.onBeforeStart)===null||_===void 0||_.call(y,b)),P&&((T=y==null?void 0:y.onBeforeUpdate)===null||T===void 0||T.call(y,b)),(P||V)&&(b.items=await f({editor:e,query:J.query})),q&&((A=y==null?void 0:y.onExit)===null||A===void 0||A.call(y,b)),P&&((L=y==null?void 0:y.onUpdate)===null||L===void 0||L.call(y,b)),V&&((I=y==null?void 0:y.onStart)===null||I===void 0||I.call(y,b))},destroy:()=>{var x;b&&((x=y==null?void 0:y.onExit)===null||x===void 0||x.call(y,b))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(x,E,S,C){const{isEditable:_}=e,{composing:T}=e.view,{selection:A}=x,{empty:L,from:I}=A,M={...E};if(M.composing=T,_&&(L||e.view.composing)){(I<E.range.from||I>E.range.to)&&!T&&!E.composing&&(M.active=!1);const W=g({char:n,allowSpaces:r,allowToIncludeChar:o,allowedPrefixes:s,startOfLine:a,$position:A.$from}),j=`id_${Math.floor(Math.random()*4294967295)}`;W&&m({editor:e,state:C,range:W.range,isActive:E.active})?(M.active=!0,M.decorationId=E.decorationId?E.decorationId:j,M.range=W.range,M.query=W.query,M.text=W.text):M.active=!1}else M.active=!1;return M.active||(M.decorationId=null,M.range={from:0,to:0},M.query=null,M.text=null),M}},props:{handleKeyDown(x,E){var S;const{active:C,range:_}=w.getState(x.state);return C&&((S=y==null?void 0:y.onKeyDown)===null||S===void 0?void 0:S.call(y,{view:x,event:E,range:_}))||!1},decorations(x){const{active:E,range:S,decorationId:C}=w.getState(x);return E?ht.create(x.doc,[qt.inline(S.from,S.to,{nodeName:l,class:u,"data-decoration-id":C})]):null}}});return w}const rY=[{label:"优酷",value:"youku",icon:"Youku"},{label:"哔哩哔哩",value:"bilibili",icon:"BiliBili"},{label:"腾讯视频",value:"qqvideo",icon:"QQVideo"}],oY=[{label:"高德地图",value:"amap",icon:"Gaode"},{label:"百度地图",value:"baidu_map",icon:"Baidu"}],iY=[{label:"墨刀",value:"modao",icon:"Modao"},{label:"蓝湖",value:"lanhu",icon:"Lanhu"},{label:"Figma",value:"figma",icon:"Figma"},{label:"Canva",value:"canva",icon:"Canva"},{label:"ProcessOn",value:"processon",icon:"Processon"}],sY=[{label:"CodePen",value:"codepen",icon:"Codepen"}],aY=[{label:"金数据",value:"jinshuju",icon:"Jinshuju"}],lY=[],uY=[...rY,...oY,...iY,...sY,...aY,...lY];function cY(t){const{t:e}=Tt(),n=[{name:"format",title:e("editor.slash.format"),commands:[{name:"paragraph",label:e("editor.paragraph.tooltip"),aliases:["paragraph","zw"],iconName:"Paragraph",action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).setHeading({level:1}).run()}},{name:"heading1",label:e("editor.heading.h1.tooltip"),aliases:["h1","bt","bt1"],iconName:"Heading1",action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).setHeading({level:1}).run()}},{name:"heading2",label:e("editor.heading.h2.tooltip"),aliases:["h2","bt","bt2"],iconName:"Heading2",action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).setNode("heading",{level:2}).run()}},{name:"heading3",label:e("editor.heading.h3.tooltip"),aliases:["h3","bt","bt3","heading3"],iconName:"Heading3",action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).setNode("heading",{level:3}).run()}},{name:"bulletList",label:e("editor.bulletlist.tooltip"),aliases:["ul","yxlb","bulletList"],iconName:"List",action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).toggleBulletList().run()}},{name:"numberedList",label:e("editor.orderedlist.tooltip"),aliases:["ol","yxlb"],iconName:"ListOrdered",action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).toggleOrderedList().run()}},{name:"codeBlock",label:e("editor.codeblock.tooltip"),iconName:"Code2",aliases:["codeBlock"],description:"Code block with syntax highlighting",shouldBeHidden:o=>o.isActive("columns"),action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).setCodeBlock().run()}},{name:"blockquote",label:e("editor.blockquote.tooltip"),description:"插入引入格式",aliases:["yr"],iconName:"TextQuote",action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).setBlockquote().run()}},{name:"horizontalrule",label:e("editor.horizontalrule.tooltip"),aliases:["fgx","horizontalRule"],iconName:"Minus",action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).setHorizontalRule().run()}},{name:"link",label:e("editor.link.tooltip"),aliases:["link","lianjie","lj"],iconName:"Link",action:({editor:o,range:s})=>{o.chain().deleteRange(s).extendMarkRange("link").insertContent({type:"text",text:"link",marks:[{type:"link",attrs:{href:"",target:"_blank"}}]}).setLink({href:""}).focus().run()}}]},{name:"insert",title:e("editor.slash.insert"),commands:[{name:"image",label:e("editor.image.tooltip"),iconName:"ImageUp",description:"Insert a image",aliases:["image","tp","tupian"],shouldBeHidden:o=>o.isActive("columns"),action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).setImageUpload().run()}},{name:"table",label:e("editor.table.tooltip"),iconName:"Table",description:"Insert a table",aliases:["table","bg","biaoge","biao"],shouldBeHidden:o=>o.isActive("columns"),action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).insertTable({rows:3,cols:3,withHeaderRow:!1}).run()}},{name:"video",label:e("editor.video.tooltip"),iconName:"Video",description:"Insert a video",aliases:["video","sp","shipin"],shouldBeHidden:o=>o.isActive("columns"),action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).setVideoUpload().run()}},{name:"taskList",label:e("editor.tasklist.tooltip"),iconName:"ListTodo",description:"Task list with todo items",aliases:["todo"],action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).toggleTaskList().run()}},{name:"columns",label:e("editor.columns.tooltip"),iconName:"Columns2",description:"Add two column content",aliases:["columns","cols","2cols"],shouldBeHidden:o=>o.isActive("columns"),action:({editor:o,range:s})=>{o.chain().deleteRange(s).setColumns().focus(o.state.selection.head-1).run()}}]}];if(S0(t,"iframes")){const o=uY;n.push({name:"others",title:e("editor.slash.embed"),commands:o.map(s=>({name:s.value,label:s.label,iconName:s.icon,aliases:[s.value,s.label],shouldBeHidden:a=>a.isActive("columns"),action:({editor:a,range:l})=>{a.chain().deleteRange(l).focus().setIframe({src:"",service:s.value}).run()}}))})}return n}const dY={key:0,class:"grid grid-cols-1 gap-0.5 min-w-48"},fY={className:"text-neutral-500 text-[0.65rem] col-[1/-1] mx-2 mt-2 font-semibold tracking-wider select-none uppercase first:mt-0.5"},pY=["onClick"],hY=["src"],mY={key:1,class:"p-3"},gY={class:"text-xs text-gray-800 dark:text-gray-400"},bY=i.defineComponent({__name:"CommandsList",props:{editor:{},items:{default:void 0},command:{type:Function,default:void 0}},setup(t,{expose:e}){const n=i.ref(0),r=i.ref(0),o=i.ref(null),{t:s}=Tt(),a=i.ref([]),l=t;e({onKeyDown:u}),i.watch([()=>n.value,()=>r.value],async()=>{if(!o.value)return;await i.nextTick();const y=r.value*1e3+n.value,w=a.value[y];w&&w.scrollIntoView({behavior:"smooth",block:"nearest"})});function u({event:y}){return y.key==="ArrowUp"?(c(),!0):y.key==="ArrowDown"?(f(),!0):y.key==="Enter"?(p(),!0):!1}function c(){var x;if(!l.items.length)return!1;let y=n.value-1,w=r.value;y<0&&(w=r.value-1,y=((x=l.items[w])==null?void 0:x.commands.length)-1||0),w<0&&(w=l.items.length-1,y=l.items[w].commands.length-1),n.value=y,r.value=w}function f(){if(!l.items.length)return!1;const y=l.items[r.value].commands;let w=n.value+1,x=r.value;y.length-1<w&&(w=0,x=r.value+1),l.items.length-1<x&&(x=0),n.value=w,r.value=x}function p(){if(!l.items.length||r.value===-1||n.value===-1)return!1;m(r.value,n.value)}function m(y,w){const x=l.items[y].commands[w];l.command(x)}function g(y,w){m(y,w)}function b(y,w,x){a.value[y*1e3+w]=x}return(y,w)=>{var x;return i.openBlock(),i.createElementBlock("div",{ref_key:"scrollContainer",ref:o,class:"bg-white rounded-lg dark:bg-black shadow-sm border border-neutral-200 dark:border-neutral-800 text-black max-h-[min(80vh,24rem)] overflow-auto flex-wrap mb-8 p-1"},[(x=y.items)!=null&&x.length?(i.openBlock(),i.createElementBlock("div",dY,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(y.items,(E,S)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:E.title},[i.createElementVNode("div",fY,i.toDisplayString(E.title),1),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(E.commands,(C,_)=>(i.openBlock(),i.createElementBlock("button",{ref_for:!0,ref:T=>b(S,_,T),key:_,class:i.normalizeClass(["flex items-center gap-3 px-2 py-1.5 text-sm text-neutral-800 dark:text-neutral-200 text-left w-full rounded-sm outline-none transition-colors",[r.value===S&&n.value===_?"bg-ed-accent text-neutral-800 dark:bg-neutral-900 dark:text-neutral-200":"hover:bg-ed-accent hover:text-neutral-800 dark:hover:bg-neutral-900 dark:hover:text-neutral-200"]]),onClick:T=>g(S,_)},[C.iconUrl?(i.openBlock(),i.createElementBlock("img",{key:0,class:"w-6 h-6",src:C.iconUrl},null,8,hY)):i.createCommentVNode("",!0),C.iconName?(i.openBlock(),i.createBlock(i.unref(Ft),{key:1,name:C.iconName,class:"mr-1 text-lg"},null,8,["name"])):i.createCommentVNode("",!0),i.createTextVNode(" "+i.toDisplayString(C.label),1)],10,pY))),128))],64))),128))])):(i.openBlock(),i.createElementBlock("div",mY,[i.createElementVNode("span",gY,i.toDisplayString(i.unref(s)("editor.slash.empty")),1)]))],512)}}}),ca="slashCommand";let Rt;const vY=Ze.create({name:ca,priority:200,onCreate(){Rt=Fs("body",{interactive:!0,trigger:"manual",placement:"bottom-start",theme:"slash-command",maxWidth:"16rem",offset:[16,8],popperOptions:{strategy:"fixed",modifiers:[{name:"flip",enabled:!1}]}})},addProseMirrorPlugins(){return[nY({editor:this.editor,char:"/",allowSpaces:!0,startOfLine:!0,pluginKey:new Et(ca),allow:({state:t,range:e})=>{var c,f,p;const n=t.doc.resolve(e.from),r=n.depth===1,o=n.parent.type.name==="paragraph",s=((c=n.parent.textContent)==null?void 0:c.charAt(0))==="/",a=this.editor.isActive("column"),l=(p=n.parent.textContent)==null?void 0:p.substring((f=n.parent.textContent)==null?void 0:f.indexOf("/")),u=!(l!=null&&l.endsWith(" "));return(r&&o&&s||a&&o&&s)&&u},command:({editor:t,range:e,props:n})=>{const{view:r}=t;n.action({editor:t,range:e}),r.focus()},items:({query:t})=>cY(this.editor).map(s=>({...s,commands:s.commands.filter(a=>{const l=a.label.toLowerCase().trim(),u=t.toLowerCase().trim();if(a.aliases){const c=a.aliases.map(m=>m.toLowerCase().trim()),f=l.match(u),p=c.some(m=>m.match(u));return f||p}return l.match(u)}).filter(a=>a.shouldBeHidden?!a.shouldBeHidden(this.editor):!0)})).filter(s=>s.commands.length>0).map(s=>({...s,commands:s.commands.map(a=>({...a,isEnabled:!0}))})),render:()=>{let t,e=null;return{onStart:n=>{var s;t=new sw(bY,{props:n,editor:n.editor});const{view:r}=n.editor,o=()=>{if(!n.clientRect)return n.editor.storage[ca].rect;const a=n.clientRect();if(!a)return n.editor.storage[ca].rect;let l=a.y;if(t.element instanceof HTMLElement&&a.top+t.element.offsetHeight+40>window.innerHeight){const u=a.top+t.element.offsetHeight-window.innerHeight+40;l=a.y-u}return new DOMRect(a.x,l,a.width,a.height)};e=()=>{Rt==null||Rt[0].setProps({getReferenceClientRect:o})},(s=r.dom.parentElement)==null||s.addEventListener("scroll",e),t.element&&(Rt==null||Rt[0].setProps({getReferenceClientRect:o,appendTo:()=>document.body,content:t.element})),Rt==null||Rt[0].show()},onUpdate(n){var a;t.updateProps(n);const{view:r}=n.editor,o=()=>{if(!n.clientRect)return n.editor.storage[ca].rect;const l=n.clientRect();return l?new DOMRect(l.x,l.y,l.width,l.height):n.editor.storage[ca].rect},s=()=>{Rt==null||Rt[0].setProps({getReferenceClientRect:o})};(a=r.dom.parentElement)==null||a.addEventListener("scroll",s),n.editor.storage[ca].rect=n.clientRect?o():{width:0,height:0,left:0,top:0,right:0,bottom:0},Rt==null||Rt[0].setProps({getReferenceClientRect:o})},onKeyDown(n){var r;return n.event.key==="Escape"?(Rt==null||Rt[0].hide(),!0):(Rt!=null&&Rt[0].state.isShown||Rt==null||Rt[0].show(),(r=t.ref)==null?void 0:r.onKeyDown(n))},onExit(n){var r;if(Rt==null||Rt[0].hide(),e){const{view:o}=n.editor;(r=o.dom.parentElement)==null||r.removeEventListener("scroll",e)}t.destroy()}}}})]},addStorage(){return{rect:{width:0,height:0,left:0,top:0,right:0,bottom:0}}}}),yY=i.defineComponent({__name:"AIButton",props:{editor:{},icon:{default:void 0},title:{default:void 0},tooltip:{default:void 0},disabled:{type:Boolean,default:!1},shortcutKeys:{default:void 0},customClass:{default:""},loading:{type:Boolean,default:!1},tooltipOptions:{default:void 0},color:{default:void 0},action:{type:Function,default:void 0},isActive:{type:Function,default:void 0}},setup(t){const e=t,n=wn(),{toast:r}=Bb();function o(){var a,l,u;const s=(l=(a=e.editor.extensionManager.extensions.find(c=>c.name==="AI"))==null?void 0:a.options)==null?void 0:l.completions;if(typeof s!="function"){r({title:"AI completions method is not set or is not a valid function",variant:"destructive"});return}if(s.constructor.name!=="AsyncFunction"){r({title:"AI completions method must be an asynchronous function",variant:"destructive"});return}n.state.AIMenu=!0,(u=e.editor)==null||u.commands.focus()}return(s,a)=>(i.openBlock(),i.createBlock(Ke,{action:o,title:"AI",disabled:s.disabled,icon:s.icon,tooltip:s.tooltip},null,8,["disabled","icon","tooltip"]))}}),wY=Bt.create({name:"AI",group:"block",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),toolbar:!1,button:({editor:e,t:n})=>({component:yY,componentProps:{icon:"Sparkles",tooltip:n("editor.AI.ask")}})}}});function xY(t,e){const n=atob(t.split(",")[1]),r=new Array(n.length);for(let s=0;s<n.length;s++)r[s]=n.charCodeAt(s);const o=new Uint8Array(r);return new Blob([o],{type:e})}function CY(t,e){return new File([t],e,{type:t.type})}const EY=Ze.create({name:"importWord",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),upload:void 0,convert:void 0,limit:1024*1024*10,button:({editor:e,extension:n,t:r})=>({component:Ke,componentProps:{action:()=>{var o;return(o=e.commands)==null?void 0:o.toggleImportWord()},disabled:!e.can().setHorizontalRule(),icon:"Word",tooltip:r("editor.importWord.tooltip")}})}},addCommands(){return{toggleImportWord:()=>({chain:t,editor:e})=>{const{toast:n}=Bb(),{t:r}=Tt();async function o(u){var g;const f=new DOMParser().parseFromString(u,"text/html"),p=f.querySelectorAll("img");if(!p.length)return f.body.innerHTML;if(S0(e,"image")){const b=(g=e.extensionManager.extensions.find(y=>y.name==="importWord"))==null?void 0:g.options;if(b&&typeof b.upload=="function"){const y=[];for(const x of p){const E=x.getAttribute("src"),S=xY(E,"image/jpeg"),C=CY(S,"image.jpeg");y.push(C)}const w=await b.upload(y);for(let x=0;x<p.length;x++){const E=p[x];E.setAttribute("src",w[x].src);const S=E.parentElement;(S==null?void 0:S.tagName)==="P"&&(S.insertAdjacentElement("beforebegin",E),!S.hasChildNodes()&&S.textContent===""&&S.remove())}return f.body.innerHTML}else return console.warn("Image Upload method found, skip image conversion"),f.body.innerHTML}else return console.error("Image extension not found, unable to convert image"),f.body.innerHTML}async function s(u){const c=await o(u);e.chain().setContent(c.toString(),!0).run(),n({title:r("editor.importWord.success")})}const{open:a,onChange:l}=gt.useFileDialog({accept:".docx",reset:!0,multiple:!1});return a(),l(async u=>{const[c]=Array.from(u??[]);if(c){if(c.size>this.options.limit){n({title:r("editor.importWord.fileTooLarge"),variant:"destructive"});return}if(this.options.convert){const f=await this.options.convert(c);s(f)}else{const f=new FormData,p=JSON.stringify({collaboration_features:{comments:!0,user_id:"e3",track_changes:!0},formatting:{resets:"none",defaults:"inline",styles:"inline",comments:"basic"}});f.append("config",p),f.append("file",c),fetch("https://docx-converter.cke-cs.com/v2/convert/docx-html",{method:"POST",body:f}).then(m=>m.json()).then(async m=>{s(m.html)}).catch(m=>{n({title:r("editor.importWord.error"),variant:"destructive"}),console.error("Error:",m)})}}}),!1}}}}),Ib=wn(),SY=Ze.create({name:"preview",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({t:e})=>({component:Ke,componentProps:{icon:"Eye",action:()=>{Ib.togglePreview()},tooltip:e("editor.preview.tooltip"),isActive:()=>Ib.state.showPreview}})}},addCommands(){return{togglePreview:()=>()=>(Ib.togglePreview(),!0)}}}),tS=wn(),kY=(t,e,n)=>RegExp(e?t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"):t,n?"gu":"gui");function _Y(t,e,n,r){const o=[],s=[];let a=[],l=0;if(!e)return{decorationsToReturn:ht.empty,results:[]};t==null||t.descendants((u,c)=>{u.isText?a[l]?a[l]={text:a[l].text+u.text,pos:a[l].pos}:a[l]={text:`${u.text}`,pos:c}:l+=1}),a=a.filter(Boolean);for(const u of a){const{text:c,pos:f}=u,p=Array.from(c.matchAll(e)).filter(([m])=>m.trim());for(const m of p){if(m[0]==="")break;m.index!==void 0&&s.push({from:f+m.index,to:f+m.index+m[0].length})}}for(let u=0;u<s.length;u+=1){const c=s[u],f=u===r?`${n} ${n}-current`:n,p=qt.inline(c.from,c.to,{class:f});o.push(p)}return{decorationsToReturn:ht.create(t,o),results:s}}const TY=(t,e,{state:n,dispatch:r})=>{if(!e[0])return;const{from:s,to:a}=e[0];r&&r(n.tr.insertText(t,s,a))},AY=(t,e,n,r)=>{const o=e+1;if(!r[o])return null;const{from:s,to:a}=r[e],l=a-s-t.length+n,{from:u,to:c}=r[o];return r[o]={to:c-l,from:u-l},[l,r]},OY=(t,e,{tr:n,dispatch:r})=>{let o=0,s=e.slice();if(s.length){for(let a=0;a<s.length;a+=1){const{from:l,to:u}=s[a];n.insertText(t,l,u);const c=AY(t,a,o,s);c&&(o=c[0],s=c[1])}r&&r(n)}},MY=new Et("findAndReplacePlugin"),BY=Ze.create({name:"findAndReplace",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),searchResultClass:"vdc-editor-search-result",disableRegex:!0,button:({editor:e,extension:n,t:r})=>({component:Ke,componentProps:{icon:"DocSearch",tooltip:r("editor.findAndReplace.tooltip"),action:()=>{tS.toggleFindAndReplace()},isActive:()=>tS.state.findAndReplace}})}},addStorage(){return{searchTerm:"",replaceTerm:"",results:[],lastSearchTerm:"",caseSensitive:!1,lastCaseSensitive:!1,resultIndex:0,lastResultIndex:0}},addCommands(){return{setSearchTerm:t=>({editor:e})=>(e.storage.findAndReplace.searchTerm=t,!1),setReplaceTerm:t=>({editor:e})=>(e.storage.findAndReplace.replaceTerm=t,!1),setCaseSensitive:t=>({editor:e})=>(e.storage.findAndReplace.caseSensitive=t,!1),resetIndex:()=>({editor:t})=>(t.storage.findAndReplace.resultIndex=0,!1),nextSearchResult:()=>({editor:t})=>{const{results:e,resultIndex:n}=t.storage.findAndReplace,r=n+1;return e[r]?t.storage.findAndReplace.resultIndex=r:t.storage.findAndReplace.resultIndex=0,!1},previousSearchResult:()=>({editor:t})=>{const{results:e,resultIndex:n}=t.storage.findAndReplace,r=n-1;return e[r]?t.storage.findAndReplace.resultIndex=r:t.storage.findAndReplace.resultIndex=e.length-1,!1},replace:()=>({editor:t,state:e,dispatch:n})=>{const{replaceTerm:r,results:o}=t.storage.findAndReplace;return TY(r,o,{state:e,dispatch:n}),!1},replaceAll:()=>({editor:t,tr:e,dispatch:n})=>{const{replaceTerm:r,results:o}=t.storage.findAndReplace;return OY(r,o,{tr:e,dispatch:n}),!1}}},addProseMirrorPlugins(){const t=this.editor,{searchResultClass:e,disableRegex:n}=this.options,r=a=>t.storage.findAndReplace.lastSearchTerm=a,o=a=>t.storage.findAndReplace.lastCaseSensitive=a,s=a=>t.storage.findAndReplace.lastResultIndex=a;return[new Ne({key:MY,state:{init:()=>ht.empty,apply({doc:a,docChanged:l},u){const{searchTerm:c,lastSearchTerm:f,caseSensitive:p,lastCaseSensitive:m,resultIndex:g,lastResultIndex:b}=t.storage.findAndReplace;if(!l&&f===c&&m===p&&b===g)return u;if(r(c),o(p),s(g),!c)return t.storage.findAndReplace.results=[],ht.empty;const{decorationsToReturn:y,results:w}=_Y(a,kY(c,n,p),e,g);return t.storage.findAndReplace.results=w,y}},props:{decorations(a){return this.getState(a)}}})]}}),{togglePrinter:IY,state:RY}=wn(),LY=Ze.create({name:"printer",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({t:e})=>({component:Ke,componentProps:{tooltip:e("editor.printer.tooltip"),action:()=>IY(),icon:"Printer",shortcutKeys:["mod","P"],isActive:()=>RY.printer}})}}}),Rb="spell-check";class PY{constructor(e,n,r,o=1e3){Xt(this,"debouncedGetMatchAndSetDecorations",nt.debounce(this.getMatchAndSetDecorations.bind(this),300));Xt(this,"debouncedGetMatchAndSetDecorationsList",nt.debounce(this.getMatchAndSetDecorationsList.bind(this),300));Xt(this,"debouncedClickEventsListener",nt.debounce(this.clickEventsListener.bind(this),0));Xt(this,"debouncedAcceptSuggestionEventsListener",nt.debounce(this.acceptSuggestionListener.bind(this),0));Xt(this,"debouncedProofreadChangedNodes",nt.debounce(this.proofreadChangedNodes.bind(this),300));Xt(this,"proofreader");Xt(this,"uiStrings");Xt(this,"showSuggestionsEvent");Xt(this,"decorationSet");Xt(this,"editorView");Xt(this,"isInitialProofreadingDone",!1);Xt(this,"lastOriginalFrom",0);Xt(this,"lastClickedDecoration",null);Xt(this,"suggestionBox");Xt(this,"isEnableSuggestion");Xt(this,"isMobile");Xt(this,"limit",1e3);Xt(this,"_debouncedProofreadDoc",nt.debounce((e,n)=>{this.proofreadDoc(e),n&&n()},500));Xt(this,"_debouncedHandleEnterKey",nt.debounce((e,n,r)=>{this.handleEnterKey(e,n),r&&r()},500));this.proofreader=e,this.uiStrings=n,this.showSuggestionsEvent=r,this.decorationSet=ht.empty,this.limit=o,this.suggestionBox=document.createElement("div"),this.suggestionBox.id="suggestions-box",this.suggestionBox.tabIndex=0,this.isEnableSuggestion=!0,this.isMobile=!1,this.hideSuggestionBox()}get completeProofreadingDone(){return this.isInitialProofreadingDone}getProofreader(){return this.proofreader}toggleIsEnabledSpellCheck(){this.proofreader.toggleIsEnabled()}setEnabledProofreadText(e){this.proofreader.setEnabled(e)}getIsEnabledSpellCheck(){return this.proofreader.getIsEnabled()}setDecorationSet(e){this.decorationSet=e}getDecorationSet(){return this.decorationSet}setEditorView(e){this.editorView=e}getEditorView(){return this.editorView}getSuggestionBox(){return this.suggestionBox}hideSuggestionBox(){this.suggestionBox.textContent="",this.suggestionBox.style.display="none"}setIsEnableSuggestion(e){if(this.isEnableSuggestion=e,this.isEnableSuggestion){this.addEventListenersToDecorations();return}this.hideSuggestionBox(),this.removeEventListenersFromDecorations()}setIsMobile(e){this.isMobile=e}getChangedNodesFromTransaction(e,n=!1,r=!1){const o=[],s=new Set;let a=!1;return e.steps.forEach(l=>{var p,m,g;const u=l;if(u.from===void 0||u.to===void 0||n&&u.structure)return;((m=(p=u.slice)==null?void 0:p.content[0])==null?void 0:m.type.name)===fc&&(a=!0);const c=u.from-(r?1:0);let f=Math.max(u.to,u.from+(((g=u.slice)==null?void 0:g.size)||0))-(r?1:0);f>e.doc.content.size&&(f=e.doc.content.size),e.doc.nodesBetween(c,f,(b,y)=>{b&&(b.isText&&!s.has(y)&&(o.push({node:b,pos:y}),s.add(y)),b.type.name===fc&&(a=!0))})}),{changedNodes:o,isChangedSuperText:a}}debouncedProofreadDoc(e,n){this._debouncedProofreadDoc(e,n)}isSuperTextAlone(e,n){let r=!1;return e.descendants((o,s,a)=>o===n?(a&&a.type.name==="paragraph"&&a.childCount===1&&a.firstChild===n&&(r=!0),!1):!0),r}proofreadDoc(e){let n=[],r=0;e==null||e.descendants((u,c)=>{if(u.isText){const f={text:u.text??"",from:c,to:c+u.nodeSize};return n[r]&&(f.text=n[r].text+f.text,f.from=n[r].from),n[r]=f,r+=1,!1}return u.type.name!==fc}),n=n.filter(Boolean);let o="",s=1;for(const{text:u,from:c,to:f}of n){const p=c-s;p>0&&(o+=Array(p+1).join(`
294
294
  `)),s=f,o+=u}const a=pw(o,this.limit),l=this.getMatchAndSetDecorationsList(a.map(u=>({text:u.text,originalFrom:u.offset+1})));this.editorView&&this.dispatch(this.editorView.state.tr.setMeta(zn.LOADING_TRANSACTION,!0)),l.then(()=>{this.editorView&&this.dispatch(this.editorView.state.tr.setMeta(zn.LOADING_TRANSACTION,!1))}),this.isInitialProofreadingDone=!0}async proofreadChangedNodes(e){const n=this.isMobile?1:2,o=e.reduce((s,a)=>{if(s.length===0)return s.push({changedNode:a,time:1}),s;const l=s[s.length-1];return a.pos===l.changedNode.pos+l.changedNode.node.nodeSize+n*(l.time-1)?(l.changedNode.node.text+=a.node.text,l.time+=1):s.push({changedNode:a,time:1}),s},[]).map(({changedNode:s})=>{var c;const a=((c=s.node)==null?void 0:c.textContent)||"",l=s.pos;return pw(a,this.limit).map(f=>({text:f.text,originalFrom:l+f.offset}))});this.debouncedGetMatchAndSetDecorationsList(o.flat())}async getMatchAndSetDecorationsList(e){const n=e.map(r=>this.getMatchAndSetDecorations(r.text,r.originalFrom));await Promise.all(n)}async getMatchAndSetDecorations(e,n){const r=await this.proofreader.proofreadText(this.proofreader.normalizeTextForLanguage(e)),o=[];for(const l of r){const u=l.startIndex+n,c=u+l.length,f=await this.proofreader.getSuggestions(l.wrongWord),p={length:l.length,wrongWord:l.wrongWord,suggestions:f};o.push(qt.inline(u,c,{class:"spell-error",nodeName:"span",[Rb]:JSON.stringify(p)}))}const s=this.decorationSet.find(n,n+e.length);let a=this.decorationSet.remove(s);this.editorView&&(a=a.add(this.editorView.state.doc,o)),this.setDecorationSet(a),this.editorView&&this.dispatch(this.editorView.state.tr.setMeta(zn.SPELLCHECKER_TRANSACTION,!0)),this.addEventListenersToDecorations()}removeEventListenersFromDecorations(){var r;const e=(r=this.editorView)==null?void 0:r.domAtPos(this.lastOriginalFrom).node,n=(e==null?void 0:e.querySelectorAll("span.spell-error"))||[];n.length&&n.forEach(o=>{o.removeEventListener("click",this.debouncedClickEventsListener)})}addEventListenersToDecorations(){var e;if(this.isEnableSuggestion)try{const n=(e=this.editorView)==null?void 0:e.domAtPos(this.lastOriginalFrom).node,r=(n==null?void 0:n.querySelectorAll("span.spell-error"))||[];if(!r.length)return;r.forEach(o=>{o.addEventListener("click",this.debouncedClickEventsListener)})}catch{}}addEventListenersToSuggestionBox(){const e=this.suggestionBox.querySelectorAll("li");e.length&&e.forEach(n=>{n.addEventListener("mousedown",this.debouncedAcceptSuggestionEventsListener)})}dispatch(e){this.editorView&&this.editorView.dispatch(e)}findChangedTextNodes(e,n,r,o){if(!e.isBlock)return!1;if(!e.isTextblock)return e.descendants((u,c)=>{this.findChangedTextNodes(u,c,r,o)}),!1;const[s,a]=[n,n+e.nodeSize];if(!(s<=r&&o<=a))return;const l={node:e,pos:n};this.onNodeChanged(l.node.textContent,l.pos+1)}onNodeChanged(e,n){n!==this.lastOriginalFrom?this.getMatchAndSetDecorations(e,n):this.debouncedGetMatchAndSetDecorations(e,n),this.lastOriginalFrom=n}async clickEventsListener(e){var c,f;if(!e.target)return;let n=e.target;for(;n&&!n.classList.contains("spell-error");)n=n.parentElement;if(!n||!n.classList.contains("spell-error"))return;this.lastClickedDecoration=n;const r=(c=n.getAttribute(Rb))==null?void 0:c.trim();if(!r){console.error("No match string provided",{spellCheckerAttributes:r});return}const{length:o,wrongWord:s,suggestions:a}=JSON.parse(r),l=((f=this.editorView)==null?void 0:f.posAtDOM(n,0))??0,u=l+o;if(this.editorView){this.addSuggestionsList(a,l,u),this.suggestionBox.style.display="";const p=RK(n);if(!p)return;const m=n.getBoundingClientRect(),g=p.getBoundingClientRect(),b=window.getComputedStyle(p).padding,y=m.left-g.left+3-parseInt(b),w=m.top-g.top+30-parseInt(b);this.suggestionBox.style.left=y+"px",this.suggestionBox.style.top=w+"px",this.showSuggestionsEvent&&this.showSuggestionsEvent(this.proofreader.normalizeTextForLanguage(s))}return this.addEventListenersToSuggestionBox(),!1}acceptSuggestionListener(e){var s;if(!e||!e.target)return;e.preventDefault(),e.stopPropagation();const n=e.target;let r=0,o=0;if(this.lastClickedDecoration&&this.editorView){const a=(s=this.lastClickedDecoration.getAttribute(Rb))==null?void 0:s.trim();if(a){const{length:l}=JSON.parse(a);r=this.editorView.posAtDOM(this.lastClickedDecoration,0),o=r+l}}this.editorView&&r>=0&&o>r&&(this.dispatch(this.editorView.state.tr.setMeta(zn.ACCEPT_SUGGESTION,!0)),this.dispatch(this.editorView.state.tr.insertText(n.textContent||"",r,o))),this.hideSuggestionBox(),this.lastClickedDecoration&&(this.lastClickedDecoration.removeEventListener("click",this.debouncedClickEventsListener),this.lastClickedDecoration=null)}addSuggestionsList(e,n,r){if(this.suggestionBox.textContent="",e.length>0){const o=document.createElement("ul");o.className="suggestion-list",e.forEach(s=>{const a=document.createElement("li");a.innerText=s,a.dataset.from=n+"",a.dataset.to=r+"",o.appendChild(a)}),this.suggestionBox.appendChild(o)}if(e.length===0){const o=document.createElement("b"),s=this.uiStrings&&this.uiStrings.noSuggestions?this.uiStrings.noSuggestions:"No suggestions found";o.textContent=s,this.suggestionBox.appendChild(o)}}isUndoRedo(e,n){return e.getMeta(R8.ADD_TO_HISTORY_TRANSACTION)===!1||e.getMeta(zn.APPENDED)===!0||n.isUndoRedoOperation}handleUndoRedo(e,n){var s;const r=(s=e.getMeta(R8.HISTORY_TRANSACTION))==null?void 0:s.redo;if(n.isUndoRedoOperation=!1,r)return this.debouncedProofreadDoc(e.doc),this.getDecorationSet();const{changedNodes:o}=this.getChangedNodesFromTransaction(e,!0);return o.length===0?this.getDecorationSet():o.length===1?(this.debouncedProofreadChangedNodes(o),this.getDecorationSet()):(this.debouncedProofreadDoc(e.doc),this.getDecorationSet())}isTextContentChangedOrDeleted(e){let n=!1;return{isTextContentChanged:e.steps.some(o=>{var a,l;const s=(a=o.toJSON)==null?void 0:a.call(o);return(s==null?void 0:s.stepType)==="replace"&&((l=s==null?void 0:s.slice)!=null&&l.content)?s.slice.content.some(u=>u.type==="paragraph"&&u.content&&u.content.length>0):(s==null?void 0:s.stepType)==="replace"&&(!s.slice||!s.slice.content||s.slice.content.length===0)?(n=!0,s.from!==s.to):!1}),isDeleteAction:n}}handleEnterKey(e,n){if(n)return this.debouncedProofreadDoc(e.doc),this.getDecorationSet();const r=e.getMeta(zn.APPENDED_TRANSACTION);if(!r)return this.getDecorationSet();const s=r.steps[0].to,a=r.before.nodeAt(s-1);if(!(a!=null&&a.isText))return this.getDecorationSet();let l=0;return r.before.descendants((c,f)=>{c.textContent===(a==null?void 0:a.textContent)&&(l=f)}),l+((a==null?void 0:a.nodeSize)||0)===s?this.getDecorationSet():(this.debouncedProofreadDoc(e.doc),this.getDecorationSet())}handleEnterKeyDebounced(e,n,r){this._debouncedHandleEnterKey(e,n,r)}}const nS=wn(),zn={SPELLCHECKER_TRANSACTION:"spellcheckerTransaction",IS_ACTIVE_SPELLCHECK:"isActiveSpellCheck",LOADING_TRANSACTION:"loading",PREVENT_UPDATE:"preventUpdate",APPENDED:"appended",APPENDED_TRANSACTION:"appendedTransaction",ACCEPT_SUGGESTION:"acceptSuggestion",SKIP_SPELLCHECK:"skipSpellcheck",UI_EVENT:"uiEvent"},DY={DROP:"drop"},rS=Ze.create({name:"spellchecker",addOptions(){return{proofreader:void 0,uiStrings:{noSuggestions:""},button:({editor:t,t:e,isMobile:n})=>({component:Ke,componentProps:{action:()=>t.commands.handleActiveSpellCheck(),isActive:()=>{var r,o,s,a;return((a=(s=(o=(r=t==null?void 0:t.extensionStorage)==null?void 0:r.spellchecker)==null?void 0:o.spellchecker)==null?void 0:s.proofreader)==null?void 0:a.enabled)||!1},icon:"SpellCheck",tooltip:"맞춤법 검사",title:n?e("editor.menubar.menu.spelling"):""}})}},addStorage(){return{didPaste:!1,spellchecker:void 0,isUndoRedoOperation:!1,pendingSpellCheck:!1,enterKeyPressed:!1}},addCommands(){return{checkSpelling:()=>({tr:t})=>(this.storage.spellchecker.proofreadDoc(t.doc),!0),selectAll:()=>({state:t,dispatch:e})=>(i9(t,e),!0),copy:()=>()=>(document.execCommand("copy"),!0),handleActiveSpellCheck:(t=!0)=>({editor:e})=>{const n=e.extensionStorage.spellchecker.spellchecker;return n.toggleIsEnabledSpellCheck(),e.view.dispatch(e.state.tr.setMeta(zn.IS_ACTIVE_SPELLCHECK,n.getIsEnabledSpellCheck())),t&&nS.setSpellCheck(n.getIsEnabledSpellCheck()),!0},setIsEnableSuggestion:t=>()=>(this.storage.spellchecker.setIsEnableSuggestion(t),!0)}},addProseMirrorPlugins(){return[new Ne({key:new Et("skipMarkPlugin"),view:e=>{const n=e.dispatch;return e.dispatch=r=>(r.steps.some(s=>s instanceof qo||s instanceof Qr)&&r.setMeta(zn.SKIP_SPELLCHECK,!0),n.call(e,r)),{}}}),new Ne({key:new Et("spellcheckerPlugin"),props:{decorations(e){return this.getState(e)},handlePaste:()=>{this.storage.didPaste=!0},handleClick:()=>{this.storage.spellchecker.hideSuggestionBox()},handleKeyDown:(e,n)=>((n.ctrlKey||n.metaKey)&&(n.key==="z"||n.key==="y")&&(this.storage.isUndoRedoOperation=!0,this.storage.pendingSpellCheck=!0),this.storage.enterKeyPressed&&(this.storage.pendingSpellCheck=!0),n.key==="Enter"&&(this.storage.enterKeyPressed=!0),!1)},state:{init:(e,n)=>{var o,s;const r=new PY(this.options.proofreader,this.options.uiStrings,this.options.onShowSuggestionsEvent,(o=this.options.proofreader)==null?void 0:o.limit);return this.storage.spellchecker=r,r.setDecorationSet(ht.create(n.doc,[])),nS.setSpellCheck(r.getIsEnabledSpellCheck()),(s=this.options.proofreader)!=null&&s.enabled&&r.proofreadDoc(n.doc),r.getDecorationSet()},apply:(e,n)=>{var s;if(e.getMeta(zn.SKIP_SPELLCHECK))return n;const r=this.storage.spellchecker,o=e.getMeta(zn.IS_ACTIVE_SPELLCHECK);if(o!==void 0)return o?r.proofreadDoc(e.doc):r.setDecorationSet(ht.empty),r.getDecorationSet();if(e.getMeta(zn.SPELLCHECKER_TRANSACTION))return r.getDecorationSet();if(e.docChanged&&e.doc.nodeSize){const l=r.getDecorationSet().map(e.mapping,e.doc);if(r.setDecorationSet(l),e.getMeta(zn.UI_EVENT)===DY.DROP)return r.debouncedProofreadDoc(e.doc),r.getDecorationSet();if(r.isUndoRedo(e,this.storage))return r.handleUndoRedo(e,this.storage);const{isTextContentChanged:u,isDeleteAction:c}=r.isTextContentChangedOrDeleted(e);if(c){const{changedNodes:g}=r.getChangedNodesFromTransaction(e,!1,!0);return g.length>0&&r.debouncedProofreadChangedNodes([g[0]]),r.getDecorationSet()}if(this.storage.enterKeyPressed)return r.handleEnterKeyDebounced(e,this.storage.pendingSpellCheck,()=>{this.storage.enterKeyPressed=!1,this.storage.pendingSpellCheck=!1}),r.getDecorationSet();if(this.storage.pendingSpellCheck||u)return r.debouncedProofreadDoc(e.doc,()=>{this.storage.pendingSpellCheck=!1}),r.getDecorationSet();if(e.getMeta(wE.UPDATE)||e.updated===0&&((s=e.steps[0])==null?void 0:s.structure)===!0)return r.getDecorationSet();if(e.getMeta(zn.PREVENT_UPDATE)===!0&&e.before.textContent.length===0)return r.debouncedProofreadDoc(e.doc),r.getDecorationSet();this.storage.didPaste&&(this.storage.didPaste=!1);const{changedNodes:p,isChangedSuperText:m}=r.getChangedNodesFromTransaction(e);if(m)return r.debouncedProofreadDoc(e.doc),r.getDecorationSet();p.length>0&&r.debouncedProofreadChangedNodes(p)}return r.getDecorationSet()}},view:()=>({update:e=>{var r,o;const n=this.storage.spellchecker;n.setEditorView(e),(o=(r=e==null?void 0:e.dom)==null?void 0:r.parentNode)==null||o.appendChild(n.getSuggestionBox())}})})]}});function oS(t,e){return function(){return t.apply(e,arguments)}}const{toString:VY}=Object.prototype,{getPrototypeOf:Lb}=Object,Dp=(t=>e=>{const n=VY.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),po=t=>(t=t.toLowerCase(),e=>Dp(e)===t),Vp=t=>e=>typeof e===t,{isArray:_l}=Array,mc=Vp("undefined");function FY(t){return t!==null&&!mc(t)&&t.constructor!==null&&!mc(t.constructor)&&wr(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const iS=po("ArrayBuffer");function $Y(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&iS(t.buffer),e}const zY=Vp("string"),wr=Vp("function"),sS=Vp("number"),Fp=t=>t!==null&&typeof t=="object",HY=t=>t===!0||t===!1,$p=t=>{if(Dp(t)!=="object")return!1;const e=Lb(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},UY=po("Date"),WY=po("File"),jY=po("Blob"),qY=po("FileList"),KY=t=>Fp(t)&&wr(t.pipe),GY=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||wr(t.append)&&((e=Dp(t))==="formdata"||e==="object"&&wr(t.toString)&&t.toString()==="[object FormData]"))},XY=po("URLSearchParams"),[YY,JY,ZY,QY]=["ReadableStream","Request","Response","Headers"].map(po),NY=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function gc(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,o;if(typeof t!="object"&&(t=[t]),_l(t))for(r=0,o=t.length;r<o;r++)e.call(null,t[r],r,t);else{const s=n?Object.getOwnPropertyNames(t):Object.keys(t),a=s.length;let l;for(r=0;r<a;r++)l=s[r],e.call(null,t[l],l,t)}}function aS(t,e){e=e.toLowerCase();const n=Object.keys(t);let r=n.length,o;for(;r-- >0;)if(o=n[r],e===o.toLowerCase())return o;return null}const da=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,lS=t=>!mc(t)&&t!==da;function Pb(){const{caseless:t}=lS(this)&&this||{},e={},n=(r,o)=>{const s=t&&aS(e,o)||o;$p(e[s])&&$p(r)?e[s]=Pb(e[s],r):$p(r)?e[s]=Pb({},r):_l(r)?e[s]=r.slice():e[s]=r};for(let r=0,o=arguments.length;r<o;r++)arguments[r]&&gc(arguments[r],n);return e}const eJ=(t,e,n,{allOwnKeys:r}={})=>(gc(e,(o,s)=>{n&&wr(o)?t[s]=oS(o,n):t[s]=o},{allOwnKeys:r}),t),tJ=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),nJ=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},rJ=(t,e,n,r)=>{let o,s,a;const l={};if(e=e||{},t==null)return e;do{for(o=Object.getOwnPropertyNames(t),s=o.length;s-- >0;)a=o[s],(!r||r(a,t,e))&&!l[a]&&(e[a]=t[a],l[a]=!0);t=n!==!1&&Lb(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},oJ=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},iJ=t=>{if(!t)return null;if(_l(t))return t;let e=t.length;if(!sS(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},sJ=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Lb(Uint8Array)),aJ=(t,e)=>{const r=(t&&t[Symbol.iterator]).call(t);let o;for(;(o=r.next())&&!o.done;){const s=o.value;e.call(t,s[0],s[1])}},lJ=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},uJ=po("HTMLFormElement"),cJ=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),uS=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),dJ=po("RegExp"),cS=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};gc(n,(o,s)=>{let a;(a=e(o,s,t))!==!1&&(r[s]=a||o)}),Object.defineProperties(t,r)},fJ=t=>{cS(t,(e,n)=>{if(wr(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(wr(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},pJ=(t,e)=>{const n={},r=o=>{o.forEach(s=>{n[s]=!0})};return _l(t)?r(t):r(String(t).split(e)),n},hJ=()=>{},mJ=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function gJ(t){return!!(t&&wr(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const bJ=t=>{const e=new Array(10),n=(r,o)=>{if(Fp(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[o]=r;const s=_l(r)?[]:{};return gc(r,(a,l)=>{const u=n(a,o+1);!mc(u)&&(s[l]=u)}),e[o]=void 0,s}}return r};return n(t,0)},vJ=po("AsyncFunction"),yJ=t=>t&&(Fp(t)||wr(t))&&wr(t.then)&&wr(t.catch),dS=((t,e)=>t?setImmediate:e?((n,r)=>(da.addEventListener("message",({source:o,data:s})=>{o===da&&s===n&&r.length&&r.shift()()},!1),o=>{r.push(o),da.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",wr(da.postMessage)),wJ=typeof queueMicrotask<"u"?queueMicrotask.bind(da):typeof process<"u"&&process.nextTick||dS,oe={isArray:_l,isArrayBuffer:iS,isBuffer:FY,isFormData:GY,isArrayBufferView:$Y,isString:zY,isNumber:sS,isBoolean:HY,isObject:Fp,isPlainObject:$p,isReadableStream:YY,isRequest:JY,isResponse:ZY,isHeaders:QY,isUndefined:mc,isDate:UY,isFile:WY,isBlob:jY,isRegExp:dJ,isFunction:wr,isStream:KY,isURLSearchParams:XY,isTypedArray:sJ,isFileList:qY,forEach:gc,merge:Pb,extend:eJ,trim:NY,stripBOM:tJ,inherits:nJ,toFlatObject:rJ,kindOf:Dp,kindOfTest:po,endsWith:oJ,toArray:iJ,forEachEntry:aJ,matchAll:lJ,isHTMLForm:uJ,hasOwnProperty:uS,hasOwnProp:uS,reduceDescriptors:cS,freezeMethods:fJ,toObjectSet:pJ,toCamelCase:cJ,noop:hJ,toFiniteNumber:mJ,findKey:aS,global:da,isContextDefined:lS,isSpecCompliantForm:gJ,toJSONObject:bJ,isAsyncFn:vJ,isThenable:yJ,setImmediate:dS,asap:wJ};function rt(t,e,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}oe.inherits(rt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:oe.toJSONObject(this.config),code:this.code,status:this.status}}});const fS=rt.prototype,pS={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{pS[t]={value:t}}),Object.defineProperties(rt,pS),Object.defineProperty(fS,"isAxiosError",{value:!0}),rt.from=(t,e,n,r,o,s)=>{const a=Object.create(fS);return oe.toFlatObject(t,a,function(u){return u!==Error.prototype},l=>l!=="isAxiosError"),rt.call(a,t.message,e,n,r,o),a.cause=t,a.name=t.name,s&&Object.assign(a,s),a};const xJ=null;function Db(t){return oe.isPlainObject(t)||oe.isArray(t)}function hS(t){return oe.endsWith(t,"[]")?t.slice(0,-2):t}function mS(t,e,n){return t?t.concat(e).map(function(o,s){return o=hS(o),!n&&s?"["+o+"]":o}).join(n?".":""):e}function CJ(t){return oe.isArray(t)&&!t.some(Db)}const EJ=oe.toFlatObject(oe,{},null,function(e){return/^is[A-Z]/.test(e)});function zp(t,e,n){if(!oe.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=oe.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,w){return!oe.isUndefined(w[y])});const r=n.metaTokens,o=n.visitor||f,s=n.dots,a=n.indexes,u=(n.Blob||typeof Blob<"u"&&Blob)&&oe.isSpecCompliantForm(e);if(!oe.isFunction(o))throw new TypeError("visitor must be a function");function c(b){if(b===null)return"";if(oe.isDate(b))return b.toISOString();if(!u&&oe.isBlob(b))throw new rt("Blob is not supported. Use a Buffer instead.");return oe.isArrayBuffer(b)||oe.isTypedArray(b)?u&&typeof Blob=="function"?new Blob([b]):Buffer.from(b):b}function f(b,y,w){let x=b;if(b&&!w&&typeof b=="object"){if(oe.endsWith(y,"{}"))y=r?y:y.slice(0,-2),b=JSON.stringify(b);else if(oe.isArray(b)&&CJ(b)||(oe.isFileList(b)||oe.endsWith(y,"[]"))&&(x=oe.toArray(b)))return y=hS(y),x.forEach(function(S,C){!(oe.isUndefined(S)||S===null)&&e.append(a===!0?mS([y],C,s):a===null?y:y+"[]",c(S))}),!1}return Db(b)?!0:(e.append(mS(w,y,s),c(b)),!1)}const p=[],m=Object.assign(EJ,{defaultVisitor:f,convertValue:c,isVisitable:Db});function g(b,y){if(!oe.isUndefined(b)){if(p.indexOf(b)!==-1)throw Error("Circular reference detected in "+y.join("."));p.push(b),oe.forEach(b,function(x,E){(!(oe.isUndefined(x)||x===null)&&o.call(e,x,oe.isString(E)?E.trim():E,y,m))===!0&&g(x,y?y.concat(E):[E])}),p.pop()}}if(!oe.isObject(t))throw new TypeError("data must be an object");return g(t),e}function gS(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function Vb(t,e){this._pairs=[],t&&zp(t,this,e)}const bS=Vb.prototype;bS.append=function(e,n){this._pairs.push([e,n])},bS.toString=function(e){const n=e?function(r){return e.call(this,r,gS)}:gS;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function SJ(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function vS(t,e,n){if(!e)return t;const r=n&&n.encode||SJ;oe.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let s;if(o?s=o(e,n):s=oe.isURLSearchParams(e)?e.toString():new Vb(e,n).toString(r),s){const a=t.indexOf("#");a!==-1&&(t=t.slice(0,a)),t+=(t.indexOf("?")===-1?"?":"&")+s}return t}class yS{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){oe.forEach(this.handlers,function(r){r!==null&&e(r)})}}const wS={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},kJ={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Vb,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Fb=typeof window<"u"&&typeof document<"u",$b=typeof navigator=="object"&&navigator||void 0,_J=Fb&&(!$b||["ReactNative","NativeScript","NS"].indexOf($b.product)<0),TJ=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",AJ=Fb&&window.location.href||"http://localhost",Hn={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Fb,hasStandardBrowserEnv:_J,hasStandardBrowserWebWorkerEnv:TJ,navigator:$b,origin:AJ},Symbol.toStringTag,{value:"Module"})),...kJ};function OJ(t,e){return zp(t,new Hn.classes.URLSearchParams,Object.assign({visitor:function(n,r,o,s){return Hn.isNode&&oe.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},e))}function MJ(t){return oe.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function BJ(t){const e={},n=Object.keys(t);let r;const o=n.length;let s;for(r=0;r<o;r++)s=n[r],e[s]=t[s];return e}function xS(t){function e(n,r,o,s){let a=n[s++];if(a==="__proto__")return!0;const l=Number.isFinite(+a),u=s>=n.length;return a=!a&&oe.isArray(o)?o.length:a,u?(oe.hasOwnProp(o,a)?o[a]=[o[a],r]:o[a]=r,!l):((!o[a]||!oe.isObject(o[a]))&&(o[a]=[]),e(n,r,o[a],s)&&oe.isArray(o[a])&&(o[a]=BJ(o[a])),!l)}if(oe.isFormData(t)&&oe.isFunction(t.entries)){const n={};return oe.forEachEntry(t,(r,o)=>{e(MJ(r),o,n,0)}),n}return null}function IJ(t,e,n){if(oe.isString(t))try{return(e||JSON.parse)(t),oe.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const bc={transitional:wS,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,s=oe.isObject(e);if(s&&oe.isHTMLForm(e)&&(e=new FormData(e)),oe.isFormData(e))return o?JSON.stringify(xS(e)):e;if(oe.isArrayBuffer(e)||oe.isBuffer(e)||oe.isStream(e)||oe.isFile(e)||oe.isBlob(e)||oe.isReadableStream(e))return e;if(oe.isArrayBufferView(e))return e.buffer;if(oe.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let l;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return OJ(e,this.formSerializer).toString();if((l=oe.isFileList(e))||r.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return zp(l?{"files[]":e}:e,u&&new u,this.formSerializer)}}return s||o?(n.setContentType("application/json",!1),IJ(e)):e}],transformResponse:[function(e){const n=this.transitional||bc.transitional,r=n&&n.forcedJSONParsing,o=this.responseType==="json";if(oe.isResponse(e)||oe.isReadableStream(e))return e;if(e&&oe.isString(e)&&(r&&!this.responseType||o)){const a=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(e)}catch(l){if(a)throw l.name==="SyntaxError"?rt.from(l,rt.ERR_BAD_RESPONSE,this,null,this.response):l}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Hn.classes.FormData,Blob:Hn.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};oe.forEach(["delete","get","head","post","put","patch"],t=>{bc.headers[t]={}});const RJ=oe.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),LJ=t=>{const e={};let n,r,o;return t&&t.split(`
295
295
  `).forEach(function(a){o=a.indexOf(":"),n=a.substring(0,o).trim().toLowerCase(),r=a.substring(o+1).trim(),!(!n||e[n]&&RJ[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},CS=Symbol("internals");function vc(t){return t&&String(t).trim().toLowerCase()}function Hp(t){return t===!1||t==null?t:oe.isArray(t)?t.map(Hp):String(t)}function PJ(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}const DJ=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function zb(t,e,n,r,o){if(oe.isFunction(r))return r.call(this,e,n);if(o&&(e=n),!!oe.isString(e)){if(oe.isString(r))return e.indexOf(r)!==-1;if(oe.isRegExp(r))return r.test(e)}}function VJ(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function FJ(t,e){const n=oe.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(o,s,a){return this[r].call(this,e,o,s,a)},configurable:!0})})}let sr=class{constructor(e){e&&this.set(e)}set(e,n,r){const o=this;function s(l,u,c){const f=vc(u);if(!f)throw new Error("header name must be a non-empty string");const p=oe.findKey(o,f);(!p||o[p]===void 0||c===!0||c===void 0&&o[p]!==!1)&&(o[p||u]=Hp(l))}const a=(l,u)=>oe.forEach(l,(c,f)=>s(c,f,u));if(oe.isPlainObject(e)||e instanceof this.constructor)a(e,n);else if(oe.isString(e)&&(e=e.trim())&&!DJ(e))a(LJ(e),n);else if(oe.isHeaders(e))for(const[l,u]of e.entries())s(u,l,r);else e!=null&&s(n,e,r);return this}get(e,n){if(e=vc(e),e){const r=oe.findKey(this,e);if(r){const o=this[r];if(!n)return o;if(n===!0)return PJ(o);if(oe.isFunction(n))return n.call(this,o,r);if(oe.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=vc(e),e){const r=oe.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||zb(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let o=!1;function s(a){if(a=vc(a),a){const l=oe.findKey(r,a);l&&(!n||zb(r,r[l],l,n))&&(delete r[l],o=!0)}}return oe.isArray(e)?e.forEach(s):s(e),o}clear(e){const n=Object.keys(this);let r=n.length,o=!1;for(;r--;){const s=n[r];(!e||zb(this,this[s],s,e,!0))&&(delete this[s],o=!0)}return o}normalize(e){const n=this,r={};return oe.forEach(this,(o,s)=>{const a=oe.findKey(r,s);if(a){n[a]=Hp(o),delete n[s];return}const l=e?VJ(s):String(s).trim();l!==s&&delete n[s],n[l]=Hp(o),r[l]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return oe.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=e&&oe.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
296
296
  `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(o=>r.set(o)),r}static accessor(e){const r=(this[CS]=this[CS]={accessors:{}}).accessors,o=this.prototype;function s(a){const l=vc(a);r[l]||(FJ(o,a),r[l]=!0)}return oe.isArray(e)?e.forEach(s):s(e),this}};sr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),oe.reduceDescriptors(sr.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}}),oe.freezeMethods(sr);function Hb(t,e){const n=this||bc,r=e||n,o=sr.from(r.headers);let s=r.data;return oe.forEach(t,function(l){s=l.call(n,s,o.normalize(),e?e.status:void 0)}),o.normalize(),s}function ES(t){return!!(t&&t.__CANCEL__)}function Tl(t,e,n){rt.call(this,t??"canceled",rt.ERR_CANCELED,e,n),this.name="CanceledError"}oe.inherits(Tl,rt,{__CANCEL__:!0});function SS(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new rt("Request failed with status code "+n.status,[rt.ERR_BAD_REQUEST,rt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function $J(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function zJ(t,e){t=t||10;const n=new Array(t),r=new Array(t);let o=0,s=0,a;return e=e!==void 0?e:1e3,function(u){const c=Date.now(),f=r[s];a||(a=c),n[o]=u,r[o]=c;let p=s,m=0;for(;p!==o;)m+=n[p++],p=p%t;if(o=(o+1)%t,o===s&&(s=(s+1)%t),c-a<e)return;const g=f&&c-f;return g?Math.round(m*1e3/g):void 0}}function HJ(t,e){let n=0,r=1e3/e,o,s;const a=(c,f=Date.now())=>{n=f,o=null,s&&(clearTimeout(s),s=null),t.apply(null,c)};return[(...c)=>{const f=Date.now(),p=f-n;p>=r?a(c,f):(o=c,s||(s=setTimeout(()=>{s=null,a(o)},r-p)))},()=>o&&a(o)]}const Up=(t,e,n=3)=>{let r=0;const o=zJ(50,250);return HJ(s=>{const a=s.loaded,l=s.lengthComputable?s.total:void 0,u=a-r,c=o(u),f=a<=l;r=a;const p={loaded:a,total:l,progress:l?a/l:void 0,bytes:u,rate:c||void 0,estimated:c&&l&&f?(l-a)/c:void 0,event:s,lengthComputable:l!=null,[e?"download":"upload"]:!0};t(p)},n)},kS=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},_S=t=>(...e)=>oe.asap(()=>t(...e)),UJ=Hn.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,Hn.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(Hn.origin),Hn.navigator&&/(msie|trident)/i.test(Hn.navigator.userAgent)):()=>!0,WJ=Hn.hasStandardBrowserEnv?{write(t,e,n,r,o,s){const a=[t+"="+encodeURIComponent(e)];oe.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),oe.isString(r)&&a.push("path="+r),oe.isString(o)&&a.push("domain="+o),s===!0&&a.push("secure"),document.cookie=a.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function jJ(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function qJ(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function TS(t,e,n){let r=!jJ(e);return t&&(r||n==!1)?qJ(t,e):e}const AS=t=>t instanceof sr?{...t}:t;function fa(t,e){e=e||{};const n={};function r(c,f,p,m){return oe.isPlainObject(c)&&oe.isPlainObject(f)?oe.merge.call({caseless:m},c,f):oe.isPlainObject(f)?oe.merge({},f):oe.isArray(f)?f.slice():f}function o(c,f,p,m){if(oe.isUndefined(f)){if(!oe.isUndefined(c))return r(void 0,c,p,m)}else return r(c,f,p,m)}function s(c,f){if(!oe.isUndefined(f))return r(void 0,f)}function a(c,f){if(oe.isUndefined(f)){if(!oe.isUndefined(c))return r(void 0,c)}else return r(void 0,f)}function l(c,f,p){if(p in e)return r(c,f);if(p in t)return r(void 0,c)}const u={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:l,headers:(c,f,p)=>o(AS(c),AS(f),p,!0)};return oe.forEach(Object.keys(Object.assign({},t,e)),function(f){const p=u[f]||o,m=p(t[f],e[f],f);oe.isUndefined(m)&&p!==l||(n[f]=m)}),n}const OS=t=>{const e=fa({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:s,headers:a,auth:l}=e;e.headers=a=sr.from(a),e.url=vS(TS(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),l&&a.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):"")));let u;if(oe.isFormData(n)){if(Hn.hasStandardBrowserEnv||Hn.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((u=a.getContentType())!==!1){const[c,...f]=u?u.split(";").map(p=>p.trim()).filter(Boolean):[];a.setContentType([c||"multipart/form-data",...f].join("; "))}}if(Hn.hasStandardBrowserEnv&&(r&&oe.isFunction(r)&&(r=r(e)),r||r!==!1&&UJ(e.url))){const c=o&&s&&WJ.read(s);c&&a.set(o,c)}return e},KJ=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(n,r){const o=OS(t);let s=o.data;const a=sr.from(o.headers).normalize();let{responseType:l,onUploadProgress:u,onDownloadProgress:c}=o,f,p,m,g,b;function y(){g&&g(),b&&b(),o.cancelToken&&o.cancelToken.unsubscribe(f),o.signal&&o.signal.removeEventListener("abort",f)}let w=new XMLHttpRequest;w.open(o.method.toUpperCase(),o.url,!0),w.timeout=o.timeout;function x(){if(!w)return;const S=sr.from("getAllResponseHeaders"in w&&w.getAllResponseHeaders()),_={data:!l||l==="text"||l==="json"?w.responseText:w.response,status:w.status,statusText:w.statusText,headers:S,config:t,request:w};SS(function(A){n(A),y()},function(A){r(A),y()},_),w=null}"onloadend"in w?w.onloadend=x:w.onreadystatechange=function(){!w||w.readyState!==4||w.status===0&&!(w.responseURL&&w.responseURL.indexOf("file:")===0)||setTimeout(x)},w.onabort=function(){w&&(r(new rt("Request aborted",rt.ECONNABORTED,t,w)),w=null)},w.onerror=function(){r(new rt("Network Error",rt.ERR_NETWORK,t,w)),w=null},w.ontimeout=function(){let C=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const _=o.transitional||wS;o.timeoutErrorMessage&&(C=o.timeoutErrorMessage),r(new rt(C,_.clarifyTimeoutError?rt.ETIMEDOUT:rt.ECONNABORTED,t,w)),w=null},s===void 0&&a.setContentType(null),"setRequestHeader"in w&&oe.forEach(a.toJSON(),function(C,_){w.setRequestHeader(_,C)}),oe.isUndefined(o.withCredentials)||(w.withCredentials=!!o.withCredentials),l&&l!=="json"&&(w.responseType=o.responseType),c&&([m,b]=Up(c,!0),w.addEventListener("progress",m)),u&&w.upload&&([p,g]=Up(u),w.upload.addEventListener("progress",p),w.upload.addEventListener("loadend",g)),(o.cancelToken||o.signal)&&(f=S=>{w&&(r(!S||S.type?new Tl(null,t,w):S),w.abort(),w=null)},o.cancelToken&&o.cancelToken.subscribe(f),o.signal&&(o.signal.aborted?f():o.signal.addEventListener("abort",f)));const E=$J(o.url);if(E&&Hn.protocols.indexOf(E)===-1){r(new rt("Unsupported protocol "+E+":",rt.ERR_BAD_REQUEST,t));return}w.send(s||null)})},GJ=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let r=new AbortController,o;const s=function(c){if(!o){o=!0,l();const f=c instanceof Error?c:this.reason;r.abort(f instanceof rt?f:new Tl(f instanceof Error?f.message:f))}};let a=e&&setTimeout(()=>{a=null,s(new rt(`timeout ${e} of ms exceeded`,rt.ETIMEDOUT))},e);const l=()=>{t&&(a&&clearTimeout(a),a=null,t.forEach(c=>{c.unsubscribe?c.unsubscribe(s):c.removeEventListener("abort",s)}),t=null)};t.forEach(c=>c.addEventListener("abort",s));const{signal:u}=r;return u.unsubscribe=()=>oe.asap(l),u}},XJ=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let r=0,o;for(;r<n;)o=r+e,yield t.slice(r,o),r=o},YJ=async function*(t,e){for await(const n of JJ(t))yield*XJ(n,e)},JJ=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:n,value:r}=await e.read();if(n)break;yield r}}finally{await e.cancel()}},MS=(t,e,n,r)=>{const o=YJ(t,e);let s=0,a,l=u=>{a||(a=!0,r&&r(u))};return new ReadableStream({async pull(u){try{const{done:c,value:f}=await o.next();if(c){l(),u.close();return}let p=f.byteLength;if(n){let m=s+=p;n(m)}u.enqueue(new Uint8Array(f))}catch(c){throw l(c),c}},cancel(u){return l(u),o.return()}},{highWaterMark:2})},Wp=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",BS=Wp&&typeof ReadableStream=="function",ZJ=Wp&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),IS=(t,...e)=>{try{return!!t(...e)}catch{return!1}},QJ=BS&&IS(()=>{let t=!1;const e=new Request(Hn.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),RS=64*1024,Ub=BS&&IS(()=>oe.isReadableStream(new Response("").body)),jp={stream:Ub&&(t=>t.body)};Wp&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!jp[e]&&(jp[e]=oe.isFunction(t[e])?n=>n[e]():(n,r)=>{throw new rt(`Response type '${e}' is not supported`,rt.ERR_NOT_SUPPORT,r)})})})(new Response);const NJ=async t=>{if(t==null)return 0;if(oe.isBlob(t))return t.size;if(oe.isSpecCompliantForm(t))return(await new Request(Hn.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(oe.isArrayBufferView(t)||oe.isArrayBuffer(t))return t.byteLength;if(oe.isURLSearchParams(t)&&(t=t+""),oe.isString(t))return(await ZJ(t)).byteLength},eZ=async(t,e)=>{const n=oe.toFiniteNumber(t.getContentLength());return n??NJ(e)},Wb={http:xJ,xhr:KJ,fetch:Wp&&(async t=>{let{url:e,method:n,data:r,signal:o,cancelToken:s,timeout:a,onDownloadProgress:l,onUploadProgress:u,responseType:c,headers:f,withCredentials:p="same-origin",fetchOptions:m}=OS(t);c=c?(c+"").toLowerCase():"text";let g=GJ([o,s&&s.toAbortSignal()],a),b;const y=g&&g.unsubscribe&&(()=>{g.unsubscribe()});let w;try{if(u&&QJ&&n!=="get"&&n!=="head"&&(w=await eZ(f,r))!==0){let _=new Request(e,{method:"POST",body:r,duplex:"half"}),T;if(oe.isFormData(r)&&(T=_.headers.get("content-type"))&&f.setContentType(T),_.body){const[A,L]=kS(w,Up(_S(u)));r=MS(_.body,RS,A,L)}}oe.isString(p)||(p=p?"include":"omit");const x="credentials"in Request.prototype;b=new Request(e,{...m,signal:g,method:n.toUpperCase(),headers:f.normalize().toJSON(),body:r,duplex:"half",credentials:x?p:void 0});let E=await fetch(b);const S=Ub&&(c==="stream"||c==="response");if(Ub&&(l||S&&y)){const _={};["status","statusText","headers"].forEach(I=>{_[I]=E[I]});const T=oe.toFiniteNumber(E.headers.get("content-length")),[A,L]=l&&kS(T,Up(_S(l),!0))||[];E=new Response(MS(E.body,RS,A,()=>{L&&L(),y&&y()}),_)}c=c||"text";let C=await jp[oe.findKey(jp,c)||"text"](E,t);return!S&&y&&y(),await new Promise((_,T)=>{SS(_,T,{data:C,headers:sr.from(E.headers),status:E.status,statusText:E.statusText,config:t,request:b})})}catch(x){throw y&&y(),x&&x.name==="TypeError"&&/fetch/i.test(x.message)?Object.assign(new rt("Network Error",rt.ERR_NETWORK,t,b),{cause:x.cause||x}):rt.from(x,x&&x.code,t,b)}})};oe.forEach(Wb,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const LS=t=>`- ${t}`,tZ=t=>oe.isFunction(t)||t===null||t===!1,PS={getAdapter:t=>{t=oe.isArray(t)?t:[t];const{length:e}=t;let n,r;const o={};for(let s=0;s<e;s++){n=t[s];let a;if(r=n,!tZ(n)&&(r=Wb[(a=String(n)).toLowerCase()],r===void 0))throw new rt(`Unknown adapter '${a}'`);if(r)break;o[a||"#"+s]=r}if(!r){const s=Object.entries(o).map(([l,u])=>`adapter ${l} `+(u===!1?"is not supported by the environment":"is not available in the build"));let a=e?s.length>1?`since :
@@ -301,7 +301,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`),ne=P,Y=q),J===void 0&&
301
301
  `});switch(be){case"html":return N.getHTML();case"json":return N.getJSON();case"text":return N.getText({blockSeparator:`
302
302
  `});default:return""}}function J(N){return N.every(be=>M==null?void 0:M.extensionManager.extensions.find(Ie=>Ie.name===be))}i.watch(()=>y.languages,()=>{M.commands.checkSpelling()}),i.watch(()=>r.modelValue,N=>{if(!M||nt.isEqual(q(M,r.output),N))return;const{from:be,to:Ie}=M.state.selection;M.commands.setTextSelection({from:be,to:Ie}),M.commands.setContent(Dn(N,r.disabled,r.mode),!1,{preserveWhitespace:"full"}),P()},{deep:!0}),i.watch(()=>x.value,N=>{var be;M==null||M.setEditable(N),(be=M==null?void 0:M.commands)!=null&&be.setIsEnableSuggestion&&M.commands.setIsEnableSuggestion(N)},{immediate:!0}),i.watch(()=>m.value,()=>{m.value&&m.value.on("selectionUpdate",({editor:N})=>{o("changed:selection",{editor:N})})}),i.onUnmounted(()=>M==null?void 0:M.destroy()),Xu(Su.SAVE,()=>{localStorage.setItem("content",q(M,"html"))});const Y=i.computed(()=>{var Ue;if(!((Ue=M==null?void 0:M.storage)!=null&&Ue.superText))return!1;const{enable:N}=M.storage.superText,be=[Fe.EDITOR,Fe.PLAIN_TEXT].includes(r.mode),Ie=r.disabled;return N&&!be&&!Ie}),ne=i.ref(null),we=i.computed(()=>r.mode),{commentHeight:xe,contentHeight:Ve,minHeight:Se,minHeightComment:We}=DZ(ne,we,r.autoHeight,typeof r.minHeight=="string"?parseInt(r.minHeight):r.minHeight),Z=i.ref(null);function re(N){N===Fe.STRAIGHT&&w(Z.value)}i.onMounted(()=>{re(r.mode)}),i.watch(()=>r.mode,N=>{re(N)});const le=i.ref(null),ue=()=>{var be;(be=le.value)!=null&&be.editor.commands.focusInvalidChar()||M.commands.focusInvalidChar()};u.focusFirstInvalidChar.value=ue,i.onActivated(()=>{u.focusFirstInvalidChar.value=ue});const me=i.computed(()=>{var be,Ie,Ue;const N=((be=r.fieldNameComment)==null?void 0:be.label)||((Ie=r.fieldNameCommentCuesheet)==null?void 0:Ie.label)||((Ue=r.fieldNameContent)==null?void 0:Ue.label);return r.disabled&&N});return e({editor:M}),(N,be)=>{var $;const Ie=Yp,Ue=Xp,mt=Gp,St=Of,H=a$,D=JB;return i.unref(M)?(i.openBlock(),i.createElementBlock("div",{key:0,id:"vdc-editor",class:i.normalizeClass(["vdc-editor w-full flex flex-col",[N.editorClass,{"outline-ed-primary":i.unref(M).isFocused,"outline-ed-border":!i.unref(M).isFocused}]]),style:i.normalizeStyle(I.value)},[!N.hideBubble&&!N.disabled&&x.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[J([i.unref(uc)])?(i.openBlock(),i.createBlock(Ie,{key:0,editor:i.unref(M)},null,8,["editor"])):i.createCommentVNode("",!0),J([i.unref(sa)])?(i.openBlock(),i.createBlock(Ue,{key:1,editor:i.unref(M)},null,8,["editor"])):i.createCommentVNode("",!0),J([i.unref(us)])?(i.openBlock(),i.createBlock(mt,{key:2,editor:i.unref(M)},null,8,["editor"])):i.createCommentVNode("",!0),J([i.unref(cs),i.unref(ds)])?(i.openBlock(),i.createBlock(St,{key:3,editor:i.unref(M)},null,8,["editor"])):i.createCommentVNode("",!0)],64)):i.createCommentVNode("",!0),N.hideToolbar?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(H,{key:1,editor:i.unref(M),"editor-comment":($=le.value)==null?void 0:$.editor,mode:N.mode,class:i.normalizeClass(["mb-2",N.toolBarClass])},null,8,["editor","editor-comment","mode","class"])),i.createElementVNode("div",{ref_key:"editorWrapRef",ref:ne,class:i.normalizeClass(["space-y-2 flex-1 flex flex-col break-keep",!C.value&&"[&_*]:!font-inherit [&_*]:!text-font-size-inherit",T.value&&!C.value?"[&_*]:!font-inherit":"",_.value&&!C.value?"[&_*]:!text-font-size-inherit":""]),style:i.normalizeStyle(A.value)},[me.value?(i.openBlock(),i.createBlock(D,{key:0,extensions:N.extensions,mode:N.mode,"hide-comment":N.hideComment,"field-name-comment":N.fieldNameComment,"field-name-comment-cuesheet":N.fieldNameCommentCuesheet,"field-name-content":N.fieldNameContent,comment:N.comment,"comment-cuesheet":N.commentCuesheet,content:N.modelValue,"min-chars":N.minChar.content,"font-size":_.value},null,8,["extensions","mode","hide-comment","field-name-comment","field-name-comment-cuesheet","field-name-content","comment","comment-cuesheet","content","min-chars","font-size"])):(i.openBlock(),i.createElementBlock("div",{key:1,class:"space-y-2 flex-1 flex flex-col",style:i.normalizeStyle({minWidth:`${V.value}px`})},[N.mode===i.unref(Fe).REPORT&&!N.hideComment?(i.openBlock(),i.createBlock(PZ,{key:0,ref_key:"editorCommentRef",ref:le,mode:i.unref(Fe).REPORT,extensions:N.extensions,"model-value":r.comment,disabled:r.disabled,"disable-super-input":N.disableSuperInput,"is-open-super-view":Y.value,"super-preview-custom-class":N.superPreviewCustomClass,"min-char":N.minChar,"font-size":_.value,style:i.normalizeStyle(r.autoHeight?{height:"auto",minHeight:i.unref(an)(i.unref(We))}:{height:i.unref(an)(i.unref(xe)),minHeight:i.unref(an)(i.unref(Se))}),class:"relative overflow-y-auto","onUpdate:modelValue":be[0]||(be[0]=Q=>o("update:comment",Q))},null,8,["mode","extensions","model-value","disabled","disable-super-input","is-open-super-view","super-preview-custom-class","min-char","font-size","style"])):i.createCommentVNode("",!0),i.createElementVNode("div",{id:"editor-container",class:"relative overflow-y-auto flex flex-col",style:i.normalizeStyle(r.autoHeight?{height:"auto",minHeight:i.unref(an)(i.unref(Se))}:{height:i.unref(an)(i.unref(Ve))})},[i.createElementVNode("div",VZ,[i.withDirectives(i.createVNode(TZ,{ref_key:"superTextViewRef",ref:se,editor:i.unref(M),"super-preview-custom-class":N.superPreviewCustomClass,"min-chars":N.minChar.superPreview,"font-size":_.value},null,8,["editor","super-preview-custom-class","min-chars","font-size"]),[[i.vShow,Y.value]]),i.createElementVNode("div",{id:"editor-panel",ref_key:"contentInner",ref:W,class:"flex-1 p-2.5 border border-ed-gray-400 rounded-[3px] focus-within:border-ed-input-focus"},[i.createVNode(pb,{ref_key:"selectContextMenuRef",ref:Z,editor:i.unref(M),mode:N.mode,"super-text-store":i.unref(b)},{default:i.withCtx(()=>[i.createVNode(i.unref(So),{editor:i.unref(M),spellcheck:"true",class:i.normalizeClass(i.unref(Te)("h-full break-all",N.mode===i.unref(Fe).PLAIN_TEXT&&"plain-text"))},null,8,["editor","class"])]),_:1},8,["editor","mode","super-text-store"])],512)])],4)],4))],6)],6)):i.createCommentVNode("",!0)}}}),FZ={class:"flex gap-2 items-center overflow-x-auto overflow-y-hidden min-h-11 scrollbar-hide"},$Z=i.defineComponent({__name:"ToolbarFormat",props:{editor:{},disabled:{type:Boolean,default:!1},mode:{},activeExtensions:{default:()=>[]}},setup(t){const{t:e}=Tt(),n=t,r=["fontSize","fontFamily","superText","spellchecker",cE],o=i.computed(()=>{const l=[...n.editor.extensionManager.extensions];let u=[];for(const c of l){const{button:f,divider:p=!1,spacer:m=!1,toolbar:g=!0}=c.options;if(!f||!E0(f)||!g)continue;const b=f({editor:n.editor,extension:c,t:i.unref(e),isMobile:!0});if(Array.isArray(b)){const y=b.map((w,x)=>({id:`${c.name}`,button:w,divider:x===b.length-1?p:!1,spacer:x===0?m:!1}));u=[...u,...y];continue}u.push({button:b,divider:p,spacer:m,id:`${c.name}`})}return n.activeExtensions.length?u.filter(c=>c.id&&n.activeExtensions.includes(c.id)):(r.length&&(u=u.filter(c=>c.id&&!r.includes(c.id))),u)}),s=l=>l.id==="spellchecker"?"!text-ed-blue !bg-white !font-normal rounded [&>div>svg]:w-[19px] [&>div>svg]:h-[19px] h-[26px] gap-x-1 whitespace-nowrap":l.button.componentProps.customClass,a=l=>l.id==="spellchecker"?"Spellchecker":l.button.componentProps.icon;return(l,u)=>(i.openBlock(),i.createElementBlock("div",{id:"tool-bar-format",class:i.normalizeClass(i.unref(Te)("bg-white border border-gray-100 dark:bg-ed-gray-500 dark:border-ed-muted rounded-full shadow-elevation2 px-2.5",!o.value.length&&"hidden"))},[i.createElementVNode("div",FZ,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.value,(c,f)=>{var p;return i.openBlock(),i.createBlock(i.resolveDynamicComponent(c.button.component),i.mergeProps({key:f,id:c.id,ref_for:!0},c.button.componentProps,{editor:l.editor,disabled:l.disabled||((p=c.button.componentProps)==null?void 0:p.disabled),"custom-class":s(c),icon:a(c)}),i.createSlots({_:2},[i.renderList(c.button.componentSlots,(m,g,b)=>({name:`${g}`,fn:i.withCtx(y=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(m),i.mergeProps({ref_for:!0},y==null?void 0:y.props,{id:c.id}),null,16,["id"]))])}))]),1040,["id","editor","disabled","custom-class","icon"])}),128))])],2))}}),zZ={class:"flex gap-2 items-center overflow-x-auto"},jS=i.defineComponent({__name:"ToolbarMobile",props:{editor:{},disabled:{type:Boolean,default:!1},mode:{},activeExtensions:{default:()=>[uE,cc,sb]}},setup(t){const{t:e}=Tt(),n=t,r=i.inject("isEditable",i.ref(!0)),o=i.computed(()=>{const u=[...n.editor.extensionManager.extensions],c=u.find(m=>m.name===sb);let f=u.sort((m,g)=>m.name==="spellchecker"?-1:g.name==="spellchecker"||m.name==="superText"?1:g.name==="superText"?-1:0);c&&(f=u.sort((m,g)=>m.name==="configPlan"?1:g.name==="configPlan"?-1:0));let p=[];for(const m of f){const{button:g,divider:b=!1,spacer:y=!1,toolbar:w=!0}=m.options;if(!g||!E0(g)||!w)continue;const x=g({editor:n.editor,extension:m,t:i.unref(e),isMobile:!0});if(Array.isArray(x)){const E=x.map((S,C)=>({id:`${m.name}`,button:S,divider:C===x.length-1?b:!1,spacer:C===0?y:!1}));p=[...p,...E];continue}p.push({button:x,divider:b,spacer:y,id:`${m.name}`})}if(!r.value){const m=p.find(g=>g.id==="superText");m&&(m.button.componentProps.disabled=!0)}return n.activeExtensions.length?p.filter(m=>m.id&&n.activeExtensions.includes(m.id)):p}),s=u=>u.id==="spellchecker"?"!text-ed-blue data-[state=off]:bg-white dark:data-[state=off]:bg-ed-accent/40 !font-normal rounded [&>div>svg]:w-[19px] [&>div>svg]:h-[19px] h-[26px] gap-x-1 whitespace-nowrap":u.button.componentProps.customClass,a=u=>u.id==="spellchecker"?"Spellchecker":u.button.componentProps.icon,l=i.ref(!1);return(u,c)=>{const f=dE;return i.openBlock(),i.createElementBlock("div",{id:"tool-bar",class:i.normalizeClass(i.unref(Te)("z-10 bg-ed-gray-500 rounded-[5px] px-2.5 py-[5px] leading-none",i.unref(df)()&&"top-16",!o.value.length&&"hidden"))},[i.createElementVNode("div",zZ,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.value,(p,m)=>{var g,b,y;return i.openBlock(),i.createElementBlock(i.Fragment,{key:m},[p.spacer&&m!==0?(i.openBlock(),i.createBlock(i.unref(ii),{key:0,orientation:"vertical",class:"h-[16px] mx-[10px]"})):i.createCommentVNode("",!0),(i.openBlock(),i.createBlock(i.resolveDynamicComponent(p.button.component),i.mergeProps({id:p.id,ref_for:!0},p.button.componentProps,{editor:u.editor,disabled:u.disabled||((g=p.button.componentProps)==null?void 0:g.disabled),"custom-class":s(p),icon:a(p)}),i.createSlots({_:2},[i.renderList(p.button.componentSlots,(w,x,E)=>({name:`${x}`,fn:i.withCtx(S=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(w),i.mergeProps({ref_for:!0},S==null?void 0:S.props,{id:p.id}),null,16,["id"]))])}))]),1040,["id","editor","disabled","custom-class","icon"])),p.id===cc&&i.unref(l)?(i.openBlock(),i.createBlock(f,{key:1,class:"bg-white border-inherit w-[26px] h-[26px] shadow-none",checked:(y=(b=p.button.componentProps).isActive)==null?void 0:y.call(b),"onUpdate:checked":w=>{var x,E;return(E=(x=p.button.componentProps).action)==null?void 0:E.call(x)}},null,8,["checked","onUpdate:checked"])):i.createCommentVNode("",!0),p.divider?(i.openBlock(),i.createBlock(i.unref(ii),{key:2,orientation:"vertical",class:"mx-2 h-auto"})):i.createCommentVNode("",!0)],64)}),128))])],2)}}}),HZ={class:"flex w-fit rounded-md bg-[#46505E] text-white max-w-full overflow-x-auto"},UZ=To(i.defineComponent({__name:"MainBubbleMenuList",props:{editor:{},mode:{},disableSuperInput:{type:Boolean},hasClipboard:{type:Boolean}},emits:["close-long-press-menu"],setup(t,{emit:e}){var c;const n=t,r=e,{t:o}=Tt(),s=i.computed(()=>[...n.editor.extensionManager.extensions].find(p=>p.name==="superText")),a=i.ref(!1),l=(c=n.editor.extensionManager.extensions.find(f=>f.name==="superText"))==null?void 0:c.options.specialCharModal,u=f=>{const{state:p}=n.editor,{from:m}=p.selection;n.editor.commands.insertContentAt(m,f)};return(f,p)=>{var m,g,b;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",HZ,[i.unref(s)&&!f.disableSuperInput&&f.mode!==i.unref(Fe).EDITOR?(i.openBlock(),i.createElementBlock("button",{key:0,class:"bubble-menu-item",onClick:p[0]||(p[0]=y=>f.editor.chain().focus().toggleSuperInputMoblie().run())},i.toDisplayString(i.unref(o)("editor.super")),1)):i.createCommentVNode("",!0),i.createElementVNode("button",{class:"bubble-menu-item",onClick:p[1]||(p[1]=y=>a.value=!0)},i.toDisplayString(i.unref(o)("editor.insertSpecial")),1),f.hasClipboard?(i.openBlock(),i.createElementBlock("button",{key:1,class:"bubble-menu-item",onClick:p[2]||(p[2]=y=>f.editor.chain().focus().pasteContent().run())},i.toDisplayString(i.unref(o)("editor.paste")),1)):i.createCommentVNode("",!0),i.createElementVNode("button",{class:"bubble-menu-item",onClick:p[3]||(p[3]=y=>f.editor.chain().focus().cutContent().run())},i.toDisplayString(i.unref(o)("editor.cut")),1),i.createElementVNode("button",{class:"bubble-menu-item",onClick:p[4]||(p[4]=()=>{f.editor.chain().focus().copyContent().setTextSelection(0).blur().run(),r("close-long-press-menu")})},i.toDisplayString(i.unref(o)("editor.copy")),1),i.createElementVNode("button",{class:"bubble-menu-item",onClick:p[5]||(p[5]=y=>f.editor.chain().focus().selectAll().run())},i.toDisplayString(i.unref(o)("editor.selectAll")),1)]),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[(i.openBlock(),i.createBlock(i.resolveDynamicComponent((m=i.unref(l))==null?void 0:m.component),{"is-open":i.unref(a),open:i.unref(a),class:i.normalizeClass((b=(g=i.unref(l))==null?void 0:g.componentProps)==null?void 0:b.class),onSelectedChar:u,onClose:p[6]||(p[6]=y=>a.value=!1)},null,40,["is-open","open","class"]))]))],64)}}}),[["__scopeId","data-v-bd0f16de"]]);class qS{isNativeWebViewAvailable(){return window.ReactNativeWebView!==void 0}getDevicePlatform(){var r;if(!this.isNativeWebViewAvailable())return;if(typeof window.webkit=="object"&&typeof((r=window.webkit)==null?void 0:r.messageHandlers)=="object")return w0.IOS;const n=navigator.userAgent.toLowerCase();if(n.includes("android"))return w0.ANDROID;if(n.includes("iphone")||n.includes("ipad")||n.includes("ipod"))return w0.IOS}sendToNative(e,n){if(window.ReactNativeWebView){const r={type:e,data:n};window.ReactNativeWebView.postMessage(JSON.stringify(r)),console.log(`Sent message to native: ${e}`)}else console.log("ReactNativeWebView not available")}receiveDataFromNative(e,n){const r=window.receiveDriverData;window.receiveDriverData=o=>{try{const s=JSON.parse(o);s.type===e?(console.log(`Received data from native ${e}`),n(s.data)):r&&r(o)}catch(s){console.log("Error parsing data from native",s)}}}}const KS=i.defineComponent({__name:"MainBubbleMenu",props:{editor:{},mode:{},disableSuperInput:{type:Boolean}},setup(t){const e=t,n=new qS,r=i.ref(!1),o=async()=>{var g,b;const m=await((b=(g=e.editor).hasClipboard)==null?void 0:b.call(g));r.value=!!m},s={duration:200,placement:"bottom",appendTo:()=>document.body.querySelector(".splitpanes__pane"),onShow:()=>{o(),n.sendToNative("hideIOSEditMenu")},getReferenceClientRect:()=>{if(e.editor&&!e.editor.isDestroyed){const{view:m,state:g}=e.editor,{from:b,to:y}=g.selection,w=m.dom.getBoundingClientRect(),x=m.coordsAtPos(b),E=m.coordsAtPos(y),S=Math.min(x.top,E.top),_=Math.max(x.bottom,E.bottom)-S;return new DOMRect(w.left,S,w.width,_)}return null}},a=i.ref(null),l=i.ref(!1),u=({editor:m,state:g})=>m.isActive("image")?!1:!g.selection.empty||l.value;function c(m){return f(m)&&m.touches.length>0?{x:m.touches[0].clientX,y:m.touches[0].clientY}:f(m)&&m.changedTouches.length>0?{x:m.changedTouches[0].clientX,y:m.changedTouches[0].clientY}:m instanceof MouseEvent?{x:m.clientX,y:m.clientY}:window.PointerEvent&&m instanceof PointerEvent?{x:m.clientX,y:m.clientY}:null}function f(m){return"touches"in m}function p(m){if(!e.editor)return;const g=c(m);if(!g)return;const b=e.editor.view,y=b.state,w=b.posAtCoords({left:g.x,top:g.y});if(!w||w.inside===-1)return;const x=w.pos,E=y.doc.content.size,S=Math.min(x+1,E);let C=y.tr;C=C.setSelection(Ae.create(y.doc,x,S)),b.dispatch(C),requestAnimationFrame(()=>{const _=b.state.tr.setSelection(Ae.create(b.state.doc,x,x));b.dispatch(_),b.focus()})}return i.onMounted(()=>{const m=e.editor.view.dom;gt.onLongPress(i.ref(m),y=>{l.value=!0,p(y)},{delay:500,modifiers:{prevent:!1}});const g=()=>{e.editor.state.selection.empty&&(l.value=!1)};m.addEventListener("pointerdown",g);const b=({transaction:y})=>{l.value&&y.docChanged&&(l.value=!1,i.nextTick(()=>{var w;try{const x=(w=a.value)==null?void 0:w.$el;x&&x._tippy&&typeof x._tippy.hide=="function"&&x._tippy.hide()}catch{const E=e.editor.view,S=E.state,C=S.selection.from,_=S.doc.content.size,T=Math.min(C+1,_);E.dispatch(S.tr.setSelection(Ae.create(S.doc,C,T))),requestAnimationFrame(()=>{E.dispatch(E.state.tr.setSelection(Ae.create(E.state.doc,C,C)))})}}))};e.editor.on("transaction",b),i.onUnmounted(()=>{m.removeEventListener("pointerdown",g),e.editor.off("transaction",b)})}),(m,g)=>(i.openBlock(),i.createBlock(i.unref(Eu),{ref_key:"bubbleMenuRef",ref:a,editor:m.editor,"tippy-options":s,"should-show":u},{default:i.withCtx(()=>[i.createVNode(UZ,{editor:m.editor,mode:m.mode,disableSuperInput:m.disableSuperInput,hasClipboard:i.unref(r),onCloseLongPressMenu:g[0]||(g[0]=b=>l.value=!1)},null,8,["editor","mode","disableSuperInput","hasClipboard"])]),_:1},8,["editor"]))}}),WZ={class:"flex items-center justify-between mb-2"},jZ={class:"mb-5"},qZ={class:"flex gap-x-3"},KZ=i.defineComponent({__name:"SuperInputBottomSheet",props:{editor:{},open:{type:Boolean},bottomSheetComponent:{}},emits:["save","close"],setup(t,{emit:e}){const n=e,{t:r}=Tt(),o=i.ref(""),s=i.computed(()=>{var c;if(!o.value)return!0;const u=document.createElement("div");return u.innerHTML=o.value,((c=u==null?void 0:u.textContent)==null?void 0:c.trim())===""}),a=()=>{n("save",o.value),o.value=""},l=()=>{n("close")};return(u,c)=>{var p;const f=Ft;return i.openBlock(),i.createBlock(i.resolveDynamicComponent((p=u.bottomSheetComponent)==null?void 0:p.component),{"is-open":u.open,type:"bottom",title:"수퍼 입력",onOnClose:l},{customContent:i.withCtx(()=>{var m;return[i.createElementVNode("div",WZ,[c[3]||(c[3]=i.createElementVNode("p",null,"내용",-1)),(i.openBlock(),i.createBlock(i.resolveDynamicComponent((m=u.bottomSheetComponent)==null?void 0:m.button),{class:"w-fit [&_svg]:size-6 text-blue",variant:"ghost",size:"icon",onClick:c[0]||(c[0]=g=>o.value="")},{default:i.withCtx(()=>[i.createVNode(f,{name:"reset"}),c[2]||(c[2]=i.createElementVNode("p",null,"초기화",-1))]),_:1}))])]}),body:i.withCtx(()=>[i.createElementVNode("div",jZ,[i.createVNode(fb,{modelValue:o.value,"onUpdate:modelValue":c[1]||(c[1]=m=>o.value=m),"parent-editor":u.editor},null,8,["modelValue","parent-editor"])])]),footer:i.withCtx(()=>{var m,g;return[i.createElementVNode("div",qZ,[(i.openBlock(),i.createBlock(i.resolveDynamicComponent((m=u.bottomSheetComponent)==null?void 0:m.button),{variant:"outline",onClick:l},{default:i.withCtx(()=>c[4]||(c[4]=[i.createTextVNode(" 취소 ")])),_:1})),(i.openBlock(),i.createBlock(i.resolveDynamicComponent((g=u.bottomSheetComponent)==null?void 0:g.button),{disabled:s.value,variant:s.value?"disabled":"default",onClick:a},{default:i.withCtx(()=>c[5]||(c[5]=[i.createTextVNode(" 입력 ")])),_:1},8,["disabled","variant"]))])]}),_:1},40,["is-open"])}}}),GZ=Pn.create({name:"diffDel",parseHTML(){return[{tag:"span.diff-del"}]},renderHTML({HTMLAttributes:t}){return["span",{class:"diff-del",...t},0]}}),XZ=i.defineComponent({__name:"EditorCommentMoblie",props:{isMobile:{type:Boolean},superTextArea:{default:{view:!0,button:!0}},mode:{},modelValue:{default:""},comment:{},commentCuesheet:{},hideComment:{type:Boolean},disableSuperInput:{type:Boolean,default:!1},fontSizeDefault:{},fontFamilyDefault:{},isOpenSuperView:{type:Boolean,default:!0},output:{default:"html"},dark:{type:Boolean,default:void 0},disabled:{type:Boolean,default:!1},hideToolbar:{type:Boolean,default:!1},isShowFormatControlBar:{type:Boolean},titleBarComment:{},titleBarContent:{},fieldNameComment:{},fieldNameCommentCuesheet:{},fieldNameContent:{},fieldNameSuper:{},isScreenSplit:{},isShowLineNumber:{type:Boolean},hideMenubar:{type:Boolean},disableBubble:{type:Boolean,default:!1},hideBubble:{type:Boolean,default:!1},maxWidth:{default:void 0},minHeight:{default:600},maxHeight:{default:void 0},height:{},extensions:{default:()=>[]},editorClass:{default:void 0},contentClass:{default:void 0},isCompare:{type:Boolean},autoHeight:{type:Boolean},textAlert:{},toolBarClass:{},readonly:{type:Boolean},canEditSuperReadOnly:{type:Boolean},autoFocus:{type:Boolean,default:!0},superPreviewCustomClass:{},minChar:{},isAccordion:{type:Boolean},contentAutoCopied:{}},emits:["enter","change","update:modelValue","update:comment","onFocusEditor","changed:selection","setEditorSelected","onBlurEditor","lineFocus","onFocus","onBlur"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.useAttrs(),a=wn(),{isReady:l,editor:u,updateEditorState:c,checkSpellStore:f}=a,p=i.inject("isEditable",i.ref(!0)),m=new ei({enablePasteRules:!1,enableInputRules:!1,content:Dn(r.modelValue,r.disabled),editorProps:{attributes:{id:nr.COMMENT,[nr.DISABLE_SUPER_INPUT]:`${r.disableSuperInput}`},handleKeyDown:nt.throttle((x,E)=>E.key==="Enter"&&s.enter&&!E.shiftKey?(o("enter"),!0):!1,_o),transformPastedHTML:x=>(x=x.replace(/\s*style="[^"]*"/g,""),x)},onCreate:({editor:x})=>{c(x)},onUpdate:nt.throttle(({editor:x})=>{l.value=!0;const E=b(x,r.output);o("update:modelValue",E),o("change",{editor:x,output:E}),c(x)},_o),extensions:[GZ,...nt.uniqBy(nt.reverse(i.unref(r.extensions)),"name")],editable:p.value,onFocus:()=>{g()},onBlur:({editor:x,event:E})=>{o("onBlurEditor",E)}});function g(){o("setEditorSelected",m)}g();function b(x,E){if(!x)return"";if(x.isEmpty)return E==="json"?{}:"";switch(E){case"html":return x.getHTML();case"json":return x.getJSON();case"text":return x.getText();default:return""}}function y(x){return x.every(E=>m==null?void 0:m.extensionManager.extensions.find(S=>S.name===E))}i.watch(()=>f.languages,()=>{m.commands.checkSpelling()}),i.watch(()=>r.modelValue,x=>{if(!m||nt.isEqual(b(m,r.output),x))return;const{from:E,to:S}=m.state.selection;m.commands.setTextSelection({from:E,to:S}),m.commands.setContent(Dn(x,r.disabled),!1)},{deep:!0}),i.watch(()=>u.value,()=>{u.value&&u.value.on("selectionUpdate",({editor:x})=>{o("changed:selection",{editor:x})})}),i.watch(()=>r.disableSuperInput,()=>{const x=document.getElementById(nr.COMMENT);x==null||x.setAttribute(nr.DISABLE_SUPER_INPUT,`${r.disableSuperInput}`)}),i.onUnmounted(()=>m==null?void 0:m.destroy()),Xu(Su.SAVE,()=>{localStorage.setItem("comment",b(m,"html"))});function w(x){m.commands.focus("end"),g()}return Jp(m),i.onMounted(()=>{var x;r.autoFocus&&w(r.mode),(x=m==null?void 0:m.commands)!=null&&x.setIsMobile&&m.commands.setIsMobile(!0)}),i.watch(()=>r.mode,x=>{r.autoFocus&&w()}),i.watch(()=>p.value,x=>{var E;m==null||m.setEditable(x),(E=m==null?void 0:m.commands)!=null&&E.setIsEnableSuggestion&&m.commands.setIsEnableSuggestion(x)},{immediate:!0}),e({editor:m}),(x,E)=>{const S=KS,C=Yp,_=Xp,T=Gp,A=Of;return i.openBlock(),i.createElementBlock(i.Fragment,null,[!x.hideBubble&&!x.disabled&&i.unref(p)?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createVNode(S,{editor:i.unref(m),mode:x.mode,"disable-super-input":x.disableSuperInput},null,8,["editor","mode","disable-super-input"]),y([i.unref(uc)])?(i.openBlock(),i.createBlock(C,{key:0,editor:i.unref(m)},null,8,["editor"])):i.createCommentVNode("",!0),y([i.unref(sa)])?(i.openBlock(),i.createBlock(_,{key:1,editor:i.unref(m)},null,8,["editor"])):i.createCommentVNode("",!0),y([i.unref(us)])?(i.openBlock(),i.createBlock(T,{key:2,editor:i.unref(m)},null,8,["editor"])):i.createCommentVNode("",!0),y([i.unref(cs),i.unref(ds)])?(i.openBlock(),i.createBlock(A,{key:3,editor:i.unref(m)},null,8,["editor"])):i.createCommentVNode("",!0)],64)):i.createCommentVNode("",!0),i.createVNode(i.unref(So),{id:"editor-panel",editor:i.unref(m),spellcheck:"true",class:i.normalizeClass(["flex-1 flex-col relative"])},null,8,["editor"])],64)}}}),Gb={__name:"splitpanes",props:{horizontal:{type:Boolean,default:!1},pushOtherPanes:{type:Boolean,default:!0},maximizePanes:{type:Boolean,default:!0},rtl:{type:Boolean,default:!1},firstSplitter:{type:Boolean,default:!1}},emits:["ready","resize","resized","pane-click","pane-maximize","pane-add","pane-remove","splitter-click","splitter-dblclick"],setup(t,{emit:e}){const n=e,r=t,o=i.useSlots(),s=i.ref([]),a=i.computed(()=>s.value.reduce((Z,re)=>(Z[~~re.id]=re)&&Z,{})),l=i.computed(()=>s.value.length),u=i.ref(null),c=i.ref(!1),f=i.ref({mouseDown:!1,dragging:!1,activeSplitter:null,cursorOffset:0}),p=i.ref({splitter:null,timeoutId:null}),m=i.computed(()=>({[`splitpanes splitpanes--${r.horizontal?"horizontal":"vertical"}`]:!0,"splitpanes--dragging":f.value.dragging})),g=()=>{document.addEventListener("mousemove",w,{passive:!1}),document.addEventListener("mouseup",x),"ontouchstart"in window&&(document.addEventListener("touchmove",w,{passive:!1}),document.addEventListener("touchend",x))},b=()=>{document.removeEventListener("mousemove",w,{passive:!1}),document.removeEventListener("mouseup",x),"ontouchstart"in window&&(document.removeEventListener("touchmove",w,{passive:!1}),document.removeEventListener("touchend",x))},y=(Z,re)=>{const le=Z.target.closest(".splitpanes__splitter");if(le){const{left:ue,top:me}=le.getBoundingClientRect(),{clientX:N,clientY:be}="ontouchstart"in window&&Z.touches?Z.touches[0]:Z;f.value.cursorOffset=r.horizontal?be-me:N-ue}g(),f.value.mouseDown=!0,f.value.activeSplitter=re},w=Z=>{f.value.mouseDown&&(Z.preventDefault(),f.value.dragging=!0,requestAnimationFrame(()=>{A(_(Z)),Se("resize",{event:Z},!0)}))},x=Z=>{f.value.dragging&&(window.getSelection().removeAllRanges(),Se("resized",{event:Z},!0)),f.value.mouseDown=!1,f.value.activeSplitter=null,setTimeout(()=>{f.value.dragging=!1,b()},100)},E=(Z,re)=>{"ontouchstart"in window&&(Z.preventDefault(),p.value.splitter===re?(clearTimeout(p.value.timeoutId),p.value.timeoutId=null,S(Z,re),p.value.splitter=null):(p.value.splitter=re,p.value.timeoutId=setTimeout(()=>p.value.splitter=null,500))),f.value.dragging||Se("splitter-click",{event:Z,index:re},!0)},S=(Z,re)=>{if(Se("splitter-dblclick",{event:Z,index:re},!0),r.maximizePanes){let le=0;s.value=s.value.map((ue,me)=>(ue.size=me===re?ue.max:ue.min,me!==re&&(le+=ue.min),ue)),s.value[re].size-=le,Se("pane-maximize",{event:Z,index:re,pane:s.value[re]}),Se("resized",{event:Z,index:re},!0)}},C=(Z,re)=>{Se("pane-click",{event:Z,index:a.value[re].index,pane:a.value[re]})},_=Z=>{const re=u.value.getBoundingClientRect(),{clientX:le,clientY:ue}="ontouchstart"in window&&Z.touches?Z.touches[0]:Z;return{x:le-(r.horizontal?0:f.value.cursorOffset)-re.left,y:ue-(r.horizontal?f.value.cursorOffset:0)-re.top}},T=Z=>{Z=Z[r.horizontal?"y":"x"];const re=u.value[r.horizontal?"clientHeight":"clientWidth"];return r.rtl&&!r.horizontal&&(Z=re-Z),Z*100/re},A=Z=>{const re=f.value.activeSplitter;let le={prevPanesSize:I(re),nextPanesSize:M(re),prevReachedMinPanes:0,nextReachedMinPanes:0};const ue=0+(r.pushOtherPanes?0:le.prevPanesSize),me=100-(r.pushOtherPanes?0:le.nextPanesSize),N=Math.max(Math.min(T(Z),me),ue);let be=[re,re+1],Ie=s.value[be[0]]||null,Ue=s.value[be[1]]||null;const mt=Ie.max<100&&N>=Ie.max+le.prevPanesSize,St=Ue.max<100&&N<=100-(Ue.max+M(re+1));if(mt||St){mt?(Ie.size=Ie.max,Ue.size=Math.max(100-Ie.max-le.prevPanesSize-le.nextPanesSize,0)):(Ie.size=Math.max(100-Ue.max-le.prevPanesSize-M(re+1),0),Ue.size=Ue.max);return}if(r.pushOtherPanes){const H=L(le,N);if(!H)return;({sums:le,panesToResize:be}=H),Ie=s.value[be[0]]||null,Ue=s.value[be[1]]||null}Ie!==null&&(Ie.size=Math.min(Math.max(N-le.prevPanesSize-le.prevReachedMinPanes,Ie.min),Ie.max)),Ue!==null&&(Ue.size=Math.min(Math.max(100-N-le.nextPanesSize-le.nextReachedMinPanes,Ue.min),Ue.max))},L=(Z,re)=>{const le=f.value.activeSplitter,ue=[le,le+1];return re<Z.prevPanesSize+s.value[ue[0]].min&&(ue[0]=W(le).index,Z.prevReachedMinPanes=0,ue[0]<le&&s.value.forEach((me,N)=>{N>ue[0]&&N<=le&&(me.size=me.min,Z.prevReachedMinPanes+=me.min)}),Z.prevPanesSize=I(ue[0]),ue[0]===void 0)?(Z.prevReachedMinPanes=0,s.value[0].size=s.value[0].min,s.value.forEach((me,N)=>{N>0&&N<=le&&(me.size=me.min,Z.prevReachedMinPanes+=me.min)}),s.value[ue[1]].size=100-Z.prevReachedMinPanes-s.value[0].min-Z.prevPanesSize-Z.nextPanesSize,null):re>100-Z.nextPanesSize-s.value[ue[1]].min&&(ue[1]=j(le).index,Z.nextReachedMinPanes=0,ue[1]>le+1&&s.value.forEach((me,N)=>{N>le&&N<ue[1]&&(me.size=me.min,Z.nextReachedMinPanes+=me.min)}),Z.nextPanesSize=M(ue[1]-1),ue[1]===void 0)?(Z.nextReachedMinPanes=0,s.value.forEach((me,N)=>{N<l.value-1&&N>=le+1&&(me.size=me.min,Z.nextReachedMinPanes+=me.min)}),s.value[ue[0]].size=100-Z.prevPanesSize-M(ue[0]-1),null):{sums:Z,panesToResize:ue}},I=Z=>s.value.reduce((re,le,ue)=>re+(ue<Z?le.size:0),0),M=Z=>s.value.reduce((re,le,ue)=>re+(ue>Z+1?le.size:0),0),W=Z=>[...s.value].reverse().find(re=>re.index<Z&&re.size>re.min)||{},j=Z=>s.value.find(re=>re.index>Z+1&&re.size>re.min)||{},K=()=>{var Z;const re=Array.from(((Z=u.value)==null?void 0:Z.children)||[]);for(const le of re){const ue=le.classList.contains("splitpanes__pane"),me=le.classList.contains("splitpanes__splitter");!ue&&!me&&(le.remove(),console.warn("Splitpanes: Only <pane> elements are allowed at the root of <splitpanes>. One of your DOM nodes was removed."))}},se=(Z,re,le=!1)=>{const ue=Z-1,me=document.createElement("div");me.classList.add("splitpanes__splitter"),le||(me.onmousedown=N=>y(N,ue),typeof window<"u"&&"ontouchstart"in window&&(me.ontouchstart=N=>y(N,ue)),me.onclick=N=>E(N,ue+1)),me.ondblclick=N=>S(N,ue+1),re.parentNode.insertBefore(me,re)},z=Z=>{Z.onmousedown=void 0,Z.onclick=void 0,Z.ondblclick=void 0,Z.remove()},V=()=>{var Z;const re=Array.from(((Z=u.value)==null?void 0:Z.children)||[]);for(const ue of re)ue.className.includes("splitpanes__splitter")&&z(ue);let le=0;for(const ue of re)ue.className.includes("splitpanes__pane")&&(!le&&r.firstSplitter?se(le,ue,!0):le&&se(le,ue),le++)},P=({uid:Z,...re})=>{const le=a.value[Z];for(const[ue,me]of Object.entries(re))le[ue]=me},q=Z=>{var re;let le=-1;Array.from(((re=u.value)==null?void 0:re.children)||[]).some(ue=>(ue.className.includes("splitpanes__pane")&&le++,ue.isSameNode(Z.el))),s.value.splice(le,0,{...Z,index:le}),s.value.forEach((ue,me)=>ue.index=me),c.value&&i.nextTick(()=>{V(),Y({addedPane:s.value[le]}),Se("pane-add",{pane:s.value[le]})})},J=Z=>{const re=s.value.findIndex(ue=>ue.id===Z);s.value[re].el=null;const le=s.value.splice(re,1)[0];s.value.forEach((ue,me)=>ue.index=me),i.nextTick(()=>{V(),Se("pane-remove",{pane:le}),Y({removedPane:{...le}})})},Y=(Z={})=>{!Z.addedPane&&!Z.removedPane?we():s.value.some(re=>re.givenSize!==null||re.min||re.max<100)?xe(Z):ne(),c.value&&Se("resized")},ne=()=>{const Z=100/l.value;let re=0;const le=[],ue=[];for(const me of s.value)me.size=Math.max(Math.min(Z,me.max),me.min),re-=me.size,me.size>=me.max&&le.push(me.id),me.size<=me.min&&ue.push(me.id);re>.1&&Ve(re,le,ue)},we=()=>{let Z=100;const re=[],le=[];let ue=0;for(const N of s.value)Z-=N.size,N.givenSize!==null&&ue++,N.size>=N.max&&re.push(N.id),N.size<=N.min&&le.push(N.id);let me=100;if(Z>.1){for(const N of s.value)N.givenSize===null&&(N.size=Math.max(Math.min(Z/(l.value-ue),N.max),N.min)),me-=N.size;me>.1&&Ve(me,re,le)}},xe=({addedPane:Z,removedPane:re}={})=>{let le=100/l.value,ue=0;const me=[],N=[];((Z==null?void 0:Z.givenSize)??null)!==null&&(le=(100-Z.givenSize)/(l.value-1));for(const be of s.value)ue-=be.size,be.size>=be.max&&me.push(be.id),be.size<=be.min&&N.push(be.id);if(!(Math.abs(ue)<.1)){for(const be of s.value)(Z==null?void 0:Z.givenSize)!==null&&(Z==null?void 0:Z.id)===be.id||(be.size=Math.max(Math.min(le,be.max),be.min)),ue-=be.size,be.size>=be.max&&me.push(be.id),be.size<=be.min&&N.push(be.id);ue>.1&&Ve(ue,me,N)}},Ve=(Z,re,le)=>{let ue;Z>0?ue=Z/(l.value-re.length):ue=Z/(l.value-le.length),s.value.forEach((me,N)=>{if(Z>0&&!re.includes(me.id)){const be=Math.max(Math.min(me.size+ue,me.max),me.min),Ie=be-me.size;Z-=Ie,me.size=be}else if(!le.includes(me.id)){const be=Math.max(Math.min(me.size+ue,me.max),me.min),Ie=be-me.size;Z-=Ie,me.size=be}}),Math.abs(Z)>.1&&i.nextTick(()=>{c.value&&console.warn("Splitpanes: Could not resize panes correctly due to their constraints.")})},Se=(Z,re=void 0,le=!1)=>{const ue=(re==null?void 0:re.index)??f.value.activeSplitter??null;n(Z,{...re,...ue!==null&&{index:ue},...le&&ue!==null&&{prevPane:s.value[ue-(r.firstSplitter?1:0)],nextPane:s.value[ue+(r.firstSplitter?0:1)]},panes:s.value.map(me=>({min:me.min,max:me.max,size:me.size}))})};i.watch(()=>r.firstSplitter,()=>V()),i.onMounted(()=>{K(),V(),Y(),Se("ready"),c.value=!0}),i.onBeforeUnmount(()=>c.value=!1);const We=()=>{var Z;return i.h("div",{ref:u,class:m.value},(Z=o.default)==null?void 0:Z.call(o))};return i.provide("panes",s),i.provide("indexedPanes",a),i.provide("horizontal",i.computed(()=>r.horizontal)),i.provide("requestUpdate",P),i.provide("onPaneAdd",q),i.provide("onPaneRemove",J),i.provide("onPaneClick",C),(Z,re)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(We)))}},ha={__name:"pane",props:{size:{type:[Number,String]},minSize:{type:[Number,String],default:0},maxSize:{type:[Number,String],default:100}},setup(t){var e;const n=t,r=i.inject("requestUpdate"),o=i.inject("onPaneAdd"),s=i.inject("horizontal"),a=i.inject("onPaneRemove"),l=i.inject("onPaneClick"),u=(e=i.getCurrentInstance())==null?void 0:e.uid,c=i.inject("indexedPanes"),f=i.computed(()=>c.value[u]),p=i.ref(null),m=i.computed(()=>{const w=isNaN(n.size)||n.size===void 0?0:parseFloat(n.size);return Math.max(Math.min(w,b.value),g.value)}),g=i.computed(()=>{const w=parseFloat(n.minSize);return isNaN(w)?0:w}),b=i.computed(()=>{const w=parseFloat(n.maxSize);return isNaN(w)?100:w}),y=i.computed(()=>{var w;return`${s.value?"height":"width"}: ${(w=f.value)==null?void 0:w.size}%`});return i.watch(()=>m.value,w=>r({uid:u,size:w})),i.watch(()=>g.value,w=>r({uid:u,min:w})),i.watch(()=>b.value,w=>r({uid:u,max:w})),i.onMounted(()=>{o({id:u,el:p.value,min:g.value,max:b.value,givenSize:n.size===void 0?null:m.value,size:m.value})}),i.onBeforeUnmount(()=>a(u)),(w,x)=>(i.openBlock(),i.createElementBlock("div",{ref_key:"paneEl",ref:p,class:"splitpanes__pane",onClick:x[0]||(x[0]=E=>i.unref(l)(E,w._.uid)),style:i.normalizeStyle(y.value)},[i.renderSlot(w.$slots,"default")],4))}},GS=i.defineComponent({__name:"ToolbarTitle",props:{titleBar:{},customClass:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("h3",{class:i.normalizeClass(i.unref(Te)("rounded-[5px] px-2.5 py-[5px] min-h-[32px] flex items-center bg-ed-gray-500",[e.customClass],[e.titleBar.bgClass]))},i.toDisplayString(e.titleBar.title),3))}}),YZ={class:"text-red-500 relative -top-1"},Qp=i.defineComponent({__name:"EditorFieldName",props:{fieldName:{},mode:{},disabled:{type:Boolean,default:!1},isRequired:{type:Boolean,default:!1}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(i.unref(Te)("label-large",e.fieldName.customClass))},[i.createElementVNode("span",null,i.toDisplayString(e.fieldName.label),1),i.withDirectives(i.createElementVNode("span",YZ," •",512),[[i.vShow,e.fieldName.isRequired]])],2))}});function XS(t=!1,e=10){const n=e,r=90,o=50,s=n+1,a=i.ref(!0),l=i.ref(!0),u=i.ref(o),c=i.ref(o);return{HEADER_ONLY_SIZE:n,FULL_SIZE:r,SPLIT_SIZE:o,pane1ContentVisible:a,pane2ContentVisible:l,pane1Size:u,pane2Size:c,togglePane:m=>{if(i.unref(t)){l.value?(l.value=!1,c.value=n):(l.value=!0,c.value=r+n);return}if(m==="pane1"){a.value&&l.value?(a.value=!1,u.value=n,c.value=r):a.value&&!l.value?(a.value=!1,l.value=!0,u.value=n,c.value=r):!a.value&&l.value?(a.value=!0,u.value=o,c.value=o):(a.value=!0,u.value=r,c.value=n);return}m==="pane2"&&(a.value&&l.value?(l.value=!1,u.value=r,c.value=n):l.value&&!a.value?(l.value=!1,a.value=!0,u.value=r,c.value=n):!l.value&&a.value?(l.value=!0,u.value=o,c.value=o):(l.value=!0,u.value=n,c.value=r))},handlePaneResize:m=>{const g=m.panes;if(g&&g.length>=2){const b=g[0].size,y=g[1].size;u.value=b,c.value=y,b>n&&!a.value&&(a.value=!0),y>n&&!l.value&&(l.value=!0),b<=s&&a.value&&(a.value=!1),y<=s&&l.value&&(l.value=!1)}}}}const JZ={class:"flex justify-between items-center"},yc=i.defineComponent({__name:"CoreEditorMoblie",props:{isMobile:{type:Boolean},superTextArea:{default:{view:!0,button:!0}},mode:{},modelValue:{default:""},comment:{default:""},commentCuesheet:{},hideComment:{type:Boolean,default:!1},disableSuperInput:{type:Boolean,default:!1},fontSizeDefault:{default:"14px"},fontFamilyDefault:{default:""},isOpenSuperView:{type:Boolean},output:{default:"html"},dark:{type:Boolean,default:void 0},disabled:{type:Boolean,default:!1},hideToolbar:{type:Boolean,default:!1},isShowFormatControlBar:{type:Boolean,default:!1},titleBarComment:{default:null},titleBarContent:{default:null},fieldNameComment:{default:null},fieldNameCommentCuesheet:{},fieldNameContent:{default:null},fieldNameSuper:{},isScreenSplit:{default:!1},isShowLineNumber:{type:Boolean,default:!1},hideMenubar:{type:Boolean},disableBubble:{type:Boolean,default:!1},hideBubble:{type:Boolean,default:!1},maxWidth:{default:void 0},minHeight:{default:200},maxHeight:{default:void 0},height:{default:void 0},extensions:{default:()=>[]},editorClass:{default:void 0},contentClass:{default:void 0},isCompare:{type:Boolean},autoHeight:{type:Boolean},textAlert:{},toolBarClass:{default:void 0},readonly:{type:Boolean,default:!1},canEditSuperReadOnly:{type:Boolean},autoFocus:{type:Boolean,default:!0},superPreviewCustomClass:{},minChar:{},isAccordion:{type:Boolean},contentAutoCopied:{}},emits:["enter","change","update:modelValue","update:comment","onFocusEditor","changed:selection","setEditorSelected","onBlurEditor","lineFocus","onFocus","onBlur"],setup(t,{expose:e,emit:n}){var D;const r=t,o=n,s=new qS;i.provide("isMobile",!0);const a=gt.useEventBus(ir.INCREASE_DECREASE_FONTSIZE),l=i.useAttrs(),u=wn(),{state:c,isFullscreen:f,isReady:p,editor:m,updateEditorState:g,checkSpellStore:b,setImageAttachment:y,setEditorContentMobile:w}=u,{markAsFocused:x,insertHtml:E}=cZ(),S=i.ref(!r.disabled&&!r.readonly);i.provide("isEditable",S);const C=i.computed(()=>[...c.extensions,...nt.differenceBy(r.extensions,c.extensions,"name")].map(($,Q)=>$.configure({sort:Q}))),_=i.ref(r.fontSizeDefault),T=i.ref(r.fontFamilyDefault);i.provide("fontSize",_),i.provide("fontFamily",T);const A=i.computed(()=>({fontFamily:T.value,fontSize:_.value})),L=i.ref(),{height:I}=gt.useWindowSize(),M=i.computed(()=>{var Q;if(P.value)return{bottom:"15px"};const $=((Q=L.value)==null?void 0:Q.getBoundingClientRect().bottom)||0;return{bottom:`${I.value-$+10}px`}}),W=$=>{const Q=parseInt(_.value||"12px"),Ce=$?Q+2:Q-2;_.value=Ce+"px"};i.onBeforeMount(()=>{a.on(W)}),i.onBeforeUnmount(()=>{a.off(W)});const j=i.computed(()=>({...i.unref(f)?{height:"100%"}:{minHeight:r.minHeight?an(r.minHeight):void 0,maxHeight:r.maxHeight?an(r.maxHeight):void 0,height:r.height?an(r.height):void 0},maxWidth:an(r.maxWidth),width:r.maxWidth?"100%":void 0,margin:r.maxWidth?"0 auto":void 0})),K=new ei({enablePasteRules:!1,enableInputRules:!1,content:Dn(r.modelValue,r.disabled,r.mode),editorProps:{handleKeyDown:nt.throttle(($,Q)=>Q.key==="Enter"&&l.enter&&!Q.shiftKey?(o("enter"),!0):!1,_o),transformPastedHTML:$=>($=$.replace(/\s*style="[^"]*"/g,""),$),handlePaste($,Q){var ee;if(r.mode!==Fe.PLAIN_TEXT)return!1;Q.preventDefault();const Ce=((ee=Q.clipboardData)==null?void 0:ee.getData("text/plain"))||"",{tr:je,selection:$e}=$.state;return $.dispatch(je.insertText(Ce,$e.from)),!0}},onCreate:({editor:$})=>{g($)},onUpdate:nt.throttle(({editor:$})=>{p.value=!0;const Q=xe($,r.output);o("update:modelValue",Q),o("change",{editor:$,output:Q}),g($),se($)},_o),extensions:nt.uniqBy(nt.reverse(i.unref(C)),"name"),editable:S.value,onFocus:$=>{ne(),o("onFocus",$),x()},onBlur:$=>o("onBlur",$),parseOptions:{preserveWhitespace:"full"}});function se($){const Q=[];$.state.doc.descendants(Ce=>{Ce.type.name==="image"&&Q.push({id:Ce.attrs.id,src:Ce.attrs.src})}),y(Q)}const z=i.ref(),V=i.ref(!0),P=i.ref(!1);function q(){s.isNativeWebViewAvailable()&&(s.receiveDataFromNative("keyboardDidShow",$=>{P.value=!0}),s.receiveDataFromNative("keyboardDidHide",$=>{P.value=!1}))}function J($){const Q=document.querySelectorAll('[contenteditable="true"]:not(.tiptap), .simple-editor, input, textarea'),Ce=Array.from(Q).some(je=>je.contains($.target));if($.type==="focusout"){V.value=!0;return}V.value=!Ce}gt.useEventListener(document,"focusin",J),gt.useEventListener(document,"focusout",J),i.onMounted(()=>{ne(K),w(K),q()});const Y=i.computed(()=>r.isShowFormatControlBar&&V.value&&!P.value);function ne($){z.value=$??K,u.setEditorSelectedMobile(z.value)}const we=i.computed(()=>{const $=z.value.view.dom.dataset.disableSuperInput&&JSON.parse(z.value.view.dom.dataset.disableSuperInput);return z.value.storage.superText.isShowSuperInputMoblie&&!$});function xe($,Q){if(!$)return"";if($.isEmpty)return Q==="json"?{}:"";if(r.mode===Fe.PLAIN_TEXT)return $.getText({blockSeparator:`
303
303
  `});switch(Q){case"html":return $.getHTML();case"json":return $.getJSON();case"text":return $.getText({blockSeparator:`
304
- `});default:return""}}function Ve($){return $.every(Q=>K==null?void 0:K.extensionManager.extensions.find(Ce=>Ce.name===Q))}i.watch(()=>b.languages,()=>{K.commands.checkSpelling()}),i.watch(()=>r.modelValue,$=>{if(!K||nt.isEqual(xe(K,r.output),$))return;const{from:Q,to:Ce}=K.state.selection;K.commands.setTextSelection({from:Q,to:Ce}),K.commands.setContent(Dn($,r.disabled,r.mode),!1,{preserveWhitespace:"full"})},{deep:!0}),i.watch([()=>r.disabled,()=>r.readonly],()=>{S.value=!r.disabled&&!r.readonly},{immediate:!0}),i.watch(()=>S.value,$=>{var Q;K==null||K.setEditable($),(Q=K==null?void 0:K.commands)!=null&&Q.setIsEnableSuggestion&&K.commands.setIsEnableSuggestion($)},{immediate:!0}),i.watch(()=>m.value,()=>{m.value&&m.value.on("selectionUpdate",({editor:$})=>{o("changed:selection",{editor:$})})}),i.onUnmounted(()=>{var $;K==null||K.destroy(),($=z.value)==null||$.destroy()}),Xu(Su.SAVE,()=>{localStorage.setItem("content",xe(K,"html"))});const Se=$=>{var Ce;const Q=z.value??K;if(Q){const{from:je}=Q.view.state.selection;Q.commands.insertContentAt(je,{type:"superText",attrs:{"data-id":li(6),"data-text":$}})}(Ce=z.value)==null||Ce.commands.toggleSuperInputMoblie()},We=$=>{var Ce;const Q=z.value??K;if(Q){const{from:je}=Q.view.state.selection;Q.commands.insertContentAt(je,{type:"configPlan",attrs:{"data-id":li(6),"data-text":$}})}(Ce=z.value)==null||Ce.commands.toggleConfigPlanInput()};function Z($){$===Fe.STRAIGHT&&K.commands.focus("end"),$===Fe.EDITOR&&K.commands.focus("end")}i.onMounted(()=>{var $;r.autoFocus&&Z(r.mode),($=K==null?void 0:K.commands)!=null&&$.setIsMobile&&K.commands.setIsMobile(!0)}),i.watch(()=>r.mode,$=>{r.autoFocus&&Z($)});const re=(D=K.extensionManager.extensions.find($=>$.name==="superText"))==null?void 0:D.options.bottomSheetComponent,le=i.computed(()=>{const $=r.mode===Fe.REPORT,Q=r.mode===Fe.EDITOR&&r.isScreenSplit,Ce=!r.hideComment;return($||Q)&&Ce}),ue=i.computed(()=>!le.value),{HEADER_ONLY_SIZE:me,pane1ContentVisible:N,pane2ContentVisible:be,pane1Size:Ie,pane2Size:Ue,togglePane:mt,handlePaneResize:St}=XS(ue);function H(){if(!r.contentAutoCopied)return;const $=pT(r.contentAutoCopied,".super-text");E(K,$)}return e({editor:K}),($,Q)=>{var kt,Ut,Ur,ie,Me,He;const Ce=KS,je=Yp,$e=Xp,ee=Gp,ge=Of,ce=jS,ye=$Z,ze=Ft,ot=yn;return i.openBlock(),i.createElementBlock(i.Fragment,null,[z.value?(i.openBlock(),i.createElementBlock("div",{key:0,id:"vdc-editor",ref_key:"editorRef",ref:L,style:i.normalizeStyle(j.value),class:i.normalizeClass(i.unref(Te)("vdc-editor mobile relative w-full flex flex-col",!r.height&&"flex-1",$.editorClass,$.disabled&&"disabled",$.mode!==i.unref(Fe).EDITOR&&$.isShowLineNumber&&"editor-line"))},[!$.hideBubble&&!$.disabled&&S.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createVNode(Ce,{editor:i.unref(K),mode:$.mode},null,8,["editor","mode"]),Ve([i.unref(uc)])?(i.openBlock(),i.createBlock(je,{key:0,editor:i.unref(K)},null,8,["editor"])):i.createCommentVNode("",!0),Ve([i.unref(sa)])?(i.openBlock(),i.createBlock($e,{key:1,editor:i.unref(K)},null,8,["editor"])):i.createCommentVNode("",!0),Ve([i.unref(us)])?(i.openBlock(),i.createBlock(ee,{key:2,editor:i.unref(K)},null,8,["editor"])):i.createCommentVNode("",!0),Ve([i.unref(cs),i.unref(ds)])?(i.openBlock(),i.createBlock(ge,{key:3,editor:i.unref(K)},null,8,["editor"])):i.createCommentVNode("",!0)],64)):i.createCommentVNode("",!0),$.hideToolbar?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(ce,{key:1,editor:z.value,mode:$.mode,disabled:$.disabled,class:i.normalizeClass(["mb-[3px]",$.toolBarClass]),"active-extensions":$.mode===i.unref(Fe).EDITOR?[cc]:void 0},null,8,["editor","mode","disabled","class","active-extensions"])),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[$.isShowFormatControlBar?(i.openBlock(),i.createElementBlock("div",{key:0,style:i.normalizeStyle(M.value),class:"fixed left-5 right-5 z-[12]"},[i.createVNode(ye,{editor:z.value,mode:$.mode,disabled:!S.value||$.disabled,style:i.normalizeStyle({visibility:V.value?"visible":"hidden"})},null,8,["editor","mode","disabled","style"])],4)):i.createCommentVNode("",!0)])),i.createVNode(i.unref(Gb),{class:i.normalizeClass(i.unref(Te)("flex-1 basis-0 flex-col",Y.value&&"pb-16")),style:i.normalizeStyle({...A.value}),horizontal:"",onResize:i.unref(St)},{default:i.withCtx(()=>[le.value?(i.openBlock(),i.createBlock(i.unref(ha),{key:0,size:i.unref(Ie),"min-size":i.unref(me),class:"flex flex-col"},{default:i.withCtx(()=>{var it,at;return[(it=$.titleBarComment)!=null&&it.title?(i.openBlock(),i.createBlock(GS,{key:0,"title-bar":$.titleBarComment,class:"mb-[3px]"},null,8,["title-bar"])):i.createCommentVNode("",!0),(at=$.fieldNameComment)!=null&&at.label?(i.openBlock(),i.createElementBlock("div",{key:1,onClick:Q[0]||(Q[0]=un=>i.unref(mt)("pane1")),class:i.normalizeClass(i.unref(Te)("flex justify-between items-center py-1.5 mb-1 active:bg-ed-accent",!$.isAccordion&&"pointer-events-none"))},[i.createVNode(Qp,{"field-name":$.fieldNameComment,mode:$.mode},null,8,["field-name","mode"]),$.isAccordion?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(i.unref(N)?i.unref(a1):i.unref(Zu)),{key:0,class:"h-5 w-5"})):i.createCommentVNode("",!0)],2)):i.createCommentVNode("",!0),i.withDirectives(i.createElementVNode("div",{class:i.normalizeClass(i.unref(Te)("flex-1 !overflow-y-auto basis-0 flex h-full flex-col",$.contentClass))},[i.createVNode(XZ,{ref:"editorCommentRef",mode:$.mode,extensions:$.extensions,"model-value":r.comment,disabled:r.disabled,"disable-super-input":$.disableSuperInput,"field-name-comment":$.fieldNameComment,"is-show-format-control-bar":$.isShowFormatControlBar,"auto-focus":$.autoFocus,"onUpdate:modelValue":Q[1]||(Q[1]=un=>o("update:comment",un)),onSetEditorSelected:ne},null,8,["mode","extensions","model-value","disabled","disable-super-input","field-name-comment","is-show-format-control-bar","auto-focus"])],2),[[i.vShow,i.unref(N)]])]}),_:1},8,["size","min-size"])):i.createCommentVNode("",!0),i.createVNode(i.unref(ha),{size:i.unref(Ue),"min-size":i.unref(me),class:"flex flex-col"},{default:i.withCtx(()=>{var it,at;return[(it=$.titleBarContent)!=null&&it.title?(i.openBlock(),i.createBlock(GS,{key:0,"title-bar":$.titleBarContent,class:"mb-[3px]"},null,8,["title-bar"])):i.createCommentVNode("",!0),i.createElementVNode("div",JZ,[(at=$.fieldNameContent)!=null&&at.label?(i.openBlock(),i.createElementBlock("div",{key:0,onClick:Q[2]||(Q[2]=un=>i.unref(mt)("pane2")),class:i.normalizeClass(i.unref(Te)("flex justify-between items-center py-1.5 mb-1 active:bg-ed-accent flex-1",!$.isAccordion&&"pointer-events-none"))},[i.createVNode(Qp,{"field-name":$.fieldNameContent,mode:$.mode},null,8,["field-name","mode"]),$.isAccordion?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(i.unref(be)?i.unref(a1):i.unref(Zu)),{key:0,class:"h-5 w-5"})):i.createCommentVNode("",!0)],2)):i.createCommentVNode("",!0),$.contentAutoCopied?(i.openBlock(),i.createBlock(ot,{key:1,disabled:i.unref(vb)($.contentAutoCopied),onClick:H,variant:"ghost",class:"w-fit h-fit p-0 gap-x-1 label-large text-blue-500"},{default:i.withCtx(()=>[i.createVNode(ze,{name:"autoCopy",class:"size-5"}),Q[6]||(Q[6]=i.createTextVNode("자동복사"))]),_:1},8,["disabled"])):i.createCommentVNode("",!0)]),i.withDirectives(i.createElementVNode("div",{class:i.normalizeClass(i.unref(Te)("flex-1 !overflow-y-auto basis-0 flex flex-col",$.contentClass))},[i.createVNode(i.unref(So),{id:"editor-panel",editor:i.unref(K),spellcheck:"true",class:i.normalizeClass(["flex-1 flex-col relative break-all",$.mode===i.unref(Fe).PLAIN_TEXT&&"plain-text"])},null,8,["editor","class"])],2),[[i.vShow,i.unref(be)]])]}),_:1},8,["size","min-size"])]),_:1},8,["class","style","onResize"])],6)):i.createCommentVNode("",!0),(kt=z.value)!=null&&kt.storage.superText&&i.unref(re)?(i.openBlock(),i.createBlock(KZ,{key:1,open:we.value,editor:z.value,"bottom-sheet-component":i.unref(re),onClose:Q[3]||(Q[3]=it=>z.value.commands.toggleSuperInputMoblie()),onSave:Se},null,8,["open","editor","bottom-sheet-component"])):(Ut=z.value)!=null&&Ut.storage.superText?(i.openBlock(),i.createBlock(Ap,{key:2,open:we.value,"is-view-mode":!((Ur=z.value)!=null&&Ur.storage.superText.isShowSuperInputMoblie),editor:z.value,onClose:Q[4]||(Q[4]=it=>z.value.commands.toggleSuperInputMoblie()),onSave:Se},null,8,["open","is-view-mode","editor"])):i.createCommentVNode("",!0),(ie=z.value)!=null&&ie.storage.configPlan?(i.openBlock(),i.createBlock(Ap,{key:3,open:(Me=z.value)==null?void 0:Me.storage.configPlan.isShowConfigPlanInput,"is-view-mode":!((He=z.value)!=null&&He.storage.configPlan.isShowConfigPlanInput),editor:z.value,title:$.$t("editor.configPlan"),onClose:Q[5]||(Q[5]=it=>z.value.commands.toggleConfigPlanInput()),onSave:We},null,8,["open","is-view-mode","editor","title"])):i.createCommentVNode("",!0)],64)}}}),ZZ=i.defineComponent({__name:"ArticleEditor",props:{mode:{default:Fe.STRAIGHT},isMobile:{type:Boolean},superTextArea:{},modelValue:{},comment:{},commentCuesheet:{},hideComment:{type:Boolean},disableSuperInput:{type:Boolean},fontSizeDefault:{},fontFamilyDefault:{},isOpenSuperView:{type:Boolean},output:{},dark:{type:Boolean},disabled:{type:Boolean},hideToolbar:{type:Boolean},isShowFormatControlBar:{type:Boolean},titleBarComment:{},titleBarContent:{},fieldNameComment:{},fieldNameCommentCuesheet:{},fieldNameContent:{},fieldNameSuper:{},isScreenSplit:{},isShowLineNumber:{type:Boolean},hideMenubar:{type:Boolean},disableBubble:{type:Boolean},hideBubble:{type:Boolean},maxWidth:{},minHeight:{},maxHeight:{},height:{},extensions:{},editorClass:{},contentClass:{},isCompare:{type:Boolean},autoHeight:{type:Boolean},textAlert:{},toolBarClass:{},readonly:{type:Boolean},canEditSuperReadOnly:{type:Boolean},autoFocus:{type:Boolean,default:!0},superPreviewCustomClass:{},minChar:{},isAccordion:{type:Boolean},contentAutoCopied:{}},setup(t){const e=t,n=wn();return i.onMounted(()=>{n.setTextAlert(e.textAlert||"")}),(r,o)=>e.isMobile?(i.openBlock(),i.createBlock(yc,i.mergeProps({key:1},e,{"onUpdate:modelValue":o[2]||(o[2]=s=>r.$emit("update:modelValue",s)),"onUpdate:comment":o[3]||(o[3]=s=>r.$emit("update:comment",s))}),null,16)):(i.openBlock(),i.createBlock(Zp,i.mergeProps({key:0},e,{"onUpdate:modelValue":o[0]||(o[0]=s=>r.$emit("update:modelValue",s)),"onUpdate:comment":o[1]||(o[1]=s=>r.$emit("update:comment",s))}),null,16))}}),QZ=i.defineComponent({__name:"DigitalNewsEditor",props:{mode:{default:Fe.EDITOR},isMobile:{type:Boolean},superTextArea:{},modelValue:{},comment:{},commentCuesheet:{},hideComment:{type:Boolean},disableSuperInput:{type:Boolean},fontSizeDefault:{},fontFamilyDefault:{},isOpenSuperView:{type:Boolean},output:{},dark:{type:Boolean},disabled:{type:Boolean},hideToolbar:{type:Boolean},isShowFormatControlBar:{type:Boolean},titleBarComment:{},titleBarContent:{},fieldNameComment:{},fieldNameCommentCuesheet:{},fieldNameContent:{},fieldNameSuper:{},isScreenSplit:{},isShowLineNumber:{type:Boolean},hideMenubar:{type:Boolean},disableBubble:{type:Boolean},hideBubble:{type:Boolean},maxWidth:{},minHeight:{},maxHeight:{},height:{},extensions:{},editorClass:{},contentClass:{},isCompare:{type:Boolean},autoHeight:{type:Boolean},textAlert:{},toolBarClass:{},readonly:{type:Boolean},canEditSuperReadOnly:{type:Boolean},autoFocus:{type:Boolean,default:!0},superPreviewCustomClass:{},minChar:{},isAccordion:{type:Boolean},contentAutoCopied:{}},setup(t){const e=t;return(n,r)=>{const o=Zp,s=yc;return e.isMobile?(i.openBlock(),i.createBlock(s,i.mergeProps({key:1},e,{"onUpdate:modelValue":r[1]||(r[1]=a=>n.$emit("update:modelValue",a)),"onUpdate:comment":r[2]||(r[2]=a=>n.$emit("update:comment",a))}),null,16)):(i.openBlock(),i.createBlock(o,i.mergeProps({key:0},e,{"onUpdate:modelValue":r[0]||(r[0]=a=>n.$emit("update:modelValue",a))}),null,16))}}});var YS={exports:{}};(function(t){(function(){function e(z){return z===">"}function n(z){return z==="<"}function r(z){return/^\s+$/.test(z)}function o(z){var V=z.match(/^\s*<([^!>][^>]*)>\s*$/);return!!V&&V[1].trim().split(" ")[0]}function s(z){return!o(z)}function a(z){return/^<!--/.test(z)}function l(z){return/--\>$/.test(z)}var u,c=new RegExp("^<(iframe|object|math|svg|script|video|head|style|a)");function f(z){var V=u.exec(z);return V&&V[1]}function p(z,V){return z.substring(z.length-V.length-2)==="</"+V}function m(z){return/^\s*<[^>]+\/>\s*$/.test(z)}function g(z){var V=/^<img[\s>]/.test(z);return V||s(z)||f(z)||m(z)}function b(z){return{string:z,key:x(z)}}function y(z,V,P,q){this.segment=q,this.length=P,this.startInBefore=z+q.beforeIndex,this.startInAfter=V+q.afterIndex,this.endInBefore=this.startInBefore+this.length-1,this.endInAfter=this.startInAfter+this.length-1,this.segmentStartInBefore=z,this.segmentStartInAfter=V,this.segmentEndInBefore=this.segmentStartInBefore+this.length-1,this.segmentEndInAfter=this.segmentStartInAfter+this.length-1}function w(z){for(var V="char",P="",q="",J=[],Y=0;Y<z.length;Y++){var ne=z[Y];switch(V){case"tag":var we=f(P);we?(V="atomic_tag",q=we,P+=ne):a(P)?(V="html_comment",P+=ne):e(ne)?(P+=">",J.push(b(P)),P="",r(ne)?V="whitespace":V="char"):P+=ne;break;case"atomic_tag":e(ne)&&p(P,q)?(P+=">",J.push(b(P)),P="",q="",V="char"):P+=ne;break;case"html_comment":P+=ne,l(P)&&(P="",V="char");break;case"char":n(ne)?(P&&J.push(b(P)),P="<",V="tag"):/\s/.test(ne)?(P&&J.push(b(P)),P=ne,V="whitespace"):/[\w\d\#@]/.test(ne)?P+=ne:/&/.test(ne)?(P&&J.push(b(P)),P=ne):(P+=ne,J.push(b(P)),P="");break;case"whitespace":n(ne)?(P&&J.push(b(P)),P="<",V="tag"):r(ne)?P+=ne:(P&&J.push(b(P)),P=ne,V="char");break;default:throw new Error("Unknown mode "+V)}}return P&&J.push(b(P)),J}function x(z){var V=/^<img.*src=['"]([^"']*)['"].*>$/.exec(z);if(V)return'<img src="'+V[1]+'">';var P=/^<a.*href=['"]([^"']*)['"]/.exec(z);if(P)return'<a href="'+P[1]+'"></a>';var q=/^<object.*data=['"]([^"']*)['"]/.exec(z);if(q)return'<object src="'+q[1]+'"></object>';if(/^<(svg|math|video)[\s>]/.test(z)){var J=z.indexOf('data-uuid="');if(J!==-1){var Y=z.slice(0,J),ne=z.slice(J+44);return Y+ne}else return z}var we=/^<iframe.*src=['"]([^"']*)['"].*>/.exec(z);if(we)return'<iframe src="'+we[1]+'"></iframe>';var xe=/<([^\s>]+)[\s>]/.exec(z);return xe?"<"+xe[1].toLowerCase()+">":z&&z.replace(/(\s+|&nbsp;|&#160;)/g," ")}function E(z){return z.reduce(function(V,P,q){return V[P.key]?V[P.key].push(q):V[P.key]=[q],V},Object.create(null))}function S(z,V){return V.endInBefore<z.startInBefore&&V.endInAfter<z.startInAfter?-1:V.startInBefore>z.endInBefore&&V.startInAfter>z.endInAfter?1:0}function C(){this._root=null}C.prototype={add:function(z){var V={value:z,left:null,right:null},P=this._root;if(P)for(;;){var q=S(P.value,z);if(q===-1)if(P.left)P=P.left;else{P.left=V;break}else if(q===1)if(P.right)P=P.right;else{P.right=V;break}else break}else this._root=V},toArray:function(){function z(V,P){return V&&(z(V.left,P),P.push(V.value),z(V.right,P)),P}return z(this._root,[])}};function _(z){for(var V=z.beforeTokens,P=z.afterMap,q=null,J=null,Y=0;Y<V.length;Y++){var ne=!1,we=V.length-Y;if(J&&we<J.length)break;var xe=V[Y];if(xe.key===" "){q=Y;continue}q===Y-1&&(ne=!0);var Ve=P[xe.key];Ve&&Ve.forEach(function(Se){var We=J?J.length:0,Z=T(z,Y,Se,We,ne);Z&&Z.length>We&&(J=Z)})}return J}function T(z,V,P,q,J){var Y=z.beforeTokens,ne=z.afterTokens,we=V+q,xe=P+q;if(!(we>=Y.length||xe>=ne.length)){if(q){var Ve=Y[we].key,Se=ne[xe].key;if(Ve!==Se)return}for(var We=!0,Z=1,re=V+Z,le=P+Z;We&&re<Y.length&&le<ne.length;){var ue=Y[re].key,me=ne[le].key;ue===me?(Z++,re=V+Z,le=P+Z):We=!1}if(J&&V>0&&P>0){var N=Y[V-1].key,be=ne[P-1].key;N===" "&&be===" "&&(V--,P--,Z++)}return new y(V,P,Z,z)}}function A(z,V,P,q){return{beforeTokens:z,afterTokens:V,beforeMap:E(z),afterMap:E(V),beforeIndex:P,afterIndex:q}}function L(z){for(var V=new C,P,q=[z];q.length;)if(z=q.pop(),P=_(z),P&&P.length){if(P.segmentStartInBefore>0&&P.segmentStartInAfter>0){var J=z.beforeTokens.slice(0,P.segmentStartInBefore),Y=z.afterTokens.slice(0,P.segmentStartInAfter);q.push(A(J,Y,z.beforeIndex,z.afterIndex))}var ne=z.beforeTokens.slice(P.segmentEndInBefore+1),we=z.afterTokens.slice(P.segmentEndInAfter+1),xe=z.beforeIndex+P.segmentEndInBefore+1,Ve=z.afterIndex+P.segmentEndInAfter+1;ne.length&&we.length&&q.push(A(ne,we,xe,Ve)),V.add(P)}return V.toArray()}function I(z,V){if(!z)throw new Error("Missing beforeTokens");if(!V)throw new Error("Missing afterTokens");var P=0,q=0,J=[],Y=A(z,V,0,0),ne=L(Y);ne.push(new y(z.length,V.length,0,Y));for(var we=0;we<ne.length;we++){var xe=ne[we],Ve="none";P===xe.startInBefore?q!==xe.startInAfter&&(Ve="insert"):(Ve="delete",q!==xe.startInAfter&&(Ve="replace")),Ve!=="none"&&J.push({action:Ve,startInBefore:P,endInBefore:Ve!=="insert"?xe.startInBefore-1:null,startInAfter:q,endInAfter:Ve!=="delete"?xe.startInAfter-1:null}),xe.length!==0&&J.push({action:"equal",startInBefore:xe.startInBefore,endInBefore:xe.endInBefore,startInAfter:xe.startInAfter,endInAfter:xe.endInAfter}),P=xe.endInBefore+1,q=xe.endInAfter+1}var Se=[],We={action:"none"};function Z(ue){return ue.action!=="equal"||ue.endInBefore-ue.startInBefore!==0?!1:/^\s$/.test(z.slice(ue.startInBefore,ue.endInBefore+1))}for(var re=0;re<J.length;re++){var le=J[re];Z(le)&&We.action==="replace"||le.action==="replace"&&We.action==="replace"?(We.endInBefore=le.endInBefore,We.endInAfter=le.endInAfter):(Se.push(le),We=le)}return Se}function M(z){this.tokens=z,this.notes=z.reduce(function(V,P,q){V.notes.push({isWrappable:g(P),insertedTag:!1});var J=!m(P)&&o(P),Y=V.tagStack[V.tagStack.length-1];return J&&(Y&&"/"+Y.tag===J?(V.notes[Y.position].insertedTag=!0,V.tagStack.pop()):V.tagStack.push({tag:J,position:q})),V},{notes:[],tagStack:[]}).notes}M.prototype.combine=function(z,V){var P=this.notes,q=this.tokens.slice(),J=q.reduce(function(Y,ne,we){P[we].insertedTag&&(q[we]=V(q[we])),Y.status===null&&(Y.status=P[we].isWrappable);var xe=P[we].isWrappable;return xe!==Y.status&&(Y.list.push({isWrappable:Y.status,tokens:q.slice(Y.lastIndex,we)}),Y.lastIndex=we,Y.status=xe),we===q.length-1&&Y.list.push({isWrappable:Y.status,tokens:q.slice(Y.lastIndex,we+1)}),Y},{list:[],status:null,lastIndex:0}).list;return J.map(z).join("")};function W(z,V,P,q,J){var Y=new M(V);q=q?q+"-":"";var ne=" data-"+q+'operation-index="'+P+'"';return J&&(ne+=' class="'+J+'"'),Y.combine(function(we){if(we.isWrappable){var xe=we.tokens.join("");if(xe.trim())return"<"+z+ne+">"+xe+"</"+z+">"}else return we.tokens.join("");return""},function(we){var xe=' data-diff-node="'+z+'"';return xe+=" data-"+q+'operation-index="'+P+'"',we.replace(/>\s*$/,xe+"$&")})}var j={equal:function(z,V,P,q,J,Y){var ne=P.slice(z.startInAfter,z.endInAfter+1);return ne.reduce(function(we,xe){return we+xe.string},"")},insert:function(z,V,P,q,J,Y){var ne=P.slice(z.startInAfter,z.endInAfter+1),we=ne.map(function(xe){return xe.string});return W("ins",we,q,J,Y)},delete:function(z,V,P,q,J,Y){var ne=V.slice(z.startInBefore,z.endInBefore+1),we=ne.map(function(xe){return xe.string});return W("del",we,q,J,Y)},replace:function(){return j.delete.apply(null,arguments)+j.insert.apply(null,arguments)}};function K(z,V,P,q,J){return P.reduce(function(Y,ne,we){return Y+j[ne.action](ne,z,V,we,q,J)},"")}function se(z,V,P,q,J){if(z===V)return z;J?u=new RegExp("^<("+J.replace(/\s*/g,"").replace(/,/g,"|")+")"):u=c,z=w(z),V=w(V);var Y=I(z,V);return K(z,V,Y,q,P)}se.htmlToTokens=w,se.findMatchingBlocks=L,L.findBestMatch=_,L.createMap=E,L.createToken=b,L.createSegment=A,L.getKeyForToken=x,se.calculateOperations=I,se.renderOperations=K,t!==null?t.exports=se:this.htmldiff=se}).call(Xa)})(YS);var NZ=YS.exports;const eQ=UB(NZ),JS=(t,e,n)=>{let r="";{const o=Dn(t,n),s=Dn(e,n);r=eQ(o,s,null,null,"button")}return r=r.replace(/<del[^>]*>/g,'<span class="diff-del">').replace(/<\/del>/g,"</span>").replace(/<ins[^>]*>/g,'<mark style="background:#FEF3C7;">').replace(/<\/ins>/g,"</mark>"),r},tQ={key:0,class:"px-2 min-h-[24px] flex items-center justify-between gap-1 mb-1.5"},nQ={class:"flex items-center gap-2"},rQ={class:"body-small text-gray-600 px-[6px] py-[2px] shrink-0 rounded-[4px] bg-gray-100"},oQ={class:"label-large text-gray-800 line-clamp-1"},iQ={class:"flex items-center gap-1 shrink-0"},sQ={class:"mt-[2px]"},aQ={class:"body-small text-gray-400"},lQ={class:"border border-gray-50 rounded-md py-[10px] px-4 flex-1 overflow-y-auto"},uQ={class:"border border-ed-gray rounded-[5px] p-2.5 my-2 h-full"},cQ={key:0,class:"px-2 min-h-[24px] flex items-center justify-between gap-1 mb-1.5"},dQ={class:"flex items-center gap-2"},fQ={class:"body-small text-blue-500 px-[6px] py-[2px] shrink-0 rounded-[4px] bg-blue-50"},pQ={class:"label-large text-gray-800 line-clamp-1"},hQ={class:"flex items-center gap-1 shrink-0"},mQ={class:"mt-[2px]"},gQ={class:"body-small text-gray-400"},bQ={class:"border border-gray-50 bg-dark-blue-600 rounded-md py-[10px] px-4 flex-1 overflow-y-auto"},vQ=To(i.defineComponent({__name:"ArticleCompareEditor",props:{originalData:{},changedData:{},extensions:{},editorClass:{}},setup(t){const e=t,n=i.ref(!1),r=i.computed(()=>!e.originalData||!e.changedData?{comment:"",content:""}:{comment:JS(e.originalData.comment,e.changedData.comment,!0),content:JS(e.originalData.content,e.changedData.content,!0)}),{HEADER_ONLY_SIZE:o,pane1ContentVisible:s,pane2ContentVisible:a,pane1Size:l,pane2Size:u,handlePaneResize:c}=XS(!1,6);return(f,p)=>{const m=Ft;return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(i.unref(Te)("h-full",f.editorClass))},[i.createVNode(i.unref(Gb),{horizontal:"",onResize:i.unref(c)},{default:i.withCtx(()=>[i.createVNode(i.unref(ha),{size:i.unref(l),"min-size":i.unref(o),class:"flex flex-col"},{default:i.withCtx(()=>{var g,b,y,w,x,E,S,C,_,T;return[(b=(g=f.originalData)==null?void 0:g.titleBar)!=null&&b.title?(i.openBlock(),i.createElementBlock("div",tQ,[i.createElementVNode("div",nQ,[i.createElementVNode("div",rQ,i.toDisplayString(f.$t("기준")),1),i.createElementVNode("h3",oQ,i.toDisplayString((w=(y=f.originalData)==null?void 0:y.titleBar)==null?void 0:w.title),1)]),i.createElementVNode("div",iQ,[i.createElementVNode("div",sQ,[i.createVNode(m,{name:"Clock",class:"w-[13px] h-[13px] text-gray-400"})]),i.createElementVNode("div",aQ,i.toDisplayString((E=(x=f.originalData)==null?void 0:x.titleBar)==null?void 0:E.time),1)])])):i.createCommentVNode("",!0),i.withDirectives(i.createElementVNode("div",lQ,[i.createVNode(yc,{"editor-class":"h-full",mode:i.unref(Fe).REPORT,disabled:"","hide-toolbar":"",extensions:f.extensions,"field-name-comment":(S=f.originalData)==null?void 0:S.fieldNameComment,"field-name-content":(C=f.originalData)==null?void 0:C.fieldNameContent,comment:(_=f.originalData)==null?void 0:_.comment,"model-value":(T=f.originalData)==null?void 0:T.content},null,8,["mode","extensions","field-name-comment","field-name-content","comment","model-value"])],512),[[i.vShow,i.unref(s)]])]}),_:1},8,["size","min-size"]),i.unref(n)?(i.openBlock(),i.createBlock(i.unref(ha),{key:0},{default:i.withCtx(()=>{var g,b,y,w;return[i.createElementVNode("div",uQ,[i.createVNode(yc,{"editor-class":"h-full",mode:i.unref(Fe).REPORT,disabled:"","hide-toolbar":"",extensions:f.extensions,"field-name-comment":(g=f.changedData)==null?void 0:g.fieldNameComment,"field-name-content":(b=f.changedData)==null?void 0:b.fieldNameContent,comment:(y=f.changedData)==null?void 0:y.comment,"model-value":(w=f.changedData)==null?void 0:w.content},null,8,["mode","extensions","field-name-comment","field-name-content","comment","model-value"])])]}),_:1})):i.createCommentVNode("",!0),i.createVNode(i.unref(ha),{size:i.unref(u),"min-size":i.unref(o),class:"flex flex-col"},{default:i.withCtx(()=>{var g,b,y,w,x,E,S,C;return[(b=(g=f.changedData)==null?void 0:g.titleBar)!=null&&b.title?(i.openBlock(),i.createElementBlock("div",cQ,[i.createElementVNode("div",dQ,[i.createElementVNode("div",fQ,i.toDisplayString(f.$t("대상")),1),i.createElementVNode("h3",pQ,i.toDisplayString((w=(y=f.changedData)==null?void 0:y.titleBar)==null?void 0:w.title),1)]),i.createElementVNode("div",hQ,[i.createElementVNode("div",mQ,[i.createVNode(m,{name:"Clock",class:"w-[13px] h-[13px] text-gray-400"})]),i.createElementVNode("div",gQ,i.toDisplayString((E=(x=f.changedData)==null?void 0:x.titleBar)==null?void 0:E.time),1)])])):i.createCommentVNode("",!0),i.withDirectives(i.createElementVNode("div",bQ,[i.createVNode(yc,{"editor-class":"h-full",mode:i.unref(Fe).REPORT,disabled:"","hide-toolbar":"",extensions:f.extensions,"field-name-comment":(S=f.changedData)==null?void 0:S.fieldNameComment,"field-name-content":(C=f.changedData)==null?void 0:C.fieldNameContent,comment:i.unref(r).comment,"model-value":i.unref(r).content},null,8,["mode","extensions","field-name-comment","field-name-content","comment","model-value"])],512),[[i.vShow,i.unref(a)]])]}),_:1},8,["size","min-size"])]),_:1},8,["onResize"])],2)}}}),[["__scopeId","data-v-9a3f94c5"]]),ZS=t=>{if(!t)return-1;const{from:e}=t.state.selection;let n=0;return t.state.doc.descendants((r,o)=>{r.type.name===yp&&o<e&&n++}),n},yQ=i.defineComponent({__name:"SuperViewMobileSuperEditor",props:{isMobile:{type:Boolean},superTextArea:{},mode:{},modelValue:{default:""},comment:{},commentCuesheet:{},hideComment:{type:Boolean},disableSuperInput:{type:Boolean,default:!1},fontSizeDefault:{},fontFamilyDefault:{},isOpenSuperView:{type:Boolean},output:{default:"html"},dark:{type:Boolean,default:void 0},disabled:{type:Boolean},hideToolbar:{type:Boolean,default:!1},isShowFormatControlBar:{type:Boolean},titleBarComment:{},titleBarContent:{},fieldNameComment:{},fieldNameCommentCuesheet:{},fieldNameContent:{},fieldNameSuper:{default:null},isScreenSplit:{},isShowLineNumber:{type:Boolean},hideMenubar:{type:Boolean},disableBubble:{type:Boolean,default:!1},hideBubble:{type:Boolean,default:!1},maxWidth:{default:void 0},minHeight:{default:600},maxHeight:{default:void 0},height:{},extensions:{default:()=>[]},editorClass:{},contentClass:{},isCompare:{type:Boolean},autoHeight:{type:Boolean},textAlert:{},toolBarClass:{},readonly:{type:Boolean},canEditSuperReadOnly:{type:Boolean},autoFocus:{type:Boolean},superPreviewCustomClass:{},minChar:{},isAccordion:{type:Boolean},contentAutoCopied:{}},emits:["enter","change","update:modelValue","update:comment","onFocusEditor","changed:selection","setEditorSelected","onBlurEditor","lineFocus","onFocus","onBlur"],setup(t,{expose:e,emit:n}){const r=t,o=n;i.computed(()=>r.mode===Fe.EDITOR);const s=gt.useEventBus(ir.RENDER_SUPER_TEXT),a=wn(),{isReady:l,editor:u,updateEditorState:c,checkSpellStore:f}=a,p=i.ref(!1);i.provide("isEditable",p);const m=i.ref(dw(r.modelValue));function g(C){if(r.disabled||r.readonly)return;const _=ZS(C);o("lineFocus",{lineIndex:_})}function b(){o("lineFocus",{lineIndex:void 0})}const y=new ei({enablePasteRules:!1,enableInputRules:!1,content:m.value,onCreate:({editor:C})=>{c(C)},onUpdate:nt.throttle(({editor:C})=>{l.value=!0;const _=S(C,r.output);o("update:modelValue",_),o("change",{editor:C,output:_}),c(C)},_o),extensions:nt.uniqBy(nt.reverse(i.unref(r.extensions)),"name"),editable:p.value,onFocus:()=>{x(),w.value=!0,g(y)},onBlur:()=>{w.value=!1,b()},onSelectionUpdate:()=>{g(y)}}),w=i.ref(!1);function x(){o("setEditorSelected",y)}function E(){s.emit({action:"render"})}function S(C,_){if(!C)return"";if(C.isEmpty)return _==="json"?{}:"";switch(_){case"html":return C.getHTML();case"json":return C.getJSON();case"text":return C.getText();default:return""}}return i.watch(()=>f.languages,()=>{y.commands.checkSpelling()}),i.watch(()=>r.modelValue,C=>{if(!y||nt.isEqual(S(y,r.output),C))return;const{from:_,to:T}=y.state.selection;y.commands.setTextSelection({from:_,to:T}),E(),m.value=dw(C)},{deep:!0}),i.watch(()=>u.value,()=>{u.value&&u.value.on("selectionUpdate",({editor:C})=>{o("changed:selection",{editor:C})})}),i.watch(()=>r.disableSuperInput,()=>{const C=document.getElementById(nr.COMMENT);C==null||C.setAttribute(nr.DISABLE_SUPER_INPUT,`${r.disableSuperInput}`)}),i.onUnmounted(()=>y==null?void 0:y.destroy()),Jp(y),i.onMounted(()=>{var C,_;(C=y==null?void 0:y.commands)!=null&&C.setIsEnableSuggestion&&y.commands.setIsEnableSuggestion(!1),(_=y==null?void 0:y.commands)!=null&&_.setIsMobile&&y.commands.setIsMobile(!0)}),e({editor:y}),(C,_)=>{var A;const T=Qp;return i.openBlock(),i.createElementBlock(i.Fragment,null,[(A=C.fieldNameSuper)!=null&&A.label?(i.openBlock(),i.createBlock(T,{key:0,"field-name":C.fieldNameSuper,mode:C.mode,disabled:C.disabled,class:"mb-1",intent:"secondary"},null,8,["field-name","mode","disabled"])):i.createCommentVNode("",!0),i.createVNode(i.unref(So),{editor:i.unref(y),spellcheck:"true",class:i.normalizeClass(["flex-1 flex-col"])},null,8,["editor"])],64)}}}),wQ=(t,e)=>{let n=null;return t.state.doc.descendants((r,o)=>{if(r.type.name==="paragraph"&&Number(r.attrs["number-line"])===e)return n={node:r,pos:o},!1}),n},QS="focused-line";async function NS({lineIndex:t,editor:e}){if(e.state.doc.descendants((l,u)=>{if(l.attrs.class===QS){const c=e.state.tr.setNodeMarkup(u,void 0,{...l.attrs,class:""});return e.view.dispatch(c),!1}}),await i.nextTick(),!t)return;const n=wQ(e,t);if(!n)return;const{node:r,pos:o}=n,s=e.state.tr.setNodeMarkup(o,void 0,{...r.attrs,class:QS});e.view.dispatch(s),await i.nextTick(),e.view.nodeDOM(o).scrollIntoView({behavior:"smooth"})}const xQ=i.defineComponent({__name:"SuperViewMobileEditor",props:{isMobile:{type:Boolean},superTextArea:{},mode:{},modelValue:{default:""},comment:{default:""},commentCuesheet:{},hideComment:{type:Boolean},disableSuperInput:{type:Boolean},fontSizeDefault:{default:"12px"},fontFamilyDefault:{default:""},isOpenSuperView:{type:Boolean},output:{default:"html"},dark:{type:Boolean},disabled:{type:Boolean,default:!1},hideToolbar:{type:Boolean,default:!1},isShowFormatControlBar:{type:Boolean},titleBarComment:{},titleBarContent:{},fieldNameComment:{},fieldNameCommentCuesheet:{},fieldNameContent:{default:null},fieldNameSuper:{default:null},isScreenSplit:{},isShowLineNumber:{type:Boolean},hideMenubar:{type:Boolean},disableBubble:{type:Boolean},hideBubble:{type:Boolean,default:!1},maxWidth:{default:void 0},minHeight:{default:200},maxHeight:{default:void 0},height:{default:void 0},extensions:{default:()=>[]},editorClass:{default:void 0},contentClass:{default:void 0},isCompare:{type:Boolean},autoHeight:{type:Boolean},textAlert:{},toolBarClass:{default:void 0},readonly:{type:Boolean,default:!1},canEditSuperReadOnly:{type:Boolean},autoFocus:{type:Boolean},superPreviewCustomClass:{},minChar:{},isAccordion:{type:Boolean},contentAutoCopied:{}},emits:["enter","change","update:modelValue","update:comment","onFocusEditor","changed:selection","setEditorSelected","onBlurEditor","lineFocus","onFocus","onBlur"],setup(t,{expose:e,emit:n}){const r=t,o=n;i.provide("isMobile",!0),i.computed(()=>r.mode===Fe.EDITOR);const s=gt.useEventBus(ir.INCREASE_DECREASE_FONTSIZE);i.useAttrs();const a=wn(),{state:l,isFullscreen:u,isReady:c,editor:f,updateEditorState:p,checkSpellStore:m}=a,g=i.ref(!1);i.provide("isEditable",g);const b=i.ref(void 0),y=i.ref(),w=i.computed(()=>[...l.extensions,...nt.differenceBy(r.extensions,l.extensions,"name")].map((V,P)=>V.configure({sort:P}))),x=i.ref(r.fontSizeDefault),E=i.ref(r.fontFamilyDefault);i.provide("fontSize",x),i.provide("fontFamily",E);const S=i.computed(()=>({fontFamily:E.value,fontSize:x.value})),C=i.ref(),_=V=>{const P=parseInt(x.value||"12px"),q=V?P+2:P-2;x.value=q+"px"};i.onBeforeMount(()=>{s.on(_)}),i.onBeforeUnmount(()=>{s.off(_)});const T=i.computed(()=>({...i.unref(u)?{height:"100%"}:{minHeight:r.minHeight?an(r.minHeight):void 0,maxHeight:r.maxHeight?an(r.maxHeight):void 0,height:r.height?an(r.height):void 0},maxWidth:an(r.maxWidth),width:r.maxWidth?"100%":void 0,margin:r.maxWidth?"0 auto":void 0}));function A(V){if(r.disabled||r.readonly)return;const P=ZS(V);b.value=P}function L(){b.value=void 0}const I=new ei({enablePasteRules:!1,enableInputRules:!1,content:Dn(r.modelValue,r.disabled,r.mode),onCreate:({editor:V})=>{p(V)},onUpdate:nt.throttle(({editor:V})=>{c.value=!0;const P=se(V,r.output);o("update:modelValue",P),o("change",{editor:V,output:P}),p(V)},_o),extensions:nt.uniqBy(nt.reverse(i.unref(w)),"name"),editable:g.value,onFocus:()=>{K(),M.value=!0,A(I)},onBlur:()=>{M.value=!1,L()},onSelectionUpdate:()=>{A(I)}}),M=i.ref(!1),W=i.ref();i.onMounted(()=>{W.value=I});const j=({lineIndex:V})=>{var q;I&&NS({lineIndex:V,editor:I});const P=(q=y.value)==null?void 0:q.editor;P&&NS({lineIndex:V,editor:P})};i.watch(()=>b.value,V=>{o("lineFocus",{lineIndex:V}),j({lineIndex:V})},{immediate:!0});function K(V){W.value=I}function se(V,P){if(!V)return"";if(V.isEmpty)return P==="json"?{}:"";switch(P){case"html":return V.getHTML();case"json":return V.getJSON();case"text":return V.getText({blockSeparator:`
304
+ `});default:return""}}function Ve($){return $.every(Q=>K==null?void 0:K.extensionManager.extensions.find(Ce=>Ce.name===Q))}i.watch(()=>b.languages,()=>{K.commands.checkSpelling()}),i.watch(()=>r.modelValue,$=>{if(!K||nt.isEqual(xe(K,r.output),$))return;const{from:Q,to:Ce}=K.state.selection;K.commands.setTextSelection({from:Q,to:Ce}),K.commands.setContent(Dn($,r.disabled,r.mode),!1,{preserveWhitespace:"full"})},{deep:!0}),i.watch([()=>r.disabled,()=>r.readonly],()=>{S.value=!r.disabled&&!r.readonly},{immediate:!0}),i.watch(()=>S.value,$=>{var Q;K==null||K.setEditable($),(Q=K==null?void 0:K.commands)!=null&&Q.setIsEnableSuggestion&&K.commands.setIsEnableSuggestion($)},{immediate:!0}),i.watch(()=>m.value,()=>{m.value&&m.value.on("selectionUpdate",({editor:$})=>{o("changed:selection",{editor:$})})}),i.onUnmounted(()=>{var $;K==null||K.destroy(),($=z.value)==null||$.destroy()}),Xu(Su.SAVE,()=>{localStorage.setItem("content",xe(K,"html"))});const Se=$=>{var Ce;const Q=z.value??K;if(Q){const{from:je}=Q.view.state.selection;Q.commands.insertContentAt(je,{type:"superText",attrs:{"data-id":li(6),"data-text":$}})}(Ce=z.value)==null||Ce.commands.toggleSuperInputMoblie()},We=$=>{var Ce;const Q=z.value??K;if(Q){const{from:je}=Q.view.state.selection;Q.commands.insertContentAt(je,{type:"configPlan",attrs:{"data-id":li(6),"data-text":$}})}(Ce=z.value)==null||Ce.commands.toggleConfigPlanInput()};function Z($){$===Fe.STRAIGHT&&K.commands.focus("end"),$===Fe.EDITOR&&K.commands.focus("end")}i.onMounted(()=>{var $;r.autoFocus&&Z(r.mode),($=K==null?void 0:K.commands)!=null&&$.setIsMobile&&K.commands.setIsMobile(!0)}),i.watch(()=>r.mode,$=>{r.autoFocus&&Z($)});const re=(D=K.extensionManager.extensions.find($=>$.name==="superText"))==null?void 0:D.options.bottomSheetComponent,le=i.computed(()=>{const $=r.mode===Fe.REPORT,Q=r.mode===Fe.EDITOR&&r.isScreenSplit,Ce=!r.hideComment;return($||Q)&&Ce}),ue=i.computed(()=>!le.value),{HEADER_ONLY_SIZE:me,pane1ContentVisible:N,pane2ContentVisible:be,pane1Size:Ie,pane2Size:Ue,togglePane:mt,handlePaneResize:St}=XS(ue);function H(){if(!r.contentAutoCopied)return;const $=pT(r.contentAutoCopied,".super-text");E(K,$)}return e({editor:K}),($,Q)=>{var kt,Ut,Ur,ie,Me,He;const Ce=KS,je=Yp,$e=Xp,ee=Gp,ge=Of,ce=jS,ye=$Z,ze=Ft,ot=yn;return i.openBlock(),i.createElementBlock(i.Fragment,null,[z.value?(i.openBlock(),i.createElementBlock("div",{key:0,id:"vdc-editor",ref_key:"editorRef",ref:L,style:i.normalizeStyle(j.value),class:i.normalizeClass(i.unref(Te)("vdc-editor mobile relative w-full flex flex-col",!r.height&&"flex-1",$.editorClass,$.disabled&&"disabled",$.mode!==i.unref(Fe).EDITOR&&$.isShowLineNumber&&"editor-line"))},[!$.hideBubble&&!$.disabled&&S.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createVNode(Ce,{editor:i.unref(K),mode:$.mode},null,8,["editor","mode"]),Ve([i.unref(uc)])?(i.openBlock(),i.createBlock(je,{key:0,editor:i.unref(K)},null,8,["editor"])):i.createCommentVNode("",!0),Ve([i.unref(sa)])?(i.openBlock(),i.createBlock($e,{key:1,editor:i.unref(K)},null,8,["editor"])):i.createCommentVNode("",!0),Ve([i.unref(us)])?(i.openBlock(),i.createBlock(ee,{key:2,editor:i.unref(K)},null,8,["editor"])):i.createCommentVNode("",!0),Ve([i.unref(cs),i.unref(ds)])?(i.openBlock(),i.createBlock(ge,{key:3,editor:i.unref(K)},null,8,["editor"])):i.createCommentVNode("",!0)],64)):i.createCommentVNode("",!0),$.hideToolbar?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(ce,{key:1,editor:z.value,mode:$.mode,disabled:$.disabled,class:i.normalizeClass(["mb-[3px]",$.toolBarClass]),"active-extensions":$.mode===i.unref(Fe).EDITOR?[cc]:void 0},null,8,["editor","mode","disabled","class","active-extensions"])),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[$.isShowFormatControlBar?(i.openBlock(),i.createElementBlock("div",{key:0,style:i.normalizeStyle(M.value),class:"fixed left-5 right-5 z-[12]"},[i.createVNode(ye,{editor:z.value,mode:$.mode,disabled:!S.value||$.disabled,style:i.normalizeStyle({visibility:V.value?"visible":"hidden"})},null,8,["editor","mode","disabled","style"])],4)):i.createCommentVNode("",!0)])),i.createVNode(i.unref(Gb),{class:i.normalizeClass(i.unref(Te)("flex-1 basis-0 flex-col",Y.value&&"pb-16")),style:i.normalizeStyle({...A.value}),horizontal:"",onResize:i.unref(St)},{default:i.withCtx(()=>[le.value?(i.openBlock(),i.createBlock(i.unref(ha),{key:0,size:i.unref(Ie),"min-size":i.unref(me),class:"flex flex-col"},{default:i.withCtx(()=>{var it,at;return[(it=$.titleBarComment)!=null&&it.title?(i.openBlock(),i.createBlock(GS,{key:0,"title-bar":$.titleBarComment,class:"mb-[3px]"},null,8,["title-bar"])):i.createCommentVNode("",!0),(at=$.fieldNameComment)!=null&&at.label?(i.openBlock(),i.createElementBlock("div",{key:1,onClick:Q[0]||(Q[0]=un=>i.unref(mt)("pane1")),class:i.normalizeClass(i.unref(Te)("flex justify-between items-center py-1.5 mb-1 active:bg-ed-accent",!$.isAccordion&&"pointer-events-none"))},[i.createVNode(Qp,{"field-name":$.fieldNameComment,mode:$.mode},null,8,["field-name","mode"]),$.isAccordion?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(i.unref(N)?i.unref(a1):i.unref(Zu)),{key:0,class:"h-5 w-5"})):i.createCommentVNode("",!0)],2)):i.createCommentVNode("",!0),i.withDirectives(i.createElementVNode("div",{class:i.normalizeClass(i.unref(Te)("flex-1 !overflow-y-auto overflow-x-hidden basis-0 flex h-full flex-col",$.contentClass))},[i.createVNode(XZ,{ref:"editorCommentRef",mode:$.mode,extensions:$.extensions,"model-value":r.comment,disabled:r.disabled,"disable-super-input":$.disableSuperInput,"field-name-comment":$.fieldNameComment,"is-show-format-control-bar":$.isShowFormatControlBar,"auto-focus":$.autoFocus,"onUpdate:modelValue":Q[1]||(Q[1]=un=>o("update:comment",un)),onSetEditorSelected:ne},null,8,["mode","extensions","model-value","disabled","disable-super-input","field-name-comment","is-show-format-control-bar","auto-focus"])],2),[[i.vShow,i.unref(N)]])]}),_:1},8,["size","min-size"])):i.createCommentVNode("",!0),i.createVNode(i.unref(ha),{size:i.unref(Ue),"min-size":i.unref(me),class:"flex flex-col"},{default:i.withCtx(()=>{var it,at;return[(it=$.titleBarContent)!=null&&it.title?(i.openBlock(),i.createBlock(GS,{key:0,"title-bar":$.titleBarContent,class:"mb-[3px]"},null,8,["title-bar"])):i.createCommentVNode("",!0),i.createElementVNode("div",JZ,[(at=$.fieldNameContent)!=null&&at.label?(i.openBlock(),i.createElementBlock("div",{key:0,onClick:Q[2]||(Q[2]=un=>i.unref(mt)("pane2")),class:i.normalizeClass(i.unref(Te)("flex justify-between items-center py-1.5 mb-1 active:bg-ed-accent flex-1",!$.isAccordion&&"pointer-events-none"))},[i.createVNode(Qp,{"field-name":$.fieldNameContent,mode:$.mode},null,8,["field-name","mode"]),$.isAccordion?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(i.unref(be)?i.unref(a1):i.unref(Zu)),{key:0,class:"h-5 w-5"})):i.createCommentVNode("",!0)],2)):i.createCommentVNode("",!0),$.contentAutoCopied?(i.openBlock(),i.createBlock(ot,{key:1,disabled:i.unref(vb)($.contentAutoCopied),onClick:H,variant:"ghost",class:"w-fit h-fit p-0 gap-x-1 label-large text-blue-500"},{default:i.withCtx(()=>[i.createVNode(ze,{name:"autoCopy",class:"size-5"}),Q[6]||(Q[6]=i.createTextVNode("자동복사"))]),_:1},8,["disabled"])):i.createCommentVNode("",!0)]),i.withDirectives(i.createElementVNode("div",{class:i.normalizeClass(i.unref(Te)("flex-1 !overflow-y-auto overflow-x-hidden basis-0 flex flex-col",$.contentClass))},[i.createVNode(i.unref(So),{id:"editor-panel",editor:i.unref(K),spellcheck:"true",class:i.normalizeClass(["flex-1 flex-col relative break-all",$.mode===i.unref(Fe).PLAIN_TEXT&&"plain-text"])},null,8,["editor","class"])],2),[[i.vShow,i.unref(be)]])]}),_:1},8,["size","min-size"])]),_:1},8,["class","style","onResize"])],6)):i.createCommentVNode("",!0),(kt=z.value)!=null&&kt.storage.superText&&i.unref(re)?(i.openBlock(),i.createBlock(KZ,{key:1,open:we.value,editor:z.value,"bottom-sheet-component":i.unref(re),onClose:Q[3]||(Q[3]=it=>z.value.commands.toggleSuperInputMoblie()),onSave:Se},null,8,["open","editor","bottom-sheet-component"])):(Ut=z.value)!=null&&Ut.storage.superText?(i.openBlock(),i.createBlock(Ap,{key:2,open:we.value,"is-view-mode":!((Ur=z.value)!=null&&Ur.storage.superText.isShowSuperInputMoblie),editor:z.value,onClose:Q[4]||(Q[4]=it=>z.value.commands.toggleSuperInputMoblie()),onSave:Se},null,8,["open","is-view-mode","editor"])):i.createCommentVNode("",!0),(ie=z.value)!=null&&ie.storage.configPlan?(i.openBlock(),i.createBlock(Ap,{key:3,open:(Me=z.value)==null?void 0:Me.storage.configPlan.isShowConfigPlanInput,"is-view-mode":!((He=z.value)!=null&&He.storage.configPlan.isShowConfigPlanInput),editor:z.value,title:$.$t("editor.configPlan"),onClose:Q[5]||(Q[5]=it=>z.value.commands.toggleConfigPlanInput()),onSave:We},null,8,["open","is-view-mode","editor","title"])):i.createCommentVNode("",!0)],64)}}}),ZZ=i.defineComponent({__name:"ArticleEditor",props:{mode:{default:Fe.STRAIGHT},isMobile:{type:Boolean},superTextArea:{},modelValue:{},comment:{},commentCuesheet:{},hideComment:{type:Boolean},disableSuperInput:{type:Boolean},fontSizeDefault:{},fontFamilyDefault:{},isOpenSuperView:{type:Boolean},output:{},dark:{type:Boolean},disabled:{type:Boolean},hideToolbar:{type:Boolean},isShowFormatControlBar:{type:Boolean},titleBarComment:{},titleBarContent:{},fieldNameComment:{},fieldNameCommentCuesheet:{},fieldNameContent:{},fieldNameSuper:{},isScreenSplit:{},isShowLineNumber:{type:Boolean},hideMenubar:{type:Boolean},disableBubble:{type:Boolean},hideBubble:{type:Boolean},maxWidth:{},minHeight:{},maxHeight:{},height:{},extensions:{},editorClass:{},contentClass:{},isCompare:{type:Boolean},autoHeight:{type:Boolean},textAlert:{},toolBarClass:{},readonly:{type:Boolean},canEditSuperReadOnly:{type:Boolean},autoFocus:{type:Boolean,default:!0},superPreviewCustomClass:{},minChar:{},isAccordion:{type:Boolean},contentAutoCopied:{}},setup(t){const e=t,n=wn();return i.onMounted(()=>{n.setTextAlert(e.textAlert||"")}),(r,o)=>e.isMobile?(i.openBlock(),i.createBlock(yc,i.mergeProps({key:1},e,{"onUpdate:modelValue":o[2]||(o[2]=s=>r.$emit("update:modelValue",s)),"onUpdate:comment":o[3]||(o[3]=s=>r.$emit("update:comment",s))}),null,16)):(i.openBlock(),i.createBlock(Zp,i.mergeProps({key:0},e,{"onUpdate:modelValue":o[0]||(o[0]=s=>r.$emit("update:modelValue",s)),"onUpdate:comment":o[1]||(o[1]=s=>r.$emit("update:comment",s))}),null,16))}}),QZ=i.defineComponent({__name:"DigitalNewsEditor",props:{mode:{default:Fe.EDITOR},isMobile:{type:Boolean},superTextArea:{},modelValue:{},comment:{},commentCuesheet:{},hideComment:{type:Boolean},disableSuperInput:{type:Boolean},fontSizeDefault:{},fontFamilyDefault:{},isOpenSuperView:{type:Boolean},output:{},dark:{type:Boolean},disabled:{type:Boolean},hideToolbar:{type:Boolean},isShowFormatControlBar:{type:Boolean},titleBarComment:{},titleBarContent:{},fieldNameComment:{},fieldNameCommentCuesheet:{},fieldNameContent:{},fieldNameSuper:{},isScreenSplit:{},isShowLineNumber:{type:Boolean},hideMenubar:{type:Boolean},disableBubble:{type:Boolean},hideBubble:{type:Boolean},maxWidth:{},minHeight:{},maxHeight:{},height:{},extensions:{},editorClass:{},contentClass:{},isCompare:{type:Boolean},autoHeight:{type:Boolean},textAlert:{},toolBarClass:{},readonly:{type:Boolean},canEditSuperReadOnly:{type:Boolean},autoFocus:{type:Boolean,default:!0},superPreviewCustomClass:{},minChar:{},isAccordion:{type:Boolean},contentAutoCopied:{}},setup(t){const e=t;return(n,r)=>{const o=Zp,s=yc;return e.isMobile?(i.openBlock(),i.createBlock(s,i.mergeProps({key:1},e,{"onUpdate:modelValue":r[1]||(r[1]=a=>n.$emit("update:modelValue",a)),"onUpdate:comment":r[2]||(r[2]=a=>n.$emit("update:comment",a))}),null,16)):(i.openBlock(),i.createBlock(o,i.mergeProps({key:0},e,{"onUpdate:modelValue":r[0]||(r[0]=a=>n.$emit("update:modelValue",a))}),null,16))}}});var YS={exports:{}};(function(t){(function(){function e(z){return z===">"}function n(z){return z==="<"}function r(z){return/^\s+$/.test(z)}function o(z){var V=z.match(/^\s*<([^!>][^>]*)>\s*$/);return!!V&&V[1].trim().split(" ")[0]}function s(z){return!o(z)}function a(z){return/^<!--/.test(z)}function l(z){return/--\>$/.test(z)}var u,c=new RegExp("^<(iframe|object|math|svg|script|video|head|style|a)");function f(z){var V=u.exec(z);return V&&V[1]}function p(z,V){return z.substring(z.length-V.length-2)==="</"+V}function m(z){return/^\s*<[^>]+\/>\s*$/.test(z)}function g(z){var V=/^<img[\s>]/.test(z);return V||s(z)||f(z)||m(z)}function b(z){return{string:z,key:x(z)}}function y(z,V,P,q){this.segment=q,this.length=P,this.startInBefore=z+q.beforeIndex,this.startInAfter=V+q.afterIndex,this.endInBefore=this.startInBefore+this.length-1,this.endInAfter=this.startInAfter+this.length-1,this.segmentStartInBefore=z,this.segmentStartInAfter=V,this.segmentEndInBefore=this.segmentStartInBefore+this.length-1,this.segmentEndInAfter=this.segmentStartInAfter+this.length-1}function w(z){for(var V="char",P="",q="",J=[],Y=0;Y<z.length;Y++){var ne=z[Y];switch(V){case"tag":var we=f(P);we?(V="atomic_tag",q=we,P+=ne):a(P)?(V="html_comment",P+=ne):e(ne)?(P+=">",J.push(b(P)),P="",r(ne)?V="whitespace":V="char"):P+=ne;break;case"atomic_tag":e(ne)&&p(P,q)?(P+=">",J.push(b(P)),P="",q="",V="char"):P+=ne;break;case"html_comment":P+=ne,l(P)&&(P="",V="char");break;case"char":n(ne)?(P&&J.push(b(P)),P="<",V="tag"):/\s/.test(ne)?(P&&J.push(b(P)),P=ne,V="whitespace"):/[\w\d\#@]/.test(ne)?P+=ne:/&/.test(ne)?(P&&J.push(b(P)),P=ne):(P+=ne,J.push(b(P)),P="");break;case"whitespace":n(ne)?(P&&J.push(b(P)),P="<",V="tag"):r(ne)?P+=ne:(P&&J.push(b(P)),P=ne,V="char");break;default:throw new Error("Unknown mode "+V)}}return P&&J.push(b(P)),J}function x(z){var V=/^<img.*src=['"]([^"']*)['"].*>$/.exec(z);if(V)return'<img src="'+V[1]+'">';var P=/^<a.*href=['"]([^"']*)['"]/.exec(z);if(P)return'<a href="'+P[1]+'"></a>';var q=/^<object.*data=['"]([^"']*)['"]/.exec(z);if(q)return'<object src="'+q[1]+'"></object>';if(/^<(svg|math|video)[\s>]/.test(z)){var J=z.indexOf('data-uuid="');if(J!==-1){var Y=z.slice(0,J),ne=z.slice(J+44);return Y+ne}else return z}var we=/^<iframe.*src=['"]([^"']*)['"].*>/.exec(z);if(we)return'<iframe src="'+we[1]+'"></iframe>';var xe=/<([^\s>]+)[\s>]/.exec(z);return xe?"<"+xe[1].toLowerCase()+">":z&&z.replace(/(\s+|&nbsp;|&#160;)/g," ")}function E(z){return z.reduce(function(V,P,q){return V[P.key]?V[P.key].push(q):V[P.key]=[q],V},Object.create(null))}function S(z,V){return V.endInBefore<z.startInBefore&&V.endInAfter<z.startInAfter?-1:V.startInBefore>z.endInBefore&&V.startInAfter>z.endInAfter?1:0}function C(){this._root=null}C.prototype={add:function(z){var V={value:z,left:null,right:null},P=this._root;if(P)for(;;){var q=S(P.value,z);if(q===-1)if(P.left)P=P.left;else{P.left=V;break}else if(q===1)if(P.right)P=P.right;else{P.right=V;break}else break}else this._root=V},toArray:function(){function z(V,P){return V&&(z(V.left,P),P.push(V.value),z(V.right,P)),P}return z(this._root,[])}};function _(z){for(var V=z.beforeTokens,P=z.afterMap,q=null,J=null,Y=0;Y<V.length;Y++){var ne=!1,we=V.length-Y;if(J&&we<J.length)break;var xe=V[Y];if(xe.key===" "){q=Y;continue}q===Y-1&&(ne=!0);var Ve=P[xe.key];Ve&&Ve.forEach(function(Se){var We=J?J.length:0,Z=T(z,Y,Se,We,ne);Z&&Z.length>We&&(J=Z)})}return J}function T(z,V,P,q,J){var Y=z.beforeTokens,ne=z.afterTokens,we=V+q,xe=P+q;if(!(we>=Y.length||xe>=ne.length)){if(q){var Ve=Y[we].key,Se=ne[xe].key;if(Ve!==Se)return}for(var We=!0,Z=1,re=V+Z,le=P+Z;We&&re<Y.length&&le<ne.length;){var ue=Y[re].key,me=ne[le].key;ue===me?(Z++,re=V+Z,le=P+Z):We=!1}if(J&&V>0&&P>0){var N=Y[V-1].key,be=ne[P-1].key;N===" "&&be===" "&&(V--,P--,Z++)}return new y(V,P,Z,z)}}function A(z,V,P,q){return{beforeTokens:z,afterTokens:V,beforeMap:E(z),afterMap:E(V),beforeIndex:P,afterIndex:q}}function L(z){for(var V=new C,P,q=[z];q.length;)if(z=q.pop(),P=_(z),P&&P.length){if(P.segmentStartInBefore>0&&P.segmentStartInAfter>0){var J=z.beforeTokens.slice(0,P.segmentStartInBefore),Y=z.afterTokens.slice(0,P.segmentStartInAfter);q.push(A(J,Y,z.beforeIndex,z.afterIndex))}var ne=z.beforeTokens.slice(P.segmentEndInBefore+1),we=z.afterTokens.slice(P.segmentEndInAfter+1),xe=z.beforeIndex+P.segmentEndInBefore+1,Ve=z.afterIndex+P.segmentEndInAfter+1;ne.length&&we.length&&q.push(A(ne,we,xe,Ve)),V.add(P)}return V.toArray()}function I(z,V){if(!z)throw new Error("Missing beforeTokens");if(!V)throw new Error("Missing afterTokens");var P=0,q=0,J=[],Y=A(z,V,0,0),ne=L(Y);ne.push(new y(z.length,V.length,0,Y));for(var we=0;we<ne.length;we++){var xe=ne[we],Ve="none";P===xe.startInBefore?q!==xe.startInAfter&&(Ve="insert"):(Ve="delete",q!==xe.startInAfter&&(Ve="replace")),Ve!=="none"&&J.push({action:Ve,startInBefore:P,endInBefore:Ve!=="insert"?xe.startInBefore-1:null,startInAfter:q,endInAfter:Ve!=="delete"?xe.startInAfter-1:null}),xe.length!==0&&J.push({action:"equal",startInBefore:xe.startInBefore,endInBefore:xe.endInBefore,startInAfter:xe.startInAfter,endInAfter:xe.endInAfter}),P=xe.endInBefore+1,q=xe.endInAfter+1}var Se=[],We={action:"none"};function Z(ue){return ue.action!=="equal"||ue.endInBefore-ue.startInBefore!==0?!1:/^\s$/.test(z.slice(ue.startInBefore,ue.endInBefore+1))}for(var re=0;re<J.length;re++){var le=J[re];Z(le)&&We.action==="replace"||le.action==="replace"&&We.action==="replace"?(We.endInBefore=le.endInBefore,We.endInAfter=le.endInAfter):(Se.push(le),We=le)}return Se}function M(z){this.tokens=z,this.notes=z.reduce(function(V,P,q){V.notes.push({isWrappable:g(P),insertedTag:!1});var J=!m(P)&&o(P),Y=V.tagStack[V.tagStack.length-1];return J&&(Y&&"/"+Y.tag===J?(V.notes[Y.position].insertedTag=!0,V.tagStack.pop()):V.tagStack.push({tag:J,position:q})),V},{notes:[],tagStack:[]}).notes}M.prototype.combine=function(z,V){var P=this.notes,q=this.tokens.slice(),J=q.reduce(function(Y,ne,we){P[we].insertedTag&&(q[we]=V(q[we])),Y.status===null&&(Y.status=P[we].isWrappable);var xe=P[we].isWrappable;return xe!==Y.status&&(Y.list.push({isWrappable:Y.status,tokens:q.slice(Y.lastIndex,we)}),Y.lastIndex=we,Y.status=xe),we===q.length-1&&Y.list.push({isWrappable:Y.status,tokens:q.slice(Y.lastIndex,we+1)}),Y},{list:[],status:null,lastIndex:0}).list;return J.map(z).join("")};function W(z,V,P,q,J){var Y=new M(V);q=q?q+"-":"";var ne=" data-"+q+'operation-index="'+P+'"';return J&&(ne+=' class="'+J+'"'),Y.combine(function(we){if(we.isWrappable){var xe=we.tokens.join("");if(xe.trim())return"<"+z+ne+">"+xe+"</"+z+">"}else return we.tokens.join("");return""},function(we){var xe=' data-diff-node="'+z+'"';return xe+=" data-"+q+'operation-index="'+P+'"',we.replace(/>\s*$/,xe+"$&")})}var j={equal:function(z,V,P,q,J,Y){var ne=P.slice(z.startInAfter,z.endInAfter+1);return ne.reduce(function(we,xe){return we+xe.string},"")},insert:function(z,V,P,q,J,Y){var ne=P.slice(z.startInAfter,z.endInAfter+1),we=ne.map(function(xe){return xe.string});return W("ins",we,q,J,Y)},delete:function(z,V,P,q,J,Y){var ne=V.slice(z.startInBefore,z.endInBefore+1),we=ne.map(function(xe){return xe.string});return W("del",we,q,J,Y)},replace:function(){return j.delete.apply(null,arguments)+j.insert.apply(null,arguments)}};function K(z,V,P,q,J){return P.reduce(function(Y,ne,we){return Y+j[ne.action](ne,z,V,we,q,J)},"")}function se(z,V,P,q,J){if(z===V)return z;J?u=new RegExp("^<("+J.replace(/\s*/g,"").replace(/,/g,"|")+")"):u=c,z=w(z),V=w(V);var Y=I(z,V);return K(z,V,Y,q,P)}se.htmlToTokens=w,se.findMatchingBlocks=L,L.findBestMatch=_,L.createMap=E,L.createToken=b,L.createSegment=A,L.getKeyForToken=x,se.calculateOperations=I,se.renderOperations=K,t!==null?t.exports=se:this.htmldiff=se}).call(Xa)})(YS);var NZ=YS.exports;const eQ=UB(NZ),JS=(t,e,n)=>{let r="";{const o=Dn(t,n),s=Dn(e,n);r=eQ(o,s,null,null,"button")}return r=r.replace(/<del[^>]*>/g,'<span class="diff-del">').replace(/<\/del>/g,"</span>").replace(/<ins[^>]*>/g,'<mark style="background:#FEF3C7;">').replace(/<\/ins>/g,"</mark>"),r},tQ={key:0,class:"px-2 min-h-[24px] flex items-center justify-between gap-1 mb-1.5"},nQ={class:"flex items-center gap-2"},rQ={class:"body-small text-gray-600 px-[6px] py-[2px] shrink-0 rounded-[4px] bg-gray-100"},oQ={class:"label-large text-gray-800 line-clamp-1"},iQ={class:"flex items-center gap-1 shrink-0"},sQ={class:"mt-[2px]"},aQ={class:"body-small text-gray-400"},lQ={class:"border border-gray-50 rounded-md py-[10px] px-4 flex-1 overflow-y-auto"},uQ={class:"border border-ed-gray rounded-[5px] p-2.5 my-2 h-full"},cQ={key:0,class:"px-2 min-h-[24px] flex items-center justify-between gap-1 mb-1.5"},dQ={class:"flex items-center gap-2"},fQ={class:"body-small text-blue-500 px-[6px] py-[2px] shrink-0 rounded-[4px] bg-blue-50"},pQ={class:"label-large text-gray-800 line-clamp-1"},hQ={class:"flex items-center gap-1 shrink-0"},mQ={class:"mt-[2px]"},gQ={class:"body-small text-gray-400"},bQ={class:"border border-gray-50 bg-dark-blue-600 rounded-md py-[10px] px-4 flex-1 overflow-y-auto"},vQ=To(i.defineComponent({__name:"ArticleCompareEditor",props:{originalData:{},changedData:{},extensions:{},editorClass:{}},setup(t){const e=t,n=i.ref(!1),r=i.computed(()=>!e.originalData||!e.changedData?{comment:"",content:""}:{comment:JS(e.originalData.comment,e.changedData.comment,!0),content:JS(e.originalData.content,e.changedData.content,!0)}),{HEADER_ONLY_SIZE:o,pane1ContentVisible:s,pane2ContentVisible:a,pane1Size:l,pane2Size:u,handlePaneResize:c}=XS(!1,6);return(f,p)=>{const m=Ft;return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(i.unref(Te)("h-full",f.editorClass))},[i.createVNode(i.unref(Gb),{horizontal:"",onResize:i.unref(c)},{default:i.withCtx(()=>[i.createVNode(i.unref(ha),{size:i.unref(l),"min-size":i.unref(o),class:"flex flex-col"},{default:i.withCtx(()=>{var g,b,y,w,x,E,S,C,_,T;return[(b=(g=f.originalData)==null?void 0:g.titleBar)!=null&&b.title?(i.openBlock(),i.createElementBlock("div",tQ,[i.createElementVNode("div",nQ,[i.createElementVNode("div",rQ,i.toDisplayString(f.$t("기준")),1),i.createElementVNode("h3",oQ,i.toDisplayString((w=(y=f.originalData)==null?void 0:y.titleBar)==null?void 0:w.title),1)]),i.createElementVNode("div",iQ,[i.createElementVNode("div",sQ,[i.createVNode(m,{name:"Clock",class:"w-[13px] h-[13px] text-gray-400"})]),i.createElementVNode("div",aQ,i.toDisplayString((E=(x=f.originalData)==null?void 0:x.titleBar)==null?void 0:E.time),1)])])):i.createCommentVNode("",!0),i.withDirectives(i.createElementVNode("div",lQ,[i.createVNode(yc,{"editor-class":"h-full",mode:i.unref(Fe).REPORT,disabled:"","hide-toolbar":"",extensions:f.extensions,"field-name-comment":(S=f.originalData)==null?void 0:S.fieldNameComment,"field-name-content":(C=f.originalData)==null?void 0:C.fieldNameContent,comment:(_=f.originalData)==null?void 0:_.comment,"model-value":(T=f.originalData)==null?void 0:T.content},null,8,["mode","extensions","field-name-comment","field-name-content","comment","model-value"])],512),[[i.vShow,i.unref(s)]])]}),_:1},8,["size","min-size"]),i.unref(n)?(i.openBlock(),i.createBlock(i.unref(ha),{key:0},{default:i.withCtx(()=>{var g,b,y,w;return[i.createElementVNode("div",uQ,[i.createVNode(yc,{"editor-class":"h-full",mode:i.unref(Fe).REPORT,disabled:"","hide-toolbar":"",extensions:f.extensions,"field-name-comment":(g=f.changedData)==null?void 0:g.fieldNameComment,"field-name-content":(b=f.changedData)==null?void 0:b.fieldNameContent,comment:(y=f.changedData)==null?void 0:y.comment,"model-value":(w=f.changedData)==null?void 0:w.content},null,8,["mode","extensions","field-name-comment","field-name-content","comment","model-value"])])]}),_:1})):i.createCommentVNode("",!0),i.createVNode(i.unref(ha),{size:i.unref(u),"min-size":i.unref(o),class:"flex flex-col"},{default:i.withCtx(()=>{var g,b,y,w,x,E,S,C;return[(b=(g=f.changedData)==null?void 0:g.titleBar)!=null&&b.title?(i.openBlock(),i.createElementBlock("div",cQ,[i.createElementVNode("div",dQ,[i.createElementVNode("div",fQ,i.toDisplayString(f.$t("대상")),1),i.createElementVNode("h3",pQ,i.toDisplayString((w=(y=f.changedData)==null?void 0:y.titleBar)==null?void 0:w.title),1)]),i.createElementVNode("div",hQ,[i.createElementVNode("div",mQ,[i.createVNode(m,{name:"Clock",class:"w-[13px] h-[13px] text-gray-400"})]),i.createElementVNode("div",gQ,i.toDisplayString((E=(x=f.changedData)==null?void 0:x.titleBar)==null?void 0:E.time),1)])])):i.createCommentVNode("",!0),i.withDirectives(i.createElementVNode("div",bQ,[i.createVNode(yc,{"editor-class":"h-full",mode:i.unref(Fe).REPORT,disabled:"","hide-toolbar":"",extensions:f.extensions,"field-name-comment":(S=f.changedData)==null?void 0:S.fieldNameComment,"field-name-content":(C=f.changedData)==null?void 0:C.fieldNameContent,comment:i.unref(r).comment,"model-value":i.unref(r).content},null,8,["mode","extensions","field-name-comment","field-name-content","comment","model-value"])],512),[[i.vShow,i.unref(a)]])]}),_:1},8,["size","min-size"])]),_:1},8,["onResize"])],2)}}}),[["__scopeId","data-v-9a3f94c5"]]),ZS=t=>{if(!t)return-1;const{from:e}=t.state.selection;let n=0;return t.state.doc.descendants((r,o)=>{r.type.name===yp&&o<e&&n++}),n},yQ=i.defineComponent({__name:"SuperViewMobileSuperEditor",props:{isMobile:{type:Boolean},superTextArea:{},mode:{},modelValue:{default:""},comment:{},commentCuesheet:{},hideComment:{type:Boolean},disableSuperInput:{type:Boolean,default:!1},fontSizeDefault:{},fontFamilyDefault:{},isOpenSuperView:{type:Boolean},output:{default:"html"},dark:{type:Boolean,default:void 0},disabled:{type:Boolean},hideToolbar:{type:Boolean,default:!1},isShowFormatControlBar:{type:Boolean},titleBarComment:{},titleBarContent:{},fieldNameComment:{},fieldNameCommentCuesheet:{},fieldNameContent:{},fieldNameSuper:{default:null},isScreenSplit:{},isShowLineNumber:{type:Boolean},hideMenubar:{type:Boolean},disableBubble:{type:Boolean,default:!1},hideBubble:{type:Boolean,default:!1},maxWidth:{default:void 0},minHeight:{default:600},maxHeight:{default:void 0},height:{},extensions:{default:()=>[]},editorClass:{},contentClass:{},isCompare:{type:Boolean},autoHeight:{type:Boolean},textAlert:{},toolBarClass:{},readonly:{type:Boolean},canEditSuperReadOnly:{type:Boolean},autoFocus:{type:Boolean},superPreviewCustomClass:{},minChar:{},isAccordion:{type:Boolean},contentAutoCopied:{}},emits:["enter","change","update:modelValue","update:comment","onFocusEditor","changed:selection","setEditorSelected","onBlurEditor","lineFocus","onFocus","onBlur"],setup(t,{expose:e,emit:n}){const r=t,o=n;i.computed(()=>r.mode===Fe.EDITOR);const s=gt.useEventBus(ir.RENDER_SUPER_TEXT),a=wn(),{isReady:l,editor:u,updateEditorState:c,checkSpellStore:f}=a,p=i.ref(!1);i.provide("isEditable",p);const m=i.ref(dw(r.modelValue));function g(C){if(r.disabled||r.readonly)return;const _=ZS(C);o("lineFocus",{lineIndex:_})}function b(){o("lineFocus",{lineIndex:void 0})}const y=new ei({enablePasteRules:!1,enableInputRules:!1,content:m.value,onCreate:({editor:C})=>{c(C)},onUpdate:nt.throttle(({editor:C})=>{l.value=!0;const _=S(C,r.output);o("update:modelValue",_),o("change",{editor:C,output:_}),c(C)},_o),extensions:nt.uniqBy(nt.reverse(i.unref(r.extensions)),"name"),editable:p.value,onFocus:()=>{x(),w.value=!0,g(y)},onBlur:()=>{w.value=!1,b()},onSelectionUpdate:()=>{g(y)}}),w=i.ref(!1);function x(){o("setEditorSelected",y)}function E(){s.emit({action:"render"})}function S(C,_){if(!C)return"";if(C.isEmpty)return _==="json"?{}:"";switch(_){case"html":return C.getHTML();case"json":return C.getJSON();case"text":return C.getText();default:return""}}return i.watch(()=>f.languages,()=>{y.commands.checkSpelling()}),i.watch(()=>r.modelValue,C=>{if(!y||nt.isEqual(S(y,r.output),C))return;const{from:_,to:T}=y.state.selection;y.commands.setTextSelection({from:_,to:T}),E(),m.value=dw(C)},{deep:!0}),i.watch(()=>u.value,()=>{u.value&&u.value.on("selectionUpdate",({editor:C})=>{o("changed:selection",{editor:C})})}),i.watch(()=>r.disableSuperInput,()=>{const C=document.getElementById(nr.COMMENT);C==null||C.setAttribute(nr.DISABLE_SUPER_INPUT,`${r.disableSuperInput}`)}),i.onUnmounted(()=>y==null?void 0:y.destroy()),Jp(y),i.onMounted(()=>{var C,_;(C=y==null?void 0:y.commands)!=null&&C.setIsEnableSuggestion&&y.commands.setIsEnableSuggestion(!1),(_=y==null?void 0:y.commands)!=null&&_.setIsMobile&&y.commands.setIsMobile(!0)}),e({editor:y}),(C,_)=>{var A;const T=Qp;return i.openBlock(),i.createElementBlock(i.Fragment,null,[(A=C.fieldNameSuper)!=null&&A.label?(i.openBlock(),i.createBlock(T,{key:0,"field-name":C.fieldNameSuper,mode:C.mode,disabled:C.disabled,class:"mb-1",intent:"secondary"},null,8,["field-name","mode","disabled"])):i.createCommentVNode("",!0),i.createVNode(i.unref(So),{editor:i.unref(y),spellcheck:"true",class:i.normalizeClass(["flex-1 flex-col"])},null,8,["editor"])],64)}}}),wQ=(t,e)=>{let n=null;return t.state.doc.descendants((r,o)=>{if(r.type.name==="paragraph"&&Number(r.attrs["number-line"])===e)return n={node:r,pos:o},!1}),n},QS="focused-line";async function NS({lineIndex:t,editor:e}){if(e.state.doc.descendants((l,u)=>{if(l.attrs.class===QS){const c=e.state.tr.setNodeMarkup(u,void 0,{...l.attrs,class:""});return e.view.dispatch(c),!1}}),await i.nextTick(),!t)return;const n=wQ(e,t);if(!n)return;const{node:r,pos:o}=n,s=e.state.tr.setNodeMarkup(o,void 0,{...r.attrs,class:QS});e.view.dispatch(s),await i.nextTick(),e.view.nodeDOM(o).scrollIntoView({behavior:"smooth"})}const xQ=i.defineComponent({__name:"SuperViewMobileEditor",props:{isMobile:{type:Boolean},superTextArea:{},mode:{},modelValue:{default:""},comment:{default:""},commentCuesheet:{},hideComment:{type:Boolean},disableSuperInput:{type:Boolean},fontSizeDefault:{default:"12px"},fontFamilyDefault:{default:""},isOpenSuperView:{type:Boolean},output:{default:"html"},dark:{type:Boolean},disabled:{type:Boolean,default:!1},hideToolbar:{type:Boolean,default:!1},isShowFormatControlBar:{type:Boolean},titleBarComment:{},titleBarContent:{},fieldNameComment:{},fieldNameCommentCuesheet:{},fieldNameContent:{default:null},fieldNameSuper:{default:null},isScreenSplit:{},isShowLineNumber:{type:Boolean},hideMenubar:{type:Boolean},disableBubble:{type:Boolean},hideBubble:{type:Boolean,default:!1},maxWidth:{default:void 0},minHeight:{default:200},maxHeight:{default:void 0},height:{default:void 0},extensions:{default:()=>[]},editorClass:{default:void 0},contentClass:{default:void 0},isCompare:{type:Boolean},autoHeight:{type:Boolean},textAlert:{},toolBarClass:{default:void 0},readonly:{type:Boolean,default:!1},canEditSuperReadOnly:{type:Boolean},autoFocus:{type:Boolean},superPreviewCustomClass:{},minChar:{},isAccordion:{type:Boolean},contentAutoCopied:{}},emits:["enter","change","update:modelValue","update:comment","onFocusEditor","changed:selection","setEditorSelected","onBlurEditor","lineFocus","onFocus","onBlur"],setup(t,{expose:e,emit:n}){const r=t,o=n;i.provide("isMobile",!0),i.computed(()=>r.mode===Fe.EDITOR);const s=gt.useEventBus(ir.INCREASE_DECREASE_FONTSIZE);i.useAttrs();const a=wn(),{state:l,isFullscreen:u,isReady:c,editor:f,updateEditorState:p,checkSpellStore:m}=a,g=i.ref(!1);i.provide("isEditable",g);const b=i.ref(void 0),y=i.ref(),w=i.computed(()=>[...l.extensions,...nt.differenceBy(r.extensions,l.extensions,"name")].map((V,P)=>V.configure({sort:P}))),x=i.ref(r.fontSizeDefault),E=i.ref(r.fontFamilyDefault);i.provide("fontSize",x),i.provide("fontFamily",E);const S=i.computed(()=>({fontFamily:E.value,fontSize:x.value})),C=i.ref(),_=V=>{const P=parseInt(x.value||"12px"),q=V?P+2:P-2;x.value=q+"px"};i.onBeforeMount(()=>{s.on(_)}),i.onBeforeUnmount(()=>{s.off(_)});const T=i.computed(()=>({...i.unref(u)?{height:"100%"}:{minHeight:r.minHeight?an(r.minHeight):void 0,maxHeight:r.maxHeight?an(r.maxHeight):void 0,height:r.height?an(r.height):void 0},maxWidth:an(r.maxWidth),width:r.maxWidth?"100%":void 0,margin:r.maxWidth?"0 auto":void 0}));function A(V){if(r.disabled||r.readonly)return;const P=ZS(V);b.value=P}function L(){b.value=void 0}const I=new ei({enablePasteRules:!1,enableInputRules:!1,content:Dn(r.modelValue,r.disabled,r.mode),onCreate:({editor:V})=>{p(V)},onUpdate:nt.throttle(({editor:V})=>{c.value=!0;const P=se(V,r.output);o("update:modelValue",P),o("change",{editor:V,output:P}),p(V)},_o),extensions:nt.uniqBy(nt.reverse(i.unref(w)),"name"),editable:g.value,onFocus:()=>{K(),M.value=!0,A(I)},onBlur:()=>{M.value=!1,L()},onSelectionUpdate:()=>{A(I)}}),M=i.ref(!1),W=i.ref();i.onMounted(()=>{W.value=I});const j=({lineIndex:V})=>{var q;I&&NS({lineIndex:V,editor:I});const P=(q=y.value)==null?void 0:q.editor;P&&NS({lineIndex:V,editor:P})};i.watch(()=>b.value,V=>{o("lineFocus",{lineIndex:V}),j({lineIndex:V})},{immediate:!0});function K(V){W.value=I}function se(V,P){if(!V)return"";if(V.isEmpty)return P==="json"?{}:"";switch(P){case"html":return V.getHTML();case"json":return V.getJSON();case"text":return V.getText({blockSeparator:`
305
305
  `});default:return""}}function z(V){return V.every(P=>I==null?void 0:I.extensionManager.extensions.find(q=>q.name===P))}return i.watch(()=>m.languages,()=>{I.commands.checkSpelling()}),i.watch(()=>r.modelValue,V=>{if(!I||nt.isEqual(se(I,r.output),V))return;const{from:P,to:q}=I.state.selection;I.commands.setTextSelection({from:P,to:q}),I.commands.setContent(Dn(V,r.disabled,r.mode),!1)},{deep:!0}),i.watch(()=>f.value,()=>{f.value&&f.value.on("selectionUpdate",({editor:V})=>{o("changed:selection",{editor:V})})}),i.onUnmounted(()=>{var V;I==null||I.destroy(),(V=W.value)==null||V.destroy()}),Xu(Su.SAVE,()=>{localStorage.setItem("content",se(I,"html"))}),i.onMounted(()=>{var V,P;(V=I==null?void 0:I.commands)!=null&&V.setIsEnableSuggestion&&I.commands.setIsEnableSuggestion(!1),(P=I==null?void 0:I.commands)!=null&&P.setIsMobile&&I.commands.setIsMobile(!0)}),Jp(I),e({editor:I}),(V,P)=>{const q=Yp,J=Xp,Y=Gp,ne=Of,we=jS,xe=Qp;return W.value?(i.openBlock(),i.createElementBlock("div",{key:0,id:"vdc-editor",ref_key:"editorRef",ref:C,style:i.normalizeStyle(T.value),class:i.normalizeClass(i.unref(Te)("vdc-editor mobile relative w-full flex flex-col editor-line-number editor-line",!r.height&&"flex-1",V.editorClass))},[!V.hideBubble&&!V.disabled&&g.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[z([i.unref(uc)])?(i.openBlock(),i.createBlock(q,{key:0,editor:i.unref(I)},null,8,["editor"])):i.createCommentVNode("",!0),z([i.unref(sa)])?(i.openBlock(),i.createBlock(J,{key:1,editor:i.unref(I)},null,8,["editor"])):i.createCommentVNode("",!0),z([i.unref(us)])?(i.openBlock(),i.createBlock(Y,{key:2,editor:i.unref(I)},null,8,["editor"])):i.createCommentVNode("",!0),z([i.unref(cs),i.unref(ds)])?(i.openBlock(),i.createBlock(ne,{key:3,editor:i.unref(I)},null,8,["editor"])):i.createCommentVNode("",!0)],64)):i.createCommentVNode("",!0),V.hideToolbar?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(we,{key:1,editor:W.value,mode:V.mode,disabled:V.disabled,class:i.normalizeClass(["mb-[3px]",V.toolBarClass]),"active-extensions":[cc]},null,8,["editor","mode","disabled","class","active-extensions"])),i.createVNode(i.unref(Gb),{class:i.normalizeClass(i.unref(Te)("flex flex-col")),style:i.normalizeStyle({...S.value}),horizontal:""},{default:i.withCtx(()=>[i.createVNode(i.unref(ha),{size:50,class:"border-none p-0 flex flex-col bg-[#EEEEEE]"},{default:i.withCtx(()=>{var Ve;return[i.createElementVNode("div",{class:i.normalizeClass(i.unref(Te)("flex-1 !overflow-y-auto basis-0 flex flex-col pt-1.5 p-2.5 border border-ed-gray rounded-[5px]",V.contentClass))},[(Ve=V.fieldNameContent)!=null&&Ve.label?(i.openBlock(),i.createBlock(xe,{key:0,"field-name":V.fieldNameContent,mode:V.mode,disabled:V.disabled,class:"mb-1"},null,8,["field-name","mode","disabled"])):i.createCommentVNode("",!0),i.createVNode(i.unref(So),{editor:i.unref(I),spellcheck:"true",class:i.normalizeClass(["flex-1 flex-col"])},null,8,["editor"])],2)]}),_:1}),i.createVNode(i.unref(ha),{size:50,class:"border-none p-0 flex flex-col"},{default:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass(i.unref(Te)("flex-1 !overflow-y-auto basis-0 flex flex-col pt-1.5 p-2.5 border border-ed-gray rounded-[5px]",M.value&&"border-ed-blue",V.disabled&&"border-transparent",V.contentClass))},[i.createVNode(yQ,{ref_key:"superEditorRef",ref:y,mode:V.mode,"field-name-super":V.fieldNameSuper,extensions:V.extensions,"model-value":V.modelValue,disabled:V.disabled,readonly:V.readonly,onLineFocus:j},null,8,["mode","field-name-super","extensions","model-value","disabled","readonly"])],2)]),_:1})]),_:1},8,["class","style"])],6)):i.createCommentVNode("",!0)}}}),ek={"editor.remove":"Remove","editor.copy":"Copy","editor.words":"WORDS","editor.characters":"CHARACTERS","editor.default":"Default","editor.recent":"Recently Used","editor.nofill":"Remove Color","editor.format":"Format Painter","editor.close":"Close","editor.modify":"Modify","editor.preview.tooltip":"Preview","editor.draghandle.tooltip":"Click And Drag","editor.copyToClipboard":"CopyToClipboard","editor.importWord.tooltip":"Import from Word","editor.importWord.success":"Import Success","editor.importWord.fileTooLarge":"File is Too large","editor.importWord.error":"Import Failed, File not supported","editor.slash":"Press '/' for commands","editor.slash.empty":"No Result","editor.slash.format":"Format","editor.slash.insert":"Insert","editor.slash.embed":"Embed Services","editor.content":"Please input content","editor.slash.hint":"Please input content","editor.moremark":"More Text Styles","editor.size.small.tooltip":"Small","editor.size.medium.tooltip":"Medium","editor.size.large.tooltip":"Cover","editor.bold.tooltip":"Bold","editor.italic.tooltip":"Italic","editor.underline.tooltip":"Underline","editor.strike.tooltip":"Strike","editor.color.tooltip":"Color","editor.color.more":"Color Picker","editor.highlight.tooltip":"Highlight","editor.lineheight.tooltip":"Line Height","editor.heading.tooltip":"Headings","editor.heading.h1.tooltip":"Heading 1","editor.heading.h2.tooltip":"Heading 2","editor.heading.h3.tooltip":"Heading 3","editor.heading.h4.tooltip":"Heading 4","editor.heading.h5.tooltip":"Heading 5","editor.heading.h6.tooltip":"Heading 6","editor.paragraph.tooltip":"Paragraph","editor.textalign.tooltip":"Align","editor.textalign.left.tooltip":"Left","editor.textalign.center.tooltip":"Center","editor.textalign.right.tooltip":"Right","editor.textalign.justify.tooltip":"Justify","editor.indent":"Indent","editor.indent.indent":"Increase Indent","editor.indent.outdent":"Decrease Indent","editor.fontFamily.tooltip":"Font family","editor.fontFamily.default":"Default","editor.fontFamily.gulim":"Gulim","editor.fontFamily.dotum":"Dotum","editor.fontFamily.gungsuh":"Gungsuh","editor.fontSize.tooltip":"Font size","editor.fontSize.default.tooltip":"Default","editor.superscript.tooltip":"Superscript","editor.subscript.tooltip":"Subscript","editor.bulletlist.tooltip":"Bullet List","editor.bulletlist.disc.tooltip":"Disc","editor.bulletlist.circle.tooltip":"Circle","editor.bulletlist.square.tooltip":"Square","editor.orderedlist.tooltip":"Ordered List","editor.orderedlist.decimal.tooltip":"Decimal","editor.orderedlist.decimalLeadingZero.tooltip":"Decimal with leading zero","editor.orderedlist.lowerRoman.tooltip":"Lower Roman","editor.orderedlist.upperRoman.tooltip":"Upper Roman","editor.orderedlist.lowerLatin.tooltip":"Lower Latin","editor.orderedlist.upperLatin.tooltip":"Upper Latin","editor.orderedlist.tradChineseInformal.tooltip":"Trad Chinese Informal","editor.orderedlist.simpChineseFormal.tooltip":"Simp Chinese Informal","editor.tasklist.tooltip":"Task List","editor.indent.tooltip":"Indent","editor.outdent.tooltip":"Outdent","editor.columns.tooltip":"Columns","editor.link.tooltip":"Link","editor.link.unlink.tooltip":"UnLink","editor.link.open.tooltip":"Open Link","editor.link.edit.tooltip":"Edit Link","editor.link.dialog.title":"Insert Link","editor.link.dialog.link":"Link","editor.link.dialog.text":"Text","editor.link.dialog.openInNewTab":"Open In New Tab","editor.link.dialog.link.placeholder":"Link Address","editor.link.dialog.text.placeholder":"Add Description","editor.link.dialog.button.apply":"Apply","editor.image.tooltip":"Image","editor.image.menu.flipX":"Flip vertical","editor.image.menu.flipY":"Flip horizontal","editor.image.menu.size":"Set Size","editor.image.menu.size.width":"Width","editor.image.menu.size.height":"Height","editor.image.dragger.tooltip":"Click or drag the image to the area to upload","editor.image.float.left.tooltip":"Float left","editor.image.float.none.tooltip":"Float none","editor.image.float.right.tooltip":"Float right","editor.image.dialog.title":"Add an image","editor.image.dialog.tab.url":"Url","editor.image.dialog.tab.upload":"Upload","editor.image.dialog.uploading":"Uploading","editor.image.dialog.form.link":"Link","editor.image.dialog.placeholder":"Link","editor.image.dialog.form.alt":"Alt","editor.image.dialog.form.aspectRatio":"Lock original aspect ratio","editor.image.dialog.form.file":"File","editor.image.dialog.button.apply":"apply","editor.video.tooltip":"Video","editor.video.dialog.tab.upload":"Upload","editor.video.dialog.uploading":"Uploading","editor.video.dialog.title":"Embed or upload a video","editor.video.dialog.link":"link","editor.video.dialog.placeholder":"Link","editor.video.dialog.button.apply":"apply","editor.table.tooltip":"Table","editor.table.menu.insert_table":"Insert Table","editor.table.menu.insert_table.with_header_row":"With header row","editor.table.menu.insertColumnBefore":"Insert Column Before","editor.table.menu.insertColumnAfter":"Insert Column After","editor.table.menu.deleteColumn":"Delete Column","editor.table.menu.insertRowAbove":"Insert Row Above","editor.table.menu.insertRowBelow":"Insert Row Below","editor.table.menu.deleteRow":"Delete Row","editor.table.menu.mergeCells":"Merge Cells","editor.table.menu.splitCells":"Split Cells","editor.table.menu.deleteTable":"Delete Table","editor.table.menu.setCellsBgColor":"Cell Background Color","editor.blockquote.tooltip":"Blockquote","editor.horizontalrule.tooltip":"Horizontal Rule","editor.code.tooltip":"Code","editor.codeblock.tooltip":"Code Block","editor.clear.tooltip":"Clear Format","editor.undo.tooltip":"Undo","editor.redo.tooltip":"Redo","editor.fullscreen.tooltip.fullscreen":"Fullscreen","editor.fullscreen.tooltip.exit":"Fullscreen Exit","editor.imageUpload.fileTypeNotSupported":"File type not supported","editor.imageUpload.fileSizeTooBig":"File size too big, Maximum size is","editor.AI.placeholder":"Ask AI ...","editor.AI.generating":"Generating","editor.AI.insert":"Insert below selection","editor.AI.replace":"Replace selected content","editor.AI.regenerate":"Regenerate","editor.AI.close":"Close","editor.AI.stop":"Stop","editor.AI.ask":"Ask AI","editor.menubar.file":"File","editor.menubar.edit":"Edit","editor.menubar.view":"View","editor.menubar.insert":"Insert","editor.menubar.format":"Format","editor.menubar.menu.newDoc":"New Document","editor.menubar.menu.restoreLastDraft":"Restore last draft","editor.menubar.menu.print":"Print","editor.menubar.menu.cut":"Cut","editor.menubar.menu.copy":"Copy","editor.menubar.menu.paste":"Paste","editor.menubar.menu.pasteAsText":"Paste as text","editor.menubar.menu.selectAll":"Select all","editor.menubar.menu.preview":"Preview","editor.menubar.menu.spellCheck":"Spell check","editor.menubar.menu.spelling":"spelling","editor.menubar.menu.superView":"Super view","editor.menubar.menu.insertSuper":"Insert super","editor.menubar.menu.articleContent":"Article content","editor.menubar.menu.articleComment":"Article comment","editor.menubar.menu.cancel":"Cancel","editor.menubar.menu.save":"Save","editor.findAndReplace.tooltip":"Find and replace","editor.findAndReplace.find":"Find","editor.findAndReplace.replace":"Replace","editor.findAndReplace.replaceAll":"Replace All","editor.findAndReplace.caseSensitive":"Case Sensitive","editor.printer.tooltip":"Print","editor.superinput":"Super input","editor.insert.symbol":"Insert symbol","editor.check":"Check","editor.detail":"Detail","editor.inputSuper":"Input Super","editor.insertSpecial":"Special characters","editor.cut":"Cut","editor.paste":"Paste","editor.selectAll":"SelectAll","editor.delete":"Delete","editor.super.edit":"Super edit","editor.super.delete":"Super delete","editor.configPlan.edit":"Config plan edit","editor.configPlan.delete":"Config plan delete","editor.super":"Super","editor.configPlan":"Config plan","editor.insertConfigPlan":"Insert config plan","editor.alert":"Super has been changed. Super ID will be deleted.","editor.alertConfirm":"Confirm","editor.alertYes":"OK"},tk={"editor.remove":"제거","editor.copy":"복사","editor.words":"낱말","editor.characters":"문자","editor.default":"기본값","editor.recent":"최근 사용됨","editor.nofill":"색상 제거","editor.format":"형식 페인터","editor.close":"닫기","editor.modify":"수정","editor.preview.tooltip":"미리보기","editor.draghandle.tooltip":"클릭하여 드래그","editor.copyToClipboard":"클립보드에 복사","editor.importWord.tooltip":"Word에서 가져오기","editor.importWord.success":"가져오기 성공","editor.importWord.fileTooLarge":"파일이 너무 큽니다","editor.importWord.error":"가져오기 실패, 파일이 지원되지 않음","editor.slash":"명령을 보려면 '/'를 누르세요.","editor.slash.empty":"결과 없음","editor.slash.format":"형식","editor.slash.insert":"삽입","editor.slash.embed":"서비스 삽입","editor.content":"내용을 입력해주세요","editor.slash.hint":"내용을 입력해주세요","editor.moremark":"추가 텍스트 스타일","editor.size.small.tooltip":"작음","editor.size.medium.tooltip":"중간","editor.size.large.tooltip":"표지","editor.bold.tooltip":"굵게","editor.italic.tooltip":"기울임꼴","editor.underline.tooltip":"밑줄","editor.strike.tooltip":"스트라이크","editor.color.tooltip":"색상","editor.color.more":"색상 선택기","editor.highlight.tooltip":"강조 표시","editor.lineheight.tooltip":"줄 높이","editor.heading.tooltip":"제목","editor.heading.h1.tooltip":"제목 1","editor.heading.h2.tooltip":"제목 2","editor.heading.h3.tooltip":"제목 3","editor.heading.h4.tooltip":"제목 4","editor.heading.h5.tooltip":"제목 5","editor.heading.h6.tooltip":"제목 6","editor.paragraph.tooltip":"단락","editor.textalign.tooltip":"정렬","editor.textalign.left.tooltip":"왼쪽","editor.textalign.center.tooltip":"가운데","editor.textalign.right.tooltip":"오른쪽","editor.textalign.justify.tooltip":"정렬","editor.indent":"들여쓰기","editor.indent.indent":"들여쓰기","editor.indent.outdent":"들여쓰기 줄이기","editor.fontFamily.tooltip":"글꼴 모음","editor.fontFamily.default":"기본값","editor.fontFamily.gulim":"굴림","editor.fontFamily.dotum":"돋움","editor.fontFamily.gungsuh":"궁서","editor.fontSize.tooltip":"글꼴 크기","editor.fontSize.default.tooltip":"기본값","editor.superscript.tooltip":"위 첨자","editor.subscript.tooltip":"아래첨자","editor.bulletlist.tooltip":"글머리 기호 목록","editor.bulletlist.disc.tooltip":"디스크","editor.bulletlist.circle.tooltip":"원","editor.bulletlist.square.tooltip":"사각형","editor.orderedlist.tooltip":"순서가 지정된 목록","editor.orderedlist.decimal.tooltip":"십진수","editor.orderedlist.decimalLeadingZero.tooltip":"앞에 0이 있는 십진수","editor.orderedlist.lowerRoman.tooltip":"하위 로마자","editor.orderedlist.upperRoman.tooltip":"상위 로마자","editor.orderedlist.lowerLatin.tooltip":"하위 라틴어","editor.orderedlist.upperLatin.tooltip":"상위 라틴어","editor.orderedlist.tradChinaInformal.tooltip":"중국어 비공식","editor.orderedlist.simpChinaFormal.tooltip":"간체 중국어 비공식","editor.tasklist.tooltip":"작업 목록","editor.indent.tooltip":"들여쓰기","editor.outdent.tooltip":"내어쓰기","editor.columns.tooltip":"열","editor.link.tooltip":"링크","editor.link.unlink.tooltip":"링크 해제","editor.link.open.tooltip":"링크 열기","editor.link.edit.tooltip":"링크 편집","editor.link.dialog.title":"링크 삽입","editor.link.dialog.link":"링크","editor.link.dialog.text":"텍스트","editor.link.dialog.openInNewTab":"새 탭에서 열기","editor.link.dialog.link.placeholder":"링크 주소","editor.link.dialog.text.placeholder":"설명 추가","editor.link.dialog.button.apply":"적용","editor.image.tooltip":"이미지","editor.image.menu.flipX":"세로 뒤집기","editor.image.menu.flipY":"가로 뒤집기","editor.image.menu.size":"크기 설정","editor.image.menu.size.width":"너비","editor.image.menu.size.height":"높이","editor.image.dragger.tooltip":"업로드할 영역으로 이미지를 클릭하거나 드래그하세요.","editor.image.float.left.tooltip":"왼쪽으로 부동","editor.image.float.none.tooltip":"부동 없음","editor.image.float.right.tooltip":"오른쪽으로 부동","editor.image.dialog.title":"이미지 추가","editor.image.dialog.tab.url":"URL","editor.image.dialog.tab.upload":"업로드","editor.image.dialog.uploading":"업로드 중","editor.image.dialog.form.link":"링크","editor.image.dialog.placeholder":"링크","editor.image.dialog.form.alt":"Alt","editor.image.dialog.form.aspectRatio":"원본 가로 세로 비율 잠금","editor.image.dialog.form.file":"파일","editor.image.dialog.button.apply":"적용","editor.video.tooltip":"비디오","editor.video.dialog.tab.upload":"업로드","editor.video.dialog.uploading":"업로드 중","editor.video.dialog.title":"동영상 삽입 또는 업로드","editor.video.dialog.link":"링크","editor.video.dialog.placeholder":"링크","editor.video.dialog.button.apply":"적용","editor.table.tooltip":"테이블","editor.table.menu.insert_table":"테이블 삽입","editor.table.menu.insert_table.with_header_row":"머리글 행 포함","editor.table.menu.insertColumnBefore":"앞에 열 삽입","editor.table.menu.insertColumnAfter":"다음에 열 삽입","editor.table.menu.deleteColumn":"열 삭제","editor.table.menu.insertRowAbove":"위에 행 삽입","editor.table.menu.insertRowBelow":"아래에 행 삽입","editor.table.menu.deleteRow":"행 삭제","editor.table.menu.mergeCells":"셀 병합","editor.table.menu.splitCells":"셀 분할","editor.table.menu.deleteTable":"테이블 삭제","editor.table.menu.setCellsBgColor":"셀 배경색","editor.blockquote.tooltip":"블록인용","editor.horizontalrule.tooltip":"수평 규칙","editor.code.tooltip":"코드","editor.codeblock.tooltip":"코드 블록","editor.clear.tooltip":"형식 지우기","editor.undo.tooltip":"실행 취소","editor.redo.tooltip":"다시 실행","editor.fullscreen.tooltip.fullscreen":"전체 화면","editor.fullscreen.tooltip.exit":"전체 화면 종료","editor.imageUpload.fileTypeNotSupported":"지원되지 않는 파일 형식","editor.imageUpload.fileSizeTooBig":"파일 크기가 너무 큽니다. 최대 크기는 다음과 같습니다.","editor.AI.placeholder":"AI에게 물어보세요...","editor.AI.geneating":"생성","editor.AI.insert":"선택 항목 아래에 삽입","editor.AI.replace":"선택한 콘텐츠 교체","editor.AI.regenerate":"재생성","editor.AI.close":"닫기","editor.AI.stop":"중지","editor.AI.ask":"AI에게 물어보세요","editor.menubar.file":"파일","editor.menubar.edit":"편집","editor.menubar.view":"보기","editor.menubar.insert":"삽입","editor.menubar.format":"형식","editor.menubar.menu.newDoc":"새 문서","editor.menubar.menu.restoreLastDraft":"마지막 초안 복원","editor.menubar.menu.print":"인쇄","editor.menubar.menu.cut":"잘라내기","editor.menubar.menu.copy":"복사","editor.menubar.menu.paste":"붙여넣기","editor.menubar.menu.pasteAsText":"텍스트로 붙여넣기","editor.menubar.menu.selectAll":"모두 선택","editor.menubar.menu.preview":"미리보기","editor.menubar.menu.spellCheck":"맞춤법 검사","editor.menubar.menu.spelling":"맞춤법","editor.menubar.menu.superView":"수퍼보기","editor.menubar.menu.insertSuper":"수퍼 넣기","editor.menubar.menu.articleContent":"앵커멘트","editor.menubar.menu.articleComment":"상세 텍스트","editor.menubar.menu.cancel":"취소","editor.menubar.menu.save":"저장","editor.findAndReplace.tooltip":"찾기 및 바꾸기","editor.findAndReplace.find":"찾기","editor.findAndReplace.replace":"바꾸기","editor.findAndReplace.replaceAll":"모두 바꾸기","editor.findAndReplace.caseSensitive":"대소문자 구분","editor.printer.tooltip":"인쇄","editor.superinput":"수퍼입력","editor.insert.symbol":"기호삽입","editor.check":"확인","editor.detail":"내용","editor.inputSuper":"수퍼 작성","editor.insertSpecial":"특수문자","editor.cut":"잘라내기","editor.paste":"붙여넣기","editor.selectAll":"모두선택","editor.delete":"삭제","editor.super.edit":"수퍼 수정","editor.super.delete":"수퍼 삭제","editor.configPlan.edit":"구성안 수정","editor.configPlan.delete":"구성안 삭제","editor.super":"수퍼","editor.configPlan":"구성안","editor.insertConfigPlan":"구성안넣기","editor.alert":"수퍼가 변경되었습니다. 수퍼아이디를 삭제합니다.","editor.alertConfirm":"확인","editor.alertYes":"확인"},CQ=YF({legacy:!1,locale:"en",fallbackLocale:"en",messages:{en:ek,ko:tk}});pC();const nk={install(t){t.use(CQ),t.component("vdc-editor",Zp)}},EQ=gt.useEventBus(ir.RENDER_SUPER_TEXT);function SQ(){EQ.emit({action:"render"})}const kQ={class:"min-h-[188px] flex flex-col items-center justify-center gap-y-2 text-sm"},_Q=i.defineComponent({__name:"BulkSpellCheckerFail",setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",kQ,[i.createVNode(i.unref(gU),{class:"h-12 w-12 text-red-500"}),n[0]||(n[0]=i.createElementVNode("div",null,"맞춤법 검사에 실패했습니다",-1)),n[1]||(n[1]=i.createElementVNode("p",{class:"text-xs font-normal text-gray-600 dark:text-gray-400"},"다시 검사하기 버튼을 눌러 재시도 해주세요",-1))]))}}),TQ={class:"min-h-[188px] flex flex-col items-center justify-center gap-y-2 text-sm"},AQ=i.defineComponent({__name:"BulkSpellCheckerNotWrongWord",setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",TQ,[i.createVNode(i.unref(bU),{class:"h-12 w-12 text-blue-500"}),n[0]||(n[0]=i.createElementVNode("div",null,"맞춤법 오류가 없습니다",-1))]))}}),OQ={class:"relative"},MQ=["innerHTML"],BQ={class:"border-b border-gray-500"},IQ=i.defineComponent({__name:"BulkSpellCheckerHelpText",props:{text:{}},setup(t){const e=i.ref(!1),n=i.ref(!1),r=i.ref(null);function o(){e.value=!e.value}return i.onMounted(async()=>{await i.nextTick(),r.value&&r.value.scrollHeight>32&&(n.value=!0)}),(s,a)=>(i.openBlock(),i.createElementBlock("div",OQ,[i.createElementVNode("div",{ref_key:"helpRef",ref:r,class:i.normalizeClass(["text-gray-700 dark:text-gray-400 transition-all",i.unref(e)?"max-h-none":"max-h-[32px] overflow-hidden"]),innerHTML:s.text},null,10,MQ),i.unref(n)?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["",i.unref(Te)("w-32 flex items-end justify-end bg-gradient-to-l from-white via-white to-transparent dark:from-ed-background dark:via-ed-background",i.unref(e)?"ml-auto opacity-60":"absolute bottom-0 right-0")])},[i.createElementVNode("button",{class:"flex items-center gap-1",onClick:i.withModifiers(o,["stop"])},[i.createElementVNode("span",BQ,i.toDisplayString(i.unref(e)?"접기":"자세히"),1),i.createVNode(i.unref(Zu),{class:i.normalizeClass(["w-4 h-4 transition-transform",i.unref(e)?"rotate-180":""])},null,8,["class"])])],2)):i.createCommentVNode("",!0)]))}}),Xb=new Et("bulk-spellcheck-highlight");function RQ(t,e,n=`
306
306
  `){return new Ne({key:Xb,props:{decorations(r){const o=[],s={[Md.SPACING]:"bulk-highlight text-blue-500 border-b-2 border-blue-500",[Md.SPELLING]:"bulk-highlight text-red-500 border-b-2 border-red-500"};return e.forEach(a=>{var g,b;const l=Al(t,a.startIndex,n),u=Al(t,a.endIndex-1,n)+1,c=(b=(g=a.errorHelpDtos)==null?void 0:g[0])==null?void 0:b.errorType,f=s[c??-1]||"bulk-highlight text-green-500 border-b-2 border-green-500",p=Math.max(0,Math.min(l,r.doc.content.size)),m=Math.max(0,Math.min(u,r.doc.content.size));p<m&&o.push(qt.inline(p,m,{class:f}))}),ht.create(r.doc,o)}}})}function Yb(t,e){if(t.unregisterPlugin(Xb),!e.length)return;const n=RQ(t,e);t.registerPlugin(n)}function LQ(t){t&&t.unregisterPlugin(Xb)}function rk(t,e=`
307
307
  `){const n=[];let r=0,o=!0;return t.state.doc.descendants((s,a)=>{if(s.isText&&s.text)for(let c=0;c<s.text.length;c++)n[r++]=a+c;const l=s.type&&s.type.name;if((l==="hardBreak"||l==="hard_break"||l==="br")&&e.length>0)for(let c=0;c<e.length;c++)n[r++]=a;if(s.isBlock){if(!o&&e.length>0)for(let c=0;c<e.length;c++)n[r++]=a;o=!1}return!0}),n}function Al(t,e,n=`