@opengis/richtext 0.0.12 → 0.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/richtext.js CHANGED
@@ -18202,20 +18202,21 @@ function Bte(s) {
18202
18202
  }
18203
18203
  };
18204
18204
  }
18205
- function Vte(s) {
18206
- const e = ct(!1), t = ct(""), n = ct(null);
18205
+ function Vte(s, e) {
18206
+ const t = ct(!1), n = ct(""), i = ct(null);
18207
18207
  return {
18208
- isHtmlMode: e,
18209
- htmlContent: t,
18210
- htmlTextarea: n,
18211
- toggleHtmlMode: (o) => {
18212
- e.value = o, o ? (s.value && (t.value = s.value.getHTML()), p1(() => {
18213
- n.value && (n.value.focus(), setTimeout(() => {
18214
- n.value.formatCode();
18208
+ isHtmlMode: t,
18209
+ htmlContent: n,
18210
+ htmlTextarea: i,
18211
+ toggleHtmlMode: (a) => {
18212
+ t.value = a, a ? (s.value && (n.value = s.value.getHTML()), p1(() => {
18213
+ i.value && (i.value.focus(), setTimeout(() => {
18214
+ i.value.formatCode();
18215
18215
  }, 100));
18216
- })) : s.value && t.value && s.value.commands.setContent(t.value, !0);
18216
+ })) : s.value && n.value && s.value.commands.setContent(n.value, !0);
18217
18217
  },
18218
- onHtmlInput: () => {
18218
+ onHtmlInput: (a) => {
18219
+ n.value = a, e && e("update:modelValue", a);
18219
18220
  }
18220
18221
  };
18221
18222
  }
@@ -105000,7 +105001,9 @@ const VDe = {
105000
105001
  }),
105001
105002
  emits: /* @__PURE__ */ WP(["update:modelValue"], ["update:modelValue"]),
105002
105003
  setup(s) {
105003
- const e = s, t = Fq(s, "modelValue"), { editor: n, editorInstance: i, focusEditor: r } = Bte(e), { isHtmlMode: o, htmlContent: a, htmlTextarea: l, toggleHtmlMode: c, onHtmlInput: d } = Vte(n), { isFullscreen: h, toggleFullscreen: u } = Wte(), f = Bi(() => typeof e.toolbar == "string" ? S4[e.toolbar] || S4.default : e.toolbar), g = Bi(() => f.value.map((p) => _se[p]).filter(Boolean));
105004
+ const e = s, t = Fq(s, "modelValue"), { editor: n, editorInstance: i, focusEditor: r } = Bte(e), { isHtmlMode: o, htmlContent: a, htmlTextarea: l, toggleHtmlMode: c, onHtmlInput: d } = Vte(n, (p, m) => {
105005
+ p === "update:modelValue" && (t.value = m);
105006
+ }), { isFullscreen: h, toggleFullscreen: u } = Wte(), f = Bi(() => typeof e.toolbar == "string" ? S4[e.toolbar] || S4.default : e.toolbar), g = Bi(() => f.value.map((p) => _se[p]).filter(Boolean));
105004
105007
  return go(() => e.modelValue, (p) => {
105005
105008
  if (n.value) {
105006
105009
  const m = p || "", b = n.value.getHTML();
@@ -105025,7 +105028,7 @@ const VDe = {
105025
105028
  ], 64))), 128))
105026
105029
  ]),
105027
105030
  z("div", {
105028
- onClick: m[1] || (m[1] = (...b) => Mn(r) && Mn(r)(...b)),
105031
+ onClick: m[2] || (m[2] = (...b) => Mn(r) && Mn(r)(...b)),
105029
105032
  class: "relative w-full px-4 py-2 bg-white rounded-b-lg editor-content dark:bg-gray-800",
105030
105033
  style: Ga({ height: Mn(h) ? "95vh" : s.height })
105031
105034
  }, [
@@ -105038,8 +105041,8 @@ const VDe = {
105038
105041
  height: Mn(h) ? "calc(95vh - 100px)" : "100%",
105039
105042
  language: "html",
105040
105043
  theme: "vs",
105041
- onChange: Mn(d)
105042
- }, null, 8, ["modelValue", "height", "onChange"])
105044
+ onChange: m[1] || (m[1] = (b) => Mn(d)(b))
105045
+ }, null, 8, ["modelValue", "height"])
105043
105046
  ])) : (me(), Hi(Mn(MQ), {
105044
105047
  key: 0,
105045
105048
  editor: Mn(n),
@@ -101,7 +101,7 @@ img.ProseMirror-separator {
101
101
  `,IJ="️",MJ="‍",Ok="";let vw=null,yw=null;function RJ(s=[]){const e={};js.groups=e;const t=new js;vw==null&&(vw=V3(LJ)),yw==null&&(yw=V3(kJ)),de(t,"'",cw),de(t,"{",mm),de(t,"}",_m),de(t,"[",G0),de(t,"]",Y0),de(t,"(",X0),de(t,")",Z0),de(t,"<",Q0),de(t,">",J0),de(t,"(",ew),de(t,")",tw),de(t,"「",nw),de(t,"」",iw),de(t,"『",sw),de(t,"』",rw),de(t,"<",ow),de(t,">",aw),de(t,"&",lw),de(t,"*",dw),de(t,"@",Ic),de(t,"`",uw),de(t,"^",fw),de(t,":",Mc),de(t,",",Nk),de(t,"$",gw),de(t,".",Jo),de(t,"=",pw),de(t,"!",Dk),de(t,"-",Kr),de(t,"%",bm),de(t,"|",mw),de(t,"+",_w),de(t,"#",bw),de(t,"?",wm),de(t,'"',Tk),de(t,"/",ea),de(t,";",Ik),de(t,"~",Cm),de(t,"_",ww),de(t,"\\",hw),de(t,"・",A3);const n=On(t,al,Lk,{[_k]:!0});On(n,al,n);const i=On(n,ol,M3,{[fm]:!0}),r=On(n,vm,R3,{[gm]:!0}),o=On(t,ol,rl,{[bk]:!0});On(o,al,i),On(o,ol,o),On(i,al,i),On(i,ol,i);const a=On(t,vm,yk,{[wk]:!0});On(a,ol),On(a,al,r),On(a,vm,a),On(r,al,r),On(r,ol),On(r,vm,r);const l=de(t,Ak,Ek,{[vk]:!0}),c=de(t,F3,kk,{[vk]:!0}),d=On(t,Rk,kk,{[vk]:!0});de(t,Ok,d),de(c,Ak,l),de(c,Ok,d),On(c,Rk,d),de(d,F3),de(d,Ak),On(d,Rk,d),de(d,Ok,d);const h=On(t,Mk,O3,{[T3]:!0});de(h,"#"),On(h,Mk,h),de(h,IJ,h);const u=de(h,MJ);de(u,"#"),On(u,Mk,h);const f=[[ol,o],[al,i]],g=[[ol,null],[vm,a],[al,r]];for(let p=0;p<vw.length;p++)Rc(t,vw[p],Sk,rl,f);for(let p=0;p<yw.length;p++)Rc(t,yw[p],xk,yk,g);Yd(Sk,{tld:!0,ascii:!0},e),Yd(xk,{utld:!0,alpha:!0},e),Rc(t,"file",q0,rl,f),Rc(t,"mailto",q0,rl,f),Rc(t,"http",Df,rl,f),Rc(t,"https",Df,rl,f),Rc(t,"ftp",Df,rl,f),Rc(t,"ftps",Df,rl,f),Yd(q0,{scheme:!0,ascii:!0},e),Yd(Df,{slashscheme:!0,ascii:!0},e),s=s.sort((p,m)=>p[0]>m[0]?1:-1);for(let p=0;p<s.length;p++){const m=s[p][0],w=s[p][1]?{[EJ]:!0}:{[NJ]:!0};m.indexOf("-")>=0?w[Ck]=!0:ol.test(m)?al.test(m)?w[fm]=!0:w[bk]=!0:w[_k]=!0,I3(t,m,m,w)}return I3(t,"localhost",pm,{ascii:!0}),t.jd=new js(Cw),{start:t,tokens:Object.assign({groups:e},P3)}}function B3(s,e){const t=AJ(e.replace(/[A-Z]/g,a=>a.toLowerCase())),n=t.length,i=[];let r=0,o=0;for(;o<n;){let a=s,l=null,c=0,d=null,h=-1,u=-1;for(;o<n&&(l=a.go(t[o]));)a=l,a.accepts()?(h=0,u=0,d=a):h>=0&&(h+=t[o].length,u++),c+=t[o].length,r+=t[o].length,o++;r-=h,o-=u,c-=h,i.push({t:d.t,v:e.slice(r-c,r),s:r-c,e:r})}return i}function AJ(s){const e=[],t=s.length;let n=0;for(;n<t;){let i=s.charCodeAt(n),r,o=i<55296||i>56319||n+1===t||(r=s.charCodeAt(n+1))<56320||r>57343?s[n]:s.slice(n,n+2);e.push(o),n+=o.length}return e}function Rc(s,e,t,n,i){let r;const o=e.length;for(let a=0;a<o-1;a++){const l=e[a];s.j[l]?r=s.j[l]:(r=new js(n),r.jr=i.slice(),s.j[l]=r),s=r}return r=new js(t),r.jr=i.slice(),s.j[e[o-1]]=r,r}function V3(s){const e=[],t=[];let n=0,i="0123456789";for(;n<s.length;){let r=0;for(;i.indexOf(s[n+r])>=0;)r++;if(r>0){e.push(t.join(""));for(let o=parseInt(s.substring(n,n+r),10);o>0;o--)t.pop();n+=r}else t.push(s[n]),n++}return e}const ym={defaultProtocol:"http",events:null,format:W3,formatHref:W3,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Pk(s,e=null){let t=Object.assign({},ym);s&&(t=Object.assign(t,s instanceof Pk?s.o:s));const n=t.ignoreTags,i=[];for(let r=0;r<n.length;r++)i.push(n[r].toUpperCase());this.o=t,e&&(this.defaultRender=e),this.ignoreTags=i}Pk.prototype={o:ym,ignoreTags:[],defaultRender(s){return s},check(s){return this.get("validate",s.toString(),s)},get(s,e,t){const n=e!=null;let i=this.o[s];return i&&(typeof i=="object"?(i=t.t in i?i[t.t]:ym[s],typeof i=="function"&&n&&(i=i(e,t))):typeof i=="function"&&n&&(i=i(e,t.t,t)),i)},getObj(s,e,t){let n=this.o[s];return typeof n=="function"&&e!=null&&(n=n(e,t.t,t)),n},render(s){const e=s.render(this);return(this.get("render",null,s)||this.defaultRender)(e,s.t,s)}};function W3(s){return s}function H3(s,e){this.t="token",this.v=s,this.tk=e}H3.prototype={isLink:!1,toString(){return this.v},toHref(s){return this.toString()},toFormattedString(s){const e=this.toString(),t=s.get("truncate",e,this),n=s.get("format",e,this);return t&&n.length>t?n.substring(0,t)+"…":n},toFormattedHref(s){return s.get("formatHref",this.toHref(s.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(s=ym.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(s),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(s){return{type:this.t,value:this.toFormattedString(s),isLink:this.isLink,href:this.toFormattedHref(s),start:this.startIndex(),end:this.endIndex()}},validate(s){return s.get("validate",this.toString(),this)},render(s){const e=this,t=this.toHref(s.get("defaultProtocol")),n=s.get("formatHref",t,this),i=s.get("tagName",t,e),r=this.toFormattedString(s),o={},a=s.get("className",t,e),l=s.get("target",t,e),c=s.get("rel",t,e),d=s.getObj("attributes",t,e),h=s.getObj("events",t,e);return o.href=n,a&&(o.class=a),l&&(o.target=l),c&&(o.rel=c),d&&Object.assign(o,d),{tagName:i,attributes:o,content:r,eventListeners:h}}};function Sw(s,e){class t extends H3{constructor(i,r){super(i,r),this.t=s}}for(const n in e)t.prototype[n]=e[n];return t.t=s,t}const z3=Sw("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),$3=Sw("text"),OJ=Sw("nl"),xw=Sw("url",{isLink:!0,toHref(s=ym.defaultProtocol){return this.hasProtocol()?this.v:`${s}://${this.v}`},hasProtocol(){const s=this.tk;return s.length>=2&&s[0].t!==pm&&s[1].t===Mc}}),qr=s=>new js(s);function PJ({groups:s}){const e=s.domain.concat([lw,dw,Ic,hw,uw,fw,gw,pw,Kr,Lk,bm,mw,_w,bw,ea,Cw,Cm,ww]),t=[cw,Mc,Nk,Jo,Dk,bm,wm,Tk,Ik,Q0,J0,mm,_m,Y0,G0,X0,Z0,ew,tw,nw,iw,sw,rw,ow,aw],n=[lw,cw,dw,hw,uw,fw,gw,pw,Kr,mm,_m,bm,mw,_w,bw,wm,ea,Cw,Cm,ww],i=qr(),r=de(i,Cm);ut(r,n,r),ut(r,s.domain,r);const o=qr(),a=qr(),l=qr();ut(i,s.domain,o),ut(i,s.scheme,a),ut(i,s.slashscheme,l),ut(o,n,r),ut(o,s.domain,o);const c=de(o,Ic);de(r,Ic,c),de(a,Ic,c),de(l,Ic,c);const d=de(r,Jo);ut(d,n,r),ut(d,s.domain,r);const h=qr();ut(c,s.domain,h),ut(h,s.domain,h);const u=de(h,Jo);ut(u,s.domain,h);const f=qr(z3);ut(u,s.tld,f),ut(u,s.utld,f),de(c,pm,f);const g=de(h,Kr);de(g,Kr,g),ut(g,s.domain,h),ut(f,s.domain,h),de(f,Jo,u),de(f,Kr,g);const p=de(f,Mc);ut(p,s.numeric,z3);const m=de(o,Kr),b=de(o,Jo);de(m,Kr,m),ut(m,s.domain,o),ut(b,n,r),ut(b,s.domain,o);const w=qr(xw);ut(b,s.tld,w),ut(b,s.utld,w),ut(w,s.domain,o),ut(w,n,r),de(w,Jo,b),de(w,Kr,m),de(w,Ic,c);const C=de(w,Mc),v=qr(xw);ut(C,s.numeric,v);const S=qr(xw),k=qr();ut(S,e,S),ut(S,t,k),ut(k,e,S),ut(k,t,k),de(w,ea,S),de(v,ea,S);const L=de(a,Mc),E=de(l,Mc),N=de(E,ea),M=de(N,ea);ut(a,s.domain,o),de(a,Jo,b),de(a,Kr,m),ut(l,s.domain,o),de(l,Jo,b),de(l,Kr,m),ut(L,s.domain,S),de(L,ea,S),de(L,wm,S),ut(M,s.domain,S),ut(M,e,S),de(M,ea,S);const O=[[mm,_m],[G0,Y0],[X0,Z0],[Q0,J0],[ew,tw],[nw,iw],[sw,rw],[ow,aw]];for(let I=0;I<O.length;I++){const[F,H]=O[I],j=de(S,F);de(k,F,j),de(j,H,S);const G=qr(xw);ut(j,e,G);const Y=qr();ut(j,t),ut(G,e,G),ut(G,t,Y),ut(Y,e,G),ut(Y,t,Y),de(G,H,S),de(Y,H,S)}return de(i,pm,w),de(i,Ek,OJ),{start:i,tokens:P3}}function FJ(s,e,t){let n=t.length,i=0,r=[],o=[];for(;i<n;){let a=s,l=null,c=null,d=0,h=null,u=-1;for(;i<n&&!(l=a.go(t[i].t));)o.push(t[i++]);for(;i<n&&(c=l||a.go(t[i].t));)l=null,a=c,a.accepts()?(u=0,h=a):u>=0&&u++,i++,d++;if(u<0)i-=d,i<n&&(o.push(t[i]),i++);else{o.length>0&&(r.push(Fk($3,e,o)),o=[]),i-=u,d-=u;const f=h.t,g=t.slice(i-d,i);r.push(Fk(f,e,g))}}return o.length>0&&r.push(Fk($3,e,o)),r}function Fk(s,e,t){const n=t[0].s,i=t[t.length-1].e,r=e.slice(n,i);return new s(r,t)}const BJ=typeof console<"u"&&console&&console.warn||(()=>{}),VJ="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",bn={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function WJ(){return js.groups={},bn.scanner=null,bn.parser=null,bn.tokenQueue=[],bn.pluginQueue=[],bn.customSchemes=[],bn.initialized=!1,bn}function U3(s,e=!1){if(bn.initialized&&BJ(`linkifyjs: already initialized - will not register custom scheme "${s}" ${VJ}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(s))throw new Error(`linkifyjs: incorrect scheme format.
102
102
  1. Must only contain digits, lowercase ASCII letters or "-"
103
103
  2. Cannot start or end with "-"
104
- 3. "-" cannot repeat`);bn.customSchemes.push([s,e])}function HJ(){bn.scanner=RJ(bn.customSchemes);for(let s=0;s<bn.tokenQueue.length;s++)bn.tokenQueue[s][1]({scanner:bn.scanner});bn.parser=PJ(bn.scanner.tokens);for(let s=0;s<bn.pluginQueue.length;s++)bn.pluginQueue[s][1]({scanner:bn.scanner,parser:bn.parser});return bn.initialized=!0,bn}function Bk(s){return bn.initialized||HJ(),FJ(bn.parser.start,s,B3(bn.scanner.start,s))}Bk.scan=B3;function j3(s,e=null,t=null){if(e&&typeof e=="object"){if(t)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);t=e,e=null}const n=new Pk(t),i=Bk(s),r=[];for(let o=0;o<i.length;o++){const a=i[o];a.isLink&&(!e||a.t===e)&&n.check(a)&&r.push(a.toFormattedObject(n))}return r}var Vk="[\0-   ᠎ -\u2029  ]",zJ=new RegExp(Vk),$J=new RegExp(`${Vk}$`),UJ=new RegExp(Vk,"g");function jJ(s){return s.length===1?s[0].isLink:s.length===3&&s[1].isLink?["()","[]"].includes(s[0].value+s[2].value):!1}function KJ(s){return new yn({key:new Gn("autolink"),appendTransaction:(e,t,n)=>{const i=e.some(c=>c.docChanged)&&!t.doc.eq(n.doc),r=e.some(c=>c.getMeta("preventAutolink"));if(!i||r)return;const{tr:o}=n,a=S4(t.doc,[...e]);if(O4(a).forEach(({newRange:c})=>{const d=YY(n.doc,c,f=>f.isTextblock);let h,u;if(d.length>1)h=d[0],u=n.doc.textBetween(h.pos,h.pos+h.node.nodeSize,void 0," ");else if(d.length){const f=n.doc.textBetween(c.from,c.to," "," ");if(!$J.test(f))return;h=d[0],u=n.doc.textBetween(h.pos,c.to,void 0," ")}if(h&&u){const f=u.split(zJ).filter(Boolean);if(f.length<=0)return!1;const g=f[f.length-1],p=h.pos+u.lastIndexOf(g);if(!g)return!1;const m=Bk(g).map(b=>b.toObject(s.defaultProtocol));if(!jJ(m))return!1;m.filter(b=>b.isLink).map(b=>({...b,from:p+b.start+1,to:p+b.end+1})).filter(b=>n.schema.marks.code?!n.doc.rangeHasMark(b.from,b.to,n.schema.marks.code):!0).filter(b=>s.validate(b.value)).filter(b=>s.shouldAutoLink(b.value)).forEach(b=>{tk(b.from,b.to,n.doc).some(w=>w.mark.type===s.type)||o.addMark(b.from,b.to,s.type.create({href:b.href}))})}}),!!o.steps.length)return o}})}function qJ(s){return new yn({key:new Gn("handleClickLink"),props:{handleClick:(e,t,n)=>{var i,r;if(n.button!==0||!e.editable)return!1;let o=null;if(n.target instanceof HTMLAnchorElement)o=n.target;else{let d=n.target;const h=[];for(;d.nodeName!=="DIV";)h.push(d),d=d.parentNode;o=h.find(u=>u.nodeName==="A")}if(!o)return!1;const a=A4(e.state,s.type.name),l=(i=o?.href)!=null?i:a.href,c=(r=o?.target)!=null?r:a.target;return s.enableClickSelection&&s.editor.commands.extendMarkRange(s.type.name),o&&l?(window.open(l,c),!0):!1}}})}function GJ(s){return new yn({key:new Gn("handlePasteLink"),props:{handlePaste:(e,t,n)=>{const{state:i}=e,{selection:r}=i,{empty:o}=r;if(o)return!1;let a="";n.content.forEach(c=>{a+=c.textContent});const l=j3(a,{defaultProtocol:s.defaultProtocol}).find(c=>c.isLink&&c.value===a);return!a||!l?!1:s.editor.commands.setMark(s.type,{href:l.href})}}})}function Xd(s,e){const t=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(n=>{const i=typeof n=="string"?n:n.scheme;i&&t.push(i)}),!s||s.replace(UJ,"").match(new RegExp(`^(?:(?:${t.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var K3=_o.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(s=>{if(typeof s=="string"){U3(s);return}U3(s.scheme,s.optionalSlashes)})},onDestroy(){WJ()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(s,e)=>!!Xd(s,e.protocols),validate:s=>!!s,shouldAutoLink:s=>!!s}},addAttributes(){return{href:{default:null,parseHTML(s){return s.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:s=>{const e=s.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:t=>!!Xd(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:s}){return this.options.isAllowedUri(s.href,{defaultValidate:e=>!!Xd(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",$t(this.options.HTMLAttributes,s),0]:["a",$t(this.options.HTMLAttributes,{...s,href:""}),0]},addCommands(){return{setLink:s=>({chain:e})=>{const{href:t}=s;return this.options.isAllowedUri(t,{defaultValidate:n=>!!Xd(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,s).setMeta("preventAutolink",!0).run():!1},toggleLink:s=>({chain:e})=>{const{href:t}=s||{};return t&&!this.options.isAllowedUri(t,{defaultValidate:n=>!!Xd(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,s,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:s})=>s().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[Dc({find:s=>{const e=[];if(s){const{protocols:t,defaultProtocol:n}=this.options,i=j3(s).filter(r=>r.isLink&&this.options.isAllowedUri(r.value,{defaultValidate:o=>!!Xd(o,t),protocols:t,defaultProtocol:n}));i.length&&i.forEach(r=>e.push({text:r.value,data:{href:r.href},index:r.start}))}return e},type:this.type,getAttributes:s=>{var e;return{href:(e=s.data)==null?void 0:e.href}}})]},addProseMirrorPlugins(){const s=[],{protocols:e,defaultProtocol:t}=this.options;return this.options.autolink&&s.push(KJ({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:n=>this.options.isAllowedUri(n,{defaultValidate:i=>!!Xd(i,e),protocols:e,defaultProtocol:t}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&s.push(qJ({type:this.type,editor:this.editor,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&s.push(GJ({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),s}}),YJ=Object.defineProperty,XJ=(s,e)=>{for(var t in e)YJ(s,t,{get:e[t],enumerable:!0})},ZJ="listItem",q3="textStyle",G3=/^\s*([-+*])\s$/,Y3=Ni.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:s}){return["ul",$t(this.options.HTMLAttributes,s),0]},addCommands(){return{toggleBulletList:()=>({commands:s,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(ZJ,this.editor.getAttributes(q3)).run():s.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let s=Ef({find:G3,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(s=Ef({find:G3,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(q3),editor:this.editor})),[s]}}),X3=Ni.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:s}){return["li",$t(this.options.HTMLAttributes,s),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)}}}),QJ={};XJ(QJ,{findListItemPos:()=>Sm,getNextListDepth:()=>Wk,handleBackspace:()=>Hk,handleDelete:()=>zk,hasListBefore:()=>Z3,hasListItemAfter:()=>JJ,hasListItemBefore:()=>Q3,listItemHasSubList:()=>J3,nextListIsDeeper:()=>eF,nextListIsHigher:()=>tF});var Sm=(s,e)=>{const{$from:t}=e.selection,n=ii(s,e.schema);let i=null,r=t.depth,o=t.pos,a=null;for(;r>0&&a===null;)i=t.node(r),i.type===n?a=r:(r-=1,o-=1);return a===null?null:{$pos:e.doc.resolve(o),depth:a}},Wk=(s,e)=>{const t=Sm(s,e);if(!t)return!1;const[,n]=sX(e,s,t.$pos.pos+4);return n},Z3=(s,e,t)=>{const{$anchor:n}=s.selection,i=Math.max(0,n.pos-2),r=s.doc.resolve(i).node();return!(!r||!t.includes(r.type.name))},Q3=(s,e)=>{var t;const{$anchor:n}=e.selection,i=e.doc.resolve(n.pos-2);return!(i.index()===0||((t=i.nodeBefore)==null?void 0:t.type.name)!==s)},J3=(s,e,t)=>{if(!t)return!1;const n=ii(s,e.schema);let i=!1;return t.descendants(r=>{r.type===n&&(i=!0)}),i},Hk=(s,e,t)=>{if(s.commands.undoInputRule())return!0;if(s.state.selection.from!==s.state.selection.to)return!1;if(!Nc(s.state,e)&&Z3(s.state,e,t)){const{$anchor:a}=s.state.selection,l=s.state.doc.resolve(a.before()-1),c=[];l.node().descendants((u,f)=>{u.type.name===e&&c.push({node:u,pos:f})});const d=c.at(-1);if(!d)return!1;const h=s.state.doc.resolve(l.start()+d.pos+1);return s.chain().cut({from:a.start()-1,to:a.end()+1},h.end()).joinForward().run()}if(!Nc(s.state,e)||!lX(s.state))return!1;const n=Sm(e,s.state);if(!n)return!1;const r=s.state.doc.resolve(n.$pos.pos-2).node(n.depth),o=J3(e,s.state,r);return Q3(e,s.state)&&!o?s.commands.joinItemBackward():s.chain().liftListItem(e).run()},eF=(s,e)=>{const t=Wk(s,e),n=Sm(s,e);return!n||!t?!1:t>n.depth},tF=(s,e)=>{const t=Wk(s,e),n=Sm(s,e);return!n||!t?!1:t<n.depth},zk=(s,e)=>{if(!Nc(s.state,e)||!aX(s.state,e))return!1;const{selection:t}=s.state,{$from:n,$to:i}=t;return!t.empty&&n.sameParent(i)?!1:eF(e,s.state)?s.chain().focus(s.state.selection.from+4).lift(e).joinBackward().run():tF(e,s.state)?s.chain().joinForward().joinBackward().run():s.commands.joinItemForward()},JJ=(s,e)=>{var t;const{$anchor:n}=e.selection,i=e.doc.resolve(n.pos-n.parentOffset-2);return!(i.index()===i.parent.childCount-1||((t=i.nodeAfter)==null?void 0:t.type.name)!==s)},nF=Gt.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:s})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t})=>{s.state.schema.nodes[t]!==void 0&&zk(s,t)&&(e=!0)}),e},"Mod-Delete":({editor:s})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t})=>{s.state.schema.nodes[t]!==void 0&&zk(s,t)&&(e=!0)}),e},Backspace:({editor:s})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t,wrapperNames:n})=>{s.state.schema.nodes[t]!==void 0&&Hk(s,t,n)&&(e=!0)}),e},"Mod-Backspace":({editor:s})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t,wrapperNames:n})=>{s.state.schema.nodes[t]!==void 0&&Hk(s,t,n)&&(e=!0)}),e}}}}),eee="listItem",iF="textStyle",sF=/^(\d+)\.\s$/,rF=Ni.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:s=>s.hasAttribute("start")?parseInt(s.getAttribute("start")||"",10):1},type:{default:null,parseHTML:s=>s.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:s}){const{start:e,...t}=s;return e===1?["ol",$t(this.options.HTMLAttributes,t),0]:["ol",$t(this.options.HTMLAttributes,s),0]},addCommands(){return{toggleOrderedList:()=>({commands:s,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(eee,this.editor.getAttributes(iF)).run():s.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let s=Ef({find:sF,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(s=Ef({find:sF,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(iF)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[s]}}),tee=/^\s*(\[([( |x])?\])\s$/,nee=Ni.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:s=>{const e=s.getAttribute("data-checked");return e===""||e==="true"},renderHTML:s=>({"data-checked":s.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:s,HTMLAttributes:e}){return["li",$t(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:s.attrs.checked?"checked":null}],["span"]],["div",0]]},addKeyboardShortcuts(){const s={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...s,Tab:()=>this.editor.commands.sinkListItem(this.name)}:s},addNodeView(){return({node:s,HTMLAttributes:e,getPos:t,editor:n})=>{const i=document.createElement("li"),r=document.createElement("label"),o=document.createElement("span"),a=document.createElement("input"),l=document.createElement("div"),c=d=>{var h,u;a.ariaLabel=((u=(h=this.options.a11y)==null?void 0:h.checkboxLabel)==null?void 0:u.call(h,d,a.checked))||`Task item checkbox for ${d.textContent||"empty task item"}`};return c(s),r.contentEditable="false",a.type="checkbox",a.addEventListener("mousedown",d=>d.preventDefault()),a.addEventListener("change",d=>{if(!n.isEditable&&!this.options.onReadOnlyChecked){a.checked=!a.checked;return}const{checked:h}=d.target;n.isEditable&&typeof t=="function"&&n.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:u})=>{const f=t();if(typeof f!="number")return!1;const g=u.doc.nodeAt(f);return u.setNodeMarkup(f,void 0,{...g?.attrs,checked:h}),!0}).run(),!n.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(s,h)||(a.checked=!a.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([d,h])=>{i.setAttribute(d,h)}),i.dataset.checked=s.attrs.checked,a.checked=s.attrs.checked,r.append(a,o),i.append(r,l),Object.entries(e).forEach(([d,h])=>{i.setAttribute(d,h)}),{dom:i,contentDOM:l,update:d=>d.type!==this.type?!1:(i.dataset.checked=d.attrs.checked,a.checked=d.attrs.checked,c(d),!0)}}},addInputRules(){return[Ef({find:tee,type:this.type,getAttributes:s=>({checked:s[s.length-1]==="x"})})]}}),iee=Ni.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:s}){return["ul",$t(this.options.HTMLAttributes,s,{"data-type":this.name}),0]},addCommands(){return{toggleTaskList:()=>({commands:s})=>s.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});Gt.create({name:"listKit",addExtensions(){const s=[];return this.options.bulletList!==!1&&s.push(Y3.configure(this.options.bulletList)),this.options.listItem!==!1&&s.push(X3.configure(this.options.listItem)),this.options.listKeymap!==!1&&s.push(nF.configure(this.options.listKeymap)),this.options.orderedList!==!1&&s.push(rF.configure(this.options.orderedList)),this.options.taskItem!==!1&&s.push(nee.configure(this.options.taskItem)),this.options.taskList!==!1&&s.push(iee.configure(this.options.taskList)),s}});var oF=Ni.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:s}){return["p",$t(this.options.HTMLAttributes,s),0]},addCommands(){return{setParagraph:()=>({commands:s})=>s.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),see=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,ree=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,oee=_o.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:s=>s.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:s}){return["s",$t(this.options.HTMLAttributes,s),0]},addCommands(){return{setStrike:()=>({commands:s})=>s.setMark(this.name),toggleStrike:()=>({commands:s})=>s.toggleMark(this.name),unsetStrike:()=>({commands:s})=>s.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[qd({find:see,type:this.type})]},addPasteRules(){return[Dc({find:ree,type:this.type})]}}),aee=Ni.create({name:"text",group:"inline"}),lee=_o.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:s=>s.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:s}){return["u",$t(this.options.HTMLAttributes,s),0]},addCommands(){return{setUnderline:()=>({commands:s})=>s.setMark(this.name),toggleUnderline:()=>({commands:s})=>s.toggleMark(this.name),unsetUnderline:()=>({commands:s})=>s.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function cee(s={}){return new yn({view(e){return new dee(e,s)}})}class dee{constructor(e,t){var n;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(n=t.width)!==null&&n!==void 0?n:1,this.color=t.color===!1?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let r=o=>{this[i](o)};return e.dom.addEventListener(i,r),{name:i,handler:r}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,n,i=this.editorView.dom,r=i.getBoundingClientRect(),o=r.width/i.offsetWidth,a=r.height/i.offsetHeight;if(t){let h=e.nodeBefore,u=e.nodeAfter;if(h||u){let f=this.editorView.nodeDOM(this.cursorPos-(h?h.nodeSize:0));if(f){let g=f.getBoundingClientRect(),p=h?g.bottom:g.top;h&&u&&(p=(p+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let m=this.width/2*a;n={left:g.left,right:g.right,top:p-m,bottom:p+m}}}}if(!n){let h=this.editorView.coordsAtPos(this.cursorPos),u=this.width/2*o;n={left:h.left-u,right:h.left+u,top:h.top,bottom:h.bottom}}let l=this.editorView.dom.offsetParent;this.element||(this.element=l.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",t),this.element.classList.toggle("prosemirror-dropcursor-inline",!t);let c,d;if(!l||l==document.body&&getComputedStyle(l).position=="static")c=-pageXOffset,d=-pageYOffset;else{let h=l.getBoundingClientRect(),u=h.width/l.offsetWidth,f=h.height/l.offsetHeight;c=h.left-l.scrollLeft*u,d=h.top-l.scrollTop*f}this.element.style.left=(n.left-c)/o+"px",this.element.style.top=(n.top-d)/a+"px",this.element.style.width=(n.right-n.left)/o+"px",this.element.style.height=(n.bottom-n.top)/a+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),i=n&&n.type.spec.disableDropCursor,r=typeof i=="function"?i(this.editorView,t,e):i;if(t&&!r){let o=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=PP(this.editorView.state.doc,o,this.editorView.dragging.slice);a!=null&&(o=a)}this.setCursor(o),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class Pn extends je{constructor(e){super(e,e)}map(e,t){let n=e.resolve(t.map(this.head));return Pn.valid(n)?new Pn(n):je.near(n)}content(){return _e.empty}eq(e){return e instanceof Pn&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Pn(e.resolve(t.pos))}getBookmark(){return new $k(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!hee(e)||!uee(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let i=t.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,t,n=!1){e:for(;;){if(!n&&Pn.valid(e))return e;let i=e.pos,r=null;for(let o=e.depth;;o--){let a=e.node(o);if(t>0?e.indexAfter(o)<a.childCount:e.index(o)>0){r=a.child(t>0?e.indexAfter(o):e.index(o)-1);break}else if(o==0)return null;i+=t;let l=e.doc.resolve(i);if(Pn.valid(l))return l}for(;;){let o=t>0?r.firstChild:r.lastChild;if(!o){if(r.isAtom&&!r.isText&&!Be.isSelectable(r)){e=e.doc.resolve(i+r.nodeSize*t),n=!1;continue e}break}r=o,i+=t;let a=e.doc.resolve(i);if(Pn.valid(a))return a}return null}}}Pn.prototype.visible=!1,Pn.findFrom=Pn.findGapCursorFrom,je.jsonID("gapcursor",Pn);class $k{constructor(e){this.pos=e}map(e){return new $k(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return Pn.valid(t)?new Pn(t):je.near(t)}}function hee(s){for(let e=s.depth;e>=0;e--){let t=s.index(e),n=s.node(e);if(t==0){if(n.type.spec.isolating)return!0;continue}for(let i=n.child(t-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function uee(s){for(let e=s.depth;e>=0;e--){let t=s.indexAfter(e),n=s.node(e);if(t==n.childCount){if(n.type.spec.isolating)return!0;continue}for(let i=n.child(t);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function fee(){return new yn({props:{decorations:_ee,createSelectionBetween(s,e,t){return e.pos==t.pos&&Pn.valid(t)?new Pn(t):null},handleClick:pee,handleKeyDown:gee,handleDOMEvents:{beforeinput:mee}}})}const gee=$L({ArrowLeft:Lw("horiz",-1),ArrowRight:Lw("horiz",1),ArrowUp:Lw("vert",-1),ArrowDown:Lw("vert",1)});function Lw(s,e){const t=s=="vert"?e>0?"down":"up":e>0?"right":"left";return function(n,i,r){let o=n.selection,a=e>0?o.$to:o.$from,l=o.empty;if(o instanceof Ve){if(!r.endOfTextblock(t)||a.depth==0)return!1;l=!1,a=n.doc.resolve(e>0?a.after():a.before())}let c=Pn.findGapCursorFrom(a,e,l);return c?(i&&i(n.tr.setSelection(new Pn(c))),!0):!1}}function pee(s,e,t){if(!s||!s.editable)return!1;let n=s.state.doc.resolve(e);if(!Pn.valid(n))return!1;let i=s.posAtCoords({left:t.clientX,top:t.clientY});return i&&i.inside>-1&&Be.isSelectable(s.state.doc.nodeAt(i.inside))?!1:(s.dispatch(s.state.tr.setSelection(new Pn(n))),!0)}function mee(s,e){if(e.inputType!="insertCompositionText"||!(s.state.selection instanceof Pn))return!1;let{$from:t}=s.state.selection,n=t.parent.contentMatchAt(t.index()).findWrapping(s.state.schema.nodes.text);if(!n)return!1;let i=te.empty;for(let o=n.length-1;o>=0;o--)i=te.from(n[o].createAndFill(null,i));let r=s.state.tr.replace(t.pos,t.pos,new _e(i,0,0));return r.setSelection(Ve.near(r.doc.resolve(t.pos+1))),s.dispatch(r),!1}function _ee(s){if(!(s.selection instanceof Pn))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",hn.create(s.doc,[Ei.widget(s.selection.head,e,{key:"gapcursor"})])}var kw=200,Di=function(){};Di.prototype.append=function(e){return e.length?(e=Di.from(e),!this.length&&e||e.length<kw&&this.leafAppend(e)||this.length<kw&&e.leafPrepend(this)||this.appendInner(e)):this},Di.prototype.prepend=function(e){return e.length?Di.from(e).append(this):this},Di.prototype.appendInner=function(e){return new bee(this,e)},Di.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?Di.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},Di.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Di.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},Di.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var i=[];return this.forEach(function(r,o){return i.push(e(r,o))},t,n),i},Di.from=function(e){return e instanceof Di?e:e&&e.length?new aF(e):Di.empty};var aF=(function(s){function e(n){s.call(this),this.values=n}s&&(e.__proto__=s),e.prototype=Object.create(s&&s.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,r){return i==0&&r==this.length?this:new e(this.values.slice(i,r))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,r,o,a){for(var l=r;l<o;l++)if(i(this.values[l],a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(i,r,o,a){for(var l=r-1;l>=o;l--)if(i(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=kw)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=kw)return new e(i.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e})(Di);Di.empty=new aF([]);var bee=(function(s){function e(t,n){s.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return s&&(e.__proto__=s),e.prototype=Object.create(s&&s.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(n){return n<this.left.length?this.left.get(n):this.right.get(n-this.left.length)},e.prototype.forEachInner=function(n,i,r,o){var a=this.left.length;if(i<a&&this.left.forEachInner(n,i,Math.min(r,a),o)===!1||r>a&&this.right.forEachInner(n,Math.max(i-a,0),Math.min(this.length,r)-a,o+a)===!1)return!1},e.prototype.forEachInvertedInner=function(n,i,r,o){var a=this.left.length;if(i>a&&this.right.forEachInvertedInner(n,i-a,Math.max(r,a)-a,o+a)===!1||r<a&&this.left.forEachInvertedInner(n,Math.min(i,a),r,o)===!1)return!1},e.prototype.sliceInner=function(n,i){if(n==0&&i==this.length)return this;var r=this.left.length;return i<=r?this.left.slice(n,i):n>=r?this.right.slice(n-r,i-r):this.left.slice(n,r).append(this.right.slice(0,i-r))},e.prototype.leafAppend=function(n){var i=this.right.leafAppend(n);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(n){var i=this.left.leafPrepend(n);if(i)return new e(i,this.right)},e.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new e(this.left,new e(this.right,n)):new e(this,n)},e})(Di);const wee=500;class wo{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let n=this.items.length;for(;;n--)if(this.items.get(n-1).selection){--n;break}let i,r;t&&(i=this.remapping(n,this.items.length),r=i.maps.length);let o=e.tr,a,l,c=[],d=[];return this.items.forEach((h,u)=>{if(!h.step){i||(i=this.remapping(n,u+1),r=i.maps.length),r--,d.push(h);return}if(i){d.push(new ta(h.map));let f=h.step.map(i.slice(r)),g;f&&o.maybeStep(f).doc&&(g=o.mapping.maps[o.mapping.maps.length-1],c.push(new ta(g,void 0,void 0,c.length+d.length))),r--,g&&i.appendMap(g,r)}else o.maybeStep(h.step);if(h.selection)return a=i?h.selection.map(i.slice(r)):h.selection,l=new wo(this.items.slice(0,n).append(d.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:o,selection:a}}addTransform(e,t,n,i){let r=[],o=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null;for(let d=0;d<e.steps.length;d++){let h=e.steps[d].invert(e.docs[d]),u=new ta(e.mapping.maps[d],h,t),f;(f=l&&l.merge(u))&&(u=f,d?r.pop():a=a.slice(0,a.length-1)),r.push(u),t&&(o++,t=void 0),i||(l=u)}let c=o-n.depth;return c>vee&&(a=Cee(a,c),o-=c),new wo(a.append(r),o)}remapping(e,t){let n=new Xp;return this.items.forEach((i,r)=>{let o=i.mirrorOffset!=null&&r-i.mirrorOffset>=e?n.maps.length-i.mirrorOffset:void 0;n.appendMap(i.map,o)},e,t),n}addMaps(e){return this.eventCount==0?this:new wo(this.items.append(e.map(t=>new ta(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],i=Math.max(0,this.items.length-t),r=e.mapping,o=e.steps.length,a=this.eventCount;this.items.forEach(u=>{u.selection&&a--},i);let l=t;this.items.forEach(u=>{let f=r.getMirror(--l);if(f==null)return;o=Math.min(o,f);let g=r.maps[f];if(u.step){let p=e.steps[f].invert(e.docs[f]),m=u.selection&&u.selection.map(r.slice(l+1,f));m&&a++,n.push(new ta(g,p,m))}else n.push(new ta(g))},i);let c=[];for(let u=t;u<o;u++)c.push(new ta(r.maps[u]));let d=this.items.slice(0,i).append(c).append(n),h=new wo(d,a);return h.emptyItemCount()>wee&&(h=h.compress(this.items.length-n.length)),h}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,i=[],r=0;return this.items.forEach((o,a)=>{if(a>=e)i.push(o),o.selection&&r++;else if(o.step){let l=o.step.map(t.slice(n)),c=l&&l.getMap();if(n--,c&&t.appendMap(c,n),l){let d=o.selection&&o.selection.map(t.slice(n));d&&r++;let h=new ta(c.invert(),l,d),u,f=i.length-1;(u=i.length&&i[f].merge(h))?i[f]=u:i.push(h)}}else o.map&&n--},this.items.length,0),new wo(Di.from(i.reverse()),r)}}wo.empty=new wo(Di.empty,0);function Cee(s,e){let t;return s.forEach((n,i)=>{if(n.selection&&e--==0)return t=i,!1}),s.slice(t)}class ta{constructor(e,t,n,i){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new ta(t.getMap().invert(),t,this.selection)}}}class Ac{constructor(e,t,n,i,r){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=i,this.prevComposition=r}}const vee=20;function yee(s,e,t,n){let i=t.getMeta(Zd),r;if(i)return i.historyState;t.getMeta(Lee)&&(s=new Ac(s.done,s.undone,null,0,-1));let o=t.getMeta("appendedTransaction");if(t.steps.length==0)return s;if(o&&o.getMeta(Zd))return o.getMeta(Zd).redo?new Ac(s.done.addTransform(t,void 0,n,Ew(e)),s.undone,lF(t.mapping.maps),s.prevTime,s.prevComposition):new Ac(s.done,s.undone.addTransform(t,void 0,n,Ew(e)),null,s.prevTime,s.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let a=t.getMeta("composition"),l=s.prevTime==0||!o&&s.prevComposition!=a&&(s.prevTime<(t.time||0)-n.newGroupDelay||!See(t,s.prevRanges)),c=o?Uk(s.prevRanges,t.mapping):lF(t.mapping.maps);return new Ac(s.done.addTransform(t,l?e.selection.getBookmark():void 0,n,Ew(e)),wo.empty,c,t.time,a??s.prevComposition)}else return(r=t.getMeta("rebased"))?new Ac(s.done.rebased(t,r),s.undone.rebased(t,r),Uk(s.prevRanges,t.mapping),s.prevTime,s.prevComposition):new Ac(s.done.addMaps(t.mapping.maps),s.undone.addMaps(t.mapping.maps),Uk(s.prevRanges,t.mapping),s.prevTime,s.prevComposition)}function See(s,e){if(!e)return!1;if(!s.docChanged)return!0;let t=!1;return s.mapping.maps[0].forEach((n,i)=>{for(let r=0;r<e.length;r+=2)n<=e[r+1]&&i>=e[r]&&(t=!0)}),t}function lF(s){let e=[];for(let t=s.length-1;t>=0&&e.length==0;t--)s[t].forEach((n,i,r,o)=>e.push(r,o));return e}function Uk(s,e){if(!s)return null;let t=[];for(let n=0;n<s.length;n+=2){let i=e.map(s[n],1),r=e.map(s[n+1],-1);i<=r&&t.push(i,r)}return t}function xee(s,e,t){let n=Ew(e),i=Zd.get(e).spec.config,r=(t?s.undone:s.done).popEvent(e,n);if(!r)return null;let o=r.selection.resolve(r.transform.doc),a=(t?s.done:s.undone).addTransform(r.transform,e.selection.getBookmark(),i,n),l=new Ac(t?a:r.remaining,t?r.remaining:a,null,0,-1);return r.transform.setSelection(o).setMeta(Zd,{redo:t,historyState:l})}let jk=!1,cF=null;function Ew(s){let e=s.plugins;if(cF!=e){jk=!1,cF=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){jk=!0;break}}return jk}const Zd=new Gn("history"),Lee=new Gn("closeHistory");function kee(s={}){return s={depth:s.depth||100,newGroupDelay:s.newGroupDelay||500},new yn({key:Zd,state:{init(){return new Ac(wo.empty,wo.empty,null,0,-1)},apply(e,t,n){return yee(t,n,e,s)}},config:s,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,i=n=="historyUndo"?hF:n=="historyRedo"?uF:null;return i?(t.preventDefault(),i(e.state,e.dispatch)):!1}}}})}function dF(s,e){return(t,n)=>{let i=Zd.getState(t);if(!i||(s?i.undone:i.done).eventCount==0)return!1;if(n){let r=xee(i,t,s);r&&n(e?r.scrollIntoView():r)}return!0}}const hF=dF(!1,!0),uF=dF(!0,!0);Gt.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:s=>s.length,wordCounter:s=>s.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=s=>{const e=s?.node||this.editor.state.doc;if((s?.mode||this.options.mode)==="textSize"){const n=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(n)}return e.nodeSize},this.storage.words=s=>{const e=s?.node||this.editor.state.doc,t=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(t)}},addProseMirrorPlugins(){let s=!1;return[new yn({key:new Gn("characterCount"),appendTransaction:(e,t,n)=>{if(s)return;const i=this.options.limit;if(i==null||i===0){s=!0;return}const r=this.storage.characters({node:n.doc});if(r>i){const o=r-i,a=0,l=o;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);const c=n.tr.deleteRange(a,l);return s=!0,c}s=!0},filterTransaction:(e,t)=>{const n=this.options.limit;if(!e.docChanged||n===0||n===null||n===void 0)return!0;const i=this.storage.characters({node:t.doc}),r=this.storage.characters({node:e.doc});if(r<=n||i>n&&r>n&&r<=i)return!0;if(i>n&&r>n&&r>i||!e.getMeta("paste"))return!1;const a=e.selection.$head.pos,l=r-n,c=a-l,d=a;return e.deleteRange(c,d),!(this.storage.characters({node:e.doc})>n)}})]}});var Eee=Gt.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[cee(this.options)]}});Gt.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new yn({key:new Gn("focus"),props:{decorations:({doc:s,selection:e})=>{const{isEditable:t,isFocused:n}=this.editor,{anchor:i}=e,r=[];if(!t||!n)return hn.create(s,[]);let o=0;this.options.mode==="deepest"&&s.descendants((l,c)=>{if(l.isText)return;if(!(i>=c&&i<=c+l.nodeSize-1))return!1;o+=1});let a=0;return s.descendants((l,c)=>{if(l.isText||!(i>=c&&i<=c+l.nodeSize-1))return!1;if(a+=1,this.options.mode==="deepest"&&o-a>0||this.options.mode==="shallowest"&&a>1)return this.options.mode==="deepest";r.push(Ei.node(c,c+l.nodeSize,{class:this.options.className}))}),hn.create(s,r)}}})]}});var Nee=Gt.create({name:"gapCursor",addProseMirrorPlugins(){return[fee()]},extendNodeSchema(s){var e;const t={name:s.name,options:s.options,storage:s.storage};return{allowGapCursor:(e=Wt(Pe(s,"allowGapCursor",t)))!=null?e:null}}});Gt.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new yn({key:new Gn("placeholder"),props:{decorations:({doc:s,selection:e})=>{const t=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:n}=e,i=[];if(!t)return null;const r=this.editor.isEmpty;return s.descendants((o,a)=>{const l=n>=a&&n<=a+o.nodeSize,c=!o.isLeaf&&A0(o);if((l||!this.options.showOnlyCurrent)&&c){const d=[this.options.emptyNodeClass];r&&d.push(this.options.emptyEditorClass);const h=Ei.node(a,a+o.nodeSize,{class:d.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:o,pos:a,hasAnchor:l}):this.options.placeholder});i.push(h)}return this.options.includeChildren}),hn.create(s,i)}}})]}}),Gt.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:s,options:e}=this;return[new yn({key:new Gn("selection"),props:{decorations(t){return t.selection.empty||s.isFocused||!s.isEditable||W4(t.selection)||s.view.dragging?null:hn.create(t.doc,[Ei.inline(t.selection.from,t.selection.to,{class:e.className})])}}})]}});function fF({types:s,node:e}){return e&&Array.isArray(s)&&s.includes(e.type)||e?.type===s}var Dee=Gt.create({name:"trailingNode",addOptions(){return{node:"paragraph",notAfter:[]}},addProseMirrorPlugins(){const s=new Gn(this.name),e=Object.entries(this.editor.schema.nodes).map(([,t])=>t).filter(t=>(this.options.notAfter||[]).concat(this.options.node).includes(t.name));return[new yn({key:s,appendTransaction:(t,n,i)=>{const{doc:r,tr:o,schema:a}=i,l=s.getState(i),c=r.content.size,d=a.nodes[this.options.node];if(l)return o.insert(c,d.create())},state:{init:(t,n)=>{const i=n.tr.doc.lastChild;return!fF({node:i,types:e})},apply:(t,n)=>{if(!t.docChanged)return n;const i=t.doc.lastChild;return!fF({node:i,types:e})}}})]}}),Tee=Gt.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:s,dispatch:e})=>hF(s,e),redo:()=>({state:s,dispatch:e})=>uF(s,e)}},addProseMirrorPlugins(){return[kee(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()}}}),Iee=Gt.create({name:"starterKit",addExtensions(){var s,e,t,n;const i=[];return this.options.bold!==!1&&i.push(dJ.configure(this.options.bold)),this.options.blockquote!==!1&&i.push(rJ.configure(this.options.blockquote)),this.options.bulletList!==!1&&i.push(Y3.configure(this.options.bulletList)),this.options.code!==!1&&i.push(fJ.configure(this.options.code)),this.options.codeBlock!==!1&&i.push(mJ.configure(this.options.codeBlock)),this.options.document!==!1&&i.push(_J.configure(this.options.document)),this.options.dropcursor!==!1&&i.push(Eee.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&i.push(Nee.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&i.push(bJ.configure(this.options.hardBreak)),this.options.heading!==!1&&i.push(D3.configure(this.options.heading)),this.options.undoRedo!==!1&&i.push(Tee.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&i.push(wJ.configure(this.options.horizontalRule)),this.options.italic!==!1&&i.push(xJ.configure(this.options.italic)),this.options.listItem!==!1&&i.push(X3.configure(this.options.listItem)),this.options.listKeymap!==!1&&i.push(nF.configure((s=this.options)==null?void 0:s.listKeymap)),this.options.link!==!1&&i.push(K3.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&i.push(rF.configure(this.options.orderedList)),this.options.paragraph!==!1&&i.push(oF.configure(this.options.paragraph)),this.options.strike!==!1&&i.push(oee.configure(this.options.strike)),this.options.text!==!1&&i.push(aee.configure(this.options.text)),this.options.underline!==!1&&i.push(lee.configure((t=this.options)==null?void 0:t.underline)),this.options.trailingNode!==!1&&i.push(Dee.configure((n=this.options)==null?void 0:n.trailingNode)),i}}),Mee=Iee,Ree=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,Aee=Ni.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},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:s}){return["img",$t(this.options.HTMLAttributes,s)]},addCommands(){return{setImage:s=>({commands:e})=>e.insertContent({type:this.name,attrs:s})}},addInputRules(){return[s3({find:Ree,type:this.type,getAttributes:s=>{const[,,e,t,n]=s;return{src:t,alt:e,title:n}}})]}}),Oee=Gt.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:s=>{const e=s.style.textAlign;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:s=>s.textAlign?{style:`text-align: ${s.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:s=>({commands:e})=>this.options.alignments.includes(s)?this.options.types.map(t=>e.updateAttributes(t,{textAlign:s})).every(t=>t):!1,unsetTextAlign:()=>({commands:s})=>this.options.types.map(e=>s.resetAttributes(e,"textAlign")).every(e=>e),toggleTextAlign:s=>({editor:e,commands:t})=>this.options.alignments.includes(s)?e.isActive({textAlign:s})?t.unsetTextAlign():t.setTextAlign(s):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}});const Pee=async s=>{try{const e=new FormData;return e.append("unique","true"),e.append("file",s),(await(await fetch("/file/upload/uploads?id=&form=&table=",{method:"POST",body:e})).json())?.result}catch(e){console.error(e)}},Fee=async(s,e)=>{const t=e.clipboardData?.items;if(t){const n=e.clipboardData?.getData("text/html"),i=e.clipboardData?.getData("text/plain");if(n){const{state:r,dispatch:o}=s,{tr:a}=r,l=gf.fromSchema(s.state.schema),c=new DOMParser().parseFromString(n,"text/html").body,d=l.parse(c),h=a.replaceSelectionWith(d);return o(h),e.preventDefault(),!0}if(i){const{state:r,dispatch:o}=s,{tr:a}=r,l=a.insertText(i,r.selection.from,r.selection.to);return o(l),e.preventDefault(),!0}for(let r=0;r<t.length;r++){const o=t[r];if(o.type.startsWith("image/")){const a=o.getAsFile();if(a){const l=await Pee(a),{schema:c}=s.state,d=c.nodes.image.create({src:l?.file_path}),h=s.state.tr.replaceSelectionWith(d);return s.dispatch(h),e.preventDefault(),!0}}}}return!1},Bee={1:"font-weight:700; font-size:30px;",2:"font-weight:700; font-size:26px;",3:"font-weight:700; font-size:22px;",4:"font-weight:700; font-size:18px;",5:"font-weight:500; font-size:16px;",6:"font-weight:400; font-size:14px;"},Vee=D3.extend({addOptions(){return{...this.parent?.(),levels:[1,2,3,4,5,6]}}}).extend({addAttributes(){return{...this.parent?.(),level:{default:1,renderHTML:s=>{const e=s.level||1;return{class:`heading-level-${e}`,style:Bee[e-1]}}}}}}),Wee=oF.configure({HTMLAttributes:{style:"min-height: 1rem;"}});function Hee(s){let e=!1;const t=PZ({content:s.modelValue,extensions:[Mee.configure({history:{depth:100,newGroupDelay:500},code:{HTMLAttributes:{class:"editor-code"}},codeBlock:{HTMLAttributes:{class:"editor-codeblock"}},paragraph:!1,heading:!1,link:!1}),iJ,nJ,jZ,Wee,Vee,tJ,Aee,Oee.configure({types:["heading","paragraph"]}),K3.configure({HTMLAttributes:{class:"editor-link"},openOnClick:!1,autolink:!0}),QQ.configure({table:{HTMLAttributes:{class:"editor-content"},resizable:!0}})],editorProps:{handlePaste:Fee}}),n=y.computed(()=>t.value||null);return y.watch(t,r=>{r&&t.value.on("update",o=>{if(!e){e=!0;const a=o.editor.getHTML();s.modelValue,setTimeout(()=>{e=!1},10)}})}),{editor:t,editorInstance:n,focusEditor:()=>{t.value&&!t.value.isFocused&&t.value.commands.focus()}}}function zee(s){const e=y.ref(!1),t=y.ref(""),n=y.ref(null);return{isHtmlMode:e,htmlContent:t,htmlTextarea:n,toggleHtmlMode:o=>{e.value=o,o?(s.value&&(t.value=s.value.getHTML()),y.nextTick(()=>{n.value&&(n.value.focus(),setTimeout(()=>{n.value.formatCode()},100))})):s.value&&t.value&&s.value.commands.setContent(t.value,!0)},onHtmlInput:()=>{}}}function $ee(){const s=y.ref(!1);return{isFullscreen:s,toggleFullscreen:()=>{s.value=!s.value}}}const wn=(s,e)=>{const t=s.__vccOpts||s;for(const[n,i]of e)t[n]=i;return t},Uee={props:{editor:Object},methods:{toggleBlockquote(){this.editor&&this.editor.chain().toggleBlockquote().run()}}};function jee(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("button",{title:"Blockquote",onClick:e[0]||(e[0]=(...o)=>r.toggleBlockquote&&r.toggleBlockquote(...o)),class:"text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100 focus:outline-none"},[...e[1]||(e[1]=[y.createElementVNode("svg",{height:"16",width:"16",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[y.createElementVNode("path",{"fill-rule":"evenodd",d:"M6 6a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h3a3 3 0 0 1-3 3H5a1 1 0 1 0 0 2h1a5 5 0 0 0 5-5V8a2 2 0 0 0-2-2H6Zm9 0a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h3a3 3 0 0 1-3 3h-1a1 1 0 1 0 0 2h1a5 5 0 0 0 5-5V8a2 2 0 0 0-2-2h-3Z"})],-1)])])}const Kee=wn(Uee,[["render",jee]]),qee={props:{editor:Object},methods:{toggleBulletList(){this.editor&&this.editor.chain().focus().toggleBulletList().run()}}};function Gee(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("button",{title:"Bullet List",onClick:e[0]||(e[0]=(...o)=>r.toggleBulletList&&r.toggleBulletList(...o)),class:"text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100"},[...e[1]||(e[1]=[y.createElementVNode("svg",{height:"16",width:"16",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[y.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-width":"2",d:"M9 8h10M9 12h10M9 16h10M4.99 8H5m-.02 4h.01m0 4H5"})],-1)])])}const Yee=wn(qee,[["render",Gee]]),Xee={props:{editor:Object},methods:{toggleOrderedList(){this.editor&&this.editor.chain().focus().toggleOrderedList().run()}}};function Zee(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("button",{title:"Ordered List",onClick:e[0]||(e[0]=(...o)=>r.toggleOrderedList&&r.toggleOrderedList(...o)),class:"text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100"},[...e[1]||(e[1]=[y.createElementVNode("svg",{height:"16",width:"16",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[y.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 6h8m-8 6h8m-8 6h8M4 16a2 2 0 1 1 3.321 1.5L4 20h5M4 5l2-1v6m-2 0h4"})],-1)])])}const Qee=wn(Xee,[["render",Zee]]),Jee={props:{editor:Object},methods:{toggleCodeBlock(){this.editor&&this.editor.chain().focus().toggleCodeBlock().run()}}};function ete(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("button",{title:"Code Block",onClick:e[0]||(e[0]=(...o)=>r.toggleCodeBlock&&r.toggleCodeBlock(...o)),class:"text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100"},[...e[1]||(e[1]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 24 24"},[y.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m8 8-4 4 4 4m8 0 4-4-4-4m-2-3-4 14"})],-1)])])}const tte=wn(Jee,[["render",ete]]),nte={props:{editor:Object},methods:{toggleBold(){this.editor&&this.editor.commands.toggleBold()}}};function ite(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("button",{title:"Bold Text",onClick:e[0]||(e[0]=(...o)=>r.toggleBold&&r.toggleBold(...o)),class:y.normalizeClass(["h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100",{"bg-gray-100 text-gray-900":t.editor?.isActive("bold")}])},[...e[1]||(e[1]=[y.createElementVNode("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 24 24"},[y.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 5h4.5a3.5 3.5 0 1 1 0 7H8m0-7v7m0-7H6m2 7h6.5a3.5 3.5 0 1 1 0 7H8m0-7v7m0 0H6"})],-1),y.createElementVNode("span",{class:"sr-only"},"Bold",-1)])],2)}const ste=wn(nte,[["render",ite]]),rte={props:{editor:Object},methods:{toggleItalic(){this.editor&&this.editor.chain().toggleItalic().run()}}};function ote(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("button",{title:"Italic Text",onClick:e[0]||(e[0]=(...o)=>r.toggleItalic&&r.toggleItalic(...o)),class:y.normalizeClass(["h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100",{"bg-gray-100 text-gray-900":t.editor?.isActive("italic")}])},[...e[1]||(e[1]=[y.createElementVNode("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 24 24"},[y.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m8.874 19 6.143-14M6 19h6.33m-.66-14H18"})],-1),y.createElementVNode("span",{class:"sr-only"},"Italic",-1)])],2)}const ate=wn(rte,[["render",ote]]),lte={__name:"vs-editor-underline",props:{editor:Object},setup(s){const e=s,t=()=>{e.editor&&e.editor.chain().focus().toggleUnderline().run()};return(n,i)=>(y.openBlock(),y.createElementBlock("button",{title:"Underline",onClick:t,class:y.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100",[s.editor?.isActive("underline")?"bg-gray-100 text-gray-900":"text-gray-500"]])},[...i[0]||(i[0]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("path",{d:"M6 4v6a6 6 0 0 0 12 0V4"}),y.createElementVNode("line",{x1:"4",x2:"20",y1:"20",y2:"20"})],-1)])],2))}},cte={__name:"vs-editor-strike",props:{editor:Object},setup(s){const e=s,t=()=>{e.editor&&e.editor.chain().focus().toggleStrike().run()};return(n,i)=>(y.openBlock(),y.createElementBlock("button",{title:"Strikethrough",onClick:t,class:y.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100",[s.editor?.isActive("strike")?"bg-gray-100 text-gray-900":"text-gray-500"]])},[...i[0]||(i[0]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-strikethrough"},[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.createElementVNode("path",{d:"M5 12l14 0"}),y.createElementVNode("path",{d:"M16 6.5a4 2 0 0 0 -4 -1.5h-1a3.5 3.5 0 0 0 0 7h2a3.5 3.5 0 0 1 0 7h-1.5a4 2 0 0 1 -4 -1.5"})],-1)])],2))}},dte={props:{visible:{type:Boolean,default:()=>!1},modelValue:{type:Boolean,default:()=>!1},title:{type:String,default:()=>""},size:{type:String,default:()=>""},closeClickBack:{type:Boolean,default:()=>!1}},emits:["update:visible","update:modelValue","onClose","confirm","cancel"],inheritAttrs:!1,name:"vs-dialog",mounted(){window.addEventListener("keydown",this.checkKey)},unmounted(){window.removeEventListener("keydown",this.checkKey)},computed:{hasSlot(){return!!this.$slots?.footer},checkSize(){return this.size==="small"?"md:w-5/12 w-9/12":this.size==="medium"?"md:w-6/12 w-9/12":"lg:w-7/12 w-11/12"}},methods:{checkKey({key:s}){s==="Escape"&&this.handleClose()},handleClose(){this.$emit("update:visible",!1),this.$emit("update:modelValue",!1),this.$emit("onClose")},handleConfirm(){this.$emit("confirm"),this.handleClose()},handleCancel(){this.$emit("cancel"),this.handleClose()},closeByClickBack(s,e){e&&s.target.classList.contains("vs-dialog-overlay")&&this.handleClose()}}},hte={key:0,class:"vsTailwind ui-dialog__wrapper"},ute={class:"py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]"},fte={class:"font-medium text-gray-800 dark:text-[#ffffff]"},gte={class:"ui-dialog__content p-4"},pte={key:0,class:"flex justify-end gap-x-2"};function mte(s,e,t,n,i,r){return y.openBlock(),y.createBlock(y.Teleport,{to:"body"},[t.visible||t.modelValue?(y.openBlock(),y.createElementBlock("div",hte,[y.createElementVNode("div",{onMousedown:e[1]||(e[1]=o=>r.closeByClickBack(o,t.closeClickBack)),class:"vs-dialog-overlay vs-dialog w-full h-full fixed top-0 start-0 z-[80] bg-black bg-opacity-50"},[y.createVNode(y.Transition,{name:"content",appear:""},{default:y.withCtx(()=>[y.createElementVNode("div",{class:y.normalizeClass(["ui-dialog__modal opacity-1 flex flex-col bg-white dark:bg-[#1A1A1A] border dark:border-[#454545] pointer-events-auto shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-xl",[r.checkSize]])},[y.createElementVNode("div",ute,[y.createElementVNode("h3",fte,y.toDisplayString(t.title),1),y.createElementVNode("button",{type:"button",class:"size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600",onClick:e[0]||(e[0]=(...o)=>r.handleClose&&r.handleClose(...o))},[...e[2]||(e[2]=[y.createElementVNode("span",{class:"sr-only"},"Close",-1),y.createElementVNode("svg",{class:"flex-shrink-0 w-4 h-4",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("path",{d:"M18 6 6 18"}),y.createElementVNode("path",{d:"m6 6 12 12"})],-1)])])]),y.createElementVNode("div",gte,[y.renderSlot(s.$slots,"default",{},void 0,!0)]),r.hasSlot?(y.openBlock(),y.createElementBlock("div",pte,[y.renderSlot(s.$slots,"footer",{handleClose:r.handleClose,handleConfirm:r.handleConfirm,handleCancel:r.handleCancel},void 0,!0)])):y.createCommentVNode("",!0)],2)]),_:3})],32)])):y.createCommentVNode("",!0)])}const gF=wn(dte,[["render",mte],["__scopeId","data-v-479158fb"]]),_te={},bte={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-x"};function wte(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("svg",bte,[...e[0]||(e[0]=[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),y.createElementVNode("path",{d:"M18 6l-12 12"},null,-1),y.createElementVNode("path",{d:"M6 6l12 12"},null,-1)])])}const Cte=wn(_te,[["render",wte]]),vte={},yte={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-search"};function Ste(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("svg",yte,[...e[0]||(e[0]=[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),y.createElementVNode("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"},null,-1),y.createElementVNode("path",{d:"M21 21l-6 -6"},null,-1)])])}const xte=wn(vte,[["render",Ste]]),Lte={},kte={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-mail"};function Ete(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("svg",kte,[...e[0]||(e[0]=[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),y.createElementVNode("path",{d:"M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10z"},null,-1),y.createElementVNode("path",{d:"M3 7l9 6l9 -6"},null,-1)])])}const Nte=wn(Lte,[["render",Ete]]),Dte=y.defineComponent({components:{IconClose:Cte,IconSearch:xte,IconEmail:Nte},inheritAttrs:!1,props:{icon:{type:String,default:()=>""},disabled:{type:Boolean,default:()=>!1},clearable:{type:Boolean,default:()=>!1},modelValue:{type:String,default:()=>""},placeholder:{type:String,default:()=>""},iconPosition:{type:String,default:()=>"right"},type:{type:String,default:()=>"text"},style:{type:Object,default:()=>null},size:{type:String,default:()=>"md"},attrs:{type:Object,default:()=>{}}},emits:["onInput","update:modelValue","blur","focus"],computed:{checkSize(){if((this.style?.size||this.size)==="xs")return"h-[32px] text-sm";if((this.style?.size||this.size)==="md")return"h-[38px] text-sm";this.style?.size||this.size},value:{get(){return this.modelValue},set(s){this.$emit("update:modelValue",s.trim())}},clearIconStyle(){return[{"right-8":this.icon&&this.iconPosition==="right","right-3":!this.icon||this.iconPosition!=="right","pointer-events-none":this.disabled}]},iconStylePosition(){return[{"left-3":this.icon&&this.iconPosition==="left","right-3":this.icon&&this.iconPosition==="right"}]},inputStyle(){return[{"!pr-8":this.clearable&&!this.icon,"!pr-7":this.clearable,"!pr-16":this.clearable&&this.icon&&this.iconPosition==="right","!pl-8":this.icon&&this.iconPosition==="left","!pr-[50px]":this.clearable&&this.value&&this.icon&&this.iconPosition==="right","!cursor-not-allowed bg-slate-100":this.disabled,"bg-white":!this.disabled}]}},methods:{handleInput(){this.$emit("onInput",this.modelValue)},handleBlur(){this.$emit("blur")},handleFocus(){this.$emit("focus")},clearInput(){this.$emit("update:modelValue",""),this.$emit("onInput","")},async inputFocus(){const{vsText:s}=await this.$refs;await s.focus()}}}),Tte={class:"vs-form-text relative bg-white rounded-lg"},Ite={key:2,class:"absolute bottom-2/4 translate-y-2/4 left-[10px] cursor-pointer"},Mte=["disabled","type","placeholder"];function Rte(s,e,t,n,i,r){const o=y.resolveComponent("IconClose"),a=y.resolveComponent("IconSearch"),l=y.resolveComponent("IconEmail");return y.openBlock(),y.createElementBlock("div",Tte,[s.clearable&&s.value?(y.openBlock(),y.createElementBlock("div",{key:0,class:"absolute bottom-2/4 translate-y-2/4 right-3 cursor-pointer",onClick:e[0]||(e[0]=(...c)=>s.clearInput&&s.clearInput(...c))},[y.createVNode(o,{width:"15px",height:"15px",class:"stroke-gray-500 hover:stroke-red-500 transition-all"})])):y.createCommentVNode("",!0),s.icon&&s.icon==="search"?(y.openBlock(),y.createElementBlock("div",{key:1,class:y.normalizeClass(["absolute bottom-2/4 translate-y-2/4 cursor-pointer",s.iconStylePosition])},[y.createVNode(a,{width:"15px",height:"15px",class:"stroke-gray-500 transition-all"})],2)):s.icon&&s.icon==="email"?(y.openBlock(),y.createElementBlock("div",Ite,[y.createVNode(l,{width:"16",height:"16",class:"stroke-gray-500 transition-all"})])):(y.openBlock(),y.createElementBlock("i",{key:3,class:y.normalizeClass(["absolute bottom-2/4 translate-y-2/4 text-gray-500 cursor-pointer",["ti "+s.icon,s.iconStylePosition]])},null,2)),s.clearable&&s.value?(y.openBlock(),y.createElementBlock("div",{key:4,class:"absolute bottom-2/4 translate-y-2/4 right-3 cursor-pointer",onClick:e[1]||(e[1]=(...c)=>s.clearInput&&s.clearInput(...c))},[y.createVNode(o,{width:"15px",height:"15px",class:"stroke-gray-500 hover:stroke-red-500 transition-all"})])):y.createCommentVNode("",!0),y.withDirectives(y.createElementVNode("input",y.mergeProps({ref:"vsText",disabled:s.disabled,type:s.type,onInput:e[2]||(e[2]=(...c)=>s.handleInput&&s.handleInput(...c)),placeholder:s.placeholder,"onUpdate:modelValue":e[3]||(e[3]=c=>s.value=c)},s.style?.attrs||s.attrs||{},{onFocus:e[4]||(e[4]=(...c)=>s.handleFocus&&s.handleFocus(...c)),onBlur:e[5]||(e[5]=(...c)=>s.handleBlur&&s.handleBlur(...c)),class:[[s.inputStyle,s.checkSize],"py-2 px-3 block w-full border border-solid placeholder:text-nowrap border-stone-200 rounded-lg text-sm text-stone-800 placeholder:text-stone-400 focus:outline focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"]}),null,16,Mte),[[y.vModelDynamic,s.value]])])}const pF=wn(Dte,[["render",Rte],["__scopeId","data-v-749b581f"]]);function Kk(){const s=y.ref("en");return{t:t=>({en:{type_tag:"Type Tag",heading_1:"Heading 1",heading_2:"Heading 2",heading_3:"Heading 3",paragraph:"Paragraph",createTable:"Create Table",addColumn:"Add Column",addRow:"Add Row",deleteColumn:"Delete Column",deleteRow:"Delete Row",deleteTable:"Delete Table",mergeCells:"Merge Cells",splitCells:"Split Cells",linkTitle:"Enter Link"},uk:{type_tag:"Тип тегу",heading_1:"Заголовок 1",heading_2:"Заголовок 2",heading_3:"Заголовок 3",paragraph:"Параграф",createTable:"Створити Таблицю",addColumn:"Додати Колону",addRow:"Додати Рядок",deleteColumn:"Вилучити Колону",deleteRow:"Вилучити Рядок",deleteTable:"Вилучити Таблицю",mergeCells:"Об'єднати Клітинки",splitCells:"Розділити Клітинки",linkTitle:"Введіть Посилання"}})[s.value]?.[t]||t,locale:s}}const Ate={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"},Ote=Object.assign({inheritAttrs:!1},{__name:"vs-editor-link",props:{editor:Object},setup(s){const{t:e}=Kk(),t=s,n=y.ref(!1),i=y.ref(""),r=()=>{t.editor.chain().focus().toggleLink({href:i.value}).run(),n.value=!1,i.value=""};return(o,a)=>(y.openBlock(),y.createElementBlock(y.Fragment,null,[y.createElementVNode("button",{title:"Link",onClick:a[0]||(a[0]=l=>n.value=!0),class:"text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100 focus:outline-none"},[...a[4]||(a[4]=[y.createElementVNode("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 24 24"},[y.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13.213 9.787a3.391 3.391 0 0 0-4.795 0l-3.425 3.426a3.39 3.39 0 0 0 4.795 4.794l.321-.304m-.321-4.49a3.39 3.39 0 0 0 4.795 0l3.424-3.426a3.39 3.39 0 0 0-4.794-4.795l-1.028.961"})],-1)])]),y.createVNode(gF,{title:y.unref(e)("linkTitle"),visible:n.value,"onUpdate:visible":a[3]||(a[3]=l=>n.value=l),size:"small"},{footer:y.withCtx(()=>[y.createElementVNode("div",Ate,[y.createElementVNode("button",{style:{border:"1px solid #000"},onClick:a[2]||(a[2]=l=>{n.value=!1,i.value=""}),class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-black border-gray-200 rounded-lg !border-gray-200 hover:bg-gray-100 duration-300"},y.toDisplayString(y.unref(e)("cancel")),1),y.createElementVNode("button",{onClick:r,class:"py-2 px-3 inline-flex items-center gap-x-2 text-[14px] font-[400] whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"},y.toDisplayString(y.unref(e)("create")),1)])]),default:y.withCtx(()=>[y.createVNode(pF,{modelValue:i.value,"onUpdate:modelValue":a[1]||(a[1]=l=>i.value=l),placeholder:y.unref(e)("linkTitle")},null,8,["modelValue","placeholder"])]),_:1},8,["title","visible"])],64))}}),xm=async(s,e,t,n=10)=>{if(!e||!t)return;await y.nextTick();const i=await t?.getBoundingClientRect(),r=await e?.getBoundingClientRect();if(!r||!i)return;const o=await parseInt(e?.getBoundingClientRect()?.height),a=await parseInt(e?.getBoundingClientRect()?.width),l=await parseInt(t?.getBoundingClientRect()?.height),c=await parseInt(t?.getBoundingClientRect()?.width),d=await window.innerHeight,h=await window.innerWidth;let u=0,f=0;const g=r.bottom+n+l;switch(s){case"top":r.top-i.height-n<0?u=r.top-i.height+n+l+o:u=r.top-i.height-n,h>c+r.right+30?f=r.left-i.width/2+r.width/2:f=h-30-c;break;case"bottom":d>g?u=r.bottom+n:u=r.bottom-n-l-o,f=r.left-i.width/2+r.width/2;break;case"left":u=r.top-i.height/2+r.height/2,r.left-i.width-n>0?f=r.left-i.width-n:f=10;break;case"right":u=r.top-i.height/2+r.height/2,h-a>c?f=r.right+n:f=h-30-c;break;case"top-right":r.top-i.height-n<0?u=r.top-i.height+n+l+o:u=r.top-i.height-n,h-a>c?f=r.right+n:f=h-30-c;break;case"top-left":r.top-i.height-n<0?u=r.top-i.height+n+l+o:u=r.top-i.height-n,r.left-i.width-n>0?f=r.left-i.width-n:f=10;break;case"top-start":r.top-i.height-n<0?u=r.top-i.height+n+l+o:u=r.top-i.height-n,r.left>0?f=r.left:f=10;break;case"bottom-right":d>g?u=r.bottom+n:u=r.bottom-n-l-o,h-a>c?f=r.left:f=h-30-c;break;case"bottom-left":d>g?u=r.bottom+n:u=r.bottom-n-l-o,r.left>0?f=r.right-c:f=10;break;case"bottom-start":d>g?u=r.bottom+n:u=r.bottom-n-l-o,r.left>0?f=r.left:f=10;break}u+l>d?u=d-l-n:u<0&&(u=n),f+c>h?f=h-c-n:f<0&&(f=n),t instanceof HTMLElement&&(t.style.top=`${u}px`,t.style.left=`${f}px`,t.style.position="fixed")},Pte={class:"text-center"},Fte={class:"py-2 px-4 w-full text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-lg focus:outline-none focus:bg-stone-100 dark:bg-neutral-900 dark:text-neutral-200 dark:focus:bg-neutral-800 after:h-4 after:absolute after:-bottom-4 after:start-0 after:w-full before:h-4 before:absolute before:-top-4 before:start-0 before:w-full"},Oc=Object.assign({inheritAttrs:!1},{__name:"vs-popover",props:{isOpen:{type:Boolean,default:()=>!1},placement:{type:String,default:"top"},gap:{type:Number,default:8},width:{type:[String,Number],default:""},disabled:{type:Boolean,default:!1},trigger:{type:String,default:"click"},teleport:{type:String,default:"body"}},emits:["isvisible"],setup(s,{expose:e,emit:t}){const n=s,i=t,r=y.ref(!1),o=y.ref([]),a=y.ref(null),l=y.ref(null),c=y.ref(null);y.watch(r,C=>{C?(d(),window.addEventListener("resize",()=>xm(n.placement,l.value,c.value)),xm(n.placement,l.value,c.value)):window.removeEventListener("resize",()=>xm(n.placement,l.value,c.value)),i("isvisible",C)}),y.onMounted(()=>{window.addEventListener("click",m),window.addEventListener("popstate",b),window.addEventListener("scroll",w,!0),d()}),y.onBeforeUnmount(()=>{window.removeEventListener("click",m),window.removeEventListener("popstate",b),h()});const d=()=>{let C=a.value;for(;C&&C!==document.body;)(C.scrollHeight>C.clientHeight||C.scrollWidth>C.clientWidth)&&(C.addEventListener("scroll",p),o.value.push(C)),C=C.parentElement;document.body&&(document.body.addEventListener("scroll",p),o.value.push(document.body))},h=()=>{o.value.forEach(C=>{C.removeEventListener("scroll",p)}),o.value=[]},u=()=>{r.value=!0,xm(n.placement,l.value,c.value)},f=()=>{r.value=!1},g=async()=>{await xm(n.placement,l.value,c.value),r.value=!r.value},p=()=>{r.value=!1},m=C=>{if(!C){r.value=!1;return}l.value?.contains(C.target)||c.value?.contains(C.target)||(r.value=!1)},b=()=>{r.value&&(r.value=!1)},w=C=>{r.value&&c.value&&!c.value.contains(C.target)&&(r.value=!1)};return e({togglePopover:g}),(C,v)=>(y.openBlock(),y.createElementBlock("div",{ref_key:"popover",ref:a,class:"vs-popover inline-block"},[y.createElementVNode("div",Pte,[s.trigger==="click"?(y.openBlock(),y.createElementBlock("div",{key:0,ref_key:"popoverRef",ref:l,onClick:g,class:y.normalizeClass({"pointer-events-none":s.disabled})},[y.renderSlot(C.$slots,"reference",{},()=>[v[0]||(v[0]=y.createElementVNode("button",null,"Click me!",-1))])],2)):y.createCommentVNode("",!0),s.trigger==="hover"?(y.openBlock(),y.createElementBlock("div",{key:1,ref_key:"popoverRef",ref:l,onMouseover:u,onMouseleave:f,class:y.normalizeClass({"pointer-events-none":s.disabled})},[y.renderSlot(C.$slots,"reference",{},()=>[v[1]||(v[1]=y.createElementVNode("button",null,"Click me!",-1))])],34)):y.createCommentVNode("",!0),(y.openBlock(),y.createBlock(y.Teleport,{to:s.teleport},[y.createVNode(y.Transition,{name:"fade"},{default:y.withCtx(()=>[y.withDirectives(y.createElementVNode("div",{class:y.normalizeClass(["vsTailwind vs-popover__content",s.placement]),ref_key:"contentPop",ref:c,style:y.normalizeStyle({width:s.width?s.width+"px":"fit-content",zIndex:10002})},[y.createElementVNode("div",Fte,[y.renderSlot(C.$slots,"default",{},()=>[v[2]||(v[2]=y.createElementVNode("span",null,"Popover content",-1))])])],6),[[y.vShow,r.value]])]),_:3})],8,["to"]))])],512))}}),Bte={class:"flex flex-col gap-[2px] p-[2px]"},Vte=["onClick"],Wte={__name:"vs-editor-table",props:{editor:Object},setup(s){const{t:e}=Kk(),t=s,n=y.ref(!1),i=y.ref("popover"),r=()=>{t.editor&&(t.editor.chain().focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run(),i.value.togglePopover())},o=()=>{t.editor&&(t.editor.chain().focus().addColumnAfter().run(),i.value.togglePopover())},a=()=>{t.editor&&(t.editor.chain().focus().addRowAfter().run(),i.value.togglePopover())},l=()=>{t.editor&&(t.editor.chain().focus().deleteColumn().run(),i.value.togglePopover())},c=()=>{t.editor&&(t.editor.chain().focus().deleteRow().run(),i.value.togglePopover())},d=()=>{t.editor&&(t.editor.chain().focus().deleteTable().run(),i.value.togglePopover())},h=()=>{t.editor&&(t.editor.chain().focus().mergeCells().run(),i.value.togglePopover())},u=()=>{t.editor&&(t.editor.chain().focus().splitCell().run(),i.value.togglePopover())},f=y.computed(()=>[{text:e("createTable"),function:r},{text:e("addColumn"),function:o},{text:e("addRow"),function:a},{text:e("deleteColumn"),function:l},{text:e("deleteRow"),function:c},{text:e("deleteTable"),function:d},{text:e("mergeCells"),function:h},{text:e("splitCells"),function:u}]);return(g,p)=>(y.openBlock(),y.createBlock(Oc,{ref_key:"popover",ref:i,placement:"bottom",onIsvisible:p[0]||(p[0]=m=>n.value=m)},{reference:y.withCtx(()=>[y.createElementVNode("button",{title:"Table",class:y.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded-full hover:text-gray-900 hover:bg-gray-100",[n.value?"bg-gray-100 text-gray-900":"text-gray-500"]])},[...p[1]||(p[1]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-table"},[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.createElementVNode("path",{d:"M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14z"}),y.createElementVNode("path",{d:"M3 10h18"}),y.createElementVNode("path",{d:"M10 3v18"})],-1)])],2)]),default:y.withCtx(()=>[y.createElementVNode("div",Bte,[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(f.value,(m,b)=>(y.openBlock(),y.createElementBlock("button",{key:b,onClick:m?.function,class:"px-2 py-1 text-gray-500 text-start hover:text-gray-900 hover:bg-gray-100 rounded"},y.toDisplayString(m.text),9,Vte))),128))])]),_:1},512))}},Hte={},zte={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-align-center"};function $te(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("svg",zte,[...e[0]||(e[0]=[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),y.createElementVNode("path",{d:"M4 6l16 0"},null,-1),y.createElementVNode("path",{d:"M8 12l8 0"},null,-1),y.createElementVNode("path",{d:"M6 18l12 0"},null,-1)])])}const Ute=wn(Hte,[["render",$te]]),jte={},Kte={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-align-right"};function qte(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("svg",Kte,[...e[0]||(e[0]=[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),y.createElementVNode("path",{d:"M4 6l16 0"},null,-1),y.createElementVNode("path",{d:"M10 12l10 0"},null,-1),y.createElementVNode("path",{d:"M6 18l14 0"},null,-1)])])}const Gte=wn(jte,[["render",qte]]),Yte={},Xte={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-align-left"};function Zte(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("svg",Xte,[...e[0]||(e[0]=[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),y.createElementVNode("path",{d:"M4 6l16 0"},null,-1),y.createElementVNode("path",{d:"M4 12l10 0"},null,-1),y.createElementVNode("path",{d:"M4 18l14 0"},null,-1)])])}const Qte=wn(Yte,[["render",Zte]]),Jte={},ene={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-align-justify"};function tne(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("svg",ene,[...e[0]||(e[0]=[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),y.createElementVNode("path",{d:"M4 6h16"},null,-1),y.createElementVNode("path",{d:"M4 12h16"},null,-1),y.createElementVNode("path",{d:"M4 18h16"},null,-1)])])}const mF={left:Qte,center:Ute,right:Gte,justify:wn(Jte,[["render",tne]])},nne={class:"flex gap-[4px] p-1"},ine=["title","onClick"],sne={__name:"vs-editor-align",props:{editor:Object},setup(s){const e=s,t=y.ref(!1),n=y.ref("popover"),i=y.ref("left"),r=y.computed(()=>e.editor?.isActive("left")),o=y.computed(()=>e.editor?.isActive("right")),a=y.computed(()=>e.editor?.isActive("center")),l=y.computed(()=>e.editor?.isActive("justify")),c=h=>{e.editor&&e.editor.chain().focus().setTextAlign(h).run()},d=y.ref([{id:"left",isActive:r},{id:"center",isActive:a},{id:"right",isActive:o},{id:"justify",isActive:l}]);return(h,u)=>(y.openBlock(),y.createBlock(Oc,{ref_key:"popover",ref:n,placement:"bottom",onIsvisible:u[0]||(u[0]=f=>t.value=f)},{reference:y.withCtx(()=>[y.createElementVNode("button",{title:"Text Align",class:y.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded-full hover:text-gray-900 hover:bg-gray-100",[t.value?"bg-gray-100 text-gray-900":"text-gray-500"]])},[(y.openBlock(),y.createBlock(y.resolveDynamicComponent(y.unref(mF)[i.value]),{height:"16",width:"16"}))],2)]),default:y.withCtx(()=>[y.createElementVNode("div",nne,[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(d.value,f=>(y.openBlock(),y.createElementBlock("button",{title:"Text align "+f?.id,class:y.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded hover:text-gray-900 hover:bg-gray-100",{"bg-gray-100 text-gray-900":f?.isActive}]),key:f?.id,onClick:g=>c(f?.id)},[(y.openBlock(),y.createBlock(y.resolveDynamicComponent(y.unref(mF)[f?.id]),{height:"16",width:"16"}))],10,ine))),128))])]),_:1},512))}},rne={class:"flex flex-col gap-[2px] p-[2px]"},one=["onClick"],ane={__name:"vs-editor-type-tag",props:{editor:Object},setup(s){const{t:e}=Kk(),t=s,n=y.ref(!1),i=y.ref("popover"),r=()=>{t.editor&&(t.editor?.chain().focus().setParagraph().run(),i.value.togglePopover())},o=l=>{t.editor&&(t.editor?.chain().focus().toggleHeading({level:l}).run(),i.value.togglePopover())},a=y.computed(()=>[{text:e("richtext.heading1"),id:1,style:"font-[700] text-[30px]"},{text:e("richtext.heading2"),id:2,style:"font-[700] text-[26px]"},{text:e("richtext.heading3"),id:3,style:"font-[700] text-[22px]"},{text:e("richtext.heading4"),id:4,style:"font-[700] text-[18px]"},{text:e("richtext.heading5"),id:5,style:"font-[500] text-[16px]"},{text:e("richtext.heading6"),id:6,style:"font-[400] text-[14px]"}]);return(l,c)=>(y.openBlock(),y.createBlock(Oc,{ref_key:"popover",ref:i,placement:"bottom",onIsvisible:c[0]||(c[0]=d=>n.value=d)},{reference:y.withCtx(()=>[y.createElementVNode("button",{title:"Type Tag",class:y.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded-full hover:text-gray-900 hover:bg-gray-100",[n.value?"bg-gray-100 text-gray-900":"text-gray-500"]])},[...c[1]||(c[1]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-text-size"},[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.createElementVNode("path",{d:"M3 7v-2h13v2"}),y.createElementVNode("path",{d:"M10 5v14"}),y.createElementVNode("path",{d:"M12 19h-4"}),y.createElementVNode("path",{d:"M15 13v-1h6v1"}),y.createElementVNode("path",{d:"M18 12v7"}),y.createElementVNode("path",{d:"M17 19h2"})],-1)])],2)]),default:y.withCtx(()=>[y.createElementVNode("div",rne,[y.createElementVNode("button",{onClick:r,class:y.normalizeClass(["px-2 py-1 text-gray-500 text-start hover:text-gray-900 hover:bg-gray-100 rounded",[s.editor?.isActive("paragraph")?"bg-gray-100":""]])},y.toDisplayString(y.unref(e)("richtext.paragraph")),3),(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(a.value,(d,h)=>(y.openBlock(),y.createElementBlock("button",{key:h,onClick:u=>o(d?.id),class:y.normalizeClass(["px-2 py-1 text-gray-500 text-start hover:text-gray-900 hover:bg-gray-100 rounded leading-[100%]",[d?.style,s.editor?.isActive("heading",{level:d?.id})?"bg-gray-100":""]])},y.toDisplayString(y.unref(e)(`richtext.heading${d?.id}`)),11,one))),128))])]),_:1},512))}},lne={},cne={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-check"};function dne(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("svg",cne,[...e[0]||(e[0]=[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),y.createElementVNode("path",{d:"M5 12l5 5l10 -10"},null,-1)])])}const Lm=wn(lne,[["render",dne]]),hne={components:{VsText:pF},inheritAttrs:!1,events:["update:modelValue"],props:{modelValue:{type:String},disabled:{type:Boolean,default:()=>!1},clearable:{type:Boolean,default:()=>!1},isTextInputShown:{type:Boolean,default:()=>!0}},computed:{value:{get(){return this.modelValue},set(s){this.$emit("update:modelValue",s)}}}},une={class:"flex items-center w-full max-w-[182px]"},fne=["disabled"];function gne(s,e,t,n,i,r){const o=y.resolveComponent("vs-text");return y.openBlock(),y.createElementBlock("div",une,[y.withDirectives(y.createElementVNode("input",{"onUpdate:modelValue":e[0]||(e[0]=a=>r.value=a),type:"color",class:y.normalizeClass(["w-[38px] h-[38px] min-h-[38px] min-w-[38px] py-[2px] px-[3px] -ml-1 dark:bg-neutral-800 border dark:border-neutral-700 border-stone-200 rounded-lg",t.disabled?"cursor-not-allowed":"cursor-pointer"]),disabled:t.disabled},null,10,fne),[[y.vModelText,r.value]]),t.isTextInputShown?(y.openBlock(),y.createBlock(o,{key:0,modelValue:r.value,"onUpdate:modelValue":e[1]||(e[1]=a=>r.value=a),class:"ml-2 w-full",disabled:t.disabled,clearable:t.clearable},null,8,["modelValue","disabled","clearable"])):y.createCommentVNode("",!0)])}const _F=wn(hne,[["render",gne]]),pne={title:"Text Color",class:"flex flex-col h-[30px] min-w-[30px] px-1 rounded-full hover:bg-gray-100 justify-center items-center relative flex"},mne={class:"flex gap-[4px] mb-[8px]"},_ne={class:"grid grid-rows-3 grid-cols-7"},bne={class:"w-full h-full rounded border border-gray-300 overflow-hidden"},wne=["onClick","title"],Cne={__name:"vs-editor-color",props:{editor:Object},setup(s){const e=s,t=y.ref("popover"),n=y.ref("#000000"),i=y.ref(["#172B4D","#0747A6","#008DA6","#006644","#FF991F","#BF2600","#403294","#97A0AF","#4C9AFF","#00B8D9","#36B37E","#FFC400","#FF5630","#6554C0","#FFFFFF","#B3D4FF","#B3F5FF","#ABF5D1","#FFF0B3","#FFBDAD","#EAE6FF"]),r=l=>{e.editor&&(e.editor.chain().focus().setColor(l).run(),n.value=l,t.value&&t.value.togglePopover())},o=()=>{r(n.value)},a=l=>({"#172B4D":"Default","#0747A6":"Bright blue","#008DA6":"Bright blue-green","#006644":"Bright green","#FF991F":"Bright orange","#BF2600":"Bright red","#403294":"Bright purple","#97A0AF":"Gray","#4C9AFF":"Blue","#00B8D9":"Blue-green","#36B37E":"Green","#FFC400":"Yellow","#FF5630":"Red","#6554C0":"Purple","#FFFFFF":"White","#B3D4FF":"Bright blue","#B3F5FF":"Bright blue-green","#ABF5D1":"Bright green","#FFF0B3":"Bright yellow","#FFBDAD":"Bright red","#EAE6FF":"Bright purple"})[l]||l;return(l,c)=>(y.openBlock(),y.createBlock(Oc,{ref_key:"popover",ref:t,placement:"bottom"},{reference:y.withCtx(()=>[y.createElementVNode("button",pne,[c[1]||(c[1]=y.createElementVNode("span",{class:"leading-none"},"A",-1)),y.createElementVNode("span",{class:"block h-1 w-5",style:y.normalizeStyle({backgroundColor:n.value})},null,4)])]),default:y.withCtx(()=>[y.createElementVNode("div",null,[y.createElementVNode("div",mne,[y.createVNode(_F,{modelValue:n.value,"onUpdate:modelValue":c[0]||(c[0]=d=>n.value=d)},null,8,["modelValue"]),y.createElementVNode("button",{onClick:o,class:"h-[38px] w-[38px] bg-blue-500 shrink-0 border rounded-md flex items-center justify-center hover:bg-blue-700 duration-300"},[y.createVNode(Lm,{class:"h-[24px] w-[24px] text-white"})])]),y.createElementVNode("div",_ne,[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(i.value,d=>(y.openBlock(),y.createElementBlock("div",{key:d,class:"h-8 w-8 p-0.5 rounded border border-transparent hover:border-gray-200 transition-transform cursor-pointer"},[y.createElementVNode("div",bne,[y.createElementVNode("button",{class:"flex items-center justify-center w-full h-full",style:y.normalizeStyle({backgroundColor:d}),onClick:h=>r(d),title:a(d)},[n.value===d?(y.openBlock(),y.createBlock(Lm,{key:0,class:"h-5 w-5 text-gray-500"})):y.createCommentVNode("",!0)],12,wne)])]))),128))])])]),_:1},512))}},vne={title:"Background Color",class:"flex flex-col h-[30px] px-1 rounded-full hover:bg-gray-100 justify-center items-center relative flex"},yne={class:"flex gap-[4px] mb-[8px]"},Sne={class:"grid grid-rows-3 grid-cols-7"},xne={class:"w-full h-full rounded border border-gray-300 overflow-hidden"},Lne=["onClick","title"],kne=["onClick","title"],Ene={__name:"vs-editor-background-color",props:{editor:Object},setup(s){const e=s,t=y.ref("popover"),n=y.ref("transparent"),i=y.ref(["#172B4D","#0747A6","#008DA6","#006644","#FF991F","#BF2600","#403294","#97A0AF","#4C9AFF","#00B8D9","#36B37E","#FFC400","#FF5630","#6554C0","#FFFFFF","#B3D4FF","#B3F5FF","#ABF5D1","#FFF0B3","#FFBDAD","#EAE6FF"]),r=l=>{e.editor&&(e.editor.chain().focus().setBackgroundColor(l).run(),n.value=l,t.value&&t.value.togglePopover())},o=()=>{r(n.value)},a=l=>({"#172B4D":"Default","#0747A6":"Bright blue","#008DA6":"Bright blue-green","#006644":"Bright green","#FF991F":"Bright orange","#BF2600":"Bright red","#403294":"Bright purple","#97A0AF":"Gray","#4C9AFF":"Blue","#00B8D9":"Blue-green","#36B37E":"Green","#FFC400":"Yellow","#FF5630":"Red","#6554C0":"Purple",transparent:"Transparent","#B3D4FF":"Bright blue","#B3F5FF":"Bright blue-green","#ABF5D1":"Bright green","#FFF0B3":"Bright yellow","#FFBDAD":"Bright red","#EAE6FF":"Bright purple"})[l]||l;return(l,c)=>(y.openBlock(),y.createBlock(Oc,{ref_key:"popover",ref:t,placement:"bottom"},{reference:y.withCtx(()=>[y.createElementVNode("button",vne,[c[2]||(c[2]=y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("path",{d:"m19 11-8-8-8.6 8.6a2 2 0 0 0 0 2.8l5.2 5.2c.8.8 2 .8 2.8 0L19 11Z"}),y.createElementVNode("path",{d:"m5 2 5 5"}),y.createElementVNode("path",{d:"M2 13h15"}),y.createElementVNode("path",{d:"M22 20a2 2 0 1 1-4 0c0-1.6 1.7-2.4 2-4 .3 1.6 2 2.4 2 4Z"})],-1)),y.createElementVNode("span",{class:"block h-1 w-5",style:y.normalizeStyle({backgroundColor:n.value})},null,4)])]),default:y.withCtx(()=>[y.createElementVNode("div",null,[y.createElementVNode("div",yne,[y.createVNode(_F,{modelValue:n.value,"onUpdate:modelValue":c[0]||(c[0]=d=>n.value=d)},null,8,["modelValue"]),y.createElementVNode("button",{onClick:o,class:"h-[38px] w-[38px] bg-blue-500 shrink-0 border rounded-md flex items-center justify-center hover:bg-blue-700 duration-300"},[y.createVNode(Lm,{class:"h-[24px] w-[24px] text-white"})])]),y.createElementVNode("div",Sne,[y.createElementVNode("button",{onClick:c[1]||(c[1]=d=>r("transparent")),class:"col-span-7 flex items-center justify-center gap-2 bg-gray-100 rounded-md py-1 mb-2 hover:bg-gray-200"},[...c[3]||(c[3]=[y.createElementVNode("svg",{fill:"#000000",width:"16",height:"16",viewBox:"0 0 52 52","data-name":"Layer 1",xmlns:"http://www.w3.org/2000/svg"},[y.createElementVNode("g",{id:"SVGRepo_bgCarrier","stroke-width":"0"}),y.createElementVNode("g",{id:"SVGRepo_tracerCarrier","stroke-linecap":"round","stroke-linejoin":"round"}),y.createElementVNode("g",{id:"SVGRepo_iconCarrier"},[y.createElementVNode("path",{d:"M48.5,5.6,46.4,3.5a1.67,1.67,0,0,0-2.4.3L32.59,15.21c-.77-1.3-1.51-2.61-2.21-4a36.5,36.5,0,0,1-3.15-8.36c-.13-.53-.39-.91-1-.89s-.86.4-1,.93c-.06.26-.11.51-.17.76A48.3,48.3,0,0,1,21,13.7,97.47,97.47,0,0,1,14.13,25a16,16,0,0,0-3,11.12c0,.14,0,.29.06.43L3.8,44a1.87,1.87,0,0,0-.3,2.4l2.1,2.1A1.67,1.67,0,0,0,8,48.2L48.2,8A1.67,1.67,0,0,0,48.5,5.6Z"}),y.createElementVNode("path",{d:"M38.42,23.79l-22,22.31A14.47,14.47,0,0,0,26.22,50a15.48,15.48,0,0,0,7-1.44c4.94-2.51,8.11-6.4,8.94-12A15.22,15.22,0,0,0,39,24.66C38.87,24.44,38.58,24,38.42,23.79Z"})])],-1),y.createElementVNode("p",null,"no color",-1)])]),(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(i.value,d=>(y.openBlock(),y.createElementBlock("div",{key:d,class:"h-8 w-8 p-0.5 rounded border border-transparent hover:border-gray-200 transition-transform cursor-pointer"},[y.createElementVNode("div",xne,[d!=="transparent"?(y.openBlock(),y.createElementBlock("button",{key:0,class:"flex items-center justify-center w-full h-full",style:y.normalizeStyle({backgroundColor:d}),onClick:h=>r(d),title:a(d)},[n.value===d?(y.openBlock(),y.createBlock(Lm,{key:0,class:"h-5 w-5 text-gray-500"})):y.createCommentVNode("",!0)],12,Lne)):y.createCommentVNode("",!0),d==="transparent"?(y.openBlock(),y.createElementBlock("button",{key:1,class:"flex items-center justify-center w-full h-full",onClick:h=>r(d),title:a(d)},[n.value===d?(y.openBlock(),y.createBlock(Lm,{key:0,class:"h-5 w-5 text-gray-500"})):y.createCommentVNode("",!0)],8,kne)):y.createCommentVNode("",!0)])]))),128))])])]),_:1},512))}},Nne={__name:"vs-editor-highlight",props:{editor:Object},setup(s){const e=s,t=y.computed(()=>e.editor?.isActive("highlight")),n=()=>{e.editor&&e.editor.chain().focus().toggleHighlight().run()};return(i,r)=>(y.openBlock(),y.createElementBlock("button",{title:"Highlight",onClick:n,class:y.normalizeClass(["flex flex-col h-[30px] px-1 rounded-full hover:bg-gray-100 justify-center items-center relative flex",{"bg-gray-200":t.value}])},[...r[0]||(r[0]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("path",{d:"m9 11-6 6v3h9l3-3"}),y.createElementVNode("path",{d:"m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4"})],-1)])],2))}},Dne={class:"truncate"},Tne={class:"w-[200px]"},Ine={class:"max-h-[200px] overflow-y-auto"},Mne=["onClick"],Rne={__name:"vs-editor-font-family",props:{editor:Object},setup(s){const e=s,t=y.ref("popover"),n=y.ref(!1),i=y.ref([{label:"Arial",value:"Arial, sans-serif"},{label:"Helvetica",value:"Helvetica, sans-serif"},{label:"Times New Roman",value:"Times New Roman, serif"},{label:"Georgia",value:"Georgia, serif"},{label:"Verdana",value:"Verdana, sans-serif"},{label:"Courier New",value:"Courier New, monospace"},{label:"Comic Sans MS",value:"Comic Sans MS, cursive"},{label:"Impact",value:"Impact, sans-serif"},{label:"Trebuchet MS",value:"Trebuchet MS, sans-serif"},{label:"Palatino",value:"Palatino, serif"}]),r=y.computed(()=>{if(!e.editor)return"Arial, sans-serif";for(const c of i.value)if(e.editor.isActive("textStyle",{fontFamily:c.value}))return c.value;return"Arial, sans-serif"}),o=y.computed(()=>i.value.find(d=>d.value===r.value)?.label||"Arial"),a=c=>e.editor?e.editor.isActive("textStyle",{fontFamily:c}):!1,l=c=>{e.editor&&(e.editor.chain().focus().setFontFamily(c).run(),t.value&&t.value.togglePopover())};return(c,d)=>(y.openBlock(),y.createBlock(Oc,{ref_key:"popover",ref:t,placement:"bottom",onIsvisible:d[0]||(d[0]=h=>n.value=h)},{reference:y.withCtx(()=>[y.createElementVNode("button",{title:"Font Family",class:y.normalizeClass(["h-[30px] px-2 rounded-full hover:bg-gray-100 justify-center items-center flex text-sm",[n.value?"bg-gray-100 text-gray-900":"text-gray-700"]]),style:y.normalizeStyle({fontFamily:r.value})},[y.createElementVNode("span",Dne,y.toDisplayString(o.value),1),d[1]||(d[1]=y.createElementVNode("svg",{class:"ml-1 text-gray-400",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("polyline",{points:"6,9 12,15 18,9"})],-1))],6)]),default:y.withCtx(()=>[y.createElementVNode("div",Tne,[y.createElementVNode("ul",Ine,[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(i.value,h=>(y.openBlock(),y.createElementBlock("li",{key:h.value,class:y.normalizeClass(["px-3 py-2 hover:bg-gray-100 cursor-pointer text-sm",{"bg-gray-100":a(h.value)}]),style:y.normalizeStyle({fontFamily:h.value}),onClick:u=>l(h.value)},y.toDisplayString(h.label),15,Mne))),128))])])]),_:1},512))}},Ane={class:"w-[120px]"},One={class:"max-h-[200px] overflow-y-auto"},Pne=["onClick"],Fne={__name:"vs-editor-font-size",props:{editor:Object},setup(s){const e=s,t=y.ref("popover"),n=y.ref("14px"),i=y.ref([{label:"8px",value:"8px"},{label:"9px",value:"9px"},{label:"10px",value:"10px"},{label:"11px",value:"11px"},{label:"12px",value:"12px"},{label:"14px",value:"14px"},{label:"16px",value:"16px"},{label:"18px",value:"18px"},{label:"20px",value:"20px"},{label:"24px",value:"24px"},{label:"28px",value:"28px"},{label:"32px",value:"32px"},{label:"36px",value:"36px"},{label:"48px",value:"48px"},{label:"72px",value:"72px"}]),r=o=>{e.editor&&(e.editor.chain().focus().setFontSize(o).run(),n.value=o,t.value&&t.value.togglePopover())};return(o,a)=>(y.openBlock(),y.createBlock(Oc,{ref_key:"popover",ref:t,placement:"bottom"},{reference:y.withCtx(()=>[...a[0]||(a[0]=[y.createElementVNode("button",{title:"Font Size",class:"h-[30px] px-2 min-w-[30px] rounded-full hover:bg-gray-100 justify-center items-center flex text-sm text-gray-700 space-x-1"},[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-alarge-small-icon lucide-a-large-small"},[y.createElementVNode("path",{d:"m15 16 2.536-7.328a1.02 1.02 1 0 1 1.928 0L22 16"}),y.createElementVNode("path",{d:"M15.697 14h5.606"}),y.createElementVNode("path",{d:"m2 16 4.039-9.69a.5.5 0 0 1 .923 0L11 16"}),y.createElementVNode("path",{d:"M3.304 13h6.392"})]),y.createElementVNode("svg",{class:"ml-1 text-gray-400",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("polyline",{points:"6,9 12,15 18,9"})])],-1)])]),default:y.withCtx(()=>[y.createElementVNode("div",Ane,[y.createElementVNode("ul",One,[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(i.value,l=>(y.openBlock(),y.createElementBlock("li",{key:l.value,class:"px-3 py-2 hover:bg-gray-100 cursor-pointer",onClick:c=>r(l.value)},y.toDisplayString(l.label),9,Pne))),128))])])]),_:1},512))}},Bne={props:{editor:Object},methods:{toggleSuperscript(){this.editor&&this.editor.commands.toggleSuperscript()}}};function Vne(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("button",{title:"Superscript",onClick:e[0]||(e[0]=(...o)=>r.toggleSuperscript&&r.toggleSuperscript(...o)),class:y.normalizeClass(["h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100",{"bg-gray-100 text-gray-900":t.editor?.isActive("superscript")}])},[...e[1]||(e[1]=[y.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-superscript-icon lucide-superscript"><path d="m4 19 8-8"></path><path d="m12 19-8-8"></path><path d="M20 12h-4c0-1.5.442-2 1.5-2.5S20 8.334 20 7.002c0-.472-.17-.93-.484-1.29a2.105 2.105 0 0 0-2.617-.436c-.42.239-.738.614-.899 1.06"></path></svg><span class="sr-only">Superscript</span>',2)])],2)}const Wne=wn(Bne,[["render",Vne]]),Hne={props:{editor:Object},methods:{toggleSubscript(){this.editor&&this.editor.commands.toggleSubscript()}}};function zne(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("button",{title:"Subscript",onClick:e[0]||(e[0]=(...o)=>r.toggleSubscript&&r.toggleSubscript(...o)),class:y.normalizeClass(["h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100",{"bg-gray-100 text-gray-900":t.editor?.isActive("subscript")}])},[...e[1]||(e[1]=[y.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-subscript-icon lucide-subscript"><path d="m4 5 8 8"></path><path d="m12 5-8 8"></path><path d="M20 19h-4c0-1.5.44-2 1.5-2.5S20 15.33 20 14c0-.47-.17-.93-.48-1.29a2.11 2.11 0 0 0-2.62-.44c-.42.24-.74.62-.9 1.07"></path></svg><span class="sr-only">Subscript</span>',2)])],2)}const $ne=wn(Hne,[["render",zne]]),Une={title:"Heading",class:"h-[30px] px-2 rounded-full hover:bg-gray-100 justify-center items-center flex text-sm text-gray-700"},jne={class:"truncate"},Kne={class:"max-h-[200px] overflow-y-auto"},qne=["onClick"],Gne=wn({__name:"vs-editor-heading",props:{editor:Object},setup(s){const e=s,t=y.ref("popover"),n=y.ref([{label:"Heading 1",value:1},{label:"Heading 2",value:2},{label:"Heading 3",value:3},{label:"Heading 4",value:4},{label:"Heading 5",value:5},{label:"Heading 6",value:6}]),i=y.computed(()=>{if(!e.editor)return"Paragraph";for(let l=1;l<=6;l++)if(e.editor.isActive("heading",{level:l}))return`H ${l}`;return"P"}),r=l=>({1:"font-weight:700; font-size:30px;",2:"font-weight:700; font-size:26px;",3:"font-weight:700; font-size:22px;",4:"font-weight:700; font-size:18px;",5:"font-weight:500; font-size:16px;",6:"font-weight:400; font-size:14px;"})[l]||"",o=l=>{e.editor&&(e.editor.chain().focus().setHeading({level:l}).run(),t.value&&t.value.togglePopover())},a=()=>{e.editor&&(e.editor.chain().focus().setParagraph().run(),t.value&&t.value.togglePopover())};return(l,c)=>(y.openBlock(),y.createBlock(Oc,{ref_key:"popover",ref:t,placement:"bottom"},{reference:y.withCtx(()=>[y.createElementVNode("button",Une,[y.createElementVNode("span",jne,y.toDisplayString(i.value),1),c[0]||(c[0]=y.createElementVNode("svg",{class:"ml-1 text-gray-400",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("polyline",{points:"6,9 12,15 18,9"})],-1))])]),default:y.withCtx(()=>[y.createElementVNode("div",null,[y.createElementVNode("ul",Kne,[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(n.value,d=>(y.openBlock(),y.createElementBlock("li",{key:d.value,class:y.normalizeClass(["px-3 py-2 hover:bg-gray-100 cursor-pointer text-sm",`heading-level-${d.value}`]),style:y.normalizeStyle(r(d.value)),onClick:h=>o(d.value)},y.toDisplayString(d.label),15,qne))),128)),y.createElementVNode("li",{class:"px-3 py-2 hover:bg-gray-100 cursor-pointer text-sm border-t border-gray-200 mt-1 pt-2",onClick:a}," Paragraph ")])])]),_:1},512))}},[["__scopeId","data-v-ef7c378e"]]),Yne={props:{editor:Object},methods:{clearFormatting(){this.editor&&this.editor.commands.unsetAllMarks()}}};function Xne(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("button",{title:"Clear Formatting",onClick:e[0]||(e[0]=(...o)=>r.clearFormatting&&r.clearFormatting(...o)),class:"h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100"},[...e[1]||(e[1]=[y.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-remove-formatting-icon lucide-remove-formatting"><path d="M4 7V4h16v3"></path><path d="M5 20h6"></path><path d="M13 4 8 20"></path><path d="m15 15 5 5"></path><path d="m20 15-5 5"></path></svg><span class="sr-only">Clear Formatting</span>',2)])])}const Zne=wn(Yne,[["render",Xne]]),Qne={class:"relative"},Jne={class:"space-y-4"},eie={key:0,class:"mt-4"},tie=["src","alt","title"],nie={key:0,class:"text-sm text-red-500"},iie=Object.assign({inheritAttrs:!1},{__name:"vs-editor-image",props:{editor:{type:Object,required:!0}},setup(s){const e=s,t=y.ref(!1),n=y.ref(!1),i=y.ref({src:"",alt:"",title:""}),r=()=>{i.value={src:"",alt:"",title:""},n.value=!1,t.value=!0},o=()=>{t.value=!1,n.value=!1},a=()=>{if(!i.value.src){alert("Please enter an image URL");return}e.editor&&e.editor.chain().focus().setImage({src:i.value.src,alt:i.value.alt||"",title:i.value.title||""}).run(),o()},l=()=>{a()},c=()=>{o()};return y.watch(()=>i.value.src,()=>{n.value=!1}),(d,h)=>(y.openBlock(),y.createElementBlock("div",Qne,[y.createElementVNode("button",{onClick:r,class:y.normalizeClass(["h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100",s.editor?.isActive("image")?"bg-gray-200 text-gray-900":""]),title:"Add Image"},[...h[5]||(h[5]=[y.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-image"><rect width="18" height="18" x="3" y="3" rx="2" ry="2"></rect><circle cx="9" cy="9" r="2"></circle><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"></path></svg><span class="sr-only">Add Image</span>',2)])],2),y.createVNode(gF,{modelValue:t.value,"onUpdate:modelValue":h[4]||(h[4]=u=>t.value=u),title:"Add Image"},{footer:y.withCtx(()=>[y.createElementVNode("button",{onClick:c,type:"button",class:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500"}," Cancel "),y.createElementVNode("button",{onClick:l,type:"button",class:"px-4 py-2 text-sm font-medium text-white bg-blue-600 border border-transparent rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500"}," Add Image ")]),default:y.withCtx(()=>[y.createElementVNode("div",Jne,[y.createElementVNode("div",null,[h[6]||(h[6]=y.createElementVNode("label",{for:"imageUrl",class:"block text-sm font-medium text-gray-700 mb-1"}," Image URL ",-1)),y.withDirectives(y.createElementVNode("input",{id:"imageUrl","onUpdate:modelValue":h[0]||(h[0]=u=>i.value.src=u),type:"url",placeholder:"https://example.com/image.png",class:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",required:""},null,512),[[y.vModelText,i.value.src]])]),y.createElementVNode("div",null,[h[7]||(h[7]=y.createElementVNode("label",{for:"imageAlt",class:"block text-sm font-medium text-gray-700 mb-1"}," Alt Text ",-1)),y.withDirectives(y.createElementVNode("input",{id:"imageAlt","onUpdate:modelValue":h[1]||(h[1]=u=>i.value.alt=u),type:"text",placeholder:"Description of the image",class:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"},null,512),[[y.vModelText,i.value.alt]])]),y.createElementVNode("div",null,[h[8]||(h[8]=y.createElementVNode("label",{for:"imageTitle",class:"block text-sm font-medium text-gray-700 mb-1"}," Title (optional) ",-1)),y.withDirectives(y.createElementVNode("input",{id:"imageTitle","onUpdate:modelValue":h[2]||(h[2]=u=>i.value.title=u),type:"text",placeholder:"Image title",class:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"},null,512),[[y.vModelText,i.value.title]])]),i.value.src?(y.openBlock(),y.createElementBlock("div",eie,[h[9]||(h[9]=y.createElementVNode("p",{class:"text-sm text-gray-600 mb-2"},"Preview:",-1)),y.withDirectives(y.createElementVNode("img",{src:i.value.src,alt:i.value.alt||"Image preview",title:i.value.title,class:"max-w-full h-auto max-h-32 rounded border",onError:h[3]||(h[3]=u=>n.value=!0)},null,40,tie),[[y.vShow,!n.value]]),n.value?(y.openBlock(),y.createElementBlock("p",nie," Failed to load image preview ")):y.createCommentVNode("",!0)])):y.createCommentVNode("",!0)])]),_:1},8,["modelValue"])]))}}),sie={class:"flex items-center"},rie=["disabled"],oie=["disabled"],aie=wn(Object.assign({inheritAttrs:!1},{__name:"vs-editor-history",props:{editor:Object},setup(s){const e=s,t=()=>{e.editor?.can().undo()&&e.editor.chain().focus().undo().run()},n=()=>{e.editor?.can().redo()&&e.editor.chain().focus().redo().run()};return(i,r)=>(y.openBlock(),y.createElementBlock("div",sie,[y.createElementVNode("button",{onClick:t,class:y.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center rounded-l-full hover:text-gray-900 hover:bg-gray-100 border-r border-gray-200",[s.editor?.can().undo()?"text-gray-500":"text-gray-300 cursor-not-allowed"]]),disabled:!s.editor?.can().undo(),title:"Undo (Ctrl+Z)"},[...r[0]||(r[0]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("path",{d:"M3 7v6h6"}),y.createElementVNode("path",{d:"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13"})],-1)])],10,rie),y.createElementVNode("button",{onClick:n,class:y.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center rounded-r-full hover:text-gray-900 hover:bg-gray-100",[s.editor?.can().redo()?"text-gray-500":"text-gray-300 cursor-not-allowed"]]),disabled:!s.editor?.can().redo(),title:"Redo (Ctrl+Y)"},[...r[1]||(r[1]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("path",{d:"M21 7v6h-6"}),y.createElementVNode("path",{d:"M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3L21 13"})],-1)])],10,oie)]))}}),[["__scopeId","data-v-b5a7cc5a"]]),lie={class:"relative"},cie=wn(Object.assign({inheritAttrs:!1},{__name:"vs-editor-help",props:{editor:Object},setup(s){const e=y.ref(!1),t=y.ref(null),n=()=>{e.value=!e.value},i=()=>{e.value=!1};return(r,o)=>(y.openBlock(),y.createElementBlock("div",lie,[y.createElementVNode("button",{ref_key:"helpButton",ref:t,onClick:n,class:y.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100 text-gray-500",[e.value?"bg-gray-100 text-gray-900":"text-gray-500"]]),title:"Markdown Shortcuts Help"},[...o[1]||(o[1]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("circle",{cx:"12",cy:"12",r:"10"}),y.createElementVNode("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}),y.createElementVNode("line",{x1:"12",x2:"12.01",y1:"17",y2:"17"})],-1)])],2),e.value?(y.openBlock(),y.createElementBlock("div",{key:0,class:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",onClick:i},[y.createElementVNode("div",{class:"bg-white rounded-lg shadow-xl max-w-2xl w-full mx-4 max-h-[80vh] overflow-y-auto",onClick:o[0]||(o[0]=y.withModifiers(()=>{},["stop"]))},[y.createElementVNode("div",{class:"p-6"},[y.createElementVNode("div",{class:"flex justify-between items-center mb-4"},[o[3]||(o[3]=y.createElementVNode("h2",{class:"text-xl font-semibold text-gray-900"},"Common Markdown Syntax & Shortcuts",-1)),y.createElementVNode("button",{onClick:i,class:"text-gray-400 hover:text-gray-600 transition-colors"},[...o[2]||(o[2]=[y.createElementVNode("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[y.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])]),o[4]||(o[4]=y.createStaticVNode('<div class="space-y-6" data-v-155e282c><div data-v-155e282c><h3 class="text-lg font-medium text-gray-800 mb-3" data-v-155e282c>Markdown Syntax</h3><div class="overflow-x-auto" data-v-155e282c><table class="w-full border-collapse" data-v-155e282c><thead data-v-155e282c><tr class="bg-gray-50" data-v-155e282c><th class="border border-gray-200 px-3 py-2 text-left font-medium text-gray-700" data-v-155e282c>Element</th><th class="border border-gray-200 px-3 py-2 text-left font-medium text-gray-700" data-v-155e282c>Example</th></tr></thead><tbody class="text-sm" data-v-155e282c><tr data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c>Bold</td><td class="border border-gray-200 px-3 py-2" data-v-155e282c><code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>**bold text**</code> or <code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>__bold text__</code></td></tr><tr class="bg-gray-25" data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c>Italics</td><td class="border border-gray-200 px-3 py-2" data-v-155e282c><code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>*italic text*</code> or <code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>_italic text_</code></td></tr><tr data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c>Strikethrough</td><td class="border border-gray-200 px-3 py-2" data-v-155e282c><code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>~strikethrough text~</code></td></tr><tr class="bg-gray-25" data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c>Headings</td><td class="border border-gray-200 px-3 py-2" data-v-155e282c><code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c># Heading 1</code>, <code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>## Heading 2</code>, etc., up to <code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>###### Heading 6</code></td></tr><tr data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c>Unordered Lists</td><td class="border border-gray-200 px-3 py-2" data-v-155e282c> Use an asterisk (*), dash (-), or plus sign (+) followed by a space. </td></tr><tr class="bg-gray-25" data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c>Ordered Lists</td><td class="border border-gray-200 px-3 py-2" data-v-155e282c> Use a number followed by a period and a space (e.g., <code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>1. First item</code>). </td></tr><tr data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c>Blockquotes</td><td class="border border-gray-200 px-3 py-2" data-v-155e282c> Start with a greater-than sign (&gt;) followed by a space. </td></tr><tr class="bg-gray-25" data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c>Inline Code</td><td class="border border-gray-200 px-3 py-2" data-v-155e282c> Surround with backticks (<code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>`</code>). </td></tr><tr data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c>Code Blocks</td><td class="border border-gray-200 px-3 py-2" data-v-155e282c> Enclose with three backticks (<code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>```</code>) before and after the code. </td></tr><tr class="bg-gray-25" data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c>Images</td><td class="border border-gray-200 px-3 py-2" data-v-155e282c> Use <code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>![alt text](url)</code> syntax. </td></tr><tr data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c>Links</td><td class="border border-gray-200 px-3 py-2" data-v-155e282c> Use <code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>[Link Text](url)</code> syntax. </td></tr><tr class="bg-gray-25" data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c>Checklists</td><td class="border border-gray-200 px-3 py-2" data-v-155e282c> Create a list item with <code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>- [ ]</code> for an incomplete task or <code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>- [x]</code> for a completed one. </td></tr></tbody></table></div></div><div data-v-155e282c><h3 class="text-lg font-medium text-gray-800 mb-3" data-v-155e282c>Common Editing Shortcuts</h3><div class="overflow-x-auto" data-v-155e282c><table class="w-full border-collapse" data-v-155e282c><thead data-v-155e282c><tr class="bg-gray-50" data-v-155e282c><th class="border border-gray-200 px-3 py-2 text-left font-medium text-gray-700" data-v-155e282c>Shortcut</th><th class="border border-gray-200 px-3 py-2 text-left font-medium text-gray-700" data-v-155e282c>Action</th></tr></thead><tbody class="text-sm" data-v-155e282c><tr data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c><code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>Ctrl+A</code></td><td class="border border-gray-200 px-3 py-2" data-v-155e282c>Select all text</td></tr><tr class="bg-gray-25" data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c><code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>Ctrl+B</code></td><td class="border border-gray-200 px-3 py-2" data-v-155e282c>Apply bold formatting</td></tr><tr data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c><code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>Ctrl+C</code></td><td class="border border-gray-200 px-3 py-2" data-v-155e282c>Copy selected text</td></tr><tr class="bg-gray-25" data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c><code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>Ctrl+I</code></td><td class="border border-gray-200 px-3 py-2" data-v-155e282c>Apply italic formatting</td></tr><tr data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c><code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>Ctrl+K</code></td><td class="border border-gray-200 px-3 py-2" data-v-155e282c>Open the insert link dialog</td></tr><tr class="bg-gray-25" data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c><code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>Ctrl+S</code></td><td class="border border-gray-200 px-3 py-2" data-v-155e282c>Save the current document</td></tr><tr data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c><code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>Ctrl+V</code></td><td class="border border-gray-200 px-3 py-2" data-v-155e282c>Paste copied text</td></tr><tr class="bg-gray-25" data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c><code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>Ctrl+X</code></td><td class="border border-gray-200 px-3 py-2" data-v-155e282c>Cut selected text</td></tr><tr data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c><code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>Ctrl+Y</code></td><td class="border border-gray-200 px-3 py-2" data-v-155e282c>Redo the last action</td></tr><tr class="bg-gray-25" data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c><code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>Alt+Shift+Backspace</code></td><td class="border border-gray-200 px-3 py-2" data-v-155e282c>Redo the last action</td></tr><tr data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c><code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>Ctrl+Z</code></td><td class="border border-gray-200 px-3 py-2" data-v-155e282c>Undo the last action</td></tr><tr class="bg-gray-25" data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c><code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>Alt+Backspace</code></td><td class="border border-gray-200 px-3 py-2" data-v-155e282c>Undo the last action</td></tr></tbody></table></div></div></div>',1))])])])):y.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-155e282c"]]),die={__name:"vs-editor-horizontal-rule",props:{editor:Object},setup(s){const e=s,t=()=>{e.editor&&e.editor.chain().focus().setHorizontalRule().run()};return(n,i)=>(y.openBlock(),y.createElementBlock("button",{title:"Horizontal Rule",onClick:t,class:"flex flex-col h-[30px] px-1 rounded-full hover:bg-gray-100 justify-center items-center relative flex"},[...i[0]||(i[0]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("line",{x1:"3",x2:"21",y1:"12",y2:"12"})],-1)])]))}},hie={__name:"vs-editor-fullscreen",props:{editor:Object},emits:["toggle-fullscreen"],setup(s,{emit:e}){const t=e,n=()=>{t("toggle-fullscreen")};return(i,r)=>(y.openBlock(),y.createElementBlock("button",{title:"Fullscreen",onClick:n,class:"w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded-full hover:text-gray-900 hover:bg-gray-100"},[...r[0]||(r[0]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"})],-1)])]))}},uie=["title"],fie={class:"vs-editor-html-mode__text"},gie={bold:ste,italic:ate,color:Cne,background_color:Ene,highlight:Nne,bullet_list:Yee,ordered_list:Qee,blockquote:Kee,codeblock:tte,underline:lte,strike:cte,link:Ote,table:Wte,text_align:sne,type_tag:ane,font_family:Rne,font_size:Fne,superscript:Wne,subscript:$ne,heading:Gne,clear_formatting:Zne,image:iie,history:aie,help:cie,horizontal_rule:die,fullscreen:hie,html_mode:wn({__name:"vs-editor-html-mode",props:{editor:{type:Object,required:!0}},emits:["toggle-html-mode"],setup(s,{emit:e}){const t=e,n=y.ref(!1),i=()=>{n.value=!n.value,t("toggle-html-mode",n.value)};return(r,o)=>(y.openBlock(),y.createElementBlock("button",{onClick:i,class:y.normalizeClass([{"is-active":n.value},"vs-editor-html-mode"]),type:"button",title:n.value?"Switch to Rich Text Mode":"Switch to HTML Mode"},[o[0]||(o[0]=y.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("polyline",{points:"16,18 22,12 16,6"}),y.createElementVNode("polyline",{points:"8,6 2,12 8,18"})],-1)),y.createElementVNode("span",fie,y.toDisplayString((n.value,"HTML")),1)],10,uie))}},[["__scopeId","data-v-99a48167"]])},bF={basic:["history","bold","italic","underline","strike","text_align","bullet_list","ordered_list","link","image","clear_formatting","help"],default:["heading","bold","italic","underline","strike","color","background_color","highlight","text_align","bullet_list","ordered_list","codeblock","table","link","image","horizontal_rule","clear_formatting","fullscreen","help","html_mode"],full:["history","heading","font_family","font_size","bold","italic","underline","strike","color","background_color","highlight","text_align","bullet_list","ordered_list","blockquote","codeblock","table","link","image","horizontal_rule","superscript","subscript","clear_formatting","fullscreen","help","html_mode"]};function pie(s){if(s.length===0)throw new Error("Invalid tail call");return[s.slice(0,s.length-1),s[s.length-1]]}function Sn(s,e,t=(n,i)=>n===i){if(s===e)return!0;if(!s||!e||s.length!==e.length)return!1;for(let n=0,i=s.length;n<i;n++)if(!t(s[n],e[n]))return!1;return!0}function mie(s,e){const t=s.length-1;e<t&&(s[e]=s[t]),s.pop()}function _ie(s,e,t){return wF(s.length,n=>t(s[n],e))}function wF(s,e){let t=0,n=s-1;for(;t<=n;){const i=(t+n)/2|0,r=e(i);if(r<0)t=i+1;else if(r>0)n=i-1;else return i}return-(t+1)}function*qk(s,e){let t,n;for(const i of s)n!==void 0&&e(n,i)?t.push(i):(t&&(yield t),t=[i]),n=i;t&&(yield t)}function CF(s,e){for(let t=0;t<=s.length;t++)e(t===0?void 0:s[t-1],t===s.length?void 0:s[t])}function bie(s,e){for(let t=0;t<s.length;t++)e(t===0?void 0:s[t-1],s[t],t+1===s.length?void 0:s[t+1])}function Gk(s){return s.filter(e=>!!e)}function vF(s){let e=0;for(let t=0;t<s.length;t++)s[t]&&(s[e]=s[t],e+=1);s.length=e}function wie(s){return!Array.isArray(s)||s.length===0}function Nw(s){return Array.isArray(s)&&s.length>0}function Qd(s,e=t=>t){const t=new Set;return s.filter(n=>{const i=e(n);return t.has(i)?!1:(t.add(i),!0)})}function cs(s,e){let t=typeof e=="number"?s:0;typeof e=="number"?t=s:(t=0,e=s);const n=[];if(t<=e)for(let i=t;i<e;i++)n.push(i);else for(let i=t;i>e;i--)n.push(i);return n}function Dw(s,e,t){const n=s.slice(0,e),i=s.slice(e);return n.concat(t,i)}function Yk(s,e){const t=s.indexOf(e);t>-1&&(s.splice(t,1),s.unshift(e))}function Tw(s,e){const t=s.indexOf(e);t>-1&&(s.splice(t,1),s.push(e))}function Xk(s,e){for(const t of e)s.push(t)}function Cie(s,e,t){const n=yF(s,e),i=s.length,r=t.length;s.length=i+r;for(let o=i-1;o>=n;o--)s[o+r]=s[o];for(let o=0;o<r;o++)s[o+n]=t[o]}function Iw(s,e,t,n){const i=yF(s,e);let r=s.splice(i,t);return r===void 0&&(r=[]),Cie(s,i,n),r}function yF(s,e){return e<0?Math.max(e+s.length,0):Math.min(e,s.length)}var km;(function(s){function e(r){return r<0}s.isLessThan=e;function t(r){return r<=0}s.isLessThanOrEqual=t;function n(r){return r>0}s.isGreaterThan=n;function i(r){return r===0}s.isNeitherLessOrGreaterThan=i,s.greaterThan=1,s.lessThan=-1,s.neitherLessOrGreaterThan=0})(km||(km={}));function Ks(s,e){return(t,n)=>e(s(t),s(n))}function vie(...s){return(e,t)=>{for(const n of s){const i=n(e,t);if(!km.isNeitherLessOrGreaterThan(i))return i}return km.neitherLessOrGreaterThan}}const ll=(s,e)=>s-e,yie=(s,e)=>ll(s?1:0,e?1:0);function Sie(s){return(e,t)=>-s(e,t)}class cl{constructor(e){this.firstIdx=0,this.items=e,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(e){let t=this.firstIdx;for(;t<this.items.length&&e(this.items[t]);)t++;const n=t===this.firstIdx?null:this.items.slice(this.firstIdx,t);return this.firstIdx=t,n}takeFromEndWhile(e){let t=this.lastIdx;for(;t>=0&&e(this.items[t]);)t--;const n=t===this.lastIdx?null:this.items.slice(t+1,this.lastIdx+1);return this.lastIdx=t,n}peek(){if(this.length!==0)return this.items[this.firstIdx]}dequeue(){const e=this.items[this.firstIdx];return this.firstIdx++,e}takeCount(e){const t=this.items.slice(this.firstIdx,this.firstIdx+e);return this.firstIdx+=e,t}}const Lp=class Lp{constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(e){return new Lp(t=>this.iterate(n=>e(n)?t(n):!0))}map(e){return new Lp(t=>this.iterate(n=>t(e(n))))}findLast(e){let t;return this.iterate(n=>(e(n)&&(t=n),!0)),t}findLastMaxBy(e){let t,n=!0;return this.iterate(i=>((n||km.isGreaterThan(e(i,t)))&&(n=!1,t=i),!0)),t}};Lp.empty=new Lp(e=>{});let Jd=Lp;class xie{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?If.isErrorNoTelemetry(e)?new If(e.message+`
104
+ 3. "-" cannot repeat`);bn.customSchemes.push([s,e])}function HJ(){bn.scanner=RJ(bn.customSchemes);for(let s=0;s<bn.tokenQueue.length;s++)bn.tokenQueue[s][1]({scanner:bn.scanner});bn.parser=PJ(bn.scanner.tokens);for(let s=0;s<bn.pluginQueue.length;s++)bn.pluginQueue[s][1]({scanner:bn.scanner,parser:bn.parser});return bn.initialized=!0,bn}function Bk(s){return bn.initialized||HJ(),FJ(bn.parser.start,s,B3(bn.scanner.start,s))}Bk.scan=B3;function j3(s,e=null,t=null){if(e&&typeof e=="object"){if(t)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);t=e,e=null}const n=new Pk(t),i=Bk(s),r=[];for(let o=0;o<i.length;o++){const a=i[o];a.isLink&&(!e||a.t===e)&&n.check(a)&&r.push(a.toFormattedObject(n))}return r}var Vk="[\0-   ᠎ -\u2029  ]",zJ=new RegExp(Vk),$J=new RegExp(`${Vk}$`),UJ=new RegExp(Vk,"g");function jJ(s){return s.length===1?s[0].isLink:s.length===3&&s[1].isLink?["()","[]"].includes(s[0].value+s[2].value):!1}function KJ(s){return new yn({key:new Gn("autolink"),appendTransaction:(e,t,n)=>{const i=e.some(c=>c.docChanged)&&!t.doc.eq(n.doc),r=e.some(c=>c.getMeta("preventAutolink"));if(!i||r)return;const{tr:o}=n,a=S4(t.doc,[...e]);if(O4(a).forEach(({newRange:c})=>{const d=YY(n.doc,c,f=>f.isTextblock);let h,u;if(d.length>1)h=d[0],u=n.doc.textBetween(h.pos,h.pos+h.node.nodeSize,void 0," ");else if(d.length){const f=n.doc.textBetween(c.from,c.to," "," ");if(!$J.test(f))return;h=d[0],u=n.doc.textBetween(h.pos,c.to,void 0," ")}if(h&&u){const f=u.split(zJ).filter(Boolean);if(f.length<=0)return!1;const g=f[f.length-1],p=h.pos+u.lastIndexOf(g);if(!g)return!1;const m=Bk(g).map(b=>b.toObject(s.defaultProtocol));if(!jJ(m))return!1;m.filter(b=>b.isLink).map(b=>({...b,from:p+b.start+1,to:p+b.end+1})).filter(b=>n.schema.marks.code?!n.doc.rangeHasMark(b.from,b.to,n.schema.marks.code):!0).filter(b=>s.validate(b.value)).filter(b=>s.shouldAutoLink(b.value)).forEach(b=>{tk(b.from,b.to,n.doc).some(w=>w.mark.type===s.type)||o.addMark(b.from,b.to,s.type.create({href:b.href}))})}}),!!o.steps.length)return o}})}function qJ(s){return new yn({key:new Gn("handleClickLink"),props:{handleClick:(e,t,n)=>{var i,r;if(n.button!==0||!e.editable)return!1;let o=null;if(n.target instanceof HTMLAnchorElement)o=n.target;else{let d=n.target;const h=[];for(;d.nodeName!=="DIV";)h.push(d),d=d.parentNode;o=h.find(u=>u.nodeName==="A")}if(!o)return!1;const a=A4(e.state,s.type.name),l=(i=o?.href)!=null?i:a.href,c=(r=o?.target)!=null?r:a.target;return s.enableClickSelection&&s.editor.commands.extendMarkRange(s.type.name),o&&l?(window.open(l,c),!0):!1}}})}function GJ(s){return new yn({key:new Gn("handlePasteLink"),props:{handlePaste:(e,t,n)=>{const{state:i}=e,{selection:r}=i,{empty:o}=r;if(o)return!1;let a="";n.content.forEach(c=>{a+=c.textContent});const l=j3(a,{defaultProtocol:s.defaultProtocol}).find(c=>c.isLink&&c.value===a);return!a||!l?!1:s.editor.commands.setMark(s.type,{href:l.href})}}})}function Xd(s,e){const t=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(n=>{const i=typeof n=="string"?n:n.scheme;i&&t.push(i)}),!s||s.replace(UJ,"").match(new RegExp(`^(?:(?:${t.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var K3=_o.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(s=>{if(typeof s=="string"){U3(s);return}U3(s.scheme,s.optionalSlashes)})},onDestroy(){WJ()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(s,e)=>!!Xd(s,e.protocols),validate:s=>!!s,shouldAutoLink:s=>!!s}},addAttributes(){return{href:{default:null,parseHTML(s){return s.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:s=>{const e=s.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:t=>!!Xd(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:s}){return this.options.isAllowedUri(s.href,{defaultValidate:e=>!!Xd(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",$t(this.options.HTMLAttributes,s),0]:["a",$t(this.options.HTMLAttributes,{...s,href:""}),0]},addCommands(){return{setLink:s=>({chain:e})=>{const{href:t}=s;return this.options.isAllowedUri(t,{defaultValidate:n=>!!Xd(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,s).setMeta("preventAutolink",!0).run():!1},toggleLink:s=>({chain:e})=>{const{href:t}=s||{};return t&&!this.options.isAllowedUri(t,{defaultValidate:n=>!!Xd(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,s,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:s})=>s().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[Dc({find:s=>{const e=[];if(s){const{protocols:t,defaultProtocol:n}=this.options,i=j3(s).filter(r=>r.isLink&&this.options.isAllowedUri(r.value,{defaultValidate:o=>!!Xd(o,t),protocols:t,defaultProtocol:n}));i.length&&i.forEach(r=>e.push({text:r.value,data:{href:r.href},index:r.start}))}return e},type:this.type,getAttributes:s=>{var e;return{href:(e=s.data)==null?void 0:e.href}}})]},addProseMirrorPlugins(){const s=[],{protocols:e,defaultProtocol:t}=this.options;return this.options.autolink&&s.push(KJ({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:n=>this.options.isAllowedUri(n,{defaultValidate:i=>!!Xd(i,e),protocols:e,defaultProtocol:t}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&s.push(qJ({type:this.type,editor:this.editor,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&s.push(GJ({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),s}}),YJ=Object.defineProperty,XJ=(s,e)=>{for(var t in e)YJ(s,t,{get:e[t],enumerable:!0})},ZJ="listItem",q3="textStyle",G3=/^\s*([-+*])\s$/,Y3=Ni.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:s}){return["ul",$t(this.options.HTMLAttributes,s),0]},addCommands(){return{toggleBulletList:()=>({commands:s,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(ZJ,this.editor.getAttributes(q3)).run():s.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let s=Ef({find:G3,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(s=Ef({find:G3,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(q3),editor:this.editor})),[s]}}),X3=Ni.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:s}){return["li",$t(this.options.HTMLAttributes,s),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)}}}),QJ={};XJ(QJ,{findListItemPos:()=>Sm,getNextListDepth:()=>Wk,handleBackspace:()=>Hk,handleDelete:()=>zk,hasListBefore:()=>Z3,hasListItemAfter:()=>JJ,hasListItemBefore:()=>Q3,listItemHasSubList:()=>J3,nextListIsDeeper:()=>eF,nextListIsHigher:()=>tF});var Sm=(s,e)=>{const{$from:t}=e.selection,n=ii(s,e.schema);let i=null,r=t.depth,o=t.pos,a=null;for(;r>0&&a===null;)i=t.node(r),i.type===n?a=r:(r-=1,o-=1);return a===null?null:{$pos:e.doc.resolve(o),depth:a}},Wk=(s,e)=>{const t=Sm(s,e);if(!t)return!1;const[,n]=sX(e,s,t.$pos.pos+4);return n},Z3=(s,e,t)=>{const{$anchor:n}=s.selection,i=Math.max(0,n.pos-2),r=s.doc.resolve(i).node();return!(!r||!t.includes(r.type.name))},Q3=(s,e)=>{var t;const{$anchor:n}=e.selection,i=e.doc.resolve(n.pos-2);return!(i.index()===0||((t=i.nodeBefore)==null?void 0:t.type.name)!==s)},J3=(s,e,t)=>{if(!t)return!1;const n=ii(s,e.schema);let i=!1;return t.descendants(r=>{r.type===n&&(i=!0)}),i},Hk=(s,e,t)=>{if(s.commands.undoInputRule())return!0;if(s.state.selection.from!==s.state.selection.to)return!1;if(!Nc(s.state,e)&&Z3(s.state,e,t)){const{$anchor:a}=s.state.selection,l=s.state.doc.resolve(a.before()-1),c=[];l.node().descendants((u,f)=>{u.type.name===e&&c.push({node:u,pos:f})});const d=c.at(-1);if(!d)return!1;const h=s.state.doc.resolve(l.start()+d.pos+1);return s.chain().cut({from:a.start()-1,to:a.end()+1},h.end()).joinForward().run()}if(!Nc(s.state,e)||!lX(s.state))return!1;const n=Sm(e,s.state);if(!n)return!1;const r=s.state.doc.resolve(n.$pos.pos-2).node(n.depth),o=J3(e,s.state,r);return Q3(e,s.state)&&!o?s.commands.joinItemBackward():s.chain().liftListItem(e).run()},eF=(s,e)=>{const t=Wk(s,e),n=Sm(s,e);return!n||!t?!1:t>n.depth},tF=(s,e)=>{const t=Wk(s,e),n=Sm(s,e);return!n||!t?!1:t<n.depth},zk=(s,e)=>{if(!Nc(s.state,e)||!aX(s.state,e))return!1;const{selection:t}=s.state,{$from:n,$to:i}=t;return!t.empty&&n.sameParent(i)?!1:eF(e,s.state)?s.chain().focus(s.state.selection.from+4).lift(e).joinBackward().run():tF(e,s.state)?s.chain().joinForward().joinBackward().run():s.commands.joinItemForward()},JJ=(s,e)=>{var t;const{$anchor:n}=e.selection,i=e.doc.resolve(n.pos-n.parentOffset-2);return!(i.index()===i.parent.childCount-1||((t=i.nodeAfter)==null?void 0:t.type.name)!==s)},nF=Gt.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:s})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t})=>{s.state.schema.nodes[t]!==void 0&&zk(s,t)&&(e=!0)}),e},"Mod-Delete":({editor:s})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t})=>{s.state.schema.nodes[t]!==void 0&&zk(s,t)&&(e=!0)}),e},Backspace:({editor:s})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t,wrapperNames:n})=>{s.state.schema.nodes[t]!==void 0&&Hk(s,t,n)&&(e=!0)}),e},"Mod-Backspace":({editor:s})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t,wrapperNames:n})=>{s.state.schema.nodes[t]!==void 0&&Hk(s,t,n)&&(e=!0)}),e}}}}),eee="listItem",iF="textStyle",sF=/^(\d+)\.\s$/,rF=Ni.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:s=>s.hasAttribute("start")?parseInt(s.getAttribute("start")||"",10):1},type:{default:null,parseHTML:s=>s.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:s}){const{start:e,...t}=s;return e===1?["ol",$t(this.options.HTMLAttributes,t),0]:["ol",$t(this.options.HTMLAttributes,s),0]},addCommands(){return{toggleOrderedList:()=>({commands:s,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(eee,this.editor.getAttributes(iF)).run():s.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let s=Ef({find:sF,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(s=Ef({find:sF,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(iF)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[s]}}),tee=/^\s*(\[([( |x])?\])\s$/,nee=Ni.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:s=>{const e=s.getAttribute("data-checked");return e===""||e==="true"},renderHTML:s=>({"data-checked":s.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:s,HTMLAttributes:e}){return["li",$t(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:s.attrs.checked?"checked":null}],["span"]],["div",0]]},addKeyboardShortcuts(){const s={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...s,Tab:()=>this.editor.commands.sinkListItem(this.name)}:s},addNodeView(){return({node:s,HTMLAttributes:e,getPos:t,editor:n})=>{const i=document.createElement("li"),r=document.createElement("label"),o=document.createElement("span"),a=document.createElement("input"),l=document.createElement("div"),c=d=>{var h,u;a.ariaLabel=((u=(h=this.options.a11y)==null?void 0:h.checkboxLabel)==null?void 0:u.call(h,d,a.checked))||`Task item checkbox for ${d.textContent||"empty task item"}`};return c(s),r.contentEditable="false",a.type="checkbox",a.addEventListener("mousedown",d=>d.preventDefault()),a.addEventListener("change",d=>{if(!n.isEditable&&!this.options.onReadOnlyChecked){a.checked=!a.checked;return}const{checked:h}=d.target;n.isEditable&&typeof t=="function"&&n.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:u})=>{const f=t();if(typeof f!="number")return!1;const g=u.doc.nodeAt(f);return u.setNodeMarkup(f,void 0,{...g?.attrs,checked:h}),!0}).run(),!n.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(s,h)||(a.checked=!a.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([d,h])=>{i.setAttribute(d,h)}),i.dataset.checked=s.attrs.checked,a.checked=s.attrs.checked,r.append(a,o),i.append(r,l),Object.entries(e).forEach(([d,h])=>{i.setAttribute(d,h)}),{dom:i,contentDOM:l,update:d=>d.type!==this.type?!1:(i.dataset.checked=d.attrs.checked,a.checked=d.attrs.checked,c(d),!0)}}},addInputRules(){return[Ef({find:tee,type:this.type,getAttributes:s=>({checked:s[s.length-1]==="x"})})]}}),iee=Ni.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:s}){return["ul",$t(this.options.HTMLAttributes,s,{"data-type":this.name}),0]},addCommands(){return{toggleTaskList:()=>({commands:s})=>s.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});Gt.create({name:"listKit",addExtensions(){const s=[];return this.options.bulletList!==!1&&s.push(Y3.configure(this.options.bulletList)),this.options.listItem!==!1&&s.push(X3.configure(this.options.listItem)),this.options.listKeymap!==!1&&s.push(nF.configure(this.options.listKeymap)),this.options.orderedList!==!1&&s.push(rF.configure(this.options.orderedList)),this.options.taskItem!==!1&&s.push(nee.configure(this.options.taskItem)),this.options.taskList!==!1&&s.push(iee.configure(this.options.taskList)),s}});var oF=Ni.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:s}){return["p",$t(this.options.HTMLAttributes,s),0]},addCommands(){return{setParagraph:()=>({commands:s})=>s.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),see=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,ree=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,oee=_o.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:s=>s.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:s}){return["s",$t(this.options.HTMLAttributes,s),0]},addCommands(){return{setStrike:()=>({commands:s})=>s.setMark(this.name),toggleStrike:()=>({commands:s})=>s.toggleMark(this.name),unsetStrike:()=>({commands:s})=>s.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[qd({find:see,type:this.type})]},addPasteRules(){return[Dc({find:ree,type:this.type})]}}),aee=Ni.create({name:"text",group:"inline"}),lee=_o.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:s=>s.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:s}){return["u",$t(this.options.HTMLAttributes,s),0]},addCommands(){return{setUnderline:()=>({commands:s})=>s.setMark(this.name),toggleUnderline:()=>({commands:s})=>s.toggleMark(this.name),unsetUnderline:()=>({commands:s})=>s.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function cee(s={}){return new yn({view(e){return new dee(e,s)}})}class dee{constructor(e,t){var n;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(n=t.width)!==null&&n!==void 0?n:1,this.color=t.color===!1?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let r=o=>{this[i](o)};return e.dom.addEventListener(i,r),{name:i,handler:r}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,n,i=this.editorView.dom,r=i.getBoundingClientRect(),o=r.width/i.offsetWidth,a=r.height/i.offsetHeight;if(t){let h=e.nodeBefore,u=e.nodeAfter;if(h||u){let f=this.editorView.nodeDOM(this.cursorPos-(h?h.nodeSize:0));if(f){let g=f.getBoundingClientRect(),p=h?g.bottom:g.top;h&&u&&(p=(p+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let m=this.width/2*a;n={left:g.left,right:g.right,top:p-m,bottom:p+m}}}}if(!n){let h=this.editorView.coordsAtPos(this.cursorPos),u=this.width/2*o;n={left:h.left-u,right:h.left+u,top:h.top,bottom:h.bottom}}let l=this.editorView.dom.offsetParent;this.element||(this.element=l.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",t),this.element.classList.toggle("prosemirror-dropcursor-inline",!t);let c,d;if(!l||l==document.body&&getComputedStyle(l).position=="static")c=-pageXOffset,d=-pageYOffset;else{let h=l.getBoundingClientRect(),u=h.width/l.offsetWidth,f=h.height/l.offsetHeight;c=h.left-l.scrollLeft*u,d=h.top-l.scrollTop*f}this.element.style.left=(n.left-c)/o+"px",this.element.style.top=(n.top-d)/a+"px",this.element.style.width=(n.right-n.left)/o+"px",this.element.style.height=(n.bottom-n.top)/a+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),i=n&&n.type.spec.disableDropCursor,r=typeof i=="function"?i(this.editorView,t,e):i;if(t&&!r){let o=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=PP(this.editorView.state.doc,o,this.editorView.dragging.slice);a!=null&&(o=a)}this.setCursor(o),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class Pn extends je{constructor(e){super(e,e)}map(e,t){let n=e.resolve(t.map(this.head));return Pn.valid(n)?new Pn(n):je.near(n)}content(){return _e.empty}eq(e){return e instanceof Pn&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Pn(e.resolve(t.pos))}getBookmark(){return new $k(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!hee(e)||!uee(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let i=t.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,t,n=!1){e:for(;;){if(!n&&Pn.valid(e))return e;let i=e.pos,r=null;for(let o=e.depth;;o--){let a=e.node(o);if(t>0?e.indexAfter(o)<a.childCount:e.index(o)>0){r=a.child(t>0?e.indexAfter(o):e.index(o)-1);break}else if(o==0)return null;i+=t;let l=e.doc.resolve(i);if(Pn.valid(l))return l}for(;;){let o=t>0?r.firstChild:r.lastChild;if(!o){if(r.isAtom&&!r.isText&&!Be.isSelectable(r)){e=e.doc.resolve(i+r.nodeSize*t),n=!1;continue e}break}r=o,i+=t;let a=e.doc.resolve(i);if(Pn.valid(a))return a}return null}}}Pn.prototype.visible=!1,Pn.findFrom=Pn.findGapCursorFrom,je.jsonID("gapcursor",Pn);class $k{constructor(e){this.pos=e}map(e){return new $k(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return Pn.valid(t)?new Pn(t):je.near(t)}}function hee(s){for(let e=s.depth;e>=0;e--){let t=s.index(e),n=s.node(e);if(t==0){if(n.type.spec.isolating)return!0;continue}for(let i=n.child(t-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function uee(s){for(let e=s.depth;e>=0;e--){let t=s.indexAfter(e),n=s.node(e);if(t==n.childCount){if(n.type.spec.isolating)return!0;continue}for(let i=n.child(t);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function fee(){return new yn({props:{decorations:_ee,createSelectionBetween(s,e,t){return e.pos==t.pos&&Pn.valid(t)?new Pn(t):null},handleClick:pee,handleKeyDown:gee,handleDOMEvents:{beforeinput:mee}}})}const gee=$L({ArrowLeft:Lw("horiz",-1),ArrowRight:Lw("horiz",1),ArrowUp:Lw("vert",-1),ArrowDown:Lw("vert",1)});function Lw(s,e){const t=s=="vert"?e>0?"down":"up":e>0?"right":"left";return function(n,i,r){let o=n.selection,a=e>0?o.$to:o.$from,l=o.empty;if(o instanceof Ve){if(!r.endOfTextblock(t)||a.depth==0)return!1;l=!1,a=n.doc.resolve(e>0?a.after():a.before())}let c=Pn.findGapCursorFrom(a,e,l);return c?(i&&i(n.tr.setSelection(new Pn(c))),!0):!1}}function pee(s,e,t){if(!s||!s.editable)return!1;let n=s.state.doc.resolve(e);if(!Pn.valid(n))return!1;let i=s.posAtCoords({left:t.clientX,top:t.clientY});return i&&i.inside>-1&&Be.isSelectable(s.state.doc.nodeAt(i.inside))?!1:(s.dispatch(s.state.tr.setSelection(new Pn(n))),!0)}function mee(s,e){if(e.inputType!="insertCompositionText"||!(s.state.selection instanceof Pn))return!1;let{$from:t}=s.state.selection,n=t.parent.contentMatchAt(t.index()).findWrapping(s.state.schema.nodes.text);if(!n)return!1;let i=te.empty;for(let o=n.length-1;o>=0;o--)i=te.from(n[o].createAndFill(null,i));let r=s.state.tr.replace(t.pos,t.pos,new _e(i,0,0));return r.setSelection(Ve.near(r.doc.resolve(t.pos+1))),s.dispatch(r),!1}function _ee(s){if(!(s.selection instanceof Pn))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",hn.create(s.doc,[Ei.widget(s.selection.head,e,{key:"gapcursor"})])}var kw=200,Di=function(){};Di.prototype.append=function(e){return e.length?(e=Di.from(e),!this.length&&e||e.length<kw&&this.leafAppend(e)||this.length<kw&&e.leafPrepend(this)||this.appendInner(e)):this},Di.prototype.prepend=function(e){return e.length?Di.from(e).append(this):this},Di.prototype.appendInner=function(e){return new bee(this,e)},Di.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?Di.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},Di.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Di.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},Di.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var i=[];return this.forEach(function(r,o){return i.push(e(r,o))},t,n),i},Di.from=function(e){return e instanceof Di?e:e&&e.length?new aF(e):Di.empty};var aF=(function(s){function e(n){s.call(this),this.values=n}s&&(e.__proto__=s),e.prototype=Object.create(s&&s.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,r){return i==0&&r==this.length?this:new e(this.values.slice(i,r))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,r,o,a){for(var l=r;l<o;l++)if(i(this.values[l],a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(i,r,o,a){for(var l=r-1;l>=o;l--)if(i(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=kw)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=kw)return new e(i.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e})(Di);Di.empty=new aF([]);var bee=(function(s){function e(t,n){s.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return s&&(e.__proto__=s),e.prototype=Object.create(s&&s.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(n){return n<this.left.length?this.left.get(n):this.right.get(n-this.left.length)},e.prototype.forEachInner=function(n,i,r,o){var a=this.left.length;if(i<a&&this.left.forEachInner(n,i,Math.min(r,a),o)===!1||r>a&&this.right.forEachInner(n,Math.max(i-a,0),Math.min(this.length,r)-a,o+a)===!1)return!1},e.prototype.forEachInvertedInner=function(n,i,r,o){var a=this.left.length;if(i>a&&this.right.forEachInvertedInner(n,i-a,Math.max(r,a)-a,o+a)===!1||r<a&&this.left.forEachInvertedInner(n,Math.min(i,a),r,o)===!1)return!1},e.prototype.sliceInner=function(n,i){if(n==0&&i==this.length)return this;var r=this.left.length;return i<=r?this.left.slice(n,i):n>=r?this.right.slice(n-r,i-r):this.left.slice(n,r).append(this.right.slice(0,i-r))},e.prototype.leafAppend=function(n){var i=this.right.leafAppend(n);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(n){var i=this.left.leafPrepend(n);if(i)return new e(i,this.right)},e.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new e(this.left,new e(this.right,n)):new e(this,n)},e})(Di);const wee=500;class wo{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let n=this.items.length;for(;;n--)if(this.items.get(n-1).selection){--n;break}let i,r;t&&(i=this.remapping(n,this.items.length),r=i.maps.length);let o=e.tr,a,l,c=[],d=[];return this.items.forEach((h,u)=>{if(!h.step){i||(i=this.remapping(n,u+1),r=i.maps.length),r--,d.push(h);return}if(i){d.push(new ta(h.map));let f=h.step.map(i.slice(r)),g;f&&o.maybeStep(f).doc&&(g=o.mapping.maps[o.mapping.maps.length-1],c.push(new ta(g,void 0,void 0,c.length+d.length))),r--,g&&i.appendMap(g,r)}else o.maybeStep(h.step);if(h.selection)return a=i?h.selection.map(i.slice(r)):h.selection,l=new wo(this.items.slice(0,n).append(d.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:o,selection:a}}addTransform(e,t,n,i){let r=[],o=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null;for(let d=0;d<e.steps.length;d++){let h=e.steps[d].invert(e.docs[d]),u=new ta(e.mapping.maps[d],h,t),f;(f=l&&l.merge(u))&&(u=f,d?r.pop():a=a.slice(0,a.length-1)),r.push(u),t&&(o++,t=void 0),i||(l=u)}let c=o-n.depth;return c>vee&&(a=Cee(a,c),o-=c),new wo(a.append(r),o)}remapping(e,t){let n=new Xp;return this.items.forEach((i,r)=>{let o=i.mirrorOffset!=null&&r-i.mirrorOffset>=e?n.maps.length-i.mirrorOffset:void 0;n.appendMap(i.map,o)},e,t),n}addMaps(e){return this.eventCount==0?this:new wo(this.items.append(e.map(t=>new ta(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],i=Math.max(0,this.items.length-t),r=e.mapping,o=e.steps.length,a=this.eventCount;this.items.forEach(u=>{u.selection&&a--},i);let l=t;this.items.forEach(u=>{let f=r.getMirror(--l);if(f==null)return;o=Math.min(o,f);let g=r.maps[f];if(u.step){let p=e.steps[f].invert(e.docs[f]),m=u.selection&&u.selection.map(r.slice(l+1,f));m&&a++,n.push(new ta(g,p,m))}else n.push(new ta(g))},i);let c=[];for(let u=t;u<o;u++)c.push(new ta(r.maps[u]));let d=this.items.slice(0,i).append(c).append(n),h=new wo(d,a);return h.emptyItemCount()>wee&&(h=h.compress(this.items.length-n.length)),h}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,i=[],r=0;return this.items.forEach((o,a)=>{if(a>=e)i.push(o),o.selection&&r++;else if(o.step){let l=o.step.map(t.slice(n)),c=l&&l.getMap();if(n--,c&&t.appendMap(c,n),l){let d=o.selection&&o.selection.map(t.slice(n));d&&r++;let h=new ta(c.invert(),l,d),u,f=i.length-1;(u=i.length&&i[f].merge(h))?i[f]=u:i.push(h)}}else o.map&&n--},this.items.length,0),new wo(Di.from(i.reverse()),r)}}wo.empty=new wo(Di.empty,0);function Cee(s,e){let t;return s.forEach((n,i)=>{if(n.selection&&e--==0)return t=i,!1}),s.slice(t)}class ta{constructor(e,t,n,i){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new ta(t.getMap().invert(),t,this.selection)}}}class Ac{constructor(e,t,n,i,r){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=i,this.prevComposition=r}}const vee=20;function yee(s,e,t,n){let i=t.getMeta(Zd),r;if(i)return i.historyState;t.getMeta(Lee)&&(s=new Ac(s.done,s.undone,null,0,-1));let o=t.getMeta("appendedTransaction");if(t.steps.length==0)return s;if(o&&o.getMeta(Zd))return o.getMeta(Zd).redo?new Ac(s.done.addTransform(t,void 0,n,Ew(e)),s.undone,lF(t.mapping.maps),s.prevTime,s.prevComposition):new Ac(s.done,s.undone.addTransform(t,void 0,n,Ew(e)),null,s.prevTime,s.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let a=t.getMeta("composition"),l=s.prevTime==0||!o&&s.prevComposition!=a&&(s.prevTime<(t.time||0)-n.newGroupDelay||!See(t,s.prevRanges)),c=o?Uk(s.prevRanges,t.mapping):lF(t.mapping.maps);return new Ac(s.done.addTransform(t,l?e.selection.getBookmark():void 0,n,Ew(e)),wo.empty,c,t.time,a??s.prevComposition)}else return(r=t.getMeta("rebased"))?new Ac(s.done.rebased(t,r),s.undone.rebased(t,r),Uk(s.prevRanges,t.mapping),s.prevTime,s.prevComposition):new Ac(s.done.addMaps(t.mapping.maps),s.undone.addMaps(t.mapping.maps),Uk(s.prevRanges,t.mapping),s.prevTime,s.prevComposition)}function See(s,e){if(!e)return!1;if(!s.docChanged)return!0;let t=!1;return s.mapping.maps[0].forEach((n,i)=>{for(let r=0;r<e.length;r+=2)n<=e[r+1]&&i>=e[r]&&(t=!0)}),t}function lF(s){let e=[];for(let t=s.length-1;t>=0&&e.length==0;t--)s[t].forEach((n,i,r,o)=>e.push(r,o));return e}function Uk(s,e){if(!s)return null;let t=[];for(let n=0;n<s.length;n+=2){let i=e.map(s[n],1),r=e.map(s[n+1],-1);i<=r&&t.push(i,r)}return t}function xee(s,e,t){let n=Ew(e),i=Zd.get(e).spec.config,r=(t?s.undone:s.done).popEvent(e,n);if(!r)return null;let o=r.selection.resolve(r.transform.doc),a=(t?s.done:s.undone).addTransform(r.transform,e.selection.getBookmark(),i,n),l=new Ac(t?a:r.remaining,t?r.remaining:a,null,0,-1);return r.transform.setSelection(o).setMeta(Zd,{redo:t,historyState:l})}let jk=!1,cF=null;function Ew(s){let e=s.plugins;if(cF!=e){jk=!1,cF=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){jk=!0;break}}return jk}const Zd=new Gn("history"),Lee=new Gn("closeHistory");function kee(s={}){return s={depth:s.depth||100,newGroupDelay:s.newGroupDelay||500},new yn({key:Zd,state:{init(){return new Ac(wo.empty,wo.empty,null,0,-1)},apply(e,t,n){return yee(t,n,e,s)}},config:s,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,i=n=="historyUndo"?hF:n=="historyRedo"?uF:null;return i?(t.preventDefault(),i(e.state,e.dispatch)):!1}}}})}function dF(s,e){return(t,n)=>{let i=Zd.getState(t);if(!i||(s?i.undone:i.done).eventCount==0)return!1;if(n){let r=xee(i,t,s);r&&n(e?r.scrollIntoView():r)}return!0}}const hF=dF(!1,!0),uF=dF(!0,!0);Gt.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:s=>s.length,wordCounter:s=>s.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=s=>{const e=s?.node||this.editor.state.doc;if((s?.mode||this.options.mode)==="textSize"){const n=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(n)}return e.nodeSize},this.storage.words=s=>{const e=s?.node||this.editor.state.doc,t=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(t)}},addProseMirrorPlugins(){let s=!1;return[new yn({key:new Gn("characterCount"),appendTransaction:(e,t,n)=>{if(s)return;const i=this.options.limit;if(i==null||i===0){s=!0;return}const r=this.storage.characters({node:n.doc});if(r>i){const o=r-i,a=0,l=o;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);const c=n.tr.deleteRange(a,l);return s=!0,c}s=!0},filterTransaction:(e,t)=>{const n=this.options.limit;if(!e.docChanged||n===0||n===null||n===void 0)return!0;const i=this.storage.characters({node:t.doc}),r=this.storage.characters({node:e.doc});if(r<=n||i>n&&r>n&&r<=i)return!0;if(i>n&&r>n&&r>i||!e.getMeta("paste"))return!1;const a=e.selection.$head.pos,l=r-n,c=a-l,d=a;return e.deleteRange(c,d),!(this.storage.characters({node:e.doc})>n)}})]}});var Eee=Gt.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[cee(this.options)]}});Gt.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new yn({key:new Gn("focus"),props:{decorations:({doc:s,selection:e})=>{const{isEditable:t,isFocused:n}=this.editor,{anchor:i}=e,r=[];if(!t||!n)return hn.create(s,[]);let o=0;this.options.mode==="deepest"&&s.descendants((l,c)=>{if(l.isText)return;if(!(i>=c&&i<=c+l.nodeSize-1))return!1;o+=1});let a=0;return s.descendants((l,c)=>{if(l.isText||!(i>=c&&i<=c+l.nodeSize-1))return!1;if(a+=1,this.options.mode==="deepest"&&o-a>0||this.options.mode==="shallowest"&&a>1)return this.options.mode==="deepest";r.push(Ei.node(c,c+l.nodeSize,{class:this.options.className}))}),hn.create(s,r)}}})]}});var Nee=Gt.create({name:"gapCursor",addProseMirrorPlugins(){return[fee()]},extendNodeSchema(s){var e;const t={name:s.name,options:s.options,storage:s.storage};return{allowGapCursor:(e=Wt(Pe(s,"allowGapCursor",t)))!=null?e:null}}});Gt.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new yn({key:new Gn("placeholder"),props:{decorations:({doc:s,selection:e})=>{const t=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:n}=e,i=[];if(!t)return null;const r=this.editor.isEmpty;return s.descendants((o,a)=>{const l=n>=a&&n<=a+o.nodeSize,c=!o.isLeaf&&A0(o);if((l||!this.options.showOnlyCurrent)&&c){const d=[this.options.emptyNodeClass];r&&d.push(this.options.emptyEditorClass);const h=Ei.node(a,a+o.nodeSize,{class:d.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:o,pos:a,hasAnchor:l}):this.options.placeholder});i.push(h)}return this.options.includeChildren}),hn.create(s,i)}}})]}}),Gt.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:s,options:e}=this;return[new yn({key:new Gn("selection"),props:{decorations(t){return t.selection.empty||s.isFocused||!s.isEditable||W4(t.selection)||s.view.dragging?null:hn.create(t.doc,[Ei.inline(t.selection.from,t.selection.to,{class:e.className})])}}})]}});function fF({types:s,node:e}){return e&&Array.isArray(s)&&s.includes(e.type)||e?.type===s}var Dee=Gt.create({name:"trailingNode",addOptions(){return{node:"paragraph",notAfter:[]}},addProseMirrorPlugins(){const s=new Gn(this.name),e=Object.entries(this.editor.schema.nodes).map(([,t])=>t).filter(t=>(this.options.notAfter||[]).concat(this.options.node).includes(t.name));return[new yn({key:s,appendTransaction:(t,n,i)=>{const{doc:r,tr:o,schema:a}=i,l=s.getState(i),c=r.content.size,d=a.nodes[this.options.node];if(l)return o.insert(c,d.create())},state:{init:(t,n)=>{const i=n.tr.doc.lastChild;return!fF({node:i,types:e})},apply:(t,n)=>{if(!t.docChanged)return n;const i=t.doc.lastChild;return!fF({node:i,types:e})}}})]}}),Tee=Gt.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:s,dispatch:e})=>hF(s,e),redo:()=>({state:s,dispatch:e})=>uF(s,e)}},addProseMirrorPlugins(){return[kee(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()}}}),Iee=Gt.create({name:"starterKit",addExtensions(){var s,e,t,n;const i=[];return this.options.bold!==!1&&i.push(dJ.configure(this.options.bold)),this.options.blockquote!==!1&&i.push(rJ.configure(this.options.blockquote)),this.options.bulletList!==!1&&i.push(Y3.configure(this.options.bulletList)),this.options.code!==!1&&i.push(fJ.configure(this.options.code)),this.options.codeBlock!==!1&&i.push(mJ.configure(this.options.codeBlock)),this.options.document!==!1&&i.push(_J.configure(this.options.document)),this.options.dropcursor!==!1&&i.push(Eee.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&i.push(Nee.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&i.push(bJ.configure(this.options.hardBreak)),this.options.heading!==!1&&i.push(D3.configure(this.options.heading)),this.options.undoRedo!==!1&&i.push(Tee.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&i.push(wJ.configure(this.options.horizontalRule)),this.options.italic!==!1&&i.push(xJ.configure(this.options.italic)),this.options.listItem!==!1&&i.push(X3.configure(this.options.listItem)),this.options.listKeymap!==!1&&i.push(nF.configure((s=this.options)==null?void 0:s.listKeymap)),this.options.link!==!1&&i.push(K3.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&i.push(rF.configure(this.options.orderedList)),this.options.paragraph!==!1&&i.push(oF.configure(this.options.paragraph)),this.options.strike!==!1&&i.push(oee.configure(this.options.strike)),this.options.text!==!1&&i.push(aee.configure(this.options.text)),this.options.underline!==!1&&i.push(lee.configure((t=this.options)==null?void 0:t.underline)),this.options.trailingNode!==!1&&i.push(Dee.configure((n=this.options)==null?void 0:n.trailingNode)),i}}),Mee=Iee,Ree=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,Aee=Ni.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},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:s}){return["img",$t(this.options.HTMLAttributes,s)]},addCommands(){return{setImage:s=>({commands:e})=>e.insertContent({type:this.name,attrs:s})}},addInputRules(){return[s3({find:Ree,type:this.type,getAttributes:s=>{const[,,e,t,n]=s;return{src:t,alt:e,title:n}}})]}}),Oee=Gt.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:s=>{const e=s.style.textAlign;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:s=>s.textAlign?{style:`text-align: ${s.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:s=>({commands:e})=>this.options.alignments.includes(s)?this.options.types.map(t=>e.updateAttributes(t,{textAlign:s})).every(t=>t):!1,unsetTextAlign:()=>({commands:s})=>this.options.types.map(e=>s.resetAttributes(e,"textAlign")).every(e=>e),toggleTextAlign:s=>({editor:e,commands:t})=>this.options.alignments.includes(s)?e.isActive({textAlign:s})?t.unsetTextAlign():t.setTextAlign(s):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}});const Pee=async s=>{try{const e=new FormData;return e.append("unique","true"),e.append("file",s),(await(await fetch("/file/upload/uploads?id=&form=&table=",{method:"POST",body:e})).json())?.result}catch(e){console.error(e)}},Fee=async(s,e)=>{const t=e.clipboardData?.items;if(t){const n=e.clipboardData?.getData("text/html"),i=e.clipboardData?.getData("text/plain");if(n){const{state:r,dispatch:o}=s,{tr:a}=r,l=gf.fromSchema(s.state.schema),c=new DOMParser().parseFromString(n,"text/html").body,d=l.parse(c),h=a.replaceSelectionWith(d);return o(h),e.preventDefault(),!0}if(i){const{state:r,dispatch:o}=s,{tr:a}=r,l=a.insertText(i,r.selection.from,r.selection.to);return o(l),e.preventDefault(),!0}for(let r=0;r<t.length;r++){const o=t[r];if(o.type.startsWith("image/")){const a=o.getAsFile();if(a){const l=await Pee(a),{schema:c}=s.state,d=c.nodes.image.create({src:l?.file_path}),h=s.state.tr.replaceSelectionWith(d);return s.dispatch(h),e.preventDefault(),!0}}}}return!1},Bee={1:"font-weight:700; font-size:30px;",2:"font-weight:700; font-size:26px;",3:"font-weight:700; font-size:22px;",4:"font-weight:700; font-size:18px;",5:"font-weight:500; font-size:16px;",6:"font-weight:400; font-size:14px;"},Vee=D3.extend({addOptions(){return{...this.parent?.(),levels:[1,2,3,4,5,6]}}}).extend({addAttributes(){return{...this.parent?.(),level:{default:1,renderHTML:s=>{const e=s.level||1;return{class:`heading-level-${e}`,style:Bee[e-1]}}}}}}),Wee=oF.configure({HTMLAttributes:{style:"min-height: 1rem;"}});function Hee(s){let e=!1;const t=PZ({content:s.modelValue,extensions:[Mee.configure({history:{depth:100,newGroupDelay:500},code:{HTMLAttributes:{class:"editor-code"}},codeBlock:{HTMLAttributes:{class:"editor-codeblock"}},paragraph:!1,heading:!1,link:!1}),iJ,nJ,jZ,Wee,Vee,tJ,Aee,Oee.configure({types:["heading","paragraph"]}),K3.configure({HTMLAttributes:{class:"editor-link"},openOnClick:!1,autolink:!0}),QQ.configure({table:{HTMLAttributes:{class:"editor-content"},resizable:!0}})],editorProps:{handlePaste:Fee}}),n=y.computed(()=>t.value||null);return y.watch(t,r=>{r&&t.value.on("update",o=>{if(!e){e=!0;const a=o.editor.getHTML();s.modelValue,setTimeout(()=>{e=!1},10)}})}),{editor:t,editorInstance:n,focusEditor:()=>{t.value&&!t.value.isFocused&&t.value.commands.focus()}}}function zee(s,e){const t=y.ref(!1),n=y.ref(""),i=y.ref(null);return{isHtmlMode:t,htmlContent:n,htmlTextarea:i,toggleHtmlMode:a=>{t.value=a,a?(s.value&&(n.value=s.value.getHTML()),y.nextTick(()=>{i.value&&(i.value.focus(),setTimeout(()=>{i.value.formatCode()},100))})):s.value&&n.value&&s.value.commands.setContent(n.value,!0)},onHtmlInput:a=>{n.value=a,e&&e("update:modelValue",a)}}}function $ee(){const s=y.ref(!1);return{isFullscreen:s,toggleFullscreen:()=>{s.value=!s.value}}}const wn=(s,e)=>{const t=s.__vccOpts||s;for(const[n,i]of e)t[n]=i;return t},Uee={props:{editor:Object},methods:{toggleBlockquote(){this.editor&&this.editor.chain().toggleBlockquote().run()}}};function jee(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("button",{title:"Blockquote",onClick:e[0]||(e[0]=(...o)=>r.toggleBlockquote&&r.toggleBlockquote(...o)),class:"text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100 focus:outline-none"},[...e[1]||(e[1]=[y.createElementVNode("svg",{height:"16",width:"16",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[y.createElementVNode("path",{"fill-rule":"evenodd",d:"M6 6a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h3a3 3 0 0 1-3 3H5a1 1 0 1 0 0 2h1a5 5 0 0 0 5-5V8a2 2 0 0 0-2-2H6Zm9 0a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h3a3 3 0 0 1-3 3h-1a1 1 0 1 0 0 2h1a5 5 0 0 0 5-5V8a2 2 0 0 0-2-2h-3Z"})],-1)])])}const Kee=wn(Uee,[["render",jee]]),qee={props:{editor:Object},methods:{toggleBulletList(){this.editor&&this.editor.chain().focus().toggleBulletList().run()}}};function Gee(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("button",{title:"Bullet List",onClick:e[0]||(e[0]=(...o)=>r.toggleBulletList&&r.toggleBulletList(...o)),class:"text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100"},[...e[1]||(e[1]=[y.createElementVNode("svg",{height:"16",width:"16",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[y.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-width":"2",d:"M9 8h10M9 12h10M9 16h10M4.99 8H5m-.02 4h.01m0 4H5"})],-1)])])}const Yee=wn(qee,[["render",Gee]]),Xee={props:{editor:Object},methods:{toggleOrderedList(){this.editor&&this.editor.chain().focus().toggleOrderedList().run()}}};function Zee(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("button",{title:"Ordered List",onClick:e[0]||(e[0]=(...o)=>r.toggleOrderedList&&r.toggleOrderedList(...o)),class:"text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100"},[...e[1]||(e[1]=[y.createElementVNode("svg",{height:"16",width:"16",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[y.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 6h8m-8 6h8m-8 6h8M4 16a2 2 0 1 1 3.321 1.5L4 20h5M4 5l2-1v6m-2 0h4"})],-1)])])}const Qee=wn(Xee,[["render",Zee]]),Jee={props:{editor:Object},methods:{toggleCodeBlock(){this.editor&&this.editor.chain().focus().toggleCodeBlock().run()}}};function ete(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("button",{title:"Code Block",onClick:e[0]||(e[0]=(...o)=>r.toggleCodeBlock&&r.toggleCodeBlock(...o)),class:"text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100"},[...e[1]||(e[1]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 24 24"},[y.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m8 8-4 4 4 4m8 0 4-4-4-4m-2-3-4 14"})],-1)])])}const tte=wn(Jee,[["render",ete]]),nte={props:{editor:Object},methods:{toggleBold(){this.editor&&this.editor.commands.toggleBold()}}};function ite(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("button",{title:"Bold Text",onClick:e[0]||(e[0]=(...o)=>r.toggleBold&&r.toggleBold(...o)),class:y.normalizeClass(["h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100",{"bg-gray-100 text-gray-900":t.editor?.isActive("bold")}])},[...e[1]||(e[1]=[y.createElementVNode("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 24 24"},[y.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 5h4.5a3.5 3.5 0 1 1 0 7H8m0-7v7m0-7H6m2 7h6.5a3.5 3.5 0 1 1 0 7H8m0-7v7m0 0H6"})],-1),y.createElementVNode("span",{class:"sr-only"},"Bold",-1)])],2)}const ste=wn(nte,[["render",ite]]),rte={props:{editor:Object},methods:{toggleItalic(){this.editor&&this.editor.chain().toggleItalic().run()}}};function ote(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("button",{title:"Italic Text",onClick:e[0]||(e[0]=(...o)=>r.toggleItalic&&r.toggleItalic(...o)),class:y.normalizeClass(["h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100",{"bg-gray-100 text-gray-900":t.editor?.isActive("italic")}])},[...e[1]||(e[1]=[y.createElementVNode("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 24 24"},[y.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m8.874 19 6.143-14M6 19h6.33m-.66-14H18"})],-1),y.createElementVNode("span",{class:"sr-only"},"Italic",-1)])],2)}const ate=wn(rte,[["render",ote]]),lte={__name:"vs-editor-underline",props:{editor:Object},setup(s){const e=s,t=()=>{e.editor&&e.editor.chain().focus().toggleUnderline().run()};return(n,i)=>(y.openBlock(),y.createElementBlock("button",{title:"Underline",onClick:t,class:y.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100",[s.editor?.isActive("underline")?"bg-gray-100 text-gray-900":"text-gray-500"]])},[...i[0]||(i[0]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("path",{d:"M6 4v6a6 6 0 0 0 12 0V4"}),y.createElementVNode("line",{x1:"4",x2:"20",y1:"20",y2:"20"})],-1)])],2))}},cte={__name:"vs-editor-strike",props:{editor:Object},setup(s){const e=s,t=()=>{e.editor&&e.editor.chain().focus().toggleStrike().run()};return(n,i)=>(y.openBlock(),y.createElementBlock("button",{title:"Strikethrough",onClick:t,class:y.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100",[s.editor?.isActive("strike")?"bg-gray-100 text-gray-900":"text-gray-500"]])},[...i[0]||(i[0]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-strikethrough"},[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.createElementVNode("path",{d:"M5 12l14 0"}),y.createElementVNode("path",{d:"M16 6.5a4 2 0 0 0 -4 -1.5h-1a3.5 3.5 0 0 0 0 7h2a3.5 3.5 0 0 1 0 7h-1.5a4 2 0 0 1 -4 -1.5"})],-1)])],2))}},dte={props:{visible:{type:Boolean,default:()=>!1},modelValue:{type:Boolean,default:()=>!1},title:{type:String,default:()=>""},size:{type:String,default:()=>""},closeClickBack:{type:Boolean,default:()=>!1}},emits:["update:visible","update:modelValue","onClose","confirm","cancel"],inheritAttrs:!1,name:"vs-dialog",mounted(){window.addEventListener("keydown",this.checkKey)},unmounted(){window.removeEventListener("keydown",this.checkKey)},computed:{hasSlot(){return!!this.$slots?.footer},checkSize(){return this.size==="small"?"md:w-5/12 w-9/12":this.size==="medium"?"md:w-6/12 w-9/12":"lg:w-7/12 w-11/12"}},methods:{checkKey({key:s}){s==="Escape"&&this.handleClose()},handleClose(){this.$emit("update:visible",!1),this.$emit("update:modelValue",!1),this.$emit("onClose")},handleConfirm(){this.$emit("confirm"),this.handleClose()},handleCancel(){this.$emit("cancel"),this.handleClose()},closeByClickBack(s,e){e&&s.target.classList.contains("vs-dialog-overlay")&&this.handleClose()}}},hte={key:0,class:"vsTailwind ui-dialog__wrapper"},ute={class:"py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]"},fte={class:"font-medium text-gray-800 dark:text-[#ffffff]"},gte={class:"ui-dialog__content p-4"},pte={key:0,class:"flex justify-end gap-x-2"};function mte(s,e,t,n,i,r){return y.openBlock(),y.createBlock(y.Teleport,{to:"body"},[t.visible||t.modelValue?(y.openBlock(),y.createElementBlock("div",hte,[y.createElementVNode("div",{onMousedown:e[1]||(e[1]=o=>r.closeByClickBack(o,t.closeClickBack)),class:"vs-dialog-overlay vs-dialog w-full h-full fixed top-0 start-0 z-[80] bg-black bg-opacity-50"},[y.createVNode(y.Transition,{name:"content",appear:""},{default:y.withCtx(()=>[y.createElementVNode("div",{class:y.normalizeClass(["ui-dialog__modal opacity-1 flex flex-col bg-white dark:bg-[#1A1A1A] border dark:border-[#454545] pointer-events-auto shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-xl",[r.checkSize]])},[y.createElementVNode("div",ute,[y.createElementVNode("h3",fte,y.toDisplayString(t.title),1),y.createElementVNode("button",{type:"button",class:"size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600",onClick:e[0]||(e[0]=(...o)=>r.handleClose&&r.handleClose(...o))},[...e[2]||(e[2]=[y.createElementVNode("span",{class:"sr-only"},"Close",-1),y.createElementVNode("svg",{class:"flex-shrink-0 w-4 h-4",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("path",{d:"M18 6 6 18"}),y.createElementVNode("path",{d:"m6 6 12 12"})],-1)])])]),y.createElementVNode("div",gte,[y.renderSlot(s.$slots,"default",{},void 0,!0)]),r.hasSlot?(y.openBlock(),y.createElementBlock("div",pte,[y.renderSlot(s.$slots,"footer",{handleClose:r.handleClose,handleConfirm:r.handleConfirm,handleCancel:r.handleCancel},void 0,!0)])):y.createCommentVNode("",!0)],2)]),_:3})],32)])):y.createCommentVNode("",!0)])}const gF=wn(dte,[["render",mte],["__scopeId","data-v-479158fb"]]),_te={},bte={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-x"};function wte(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("svg",bte,[...e[0]||(e[0]=[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),y.createElementVNode("path",{d:"M18 6l-12 12"},null,-1),y.createElementVNode("path",{d:"M6 6l12 12"},null,-1)])])}const Cte=wn(_te,[["render",wte]]),vte={},yte={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-search"};function Ste(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("svg",yte,[...e[0]||(e[0]=[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),y.createElementVNode("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"},null,-1),y.createElementVNode("path",{d:"M21 21l-6 -6"},null,-1)])])}const xte=wn(vte,[["render",Ste]]),Lte={},kte={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-mail"};function Ete(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("svg",kte,[...e[0]||(e[0]=[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),y.createElementVNode("path",{d:"M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10z"},null,-1),y.createElementVNode("path",{d:"M3 7l9 6l9 -6"},null,-1)])])}const Nte=wn(Lte,[["render",Ete]]),Dte=y.defineComponent({components:{IconClose:Cte,IconSearch:xte,IconEmail:Nte},inheritAttrs:!1,props:{icon:{type:String,default:()=>""},disabled:{type:Boolean,default:()=>!1},clearable:{type:Boolean,default:()=>!1},modelValue:{type:String,default:()=>""},placeholder:{type:String,default:()=>""},iconPosition:{type:String,default:()=>"right"},type:{type:String,default:()=>"text"},style:{type:Object,default:()=>null},size:{type:String,default:()=>"md"},attrs:{type:Object,default:()=>{}}},emits:["onInput","update:modelValue","blur","focus"],computed:{checkSize(){if((this.style?.size||this.size)==="xs")return"h-[32px] text-sm";if((this.style?.size||this.size)==="md")return"h-[38px] text-sm";this.style?.size||this.size},value:{get(){return this.modelValue},set(s){this.$emit("update:modelValue",s.trim())}},clearIconStyle(){return[{"right-8":this.icon&&this.iconPosition==="right","right-3":!this.icon||this.iconPosition!=="right","pointer-events-none":this.disabled}]},iconStylePosition(){return[{"left-3":this.icon&&this.iconPosition==="left","right-3":this.icon&&this.iconPosition==="right"}]},inputStyle(){return[{"!pr-8":this.clearable&&!this.icon,"!pr-7":this.clearable,"!pr-16":this.clearable&&this.icon&&this.iconPosition==="right","!pl-8":this.icon&&this.iconPosition==="left","!pr-[50px]":this.clearable&&this.value&&this.icon&&this.iconPosition==="right","!cursor-not-allowed bg-slate-100":this.disabled,"bg-white":!this.disabled}]}},methods:{handleInput(){this.$emit("onInput",this.modelValue)},handleBlur(){this.$emit("blur")},handleFocus(){this.$emit("focus")},clearInput(){this.$emit("update:modelValue",""),this.$emit("onInput","")},async inputFocus(){const{vsText:s}=await this.$refs;await s.focus()}}}),Tte={class:"vs-form-text relative bg-white rounded-lg"},Ite={key:2,class:"absolute bottom-2/4 translate-y-2/4 left-[10px] cursor-pointer"},Mte=["disabled","type","placeholder"];function Rte(s,e,t,n,i,r){const o=y.resolveComponent("IconClose"),a=y.resolveComponent("IconSearch"),l=y.resolveComponent("IconEmail");return y.openBlock(),y.createElementBlock("div",Tte,[s.clearable&&s.value?(y.openBlock(),y.createElementBlock("div",{key:0,class:"absolute bottom-2/4 translate-y-2/4 right-3 cursor-pointer",onClick:e[0]||(e[0]=(...c)=>s.clearInput&&s.clearInput(...c))},[y.createVNode(o,{width:"15px",height:"15px",class:"stroke-gray-500 hover:stroke-red-500 transition-all"})])):y.createCommentVNode("",!0),s.icon&&s.icon==="search"?(y.openBlock(),y.createElementBlock("div",{key:1,class:y.normalizeClass(["absolute bottom-2/4 translate-y-2/4 cursor-pointer",s.iconStylePosition])},[y.createVNode(a,{width:"15px",height:"15px",class:"stroke-gray-500 transition-all"})],2)):s.icon&&s.icon==="email"?(y.openBlock(),y.createElementBlock("div",Ite,[y.createVNode(l,{width:"16",height:"16",class:"stroke-gray-500 transition-all"})])):(y.openBlock(),y.createElementBlock("i",{key:3,class:y.normalizeClass(["absolute bottom-2/4 translate-y-2/4 text-gray-500 cursor-pointer",["ti "+s.icon,s.iconStylePosition]])},null,2)),s.clearable&&s.value?(y.openBlock(),y.createElementBlock("div",{key:4,class:"absolute bottom-2/4 translate-y-2/4 right-3 cursor-pointer",onClick:e[1]||(e[1]=(...c)=>s.clearInput&&s.clearInput(...c))},[y.createVNode(o,{width:"15px",height:"15px",class:"stroke-gray-500 hover:stroke-red-500 transition-all"})])):y.createCommentVNode("",!0),y.withDirectives(y.createElementVNode("input",y.mergeProps({ref:"vsText",disabled:s.disabled,type:s.type,onInput:e[2]||(e[2]=(...c)=>s.handleInput&&s.handleInput(...c)),placeholder:s.placeholder,"onUpdate:modelValue":e[3]||(e[3]=c=>s.value=c)},s.style?.attrs||s.attrs||{},{onFocus:e[4]||(e[4]=(...c)=>s.handleFocus&&s.handleFocus(...c)),onBlur:e[5]||(e[5]=(...c)=>s.handleBlur&&s.handleBlur(...c)),class:[[s.inputStyle,s.checkSize],"py-2 px-3 block w-full border border-solid placeholder:text-nowrap border-stone-200 rounded-lg text-sm text-stone-800 placeholder:text-stone-400 focus:outline focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"]}),null,16,Mte),[[y.vModelDynamic,s.value]])])}const pF=wn(Dte,[["render",Rte],["__scopeId","data-v-749b581f"]]);function Kk(){const s=y.ref("en");return{t:t=>({en:{type_tag:"Type Tag",heading_1:"Heading 1",heading_2:"Heading 2",heading_3:"Heading 3",paragraph:"Paragraph",createTable:"Create Table",addColumn:"Add Column",addRow:"Add Row",deleteColumn:"Delete Column",deleteRow:"Delete Row",deleteTable:"Delete Table",mergeCells:"Merge Cells",splitCells:"Split Cells",linkTitle:"Enter Link"},uk:{type_tag:"Тип тегу",heading_1:"Заголовок 1",heading_2:"Заголовок 2",heading_3:"Заголовок 3",paragraph:"Параграф",createTable:"Створити Таблицю",addColumn:"Додати Колону",addRow:"Додати Рядок",deleteColumn:"Вилучити Колону",deleteRow:"Вилучити Рядок",deleteTable:"Вилучити Таблицю",mergeCells:"Об'єднати Клітинки",splitCells:"Розділити Клітинки",linkTitle:"Введіть Посилання"}})[s.value]?.[t]||t,locale:s}}const Ate={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"},Ote=Object.assign({inheritAttrs:!1},{__name:"vs-editor-link",props:{editor:Object},setup(s){const{t:e}=Kk(),t=s,n=y.ref(!1),i=y.ref(""),r=()=>{t.editor.chain().focus().toggleLink({href:i.value}).run(),n.value=!1,i.value=""};return(o,a)=>(y.openBlock(),y.createElementBlock(y.Fragment,null,[y.createElementVNode("button",{title:"Link",onClick:a[0]||(a[0]=l=>n.value=!0),class:"text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100 focus:outline-none"},[...a[4]||(a[4]=[y.createElementVNode("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 24 24"},[y.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13.213 9.787a3.391 3.391 0 0 0-4.795 0l-3.425 3.426a3.39 3.39 0 0 0 4.795 4.794l.321-.304m-.321-4.49a3.39 3.39 0 0 0 4.795 0l3.424-3.426a3.39 3.39 0 0 0-4.794-4.795l-1.028.961"})],-1)])]),y.createVNode(gF,{title:y.unref(e)("linkTitle"),visible:n.value,"onUpdate:visible":a[3]||(a[3]=l=>n.value=l),size:"small"},{footer:y.withCtx(()=>[y.createElementVNode("div",Ate,[y.createElementVNode("button",{style:{border:"1px solid #000"},onClick:a[2]||(a[2]=l=>{n.value=!1,i.value=""}),class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-black border-gray-200 rounded-lg !border-gray-200 hover:bg-gray-100 duration-300"},y.toDisplayString(y.unref(e)("cancel")),1),y.createElementVNode("button",{onClick:r,class:"py-2 px-3 inline-flex items-center gap-x-2 text-[14px] font-[400] whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"},y.toDisplayString(y.unref(e)("create")),1)])]),default:y.withCtx(()=>[y.createVNode(pF,{modelValue:i.value,"onUpdate:modelValue":a[1]||(a[1]=l=>i.value=l),placeholder:y.unref(e)("linkTitle")},null,8,["modelValue","placeholder"])]),_:1},8,["title","visible"])],64))}}),xm=async(s,e,t,n=10)=>{if(!e||!t)return;await y.nextTick();const i=await t?.getBoundingClientRect(),r=await e?.getBoundingClientRect();if(!r||!i)return;const o=await parseInt(e?.getBoundingClientRect()?.height),a=await parseInt(e?.getBoundingClientRect()?.width),l=await parseInt(t?.getBoundingClientRect()?.height),c=await parseInt(t?.getBoundingClientRect()?.width),d=await window.innerHeight,h=await window.innerWidth;let u=0,f=0;const g=r.bottom+n+l;switch(s){case"top":r.top-i.height-n<0?u=r.top-i.height+n+l+o:u=r.top-i.height-n,h>c+r.right+30?f=r.left-i.width/2+r.width/2:f=h-30-c;break;case"bottom":d>g?u=r.bottom+n:u=r.bottom-n-l-o,f=r.left-i.width/2+r.width/2;break;case"left":u=r.top-i.height/2+r.height/2,r.left-i.width-n>0?f=r.left-i.width-n:f=10;break;case"right":u=r.top-i.height/2+r.height/2,h-a>c?f=r.right+n:f=h-30-c;break;case"top-right":r.top-i.height-n<0?u=r.top-i.height+n+l+o:u=r.top-i.height-n,h-a>c?f=r.right+n:f=h-30-c;break;case"top-left":r.top-i.height-n<0?u=r.top-i.height+n+l+o:u=r.top-i.height-n,r.left-i.width-n>0?f=r.left-i.width-n:f=10;break;case"top-start":r.top-i.height-n<0?u=r.top-i.height+n+l+o:u=r.top-i.height-n,r.left>0?f=r.left:f=10;break;case"bottom-right":d>g?u=r.bottom+n:u=r.bottom-n-l-o,h-a>c?f=r.left:f=h-30-c;break;case"bottom-left":d>g?u=r.bottom+n:u=r.bottom-n-l-o,r.left>0?f=r.right-c:f=10;break;case"bottom-start":d>g?u=r.bottom+n:u=r.bottom-n-l-o,r.left>0?f=r.left:f=10;break}u+l>d?u=d-l-n:u<0&&(u=n),f+c>h?f=h-c-n:f<0&&(f=n),t instanceof HTMLElement&&(t.style.top=`${u}px`,t.style.left=`${f}px`,t.style.position="fixed")},Pte={class:"text-center"},Fte={class:"py-2 px-4 w-full text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-lg focus:outline-none focus:bg-stone-100 dark:bg-neutral-900 dark:text-neutral-200 dark:focus:bg-neutral-800 after:h-4 after:absolute after:-bottom-4 after:start-0 after:w-full before:h-4 before:absolute before:-top-4 before:start-0 before:w-full"},Oc=Object.assign({inheritAttrs:!1},{__name:"vs-popover",props:{isOpen:{type:Boolean,default:()=>!1},placement:{type:String,default:"top"},gap:{type:Number,default:8},width:{type:[String,Number],default:""},disabled:{type:Boolean,default:!1},trigger:{type:String,default:"click"},teleport:{type:String,default:"body"}},emits:["isvisible"],setup(s,{expose:e,emit:t}){const n=s,i=t,r=y.ref(!1),o=y.ref([]),a=y.ref(null),l=y.ref(null),c=y.ref(null);y.watch(r,C=>{C?(d(),window.addEventListener("resize",()=>xm(n.placement,l.value,c.value)),xm(n.placement,l.value,c.value)):window.removeEventListener("resize",()=>xm(n.placement,l.value,c.value)),i("isvisible",C)}),y.onMounted(()=>{window.addEventListener("click",m),window.addEventListener("popstate",b),window.addEventListener("scroll",w,!0),d()}),y.onBeforeUnmount(()=>{window.removeEventListener("click",m),window.removeEventListener("popstate",b),h()});const d=()=>{let C=a.value;for(;C&&C!==document.body;)(C.scrollHeight>C.clientHeight||C.scrollWidth>C.clientWidth)&&(C.addEventListener("scroll",p),o.value.push(C)),C=C.parentElement;document.body&&(document.body.addEventListener("scroll",p),o.value.push(document.body))},h=()=>{o.value.forEach(C=>{C.removeEventListener("scroll",p)}),o.value=[]},u=()=>{r.value=!0,xm(n.placement,l.value,c.value)},f=()=>{r.value=!1},g=async()=>{await xm(n.placement,l.value,c.value),r.value=!r.value},p=()=>{r.value=!1},m=C=>{if(!C){r.value=!1;return}l.value?.contains(C.target)||c.value?.contains(C.target)||(r.value=!1)},b=()=>{r.value&&(r.value=!1)},w=C=>{r.value&&c.value&&!c.value.contains(C.target)&&(r.value=!1)};return e({togglePopover:g}),(C,v)=>(y.openBlock(),y.createElementBlock("div",{ref_key:"popover",ref:a,class:"vs-popover inline-block"},[y.createElementVNode("div",Pte,[s.trigger==="click"?(y.openBlock(),y.createElementBlock("div",{key:0,ref_key:"popoverRef",ref:l,onClick:g,class:y.normalizeClass({"pointer-events-none":s.disabled})},[y.renderSlot(C.$slots,"reference",{},()=>[v[0]||(v[0]=y.createElementVNode("button",null,"Click me!",-1))])],2)):y.createCommentVNode("",!0),s.trigger==="hover"?(y.openBlock(),y.createElementBlock("div",{key:1,ref_key:"popoverRef",ref:l,onMouseover:u,onMouseleave:f,class:y.normalizeClass({"pointer-events-none":s.disabled})},[y.renderSlot(C.$slots,"reference",{},()=>[v[1]||(v[1]=y.createElementVNode("button",null,"Click me!",-1))])],34)):y.createCommentVNode("",!0),(y.openBlock(),y.createBlock(y.Teleport,{to:s.teleport},[y.createVNode(y.Transition,{name:"fade"},{default:y.withCtx(()=>[y.withDirectives(y.createElementVNode("div",{class:y.normalizeClass(["vsTailwind vs-popover__content",s.placement]),ref_key:"contentPop",ref:c,style:y.normalizeStyle({width:s.width?s.width+"px":"fit-content",zIndex:10002})},[y.createElementVNode("div",Fte,[y.renderSlot(C.$slots,"default",{},()=>[v[2]||(v[2]=y.createElementVNode("span",null,"Popover content",-1))])])],6),[[y.vShow,r.value]])]),_:3})],8,["to"]))])],512))}}),Bte={class:"flex flex-col gap-[2px] p-[2px]"},Vte=["onClick"],Wte={__name:"vs-editor-table",props:{editor:Object},setup(s){const{t:e}=Kk(),t=s,n=y.ref(!1),i=y.ref("popover"),r=()=>{t.editor&&(t.editor.chain().focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run(),i.value.togglePopover())},o=()=>{t.editor&&(t.editor.chain().focus().addColumnAfter().run(),i.value.togglePopover())},a=()=>{t.editor&&(t.editor.chain().focus().addRowAfter().run(),i.value.togglePopover())},l=()=>{t.editor&&(t.editor.chain().focus().deleteColumn().run(),i.value.togglePopover())},c=()=>{t.editor&&(t.editor.chain().focus().deleteRow().run(),i.value.togglePopover())},d=()=>{t.editor&&(t.editor.chain().focus().deleteTable().run(),i.value.togglePopover())},h=()=>{t.editor&&(t.editor.chain().focus().mergeCells().run(),i.value.togglePopover())},u=()=>{t.editor&&(t.editor.chain().focus().splitCell().run(),i.value.togglePopover())},f=y.computed(()=>[{text:e("createTable"),function:r},{text:e("addColumn"),function:o},{text:e("addRow"),function:a},{text:e("deleteColumn"),function:l},{text:e("deleteRow"),function:c},{text:e("deleteTable"),function:d},{text:e("mergeCells"),function:h},{text:e("splitCells"),function:u}]);return(g,p)=>(y.openBlock(),y.createBlock(Oc,{ref_key:"popover",ref:i,placement:"bottom",onIsvisible:p[0]||(p[0]=m=>n.value=m)},{reference:y.withCtx(()=>[y.createElementVNode("button",{title:"Table",class:y.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded-full hover:text-gray-900 hover:bg-gray-100",[n.value?"bg-gray-100 text-gray-900":"text-gray-500"]])},[...p[1]||(p[1]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-table"},[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.createElementVNode("path",{d:"M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14z"}),y.createElementVNode("path",{d:"M3 10h18"}),y.createElementVNode("path",{d:"M10 3v18"})],-1)])],2)]),default:y.withCtx(()=>[y.createElementVNode("div",Bte,[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(f.value,(m,b)=>(y.openBlock(),y.createElementBlock("button",{key:b,onClick:m?.function,class:"px-2 py-1 text-gray-500 text-start hover:text-gray-900 hover:bg-gray-100 rounded"},y.toDisplayString(m.text),9,Vte))),128))])]),_:1},512))}},Hte={},zte={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-align-center"};function $te(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("svg",zte,[...e[0]||(e[0]=[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),y.createElementVNode("path",{d:"M4 6l16 0"},null,-1),y.createElementVNode("path",{d:"M8 12l8 0"},null,-1),y.createElementVNode("path",{d:"M6 18l12 0"},null,-1)])])}const Ute=wn(Hte,[["render",$te]]),jte={},Kte={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-align-right"};function qte(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("svg",Kte,[...e[0]||(e[0]=[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),y.createElementVNode("path",{d:"M4 6l16 0"},null,-1),y.createElementVNode("path",{d:"M10 12l10 0"},null,-1),y.createElementVNode("path",{d:"M6 18l14 0"},null,-1)])])}const Gte=wn(jte,[["render",qte]]),Yte={},Xte={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-align-left"};function Zte(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("svg",Xte,[...e[0]||(e[0]=[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),y.createElementVNode("path",{d:"M4 6l16 0"},null,-1),y.createElementVNode("path",{d:"M4 12l10 0"},null,-1),y.createElementVNode("path",{d:"M4 18l14 0"},null,-1)])])}const Qte=wn(Yte,[["render",Zte]]),Jte={},ene={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-align-justify"};function tne(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("svg",ene,[...e[0]||(e[0]=[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),y.createElementVNode("path",{d:"M4 6h16"},null,-1),y.createElementVNode("path",{d:"M4 12h16"},null,-1),y.createElementVNode("path",{d:"M4 18h16"},null,-1)])])}const mF={left:Qte,center:Ute,right:Gte,justify:wn(Jte,[["render",tne]])},nne={class:"flex gap-[4px] p-1"},ine=["title","onClick"],sne={__name:"vs-editor-align",props:{editor:Object},setup(s){const e=s,t=y.ref(!1),n=y.ref("popover"),i=y.ref("left"),r=y.computed(()=>e.editor?.isActive("left")),o=y.computed(()=>e.editor?.isActive("right")),a=y.computed(()=>e.editor?.isActive("center")),l=y.computed(()=>e.editor?.isActive("justify")),c=h=>{e.editor&&e.editor.chain().focus().setTextAlign(h).run()},d=y.ref([{id:"left",isActive:r},{id:"center",isActive:a},{id:"right",isActive:o},{id:"justify",isActive:l}]);return(h,u)=>(y.openBlock(),y.createBlock(Oc,{ref_key:"popover",ref:n,placement:"bottom",onIsvisible:u[0]||(u[0]=f=>t.value=f)},{reference:y.withCtx(()=>[y.createElementVNode("button",{title:"Text Align",class:y.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded-full hover:text-gray-900 hover:bg-gray-100",[t.value?"bg-gray-100 text-gray-900":"text-gray-500"]])},[(y.openBlock(),y.createBlock(y.resolveDynamicComponent(y.unref(mF)[i.value]),{height:"16",width:"16"}))],2)]),default:y.withCtx(()=>[y.createElementVNode("div",nne,[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(d.value,f=>(y.openBlock(),y.createElementBlock("button",{title:"Text align "+f?.id,class:y.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded hover:text-gray-900 hover:bg-gray-100",{"bg-gray-100 text-gray-900":f?.isActive}]),key:f?.id,onClick:g=>c(f?.id)},[(y.openBlock(),y.createBlock(y.resolveDynamicComponent(y.unref(mF)[f?.id]),{height:"16",width:"16"}))],10,ine))),128))])]),_:1},512))}},rne={class:"flex flex-col gap-[2px] p-[2px]"},one=["onClick"],ane={__name:"vs-editor-type-tag",props:{editor:Object},setup(s){const{t:e}=Kk(),t=s,n=y.ref(!1),i=y.ref("popover"),r=()=>{t.editor&&(t.editor?.chain().focus().setParagraph().run(),i.value.togglePopover())},o=l=>{t.editor&&(t.editor?.chain().focus().toggleHeading({level:l}).run(),i.value.togglePopover())},a=y.computed(()=>[{text:e("richtext.heading1"),id:1,style:"font-[700] text-[30px]"},{text:e("richtext.heading2"),id:2,style:"font-[700] text-[26px]"},{text:e("richtext.heading3"),id:3,style:"font-[700] text-[22px]"},{text:e("richtext.heading4"),id:4,style:"font-[700] text-[18px]"},{text:e("richtext.heading5"),id:5,style:"font-[500] text-[16px]"},{text:e("richtext.heading6"),id:6,style:"font-[400] text-[14px]"}]);return(l,c)=>(y.openBlock(),y.createBlock(Oc,{ref_key:"popover",ref:i,placement:"bottom",onIsvisible:c[0]||(c[0]=d=>n.value=d)},{reference:y.withCtx(()=>[y.createElementVNode("button",{title:"Type Tag",class:y.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded-full hover:text-gray-900 hover:bg-gray-100",[n.value?"bg-gray-100 text-gray-900":"text-gray-500"]])},[...c[1]||(c[1]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-text-size"},[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.createElementVNode("path",{d:"M3 7v-2h13v2"}),y.createElementVNode("path",{d:"M10 5v14"}),y.createElementVNode("path",{d:"M12 19h-4"}),y.createElementVNode("path",{d:"M15 13v-1h6v1"}),y.createElementVNode("path",{d:"M18 12v7"}),y.createElementVNode("path",{d:"M17 19h2"})],-1)])],2)]),default:y.withCtx(()=>[y.createElementVNode("div",rne,[y.createElementVNode("button",{onClick:r,class:y.normalizeClass(["px-2 py-1 text-gray-500 text-start hover:text-gray-900 hover:bg-gray-100 rounded",[s.editor?.isActive("paragraph")?"bg-gray-100":""]])},y.toDisplayString(y.unref(e)("richtext.paragraph")),3),(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(a.value,(d,h)=>(y.openBlock(),y.createElementBlock("button",{key:h,onClick:u=>o(d?.id),class:y.normalizeClass(["px-2 py-1 text-gray-500 text-start hover:text-gray-900 hover:bg-gray-100 rounded leading-[100%]",[d?.style,s.editor?.isActive("heading",{level:d?.id})?"bg-gray-100":""]])},y.toDisplayString(y.unref(e)(`richtext.heading${d?.id}`)),11,one))),128))])]),_:1},512))}},lne={},cne={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-check"};function dne(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("svg",cne,[...e[0]||(e[0]=[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),y.createElementVNode("path",{d:"M5 12l5 5l10 -10"},null,-1)])])}const Lm=wn(lne,[["render",dne]]),hne={components:{VsText:pF},inheritAttrs:!1,events:["update:modelValue"],props:{modelValue:{type:String},disabled:{type:Boolean,default:()=>!1},clearable:{type:Boolean,default:()=>!1},isTextInputShown:{type:Boolean,default:()=>!0}},computed:{value:{get(){return this.modelValue},set(s){this.$emit("update:modelValue",s)}}}},une={class:"flex items-center w-full max-w-[182px]"},fne=["disabled"];function gne(s,e,t,n,i,r){const o=y.resolveComponent("vs-text");return y.openBlock(),y.createElementBlock("div",une,[y.withDirectives(y.createElementVNode("input",{"onUpdate:modelValue":e[0]||(e[0]=a=>r.value=a),type:"color",class:y.normalizeClass(["w-[38px] h-[38px] min-h-[38px] min-w-[38px] py-[2px] px-[3px] -ml-1 dark:bg-neutral-800 border dark:border-neutral-700 border-stone-200 rounded-lg",t.disabled?"cursor-not-allowed":"cursor-pointer"]),disabled:t.disabled},null,10,fne),[[y.vModelText,r.value]]),t.isTextInputShown?(y.openBlock(),y.createBlock(o,{key:0,modelValue:r.value,"onUpdate:modelValue":e[1]||(e[1]=a=>r.value=a),class:"ml-2 w-full",disabled:t.disabled,clearable:t.clearable},null,8,["modelValue","disabled","clearable"])):y.createCommentVNode("",!0)])}const _F=wn(hne,[["render",gne]]),pne={title:"Text Color",class:"flex flex-col h-[30px] min-w-[30px] px-1 rounded-full hover:bg-gray-100 justify-center items-center relative flex"},mne={class:"flex gap-[4px] mb-[8px]"},_ne={class:"grid grid-rows-3 grid-cols-7"},bne={class:"w-full h-full rounded border border-gray-300 overflow-hidden"},wne=["onClick","title"],Cne={__name:"vs-editor-color",props:{editor:Object},setup(s){const e=s,t=y.ref("popover"),n=y.ref("#000000"),i=y.ref(["#172B4D","#0747A6","#008DA6","#006644","#FF991F","#BF2600","#403294","#97A0AF","#4C9AFF","#00B8D9","#36B37E","#FFC400","#FF5630","#6554C0","#FFFFFF","#B3D4FF","#B3F5FF","#ABF5D1","#FFF0B3","#FFBDAD","#EAE6FF"]),r=l=>{e.editor&&(e.editor.chain().focus().setColor(l).run(),n.value=l,t.value&&t.value.togglePopover())},o=()=>{r(n.value)},a=l=>({"#172B4D":"Default","#0747A6":"Bright blue","#008DA6":"Bright blue-green","#006644":"Bright green","#FF991F":"Bright orange","#BF2600":"Bright red","#403294":"Bright purple","#97A0AF":"Gray","#4C9AFF":"Blue","#00B8D9":"Blue-green","#36B37E":"Green","#FFC400":"Yellow","#FF5630":"Red","#6554C0":"Purple","#FFFFFF":"White","#B3D4FF":"Bright blue","#B3F5FF":"Bright blue-green","#ABF5D1":"Bright green","#FFF0B3":"Bright yellow","#FFBDAD":"Bright red","#EAE6FF":"Bright purple"})[l]||l;return(l,c)=>(y.openBlock(),y.createBlock(Oc,{ref_key:"popover",ref:t,placement:"bottom"},{reference:y.withCtx(()=>[y.createElementVNode("button",pne,[c[1]||(c[1]=y.createElementVNode("span",{class:"leading-none"},"A",-1)),y.createElementVNode("span",{class:"block h-1 w-5",style:y.normalizeStyle({backgroundColor:n.value})},null,4)])]),default:y.withCtx(()=>[y.createElementVNode("div",null,[y.createElementVNode("div",mne,[y.createVNode(_F,{modelValue:n.value,"onUpdate:modelValue":c[0]||(c[0]=d=>n.value=d)},null,8,["modelValue"]),y.createElementVNode("button",{onClick:o,class:"h-[38px] w-[38px] bg-blue-500 shrink-0 border rounded-md flex items-center justify-center hover:bg-blue-700 duration-300"},[y.createVNode(Lm,{class:"h-[24px] w-[24px] text-white"})])]),y.createElementVNode("div",_ne,[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(i.value,d=>(y.openBlock(),y.createElementBlock("div",{key:d,class:"h-8 w-8 p-0.5 rounded border border-transparent hover:border-gray-200 transition-transform cursor-pointer"},[y.createElementVNode("div",bne,[y.createElementVNode("button",{class:"flex items-center justify-center w-full h-full",style:y.normalizeStyle({backgroundColor:d}),onClick:h=>r(d),title:a(d)},[n.value===d?(y.openBlock(),y.createBlock(Lm,{key:0,class:"h-5 w-5 text-gray-500"})):y.createCommentVNode("",!0)],12,wne)])]))),128))])])]),_:1},512))}},vne={title:"Background Color",class:"flex flex-col h-[30px] px-1 rounded-full hover:bg-gray-100 justify-center items-center relative flex"},yne={class:"flex gap-[4px] mb-[8px]"},Sne={class:"grid grid-rows-3 grid-cols-7"},xne={class:"w-full h-full rounded border border-gray-300 overflow-hidden"},Lne=["onClick","title"],kne=["onClick","title"],Ene={__name:"vs-editor-background-color",props:{editor:Object},setup(s){const e=s,t=y.ref("popover"),n=y.ref("transparent"),i=y.ref(["#172B4D","#0747A6","#008DA6","#006644","#FF991F","#BF2600","#403294","#97A0AF","#4C9AFF","#00B8D9","#36B37E","#FFC400","#FF5630","#6554C0","#FFFFFF","#B3D4FF","#B3F5FF","#ABF5D1","#FFF0B3","#FFBDAD","#EAE6FF"]),r=l=>{e.editor&&(e.editor.chain().focus().setBackgroundColor(l).run(),n.value=l,t.value&&t.value.togglePopover())},o=()=>{r(n.value)},a=l=>({"#172B4D":"Default","#0747A6":"Bright blue","#008DA6":"Bright blue-green","#006644":"Bright green","#FF991F":"Bright orange","#BF2600":"Bright red","#403294":"Bright purple","#97A0AF":"Gray","#4C9AFF":"Blue","#00B8D9":"Blue-green","#36B37E":"Green","#FFC400":"Yellow","#FF5630":"Red","#6554C0":"Purple",transparent:"Transparent","#B3D4FF":"Bright blue","#B3F5FF":"Bright blue-green","#ABF5D1":"Bright green","#FFF0B3":"Bright yellow","#FFBDAD":"Bright red","#EAE6FF":"Bright purple"})[l]||l;return(l,c)=>(y.openBlock(),y.createBlock(Oc,{ref_key:"popover",ref:t,placement:"bottom"},{reference:y.withCtx(()=>[y.createElementVNode("button",vne,[c[2]||(c[2]=y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("path",{d:"m19 11-8-8-8.6 8.6a2 2 0 0 0 0 2.8l5.2 5.2c.8.8 2 .8 2.8 0L19 11Z"}),y.createElementVNode("path",{d:"m5 2 5 5"}),y.createElementVNode("path",{d:"M2 13h15"}),y.createElementVNode("path",{d:"M22 20a2 2 0 1 1-4 0c0-1.6 1.7-2.4 2-4 .3 1.6 2 2.4 2 4Z"})],-1)),y.createElementVNode("span",{class:"block h-1 w-5",style:y.normalizeStyle({backgroundColor:n.value})},null,4)])]),default:y.withCtx(()=>[y.createElementVNode("div",null,[y.createElementVNode("div",yne,[y.createVNode(_F,{modelValue:n.value,"onUpdate:modelValue":c[0]||(c[0]=d=>n.value=d)},null,8,["modelValue"]),y.createElementVNode("button",{onClick:o,class:"h-[38px] w-[38px] bg-blue-500 shrink-0 border rounded-md flex items-center justify-center hover:bg-blue-700 duration-300"},[y.createVNode(Lm,{class:"h-[24px] w-[24px] text-white"})])]),y.createElementVNode("div",Sne,[y.createElementVNode("button",{onClick:c[1]||(c[1]=d=>r("transparent")),class:"col-span-7 flex items-center justify-center gap-2 bg-gray-100 rounded-md py-1 mb-2 hover:bg-gray-200"},[...c[3]||(c[3]=[y.createElementVNode("svg",{fill:"#000000",width:"16",height:"16",viewBox:"0 0 52 52","data-name":"Layer 1",xmlns:"http://www.w3.org/2000/svg"},[y.createElementVNode("g",{id:"SVGRepo_bgCarrier","stroke-width":"0"}),y.createElementVNode("g",{id:"SVGRepo_tracerCarrier","stroke-linecap":"round","stroke-linejoin":"round"}),y.createElementVNode("g",{id:"SVGRepo_iconCarrier"},[y.createElementVNode("path",{d:"M48.5,5.6,46.4,3.5a1.67,1.67,0,0,0-2.4.3L32.59,15.21c-.77-1.3-1.51-2.61-2.21-4a36.5,36.5,0,0,1-3.15-8.36c-.13-.53-.39-.91-1-.89s-.86.4-1,.93c-.06.26-.11.51-.17.76A48.3,48.3,0,0,1,21,13.7,97.47,97.47,0,0,1,14.13,25a16,16,0,0,0-3,11.12c0,.14,0,.29.06.43L3.8,44a1.87,1.87,0,0,0-.3,2.4l2.1,2.1A1.67,1.67,0,0,0,8,48.2L48.2,8A1.67,1.67,0,0,0,48.5,5.6Z"}),y.createElementVNode("path",{d:"M38.42,23.79l-22,22.31A14.47,14.47,0,0,0,26.22,50a15.48,15.48,0,0,0,7-1.44c4.94-2.51,8.11-6.4,8.94-12A15.22,15.22,0,0,0,39,24.66C38.87,24.44,38.58,24,38.42,23.79Z"})])],-1),y.createElementVNode("p",null,"no color",-1)])]),(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(i.value,d=>(y.openBlock(),y.createElementBlock("div",{key:d,class:"h-8 w-8 p-0.5 rounded border border-transparent hover:border-gray-200 transition-transform cursor-pointer"},[y.createElementVNode("div",xne,[d!=="transparent"?(y.openBlock(),y.createElementBlock("button",{key:0,class:"flex items-center justify-center w-full h-full",style:y.normalizeStyle({backgroundColor:d}),onClick:h=>r(d),title:a(d)},[n.value===d?(y.openBlock(),y.createBlock(Lm,{key:0,class:"h-5 w-5 text-gray-500"})):y.createCommentVNode("",!0)],12,Lne)):y.createCommentVNode("",!0),d==="transparent"?(y.openBlock(),y.createElementBlock("button",{key:1,class:"flex items-center justify-center w-full h-full",onClick:h=>r(d),title:a(d)},[n.value===d?(y.openBlock(),y.createBlock(Lm,{key:0,class:"h-5 w-5 text-gray-500"})):y.createCommentVNode("",!0)],8,kne)):y.createCommentVNode("",!0)])]))),128))])])]),_:1},512))}},Nne={__name:"vs-editor-highlight",props:{editor:Object},setup(s){const e=s,t=y.computed(()=>e.editor?.isActive("highlight")),n=()=>{e.editor&&e.editor.chain().focus().toggleHighlight().run()};return(i,r)=>(y.openBlock(),y.createElementBlock("button",{title:"Highlight",onClick:n,class:y.normalizeClass(["flex flex-col h-[30px] px-1 rounded-full hover:bg-gray-100 justify-center items-center relative flex",{"bg-gray-200":t.value}])},[...r[0]||(r[0]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("path",{d:"m9 11-6 6v3h9l3-3"}),y.createElementVNode("path",{d:"m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4"})],-1)])],2))}},Dne={class:"truncate"},Tne={class:"w-[200px]"},Ine={class:"max-h-[200px] overflow-y-auto"},Mne=["onClick"],Rne={__name:"vs-editor-font-family",props:{editor:Object},setup(s){const e=s,t=y.ref("popover"),n=y.ref(!1),i=y.ref([{label:"Arial",value:"Arial, sans-serif"},{label:"Helvetica",value:"Helvetica, sans-serif"},{label:"Times New Roman",value:"Times New Roman, serif"},{label:"Georgia",value:"Georgia, serif"},{label:"Verdana",value:"Verdana, sans-serif"},{label:"Courier New",value:"Courier New, monospace"},{label:"Comic Sans MS",value:"Comic Sans MS, cursive"},{label:"Impact",value:"Impact, sans-serif"},{label:"Trebuchet MS",value:"Trebuchet MS, sans-serif"},{label:"Palatino",value:"Palatino, serif"}]),r=y.computed(()=>{if(!e.editor)return"Arial, sans-serif";for(const c of i.value)if(e.editor.isActive("textStyle",{fontFamily:c.value}))return c.value;return"Arial, sans-serif"}),o=y.computed(()=>i.value.find(d=>d.value===r.value)?.label||"Arial"),a=c=>e.editor?e.editor.isActive("textStyle",{fontFamily:c}):!1,l=c=>{e.editor&&(e.editor.chain().focus().setFontFamily(c).run(),t.value&&t.value.togglePopover())};return(c,d)=>(y.openBlock(),y.createBlock(Oc,{ref_key:"popover",ref:t,placement:"bottom",onIsvisible:d[0]||(d[0]=h=>n.value=h)},{reference:y.withCtx(()=>[y.createElementVNode("button",{title:"Font Family",class:y.normalizeClass(["h-[30px] px-2 rounded-full hover:bg-gray-100 justify-center items-center flex text-sm",[n.value?"bg-gray-100 text-gray-900":"text-gray-700"]]),style:y.normalizeStyle({fontFamily:r.value})},[y.createElementVNode("span",Dne,y.toDisplayString(o.value),1),d[1]||(d[1]=y.createElementVNode("svg",{class:"ml-1 text-gray-400",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("polyline",{points:"6,9 12,15 18,9"})],-1))],6)]),default:y.withCtx(()=>[y.createElementVNode("div",Tne,[y.createElementVNode("ul",Ine,[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(i.value,h=>(y.openBlock(),y.createElementBlock("li",{key:h.value,class:y.normalizeClass(["px-3 py-2 hover:bg-gray-100 cursor-pointer text-sm",{"bg-gray-100":a(h.value)}]),style:y.normalizeStyle({fontFamily:h.value}),onClick:u=>l(h.value)},y.toDisplayString(h.label),15,Mne))),128))])])]),_:1},512))}},Ane={class:"w-[120px]"},One={class:"max-h-[200px] overflow-y-auto"},Pne=["onClick"],Fne={__name:"vs-editor-font-size",props:{editor:Object},setup(s){const e=s,t=y.ref("popover"),n=y.ref("14px"),i=y.ref([{label:"8px",value:"8px"},{label:"9px",value:"9px"},{label:"10px",value:"10px"},{label:"11px",value:"11px"},{label:"12px",value:"12px"},{label:"14px",value:"14px"},{label:"16px",value:"16px"},{label:"18px",value:"18px"},{label:"20px",value:"20px"},{label:"24px",value:"24px"},{label:"28px",value:"28px"},{label:"32px",value:"32px"},{label:"36px",value:"36px"},{label:"48px",value:"48px"},{label:"72px",value:"72px"}]),r=o=>{e.editor&&(e.editor.chain().focus().setFontSize(o).run(),n.value=o,t.value&&t.value.togglePopover())};return(o,a)=>(y.openBlock(),y.createBlock(Oc,{ref_key:"popover",ref:t,placement:"bottom"},{reference:y.withCtx(()=>[...a[0]||(a[0]=[y.createElementVNode("button",{title:"Font Size",class:"h-[30px] px-2 min-w-[30px] rounded-full hover:bg-gray-100 justify-center items-center flex text-sm text-gray-700 space-x-1"},[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-alarge-small-icon lucide-a-large-small"},[y.createElementVNode("path",{d:"m15 16 2.536-7.328a1.02 1.02 1 0 1 1.928 0L22 16"}),y.createElementVNode("path",{d:"M15.697 14h5.606"}),y.createElementVNode("path",{d:"m2 16 4.039-9.69a.5.5 0 0 1 .923 0L11 16"}),y.createElementVNode("path",{d:"M3.304 13h6.392"})]),y.createElementVNode("svg",{class:"ml-1 text-gray-400",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("polyline",{points:"6,9 12,15 18,9"})])],-1)])]),default:y.withCtx(()=>[y.createElementVNode("div",Ane,[y.createElementVNode("ul",One,[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(i.value,l=>(y.openBlock(),y.createElementBlock("li",{key:l.value,class:"px-3 py-2 hover:bg-gray-100 cursor-pointer",onClick:c=>r(l.value)},y.toDisplayString(l.label),9,Pne))),128))])])]),_:1},512))}},Bne={props:{editor:Object},methods:{toggleSuperscript(){this.editor&&this.editor.commands.toggleSuperscript()}}};function Vne(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("button",{title:"Superscript",onClick:e[0]||(e[0]=(...o)=>r.toggleSuperscript&&r.toggleSuperscript(...o)),class:y.normalizeClass(["h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100",{"bg-gray-100 text-gray-900":t.editor?.isActive("superscript")}])},[...e[1]||(e[1]=[y.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-superscript-icon lucide-superscript"><path d="m4 19 8-8"></path><path d="m12 19-8-8"></path><path d="M20 12h-4c0-1.5.442-2 1.5-2.5S20 8.334 20 7.002c0-.472-.17-.93-.484-1.29a2.105 2.105 0 0 0-2.617-.436c-.42.239-.738.614-.899 1.06"></path></svg><span class="sr-only">Superscript</span>',2)])],2)}const Wne=wn(Bne,[["render",Vne]]),Hne={props:{editor:Object},methods:{toggleSubscript(){this.editor&&this.editor.commands.toggleSubscript()}}};function zne(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("button",{title:"Subscript",onClick:e[0]||(e[0]=(...o)=>r.toggleSubscript&&r.toggleSubscript(...o)),class:y.normalizeClass(["h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100",{"bg-gray-100 text-gray-900":t.editor?.isActive("subscript")}])},[...e[1]||(e[1]=[y.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-subscript-icon lucide-subscript"><path d="m4 5 8 8"></path><path d="m12 5-8 8"></path><path d="M20 19h-4c0-1.5.44-2 1.5-2.5S20 15.33 20 14c0-.47-.17-.93-.48-1.29a2.11 2.11 0 0 0-2.62-.44c-.42.24-.74.62-.9 1.07"></path></svg><span class="sr-only">Subscript</span>',2)])],2)}const $ne=wn(Hne,[["render",zne]]),Une={title:"Heading",class:"h-[30px] px-2 rounded-full hover:bg-gray-100 justify-center items-center flex text-sm text-gray-700"},jne={class:"truncate"},Kne={class:"max-h-[200px] overflow-y-auto"},qne=["onClick"],Gne=wn({__name:"vs-editor-heading",props:{editor:Object},setup(s){const e=s,t=y.ref("popover"),n=y.ref([{label:"Heading 1",value:1},{label:"Heading 2",value:2},{label:"Heading 3",value:3},{label:"Heading 4",value:4},{label:"Heading 5",value:5},{label:"Heading 6",value:6}]),i=y.computed(()=>{if(!e.editor)return"Paragraph";for(let l=1;l<=6;l++)if(e.editor.isActive("heading",{level:l}))return`H ${l}`;return"P"}),r=l=>({1:"font-weight:700; font-size:30px;",2:"font-weight:700; font-size:26px;",3:"font-weight:700; font-size:22px;",4:"font-weight:700; font-size:18px;",5:"font-weight:500; font-size:16px;",6:"font-weight:400; font-size:14px;"})[l]||"",o=l=>{e.editor&&(e.editor.chain().focus().setHeading({level:l}).run(),t.value&&t.value.togglePopover())},a=()=>{e.editor&&(e.editor.chain().focus().setParagraph().run(),t.value&&t.value.togglePopover())};return(l,c)=>(y.openBlock(),y.createBlock(Oc,{ref_key:"popover",ref:t,placement:"bottom"},{reference:y.withCtx(()=>[y.createElementVNode("button",Une,[y.createElementVNode("span",jne,y.toDisplayString(i.value),1),c[0]||(c[0]=y.createElementVNode("svg",{class:"ml-1 text-gray-400",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("polyline",{points:"6,9 12,15 18,9"})],-1))])]),default:y.withCtx(()=>[y.createElementVNode("div",null,[y.createElementVNode("ul",Kne,[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(n.value,d=>(y.openBlock(),y.createElementBlock("li",{key:d.value,class:y.normalizeClass(["px-3 py-2 hover:bg-gray-100 cursor-pointer text-sm",`heading-level-${d.value}`]),style:y.normalizeStyle(r(d.value)),onClick:h=>o(d.value)},y.toDisplayString(d.label),15,qne))),128)),y.createElementVNode("li",{class:"px-3 py-2 hover:bg-gray-100 cursor-pointer text-sm border-t border-gray-200 mt-1 pt-2",onClick:a}," Paragraph ")])])]),_:1},512))}},[["__scopeId","data-v-ef7c378e"]]),Yne={props:{editor:Object},methods:{clearFormatting(){this.editor&&this.editor.commands.unsetAllMarks()}}};function Xne(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("button",{title:"Clear Formatting",onClick:e[0]||(e[0]=(...o)=>r.clearFormatting&&r.clearFormatting(...o)),class:"h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100"},[...e[1]||(e[1]=[y.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-remove-formatting-icon lucide-remove-formatting"><path d="M4 7V4h16v3"></path><path d="M5 20h6"></path><path d="M13 4 8 20"></path><path d="m15 15 5 5"></path><path d="m20 15-5 5"></path></svg><span class="sr-only">Clear Formatting</span>',2)])])}const Zne=wn(Yne,[["render",Xne]]),Qne={class:"relative"},Jne={class:"space-y-4"},eie={key:0,class:"mt-4"},tie=["src","alt","title"],nie={key:0,class:"text-sm text-red-500"},iie=Object.assign({inheritAttrs:!1},{__name:"vs-editor-image",props:{editor:{type:Object,required:!0}},setup(s){const e=s,t=y.ref(!1),n=y.ref(!1),i=y.ref({src:"",alt:"",title:""}),r=()=>{i.value={src:"",alt:"",title:""},n.value=!1,t.value=!0},o=()=>{t.value=!1,n.value=!1},a=()=>{if(!i.value.src){alert("Please enter an image URL");return}e.editor&&e.editor.chain().focus().setImage({src:i.value.src,alt:i.value.alt||"",title:i.value.title||""}).run(),o()},l=()=>{a()},c=()=>{o()};return y.watch(()=>i.value.src,()=>{n.value=!1}),(d,h)=>(y.openBlock(),y.createElementBlock("div",Qne,[y.createElementVNode("button",{onClick:r,class:y.normalizeClass(["h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100",s.editor?.isActive("image")?"bg-gray-200 text-gray-900":""]),title:"Add Image"},[...h[5]||(h[5]=[y.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-image"><rect width="18" height="18" x="3" y="3" rx="2" ry="2"></rect><circle cx="9" cy="9" r="2"></circle><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"></path></svg><span class="sr-only">Add Image</span>',2)])],2),y.createVNode(gF,{modelValue:t.value,"onUpdate:modelValue":h[4]||(h[4]=u=>t.value=u),title:"Add Image"},{footer:y.withCtx(()=>[y.createElementVNode("button",{onClick:c,type:"button",class:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500"}," Cancel "),y.createElementVNode("button",{onClick:l,type:"button",class:"px-4 py-2 text-sm font-medium text-white bg-blue-600 border border-transparent rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500"}," Add Image ")]),default:y.withCtx(()=>[y.createElementVNode("div",Jne,[y.createElementVNode("div",null,[h[6]||(h[6]=y.createElementVNode("label",{for:"imageUrl",class:"block text-sm font-medium text-gray-700 mb-1"}," Image URL ",-1)),y.withDirectives(y.createElementVNode("input",{id:"imageUrl","onUpdate:modelValue":h[0]||(h[0]=u=>i.value.src=u),type:"url",placeholder:"https://example.com/image.png",class:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",required:""},null,512),[[y.vModelText,i.value.src]])]),y.createElementVNode("div",null,[h[7]||(h[7]=y.createElementVNode("label",{for:"imageAlt",class:"block text-sm font-medium text-gray-700 mb-1"}," Alt Text ",-1)),y.withDirectives(y.createElementVNode("input",{id:"imageAlt","onUpdate:modelValue":h[1]||(h[1]=u=>i.value.alt=u),type:"text",placeholder:"Description of the image",class:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"},null,512),[[y.vModelText,i.value.alt]])]),y.createElementVNode("div",null,[h[8]||(h[8]=y.createElementVNode("label",{for:"imageTitle",class:"block text-sm font-medium text-gray-700 mb-1"}," Title (optional) ",-1)),y.withDirectives(y.createElementVNode("input",{id:"imageTitle","onUpdate:modelValue":h[2]||(h[2]=u=>i.value.title=u),type:"text",placeholder:"Image title",class:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"},null,512),[[y.vModelText,i.value.title]])]),i.value.src?(y.openBlock(),y.createElementBlock("div",eie,[h[9]||(h[9]=y.createElementVNode("p",{class:"text-sm text-gray-600 mb-2"},"Preview:",-1)),y.withDirectives(y.createElementVNode("img",{src:i.value.src,alt:i.value.alt||"Image preview",title:i.value.title,class:"max-w-full h-auto max-h-32 rounded border",onError:h[3]||(h[3]=u=>n.value=!0)},null,40,tie),[[y.vShow,!n.value]]),n.value?(y.openBlock(),y.createElementBlock("p",nie," Failed to load image preview ")):y.createCommentVNode("",!0)])):y.createCommentVNode("",!0)])]),_:1},8,["modelValue"])]))}}),sie={class:"flex items-center"},rie=["disabled"],oie=["disabled"],aie=wn(Object.assign({inheritAttrs:!1},{__name:"vs-editor-history",props:{editor:Object},setup(s){const e=s,t=()=>{e.editor?.can().undo()&&e.editor.chain().focus().undo().run()},n=()=>{e.editor?.can().redo()&&e.editor.chain().focus().redo().run()};return(i,r)=>(y.openBlock(),y.createElementBlock("div",sie,[y.createElementVNode("button",{onClick:t,class:y.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center rounded-l-full hover:text-gray-900 hover:bg-gray-100 border-r border-gray-200",[s.editor?.can().undo()?"text-gray-500":"text-gray-300 cursor-not-allowed"]]),disabled:!s.editor?.can().undo(),title:"Undo (Ctrl+Z)"},[...r[0]||(r[0]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("path",{d:"M3 7v6h6"}),y.createElementVNode("path",{d:"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13"})],-1)])],10,rie),y.createElementVNode("button",{onClick:n,class:y.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center rounded-r-full hover:text-gray-900 hover:bg-gray-100",[s.editor?.can().redo()?"text-gray-500":"text-gray-300 cursor-not-allowed"]]),disabled:!s.editor?.can().redo(),title:"Redo (Ctrl+Y)"},[...r[1]||(r[1]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("path",{d:"M21 7v6h-6"}),y.createElementVNode("path",{d:"M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3L21 13"})],-1)])],10,oie)]))}}),[["__scopeId","data-v-b5a7cc5a"]]),lie={class:"relative"},cie=wn(Object.assign({inheritAttrs:!1},{__name:"vs-editor-help",props:{editor:Object},setup(s){const e=y.ref(!1),t=y.ref(null),n=()=>{e.value=!e.value},i=()=>{e.value=!1};return(r,o)=>(y.openBlock(),y.createElementBlock("div",lie,[y.createElementVNode("button",{ref_key:"helpButton",ref:t,onClick:n,class:y.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100 text-gray-500",[e.value?"bg-gray-100 text-gray-900":"text-gray-500"]]),title:"Markdown Shortcuts Help"},[...o[1]||(o[1]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("circle",{cx:"12",cy:"12",r:"10"}),y.createElementVNode("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}),y.createElementVNode("line",{x1:"12",x2:"12.01",y1:"17",y2:"17"})],-1)])],2),e.value?(y.openBlock(),y.createElementBlock("div",{key:0,class:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",onClick:i},[y.createElementVNode("div",{class:"bg-white rounded-lg shadow-xl max-w-2xl w-full mx-4 max-h-[80vh] overflow-y-auto",onClick:o[0]||(o[0]=y.withModifiers(()=>{},["stop"]))},[y.createElementVNode("div",{class:"p-6"},[y.createElementVNode("div",{class:"flex justify-between items-center mb-4"},[o[3]||(o[3]=y.createElementVNode("h2",{class:"text-xl font-semibold text-gray-900"},"Common Markdown Syntax & Shortcuts",-1)),y.createElementVNode("button",{onClick:i,class:"text-gray-400 hover:text-gray-600 transition-colors"},[...o[2]||(o[2]=[y.createElementVNode("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[y.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])]),o[4]||(o[4]=y.createStaticVNode('<div class="space-y-6" data-v-155e282c><div data-v-155e282c><h3 class="text-lg font-medium text-gray-800 mb-3" data-v-155e282c>Markdown Syntax</h3><div class="overflow-x-auto" data-v-155e282c><table class="w-full border-collapse" data-v-155e282c><thead data-v-155e282c><tr class="bg-gray-50" data-v-155e282c><th class="border border-gray-200 px-3 py-2 text-left font-medium text-gray-700" data-v-155e282c>Element</th><th class="border border-gray-200 px-3 py-2 text-left font-medium text-gray-700" data-v-155e282c>Example</th></tr></thead><tbody class="text-sm" data-v-155e282c><tr data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c>Bold</td><td class="border border-gray-200 px-3 py-2" data-v-155e282c><code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>**bold text**</code> or <code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>__bold text__</code></td></tr><tr class="bg-gray-25" data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c>Italics</td><td class="border border-gray-200 px-3 py-2" data-v-155e282c><code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>*italic text*</code> or <code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>_italic text_</code></td></tr><tr data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c>Strikethrough</td><td class="border border-gray-200 px-3 py-2" data-v-155e282c><code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>~strikethrough text~</code></td></tr><tr class="bg-gray-25" data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c>Headings</td><td class="border border-gray-200 px-3 py-2" data-v-155e282c><code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c># Heading 1</code>, <code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>## Heading 2</code>, etc., up to <code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>###### Heading 6</code></td></tr><tr data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c>Unordered Lists</td><td class="border border-gray-200 px-3 py-2" data-v-155e282c> Use an asterisk (*), dash (-), or plus sign (+) followed by a space. </td></tr><tr class="bg-gray-25" data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c>Ordered Lists</td><td class="border border-gray-200 px-3 py-2" data-v-155e282c> Use a number followed by a period and a space (e.g., <code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>1. First item</code>). </td></tr><tr data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c>Blockquotes</td><td class="border border-gray-200 px-3 py-2" data-v-155e282c> Start with a greater-than sign (&gt;) followed by a space. </td></tr><tr class="bg-gray-25" data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c>Inline Code</td><td class="border border-gray-200 px-3 py-2" data-v-155e282c> Surround with backticks (<code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>`</code>). </td></tr><tr data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c>Code Blocks</td><td class="border border-gray-200 px-3 py-2" data-v-155e282c> Enclose with three backticks (<code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>```</code>) before and after the code. </td></tr><tr class="bg-gray-25" data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c>Images</td><td class="border border-gray-200 px-3 py-2" data-v-155e282c> Use <code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>![alt text](url)</code> syntax. </td></tr><tr data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c>Links</td><td class="border border-gray-200 px-3 py-2" data-v-155e282c> Use <code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>[Link Text](url)</code> syntax. </td></tr><tr class="bg-gray-25" data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c>Checklists</td><td class="border border-gray-200 px-3 py-2" data-v-155e282c> Create a list item with <code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>- [ ]</code> for an incomplete task or <code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>- [x]</code> for a completed one. </td></tr></tbody></table></div></div><div data-v-155e282c><h3 class="text-lg font-medium text-gray-800 mb-3" data-v-155e282c>Common Editing Shortcuts</h3><div class="overflow-x-auto" data-v-155e282c><table class="w-full border-collapse" data-v-155e282c><thead data-v-155e282c><tr class="bg-gray-50" data-v-155e282c><th class="border border-gray-200 px-3 py-2 text-left font-medium text-gray-700" data-v-155e282c>Shortcut</th><th class="border border-gray-200 px-3 py-2 text-left font-medium text-gray-700" data-v-155e282c>Action</th></tr></thead><tbody class="text-sm" data-v-155e282c><tr data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c><code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>Ctrl+A</code></td><td class="border border-gray-200 px-3 py-2" data-v-155e282c>Select all text</td></tr><tr class="bg-gray-25" data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c><code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>Ctrl+B</code></td><td class="border border-gray-200 px-3 py-2" data-v-155e282c>Apply bold formatting</td></tr><tr data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c><code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>Ctrl+C</code></td><td class="border border-gray-200 px-3 py-2" data-v-155e282c>Copy selected text</td></tr><tr class="bg-gray-25" data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c><code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>Ctrl+I</code></td><td class="border border-gray-200 px-3 py-2" data-v-155e282c>Apply italic formatting</td></tr><tr data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c><code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>Ctrl+K</code></td><td class="border border-gray-200 px-3 py-2" data-v-155e282c>Open the insert link dialog</td></tr><tr class="bg-gray-25" data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c><code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>Ctrl+S</code></td><td class="border border-gray-200 px-3 py-2" data-v-155e282c>Save the current document</td></tr><tr data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c><code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>Ctrl+V</code></td><td class="border border-gray-200 px-3 py-2" data-v-155e282c>Paste copied text</td></tr><tr class="bg-gray-25" data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c><code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>Ctrl+X</code></td><td class="border border-gray-200 px-3 py-2" data-v-155e282c>Cut selected text</td></tr><tr data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c><code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>Ctrl+Y</code></td><td class="border border-gray-200 px-3 py-2" data-v-155e282c>Redo the last action</td></tr><tr class="bg-gray-25" data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c><code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>Alt+Shift+Backspace</code></td><td class="border border-gray-200 px-3 py-2" data-v-155e282c>Redo the last action</td></tr><tr data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c><code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>Ctrl+Z</code></td><td class="border border-gray-200 px-3 py-2" data-v-155e282c>Undo the last action</td></tr><tr class="bg-gray-25" data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c><code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>Alt+Backspace</code></td><td class="border border-gray-200 px-3 py-2" data-v-155e282c>Undo the last action</td></tr></tbody></table></div></div></div>',1))])])])):y.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-155e282c"]]),die={__name:"vs-editor-horizontal-rule",props:{editor:Object},setup(s){const e=s,t=()=>{e.editor&&e.editor.chain().focus().setHorizontalRule().run()};return(n,i)=>(y.openBlock(),y.createElementBlock("button",{title:"Horizontal Rule",onClick:t,class:"flex flex-col h-[30px] px-1 rounded-full hover:bg-gray-100 justify-center items-center relative flex"},[...i[0]||(i[0]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("line",{x1:"3",x2:"21",y1:"12",y2:"12"})],-1)])]))}},hie={__name:"vs-editor-fullscreen",props:{editor:Object},emits:["toggle-fullscreen"],setup(s,{emit:e}){const t=e,n=()=>{t("toggle-fullscreen")};return(i,r)=>(y.openBlock(),y.createElementBlock("button",{title:"Fullscreen",onClick:n,class:"w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded-full hover:text-gray-900 hover:bg-gray-100"},[...r[0]||(r[0]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"})],-1)])]))}},uie=["title"],fie={class:"vs-editor-html-mode__text"},gie={bold:ste,italic:ate,color:Cne,background_color:Ene,highlight:Nne,bullet_list:Yee,ordered_list:Qee,blockquote:Kee,codeblock:tte,underline:lte,strike:cte,link:Ote,table:Wte,text_align:sne,type_tag:ane,font_family:Rne,font_size:Fne,superscript:Wne,subscript:$ne,heading:Gne,clear_formatting:Zne,image:iie,history:aie,help:cie,horizontal_rule:die,fullscreen:hie,html_mode:wn({__name:"vs-editor-html-mode",props:{editor:{type:Object,required:!0}},emits:["toggle-html-mode"],setup(s,{emit:e}){const t=e,n=y.ref(!1),i=()=>{n.value=!n.value,t("toggle-html-mode",n.value)};return(r,o)=>(y.openBlock(),y.createElementBlock("button",{onClick:i,class:y.normalizeClass([{"is-active":n.value},"vs-editor-html-mode"]),type:"button",title:n.value?"Switch to Rich Text Mode":"Switch to HTML Mode"},[o[0]||(o[0]=y.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("polyline",{points:"16,18 22,12 16,6"}),y.createElementVNode("polyline",{points:"8,6 2,12 8,18"})],-1)),y.createElementVNode("span",fie,y.toDisplayString((n.value,"HTML")),1)],10,uie))}},[["__scopeId","data-v-99a48167"]])},bF={basic:["history","bold","italic","underline","strike","text_align","bullet_list","ordered_list","link","image","clear_formatting","help"],default:["heading","bold","italic","underline","strike","color","background_color","highlight","text_align","bullet_list","ordered_list","codeblock","table","link","image","horizontal_rule","clear_formatting","fullscreen","help","html_mode"],full:["history","heading","font_family","font_size","bold","italic","underline","strike","color","background_color","highlight","text_align","bullet_list","ordered_list","blockquote","codeblock","table","link","image","horizontal_rule","superscript","subscript","clear_formatting","fullscreen","help","html_mode"]};function pie(s){if(s.length===0)throw new Error("Invalid tail call");return[s.slice(0,s.length-1),s[s.length-1]]}function Sn(s,e,t=(n,i)=>n===i){if(s===e)return!0;if(!s||!e||s.length!==e.length)return!1;for(let n=0,i=s.length;n<i;n++)if(!t(s[n],e[n]))return!1;return!0}function mie(s,e){const t=s.length-1;e<t&&(s[e]=s[t]),s.pop()}function _ie(s,e,t){return wF(s.length,n=>t(s[n],e))}function wF(s,e){let t=0,n=s-1;for(;t<=n;){const i=(t+n)/2|0,r=e(i);if(r<0)t=i+1;else if(r>0)n=i-1;else return i}return-(t+1)}function*qk(s,e){let t,n;for(const i of s)n!==void 0&&e(n,i)?t.push(i):(t&&(yield t),t=[i]),n=i;t&&(yield t)}function CF(s,e){for(let t=0;t<=s.length;t++)e(t===0?void 0:s[t-1],t===s.length?void 0:s[t])}function bie(s,e){for(let t=0;t<s.length;t++)e(t===0?void 0:s[t-1],s[t],t+1===s.length?void 0:s[t+1])}function Gk(s){return s.filter(e=>!!e)}function vF(s){let e=0;for(let t=0;t<s.length;t++)s[t]&&(s[e]=s[t],e+=1);s.length=e}function wie(s){return!Array.isArray(s)||s.length===0}function Nw(s){return Array.isArray(s)&&s.length>0}function Qd(s,e=t=>t){const t=new Set;return s.filter(n=>{const i=e(n);return t.has(i)?!1:(t.add(i),!0)})}function cs(s,e){let t=typeof e=="number"?s:0;typeof e=="number"?t=s:(t=0,e=s);const n=[];if(t<=e)for(let i=t;i<e;i++)n.push(i);else for(let i=t;i>e;i--)n.push(i);return n}function Dw(s,e,t){const n=s.slice(0,e),i=s.slice(e);return n.concat(t,i)}function Yk(s,e){const t=s.indexOf(e);t>-1&&(s.splice(t,1),s.unshift(e))}function Tw(s,e){const t=s.indexOf(e);t>-1&&(s.splice(t,1),s.push(e))}function Xk(s,e){for(const t of e)s.push(t)}function Cie(s,e,t){const n=yF(s,e),i=s.length,r=t.length;s.length=i+r;for(let o=i-1;o>=n;o--)s[o+r]=s[o];for(let o=0;o<r;o++)s[o+n]=t[o]}function Iw(s,e,t,n){const i=yF(s,e);let r=s.splice(i,t);return r===void 0&&(r=[]),Cie(s,i,n),r}function yF(s,e){return e<0?Math.max(e+s.length,0):Math.min(e,s.length)}var km;(function(s){function e(r){return r<0}s.isLessThan=e;function t(r){return r<=0}s.isLessThanOrEqual=t;function n(r){return r>0}s.isGreaterThan=n;function i(r){return r===0}s.isNeitherLessOrGreaterThan=i,s.greaterThan=1,s.lessThan=-1,s.neitherLessOrGreaterThan=0})(km||(km={}));function Ks(s,e){return(t,n)=>e(s(t),s(n))}function vie(...s){return(e,t)=>{for(const n of s){const i=n(e,t);if(!km.isNeitherLessOrGreaterThan(i))return i}return km.neitherLessOrGreaterThan}}const ll=(s,e)=>s-e,yie=(s,e)=>ll(s?1:0,e?1:0);function Sie(s){return(e,t)=>-s(e,t)}class cl{constructor(e){this.firstIdx=0,this.items=e,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(e){let t=this.firstIdx;for(;t<this.items.length&&e(this.items[t]);)t++;const n=t===this.firstIdx?null:this.items.slice(this.firstIdx,t);return this.firstIdx=t,n}takeFromEndWhile(e){let t=this.lastIdx;for(;t>=0&&e(this.items[t]);)t--;const n=t===this.lastIdx?null:this.items.slice(t+1,this.lastIdx+1);return this.lastIdx=t,n}peek(){if(this.length!==0)return this.items[this.firstIdx]}dequeue(){const e=this.items[this.firstIdx];return this.firstIdx++,e}takeCount(e){const t=this.items.slice(this.firstIdx,this.firstIdx+e);return this.firstIdx+=e,t}}const Lp=class Lp{constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(e){return new Lp(t=>this.iterate(n=>e(n)?t(n):!0))}map(e){return new Lp(t=>this.iterate(n=>t(e(n))))}findLast(e){let t;return this.iterate(n=>(e(n)&&(t=n),!0)),t}findLastMaxBy(e){let t,n=!0;return this.iterate(i=>((n||km.isGreaterThan(e(i,t)))&&(n=!1,t=i),!0)),t}};Lp.empty=new Lp(e=>{});let Jd=Lp;class xie{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?If.isErrorNoTelemetry(e)?new If(e.message+`
105
105
 
106
106
  `+e.stack):new Error(e.message+`
107
107
 
@@ -943,7 +943,7 @@ ${e.toString()}`}}class OS{constructor(e=new Gg,t=!1,n,i=yLe){this._services=e,t
943
943
  `:H?(O+=M+`<${I}${F?" "+F:""}>
944
944
  `,Array.from(E.childNodes).forEach(G=>{O+=k(G,N+1)}),O+=M+`</${I}>
945
945
  `):O+=M+`<${I}${F?" "+F:""} />
946
- `}return O};let L="";return Array.from(S.childNodes).forEach(E=>{L+=k(E)}),L.trim()}catch(S){return console.warn("HTML formatting error:",S),v}},l=()=>{if(!r.value)return;const v=n.language;if(o=Rb.create(r.value,{value:n.modelValue,language:v,theme:n.theme,automaticLayout:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,wordWrap:"on",lineNumbers:"on",folding:!0,lineDecorationsWidth:0,lineNumbersMinChars:3,renderLineHighlight:"line",selectOnLineNumbers:!0,roundedSelection:!1,readOnly:!1,cursorStyle:"line",cursorBlinking:"blink",cursorSmoothCaretAnimation:!0,cursorWidth:1,fontFamily:"'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace",fontSize:13,lineHeight:1.5,tabSize:2,insertSpaces:!0,detectIndentation:!1,trimAutoWhitespace:!0,formatOnPaste:!0,formatOnType:!0,autoClosingBrackets:"always",autoClosingQuotes:"always",autoSurround:"languageDefined",bracketPairColorization:{enabled:!0},guides:{bracketPairs:!0,indentation:!0},fixedOverflowWidgets:!1,overflowWidgetsDomNode:r.value,suggest:{showKeywords:!0,showSnippets:!0,showClasses:!0,showFunctions:!0,showVariables:!0,showModules:!0,showProperties:!0,showEvents:!0,showOperators:!0,showUnits:!0,showValues:!0,showColors:!0,showFiles:!0,showReferences:!0,showFolders:!0,showTypeParameters:!0,showIssues:!0,showUsers:!0,showWords:!0,showCustomcolors:!0,showInterfaces:!0,showText:!0,showEnums:!0,showStructs:!0,showTypeAliases:!0,showConstants:!0,showConstructors:!0,showFields:!0,showMethods:!0,showNamespaces:!0,showPackages:!0,showSymbols:!0,showTypeParameters:!0},quickSuggestions:{other:!0,comments:!1,strings:!0},html:{format:{enable:!0,tabSize:2,insertSpaces:!0,wrapLineLength:120,unformatted:"default",contentUnformatted:"pre,code,textarea",indentInnerHtml:!1,preserveNewLines:!0,maxPreserveNewLines:2,indentHandlebars:!1,endWithNewline:!1,extraLiners:"head, body, /html",wrapAttributes:"auto"},suggest:{html5:!0,angular1:!1,ionic:!1},validate:{scripts:!0,styles:!0}},scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8,useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,verticalSliderSize:4,horizontalSliderSize:4,arrowSize:0,verticalSliderHasArrows:!1,horizontalSliderHasArrows:!1}}),n.language==="html"){lo.register({id:"html"}),lo.setMonarchTokensProvider("html",{tokenizer:{root:[[/<!--/,"comment","@comment"],[/<[^>]+>/,"tag"],[/\w+\s*=\s*"[^"]*"/,"attribute"],[/\w+\s*=\s*'[^']*'/,"attribute"],[/"[^"]*"/,"string"],[/'[^']*'/,"string"],[/\b(doctype|html|head|body|title|meta|link|script|style|div|span|p|h1|h2|h3|h4|h5|h6|ul|ol|li|table|tr|td|th|form|input|button|img|a|br|hr)\b/i,"keyword"],[/\d+/,"number"],[/\s+/,"white"],[/./,"text"]],comment:[[/-->/,"comment","@pop"],[/./,"comment"]]}});try{lo.setLanguageConfiguration("html",{wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{blockComment:["<!--","-->"]},brackets:[["<",">"],["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"<",close:">",notIn:["string"]},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string"]}],surroundingPairs:[{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"}]})}catch(S){console.warn("HTML language configuration failed:",S)}}o.onDidChangeModelContent(()=>{const S=o.getValue();i("update:modelValue",S),i("change",S)})},c=v=>{o&&v!==o.getValue()&&o.setValue(v)},d=v=>{if(o)if(n.language==="html"){const S=v==="vs-dark"||v==="hc-black";Rb.defineTheme("html-custom",{base:S?"vs-dark":"vs",inherit:!0,rules:[{token:"tag",foreground:S?"#4FC1FF":"#0066CC",fontStyle:"bold"},{token:"attribute",foreground:S?"#9CDCFE":"#0000FF"},{token:"string",foreground:S?"#FF6B6B":"#CC0000"},{token:"comment",foreground:S?"#6A9955":"#008000",fontStyle:"italic"},{token:"keyword",foreground:S?"#FFA500":"#FF6600",fontStyle:"bold"},{token:"number",foreground:S?"#B5CEA8":"#098658"},{token:"text",foreground:S?"#D4D4D4":"#000000"},{token:"white",foreground:S?"#D4D4D4":"#000000"}],colors:{"editor.background":S?"#1e1e1e":"#ffffff","editor.foreground":S?"#d4d4d4":"#000000"}}),Rb.setTheme("html-custom")}else Rb.setTheme(v)},h=v=>{o&&Rb.setModelLanguage(o.getModel(),v)},u=()=>{o&&o.focus()},f=()=>o?o.getPosition():null,g=v=>{o&&v&&(o.setPosition(v),o.revealPosition(v))},p=()=>{if(o){const v=o.getSelection();return o.getModel().getValueInRange(v)}return""},m=v=>{if(o){const S=o.getSelection();o.executeEdits("replace-selection",[{range:S,text:v,forceMoveMarkers:!0}])}},b=()=>{if(o){const v=o.getValue(),S=a(v);S!==v&&(o.setValue(S),o.setPosition({lineNumber:1,column:1}))}},w=()=>{if(n.language==="html")try{lo.registerCompletionItemProvider("html",{provideCompletionItems:(v,S)=>({suggestions:[{label:"class",kind:lo.CompletionItemKind.Property,insertText:'class="$1"',insertTextRules:lo.CompletionItemInsertTextRule.InsertAsSnippet,documentation:"CSS class attribute"},{label:"id",kind:lo.CompletionItemKind.Property,insertText:'id="$1"',insertTextRules:lo.CompletionItemInsertTextRule.InsertAsSnippet,documentation:"Unique identifier"},{label:"style",kind:lo.CompletionItemKind.Property,insertText:'style="$1"',insertTextRules:lo.CompletionItemInsertTextRule.InsertAsSnippet,documentation:"Inline CSS styles"},{label:"data-*",kind:lo.CompletionItemKind.Property,insertText:'data-$1="$2"',insertTextRules:lo.CompletionItemInsertTextRule.InsertAsSnippet,documentation:"Custom data attribute"}]})})}catch(v){console.warn("HTML completion provider failed:",v)}},C=()=>{o&&o.layout()};return y.onMounted(()=>{y.nextTick(()=>{l(),w(),window.addEventListener("resize",C)})}),y.onUnmounted(()=>{o&&o.dispose(),window.removeEventListener("resize",C)}),y.watch(()=>n.modelValue,c),y.watch(()=>n.theme,d),y.watch(()=>n.language,h),y.watch(()=>n.height,()=>{y.nextTick(()=>{C()})}),e({editor:o,focus:u,getPosition:f,setPosition:g,getSelectedText:p,replaceSelection:m,formatCode:b}),(v,S)=>(y.openBlock(),y.createElementBlock("div",{ref_key:"monacoContainer",ref:r,class:"monaco-editor-container",style:y.normalizeStyle({height:s.height})},null,4))}},[["__scopeId","data-v-e448ecfc"]]),L2e={class:"flex align-middle gap-x-0.5 border-b flex-wrap border-b-gray-200 px-[10px] py-[6px] border-solid border-transparent"},k2e={key:1,class:"html-source-editor"},lj=Object.assign({inheritAttrs:!1},{__name:"vs-richtext",props:y.mergeModels({modelValue:{type:String,default:()=>""},height:{type:String,default:()=>"300px"},toolbar:{type:[Array,String],default:()=>"default"}},{modelValue:{},modelModifiers:{}}),emits:y.mergeModels(["update:modelValue"],["update:modelValue"]),setup(s){const e=s,t=y.useModel(s,"modelValue"),{editor:n,editorInstance:i,focusEditor:r}=Hee(e),{isHtmlMode:o,htmlContent:a,htmlTextarea:l,toggleHtmlMode:c,onHtmlInput:d}=zee(n),{isFullscreen:h,toggleFullscreen:u}=$ee(),f=y.computed(()=>typeof e.toolbar=="string"?bF[e.toolbar]||bF.default:e.toolbar),g=y.computed(()=>f.value.map(p=>gie[p]).filter(Boolean));return y.watch(()=>e.modelValue,p=>{if(n.value){const m=p||"",b=n.value.getHTML();m!==b&&m!=="<p></p>"&&n.value.commands.setContent(m,!1)}},{immediate:!0}),y.watch(n,p=>{p&&n.value.on("update",m=>{const b=m.editor.getHTML();b!==e.modelValue&&b!=="<p></p>"&&(t.value=b)})}),(p,m)=>(y.openBlock(),y.createElementBlock("div",{class:y.normalizeClass(["bg-white border border border-solid border-gray-200 rounded-xl w-full",{"fixed left-0 right-0 top-0 bottom-0 z-[100000]":y.unref(h)}])},[y.createElementVNode("div",L2e,[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(g.value,b=>(y.openBlock(),y.createElementBlock(y.Fragment,{key:b},[y.unref(n)?(y.openBlock(),y.createBlock(y.resolveDynamicComponent(b),{key:0,editor:y.unref(i),onToggleFullscreen:y.unref(u),onToggleHtmlMode:y.unref(c)},null,40,["editor","onToggleFullscreen","onToggleHtmlMode"])):y.createCommentVNode("",!0)],64))),128))]),y.createElementVNode("div",{onClick:m[1]||(m[1]=(...b)=>y.unref(r)&&y.unref(r)(...b)),class:"relative w-full px-4 py-2 bg-white rounded-b-lg editor-content dark:bg-gray-800",style:y.normalizeStyle({height:y.unref(h)?"95vh":s.height})},[y.unref(o)?(y.openBlock(),y.createElementBlock("div",k2e,[y.createVNode(x2e,{ref_key:"htmlTextarea",ref:l,modelValue:y.unref(a),"onUpdate:modelValue":m[0]||(m[0]=b=>y.isRef(a)?a.value=b:null),height:y.unref(h)?"calc(95vh - 100px)":"100%",language:"html",theme:"vs",onChange:y.unref(d)},null,8,["modelValue","height","onChange"])])):(y.openBlock(),y.createBlock(y.unref(OZ),{key:0,editor:y.unref(n),class:"relative w-full"},null,8,["editor"]))],4)],2))}});/*!
946
+ `}return O};let L="";return Array.from(S.childNodes).forEach(E=>{L+=k(E)}),L.trim()}catch(S){return console.warn("HTML formatting error:",S),v}},l=()=>{if(!r.value)return;const v=n.language;if(o=Rb.create(r.value,{value:n.modelValue,language:v,theme:n.theme,automaticLayout:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,wordWrap:"on",lineNumbers:"on",folding:!0,lineDecorationsWidth:0,lineNumbersMinChars:3,renderLineHighlight:"line",selectOnLineNumbers:!0,roundedSelection:!1,readOnly:!1,cursorStyle:"line",cursorBlinking:"blink",cursorSmoothCaretAnimation:!0,cursorWidth:1,fontFamily:"'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace",fontSize:13,lineHeight:1.5,tabSize:2,insertSpaces:!0,detectIndentation:!1,trimAutoWhitespace:!0,formatOnPaste:!0,formatOnType:!0,autoClosingBrackets:"always",autoClosingQuotes:"always",autoSurround:"languageDefined",bracketPairColorization:{enabled:!0},guides:{bracketPairs:!0,indentation:!0},fixedOverflowWidgets:!1,overflowWidgetsDomNode:r.value,suggest:{showKeywords:!0,showSnippets:!0,showClasses:!0,showFunctions:!0,showVariables:!0,showModules:!0,showProperties:!0,showEvents:!0,showOperators:!0,showUnits:!0,showValues:!0,showColors:!0,showFiles:!0,showReferences:!0,showFolders:!0,showTypeParameters:!0,showIssues:!0,showUsers:!0,showWords:!0,showCustomcolors:!0,showInterfaces:!0,showText:!0,showEnums:!0,showStructs:!0,showTypeAliases:!0,showConstants:!0,showConstructors:!0,showFields:!0,showMethods:!0,showNamespaces:!0,showPackages:!0,showSymbols:!0,showTypeParameters:!0},quickSuggestions:{other:!0,comments:!1,strings:!0},html:{format:{enable:!0,tabSize:2,insertSpaces:!0,wrapLineLength:120,unformatted:"default",contentUnformatted:"pre,code,textarea",indentInnerHtml:!1,preserveNewLines:!0,maxPreserveNewLines:2,indentHandlebars:!1,endWithNewline:!1,extraLiners:"head, body, /html",wrapAttributes:"auto"},suggest:{html5:!0,angular1:!1,ionic:!1},validate:{scripts:!0,styles:!0}},scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8,useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,verticalSliderSize:4,horizontalSliderSize:4,arrowSize:0,verticalSliderHasArrows:!1,horizontalSliderHasArrows:!1}}),n.language==="html"){lo.register({id:"html"}),lo.setMonarchTokensProvider("html",{tokenizer:{root:[[/<!--/,"comment","@comment"],[/<[^>]+>/,"tag"],[/\w+\s*=\s*"[^"]*"/,"attribute"],[/\w+\s*=\s*'[^']*'/,"attribute"],[/"[^"]*"/,"string"],[/'[^']*'/,"string"],[/\b(doctype|html|head|body|title|meta|link|script|style|div|span|p|h1|h2|h3|h4|h5|h6|ul|ol|li|table|tr|td|th|form|input|button|img|a|br|hr)\b/i,"keyword"],[/\d+/,"number"],[/\s+/,"white"],[/./,"text"]],comment:[[/-->/,"comment","@pop"],[/./,"comment"]]}});try{lo.setLanguageConfiguration("html",{wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{blockComment:["<!--","-->"]},brackets:[["<",">"],["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"<",close:">",notIn:["string"]},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string"]}],surroundingPairs:[{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"}]})}catch(S){console.warn("HTML language configuration failed:",S)}}o.onDidChangeModelContent(()=>{const S=o.getValue();i("update:modelValue",S),i("change",S)})},c=v=>{o&&v!==o.getValue()&&o.setValue(v)},d=v=>{if(o)if(n.language==="html"){const S=v==="vs-dark"||v==="hc-black";Rb.defineTheme("html-custom",{base:S?"vs-dark":"vs",inherit:!0,rules:[{token:"tag",foreground:S?"#4FC1FF":"#0066CC",fontStyle:"bold"},{token:"attribute",foreground:S?"#9CDCFE":"#0000FF"},{token:"string",foreground:S?"#FF6B6B":"#CC0000"},{token:"comment",foreground:S?"#6A9955":"#008000",fontStyle:"italic"},{token:"keyword",foreground:S?"#FFA500":"#FF6600",fontStyle:"bold"},{token:"number",foreground:S?"#B5CEA8":"#098658"},{token:"text",foreground:S?"#D4D4D4":"#000000"},{token:"white",foreground:S?"#D4D4D4":"#000000"}],colors:{"editor.background":S?"#1e1e1e":"#ffffff","editor.foreground":S?"#d4d4d4":"#000000"}}),Rb.setTheme("html-custom")}else Rb.setTheme(v)},h=v=>{o&&Rb.setModelLanguage(o.getModel(),v)},u=()=>{o&&o.focus()},f=()=>o?o.getPosition():null,g=v=>{o&&v&&(o.setPosition(v),o.revealPosition(v))},p=()=>{if(o){const v=o.getSelection();return o.getModel().getValueInRange(v)}return""},m=v=>{if(o){const S=o.getSelection();o.executeEdits("replace-selection",[{range:S,text:v,forceMoveMarkers:!0}])}},b=()=>{if(o){const v=o.getValue(),S=a(v);S!==v&&(o.setValue(S),o.setPosition({lineNumber:1,column:1}))}},w=()=>{if(n.language==="html")try{lo.registerCompletionItemProvider("html",{provideCompletionItems:(v,S)=>({suggestions:[{label:"class",kind:lo.CompletionItemKind.Property,insertText:'class="$1"',insertTextRules:lo.CompletionItemInsertTextRule.InsertAsSnippet,documentation:"CSS class attribute"},{label:"id",kind:lo.CompletionItemKind.Property,insertText:'id="$1"',insertTextRules:lo.CompletionItemInsertTextRule.InsertAsSnippet,documentation:"Unique identifier"},{label:"style",kind:lo.CompletionItemKind.Property,insertText:'style="$1"',insertTextRules:lo.CompletionItemInsertTextRule.InsertAsSnippet,documentation:"Inline CSS styles"},{label:"data-*",kind:lo.CompletionItemKind.Property,insertText:'data-$1="$2"',insertTextRules:lo.CompletionItemInsertTextRule.InsertAsSnippet,documentation:"Custom data attribute"}]})})}catch(v){console.warn("HTML completion provider failed:",v)}},C=()=>{o&&o.layout()};return y.onMounted(()=>{y.nextTick(()=>{l(),w(),window.addEventListener("resize",C)})}),y.onUnmounted(()=>{o&&o.dispose(),window.removeEventListener("resize",C)}),y.watch(()=>n.modelValue,c),y.watch(()=>n.theme,d),y.watch(()=>n.language,h),y.watch(()=>n.height,()=>{y.nextTick(()=>{C()})}),e({editor:o,focus:u,getPosition:f,setPosition:g,getSelectedText:p,replaceSelection:m,formatCode:b}),(v,S)=>(y.openBlock(),y.createElementBlock("div",{ref_key:"monacoContainer",ref:r,class:"monaco-editor-container",style:y.normalizeStyle({height:s.height})},null,4))}},[["__scopeId","data-v-e448ecfc"]]),L2e={class:"flex align-middle gap-x-0.5 border-b flex-wrap border-b-gray-200 px-[10px] py-[6px] border-solid border-transparent"},k2e={key:1,class:"html-source-editor"},lj=Object.assign({inheritAttrs:!1},{__name:"vs-richtext",props:y.mergeModels({modelValue:{type:String,default:()=>""},height:{type:String,default:()=>"300px"},toolbar:{type:[Array,String],default:()=>"default"}},{modelValue:{},modelModifiers:{}}),emits:y.mergeModels(["update:modelValue"],["update:modelValue"]),setup(s){const e=s,t=y.useModel(s,"modelValue"),{editor:n,editorInstance:i,focusEditor:r}=Hee(e),{isHtmlMode:o,htmlContent:a,htmlTextarea:l,toggleHtmlMode:c,onHtmlInput:d}=zee(n,(p,m)=>{p==="update:modelValue"&&(t.value=m)}),{isFullscreen:h,toggleFullscreen:u}=$ee(),f=y.computed(()=>typeof e.toolbar=="string"?bF[e.toolbar]||bF.default:e.toolbar),g=y.computed(()=>f.value.map(p=>gie[p]).filter(Boolean));return y.watch(()=>e.modelValue,p=>{if(n.value){const m=p||"",b=n.value.getHTML();m!==b&&m!=="<p></p>"&&n.value.commands.setContent(m,!1)}},{immediate:!0}),y.watch(n,p=>{p&&n.value.on("update",m=>{const b=m.editor.getHTML();b!==e.modelValue&&b!=="<p></p>"&&(t.value=b)})}),(p,m)=>(y.openBlock(),y.createElementBlock("div",{class:y.normalizeClass(["bg-white border border border-solid border-gray-200 rounded-xl w-full",{"fixed left-0 right-0 top-0 bottom-0 z-[100000]":y.unref(h)}])},[y.createElementVNode("div",L2e,[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(g.value,b=>(y.openBlock(),y.createElementBlock(y.Fragment,{key:b},[y.unref(n)?(y.openBlock(),y.createBlock(y.resolveDynamicComponent(b),{key:0,editor:y.unref(i),onToggleFullscreen:y.unref(u),onToggleHtmlMode:y.unref(c)},null,40,["editor","onToggleFullscreen","onToggleHtmlMode"])):y.createCommentVNode("",!0)],64))),128))]),y.createElementVNode("div",{onClick:m[2]||(m[2]=(...b)=>y.unref(r)&&y.unref(r)(...b)),class:"relative w-full px-4 py-2 bg-white rounded-b-lg editor-content dark:bg-gray-800",style:y.normalizeStyle({height:y.unref(h)?"95vh":s.height})},[y.unref(o)?(y.openBlock(),y.createElementBlock("div",k2e,[y.createVNode(x2e,{ref_key:"htmlTextarea",ref:l,modelValue:y.unref(a),"onUpdate:modelValue":m[0]||(m[0]=b=>y.isRef(a)?a.value=b:null),height:y.unref(h)?"calc(95vh - 100px)":"100%",language:"html",theme:"vs",onChange:m[1]||(m[1]=b=>y.unref(d)(b))},null,8,["modelValue","height"])])):(y.openBlock(),y.createBlock(y.unref(OZ),{key:0,editor:y.unref(n),class:"relative w-full"},null,8,["editor"]))],4)],2))}});/*!
947
947
  * shared v11.1.12
948
948
  * (c) 2025 kazuya kawaguchi
949
949
  * Released under the MIT License.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengis/richtext",
3
- "version": "0.0.12",
3
+ "version": "0.0.13",
4
4
  "type": "module",
5
5
  "author": "Softpro",
6
6
  "main": "dist/richtext.js",