@fileverse-dev/ddoc 1.7.6-patch → 1.7.6-patch-2

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.es.js CHANGED
@@ -34884,7 +34884,7 @@ const O4 = ({
34884
34884
  {
34885
34885
  type: "button",
34886
34886
  className: ve(
34887
- "btn rounded-none h-8 px-2 py-1 transition",
34887
+ "btn rounded-none h-6 transition",
34888
34888
  u[L.tooltip] && "active"
34889
34889
  ),
34890
34890
  onClick: () => {
@@ -64920,7 +64920,7 @@ const yhe = /* @__PURE__ */ op(ghe), Ew = () => {
64920
64920
  return H.addEventListener("resize", L), () => {
64921
64921
  H.removeEventListener("resize", L);
64922
64922
  };
64923
- }, [T, _, D]), T ? /* @__PURE__ */ O.jsxs("main", { "data-cy": "single-webpage", className: "bg-[#f8f9fa] h-screen w-full", children: [
64923
+ }, [T, _, D]), T ? /* @__PURE__ */ O.jsxs("div", { "data-cy": "single-webpage", className: "bg-[#f8f9fa] h-full w-full", children: [
64924
64924
  /* @__PURE__ */ O.jsx(
64925
64925
  "div",
64926
64926
  {
@@ -64944,7 +64944,7 @@ const yhe = /* @__PURE__ */ op(ghe), Ew = () => {
64944
64944
  {
64945
64945
  className: "p-4 sm:px-[88px] sm:py-[78px] bg-white w-full sm:w-[70%] max-w-[856px] mx-auto",
64946
64946
  style: {
64947
- height: D ? "calc(100vh - 8rem)" : "100vh"
64947
+ height: D && !t ? "calc(100vh - 8rem)" : "100vh"
64948
64948
  },
64949
64949
  children: [
64950
64950
  /* @__PURE__ */ O.jsxs(
@@ -64977,7 +64977,7 @@ const yhe = /* @__PURE__ */ op(ghe), Ew = () => {
64977
64977
  },
64978
64978
  variant: "ghost",
64979
64979
  className: ve(
64980
- "absolute w-12 h-12 bg-white rounded-full shadow-xl top-[70px] right-[-23px]"
64980
+ "absolute w-12 h-12 bg-white rounded-full shadow-xl top-[70px] right-[-23px]"
64981
64981
  ),
64982
64982
  children: /* @__PURE__ */ O.jsx(HV, {})
64983
64983
  }
package/dist/index.umd.js CHANGED
@@ -481,7 +481,7 @@ Use Chrome, Firefox or Internet Explorer 11`)}}).call(this)}).call(this,s("_proc
481
481
  `,Hq="️",zq="‍";let hg=null,pg=null;function $q(t){t===void 0&&(t=[]);const e={};lr.groups=e;const n=new lr;hg==null&&(hg=O_(Lq)),pg==null&&(pg=O_(Bq)),we(n,"'",Zm),we(n,"{",dh),we(n,"}",hh),we(n,"[",Fm),we(n,"]",jm),we(n,"(",Um),we(n,")",Vm),we(n,"<",Hm),we(n,">",zm),we(n,"(",$m),we(n,")",Gm),we(n,"「",Wm),we(n,"」",Km),we(n,"『",qm),we(n,"』",Qm),we(n,"<",Jm),we(n,">",Ym),we(n,"&",Xm),we(n,"*",eg),we(n,"@",zo),we(n,"`",ng),we(n,"^",rg),we(n,":",$o),we(n,",",bv),we(n,"$",ig),we(n,".",Ji),we(n,"=",sg),we(n,"!",wv),we(n,"-",Yi),we(n,"%",og),we(n,"|",ag),we(n,"+",lg),we(n,"#",ug),we(n,"?",cg),we(n,'"',Av),we(n,"/",Xi),we(n,";",vv),we(n,"~",ph),we(n,"_",fg),we(n,"\\",tg);const r=Qr(n,Ev,gv,{[uv]:!0});Qr(r,Ev,r);const i=Qr(n,uc,Bs,{[cv]:!0});Qr(i,uc,i);const s=Qr(n,xv,hv,{[fv]:!0});Qr(s,uc),Qr(s,xv,s);const o=Qr(n,S_,k_,{[v_]:!0});we(n,T_,yv,{[v_]:!0}),we(o,T_),Qr(o,S_,o);const a=Qr(n,kv,E_,{[A_]:!0});Qr(a,kv,a),we(a,Hq,a);const l=we(a,zq);Qr(l,kv,a);const u=[[uc,i]],c=[[uc,null],[xv,s]];for(let f=0;f<hg.length;f++)Go(n,hg[f],pv,Bs,u);for(let f=0;f<pg.length;f++)Go(n,pg[f],mv,hv,c);bl(pv,{tld:!0,ascii:!0},e),bl(mv,{utld:!0,alpha:!0},e),Go(n,"file",Bm,Bs,u),Go(n,"mailto",Bm,Bs,u),Go(n,"http",lc,Bs,u),Go(n,"https",lc,Bs,u),Go(n,"ftp",lc,Bs,u),Go(n,"ftps",lc,Bs,u),bl(Bm,{scheme:!0,ascii:!0},e),bl(lc,{slashscheme:!0,ascii:!0},e),t=t.sort((f,d)=>f[0]>d[0]?1:-1);for(let f=0;f<t.length;f++){const d=t[f][0],p=t[f][1]?{[Fq]:!0}:{[jq]:!0};d.indexOf("-")>=0?p[dv]=!0:uc.test(d)?Ev.test(d)?p[Im]=!0:p[cv]=!0:p[uv]=!0,x_(n,d,d,p)}return x_(n,"localhost",fh,{ascii:!0}),n.jd=new lr(dg),{start:n,tokens:ac({groups:e},C_)}}function Gq(t,e){const n=Wq(e.replace(/[A-Z]/g,a=>a.toLowerCase())),r=n.length,i=[];let s=0,o=0;for(;o<r;){let a=t,l=null,u=0,c=null,f=-1,d=-1;for(;o<r&&(l=a.go(n[o]));)a=l,a.accepts()?(f=0,d=0,c=a):f>=0&&(f+=n[o].length,d++),u+=n[o].length,s+=n[o].length,o++;s-=f,o-=d,u-=f,i.push({t:c.t,v:e.slice(s-u,s),s:s-u,e:s})}return i}function Wq(t){const e=[],n=t.length;let r=0;for(;r<n;){let i=t.charCodeAt(r),s,o=i<55296||i>56319||r+1===n||(s=t.charCodeAt(r+1))<56320||s>57343?t[r]:t.slice(r,r+2);e.push(o),r+=o.length}return e}function Go(t,e,n,r,i){let s;const o=e.length;for(let a=0;a<o-1;a++){const l=e[a];t.j[l]?s=t.j[l]:(s=new lr(r),s.jr=i.slice(),t.j[l]=s),t=s}return s=new lr(n),s.jr=i.slice(),t.j[e[o-1]]=s,s}function O_(t){const e=[],n=[];let r=0,i="0123456789";for(;r<t.length;){let s=0;for(;i.indexOf(t[r+s])>=0;)s++;if(s>0){e.push(n.join(""));for(let o=parseInt(t.substring(r,r+s),10);o>0;o--)n.pop();r+=s}else n.push(t[r]),r++}return e}const mh={defaultProtocol:"http",events:null,format:D_,formatHref:D_,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Cv(t,e){e===void 0&&(e=null);let n=ac({},mh);t&&(n=ac(n,t instanceof Cv?t.o:t));const r=n.ignoreTags,i=[];for(let s=0;s<r.length;s++)i.push(r[s].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=i}Cv.prototype={o:mh,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const r=e!=null;let i=this.o[t];return i&&(typeof i=="object"?(i=n.t in i?i[n.t]:mh[t],typeof i=="function"&&r&&(i=i(e,n))):typeof i=="function"&&r&&(i=i(e,n.t,n)),i)},getObj(t,e,n){let r=this.o[t];return typeof r=="function"&&e!=null&&(r=r(e,n.t,n)),r},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function D_(t){return t}function M_(t,e){this.t="token",this.v=t,this.tk=e}M_.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t){return t===void 0&&(t=mh.defaultProtocol),{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),i=t.get("tagName",n,e),s=this.toFormattedString(t),o={},a=t.get("className",n,e),l=t.get("target",n,e),u=t.get("rel",n,e),c=t.getObj("attributes",n,e),f=t.getObj("events",n,e);return o.href=r,a&&(o.class=a),l&&(o.target=l),u&&(o.rel=u),c&&ac(o,c),{tagName:i,attributes:o,content:s,eventListeners:f}}};function mg(t,e){class n extends M_{constructor(i,s){super(i,s),this.t=t}}for(const r in e)n.prototype[r]=e[r];return n.t=t,n}const __=mg("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),N_=mg("text"),Kq=mg("nl"),gg=mg("url",{isLink:!0,toHref(t){return t===void 0&&(t=mh.defaultProtocol),this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==fh&&t[1].t===$o}}),Jr=t=>new lr(t);function qq(t){let{groups:e}=t;const n=e.domain.concat([Xm,eg,zo,tg,ng,rg,ig,sg,Yi,gv,og,ag,lg,ug,Xi,dg,ph,fg]),r=[Zm,$o,bv,Ji,wv,cg,Av,vv,Hm,zm,dh,hh,jm,Fm,Um,Vm,$m,Gm,Wm,Km,qm,Qm,Jm,Ym],i=[Xm,Zm,eg,tg,ng,rg,ig,sg,Yi,dh,hh,og,ag,lg,ug,cg,Xi,dg,ph,fg],s=Jr(),o=we(s,ph);Ze(o,i,o),Ze(o,e.domain,o);const a=Jr(),l=Jr(),u=Jr();Ze(s,e.domain,a),Ze(s,e.scheme,l),Ze(s,e.slashscheme,u),Ze(a,i,o),Ze(a,e.domain,a);const c=we(a,zo);we(o,zo,c),we(l,zo,c),we(u,zo,c);const f=we(o,Ji);Ze(f,i,o),Ze(f,e.domain,o);const d=Jr();Ze(c,e.domain,d),Ze(d,e.domain,d);const h=we(d,Ji);Ze(h,e.domain,d);const p=Jr(__);Ze(h,e.tld,p),Ze(h,e.utld,p),we(c,fh,p);const m=we(d,Yi);Ze(m,e.domain,d),Ze(p,e.domain,d),we(p,Ji,h),we(p,Yi,m);const g=we(p,$o);Ze(g,e.numeric,__);const b=we(a,Yi),v=we(a,Ji);Ze(b,e.domain,a),Ze(v,i,o),Ze(v,e.domain,a);const y=Jr(gg);Ze(v,e.tld,y),Ze(v,e.utld,y),Ze(y,e.domain,a),Ze(y,i,o),we(y,Ji,v),we(y,Yi,b),we(y,zo,c);const A=we(y,$o),x=Jr(gg);Ze(A,e.numeric,x);const k=Jr(gg),S=Jr();Ze(k,n,k),Ze(k,r,S),Ze(S,n,k),Ze(S,r,S),we(y,Xi,k),we(x,Xi,k);const E=we(l,$o),D=we(u,$o),T=we(D,Xi),R=we(T,Xi);Ze(l,e.domain,a),we(l,Ji,v),we(l,Yi,b),Ze(u,e.domain,a),we(u,Ji,v),we(u,Yi,b),Ze(E,e.domain,k),we(E,Xi,k),Ze(R,e.domain,k),Ze(R,n,k),we(R,Xi,k);const L=[[dh,hh],[Fm,jm],[Um,Vm],[Hm,zm],[$m,Gm],[Wm,Km],[qm,Qm],[Jm,Ym]];for(let B=0;B<L.length;B++){const[z,F]=L[B],$=we(k,z);we(S,z,$),we($,F,k);const Y=Jr(gg);Ze($,n,Y);const ie=Jr();Ze($,r),Ze(Y,n,Y),Ze(Y,r,ie),Ze(ie,n,Y),Ze(ie,r,ie),we(Y,F,k),we(ie,F,k)}return we(s,fh,y),we(s,yv,Kq),{start:s,tokens:C_}}function Qq(t,e,n){let r=n.length,i=0,s=[],o=[];for(;i<r;){let a=t,l=null,u=null,c=0,f=null,d=-1;for(;i<r&&!(l=a.go(n[i].t));)o.push(n[i++]);for(;i<r&&(u=l||a.go(n[i].t));)l=null,a=u,a.accepts()?(d=0,f=a):d>=0&&d++,i++,c++;if(d<0)i-=c,i<r&&(o.push(n[i]),i++);else{o.length>0&&(s.push(Sv(N_,e,o)),o=[]),i-=d,c-=d;const h=f.t,p=n.slice(i-c,i);s.push(Sv(h,e,p))}}return o.length>0&&s.push(Sv(N_,e,o)),s}function Sv(t,e,n){const r=n[0].s,i=n[n.length-1].e,s=e.slice(r,i);return new t(s,n)}const Jq=typeof console<"u"&&console&&console.warn||(()=>{}),Yq="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",It={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function Xq(){lr.groups={},It.scanner=null,It.parser=null,It.tokenQueue=[],It.pluginQueue=[],It.customSchemes=[],It.initialized=!1}function R_(t,e){if(e===void 0&&(e=!1),It.initialized&&Jq(`linkifyjs: already initialized - will not register custom scheme "${t}" ${Yq}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
482
482
  1. Must only contain digits, lowercase ASCII letters or "-"
483
483
  2. Cannot start or end with "-"
484
- 3. "-" cannot repeat`);It.customSchemes.push([t,e])}function Zq(){It.scanner=$q(It.customSchemes);for(let t=0;t<It.tokenQueue.length;t++)It.tokenQueue[t][1]({scanner:It.scanner});It.parser=qq(It.scanner.tokens);for(let t=0;t<It.pluginQueue.length;t++)It.pluginQueue[t][1]({scanner:It.scanner,parser:It.parser});It.initialized=!0}function P_(t){return It.initialized||Zq(),Qq(It.parser.start,t,Gq(It.scanner.start,t))}function I_(t,e,n){if(e===void 0&&(e=null),n===void 0&&(n=null),e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const r=new Cv(n),i=P_(t),s=[];for(let o=0;o<i.length;o++){const a=i[o];a.isLink&&(!e||a.t===e)&&r.check(a)&&s.push(a.toFormattedObject(r))}return s}function eQ(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function tQ(t){return new bt({key:new Mt("autolink"),appendTransaction:(e,n,r)=>{const i=e.some(u=>u.docChanged)&&!n.doc.eq(r.doc),s=e.some(u=>u.getMeta("preventAutolink"));if(!i||s)return;const{tr:o}=r,a=w7(n.doc,[...e]);if(S7(a).forEach(({newRange:u})=>{const c=v7(r.doc,u,h=>h.isTextblock);let f,d;if(c.length>1?(f=c[0],d=r.doc.textBetween(f.pos,f.pos+f.node.nodeSize,void 0," ")):c.length&&r.doc.textBetween(u.from,u.to," "," ").endsWith(" ")&&(f=c[0],d=r.doc.textBetween(f.pos,u.to,void 0," ")),f&&d){const h=d.split(" ").filter(b=>b!=="");if(h.length<=0)return!1;const p=h[h.length-1],m=f.pos+d.lastIndexOf(p);if(!p)return!1;const g=P_(p).map(b=>b.toObject(t.defaultProtocol));if(!eQ(g))return!1;g.filter(b=>b.isLink).map(b=>({...b,from:m+b.start+1,to:m+b.end+1})).filter(b=>r.schema.marks.code?!r.doc.rangeHasMark(b.from,b.to,r.schema.marks.code):!0).filter(b=>t.validate(b.value)).forEach(b=>{x1(b.from,b.to,r.doc).some(v=>v.mark.type===t.type)||o.addMark(b.from,b.to,t.type.create({href:b.href}))})}}),!!o.steps.length)return o}})}function nQ(t){return new bt({key:new Mt("handleClickLink"),props:{handleClick:(e,n,r)=>{var i,s;if(r.button!==0)return!1;let o=r.target;const a=[];for(;o.nodeName!=="DIV";)a.push(o),o=o.parentNode;if(!a.find(d=>d.nodeName==="A"))return!1;const l=FS(e.state,t.type.name),u=r.target,c=(i=u==null?void 0:u.href)!==null&&i!==void 0?i:l.href,f=(s=u==null?void 0:u.target)!==null&&s!==void 0?s:l.target;return u&&c?(window.open(c,f),!0):!1}}})}function rQ(t){return new bt({key:new Mt("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{state:i}=e,{selection:s}=i,{empty:o}=s;if(o)return!1;let a="";r.content.forEach(u=>{a+=u.textContent});const l=I_(a,{defaultProtocol:t.defaultProtocol}).find(u=>u.isLink&&u.value===a);return!a||!l?!1:(t.editor.commands.setMark(t.type,{href:l.href}),!0)}}})}const iQ=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g,sQ=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i;function L_(t){return!t||t.replace(iQ,"").match(sQ)}const oQ=Yt.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.protocols.forEach(t=>{if(typeof t=="string"){R_(t);return}R_(t.scheme,t.optionalSlashes)})},onDestroy(){Xq()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:t=>!!t}},addAttributes(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!L_(e)?!1:{href:e}}}]},renderHTML({HTMLAttributes:t}){return L_(t.href)?["a",rt(this.options.HTMLAttributes,t),0]:["a",rt(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return{setLink:t=>({chain:e})=>e().setMark(this.name,t).setMeta("preventAutolink",!0).run(),toggleLink:t=>({chain:e})=>e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[No({find:t=>{const e=[];if(t){const{validate:n}=this.options,r=I_(t).filter(i=>i.isLink&&n(i.value));r.length&&r.forEach(i=>e.push({text:i.value,data:{href:i.href},index:i.start}))}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[];return this.options.autolink&&t.push(tQ({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:this.options.validate})),this.options.openOnClick===!0&&t.push(nQ({type:this.type})),this.options.linkOnPaste&&t.push(rQ({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}}),aQ=wt.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new bt({key:new Mt("placeholder"),props:{decorations:({doc:t,selection:e})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=e,i=[];if(!n)return null;const s=this.editor.isEmpty;return t.descendants((o,a)=>{const l=r>=a&&r<=a+o.nodeSize,u=!o.isLeaf&&US(o);if((l||!this.options.showOnlyCurrent)&&u){const c=[this.options.emptyNodeClass];s&&c.push(this.options.emptyEditorClass);const f=nn.node(a,a+o.nodeSize,{class:c.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(f)}return this.options.includeChildren}),kt.create(t,i)}}})]}}),lQ=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,uQ=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,cQ=Yt.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:t=>t.getAttribute("data-color")||t.style.backgroundColor,renderHTML:t=>t.color?{"data-color":t.color,style:`background-color: ${t.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:t}){return["mark",rt(this.options.HTMLAttributes,t),0]},addCommands(){return{setHighlight:t=>({commands:e})=>e.setMark(this.name,t),toggleHighlight:t=>({commands:e})=>e.toggleMark(this.name,t),unsetHighlight:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Qa({find:lQ,type:this.type})]},addPasteRules(){return[No({find:uQ,type:this.type})]}}),fQ=Xe.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:t}){return["ul",rt(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),dQ=/^\s*(\[([( |x])?\])\s$/,hQ=Xe.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList"}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:t=>t.getAttribute("data-checked")==="true",renderHTML:t=>({"data-checked":t.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:t,HTMLAttributes:e}){return["li",rt(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:n,editor:r})=>{const i=document.createElement("li"),s=document.createElement("label"),o=document.createElement("span"),a=document.createElement("input"),l=document.createElement("div");return s.contentEditable="false",a.type="checkbox",a.addEventListener("change",u=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){a.checked=!a.checked;return}const{checked:c}=u.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:f})=>{const d=n(),h=f.doc.nodeAt(d);return f.setNodeMarkup(d,void 0,{...h==null?void 0:h.attrs,checked:c}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,c)||(a.checked=!a.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([u,c])=>{i.setAttribute(u,c)}),i.dataset.checked=t.attrs.checked,t.attrs.checked&&a.setAttribute("checked","checked"),s.append(a,o),i.append(s,l),Object.entries(e).forEach(([u,c])=>{i.setAttribute(u,c)}),{dom:i,contentDOM:l,update:u=>u.type!==this.type?!1:(i.dataset.checked=u.attrs.checked,u.attrs.checked?a.setAttribute("checked","checked"):a.removeAttribute("checked"),!0)}}},addInputRules(){return[Ru({find:dQ,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),pQ=Yt.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",rt(this.options.HTMLAttributes,t),0]},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),mQ=g_.extend({renderHTML(){return["div",rt(this.options.HTMLAttributes,{"data-type":this.name}),["hr"]]}}),gQ=wt.create({name:"columnExtension",addExtensions(){const t=[];return this.options.column!==!1&&t.push(jO),this.options.columns!==!1&&t.push(Y0),t}}),yQ=wt.create({name:"CustomKeymap",addCommands(){return{selectTextWithinNodeBoundaries:()=>({editor:t,commands:e})=>{const{state:n}=t,{tr:r}=n,i=r.selection.$from.start(),s=r.selection.$to.end();return e.setTextSelection({from:i,to:s})}}},addKeyboardShortcuts(){return{"Mod-a":({editor:t})=>{const{state:e}=t,{tr:n}=e,r=n.selection.from,i=n.selection.to,s=n.selection.$from.start(),o=n.selection.$to.end();return r>s||i<o?(t.chain().selectTextWithinNodeBoundaries().run(),!0):!1}}}}),bQ=wt.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:t=>{var e;return(e=t.style.color)===null||e===void 0?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.color?{style:`color: ${t.color}`}:{}}}}]},addCommands(){return{setColor:t=>({chain:e})=>e().setMark("textStyle",{color:t}).run(),unsetColor:()=>({chain:t})=>t().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}),B_=[{tooltip:"Align left",action:t=>t({dataAlign:"start",dataFloat:null}),icon:"AlignLeft",isActive:t=>t.dataAlign==="start"},{tooltip:"Align center",action:t=>t({dataAlign:"center",dataFloat:null}),icon:"AlignCenter",isActive:t=>t.dataAlign==="center"},{tooltip:"Align right",action:t=>t({dataAlign:"end",dataFloat:null}),icon:"AlignRight",isActive:t=>t.dataAlign==="end"},{tooltip:"Delete",icon:"Trash2",delete:t=>t()}];let cc;const F_=({node:t,updateAttributes:e,deleteNode:n})=>{const r=X0(),[i,s]=N.useState(),[o,a]=N.useState(0),[l,u]=N.useState(0),[c,f]=N.useState({}),d=N.useRef(null),[h,p]=N.useState(!1),m=()=>{const B={};B_.forEach(({tooltip:z,isActive:F})=>{B[z]=!!(F!=null&&F(t.attrs))}),f(B)},g=()=>{const B=document.querySelector(".ProseMirror");if(B&&u(B==null?void 0:B.clientWidth),!!d.current){if(i==="video"){const z=d.current;z.addEventListener("loadeddata",function(){a(z.videoWidth/z.videoHeight),k("left",0)})}else if(i==="iframe"){const z=d.current;z.onload=()=>{a(z.offsetWidth/z.offsetHeight),k("left",0)}}else d.current.onload=()=>{a(d.current.naturalWidth/d.current.naturalHeight)};setTimeout(()=>m(),200)}},b=B=>{cc=B};N.useEffect(()=>{g()},[]);const v=({width:B,height:z})=>B<200||z<200,y=B=>{const z=B instanceof TouchEvent?B.touches[0].clientX:B.clientX;setTimeout(()=>S(z))},A=B=>{cc=B instanceof TouchEvent?B.touches[0].clientX:B.clientX,setTimeout(()=>{document.addEventListener("mousemove",y),document.addEventListener("mouseup",x),document.addEventListener("touchmove",y),document.addEventListener("touchend",x)}),p(!0)},x=()=>{cc=-1,document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",x),p(!1)},k=(B,z)=>{var ie,ee;if(!d.current){console.error("Media ref is undefined|null",{resizableImg:d.current});return}const F={width:(ie=d.current)==null?void 0:ie.width,height:(ee=d.current)==null?void 0:ee.height},$={width:-1,height:-1};let Y=parseFloat(F.width.toString());if(isNaN(Y)&&(Y=0),B==="left"?$.width=Y-Math.abs(z):$.width=Y+Math.abs(z),$.width>l&&($.width=l),i==="iframe")$.height=$.width/(16/9);else{const Ae=isNaN(o)?1:o;$.height=$.width/Ae}$.width=isNaN($.width)?0:$.width,$.height=isNaN($.height)?0:$.height,!v($)&&e($)},S=B=>{if(cc===-1)return;const z=cc-B;if(z===0)return;const F=z>0?"left":"right";setTimeout(()=>{k(F,Math.abs(z)),cc=B})},[E,D]=N.useState(),[T,R]=N.useState();N.useEffect(()=>{s(t.attrs["media-type"]),m(),D(t.attrs.dataFloat),R(t.attrs.dataAlign)},[t.attrs]);const L=B=>{switch(B){case"AlignLeft":return O.jsx(Md,{size:16});case"AlignCenter":return O.jsx(X1,{size:16});case"AlignRight":return O.jsx(Z1,{size:16});case"Trash2":return O.jsx(aw,{size:16});default:return null}};return O.jsx(Dd,{as:"article",className:ve("media-node-view not-prose transition-all ease-in-out w-full",E&&`f-${t.attrs.dataFloat}`,T&&`justify-${t.attrs.dataAlign}`),children:O.jsxs("div",{className:"w-fit flex relative group transition-all ease-in-out",children:[i==="img"&&O.jsx("img",{src:t.attrs.src,ref:d,className:"rounded-lg",alt:t.attrs.src,width:t.attrs.width,height:t.attrs.height}),i==="video"&&O.jsx("video",{ref:d,className:"rounded-lg",controls:!0,width:t.attrs.width,height:t.attrs.height,children:O.jsx("source",{src:t.attrs.src})}),i==="iframe"&&O.jsx("iframe",{ref:d,className:ve("rounded-lg max-w-full",h&&"pointer-events-none"),src:t.attrs.src,width:t.attrs.width,height:t.attrs.height}),!r&&O.jsxs(O.Fragment,{children:[O.jsx("div",{className:"horizontal-resize-handle group-hover:bg-black group-hover:border-2 group-hover:border-white/80",title:"Resize",onClick:({clientX:B})=>b(B),onMouseDown:B=>A(B),onMouseUp:x,onTouchStart:B=>A(B),onTouchEnd:x}),O.jsx("section",{className:"media-control-buttons opacity-0 group-hover:opacity-100 transition-opacity duration-200 flex",children:B_.map((B,z)=>O.jsx("div",{className:"tooltip","data-tip":B.tooltip,children:O.jsx("button",{type:"button",className:ve("btn rounded-none h-8 px-2 py-1 transition",c[B.tooltip]&&"active"),onClick:()=>{var F;return B.tooltip==="Delete"?n():(F=B.action)==null?void 0:F.call(B,e)},children:B.icon&&L(B.icon)})},z))})]})]})})},wQ=Xe.create({name:"iframe",group:"block",atom:!0,draggable:!0,addOptions(){return{allowFullscreen:!0,HTMLAttributes:{class:"iframe-wrapper"}}},addAttributes(){return{src:{default:null},frameborder:{default:0},allowfullscreen:{default:this.options.allowFullscreen,parseHTML:()=>this.options.allowFullscreen},"media-type":{default:"iframe"},alt:{default:null},title:{default:null},width:{default:this.options.width},height:{default:this.options.height},dataAlign:{default:"left"},dataFloat:{default:null}}},addNodeView(){return el(F_)},parseHTML(){return[{tag:"iframe"}]},renderHTML({HTMLAttributes:t}){return["iframe",rt(this.options.HTMLAttributes,t)]},addCommands(){return{setIframe:t=>({tr:e,dispatch:n})=>{const{selection:r}=e,i=this.type.create(t);return n&&e.replaceRangeWith(r.from-1,r.to,i),!0}}}});var AQ="https://platform.twitter.com/widgets.js",Tv="createTweet",vQ=function(e){var n=N.useRef(null),r=N.useState(!0),i=r[0],s=r[1];return N.useEffect(function(){var o=!0,a=require("scriptjs");return a(AQ,"twitter-embed",function(){if(!window.twttr){console.error("Failure to load window.twttr, aborting load");return}if(o){if(!window.twttr.widgets[Tv]){console.error("Method "+Tv+" is not present anymore in twttr.widget api");return}window.twttr.widgets[Tv](e.tweetId,n==null?void 0:n.current,e.options).then(function(l){s(!1),e.onLoad&&e.onLoad(l)})}}),function(){o=!1}},[]),N.createElement(N.Fragment,null,i&&N.createElement(N.Fragment,null,e.placeholder),N.createElement("div",{ref:n}))};const xQ=({node:t,editor:e})=>{const[n,r]=N.useState(!0);return N.useEffect(()=>{e==null||e.chain().focus()},[]),O.jsx(Dd,{as:"div",className:"flex gap-2 group w-full relative justify-center items-start",children:O.jsxs("div",{className:"w-full max-w-sm",children:[n&&O.jsx(JO,{width:5,height:5}),O.jsx(vQ,{tweetId:t.attrs.tweetId,onLoad:()=>r(!1)})]})})},kQ=Xe.create({name:"embeddedTweet",group:"block",atom:!0,draggable:!0,addOptions(){return{HTMLAttributes:{class:""}}},addAttributes(){return{tweetId:{default:null},align:{default:"center"}}},parseHTML(){return[{tag:"div[data-tweet-id]"}]},renderHTML({HTMLAttributes:t}){return["div",rt(this.options.HTMLAttributes,t)]},addNodeView(){return el(xQ)},addCommands(){return{setTweetEmbed:t=>({commands:e})=>e.insertContent({type:this.name,attrs:{tweetId:t.tweetId,align:"center"},content:[]})}}}),EQ=t=>new bt({key:new Mt("media-paste-drop"),props:{handlePaste(e,n){var i;return Array.from(((i=n.clipboardData)==null?void 0:i.items)||[]).forEach(s=>{const o=s.getAsFile();if(((o==null?void 0:o.type.indexOf("image"))===0||(o==null?void 0:o.type.indexOf("video"))===0)&&(n.preventDefault(),o&&o.size>Hd))throw new Error("Image too large")}),!1},handleDrop(e,n){var a;if(!(n.dataTransfer&&n.dataTransfer.files&&n.dataTransfer.files.length))return!1;const i=Array.from(((a=n.dataTransfer)==null?void 0:a.files)??[]).filter(({type:l})=>/image|video/i.test(l));if(i.length===0)return!1;n.preventDefault();const{schema:s}=e.state,o=e.posAtCoords({left:n.clientX,top:n.clientY});return o?(i.forEach(async l=>{const u=new FileReader;if(t){const c=s.nodes.resizableMedia.create({src:await t(l),"media-type":l.type.includes("image")?"img":"video"}),f=e.state.tr.insert(o.pos,c);e.dispatch(f)}else u.onload=c=>{var h;const f=s.nodes.resizableMedia.create({src:(h=c.target)==null?void 0:h.result,"media-type":l.type.includes("image")?"img":"video"}),d=e.state.tr.insert(o.pos,f);e.dispatch(d)},u.readAsDataURL(l)}),!0):!1}}}),CQ=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,SQ=/!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\)/,TQ=Xe.create({name:"resizableMedia",addOptions(){return{HTMLAttributes:{class:"rounded-lg border border-stone-200"},uploadFn:async()=>""}},inline:!1,group:"block",draggable:!0,addAttributes(){return{src:{default:null},"media-type":{default:null},alt:{default:null},title:{default:null},width:{default:"100%"},height:{default:"auto"},dataAlign:{default:"left"},dataFloat:{default:null}}},selectable:!0,parseHTML(){return[{tag:'img[src]:not([src^="data:"])',getAttrs:t=>({src:t.getAttribute("src"),"media-type":"img"})},{tag:"video",getAttrs:t=>({src:t.getAttribute("src"),"media-type":"video"})}]},renderHTML({HTMLAttributes:t}){const{"media-type":e}=t;return e==="img"?["img",rt(this.options.HTMLAttributes,t)]:e==="video"?["video",{controls:"true",style:"width: 100%",...t},["source",t]]:(e||console.error("TiptapMediaExtension-renderHTML method: Media Type not set, going default with image"),["img",rt(this.options.HTMLAttributes,t)])},addCommands(){return{setMedia:t=>({commands:e})=>{const{"media-type":n}=t;return n==="img"?e.insertContent({type:this.name,attrs:t}):n==="video"?e.insertContent({type:this.name,attrs:{...t,controls:"true"}}):(n||console.error("TiptapMediaExtension-setMedia: Media Type not set, going default with image"),e.insertContent({type:this.name,attrs:t}))}}},addNodeView(){return el(F_)},addKeyboardShortcuts(){return{Enter:({editor:t})=>{const{selection:e}=t.state;if(e.empty)return!1;const n=e.$to.pos;return t.commands.insertContentAt(n,{type:"dBlock",content:[{type:"paragraph"}]})}}},addInputRules(){return[T1({find:CQ,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r,"media-type":"img"}}}),T1({find:SQ,type:this.type,getAttributes:t=>{const[,,e]=t;return{src:e,"media-type":"video"}}})]},addProseMirrorPlugins(){return[EQ(this.options.uploadFn),yV()]}});function j_(t,e){let n;return(...i)=>{clearTimeout(n),n=setTimeout(()=>t(...i),e)}}const OQ=["top","right","bottom","left"],Zi=Math.min,Mr=Math.max,yg=Math.round,bg=Math.floor,Wo=t=>({x:t,y:t}),DQ={left:"right",right:"left",bottom:"top",top:"bottom"},MQ={start:"end",end:"start"};function Ov(t,e,n){return Mr(t,Zi(e,n))}function Fs(t,e){return typeof t=="function"?t(e):t}function js(t){return t.split("-")[0]}function fc(t){return t.split("-")[1]}function Dv(t){return t==="x"?"y":"x"}function Mv(t){return t==="y"?"height":"width"}function dc(t){return["top","bottom"].includes(js(t))?"y":"x"}function _v(t){return Dv(dc(t))}function _Q(t,e,n){n===void 0&&(n=!1);const r=fc(t),i=_v(t),s=Mv(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=wg(o)),[o,wg(o)]}function NQ(t){const e=wg(t);return[Nv(t),e,Nv(e)]}function Nv(t){return t.replace(/start|end/g,e=>MQ[e])}function RQ(t,e,n){const r=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:r:e?r:i;case"left":case"right":return e?s:o;default:return[]}}function PQ(t,e,n,r){const i=fc(t);let s=RQ(js(t),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(Nv)))),s}function wg(t){return t.replace(/left|right|bottom|top/g,e=>DQ[e])}function IQ(t){return{top:0,right:0,bottom:0,left:0,...t}}function U_(t){return typeof t!="number"?IQ(t):{top:t,right:t,bottom:t,left:t}}function Ag(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function V_(t,e,n){let{reference:r,floating:i}=t;const s=dc(e),o=_v(e),a=Mv(o),l=js(e),u=s==="y",c=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,d=r[a]/2-i[a]/2;let h;switch(l){case"top":h={x:c,y:r.y-i.height};break;case"bottom":h={x:c,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-i.width,y:f};break;default:h={x:r.x,y:r.y}}switch(fc(e)){case"start":h[o]-=d*(n&&u?-1:1);break;case"end":h[o]+=d*(n&&u?-1:1);break}return h}const LQ=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,a=s.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(e));let u=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:c,y:f}=V_(u,r,l),d=r,h={},p=0;for(let m=0;m<a.length;m++){const{name:g,fn:b}=a[m],{x:v,y,data:A,reset:x}=await b({x:c,y:f,initialPlacement:r,placement:d,strategy:i,middlewareData:h,rects:u,platform:o,elements:{reference:t,floating:e}});c=v??c,f=y??f,h={...h,[g]:{...h[g],...A}},x&&p<=50&&(p++,typeof x=="object"&&(x.placement&&(d=x.placement),x.rects&&(u=x.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:i}):x.rects),{x:c,y:f}=V_(u,d,l)),m=-1)}return{x:c,y:f,placement:d,strategy:i,middlewareData:h}};async function gh(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:s,rects:o,elements:a,strategy:l}=t,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:d=!1,padding:h=0}=Fs(e,t),p=U_(h),g=a[d?f==="floating"?"reference":"floating":f],b=Ag(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(g)))==null||n?g:g.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),v=f==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,y=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),A=await(s.isElement==null?void 0:s.isElement(y))?await(s.getScale==null?void 0:s.getScale(y))||{x:1,y:1}:{x:1,y:1},x=Ag(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:y,strategy:l}):v);return{top:(b.top-x.top+p.top)/A.y,bottom:(x.bottom-b.bottom+p.bottom)/A.y,left:(b.left-x.left+p.left)/A.x,right:(x.right-b.right+p.right)/A.x}}const BQ=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:s,platform:o,elements:a,middlewareData:l}=e,{element:u,padding:c=0}=Fs(t,e)||{};if(u==null)return{};const f=U_(c),d={x:n,y:r},h=_v(i),p=Mv(h),m=await o.getDimensions(u),g=h==="y",b=g?"top":"left",v=g?"bottom":"right",y=g?"clientHeight":"clientWidth",A=s.reference[p]+s.reference[h]-d[h]-s.floating[p],x=d[h]-s.reference[h],k=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let S=k?k[y]:0;(!S||!await(o.isElement==null?void 0:o.isElement(k)))&&(S=a.floating[y]||s.floating[p]);const E=A/2-x/2,D=S/2-m[p]/2-1,T=Zi(f[b],D),R=Zi(f[v],D),L=T,B=S-m[p]-R,z=S/2-m[p]/2+E,F=Ov(L,z,B),$=!l.arrow&&fc(i)!=null&&z!==F&&s.reference[p]/2-(z<L?T:R)-m[p]/2<0,Y=$?z<L?z-L:z-B:0;return{[h]:d[h]+Y,data:{[h]:F,centerOffset:z-F-Y,...$&&{alignmentOffset:Y}},reset:$}}}),FQ=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:s,rects:o,initialPlacement:a,platform:l,elements:u}=e,{mainAxis:c=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...g}=Fs(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const b=js(i),v=js(a)===a,y=await(l.isRTL==null?void 0:l.isRTL(u.floating)),A=d||(v||!m?[wg(a)]:NQ(a));!d&&p!=="none"&&A.push(...PQ(a,m,p,y));const x=[a,...A],k=await gh(e,g),S=[];let E=((r=s.flip)==null?void 0:r.overflows)||[];if(c&&S.push(k[b]),f){const L=_Q(i,o,y);S.push(k[L[0]],k[L[1]])}if(E=[...E,{placement:i,overflows:S}],!S.every(L=>L<=0)){var D,T;const L=(((D=s.flip)==null?void 0:D.index)||0)+1,B=x[L];if(B)return{data:{index:L,overflows:E},reset:{placement:B}};let z=(T=E.filter(F=>F.overflows[0]<=0).sort((F,$)=>F.overflows[1]-$.overflows[1])[0])==null?void 0:T.placement;if(!z)switch(h){case"bestFit":{var R;const F=(R=E.map($=>[$.placement,$.overflows.filter(Y=>Y>0).reduce((Y,ie)=>Y+ie,0)]).sort(($,Y)=>$[1]-Y[1])[0])==null?void 0:R[0];F&&(z=F);break}case"initialPlacement":z=a;break}if(i!==z)return{reset:{placement:z}}}return{}}}};function H_(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function z_(t){return OQ.some(e=>t[e]>=0)}const jQ=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...i}=Fs(t,e);switch(r){case"referenceHidden":{const s=await gh(e,{...i,elementContext:"reference"}),o=H_(s,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:z_(o)}}}case"escaped":{const s=await gh(e,{...i,altBoundary:!0}),o=H_(s,n.floating);return{data:{escapedOffsets:o,escaped:z_(o)}}}default:return{}}}}};async function UQ(t,e){const{placement:n,platform:r,elements:i}=t,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=js(n),a=fc(n),l=dc(n)==="y",u=["left","top"].includes(o)?-1:1,c=s&&l?-1:1,f=Fs(e,t);let{mainAxis:d,crossAxis:h,alignmentAxis:p}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&typeof p=="number"&&(h=a==="end"?p*-1:p),l?{x:h*c,y:d*u}:{x:d*u,y:h*c}}const VQ=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:s,placement:o,middlewareData:a}=e,l=await UQ(e,t);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:o}}}}},HQ=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:g=>{let{x:b,y:v}=g;return{x:b,y:v}}},...l}=Fs(t,e),u={x:n,y:r},c=await gh(e,l),f=dc(js(i)),d=Dv(f);let h=u[d],p=u[f];if(s){const g=d==="y"?"top":"left",b=d==="y"?"bottom":"right",v=h+c[g],y=h-c[b];h=Ov(v,h,y)}if(o){const g=f==="y"?"top":"left",b=f==="y"?"bottom":"right",v=p+c[g],y=p-c[b];p=Ov(v,p,y)}const m=a.fn({...e,[d]:h,[f]:p});return{...m,data:{x:m.x-n,y:m.y-r}}}}},zQ=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:i,rects:s,middlewareData:o}=e,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=Fs(t,e),c={x:n,y:r},f=dc(i),d=Dv(f);let h=c[d],p=c[f];const m=Fs(a,e),g=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const y=d==="y"?"height":"width",A=s.reference[d]-s.floating[y]+g.mainAxis,x=s.reference[d]+s.reference[y]-g.mainAxis;h<A?h=A:h>x&&(h=x)}if(u){var b,v;const y=d==="y"?"width":"height",A=["top","left"].includes(js(i)),x=s.reference[f]-s.floating[y]+(A&&((b=o.offset)==null?void 0:b[f])||0)+(A?0:g.crossAxis),k=s.reference[f]+s.reference[y]+(A?0:((v=o.offset)==null?void 0:v[f])||0)-(A?g.crossAxis:0);p<x?p=x:p>k&&(p=k)}return{[d]:h,[f]:p}}}},$Q=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:r,platform:i,elements:s}=e,{apply:o=()=>{},...a}=Fs(t,e),l=await gh(e,a),u=js(n),c=fc(n),f=dc(n)==="y",{width:d,height:h}=r.floating;let p,m;u==="top"||u==="bottom"?(p=u,m=c===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(m=u,p=c==="end"?"top":"bottom");const g=h-l.top-l.bottom,b=d-l.left-l.right,v=Zi(h-l[p],g),y=Zi(d-l[m],b),A=!e.middlewareData.shift;let x=v,k=y;if(f?k=c||A?Zi(y,b):b:x=c||A?Zi(v,g):g,A&&!c){const E=Mr(l.left,0),D=Mr(l.right,0),T=Mr(l.top,0),R=Mr(l.bottom,0);f?k=d-2*(E!==0||D!==0?E+D:Mr(l.left,l.right)):x=h-2*(T!==0||R!==0?T+R:Mr(l.top,l.bottom))}await o({...e,availableWidth:k,availableHeight:x});const S=await i.getDimensions(s.floating);return d!==S.width||h!==S.height?{reset:{rects:!0}}:{}}}};function hc(t){return $_(t)?(t.nodeName||"").toLowerCase():"#document"}function _r(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Us(t){var e;return(e=($_(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function $_(t){return t instanceof Node||t instanceof _r(t).Node}function es(t){return t instanceof Element||t instanceof _r(t).Element}function ts(t){return t instanceof HTMLElement||t instanceof _r(t).HTMLElement}function G_(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof _r(t).ShadowRoot}function yh(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=Ai(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function GQ(t){return["table","td","th"].includes(hc(t))}function Rv(t){const e=Pv(),n=Ai(t);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function WQ(t){let e=Ko(t);for(;ts(e)&&!pc(e);){if(Rv(e))return e;e=Ko(e)}return null}function Pv(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function pc(t){return["html","body","#document"].includes(hc(t))}function Ai(t){return _r(t).getComputedStyle(t)}function vg(t){return es(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Ko(t){if(hc(t)==="html")return t;const e=t.assignedSlot||t.parentNode||G_(t)&&t.host||Us(t);return G_(e)?e.host:e}function W_(t){const e=Ko(t);return pc(e)?t.ownerDocument?t.ownerDocument.body:t.body:ts(e)&&yh(e)?e:W_(e)}function bh(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=W_(t),s=i===((r=t.ownerDocument)==null?void 0:r.body),o=_r(i);return s?e.concat(o,o.visualViewport||[],yh(i)?i:[],o.frameElement&&n?bh(o.frameElement):[]):e.concat(i,bh(i,[],n))}function K_(t){const e=Ai(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=ts(t),s=i?t.offsetWidth:n,o=i?t.offsetHeight:r,a=yg(n)!==s||yg(r)!==o;return a&&(n=s,r=o),{width:n,height:r,$:a}}function Iv(t){return es(t)?t:t.contextElement}function mc(t){const e=Iv(t);if(!ts(e))return Wo(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:s}=K_(e);let o=(s?yg(n.width):n.width)/r,a=(s?yg(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const KQ=Wo(0);function q_(t){const e=_r(t);return!Pv()||!e.visualViewport?KQ:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function qQ(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==_r(t)?!1:e}function wl(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=Iv(t);let o=Wo(1);e&&(r?es(r)&&(o=mc(r)):o=mc(t));const a=qQ(s,n,r)?q_(s):Wo(0);let l=(i.left+a.x)/o.x,u=(i.top+a.y)/o.y,c=i.width/o.x,f=i.height/o.y;if(s){const d=_r(s),h=r&&es(r)?_r(r):r;let p=d,m=p.frameElement;for(;m&&r&&h!==p;){const g=mc(m),b=m.getBoundingClientRect(),v=Ai(m),y=b.left+(m.clientLeft+parseFloat(v.paddingLeft))*g.x,A=b.top+(m.clientTop+parseFloat(v.paddingTop))*g.y;l*=g.x,u*=g.y,c*=g.x,f*=g.y,l+=y,u+=A,p=_r(m),m=p.frameElement}}return Ag({width:c,height:f,x:l,y:u})}const QQ=[":popover-open",":modal"];function Lv(t){return QQ.some(e=>{try{return t.matches(e)}catch{return!1}})}function JQ(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const s=i==="fixed",o=Us(r),a=e?Lv(e.floating):!1;if(r===o||a&&s)return n;let l={scrollLeft:0,scrollTop:0},u=Wo(1);const c=Wo(0),f=ts(r);if((f||!f&&!s)&&((hc(r)!=="body"||yh(o))&&(l=vg(r)),ts(r))){const d=wl(r);u=mc(r),c.x=d.x+r.clientLeft,c.y=d.y+r.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x,y:n.y*u.y-l.scrollTop*u.y+c.y}}function YQ(t){return Array.from(t.getClientRects())}function Q_(t){return wl(Us(t)).left+vg(t).scrollLeft}function XQ(t){const e=Us(t),n=vg(t),r=t.ownerDocument.body,i=Mr(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=Mr(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+Q_(t);const a=-n.scrollTop;return Ai(r).direction==="rtl"&&(o+=Mr(e.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}function ZQ(t,e){const n=_r(t),r=Us(t),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;const u=Pv();(!u||u&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:s,height:o,x:a,y:l}}function eJ(t,e){const n=wl(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,s=ts(t)?mc(t):Wo(1),o=t.clientWidth*s.x,a=t.clientHeight*s.y,l=i*s.x,u=r*s.y;return{width:o,height:a,x:l,y:u}}function J_(t,e,n){let r;if(e==="viewport")r=ZQ(t,n);else if(e==="document")r=XQ(Us(t));else if(es(e))r=eJ(e,n);else{const i=q_(t);r={...e,x:e.x-i.x,y:e.y-i.y}}return Ag(r)}function Y_(t,e){const n=Ko(t);return n===e||!es(n)||pc(n)?!1:Ai(n).position==="fixed"||Y_(n,e)}function tJ(t,e){const n=e.get(t);if(n)return n;let r=bh(t,[],!1).filter(a=>es(a)&&hc(a)!=="body"),i=null;const s=Ai(t).position==="fixed";let o=s?Ko(t):t;for(;es(o)&&!pc(o);){const a=Ai(o),l=Rv(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||yh(o)&&!l&&Y_(t,o))?r=r.filter(c=>c!==o):i=a,o=Ko(o)}return e.set(t,r),r}function nJ(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const o=[...n==="clippingAncestors"?Lv(e)?[]:tJ(e,this._c):[].concat(n),r],a=o[0],l=o.reduce((u,c)=>{const f=J_(e,c,i);return u.top=Mr(f.top,u.top),u.right=Zi(f.right,u.right),u.bottom=Zi(f.bottom,u.bottom),u.left=Mr(f.left,u.left),u},J_(e,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function rJ(t){const{width:e,height:n}=K_(t);return{width:e,height:n}}function iJ(t,e,n){const r=ts(e),i=Us(e),s=n==="fixed",o=wl(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const l=Wo(0);if(r||!r&&!s)if((hc(e)!=="body"||yh(i))&&(a=vg(e)),r){const f=wl(e,!0,s,e);l.x=f.x+e.clientLeft,l.y=f.y+e.clientTop}else i&&(l.x=Q_(i));const u=o.left+a.scrollLeft-l.x,c=o.top+a.scrollTop-l.y;return{x:u,y:c,width:o.width,height:o.height}}function Bv(t){return Ai(t).position==="static"}function X_(t,e){return!ts(t)||Ai(t).position==="fixed"?null:e?e(t):t.offsetParent}function Z_(t,e){const n=_r(t);if(Lv(t))return n;if(!ts(t)){let i=Ko(t);for(;i&&!pc(i);){if(es(i)&&!Bv(i))return i;i=Ko(i)}return n}let r=X_(t,e);for(;r&&GQ(r)&&Bv(r);)r=X_(r,e);return r&&pc(r)&&Bv(r)&&!Rv(r)?n:r||WQ(t)||n}const sJ=async function(t){const e=this.getOffsetParent||Z_,n=this.getDimensions,r=await n(t.floating);return{reference:iJ(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function oJ(t){return Ai(t).direction==="rtl"}const aJ={convertOffsetParentRelativeRectToViewportRelativeRect:JQ,getDocumentElement:Us,getClippingRect:nJ,getOffsetParent:Z_,getElementRects:sJ,getClientRects:YQ,getDimensions:rJ,getScale:mc,isElement:es,isRTL:oJ};function lJ(t,e){let n=null,r;const i=Us(t);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const{left:u,top:c,width:f,height:d}=t.getBoundingClientRect();if(a||e(),!f||!d)return;const h=bg(c),p=bg(i.clientWidth-(u+f)),m=bg(i.clientHeight-(c+d)),g=bg(u),v={rootMargin:-h+"px "+-p+"px "+-m+"px "+-g+"px",threshold:Mr(0,Zi(1,l))||1};let y=!0;function A(x){const k=x[0].intersectionRatio;if(k!==l){if(!y)return o();k?o(!1,k):r=setTimeout(()=>{o(!1,1e-7)},1e3)}y=!1}try{n=new IntersectionObserver(A,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(A,v)}n.observe(t)}return o(!0),s}function uJ(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=Iv(t),c=i||s?[...u?bh(u):[],...bh(e)]:[];c.forEach(b=>{i&&b.addEventListener("scroll",n,{passive:!0}),s&&b.addEventListener("resize",n)});const f=u&&a?lJ(u,n):null;let d=-1,h=null;o&&(h=new ResizeObserver(b=>{let[v]=b;v&&v.target===u&&h&&(h.unobserve(e),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var y;(y=h)==null||y.observe(e)})),n()}),u&&!l&&h.observe(u),h.observe(e));let p,m=l?wl(t):null;l&&g();function g(){const b=wl(t);m&&(b.x!==m.x||b.y!==m.y||b.width!==m.width||b.height!==m.height)&&n(),m=b,p=requestAnimationFrame(g)}return n(),()=>{var b;c.forEach(v=>{i&&v.removeEventListener("scroll",n),s&&v.removeEventListener("resize",n)}),f==null||f(),(b=h)==null||b.disconnect(),h=null,l&&cancelAnimationFrame(p)}}const cJ=VQ,fJ=HQ,dJ=FQ,hJ=$Q,pJ=jQ,eN=BQ,mJ=zQ,gJ=(t,e,n)=>{const r=new Map,i={platform:aJ,...n},s={...i.platform,_c:r};return LQ(t,e,{...i,platform:s})};var xg=typeof document<"u"?N.useLayoutEffect:N.useEffect;function kg(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!kg(t[r],e[r]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const s=i[r];if(!(s==="_owner"&&t.$$typeof)&&!kg(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function tN(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function nN(t,e){const n=tN(t);return Math.round(e*n)/n}function rN(t){const e=G.useRef(t);return xg(()=>{e.current=t}),e}function yJ(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:l,open:u}=t,[c,f]=G.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[d,h]=G.useState(r);kg(d,r)||h(r);const[p,m]=G.useState(null),[g,b]=G.useState(null),v=G.useCallback(Y=>{Y!==k.current&&(k.current=Y,m(Y))},[]),y=G.useCallback(Y=>{Y!==S.current&&(S.current=Y,b(Y))},[]),A=s||p,x=o||g,k=G.useRef(null),S=G.useRef(null),E=G.useRef(c),D=l!=null,T=rN(l),R=rN(i),L=G.useCallback(()=>{if(!k.current||!S.current)return;const Y={placement:e,strategy:n,middleware:d};R.current&&(Y.platform=R.current),gJ(k.current,S.current,Y).then(ie=>{const ee={...ie,isPositioned:!0};B.current&&!kg(E.current,ee)&&(E.current=ee,wb.flushSync(()=>{f(ee)}))})},[d,e,n,R]);xg(()=>{u===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,f(Y=>({...Y,isPositioned:!1})))},[u]);const B=G.useRef(!1);xg(()=>(B.current=!0,()=>{B.current=!1}),[]),xg(()=>{if(A&&(k.current=A),x&&(S.current=x),A&&x){if(T.current)return T.current(A,x,L);L()}},[A,x,L,T,D]);const z=G.useMemo(()=>({reference:k,floating:S,setReference:v,setFloating:y}),[v,y]),F=G.useMemo(()=>({reference:A,floating:x}),[A,x]),$=G.useMemo(()=>{const Y={position:n,left:0,top:0};if(!F.floating)return Y;const ie=nN(F.floating,c.x),ee=nN(F.floating,c.y);return a?{...Y,transform:"translate("+ie+"px, "+ee+"px)",...tN(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ie,top:ee}},[n,a,F.floating,c.x,c.y]);return G.useMemo(()=>({...c,update:L,refs:z,elements:F,floatingStyles:$}),[c,L,z,F,$])}const bJ=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:i}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?eN({element:r.current,padding:i}).fn(n):{}:r?eN({element:r,padding:i}).fn(n):{}}}},wJ=(t,e)=>({...cJ(t),options:[t,e]}),AJ=(t,e)=>({...fJ(t),options:[t,e]}),vJ=(t,e)=>({...mJ(t),options:[t,e]}),xJ=(t,e)=>({...dJ(t),options:[t,e]}),kJ=(t,e)=>({...hJ(t),options:[t,e]}),EJ=(t,e)=>({...pJ(t),options:[t,e]}),CJ=(t,e)=>({...bJ(t),options:[t,e]});var SJ="Arrow",iN=G.forwardRef((t,e)=>{const{children:n,width:r=10,height:i=5,...s}=t;return O.jsx(sr.svg,{...s,ref:e,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:O.jsx("polygon",{points:"0,0 30,0 15,10"})})});iN.displayName=SJ;var TJ=iN;function OJ(t){const[e,n]=G.useState(void 0);return tl(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,a;if("borderBoxSize"in s){const l=s.borderBoxSize,u=Array.isArray(l)?l[0]:l;o=u.inlineSize,a=u.blockSize}else o=t.offsetWidth,a=t.offsetHeight;n({width:o,height:a})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var Fv="Popper",[sN,oN]=fw(Fv),[DJ,aN]=sN(Fv),lN=t=>{const{__scopePopper:e,children:n}=t,[r,i]=G.useState(null);return O.jsx(DJ,{scope:e,anchor:r,onAnchorChange:i,children:n})};lN.displayName=Fv;var uN="PopperAnchor",cN=G.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...i}=t,s=aN(uN,n),o=G.useRef(null),a=Gr(e,o);return G.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:O.jsx(sr.div,{...i,ref:a})});cN.displayName=uN;var jv="PopperContent",[MJ,_J]=sN(jv),fN=G.forwardRef((t,e)=>{var Ve,me,Ke,fe,oe,de;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:c=0,sticky:f="partial",hideWhenDetached:d=!1,updatePositionStrategy:h="optimized",onPlaced:p,...m}=t,g=aN(jv,n),[b,v]=G.useState(null),y=Gr(e,ae=>v(ae)),[A,x]=G.useState(null),k=OJ(A),S=(k==null?void 0:k.width)??0,E=(k==null?void 0:k.height)??0,D=r+(s!=="center"?"-"+s:""),T=typeof c=="number"?c:{top:0,right:0,bottom:0,left:0,...c},R=Array.isArray(u)?u:[u],L=R.length>0,B={padding:T,boundary:R.filter(RJ),altBoundary:L},{refs:z,floatingStyles:F,placement:$,isPositioned:Y,middlewareData:ie}=yJ({strategy:"fixed",placement:D,whileElementsMounted:(...ae)=>uJ(...ae,{animationFrame:h==="always"}),elements:{reference:g.anchor},middleware:[wJ({mainAxis:i+E,alignmentAxis:o}),l&&AJ({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?vJ():void 0,...B}),l&&xJ({...B}),kJ({...B,apply:({elements:ae,rects:te,availableWidth:j,availableHeight:q})=>{const{width:K,height:pe}=te.reference,P=ae.floating.style;P.setProperty("--radix-popper-available-width",`${j}px`),P.setProperty("--radix-popper-available-height",`${q}px`),P.setProperty("--radix-popper-anchor-width",`${K}px`),P.setProperty("--radix-popper-anchor-height",`${pe}px`)}}),A&&CJ({element:A,padding:a}),PJ({arrowWidth:S,arrowHeight:E}),d&&EJ({strategy:"referenceHidden",...B})]}),[ee,Ae]=pN($),Me=Po(p);tl(()=>{Y&&(Me==null||Me())},[Y,Me]);const Be=(Ve=ie.arrow)==null?void 0:Ve.x,_e=(me=ie.arrow)==null?void 0:me.y,Ee=((Ke=ie.arrow)==null?void 0:Ke.centerOffset)!==0,[Ue,H]=G.useState();return tl(()=>{b&&H(window.getComputedStyle(b).zIndex)},[b]),O.jsx("div",{ref:z.setFloating,"data-radix-popper-content-wrapper":"",style:{...F,transform:Y?F.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Ue,"--radix-popper-transform-origin":[(fe=ie.transformOrigin)==null?void 0:fe.x,(oe=ie.transformOrigin)==null?void 0:oe.y].join(" "),...((de=ie.hide)==null?void 0:de.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:O.jsx(MJ,{scope:n,placedSide:ee,onArrowChange:x,arrowX:Be,arrowY:_e,shouldHideArrow:Ee,children:O.jsx(sr.div,{"data-side":ee,"data-align":Ae,...m,ref:y,style:{...m.style,animation:Y?void 0:"none"}})})})});fN.displayName=jv;var dN="PopperArrow",NJ={top:"bottom",right:"left",bottom:"top",left:"right"},hN=G.forwardRef(function(e,n){const{__scopePopper:r,...i}=e,s=_J(dN,r),o=NJ[s.placedSide];return O.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:O.jsx(TJ,{...i,ref:n,style:{...i.style,display:"block"}})})});hN.displayName=dN;function RJ(t){return t!==null}var PJ=t=>({name:"transformOrigin",options:t,fn(e){var g,b,v;const{placement:n,rects:r,middlewareData:i}=e,o=((g=i.arrow)==null?void 0:g.centerOffset)!==0,a=o?0:t.arrowWidth,l=o?0:t.arrowHeight,[u,c]=pN(n),f={start:"0%",center:"50%",end:"100%"}[c],d=(((b=i.arrow)==null?void 0:b.x)??0)+a/2,h=(((v=i.arrow)==null?void 0:v.y)??0)+l/2;let p="",m="";return u==="bottom"?(p=o?f:`${d}px`,m=`${-l}px`):u==="top"?(p=o?f:`${d}px`,m=`${r.floating.height+l}px`):u==="right"?(p=`${-l}px`,m=o?f:`${h}px`):u==="left"&&(p=`${r.floating.width+l}px`,m=o?f:`${h}px`),{data:{x:p,y:m}}}});function pN(t){const[e,n="center"]=t.split("-");return[e,n]}var IJ=lN,mN=cN,LJ=fN,BJ=hN,Uv="Popover",[gN,pde]=fw(Uv,[oN]),wh=oN(),[FJ,Al]=gN(Uv),yN=t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:o=!1}=t,a=wh(e),l=G.useRef(null),[u,c]=G.useState(!1),[f=!1,d]=i3({prop:r,defaultProp:i,onChange:s});return O.jsx(IJ,{...a,children:O.jsx(FJ,{scope:e,contentId:_0(),triggerRef:l,open:f,onOpenChange:d,onOpenToggle:G.useCallback(()=>d(h=>!h),[d]),hasCustomAnchor:u,onCustomAnchorAdd:G.useCallback(()=>c(!0),[]),onCustomAnchorRemove:G.useCallback(()=>c(!1),[]),modal:o,children:n})})};yN.displayName=Uv;var bN="PopoverAnchor",jJ=G.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Al(bN,n),s=wh(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:a}=i;return G.useEffect(()=>(o(),()=>a()),[o,a]),O.jsx(mN,{...s,...r,ref:e})});jJ.displayName=bN;var wN="PopoverTrigger",AN=G.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Al(wN,n),s=wh(n),o=Gr(e,i.triggerRef),a=O.jsx(sr.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":CN(i.open),...r,ref:o,onClick:Cr(t.onClick,i.onOpenToggle)});return i.hasCustomAnchor?a:O.jsx(mN,{asChild:!0,...s,children:a})});AN.displayName=wN;var UJ="PopoverPortal",[mde,VJ]=gN(UJ,{forceMount:void 0}),gc="PopoverContent",vN=G.forwardRef((t,e)=>{const n=VJ(gc,t.__scopePopover),{forceMount:r=n.forceMount,...i}=t,s=Al(gc,t.__scopePopover);return O.jsx(Rd,{present:r||s.open,children:s.modal?O.jsx(HJ,{...i,ref:e}):O.jsx(zJ,{...i,ref:e})})});vN.displayName=gc;var HJ=G.forwardRef((t,e)=>{const n=Al(gc,t.__scopePopover),r=G.useRef(null),i=Gr(e,r),s=G.useRef(!1);return G.useEffect(()=>{const o=r.current;if(o)return M3(o)},[]),O.jsx(xw,{as:N0,allowPinchZoom:!0,children:O.jsx(xN,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Cr(t.onCloseAutoFocus,o=>{var a;o.preventDefault(),s.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Cr(t.onPointerDownOutside,o=>{const a=o.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,u=a.button===2||l;s.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:Cr(t.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),zJ=G.forwardRef((t,e)=>{const n=Al(gc,t.__scopePopover),r=G.useRef(!1),i=G.useRef(!1);return O.jsx(xN,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o,a;(o=t.onCloseAutoFocus)==null||o.call(t,s),s.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{var l,u;(l=t.onInteractOutside)==null||l.call(t,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=s.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),xN=G.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:o,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:c,...f}=t,d=Al(gc,n),h=wh(n);return m3(),O.jsx(Vu,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:O.jsx(pw,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:c,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>d.onOpenChange(!1),children:O.jsx(LJ,{"data-state":CN(d.open),role:"dialog",id:d.contentId,...h,...f,ref:e,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),kN="PopoverClose",EN=G.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Al(kN,n);return O.jsx(sr.button,{type:"button",...r,ref:e,onClick:Cr(t.onClick,()=>i.onOpenChange(!1))})});EN.displayName=kN;var $J="PopoverArrow",GJ=G.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=wh(n);return O.jsx(BJ,{...i,...r,ref:e})});GJ.displayName=$J;function CN(t){return t?"open":"closed"}var WJ=yN,KJ=AN,qJ=vN,Eg=EN;const Cg=({children:t,isActive:e,onClick:n,disabled:r,className:i})=>{const s=ve("flex items-center gap-2 p-1.5 text-xs font-medium text-neutral-500 text-left w-full rounded-md border border-transparent transition-all",!e&&!r,"hover:border-neutral-200 hover:bg-neutral-100",e&&!r&&"bg-neutral-200 text-neutral-800",r&&"text-neutral-300 cursor-not-allowed",i);return O.jsx("button",{className:s,disabled:r,onClick:n,children:t})},QJ=(t,e,n)=>{const r=N.useCallback(()=>{const a=t.chain();a.setNodeSelection(n).unsetAllMarks(),(e==null?void 0:e.type.name)!=="paragraph"&&a.setParagraph(),a.run()},[t,n,e==null?void 0:e.type.name]),i=N.useCallback(()=>{t.commands.setNodeSelection(n);const{$anchor:a}=t.state.selection,l=a.node(1)||t.state.selection.node;t.chain().setMeta("hideDragHandle",!0).insertContentAt(n+((e==null?void 0:e.nodeSize)||0),l.toJSON()).run()},[t,n,e==null?void 0:e.nodeSize]),s=N.useCallback(()=>{t.chain().setMeta("hideDragHandle",!0).setNodeSelection(n).run(),document.execCommand("copy"),alert("copied")},[t,n]),o=N.useCallback(()=>{t.chain().setMeta("hideDragHandle",!0).setNodeSelection(n).deleteSelection().run()},[t,n]);return{resetTextFormatting:r,duplicateNode:i,copyNodeToClipboard:s,deleteNode:o}},JJ=({node:t,getPos:e,editor:n,deleteNode:r})=>{const[i,s]=N.useState(!1),o=QJ(n,t,e()),a=X0(),l=["https://twitter.com","https://x.com"],u=N.useMemo(()=>{const{content:D}=t.content;return D[0].type.name==="table"},[t.content]),c=N.useMemo(()=>{var T;const{content:D}=t.content;return(T=D[0].content.content[0])==null?void 0:T.text},[t.content]),f=N.useMemo(()=>{var T;const{content:D}=t.content;return(T=D[0].content.content[1])==null?void 0:T.text},[t.content]),d=N.useMemo(()=>{const{content:D}=t.content;return D[0].content.content.find(T=>{var R;return(R=T==null?void 0:T.text)==null?void 0:R.match(/\/status\/([0-9]*)/)})},[t.content]),h=()=>{if(!c)return;let D=c;if(c.includes("<iframe"))D=f;else switch(!0){case/youtu\.?be(?:\.com)?\/(?:.*v(?:\/|=)|(?:.*\/)?)([a-zA-Z0-9-_]+)/.test(c):{const z=c.match(/youtu\.?be(?:\.com)?\/(?:.*v(?:\/|=)|(?:.*\/)?)([a-zA-Z0-9-_]+)/);z&&z.length>0&&(D=`https://www.youtube.com/embed/${z[1]}`);break}case/vimeo\.com\/([a-zA-Z0-9-_]+)/.test(c):{const z=c.match(/vimeo\.com\/([a-zA-Z0-9-_]+)/);z&&z.length>0&&(D=`https://player.vimeo.com/video/${z[1]}`);break}default:return}const T=640,R=360,L=e(),B=L+t.nodeSize;D&&(n==null||n.chain().focus(L).deleteRange({from:L===0?L:L+1,to:B}).setIframe({src:D,width:T,height:R}).run())},p=D=>{const T=D.match(/\/status\/([0-9]*)/);return T&&T.length>0?T[1]:null},m=()=>{if(!c)return;let D=c;const T=l.some(z=>c.includes(z)),R=p(c);T&&R?D=R:d&&(D=p(d.text));const L=e(),B=L+t.nodeSize;D&&(n==null||n.chain().focus(L).deleteRange({from:L===2?L:L+1,to:B}).setTweetEmbed({tweetId:D}).run())},g=()=>{const D=e()+t.nodeSize;n.commands.insertContentAt(D,{type:"dBlock",content:[{type:"paragraph"}]})},b=()=>{const D=e();n.commands.insertContentAt(D,{type:"dBlock",content:[{type:"paragraph"}]})},v=()=>{r()},y=D=>{D.altKey?x():A()},A=()=>{g()},x=()=>{b()},k=D=>{D.altKey&&v()},E=j_(()=>{if(l.some(D=>c.includes(D))||d!=null&&d.text){m();return}else{h();return}},1e3);return N.useEffect(()=>{c&&E()},[c]),O.jsxs(Dd,{as:"div",className:ve("flex gap-2 group w-full relative justify-center items-start",a&&"pointer-events-none",u&&"pointer-events-auto"),children:[O.jsxs("section",{className:"lg:flex gap-1 hidden","aria-label":"left-menu",contentEditable:!1,children:[O.jsx(GO,{content:O.jsxs("div",{className:"flex flex-col w-40",children:[O.jsx("div",{className:"text-xs",children:"Click to add below"}),O.jsx("div",{className:"text-xs",children:"Opt + Click to add above"})]}),children:O.jsx("div",{className:`d-block-button cursor-pointer ${!a&&"group-hover:opacity-100"}`,contentEditable:!1,onClick:y,children:O.jsx(aV,{size:18})})}),O.jsx(Vu,{onMountAutoFocus:D=>D.preventDefault(),trapped:!1,children:O.jsxs(WJ,{open:i,onOpenChange:s,children:[O.jsx(KJ,{asChild:!0,children:O.jsx("div",{className:`d-block-button cursor-pointer ${!a&&"group-hover:opacity-100"}`,contentEditable:!1,draggable:!0,"data-drag-handle":!0,onClick:k,children:O.jsx(eV,{size:18})})}),O.jsx(qJ,{side:"bottom",align:"start",sideOffset:8,className:"z-10",children:O.jsxs(Jw,{className:"p-2 flex flex-col min-w-[16rem]",children:[O.jsx(Eg,{children:O.jsxs(Cg,{onClick:o.resetTextFormatting,children:[O.jsx(uV,{size:18}),"Clear formatting"]})}),O.jsx(Eg,{children:O.jsxs(Cg,{onClick:o.copyNodeToClipboard,children:[O.jsx(JU,{size:18}),"Copy to clipboard"]})}),O.jsx(Eg,{children:O.jsxs(Cg,{onClick:o.duplicateNode,children:[O.jsx(XU,{size:18}),"Duplicate"]})}),O.jsx(Wu.Divider,{horizontal:!0}),O.jsx(Eg,{children:O.jsxs(Cg,{onClick:o.deleteNode,className:"text-red-500 hover:bg-red-500 bg-opacity-10 hover:bg-opacity-20",children:[O.jsx(aw,{size:18}),"Delete"]})})]})})]})})]}),O.jsx(WT,{className:ve("node-view-content w-full",{"is-table":u})})]})},YJ=Xe.create({name:"dBlock",priority:1e3,group:"dBlock",content:"(block|columns)",draggable:!0,selectable:!1,inline:!1,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:'div[data-type="d-block"]'}]},renderHTML({HTMLAttributes:t}){return["div",rt(t,{"data-type":"d-block"}),0]},addCommands(){return{setDBlock:t=>({state:e,chain:n})=>{const{selection:{from:r}}=e,i=t!==void 0||t!==null?r:t;return n().insertContentAt(i,{type:this.name,content:[{type:"paragraph"}]}).focus(i+2).run()}}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setDBlock(),Enter:({editor:t})=>{var u;const{selection:{$head:e,from:n,to:r},doc:i}=t.state,s=e.node(e.depth-1);if((s==null?void 0:s.type.name)!=="dBlock"){const f=e.toString().split("/"),d=f.some(y=>y.includes("bulletList_0")||y.includes("orderedList_0")||y.includes("taskList_0")),h=f.some(y=>y.includes("paragraph_0:0")),p=e.parent.content.size===0,m=f.length===4&&h,g=f.some(y=>y.includes("paragraph_0:0"))&&f.length!==4,b=e.parent.content.size===0&&f.some(y=>y.includes("listItem_0")),v=f.some(y=>y.includes("paragraph_1:0"));if(m)return t.chain().liftListItem("listItem").focus().run();if(v)return t.chain().insertContent({type:"dBlock",content:[{type:"paragraph"}]}).focus().run();if(g&&d||b)return t.chain().liftListItem("listItem").focus().run();if(p&&d){const y=e.before(e.depth-1);return t.chain().deleteRange({from:y,to:y+s.nodeSize}).insertContentAt(n,{type:"dBlock",content:[{type:"paragraph"}]}).focus().run()}return!1}let o=-1,a="";i.descendants((c,f)=>{if(o!==-1)return!1;if(c.type.name===this.name)return;const[d,h]=[f,f+c.nodeSize];return d<=n&&r<=h&&(o=h,a=c.type.name),!1});const l=(u=i.slice(n,o))==null?void 0:u.toJSON().content;try{return a==="codeBlock"?t.chain().newlineInCode().focus().run():["columns","heading"].includes(a)?t.chain().insertContent({type:"dBlock",content:[{type:"paragraph"}]}).focus().run():t.chain().insertContentAt({from:n,to:o},{type:this.name,content:l}).focus().run()}catch(c){return console.error(`Error inserting content into dBlock node: ${c}`),!1}},Backspace:({editor:t})=>{var l;const{selection:{$head:e,from:n}}=t.state,r=e.node(e.depth-1),s=e.toString().split("/"),o=s.some(u=>u.includes("bulletList_0")||u.includes("orderedList_0")||u.includes("taskList_0"));if((r==null?void 0:r.type.name)!=="dBlock"){const c=s.some(g=>g.includes("listItem_0")||g.includes("taskItem_0"))&&s.some(g=>g.includes("paragraph_0:0")),d=s.some(g=>g.includes("dBlock_0"))&&c&&o,h=()=>e.node(e.depth-1).textContent,p=e.parent.content.size===0&&s.some(g=>g.includes("paragraph_0:0"))&&s.some(g=>g.includes("listItem_0")||g.includes("taskItem_0"))&&o&&s.length===4,m=e.node(e.depth-2).childCount>1;if(p){const g=e.before(e.depth-2);return m?t.chain().deleteRange({from:g+1,to:g+1+r.nodeSize}).insertContentAt(n-4,{type:"dBlock",content:[{type:"paragraph",content:[{type:"text",text:""}]}]}).focus().run():t.chain().liftListItem("listItem").focus().run()}if(d&&s.length===4){const g=e.node(e.depth-2),b=e.before(e.depth-2);return t.chain().deleteRange({from:b+1,to:b+1+(((l=g.firstChild)==null?void 0:l.nodeSize)||0)}).insertContentAt(n-4,{type:"dBlock",content:[{type:"paragraph",content:[{type:"text",text:h()}]}]}).focus("start").run()}}return e.toString().includes("dBlock_0")&&e.parent.content.size===0&&!o?t.chain().deleteNode("dBlock").focus().run():!1}}},addNodeView(){return el(JJ)}});let Vv,Hv;if(typeof WeakMap<"u"){let t=new WeakMap;Vv=e=>t.get(e),Hv=(e,n)=>(t.set(e,n),n)}else{let t=[],e=10,n=0;Vv=r=>{for(let i=0;i<t.length;i+=2)if(t[i]==r)return t[i+1]},Hv=(r,i)=>(n==e&&(n=0),t[n++]=r,t[n++]=i)}class yc{constructor(e,n,r,i){this.left=e,this.top=n,this.right=r,this.bottom=i}}class Vt{constructor(e,n,r,i){this.width=e,this.height=n,this.map=r,this.problems=i}findCell(e){for(let n=0;n<this.map.length;n++){let r=this.map[n];if(r!=e)continue;let i=n%this.width,s=n/this.width|0,o=i+1,a=s+1;for(let l=1;o<this.width&&this.map[n+l]==r;l++)o++;for(let l=1;a<this.height&&this.map[n+this.width*l]==r;l++)a++;return new yc(i,s,o,a)}throw new RangeError("No cell with offset "+e+" found")}colCount(e){for(let n=0;n<this.map.length;n++)if(this.map[n]==e)return n%this.width;throw new RangeError("No cell with offset "+e+" found")}nextCell(e,n,r){let{left:i,right:s,top:o,bottom:a}=this.findCell(e);return n=="horiz"?(r<0?i==0:s==this.width)?null:this.map[o*this.width+(r<0?i-1:s)]:(r<0?o==0:a==this.height)?null:this.map[i+this.width*(r<0?o-1:a)]}rectBetween(e,n){let{left:r,right:i,top:s,bottom:o}=this.findCell(e),{left:a,right:l,top:u,bottom:c}=this.findCell(n);return new yc(Math.min(r,a),Math.min(s,u),Math.max(i,l),Math.max(o,c))}cellsInRect(e){let n=[],r={};for(let i=e.top;i<e.bottom;i++)for(let s=e.left;s<e.right;s++){let o=i*this.width+s,a=this.map[o];r[a]||(r[a]=!0,(s!=e.left||!s||this.map[o-1]!=a)&&(i!=e.top||!i||this.map[o-this.width]!=a)&&n.push(a))}return n}positionAt(e,n,r){for(let i=0,s=0;;i++){let o=s+r.child(i).nodeSize;if(i==e){let a=n+e*this.width,l=(e+1)*this.width;for(;a<l&&this.map[a]<s;)a++;return a==l?o-1:this.map[a]}s=o}}static get(e){return Vv(e)||Hv(e,XJ(e))}}function XJ(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);let e=ZJ(t),n=t.childCount,r=[],i=0,s=null,o=[];for(let u=0,c=e*n;u<c;u++)r[u]=0;for(let u=0,c=0;u<n;u++){let f=t.child(u);c++;for(let p=0;;p++){for(;i<r.length&&r[i]!=0;)i++;if(p==f.childCount)break;let m=f.child(p),{colspan:g,rowspan:b,colwidth:v}=m.attrs;for(let y=0;y<b;y++){if(y+u>=n){(s||(s=[])).push({type:"overlong_rowspan",pos:c,n:b-y});break}let A=i+y*e;for(let x=0;x<g;x++){r[A+x]==0?r[A+x]=c:(s||(s=[])).push({type:"collision",row:u,pos:c,n:g-x});let k=v&&v[x];if(k){let S=(A+x)%e*2,E=o[S];E==null||E!=k&&o[S+1]==1?(o[S]=k,o[S+1]=1):E==k&&o[S+1]++}}}i+=g,c+=m.nodeSize}let d=(u+1)*e,h=0;for(;i<d;)r[i++]==0&&h++;h&&(s||(s=[])).push({type:"missing",row:u,n:h}),c++}let a=new Vt(e,n,r,s),l=!1;for(let u=0;!l&&u<o.length;u+=2)o[u]!=null&&o[u+1]<n&&(l=!0);return l&&eY(a,o,t),a}function ZJ(t){let e=-1,n=!1;for(let r=0;r<t.childCount;r++){let i=t.child(r),s=0;if(n)for(let o=0;o<r;o++){let a=t.child(o);for(let l=0;l<a.childCount;l++){let u=a.child(l);o+u.attrs.rowspan>r&&(s+=u.attrs.colspan)}}for(let o=0;o<i.childCount;o++){let a=i.child(o);s+=a.attrs.colspan,a.attrs.rowspan>1&&(n=!0)}e==-1?e=s:e!=s&&(e=Math.max(e,s))}return e}function eY(t,e,n){t.problems||(t.problems=[]);for(let r=0,i={};r<t.map.length;r++){let s=t.map[r];if(i[s])continue;i[s]=!0;let o=n.nodeAt(s),a=null;for(let l=0;l<o.attrs.colspan;l++){let u=(r+l)%t.width,c=e[u*2];c!=null&&(!o.attrs.colwidth||o.attrs.colwidth[l]!=c)&&((a||(a=tY(o.attrs)))[l]=c)}a&&t.problems.unshift({type:"colwidth mismatch",pos:s,colwidth:a})}}function tY(t){if(t.colwidth)return t.colwidth.slice();let e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}function Nn(t){let e=t.cached.tableNodeTypes;if(!e){e=t.cached.tableNodeTypes={};for(let n in t.nodes){let r=t.nodes[n],i=r.spec.tableRole;i&&(e[i]=r)}}return e}const qo=new Mt("selectingCells");function bc(t){for(let e=t.depth-1;e>0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}function nY(t){for(let e=t.depth;e>0;e--){const n=t.node(e).type.spec.tableRole;if(n==="cell"||n==="header_cell")return t.node(e)}return null}function vi(t){let e=t.selection.$head;for(let n=e.depth;n>0;n--)if(e.node(n).type.spec.tableRole=="row")return!0;return!1}function Sg(t){let e=t.selection;return e.$anchorCell?e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell:e.node&&e.node.type.spec.tableRole=="cell"?e.$anchor:bc(e.$head)||rY(e.$head)}function rY(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){let r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){let r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n-e.nodeSize)}}function zv(t){return t.parent.type.spec.tableRole=="row"&&t.nodeAfter}function iY(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function $v(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function SN(t,e,n){let r=t.start(-1),s=Vt.get(t.node(-1)).nextCell(t.pos-r,e,n);return s==null?null:t.node(0).resolve(r+s)}function hn(t,e,n){let r={};for(let i in t)r[i]=t[i];return r[e]=n,r}function vl(t,e,n=1){let r=hn(t,"colspan",t.colspan-n);return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some(i=>i>0)||(r.colwidth=null)),r}function TN(t,e,n=1){let r=hn(t,"colspan",t.colspan+n);if(r.colwidth){r.colwidth=r.colwidth.slice();for(let i=0;i<n;i++)r.colwidth.splice(e,0,0)}return r}function sY(t,e,n){let r=Nn(e.type.schema).header_cell;for(let i=0;i<t.height;i++)if(e.nodeAt(t.map[n+i*t.width]).type!=r)return!1;return!0}class at extends He{constructor(e,n=e){let r=e.node(-1),i=Vt.get(r),s=e.start(-1),o=i.rectBetween(e.pos-s,n.pos-s),a=e.node(0),l=i.cellsInRect(o).filter(c=>c!=n.pos-s);l.unshift(n.pos-s);let u=l.map(c=>{let f=r.nodeAt(c),d=c+s+1;return new Pb(a.resolve(d),a.resolve(d+f.content.size))});super(u[0].$from,u[0].$to,u),this.$anchorCell=e,this.$headCell=n}map(e,n){let r=e.resolve(n.map(this.$anchorCell.pos)),i=e.resolve(n.map(this.$headCell.pos));if(zv(r)&&zv(i)&&$v(r,i)){let s=this.$anchorCell.node(-1)!=r.node(-1);return s&&this.isRowSelection()?at.rowSelection(r,i):s&&this.isColSelection()?at.colSelection(r,i):new at(r,i)}return Fe.between(r,i)}content(){let e=this.$anchorCell.node(-1),n=Vt.get(e),r=this.$anchorCell.start(-1),i=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),s={},o=[];for(let l=i.top;l<i.bottom;l++){let u=[];for(let c=l*n.width+i.left,f=i.left;f<i.right;f++,c++){let d=n.map[c];if(!s[d]){s[d]=!0;let h=n.findCell(d),p=e.nodeAt(d),m=i.left-h.left,g=h.right-i.right;if(m>0||g>0){let b=p.attrs;m>0&&(b=vl(b,0,m)),g>0&&(b=vl(b,b.colspan-g,g)),h.left<i.left?p=p.type.createAndFill(b):p=p.type.create(b,p.content)}if(h.top<i.top||h.bottom>i.bottom){let b=hn(p.attrs,"rowspan",Math.min(h.bottom,i.bottom)-Math.max(h.top,i.top));h.top<i.top?p=p.type.createAndFill(b):p=p.type.create(b,p.content)}u.push(p)}}o.push(e.child(l).copy(le.from(u)))}const a=this.isColSelection()&&this.isRowSelection()?e:o;return new ge(le.from(a),1,1)}replace(e,n=ge.empty){let r=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:a,$to:l}=i[o],u=e.mapping.slice(r);e.replace(u.map(a.pos),u.map(l.pos),o?ge.empty:n)}let s=He.findFrom(e.doc.resolve(e.mapping.slice(r).map(this.to)),-1);s&&e.setSelection(s)}replaceWith(e,n){this.replace(e,new ge(le.from(n),0,0))}forEachCell(e){let n=this.$anchorCell.node(-1),r=Vt.get(n),i=this.$anchorCell.start(-1),s=r.cellsInRect(r.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i));for(let o=0;o<s.length;o++)e(n.nodeAt(s[o]),i+s[o])}isColSelection(){let e=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(e,n)>0)return!1;let r=e+this.$anchorCell.nodeAfter.attrs.rowspan,i=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,i)==this.$headCell.node(-1).childCount}static colSelection(e,n=e){let r=Vt.get(e.node(-1)),i=e.start(-1),s=r.findCell(e.pos-i),o=r.findCell(n.pos-i),a=e.node(0);return s.top<=o.top?(s.top>0&&(e=a.resolve(i+r.map[s.left])),o.bottom<r.height&&(n=a.resolve(i+r.map[r.width*(r.height-1)+o.right-1]))):(o.top>0&&(n=a.resolve(i+r.map[o.left])),s.bottom<r.height&&(e=a.resolve(i+r.map[r.width*(r.height-1)+s.right-1]))),new at(e,n)}isRowSelection(){let e=Vt.get(this.$anchorCell.node(-1)),n=this.$anchorCell.start(-1),r=e.colCount(this.$anchorCell.pos-n),i=e.colCount(this.$headCell.pos-n);if(Math.min(r,i)>0)return!1;let s=r+this.$anchorCell.nodeAfter.attrs.colspan,o=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(s,o)==e.width}eq(e){return e instanceof at&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){let r=Vt.get(e.node(-1)),i=e.start(-1),s=r.findCell(e.pos-i),o=r.findCell(n.pos-i),a=e.node(0);return s.left<=o.left?(s.left>0&&(e=a.resolve(i+r.map[s.top*r.width])),o.right<r.width&&(n=a.resolve(i+r.map[r.width*(o.top+1)-1]))):(o.left>0&&(n=a.resolve(i+r.map[o.top*r.width])),s.right<r.width&&(e=a.resolve(i+r.map[r.width*(s.top+1)-1]))),new at(e,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,n){return new at(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){return new at(e.resolve(n),e.resolve(r))}getBookmark(){return new Gv(this.$anchorCell.pos,this.$headCell.pos)}}at.prototype.visible=!1,He.jsonID("cell",at);class Gv{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Gv(e.map(this.anchor),e.map(this.head))}resolve(e){let n=e.resolve(this.anchor),r=e.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&r.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&r.index()<r.parent.childCount&&$v(n,r)?new at(n,r):He.near(r,1)}}function oY(t){if(!(t.selection instanceof at))return null;let e=[];return t.selection.forEachCell((n,r)=>{e.push(nn.node(r,r+n.nodeSize,{class:"selectedCell"}))}),kt.create(t.doc,e)}function aY({$from:t,$to:e}){if(t.pos==e.pos||t.pos<t.pos-6)return!1;let n=t.pos,r=e.pos,i=t.depth;for(;i>=0&&!(t.after(i+1)<t.end(i));i--,n++);for(let s=e.depth;s>=0&&!(e.before(s+1)>e.start(s));s--,r--);return n==r&&/row|table/.test(t.node(i).type.spec.tableRole)}function lY({$from:t,$to:e}){let n,r;for(let i=t.depth;i>0;i--){let s=t.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){n=s;break}}for(let i=e.depth;i>0;i--){let s=e.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){r=s;break}}return n!==r&&e.parentOffset===0}function uY(t,e,n){let r=(e||t).selection,i=(e||t).doc,s,o;if(r instanceof Pe&&(o=r.node.type.spec.tableRole)){if(o=="cell"||o=="header_cell")s=at.create(i,r.from);else if(o=="row"){let a=i.resolve(r.from+1);s=at.rowSelection(a,a)}else if(!n){let a=Vt.get(r.node),l=r.from+1,u=l+a.map[a.width*a.height-1];s=at.create(i,l+1,u)}}else r instanceof Fe&&aY(r)?s=Fe.create(i,r.from):r instanceof Fe&&lY(r)&&(s=Fe.create(i,r.$from.start(),r.$from.end()));return s&&(e||(e=t.tr)).setSelection(s),e}function cY(t){if(!t.size)return null;let{content:e,openStart:n,openEnd:r}=t;for(;e.childCount==1&&(n>0&&r>0||e.firstChild.type.spec.tableRole=="table");)n--,r--,e=e.firstChild.content;let i=e.firstChild,s=i.type.spec.tableRole,o=i.type.schema,a=[];if(s=="row")for(let l=0;l<e.childCount;l++){let u=e.child(l).content,c=l?0:Math.max(0,n-1),f=l<e.childCount-1?0:Math.max(0,r-1);(c||f)&&(u=Wv(Nn(o).row,new ge(u,c,f)).content),a.push(u)}else if(s=="cell"||s=="header_cell")a.push(n||r?Wv(Nn(o).row,new ge(e,n,r)).content:e);else return null;return fY(o,a)}function fY(t,e){let n=[];for(let i=0;i<e.length;i++){let s=e[i];for(let o=s.childCount-1;o>=0;o--){let{rowspan:a,colspan:l}=s.child(o).attrs;for(let u=i;u<i+a;u++)n[u]=(n[u]||0)+l}}let r=0;for(let i=0;i<n.length;i++)r=Math.max(r,n[i]);for(let i=0;i<n.length;i++)if(i>=e.length&&e.push(le.empty),n[i]<r){let s=Nn(t).cell.createAndFill(),o=[];for(let a=n[i];a<r;a++)o.push(s);e[i]=e[i].append(le.from(o))}return{height:e.length,width:r,rows:e}}function Wv(t,e){let n=t.createAndFill();return new Nb(n).replace(0,n.content.size,e).doc}function dY({width:t,height:e,rows:n},r,i){if(t!=r){let s=[],o=[];for(let a=0;a<n.length;a++){let l=n[a],u=[];for(let c=s[a]||0,f=0;c<r;f++){let d=l.child(f%l.childCount);c+d.attrs.colspan>r&&(d=d.type.create(vl(d.attrs,d.attrs.colspan,c+d.attrs.colspan-r),d.content)),u.push(d),c+=d.attrs.colspan;for(let h=1;h<d.attrs.rowspan;h++)s[a+h]=(s[a+h]||0)+d.attrs.colspan}o.push(le.from(u))}n=o,t=r}if(e!=i){let s=[];for(let o=0,a=0;o<i;o++,a++){let l=[],u=n[a%e];for(let c=0;c<u.childCount;c++){let f=u.child(c);o+f.attrs.rowspan>i&&(f=f.type.create(hn(f.attrs,"rowspan",Math.max(1,i-f.attrs.rowspan)),f.content)),l.push(f)}s.push(le.from(l))}n=s,e=i}return{width:t,height:e,rows:n}}function hY(t,e,n,r,i,s,o){let a=t.doc.type.schema,l=Nn(a),u,c;if(i>e.width)for(let f=0,d=0;f<e.height;f++){let h=n.child(f);d+=h.nodeSize;let p=[],m;h.lastChild==null||h.lastChild.type==l.cell?m=u||(u=l.cell.createAndFill()):m=c||(c=l.header_cell.createAndFill());for(let g=e.width;g<i;g++)p.push(m);t.insert(t.mapping.slice(o).map(d-1+r),p)}if(s>e.height){let f=[];for(let p=0,m=(e.height-1)*e.width;p<Math.max(e.width,i);p++){let g=p>=e.width?!1:n.nodeAt(e.map[m+p]).type==l.header_cell;f.push(g?c||(c=l.header_cell.createAndFill()):u||(u=l.cell.createAndFill()))}let d=l.row.create(null,le.from(f)),h=[];for(let p=e.height;p<s;p++)h.push(d);t.insert(t.mapping.slice(o).map(r+n.nodeSize-2),h)}return!!(u||c)}function ON(t,e,n,r,i,s,o,a){if(o==0||o==e.height)return!1;let l=!1;for(let u=i;u<s;u++){let c=o*e.width+u,f=e.map[c];if(e.map[c-e.width]==f){l=!0;let d=n.nodeAt(f),{top:h,left:p}=e.findCell(f);t.setNodeMarkup(t.mapping.slice(a).map(f+r),null,hn(d.attrs,"rowspan",o-h)),t.insert(t.mapping.slice(a).map(e.positionAt(o,p,n)),d.type.createAndFill(hn(d.attrs,"rowspan",h+d.attrs.rowspan-o))),u+=d.attrs.colspan-1}}return l}function DN(t,e,n,r,i,s,o,a){if(o==0||o==e.width)return!1;let l=!1;for(let u=i;u<s;u++){let c=u*e.width+o,f=e.map[c];if(e.map[c-1]==f){l=!0;let d=n.nodeAt(f),h=e.colCount(f),p=t.mapping.slice(a).map(f+r);t.setNodeMarkup(p,null,vl(d.attrs,o-h,d.attrs.colspan-(o-h))),t.insert(p+d.nodeSize,d.type.createAndFill(vl(d.attrs,0,o-h))),u+=d.attrs.rowspan-1}}return l}function MN(t,e,n,r,i){let s=n?t.doc.nodeAt(n-1):t.doc,o=Vt.get(s),{top:a,left:l}=r,u=l+i.width,c=a+i.height,f=t.tr,d=0;function h(){s=n?f.doc.nodeAt(n-1):f.doc,o=Vt.get(s),d=f.mapping.maps.length}hY(f,o,s,n,u,c,d)&&h(),ON(f,o,s,n,l,u,a,d)&&h(),ON(f,o,s,n,l,u,c,d)&&h(),DN(f,o,s,n,a,c,l,d)&&h(),DN(f,o,s,n,a,c,u,d)&&h();for(let p=a;p<c;p++){let m=o.positionAt(p,l,s),g=o.positionAt(p,u,s);f.replace(f.mapping.slice(d).map(m+n),f.mapping.slice(d).map(g+n),new ge(i.rows[p-a],0,0))}h(),f.setSelection(new at(f.doc.resolve(n+o.positionAt(a,l,s)),f.doc.resolve(n+o.positionAt(c-1,u-1,s)))),e(f)}const pY=u1({ArrowLeft:Og("horiz",-1),ArrowRight:Og("horiz",1),ArrowUp:Og("vert",-1),ArrowDown:Og("vert",1),"Shift-ArrowLeft":Dg("horiz",-1),"Shift-ArrowRight":Dg("horiz",1),"Shift-ArrowUp":Dg("vert",-1),"Shift-ArrowDown":Dg("vert",1),Backspace:Mg,"Mod-Backspace":Mg,Delete:Mg,"Mod-Delete":Mg});function Tg(t,e,n){return n.eq(t.selection)?!1:(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function Og(t,e){return(n,r,i)=>{let s=n.selection;if(s instanceof at)return Tg(n,r,He.near(s.$headCell,e));if(t!="horiz"&&!s.empty)return!1;let o=_N(i,t,e);if(o==null)return!1;if(t=="horiz")return Tg(n,r,He.near(n.doc.resolve(s.head+e),e));{let a=n.doc.resolve(o),l=SN(a,t,e),u;return l?u=He.near(l,1):e<0?u=He.near(n.doc.resolve(a.before(-1)),-1):u=He.near(n.doc.resolve(a.after(-1)),1),Tg(n,r,u)}}}function Dg(t,e){return(n,r,i)=>{let s=n.selection;if(!(s instanceof at)){let a=_N(i,t,e);if(a==null)return!1;s=new at(n.doc.resolve(a))}let o=SN(s.$headCell,t,e);return o?Tg(n,r,new at(s.$anchorCell,o)):!1}}function Mg(t,e){let n=t.selection;if(!(n instanceof at))return!1;if(e){let r=t.tr,i=Nn(t.schema).cell.createAndFill().content;n.forEachCell((s,o)=>{s.content.eq(i)||r.replace(r.mapping.map(o+1),r.mapping.map(o+s.nodeSize-1),new ge(i,0,0))}),r.docChanged&&e(r)}return!0}function mY(t,e){let n=t.state.doc,r=bc(n.resolve(e));return r?(t.dispatch(t.state.tr.setSelection(new at(r))),!0):!1}function gY(t,e,n){if(!vi(t.state))return!1;let r=cY(n),i=t.state.selection;if(i instanceof at){r||(r={width:1,height:1,rows:[le.from(Wv(Nn(t.state.schema).cell,n))]});let s=i.$anchorCell.node(-1),o=i.$anchorCell.start(-1),a=Vt.get(s).rectBetween(i.$anchorCell.pos-o,i.$headCell.pos-o);return r=dY(r,a.right-a.left,a.bottom-a.top),MN(t.state,t.dispatch,o,a,r),!0}else if(r){let s=Sg(t.state),o=s.start(-1);return MN(t.state,t.dispatch,o,Vt.get(s.node(-1)).findCell(s.pos-o),r),!0}else return!1}function yY(t,e){if(e.ctrlKey||e.metaKey)return;let n=NN(t,e.target),r;if(e.shiftKey&&t.state.selection instanceof at)i(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&n&&(r=bc(t.state.selection.$anchor))!=null&&Kv(t,e).pos!=r.pos)i(r,e),e.preventDefault();else if(!n)return;function i(a,l){let u=Kv(t,l),c=qo.getState(t.state)==null;if(!u||!$v(a,u))if(c)u=a;else return;let f=new at(a,u);if(c||!t.state.selection.eq(f)){let d=t.state.tr.setSelection(f);c&&d.setMeta(qo,a.pos),t.dispatch(d)}}function s(){t.root.removeEventListener("mouseup",s),t.root.removeEventListener("dragstart",s),t.root.removeEventListener("mousemove",o),qo.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(qo,-1))}function o(a){let l=qo.getState(t.state),u;if(l!=null)u=t.state.doc.resolve(l);else if(NN(t,a.target)!=n&&(u=Kv(t,e),!u))return s();u&&i(u,a)}t.root.addEventListener("mouseup",s),t.root.addEventListener("dragstart",s),t.root.addEventListener("mousemove",o)}function _N(t,e,n){if(!(t.state.selection instanceof Fe))return null;let{$head:r}=t.state.selection;for(let i=r.depth-1;i>=0;i--){let s=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:s.childCount))return null;if(s.type.spec.tableRole=="cell"||s.type.spec.tableRole=="header_cell"){let a=r.before(i),l=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(l)?a:null}}return null}function NN(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e}function Kv(t,e){let n=t.posAtCoords({left:e.clientX,top:e.clientY});return n&&n?bc(t.state.doc.resolve(n.pos)):null}const bY=new Mt("fix-tables");function RN(t,e,n,r){let i=t.childCount,s=e.childCount;e:for(let o=0,a=0;o<s;o++){let l=e.child(o);for(let u=a,c=Math.min(i,o+3);u<c;u++)if(t.child(u)==l){a=u+1,n+=l.nodeSize;continue e}r(l,n),a<i&&t.child(a).sameMarkup(l)?RN(t.child(a),l,n+1,r):l.nodesBetween(0,l.content.size,r,n+1),n+=l.nodeSize}}function PN(t,e){let n,r=(i,s)=>{i.type.spec.tableRole=="table"&&(n=wY(t,i,s,n))};return e?e.doc!=t.doc&&RN(e.doc,t.doc,0,r):t.doc.descendants(r),n}function wY(t,e,n,r){let i=Vt.get(e);if(!i.problems)return r;r||(r=t.tr);let s=[];for(let l=0;l<i.height;l++)s.push(0);for(let l=0;l<i.problems.length;l++){let u=i.problems[l];if(u.type=="collision"){let c=e.nodeAt(u.pos);for(let f=0;f<c.attrs.rowspan;f++)s[u.row+f]+=u.n;r.setNodeMarkup(r.mapping.map(n+1+u.pos),null,vl(c.attrs,c.attrs.colspan-u.n,u.n))}else if(u.type=="missing")s[u.row]+=u.n;else if(u.type=="overlong_rowspan"){let c=e.nodeAt(u.pos);r.setNodeMarkup(r.mapping.map(n+1+u.pos),null,hn(c.attrs,"rowspan",c.attrs.rowspan-u.n))}else if(u.type=="colwidth mismatch"){let c=e.nodeAt(u.pos);r.setNodeMarkup(r.mapping.map(n+1+u.pos),null,hn(c.attrs,"colwidth",u.colwidth))}}let o,a;for(let l=0;l<s.length;l++)s[l]&&(o==null&&(o=l),a=l);for(let l=0,u=n+1;l<i.height;l++){let c=e.child(l),f=u+c.nodeSize,d=s[l];if(d>0){let h="cell";c.firstChild&&(h=c.firstChild.type.spec.tableRole);let p=[];for(let g=0;g<d;g++)p.push(Nn(t.schema)[h].createAndFill());let m=(l==0||o==l-1)&&a==l?u+1:f-1;r.insert(r.mapping.map(m),p)}u=f}return r.setMeta(bY,{fixTables:!0})}function ns(t){let e=t.selection,n=Sg(t),r=n.node(-1),i=n.start(-1),s=Vt.get(r),o;return e instanceof at?o=s.rectBetween(e.$anchorCell.pos-i,e.$headCell.pos-i):o=s.findCell(n.pos-i),o.tableStart=i,o.map=s,o.table=r,o}function IN(t,{map:e,tableStart:n,table:r},i){let s=i>0?-1:0;sY(e,r,i+s)&&(s=i==0||i==e.width?null:0);for(let o=0;o<e.height;o++){let a=o*e.width+i;if(i>0&&i<e.width&&e.map[a-1]==e.map[a]){let l=e.map[a],u=r.nodeAt(l);t.setNodeMarkup(t.mapping.map(n+l),null,TN(u.attrs,i-e.colCount(l))),o+=u.attrs.rowspan-1}else{let l=s==null?Nn(r.type.schema).cell:r.nodeAt(e.map[a+s]).type,u=e.positionAt(o,i,r);t.insert(t.mapping.map(n+u),l.createAndFill())}}return t}function AY(t,e){if(!vi(t))return!1;if(e){let n=ns(t);e(IN(t.tr,n,n.left))}return!0}function vY(t,e){if(!vi(t))return!1;if(e){let n=ns(t);e(IN(t.tr,n,n.right))}return!0}function xY(t,{map:e,table:n,tableStart:r},i){let s=t.mapping.maps.length;for(let o=0;o<e.height;){let a=o*e.width+i,l=e.map[a],u=n.nodeAt(l);if(i>0&&e.map[a-1]==l||i<e.width-1&&e.map[a+1]==l)t.setNodeMarkup(t.mapping.slice(s).map(r+l),null,vl(u.attrs,i-e.colCount(l)));else{let c=t.mapping.slice(s).map(r+l);t.delete(c,c+u.nodeSize)}o+=u.attrs.rowspan}}function kY(t,e){if(!vi(t))return!1;if(e){let n=ns(t),r=t.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let i=n.right-1;xY(r,n,i),i!=n.left;i--)n.table=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc,n.map=Vt.get(n.table);e(r)}return!0}function EY(t,e,n){let r=Nn(e.type.schema).header_cell;for(let i=0;i<t.width;i++)if(e.nodeAt(t.map[i+n*t.width]).type!=r)return!1;return!0}function LN(t,{map:e,tableStart:n,table:r},i){let s=n;for(let l=0;l<i;l++)s+=r.child(l).nodeSize;let o=[],a=i>0?-1:0;EY(e,r,i+a)&&(a=i==0||i==e.height?null:0);for(let l=0,u=e.width*i;l<e.width;l++,u++)if(i>0&&i<e.height&&e.map[u]==e.map[u-e.width]){let c=e.map[u],f=r.nodeAt(c).attrs;t.setNodeMarkup(n+c,null,hn(f,"rowspan",f.rowspan+1)),l+=f.colspan-1}else{let c=a==null?Nn(r.type.schema).cell:r.nodeAt(e.map[u+a*e.width]).type;o.push(c.createAndFill())}return t.insert(s,Nn(r.type.schema).row.create(null,o)),t}function CY(t,e){if(!vi(t))return!1;if(e){let n=ns(t);e(LN(t.tr,n,n.top))}return!0}function SY(t,e){if(!vi(t))return!1;if(e){let n=ns(t);e(LN(t.tr,n,n.bottom))}return!0}function TY(t,{map:e,table:n,tableStart:r},i){let s=0;for(let l=0;l<i;l++)s+=n.child(l).nodeSize;let o=s+n.child(i).nodeSize,a=t.mapping.maps.length;t.delete(s+r,o+r);for(let l=0,u=i*e.width;l<e.width;l++,u++){let c=e.map[u];if(i>0&&c==e.map[u-e.width]){let f=n.nodeAt(c).attrs;t.setNodeMarkup(t.mapping.slice(a).map(c+r),null,hn(f,"rowspan",f.rowspan-1)),l+=f.colspan-1}else if(i<e.width&&c==e.map[u+e.width]){let f=n.nodeAt(c),d=f.type.create(hn(f.attrs,"rowspan",f.attrs.rowspan-1),f.content),h=e.positionAt(i+1,l,n);t.insert(t.mapping.slice(a).map(r+h),d),l+=f.attrs.colspan-1}}}function OY(t,e){if(!vi(t))return!1;if(e){let n=ns(t),r=t.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let i=n.bottom-1;TY(r,n,i),i!=n.top;i--)n.table=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc,n.map=Vt.get(n.table);e(r)}return!0}function BN(t){let e=t.content;return e.childCount==1&&e.firstChild.isTextblock&&e.firstChild.childCount==0}function DY({width:t,height:e,map:n},r){let i=r.top*t+r.left,s=i,o=(r.bottom-1)*t+r.left,a=i+(r.right-r.left-1);for(let l=r.top;l<r.bottom;l++){if(r.left>0&&n[s]==n[s-1]||r.right<t&&n[a]==n[a+1])return!0;s+=t,a+=t}for(let l=r.left;l<r.right;l++){if(r.top>0&&n[i]==n[i-t]||r.bottom<e&&n[o]==n[o+t])return!0;i++,o++}return!1}function FN(t,e){let n=t.selection;if(!(n instanceof at)||n.$anchorCell.pos==n.$headCell.pos)return!1;let r=ns(t),{map:i}=r;if(DY(i,r))return!1;if(e){let s=t.tr,o={},a=le.empty,l,u;for(let c=r.top;c<r.bottom;c++)for(let f=r.left;f<r.right;f++){let d=i.map[c*i.width+f],h=r.table.nodeAt(d);if(!o[d])if(o[d]=!0,l==null)l=d,u=h;else{BN(h)||(a=a.append(h.content));let p=s.mapping.map(d+r.tableStart);s.delete(p,p+h.nodeSize)}}if(s.setNodeMarkup(l+r.tableStart,null,hn(TN(u.attrs,u.attrs.colspan,r.right-r.left-u.attrs.colspan),"rowspan",r.bottom-r.top)),a.size){let c=l+1+u.content.size,f=BN(u)?l+1:c;s.replaceWith(f+r.tableStart,c+r.tableStart,a)}s.setSelection(new at(s.doc.resolve(l+r.tableStart))),e(s)}return!0}function jN(t,e){const n=Nn(t.schema);return MY(({node:r})=>n[r.type.spec.tableRole])(t,e)}function MY(t){return(e,n)=>{let r=e.selection,i,s;if(r instanceof at){if(r.$anchorCell.pos!=r.$headCell.pos)return!1;i=r.$anchorCell.nodeAfter,s=r.$anchorCell.pos}else{if(i=nY(r.$from),!i)return!1;s=bc(r.$from).pos}if(i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let o=i.attrs,a=[],l=o.colwidth;o.rowspan>1&&(o=hn(o,"rowspan",1)),o.colspan>1&&(o=hn(o,"colspan",1));let u=ns(e),c=e.tr;for(let d=0;d<u.right-u.left;d++)a.push(l?hn(o,"colwidth",l&&l[d]?[l[d]]:null):o);let f;for(let d=u.top;d<u.bottom;d++){let h=u.map.positionAt(d,u.left,u.table);d==u.top&&(h+=i.nodeSize);for(let p=u.left,m=0;p<u.right;p++,m++)p==u.left&&d==u.top||c.insert(f=c.mapping.map(h+u.tableStart,1),t({node:i,row:d,col:p}).createAndFill(a[m]))}c.setNodeMarkup(s,t({node:i,row:u.top,col:u.left}),a[0]),r instanceof at&&c.setSelection(new at(c.doc.resolve(r.$anchorCell.pos),f&&c.doc.resolve(f))),n(c)}return!0}}function _Y(t,e){return function(n,r){if(!vi(n))return!1;let i=Sg(n);if(i.nodeAfter.attrs[t]===e)return!1;if(r){let s=n.tr;n.selection instanceof at?n.selection.forEachCell((o,a)=>{o.attrs[t]!==e&&s.setNodeMarkup(a,null,hn(o.attrs,t,e))}):s.setNodeMarkup(i.pos,null,hn(i.nodeAfter.attrs,t,e)),r(s)}return!0}}function NY(t){return function(e,n){if(!vi(e))return!1;if(n){let r=Nn(e.schema),i=ns(e),s=e.tr,o=i.map.cellsInRect(t=="column"?new yc(i.left,0,i.right,i.map.height):t=="row"?new yc(0,i.top,i.map.width,i.bottom):i),a=o.map(l=>i.table.nodeAt(l));for(let l=0;l<o.length;l++)a[l].type==r.header_cell&&s.setNodeMarkup(i.tableStart+o[l],r.cell,a[l].attrs);if(s.steps.length==0)for(let l=0;l<o.length;l++)s.setNodeMarkup(i.tableStart+o[l],r.header_cell,a[l].attrs);n(s)}return!0}}function UN(t,e,n){const r=e.map.cellsInRect({left:0,top:0,right:t=="row"?e.map.width:1,bottom:t=="column"?e.map.height:1});for(let i=0;i<r.length;i++){const s=e.table.nodeAt(r[i]);if(s&&s.type!==n.header_cell)return!1}return!0}function Ah(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?NY(t):function(n,r){if(!vi(n))return!1;if(r){let i=Nn(n.schema),s=ns(n),o=n.tr,a=UN("row",s,i),l=UN("column",s,i),c=(t==="column"?a:t==="row"?l:!1)?1:0,f=t=="column"?new yc(0,c,1,s.map.height):t=="row"?new yc(c,0,s.map.width,1):s,d=t=="column"?l?i.cell:i.header_cell:t=="row"?a?i.cell:i.header_cell:i.cell;s.map.cellsInRect(f).forEach(h=>{const p=h+s.tableStart,m=o.doc.nodeAt(p);m&&o.setNodeMarkup(p,d,m.attrs)}),r(o)}return!0}}Ah("row",{useDeprecatedLogic:!0}),Ah("column",{useDeprecatedLogic:!0});let RY=Ah("cell",{useDeprecatedLogic:!0});function PY(t,e){if(e<0){let n=t.nodeBefore;if(n)return t.pos-n.nodeSize;for(let r=t.index(-1)-1,i=t.before();r>=0;r--){let s=t.node(-1).child(r);if(s.childCount)return i-1-s.lastChild.nodeSize;i-=s.nodeSize}}else{if(t.index()<t.parent.childCount-1)return t.pos+t.nodeAfter.nodeSize;let n=t.node(-1);for(let r=t.indexAfter(-1),i=t.after();r<n.childCount;r++){let s=n.child(r);if(s.childCount)return i+1;i+=s.nodeSize}}}function VN(t){return function(e,n){if(!vi(e))return!1;let r=PY(Sg(e),t);if(r!=null){if(n){let i=e.doc.resolve(r);n(e.tr.setSelection(Fe.between(i,iY(i))).scrollIntoView())}return!0}}}function IY(t,e){let n=t.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole=="table")return e&&e(t.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}let LY=class{constructor(e,n){this.node=e,this.cellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),qv(e,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!=this.node.type?!1:(this.node=e,qv(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function qv(t,e,n,r,i,s){let o=0,a=!0,l=e.firstChild,u=t.firstChild;for(let c=0,f=0;c<u.childCount;c++){let{colspan:d,colwidth:h}=u.child(c).attrs;for(let p=0;p<d;p++,f++){let m=i==f?s:h&&h[p],g=m?m+"px":"";o+=m||r,m||(a=!1),l?(l.style.width!=g&&(l.style.width=g),l=l.nextSibling):e.appendChild(document.createElement("col")).style.width=g}}for(;l;){let c=l.nextSibling;l.parentNode.removeChild(l),l=c}a?(n.style.width=o+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=o+"px")}const Yr=new Mt("tableColumnResizing");function BY({handleWidth:t=5,cellMinWidth:e=25,View:n=LY,lastColumnResizable:r=!0}={}){return new bt({key:Yr,state:{init(s,o){return this.spec.props.nodeViews[Nn(o.schema).table.name]=(a,l)=>new n(a,e,l),new vh(-1,!1)},apply(s,o){return o.apply(s)}},props:{attributes(s){return Yr.getState(s).activeHandle>-1?{class:"resize-cursor"}:null},handleDOMEvents:{mousemove(s,o){FY(s,o,t,e,r)},mouseleave(s){jY(s)},mousedown(s,o){UY(s,o,e)}},decorations(s){let o=Yr.getState(s);if(o.activeHandle>-1)return WY(s,o.activeHandle)},nodeViews:{}}})}class vh{constructor(e,n){this.activeHandle=e,this.dragging=n}apply(e){let n=this,r=e.getMeta(Yr);if(r&&r.setHandle!=null)return new vh(r.setHandle,null);if(r&&r.setDragging!==void 0)return new vh(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&e.docChanged){let i=e.mapping.map(n.activeHandle,-1);zv(e.doc.resolve(i))||(i=null),n=new vh(i,n.dragging)}return n}}function FY(t,e,n,r,i){let s=Yr.getState(t.state);if(!s.dragging){let o=HY(e.target),a=-1;if(o){let{left:l,right:u}=o.getBoundingClientRect();e.clientX-l<=n?a=HN(t,e,"left"):u-e.clientX<=n&&(a=HN(t,e,"right"))}if(a!=s.activeHandle){if(!i&&a!==-1){let l=t.state.doc.resolve(a),u=l.node(-1),c=Vt.get(u),f=l.start(-1);if(c.colCount(l.pos-f)+l.nodeAfter.attrs.colspan-1==c.width-1)return}$N(t,a)}}}function jY(t){let e=Yr.getState(t.state);e.activeHandle>-1&&!e.dragging&&$N(t,-1)}function UY(t,e,n){let r=Yr.getState(t.state);if(r.activeHandle==-1||r.dragging)return!1;let i=t.state.doc.nodeAt(r.activeHandle),s=VY(t,r.activeHandle,i.attrs);t.dispatch(t.state.tr.setMeta(Yr,{setDragging:{startX:e.clientX,startWidth:s}}));function o(l){window.removeEventListener("mouseup",o),window.removeEventListener("mousemove",a);let u=Yr.getState(t.state);u.dragging&&(zY(t,u.activeHandle,zN(u.dragging,l,n)),t.dispatch(t.state.tr.setMeta(Yr,{setDragging:null})))}function a(l){if(!l.which)return o(l);let u=Yr.getState(t.state),c=zN(u.dragging,l,n);$Y(t,u.activeHandle,c,n)}return window.addEventListener("mouseup",o),window.addEventListener("mousemove",a),e.preventDefault(),!0}function VY(t,e,{colspan:n,colwidth:r}){let i=r&&r[r.length-1];if(i)return i;let s=t.domAtPos(e),a=s.node.childNodes[s.offset].offsetWidth,l=n;if(r)for(let u=0;u<n;u++)r[u]&&(a-=r[u],l--);return a/l}function HY(t){for(;t&&t.nodeName!="TD"&&t.nodeName!="TH";)t=t.classList.contains("ProseMirror")?null:t.parentNode;return t}function HN(t,e,n){let r=t.posAtCoords({left:e.clientX,top:e.clientY});if(!r)return-1;let{pos:i}=r,s=bc(t.state.doc.resolve(i));if(!s)return-1;if(n=="right")return s.pos;let o=Vt.get(s.node(-1)),a=s.start(-1),l=o.map.indexOf(s.pos-a);return l%o.width==0?-1:a+o.map[l-1]}function zN(t,e,n){let r=e.clientX-t.startX;return Math.max(n,t.startWidth+r)}function $N(t,e){t.dispatch(t.state.tr.setMeta(Yr,{setHandle:e}))}function zY(t,e,n){let r=t.state.doc.resolve(e),i=r.node(-1),s=Vt.get(i),o=r.start(-1),a=s.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1,l=t.state.tr;for(let u=0;u<s.height;u++){let c=u*s.width+a;if(u&&s.map[c]==s.map[c-s.width])continue;let f=s.map[c],{attrs:d}=i.nodeAt(f),h=d.colspan==1?0:a-s.colCount(f);if(d.colwidth&&d.colwidth[h]==n)continue;let p=d.colwidth?d.colwidth.slice():GY(d.colspan);p[h]=n,l.setNodeMarkup(o+f,null,hn(d,"colwidth",p))}l.docChanged&&t.dispatch(l)}function $Y(t,e,n,r){let i=t.state.doc.resolve(e),s=i.node(-1),o=i.start(-1),a=Vt.get(s).colCount(i.pos-o)+i.nodeAfter.attrs.colspan-1,l=t.domAtPos(i.start(-1)).node;for(;l.nodeName!="TABLE";)l=l.parentNode;qv(s,l.firstChild,l,r,a,n)}function GY(t){let e=[];for(let n=0;n<t;n++)e.push(0);return e}function WY(t,e){let n=[],r=t.doc.resolve(e),i=r.node(-1),s=Vt.get(i),o=r.start(-1),a=s.colCount(r.pos-o)+r.nodeAfter.attrs.colspan;for(let l=0;l<s.height;l++){let u=a+l*s.width-1;if((a==s.width||s.map[u]!=s.map[u+1])&&(l==0||s.map[u-1]!=s.map[u-1-s.width])){let c=s.map[u],f=o+c+i.nodeAt(c).nodeSize-1,d=document.createElement("div");d.className="column-resize-handle",n.push(nn.widget(f,d))}}return kt.create(t.doc,n)}function KY({allowTableNodeSelection:t=!1}={}){return new bt({key:qo,state:{init(){return null},apply(e,n){let r=e.getMeta(qo);if(r!=null)return r==-1?null:r;if(n==null||!e.docChanged)return n;let{deleted:i,pos:s}=e.mapping.mapResult(n);return i?null:s}},props:{decorations:oY,handleDOMEvents:{mousedown:yY},createSelectionBetween(e){if(qo.getState(e.state)!=null)return e.state.selection},handleTripleClick:mY,handleKeyDown:pY,handlePaste:gY},appendTransaction(e,n,r){return uY(r,PN(r,n),t)}})}function GN(t,e,n,r,i,s){var c;let o=0,a=!0,l=e.firstChild;const u=t.firstChild;if(u)for(let f=0,d=0;f<u.childCount;f+=1){const{colspan:h,colwidth:p}=u.child(f).attrs;for(let m=0;m<h;m+=1,d+=1){const g=i===d?s:p&&p[m],b=g?`${g}px`:"";o+=g||r,g||(a=!1),l?(l.style.width!==b&&(l.style.width=b),l=l.nextSibling):e.appendChild(document.createElement("col")).style.width=b}}for(;l;){const f=l.nextSibling;(c=l==null?void 0:l.parentNode)==null||c.removeChild(l),l=f}a?(n.style.width=`${o}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${o}px`)}class qY{constructor(e,n){J(this,"node");J(this,"cellMinWidth");J(this,"dom");J(this,"table");J(this,"colgroup");J(this,"contentDOM");this.node=e,this.cellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),GN(e,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!==this.node.type?!1:(this.node=e,GN(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){return e.type==="attributes"&&(e.target===this.table||this.colgroup.contains(e.target))}}function WN(t,e){return t.createAndFill()}function QY(t){if(t.cached.tableNodeTypes)return t.cached.tableNodeTypes;const e={};return Object.keys(t.nodes).forEach(n=>{const r=t.nodes[n];r.spec.tableRole&&(e[r.spec.tableRole]=r)}),t.cached.tableNodeTypes=e,e}function JY(t,e,n,r,i){const s=QY(t),o=[],a=[];for(let u=0;u<n;u+=1){const c=WN(s.cell);if(c&&a.push(c),r){const f=WN(s.header_cell);f&&o.push(f)}}const l=[];for(let u=0;u<e;u+=1)l.push(s.row.createChecked(null,r&&u===0?o:a));return s.table.createChecked(null,l)}function YY(t){return t instanceof at}const _g=({editor:t})=>{const{selection:e}=t.state;if(!YY(e))return!1;let n=0;const r=w1(e.ranges[0].$from,s=>s.type.name==="table");return r==null||r.node.descendants(s=>{if(s.type.name==="table")return!1;["tableCell","tableHeader"].includes(s.type.name)&&(n+=1)}),n===e.ranges.length?(t.commands.deleteTable(),!0):!1},XY=Xe.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,View:qY,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:t,HTMLAttributes:e}){let n=0,r=!0;try{t.content.firstChild.content.forEach(s=>{if(s.attrs.colwidth)s.attrs.colwidth.forEach(o=>{o?n+=o:(r=!1,n+=this.options.cellMinWidth)});else{r=!1;const o=s.attrs.colspan?s.attrs.colspan:1;n+=this.options.cellMinWidth*o}})}catch{r=!1}return r&&n>0?e.style=`width: ${n}px;`:n&&n>0?e.style=`min-width: ${n}px`:e.style=null,["div",{class:"table-wrapper"},["table",rt(this.options.HTMLAttributes,e),["tbody",0]]]},addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:s})=>{const{selection:o}=r,a=JY(s.schema,t,e,n);if(i){const l=r.selection.anchor+1;r.replaceRangeWith(o.from-1,o.to,a).scrollIntoView().setSelection(Fe.near(r.doc.resolve(l)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>AY(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>vY(t,e),deleteColumn:()=>({state:t,dispatch:e})=>kY(t,e),addRowBefore:()=>({state:t,dispatch:e})=>CY(t,e),addRowAfter:()=>({state:t,dispatch:e})=>SY(t,e),deleteRow:()=>({state:t,dispatch:e})=>OY(t,e),deleteTable:()=>({state:t,dispatch:e})=>IY(t,e),mergeCells:()=>({state:t,dispatch:e})=>FN(t,e),splitCell:()=>({state:t,dispatch:e})=>jN(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>Ah("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>Ah("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>RY(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>FN(t,e)?!0:jN(t,e),setCellAttribute:(t,e)=>({state:n,dispatch:r})=>_Y(t,e)(n,r),goToNextCell:()=>({state:t,dispatch:e})=>VN(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>VN(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&PN(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>{if(n){const r=at.create(e.doc,t.anchorCell,t.headCell);e.setSelection(r)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:_g,"Mod-Backspace":_g,Delete:_g,"Mod-Delete":_g}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[BY({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],KY({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(t){const e={name:t.name,options:t.options,storage:t.storage};return{tableRole:tt(Oe(t,"tableRole",e))}}});function KN(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,s;for(s=0;s<r.length;s++)i=r[s],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}var qN=typeof window<"u"&&typeof document<"u";function Qv(t,e){t&&(typeof t=="function"&&t(e),{}.hasOwnProperty.call(t,"current")&&(t.current=e))}function QN(){return qN&&document.createElement("div")}function ZY(t){var e={"data-placement":t.placement};return t.referenceHidden&&(e["data-reference-hidden"]=""),t.escaped&&(e["data-escaped"]=""),e}function JN(t,e){if(t===e)return!0;if(typeof t=="object"&&t!=null&&typeof e=="object"&&e!=null){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(var n in t)if(e.hasOwnProperty(n)){if(!JN(t[n],e[n]))return!1}else return!1;return!0}else return!1}function eX(t){var e=[];return t.forEach(function(n){e.find(function(r){return JN(n,r)})||e.push(n)}),e}function tX(t,e){var n,r;return Object.assign({},e,{popperOptions:Object.assign({},t.popperOptions,e.popperOptions,{modifiers:eX([].concat(((n=t.popperOptions)==null?void 0:n.modifiers)||[],((r=e.popperOptions)==null?void 0:r.modifiers)||[]))})})}var Jv=qN?N.useLayoutEffect:N.useEffect;function nX(t){var e=N.useRef();return e.current||(e.current=typeof t=="function"?t():t),e.current}function YN(t,e,n){n.split(/\s+/).forEach(function(r){r&&t.classList[e](r)})}var rX={name:"className",defaultValue:"",fn:function(e){var n=e.popper.firstElementChild,r=function(){var a;return!!((a=e.props.render)!=null&&a.$$tippy)};function i(){if(e.props.className&&!r()){process.env.NODE_ENV!=="production"&&console.warn(["@tippyjs/react: Cannot use `className` prop in conjunction with","`render` prop. Place the className on the element you are","rendering."].join(" "));return}YN(n,"add",e.props.className)}function s(){r()&&YN(n,"remove",e.props.className)}return{onCreate:i,onBeforeUpdate:s,onAfterUpdate:i}}};function iX(t){function e(n){var r=n.children,i=n.content,s=n.visible,o=n.singleton,a=n.render,l=n.reference,u=n.disabled,c=u===void 0?!1:u,f=n.ignoreAttributes,d=f===void 0?!0:f;n.__source,n.__self;var h=KN(n,["children","content","visible","singleton","render","reference","disabled","ignoreAttributes","__source","__self"]),p=s!==void 0,m=o!==void 0,g=N.useState(!1),b=g[0],v=g[1],y=N.useState({}),A=y[0],x=y[1],k=N.useState(),S=k[0],E=k[1],D=nX(function(){return{container:QN(),renders:1}}),T=Object.assign({ignoreAttributes:d},h,{content:D.container});p&&(process.env.NODE_ENV!=="production"&&["trigger","hideOnClick","showOnCreate"].forEach(function(z){T[z]!==void 0&&console.warn(["@tippyjs/react: Cannot specify `"+z+"` prop in","controlled mode (`visible` prop)"].join(" "))}),T.trigger="manual",T.hideOnClick=!1),m&&(c=!0);var R=T,L=T.plugins||[];a&&(R=Object.assign({},T,{plugins:m&&o.data!=null?[].concat(L,[{fn:function(){return{onTrigger:function($,Y){var ie=o.data.children.find(function(ee){var Ae=ee.instance;return Ae.reference===Y.currentTarget});$.state.$$activeSingletonInstance=ie.instance,E(ie.content)}}}}]):L,render:function(){return{popper:D.container}}}));var B=[l].concat(r?[r.type]:[]);return Jv(function(){var z=l;l&&l.hasOwnProperty("current")&&(z=l.current);var F=t(z||D.ref||QN(),Object.assign({},R,{plugins:[rX].concat(T.plugins||[])}));return D.instance=F,c&&F.disable(),s&&F.show(),m&&o.hook({instance:F,content:i,props:R,setSingletonContent:E}),v(!0),function(){F.destroy(),o==null||o.cleanup(F)}},B),Jv(function(){var z;if(D.renders===1){D.renders++;return}var F=D.instance;F.setProps(tX(F.props,R)),(z=F.popperInstance)==null||z.forceUpdate(),c?F.disable():F.enable(),p&&(s?F.show():F.hide()),m&&o.hook({instance:F,content:i,props:R,setSingletonContent:E})}),Jv(function(){var z;if(a){var F=D.instance;F.setProps({popperOptions:Object.assign({},F.props.popperOptions,{modifiers:[].concat((((z=F.props.popperOptions)==null?void 0:z.modifiers)||[]).filter(function($){var Y=$.name;return Y!=="$$tippyReact"}),[{name:"$$tippyReact",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Y){var ie,ee=Y.state,Ae=(ie=ee.modifiersData)==null?void 0:ie.hide;(A.placement!==ee.placement||A.referenceHidden!==(Ae==null?void 0:Ae.isReferenceHidden)||A.escaped!==(Ae==null?void 0:Ae.hasPopperEscaped))&&x({placement:ee.placement,referenceHidden:Ae==null?void 0:Ae.isReferenceHidden,escaped:Ae==null?void 0:Ae.hasPopperEscaped}),ee.attributes.popper={}}}])})})}},[A.placement,A.referenceHidden,A.escaped].concat(B)),N.createElement(N.Fragment,null,r?N.cloneElement(r,{ref:function(F){D.ref=F,Qv(r.ref,F)}}):null,b&&Tt.createPortal(a?a(ZY(A),S,D.instance):i,D.container))}return e}var sX=function(t,e){return N.forwardRef(function(r,i){var s=r.children,o=KN(r,["children"]);return N.createElement(t,Object.assign({},e,o),s?N.cloneElement(s,{ref:function(l){Qv(i,l),Qv(s.ref,l)}}):null)})},oX=sX(iX(Za));const aX=[{name:"Add row above",action:t=>t.chain().focus().addRowBefore().run(),icon:O.jsx("svg",{viewBox:"0 0 24 24",children:O.jsx("path",{fill:"currentColor",d:"M22 14a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7h2v-2h4v2h2v-2h4v2h2v-2h4v2h2v-7M4 14h4v3H4v-3m6 0h4v3h-4v-3m10 0v3h-4v-3h4m-9-4h2V7h3V5h-3V2h-2v3H8v2h3v3Z"})})},{name:"Add row below",action:t=>t.chain().focus().addRowAfter().run(),icon:O.jsx("svg",{viewBox:"0 0 24 24",children:O.jsx("path",{fill:"currentColor",d:"M22 10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V3h2v2h4V3h2v2h4V3h2v2h4V3h2v7M4 10h4V7H4v3m6 0h4V7h-4v3m10 0V7h-4v3h4m-9 4h2v3h3v2h-3v3h-2v-3H8v-2h3v-3Z"})})},{name:"Add left column",action:t=>t.chain().focus().addColumnBefore().run(),icon:O.jsx("svg",{viewBox:"0 0 24 24",children:O.jsx("path",{fill:"currentColor",d:"M13 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h9V2h-9m7 8v4h-7v-4h7m0 6v4h-7v-4h7m0-12v4h-7V4h7M9 11H6V8H4v3H1v2h3v3h2v-3h3v-2Z"})})},{name:"Add right column",action:t=>t.chain().focus().addColumnAfter().run(),icon:O.jsx("svg",{viewBox:"0 0 24 24",children:O.jsx("path",{fill:"currentColor",d:"M11 2a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2H2V2h9m-7 8v4h7v-4H4m0 6v4h7v-4H4M4 4v4h7V4H4m11 7h3V8h2v3h3v2h-3v3h-2v-3h-3v-2Z"})})},{name:"Remove row",action:t=>t.chain().focus().deleteRow().run(),icon:O.jsx("svg",{viewBox:"0 0 24 24",children:O.jsx("path",{fill:"currentColor",d:"M9.41 13L12 15.59L14.59 13L16 14.41L13.41 17L16 19.59L14.59 21L12 18.41L9.41 21L8 19.59L10.59 17L8 14.41L9.41 13M22 9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v3M4 9h4V6H4v3m6 0h4V6h-4v3m6 0h4V6h-4v3Z"})})},{name:"Remove column",action:t=>t.chain().focus().deleteColumn().run(),icon:O.jsx("svg",{viewBox:"0 0 24 24",children:O.jsx("path",{fill:"currentColor",d:"M4 2h7a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2m0 8v4h7v-4H4m0 6v4h7v-4H4M4 4v4h7V4H4m13.59 8L15 9.41L16.41 8L19 10.59L21.59 8L23 9.41L20.41 12L23 14.59L21.59 16L19 13.41L16.41 16L15 14.59L17.59 12Z"})})},{name:"Toggle header row",action:t=>t.chain().focus().toggleHeaderRow().run(),icon:O.jsx("svg",{viewBox:"0 0 24 24",children:O.jsx("path",{fill:"currentColor",d:"M22 14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v4M4 14h4v-4H4v4m6 0h4v-4h-4v4m6 0h4v-4h-4v4Z"})})},{name:"Toggle header column",action:t=>t.chain().focus().toggleHeaderColumn().run(),icon:O.jsx("svg",{viewBox:"0 0 24 24",children:O.jsx("path",{fill:"currentColor",d:"M8 2h8a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2m0 8v4h8v-4H8m0 6v4h8v-4H8M8 4v4h8V4H8Z"})})},{name:"Toggle header cell",action:t=>t.chain().focus().toggleHeaderCell().run(),icon:O.jsx("svg",{viewBox:"0 0 24 24",children:O.jsx("path",{fill:"currentColor",d:"M21 19a1 1 0 0 1-1 1h-1v-2h2v1m-6 1v-2h2v2h-2m-4 0v-2h2v2h-2m-4 0v-2h2v2H7m-3 0a1 1 0 0 1-1-1v-1h2v2H4M19 4H5a2 2 0 0 0-2 2v2h18V6c0-1.11-.89-2-2-2M5 14H3v2h2v-2m0-4H3v2h2v-2m16 0h-2v2h2v-2m0 4h-2v2h2v-2m-10 2v-2h2v2h-2m0-4v-2h2v2h-2"})})},{name:"Remove table",action:t=>t.chain().focus().deleteTable().run(),icon:O.jsx("svg",{viewBox:"0 0 24 24",children:O.jsx("path",{fill:"currentColor",d:"M12.35 20H10v-3h2.09c.12-.72.37-1.39.72-2H10v-3h4v1.54c.58-.54 1.25-.93 2-1.19V12h4v.35c.75.26 1.42.65 2 1.19V5c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v15c0 1.1.9 2 2 2h9.54c-.54-.58-.93-1.25-1.19-2M16 7h4v3h-4V7m-6 0h4v3h-4V7M8 20H4v-3h4v3m0-5H4v-3h4v3m0-5H4V7h4v3m6.46 5.88l1.42-1.42L18 16.59l2.12-2.13l1.42 1.42L19.41 18l2.13 2.12l-1.42 1.42L18 19.41l-2.12 2.13l-1.42-1.42L16.59 18l-2.13-2.12"})})}],XN=({node:t,getPos:e,selected:n,editor:r})=>{const[i,s]=N.useState(!1),o=X0(),a=N.useRef(null),l=()=>{const{from:c,to:f}=r.state.selection,d=e(),h=d+t.nodeSize;s(d<=c&&f<=h)};N.useEffect(()=>(r.on("selectionUpdate",l),setTimeout(l,100),()=>{r.off("selectionUpdate",l)}));const u=()=>{var d,h;let c=(d=a.current)==null?void 0:d.clientTop;c&&(c+=5);let f=(h=a.current)==null?void 0:h.clientLeft;return f&&(f+=5),{top:`${c}px`,left:`${f}px`}};return O.jsxs(Dd,{className:"group",children:[O.jsx(WT,{as:"span"}),(i||n)&&O.jsx(oX,{appendTo:document.body,trigger:"click",interactive:!0,animation:"shift-toward-subtle",placement:"bottom-start",content:O.jsx("article",{className:"w-screen lg:w-full",contentEditable:!1,children:O.jsx("ul",{tabIndex:0,className:"static top-8 right-1/2 translate-x-1/2 lg:-translate-x-full menu menu-compact p-2 shadow bg-base-100 rounded-lg w-56",style:u(),children:aX.map(c=>O.jsx("li",{children:O.jsx(Lo,{variant:"ghost",className:"!items-center w-full !justify-start !font-[400]",onClick:()=>c.action(r),children:O.jsx("span",{children:c.name})})},c.name))})}),children:O.jsx("label",{tabIndex:0,className:ve("trigger-button",{hidden:o}),contentEditable:!1,children:O.jsx(ZU,{size:20})})})]})},lX=Xe.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?[parseInt(e,10)]:null}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",rt(this.options.HTMLAttributes,t),0]},addNodeView(){return el(XN,{as:"td",className:"relative"})}}),uX=Xe.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?[parseInt(e,10)]:null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",rt(this.options.HTMLAttributes,t),0]},addNodeView(){return el(XN,{as:"th",className:"relative"})}}),ZN=t=>(t.stopPropagation(),t.preventDefault(),t),cX=function(t){const e=t.scrollHeight>t.clientHeight,r=window.getComputedStyle(t).overflowY.indexOf("hidden")!==-1;return e&&!r},e6=function(t){return!t||t===document.body?document.body:cX(t)?t:e6(t.parentNode)},Yv=(t,e,n)=>{const r=document.createElement(t);if(!r)throw new Error(`Element with name ${t} can't be created.`);return e&&Object.entries(e).forEach(([i,s])=>r.setAttribute(i,s)),n&&Object.entries(n).forEach(([i,s])=>r.addEventListener(i,s)),r},fX=Xe.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",rt(this.options.HTMLAttributes,t),0]},addNodeView(){return({editor:t,HTMLAttributes:e,getPos:n})=>{const r=()=>n(),i=e6(t.options.element);let s=!1;const o={deleteRow:()=>{this.editor.chain().deleteNode("tableRow").focus().run()},selectRow:()=>{const b=r(),v=t.state.doc.resolve(b),y=new Pe(v);t.view.dispatch(t.state.tr.setSelection(y))}},a=()=>{s=!0},l=()=>{s=!1},u=Yv("section",{class:"absolute hidden flex items-center w-2 bg-gray-200 z-50 cursor-pointer border-1 border-indigo-600 rounded-l opacity-25 hover:opacity-100",contenteditable:"false"},{click:b=>{b&&ZN(b),o.selectRow()},mouseenter:()=>{a()},mouseover:()=>{a()},mouseleave:()=>{l(),d()}}),c=Yv("button",{class:"text-sm px-1 absolute -translate-x-[125%] hover:active:-translate-x-[125%] mr-2"},{click:b=>{b&&ZN(b),o.deleteRow()}}),f=()=>{m(),u.classList.remove("hidden")},d=()=>{setTimeout(()=>{s||u.classList.add("hidden")},100)},h=Yv("tr",{...e},{mouseenter:f,mouseover:f,mouseleave:d});u.append(c),document.body.append(u);let p="";const m=()=>{setTimeout(()=>{const b=h.getBoundingClientRect(),v=JSON.stringify(b);p!==v&&(u.style.top=`${b.top+document.documentElement.scrollTop}px`,u.style.left=`${b.x+document.documentElement.scrollLeft-8}px`,u.style.height=`${b.height+1}px`,p=v)})};return setTimeout(()=>{m()},100),t.on("selectionUpdate",m),t.on("update",m),i==null||i.addEventListener("scroll",m),document.addEventListener("scroll",m),{dom:h,contentDOM:h,destroy:()=>{u.remove(),t.off("selectionUpdate",m),t.off("update",m),i==null||i.removeEventListener("scroll",m),document.removeEventListener("scroll",m)}}}}}),dX=[XY.configure({resizable:!0}),lX,uX,fX],hX=o_.extend({content:"(dBlock|columns)+"});function t6({types:t,node:e}){return e!=null&&e.type?Array.isArray(t)&&t.includes(e.type)||e.type===t:!1}const pX=wt.create({name:"trailingNode",addOptions(){return{node:"paragraph",notAfter:["paragraph"]}},addProseMirrorPlugins(){const t=new Mt(this.name),e=Object.entries(this.editor.schema.nodes).map(([,n])=>n).filter(n=>this.options.notAfter.includes(n.name));return[new bt({key:t,appendTransaction:(n,r,i)=>{const{doc:s,tr:o,schema:a}=i,l=t.getState(i),u=s.content.size,c=a.nodes[this.options.node];if(l)return o.insert(u,c.create())},state:{init:(n,r)=>{const i=r.tr.doc.lastChild;return!t6({node:i,types:e})},apply:(n,r)=>{var s,o,a;if(!n.docChanged)return r;const i=(a=(o=(s=n.doc.lastChild)==null?void 0:s.content)==null?void 0:o.content)==null?void 0:a[0];return!t6({node:i,types:e})}}})]}}),mX=({node:t,editor:e,getPos:n})=>{const[r,i]=N.useState(""),s=X0(),o=["https://twitter.com","https://x.com"],a=()=>{switch(t.attrs.data){case"twitter":return O.jsx(t3,{size:20});case"iframe":return O.jsx(n3,{size:20});default:return O.jsx(cV,{size:20})}},l=()=>{switch(t.attrs.data){case"twitter":return"Embed a Twitter tweet";case"iframe":return"Embed a video";default:return"Embed an URL"}},u=()=>{if(!r){alert("Please enter a url");return}let p=r;if(r.includes("<iframe")){const y=r.match(/src="([^"]*)"/);y&&y.length>0&&(p=y[1])}else switch(!0){case/youtu\.?be(?:\.com)?\/(?:.*v(?:\/|=)|(?:.*\/)?)([a-zA-Z0-9-_]+)/.test(r):{const y=r.match(/youtu\.?be(?:\.com)?\/(?:.*v(?:\/|=)|(?:.*\/)?)([a-zA-Z0-9-_]+)/);y&&y.length>0&&(p=`https://www.youtube.com/embed/${y[1]}`);break}case/vimeo\.com\/([a-zA-Z0-9-_]+)/.test(r):{const y=r.match(/vimeo\.com\/([a-zA-Z0-9-_]+)/);y&&y.length>0&&(p=`https://player.vimeo.com/video/${y[1]}`);break}default:{alert("Please enter a valid url");return}}const m=640,g=360,b=n(),v=b+t.nodeSize;p&&(e==null||e.chain().focus(b).deleteRange({from:b,to:v}).setIframe({src:p,width:m,height:g}).run())},c=()=>{if(!r){alert("Please enter a url");return}let p=r;const m=o.some(A=>r.includes(A)),g=r.match(/\/status\/([0-9]*)/),b=g&&g.length>0;if(m&&b)p=g[1];else{alert("invalid url");return}const v=n(),y=v+t.nodeSize;p&&(e==null||e.chain().focus(v).deleteRange({from:v,to:y}).setTweetEmbed({tweetId:p}).run())},d=j_(()=>{switch(t.attrs.data){case"twitter":c();break;default:u();break}},500);N.useEffect(()=>{const p=m=>{if(m.key==="Backspace"&&r===""){const g=n(),b=g+t.nodeSize;(t.content.size===0||t.textContent==="")&&(e==null||e.chain().focus(g).deleteRange({from:g,to:b}).run(),m.preventDefault())}};return document.addEventListener("keydown",p),()=>{document.removeEventListener("keydown",p)}},[r,e,n,t]),N.useEffect(()=>{r&&d()},[r]),N.useEffect(()=>{e==null||e.chain().focus()},[]);const h=N.useRef(null);return N.useEffect(()=>{var p;(p=h.current)==null||p.focus()},[]),O.jsx(Dd,{as:"div",className:"flex gap-2 group w-full relative justify-center items-start",children:!s&&O.jsxs("div",{className:"relative w-full",children:[O.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none text-[#A1AAB1]",children:a()}),O.jsx("input",{ref:h,value:r,placeholder:l(),onChange:p=>i(p.target.value),onClick:p=>p.stopPropagation(),className:"rounded bg-[#f2f2f2] p-3 pl-10 w-full cursor-pointer transition-all ease-in-out text-sm"})]})})},gX=Xe.create({name:"actionButton",group:"block",content:"block*",atom:!0,draggable:!0,addOptions(){return{HTMLAttributes:{}}},addAttributes(){return{data:{default:null}}},addNodeView(){return el(mX)},parseHTML(){return[{tag:"div[data-action-node]"}]},renderHTML({HTMLAttributes:t}){return["div",rt(t,{"data-action-node":""}),0]},addCommands(){return{setActionButton:t=>({commands:e})=>e.insertContent({type:this.name,attrs:{data:t},content:[]})}}}),n6={};function yX(t){let e=n6[t];if(e)return e;e=n6[t]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);e.push(r)}for(let n=0;n<t.length;n++){const r=t.charCodeAt(n);e[r]="%"+("0"+r.toString(16).toUpperCase()).slice(-2)}return e}function wc(t,e){typeof e!="string"&&(e=wc.defaultChars);const n=yX(e);return t.replace(/(%[a-f0-9]{2})+/gi,function(r){let i="";for(let s=0,o=r.length;s<o;s+=3){const a=parseInt(r.slice(s+1,s+3),16);if(a<128){i+=n[a];continue}if((a&224)===192&&s+3<o){const l=parseInt(r.slice(s+4,s+6),16);if((l&192)===128){const u=a<<6&1984|l&63;u<128?i+="��":i+=String.fromCharCode(u),s+=3;continue}}if((a&240)===224&&s+6<o){const l=parseInt(r.slice(s+4,s+6),16),u=parseInt(r.slice(s+7,s+9),16);if((l&192)===128&&(u&192)===128){const c=a<<12&61440|l<<6&4032|u&63;c<2048||c>=55296&&c<=57343?i+="���":i+=String.fromCharCode(c),s+=6;continue}}if((a&248)===240&&s+9<o){const l=parseInt(r.slice(s+4,s+6),16),u=parseInt(r.slice(s+7,s+9),16),c=parseInt(r.slice(s+10,s+12),16);if((l&192)===128&&(u&192)===128&&(c&192)===128){let f=a<<18&1835008|l<<12&258048|u<<6&4032|c&63;f<65536||f>1114111?i+="����":(f-=65536,i+=String.fromCharCode(55296+(f>>10),56320+(f&1023))),s+=9;continue}}i+="�"}return i})}wc.defaultChars=";/?:@&=+$,#",wc.componentChars="";const r6={};function bX(t){let e=r6[t];if(e)return e;e=r6[t]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);/^[0-9a-z]$/i.test(r)?e.push(r):e.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<t.length;n++)e[t.charCodeAt(n)]=t[n];return e}function xh(t,e,n){typeof e!="string"&&(n=e,e=xh.defaultChars),typeof n>"u"&&(n=!0);const r=bX(e);let i="";for(let s=0,o=t.length;s<o;s++){const a=t.charCodeAt(s);if(n&&a===37&&s+2<o&&/^[0-9a-f]{2}$/i.test(t.slice(s+1,s+3))){i+=t.slice(s,s+3),s+=2;continue}if(a<128){i+=r[a];continue}if(a>=55296&&a<=57343){if(a>=55296&&a<=56319&&s+1<o){const l=t.charCodeAt(s+1);if(l>=56320&&l<=57343){i+=encodeURIComponent(t[s]+t[s+1]),s++;continue}}i+="%EF%BF%BD";continue}i+=encodeURIComponent(t[s])}return i}xh.defaultChars=";/?:@&=+$,-_.!~*'()#",xh.componentChars="-_.!~*'()";function Xv(t){let e="";return e+=t.protocol||"",e+=t.slashes?"//":"",e+=t.auth?t.auth+"@":"",t.hostname&&t.hostname.indexOf(":")!==-1?e+="["+t.hostname+"]":e+=t.hostname||"",e+=t.port?":"+t.port:"",e+=t.pathname||"",e+=t.search||"",e+=t.hash||"",e}function Ng(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const wX=/^([a-z0-9.+-]+:)/i,AX=/:[0-9]*$/,vX=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,xX=["<",">",'"',"`"," ","\r",`
484
+ 3. "-" cannot repeat`);It.customSchemes.push([t,e])}function Zq(){It.scanner=$q(It.customSchemes);for(let t=0;t<It.tokenQueue.length;t++)It.tokenQueue[t][1]({scanner:It.scanner});It.parser=qq(It.scanner.tokens);for(let t=0;t<It.pluginQueue.length;t++)It.pluginQueue[t][1]({scanner:It.scanner,parser:It.parser});It.initialized=!0}function P_(t){return It.initialized||Zq(),Qq(It.parser.start,t,Gq(It.scanner.start,t))}function I_(t,e,n){if(e===void 0&&(e=null),n===void 0&&(n=null),e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const r=new Cv(n),i=P_(t),s=[];for(let o=0;o<i.length;o++){const a=i[o];a.isLink&&(!e||a.t===e)&&r.check(a)&&s.push(a.toFormattedObject(r))}return s}function eQ(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function tQ(t){return new bt({key:new Mt("autolink"),appendTransaction:(e,n,r)=>{const i=e.some(u=>u.docChanged)&&!n.doc.eq(r.doc),s=e.some(u=>u.getMeta("preventAutolink"));if(!i||s)return;const{tr:o}=r,a=w7(n.doc,[...e]);if(S7(a).forEach(({newRange:u})=>{const c=v7(r.doc,u,h=>h.isTextblock);let f,d;if(c.length>1?(f=c[0],d=r.doc.textBetween(f.pos,f.pos+f.node.nodeSize,void 0," ")):c.length&&r.doc.textBetween(u.from,u.to," "," ").endsWith(" ")&&(f=c[0],d=r.doc.textBetween(f.pos,u.to,void 0," ")),f&&d){const h=d.split(" ").filter(b=>b!=="");if(h.length<=0)return!1;const p=h[h.length-1],m=f.pos+d.lastIndexOf(p);if(!p)return!1;const g=P_(p).map(b=>b.toObject(t.defaultProtocol));if(!eQ(g))return!1;g.filter(b=>b.isLink).map(b=>({...b,from:m+b.start+1,to:m+b.end+1})).filter(b=>r.schema.marks.code?!r.doc.rangeHasMark(b.from,b.to,r.schema.marks.code):!0).filter(b=>t.validate(b.value)).forEach(b=>{x1(b.from,b.to,r.doc).some(v=>v.mark.type===t.type)||o.addMark(b.from,b.to,t.type.create({href:b.href}))})}}),!!o.steps.length)return o}})}function nQ(t){return new bt({key:new Mt("handleClickLink"),props:{handleClick:(e,n,r)=>{var i,s;if(r.button!==0)return!1;let o=r.target;const a=[];for(;o.nodeName!=="DIV";)a.push(o),o=o.parentNode;if(!a.find(d=>d.nodeName==="A"))return!1;const l=FS(e.state,t.type.name),u=r.target,c=(i=u==null?void 0:u.href)!==null&&i!==void 0?i:l.href,f=(s=u==null?void 0:u.target)!==null&&s!==void 0?s:l.target;return u&&c?(window.open(c,f),!0):!1}}})}function rQ(t){return new bt({key:new Mt("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{state:i}=e,{selection:s}=i,{empty:o}=s;if(o)return!1;let a="";r.content.forEach(u=>{a+=u.textContent});const l=I_(a,{defaultProtocol:t.defaultProtocol}).find(u=>u.isLink&&u.value===a);return!a||!l?!1:(t.editor.commands.setMark(t.type,{href:l.href}),!0)}}})}const iQ=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g,sQ=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i;function L_(t){return!t||t.replace(iQ,"").match(sQ)}const oQ=Yt.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.protocols.forEach(t=>{if(typeof t=="string"){R_(t);return}R_(t.scheme,t.optionalSlashes)})},onDestroy(){Xq()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:t=>!!t}},addAttributes(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!L_(e)?!1:{href:e}}}]},renderHTML({HTMLAttributes:t}){return L_(t.href)?["a",rt(this.options.HTMLAttributes,t),0]:["a",rt(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return{setLink:t=>({chain:e})=>e().setMark(this.name,t).setMeta("preventAutolink",!0).run(),toggleLink:t=>({chain:e})=>e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[No({find:t=>{const e=[];if(t){const{validate:n}=this.options,r=I_(t).filter(i=>i.isLink&&n(i.value));r.length&&r.forEach(i=>e.push({text:i.value,data:{href:i.href},index:i.start}))}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[];return this.options.autolink&&t.push(tQ({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:this.options.validate})),this.options.openOnClick===!0&&t.push(nQ({type:this.type})),this.options.linkOnPaste&&t.push(rQ({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}}),aQ=wt.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new bt({key:new Mt("placeholder"),props:{decorations:({doc:t,selection:e})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=e,i=[];if(!n)return null;const s=this.editor.isEmpty;return t.descendants((o,a)=>{const l=r>=a&&r<=a+o.nodeSize,u=!o.isLeaf&&US(o);if((l||!this.options.showOnlyCurrent)&&u){const c=[this.options.emptyNodeClass];s&&c.push(this.options.emptyEditorClass);const f=nn.node(a,a+o.nodeSize,{class:c.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(f)}return this.options.includeChildren}),kt.create(t,i)}}})]}}),lQ=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,uQ=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,cQ=Yt.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:t=>t.getAttribute("data-color")||t.style.backgroundColor,renderHTML:t=>t.color?{"data-color":t.color,style:`background-color: ${t.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:t}){return["mark",rt(this.options.HTMLAttributes,t),0]},addCommands(){return{setHighlight:t=>({commands:e})=>e.setMark(this.name,t),toggleHighlight:t=>({commands:e})=>e.toggleMark(this.name,t),unsetHighlight:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Qa({find:lQ,type:this.type})]},addPasteRules(){return[No({find:uQ,type:this.type})]}}),fQ=Xe.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:t}){return["ul",rt(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),dQ=/^\s*(\[([( |x])?\])\s$/,hQ=Xe.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList"}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:t=>t.getAttribute("data-checked")==="true",renderHTML:t=>({"data-checked":t.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:t,HTMLAttributes:e}){return["li",rt(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:n,editor:r})=>{const i=document.createElement("li"),s=document.createElement("label"),o=document.createElement("span"),a=document.createElement("input"),l=document.createElement("div");return s.contentEditable="false",a.type="checkbox",a.addEventListener("change",u=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){a.checked=!a.checked;return}const{checked:c}=u.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:f})=>{const d=n(),h=f.doc.nodeAt(d);return f.setNodeMarkup(d,void 0,{...h==null?void 0:h.attrs,checked:c}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,c)||(a.checked=!a.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([u,c])=>{i.setAttribute(u,c)}),i.dataset.checked=t.attrs.checked,t.attrs.checked&&a.setAttribute("checked","checked"),s.append(a,o),i.append(s,l),Object.entries(e).forEach(([u,c])=>{i.setAttribute(u,c)}),{dom:i,contentDOM:l,update:u=>u.type!==this.type?!1:(i.dataset.checked=u.attrs.checked,u.attrs.checked?a.setAttribute("checked","checked"):a.removeAttribute("checked"),!0)}}},addInputRules(){return[Ru({find:dQ,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),pQ=Yt.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",rt(this.options.HTMLAttributes,t),0]},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),mQ=g_.extend({renderHTML(){return["div",rt(this.options.HTMLAttributes,{"data-type":this.name}),["hr"]]}}),gQ=wt.create({name:"columnExtension",addExtensions(){const t=[];return this.options.column!==!1&&t.push(jO),this.options.columns!==!1&&t.push(Y0),t}}),yQ=wt.create({name:"CustomKeymap",addCommands(){return{selectTextWithinNodeBoundaries:()=>({editor:t,commands:e})=>{const{state:n}=t,{tr:r}=n,i=r.selection.$from.start(),s=r.selection.$to.end();return e.setTextSelection({from:i,to:s})}}},addKeyboardShortcuts(){return{"Mod-a":({editor:t})=>{const{state:e}=t,{tr:n}=e,r=n.selection.from,i=n.selection.to,s=n.selection.$from.start(),o=n.selection.$to.end();return r>s||i<o?(t.chain().selectTextWithinNodeBoundaries().run(),!0):!1}}}}),bQ=wt.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:t=>{var e;return(e=t.style.color)===null||e===void 0?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.color?{style:`color: ${t.color}`}:{}}}}]},addCommands(){return{setColor:t=>({chain:e})=>e().setMark("textStyle",{color:t}).run(),unsetColor:()=>({chain:t})=>t().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}),B_=[{tooltip:"Align left",action:t=>t({dataAlign:"start",dataFloat:null}),icon:"AlignLeft",isActive:t=>t.dataAlign==="start"},{tooltip:"Align center",action:t=>t({dataAlign:"center",dataFloat:null}),icon:"AlignCenter",isActive:t=>t.dataAlign==="center"},{tooltip:"Align right",action:t=>t({dataAlign:"end",dataFloat:null}),icon:"AlignRight",isActive:t=>t.dataAlign==="end"},{tooltip:"Delete",icon:"Trash2",delete:t=>t()}];let cc;const F_=({node:t,updateAttributes:e,deleteNode:n})=>{const r=X0(),[i,s]=N.useState(),[o,a]=N.useState(0),[l,u]=N.useState(0),[c,f]=N.useState({}),d=N.useRef(null),[h,p]=N.useState(!1),m=()=>{const B={};B_.forEach(({tooltip:z,isActive:F})=>{B[z]=!!(F!=null&&F(t.attrs))}),f(B)},g=()=>{const B=document.querySelector(".ProseMirror");if(B&&u(B==null?void 0:B.clientWidth),!!d.current){if(i==="video"){const z=d.current;z.addEventListener("loadeddata",function(){a(z.videoWidth/z.videoHeight),k("left",0)})}else if(i==="iframe"){const z=d.current;z.onload=()=>{a(z.offsetWidth/z.offsetHeight),k("left",0)}}else d.current.onload=()=>{a(d.current.naturalWidth/d.current.naturalHeight)};setTimeout(()=>m(),200)}},b=B=>{cc=B};N.useEffect(()=>{g()},[]);const v=({width:B,height:z})=>B<200||z<200,y=B=>{const z=B instanceof TouchEvent?B.touches[0].clientX:B.clientX;setTimeout(()=>S(z))},A=B=>{cc=B instanceof TouchEvent?B.touches[0].clientX:B.clientX,setTimeout(()=>{document.addEventListener("mousemove",y),document.addEventListener("mouseup",x),document.addEventListener("touchmove",y),document.addEventListener("touchend",x)}),p(!0)},x=()=>{cc=-1,document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",x),p(!1)},k=(B,z)=>{var ie,ee;if(!d.current){console.error("Media ref is undefined|null",{resizableImg:d.current});return}const F={width:(ie=d.current)==null?void 0:ie.width,height:(ee=d.current)==null?void 0:ee.height},$={width:-1,height:-1};let Y=parseFloat(F.width.toString());if(isNaN(Y)&&(Y=0),B==="left"?$.width=Y-Math.abs(z):$.width=Y+Math.abs(z),$.width>l&&($.width=l),i==="iframe")$.height=$.width/(16/9);else{const Ae=isNaN(o)?1:o;$.height=$.width/Ae}$.width=isNaN($.width)?0:$.width,$.height=isNaN($.height)?0:$.height,!v($)&&e($)},S=B=>{if(cc===-1)return;const z=cc-B;if(z===0)return;const F=z>0?"left":"right";setTimeout(()=>{k(F,Math.abs(z)),cc=B})},[E,D]=N.useState(),[T,R]=N.useState();N.useEffect(()=>{s(t.attrs["media-type"]),m(),D(t.attrs.dataFloat),R(t.attrs.dataAlign)},[t.attrs]);const L=B=>{switch(B){case"AlignLeft":return O.jsx(Md,{size:16});case"AlignCenter":return O.jsx(X1,{size:16});case"AlignRight":return O.jsx(Z1,{size:16});case"Trash2":return O.jsx(aw,{size:16});default:return null}};return O.jsx(Dd,{as:"article",className:ve("media-node-view not-prose transition-all ease-in-out w-full",E&&`f-${t.attrs.dataFloat}`,T&&`justify-${t.attrs.dataAlign}`),children:O.jsxs("div",{className:"w-fit flex relative group transition-all ease-in-out",children:[i==="img"&&O.jsx("img",{src:t.attrs.src,ref:d,className:"rounded-lg",alt:t.attrs.src,width:t.attrs.width,height:t.attrs.height}),i==="video"&&O.jsx("video",{ref:d,className:"rounded-lg",controls:!0,width:t.attrs.width,height:t.attrs.height,children:O.jsx("source",{src:t.attrs.src})}),i==="iframe"&&O.jsx("iframe",{ref:d,className:ve("rounded-lg max-w-full",h&&"pointer-events-none"),src:t.attrs.src,width:t.attrs.width,height:t.attrs.height}),!r&&O.jsxs(O.Fragment,{children:[O.jsx("div",{className:"horizontal-resize-handle group-hover:bg-black group-hover:border-2 group-hover:border-white/80",title:"Resize",onClick:({clientX:B})=>b(B),onMouseDown:B=>A(B),onMouseUp:x,onTouchStart:B=>A(B),onTouchEnd:x}),O.jsx("section",{className:"media-control-buttons opacity-0 group-hover:opacity-100 transition-opacity duration-200 flex",children:B_.map((B,z)=>O.jsx("div",{className:"tooltip","data-tip":B.tooltip,children:O.jsx("button",{type:"button",className:ve("btn rounded-none h-6 transition",c[B.tooltip]&&"active"),onClick:()=>{var F;return B.tooltip==="Delete"?n():(F=B.action)==null?void 0:F.call(B,e)},children:B.icon&&L(B.icon)})},z))})]})]})})},wQ=Xe.create({name:"iframe",group:"block",atom:!0,draggable:!0,addOptions(){return{allowFullscreen:!0,HTMLAttributes:{class:"iframe-wrapper"}}},addAttributes(){return{src:{default:null},frameborder:{default:0},allowfullscreen:{default:this.options.allowFullscreen,parseHTML:()=>this.options.allowFullscreen},"media-type":{default:"iframe"},alt:{default:null},title:{default:null},width:{default:this.options.width},height:{default:this.options.height},dataAlign:{default:"left"},dataFloat:{default:null}}},addNodeView(){return el(F_)},parseHTML(){return[{tag:"iframe"}]},renderHTML({HTMLAttributes:t}){return["iframe",rt(this.options.HTMLAttributes,t)]},addCommands(){return{setIframe:t=>({tr:e,dispatch:n})=>{const{selection:r}=e,i=this.type.create(t);return n&&e.replaceRangeWith(r.from-1,r.to,i),!0}}}});var AQ="https://platform.twitter.com/widgets.js",Tv="createTweet",vQ=function(e){var n=N.useRef(null),r=N.useState(!0),i=r[0],s=r[1];return N.useEffect(function(){var o=!0,a=require("scriptjs");return a(AQ,"twitter-embed",function(){if(!window.twttr){console.error("Failure to load window.twttr, aborting load");return}if(o){if(!window.twttr.widgets[Tv]){console.error("Method "+Tv+" is not present anymore in twttr.widget api");return}window.twttr.widgets[Tv](e.tweetId,n==null?void 0:n.current,e.options).then(function(l){s(!1),e.onLoad&&e.onLoad(l)})}}),function(){o=!1}},[]),N.createElement(N.Fragment,null,i&&N.createElement(N.Fragment,null,e.placeholder),N.createElement("div",{ref:n}))};const xQ=({node:t,editor:e})=>{const[n,r]=N.useState(!0);return N.useEffect(()=>{e==null||e.chain().focus()},[]),O.jsx(Dd,{as:"div",className:"flex gap-2 group w-full relative justify-center items-start",children:O.jsxs("div",{className:"w-full max-w-sm",children:[n&&O.jsx(JO,{width:5,height:5}),O.jsx(vQ,{tweetId:t.attrs.tweetId,onLoad:()=>r(!1)})]})})},kQ=Xe.create({name:"embeddedTweet",group:"block",atom:!0,draggable:!0,addOptions(){return{HTMLAttributes:{class:""}}},addAttributes(){return{tweetId:{default:null},align:{default:"center"}}},parseHTML(){return[{tag:"div[data-tweet-id]"}]},renderHTML({HTMLAttributes:t}){return["div",rt(this.options.HTMLAttributes,t)]},addNodeView(){return el(xQ)},addCommands(){return{setTweetEmbed:t=>({commands:e})=>e.insertContent({type:this.name,attrs:{tweetId:t.tweetId,align:"center"},content:[]})}}}),EQ=t=>new bt({key:new Mt("media-paste-drop"),props:{handlePaste(e,n){var i;return Array.from(((i=n.clipboardData)==null?void 0:i.items)||[]).forEach(s=>{const o=s.getAsFile();if(((o==null?void 0:o.type.indexOf("image"))===0||(o==null?void 0:o.type.indexOf("video"))===0)&&(n.preventDefault(),o&&o.size>Hd))throw new Error("Image too large")}),!1},handleDrop(e,n){var a;if(!(n.dataTransfer&&n.dataTransfer.files&&n.dataTransfer.files.length))return!1;const i=Array.from(((a=n.dataTransfer)==null?void 0:a.files)??[]).filter(({type:l})=>/image|video/i.test(l));if(i.length===0)return!1;n.preventDefault();const{schema:s}=e.state,o=e.posAtCoords({left:n.clientX,top:n.clientY});return o?(i.forEach(async l=>{const u=new FileReader;if(t){const c=s.nodes.resizableMedia.create({src:await t(l),"media-type":l.type.includes("image")?"img":"video"}),f=e.state.tr.insert(o.pos,c);e.dispatch(f)}else u.onload=c=>{var h;const f=s.nodes.resizableMedia.create({src:(h=c.target)==null?void 0:h.result,"media-type":l.type.includes("image")?"img":"video"}),d=e.state.tr.insert(o.pos,f);e.dispatch(d)},u.readAsDataURL(l)}),!0):!1}}}),CQ=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,SQ=/!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\)/,TQ=Xe.create({name:"resizableMedia",addOptions(){return{HTMLAttributes:{class:"rounded-lg border border-stone-200"},uploadFn:async()=>""}},inline:!1,group:"block",draggable:!0,addAttributes(){return{src:{default:null},"media-type":{default:null},alt:{default:null},title:{default:null},width:{default:"100%"},height:{default:"auto"},dataAlign:{default:"left"},dataFloat:{default:null}}},selectable:!0,parseHTML(){return[{tag:'img[src]:not([src^="data:"])',getAttrs:t=>({src:t.getAttribute("src"),"media-type":"img"})},{tag:"video",getAttrs:t=>({src:t.getAttribute("src"),"media-type":"video"})}]},renderHTML({HTMLAttributes:t}){const{"media-type":e}=t;return e==="img"?["img",rt(this.options.HTMLAttributes,t)]:e==="video"?["video",{controls:"true",style:"width: 100%",...t},["source",t]]:(e||console.error("TiptapMediaExtension-renderHTML method: Media Type not set, going default with image"),["img",rt(this.options.HTMLAttributes,t)])},addCommands(){return{setMedia:t=>({commands:e})=>{const{"media-type":n}=t;return n==="img"?e.insertContent({type:this.name,attrs:t}):n==="video"?e.insertContent({type:this.name,attrs:{...t,controls:"true"}}):(n||console.error("TiptapMediaExtension-setMedia: Media Type not set, going default with image"),e.insertContent({type:this.name,attrs:t}))}}},addNodeView(){return el(F_)},addKeyboardShortcuts(){return{Enter:({editor:t})=>{const{selection:e}=t.state;if(e.empty)return!1;const n=e.$to.pos;return t.commands.insertContentAt(n,{type:"dBlock",content:[{type:"paragraph"}]})}}},addInputRules(){return[T1({find:CQ,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r,"media-type":"img"}}}),T1({find:SQ,type:this.type,getAttributes:t=>{const[,,e]=t;return{src:e,"media-type":"video"}}})]},addProseMirrorPlugins(){return[EQ(this.options.uploadFn),yV()]}});function j_(t,e){let n;return(...i)=>{clearTimeout(n),n=setTimeout(()=>t(...i),e)}}const OQ=["top","right","bottom","left"],Zi=Math.min,Mr=Math.max,yg=Math.round,bg=Math.floor,Wo=t=>({x:t,y:t}),DQ={left:"right",right:"left",bottom:"top",top:"bottom"},MQ={start:"end",end:"start"};function Ov(t,e,n){return Mr(t,Zi(e,n))}function Fs(t,e){return typeof t=="function"?t(e):t}function js(t){return t.split("-")[0]}function fc(t){return t.split("-")[1]}function Dv(t){return t==="x"?"y":"x"}function Mv(t){return t==="y"?"height":"width"}function dc(t){return["top","bottom"].includes(js(t))?"y":"x"}function _v(t){return Dv(dc(t))}function _Q(t,e,n){n===void 0&&(n=!1);const r=fc(t),i=_v(t),s=Mv(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=wg(o)),[o,wg(o)]}function NQ(t){const e=wg(t);return[Nv(t),e,Nv(e)]}function Nv(t){return t.replace(/start|end/g,e=>MQ[e])}function RQ(t,e,n){const r=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:r:e?r:i;case"left":case"right":return e?s:o;default:return[]}}function PQ(t,e,n,r){const i=fc(t);let s=RQ(js(t),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(Nv)))),s}function wg(t){return t.replace(/left|right|bottom|top/g,e=>DQ[e])}function IQ(t){return{top:0,right:0,bottom:0,left:0,...t}}function U_(t){return typeof t!="number"?IQ(t):{top:t,right:t,bottom:t,left:t}}function Ag(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function V_(t,e,n){let{reference:r,floating:i}=t;const s=dc(e),o=_v(e),a=Mv(o),l=js(e),u=s==="y",c=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,d=r[a]/2-i[a]/2;let h;switch(l){case"top":h={x:c,y:r.y-i.height};break;case"bottom":h={x:c,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-i.width,y:f};break;default:h={x:r.x,y:r.y}}switch(fc(e)){case"start":h[o]-=d*(n&&u?-1:1);break;case"end":h[o]+=d*(n&&u?-1:1);break}return h}const LQ=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,a=s.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(e));let u=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:c,y:f}=V_(u,r,l),d=r,h={},p=0;for(let m=0;m<a.length;m++){const{name:g,fn:b}=a[m],{x:v,y,data:A,reset:x}=await b({x:c,y:f,initialPlacement:r,placement:d,strategy:i,middlewareData:h,rects:u,platform:o,elements:{reference:t,floating:e}});c=v??c,f=y??f,h={...h,[g]:{...h[g],...A}},x&&p<=50&&(p++,typeof x=="object"&&(x.placement&&(d=x.placement),x.rects&&(u=x.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:i}):x.rects),{x:c,y:f}=V_(u,d,l)),m=-1)}return{x:c,y:f,placement:d,strategy:i,middlewareData:h}};async function gh(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:s,rects:o,elements:a,strategy:l}=t,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:d=!1,padding:h=0}=Fs(e,t),p=U_(h),g=a[d?f==="floating"?"reference":"floating":f],b=Ag(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(g)))==null||n?g:g.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),v=f==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,y=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),A=await(s.isElement==null?void 0:s.isElement(y))?await(s.getScale==null?void 0:s.getScale(y))||{x:1,y:1}:{x:1,y:1},x=Ag(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:y,strategy:l}):v);return{top:(b.top-x.top+p.top)/A.y,bottom:(x.bottom-b.bottom+p.bottom)/A.y,left:(b.left-x.left+p.left)/A.x,right:(x.right-b.right+p.right)/A.x}}const BQ=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:s,platform:o,elements:a,middlewareData:l}=e,{element:u,padding:c=0}=Fs(t,e)||{};if(u==null)return{};const f=U_(c),d={x:n,y:r},h=_v(i),p=Mv(h),m=await o.getDimensions(u),g=h==="y",b=g?"top":"left",v=g?"bottom":"right",y=g?"clientHeight":"clientWidth",A=s.reference[p]+s.reference[h]-d[h]-s.floating[p],x=d[h]-s.reference[h],k=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let S=k?k[y]:0;(!S||!await(o.isElement==null?void 0:o.isElement(k)))&&(S=a.floating[y]||s.floating[p]);const E=A/2-x/2,D=S/2-m[p]/2-1,T=Zi(f[b],D),R=Zi(f[v],D),L=T,B=S-m[p]-R,z=S/2-m[p]/2+E,F=Ov(L,z,B),$=!l.arrow&&fc(i)!=null&&z!==F&&s.reference[p]/2-(z<L?T:R)-m[p]/2<0,Y=$?z<L?z-L:z-B:0;return{[h]:d[h]+Y,data:{[h]:F,centerOffset:z-F-Y,...$&&{alignmentOffset:Y}},reset:$}}}),FQ=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:s,rects:o,initialPlacement:a,platform:l,elements:u}=e,{mainAxis:c=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...g}=Fs(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const b=js(i),v=js(a)===a,y=await(l.isRTL==null?void 0:l.isRTL(u.floating)),A=d||(v||!m?[wg(a)]:NQ(a));!d&&p!=="none"&&A.push(...PQ(a,m,p,y));const x=[a,...A],k=await gh(e,g),S=[];let E=((r=s.flip)==null?void 0:r.overflows)||[];if(c&&S.push(k[b]),f){const L=_Q(i,o,y);S.push(k[L[0]],k[L[1]])}if(E=[...E,{placement:i,overflows:S}],!S.every(L=>L<=0)){var D,T;const L=(((D=s.flip)==null?void 0:D.index)||0)+1,B=x[L];if(B)return{data:{index:L,overflows:E},reset:{placement:B}};let z=(T=E.filter(F=>F.overflows[0]<=0).sort((F,$)=>F.overflows[1]-$.overflows[1])[0])==null?void 0:T.placement;if(!z)switch(h){case"bestFit":{var R;const F=(R=E.map($=>[$.placement,$.overflows.filter(Y=>Y>0).reduce((Y,ie)=>Y+ie,0)]).sort(($,Y)=>$[1]-Y[1])[0])==null?void 0:R[0];F&&(z=F);break}case"initialPlacement":z=a;break}if(i!==z)return{reset:{placement:z}}}return{}}}};function H_(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function z_(t){return OQ.some(e=>t[e]>=0)}const jQ=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...i}=Fs(t,e);switch(r){case"referenceHidden":{const s=await gh(e,{...i,elementContext:"reference"}),o=H_(s,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:z_(o)}}}case"escaped":{const s=await gh(e,{...i,altBoundary:!0}),o=H_(s,n.floating);return{data:{escapedOffsets:o,escaped:z_(o)}}}default:return{}}}}};async function UQ(t,e){const{placement:n,platform:r,elements:i}=t,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=js(n),a=fc(n),l=dc(n)==="y",u=["left","top"].includes(o)?-1:1,c=s&&l?-1:1,f=Fs(e,t);let{mainAxis:d,crossAxis:h,alignmentAxis:p}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&typeof p=="number"&&(h=a==="end"?p*-1:p),l?{x:h*c,y:d*u}:{x:d*u,y:h*c}}const VQ=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:s,placement:o,middlewareData:a}=e,l=await UQ(e,t);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:o}}}}},HQ=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:g=>{let{x:b,y:v}=g;return{x:b,y:v}}},...l}=Fs(t,e),u={x:n,y:r},c=await gh(e,l),f=dc(js(i)),d=Dv(f);let h=u[d],p=u[f];if(s){const g=d==="y"?"top":"left",b=d==="y"?"bottom":"right",v=h+c[g],y=h-c[b];h=Ov(v,h,y)}if(o){const g=f==="y"?"top":"left",b=f==="y"?"bottom":"right",v=p+c[g],y=p-c[b];p=Ov(v,p,y)}const m=a.fn({...e,[d]:h,[f]:p});return{...m,data:{x:m.x-n,y:m.y-r}}}}},zQ=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:i,rects:s,middlewareData:o}=e,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=Fs(t,e),c={x:n,y:r},f=dc(i),d=Dv(f);let h=c[d],p=c[f];const m=Fs(a,e),g=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const y=d==="y"?"height":"width",A=s.reference[d]-s.floating[y]+g.mainAxis,x=s.reference[d]+s.reference[y]-g.mainAxis;h<A?h=A:h>x&&(h=x)}if(u){var b,v;const y=d==="y"?"width":"height",A=["top","left"].includes(js(i)),x=s.reference[f]-s.floating[y]+(A&&((b=o.offset)==null?void 0:b[f])||0)+(A?0:g.crossAxis),k=s.reference[f]+s.reference[y]+(A?0:((v=o.offset)==null?void 0:v[f])||0)-(A?g.crossAxis:0);p<x?p=x:p>k&&(p=k)}return{[d]:h,[f]:p}}}},$Q=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:r,platform:i,elements:s}=e,{apply:o=()=>{},...a}=Fs(t,e),l=await gh(e,a),u=js(n),c=fc(n),f=dc(n)==="y",{width:d,height:h}=r.floating;let p,m;u==="top"||u==="bottom"?(p=u,m=c===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(m=u,p=c==="end"?"top":"bottom");const g=h-l.top-l.bottom,b=d-l.left-l.right,v=Zi(h-l[p],g),y=Zi(d-l[m],b),A=!e.middlewareData.shift;let x=v,k=y;if(f?k=c||A?Zi(y,b):b:x=c||A?Zi(v,g):g,A&&!c){const E=Mr(l.left,0),D=Mr(l.right,0),T=Mr(l.top,0),R=Mr(l.bottom,0);f?k=d-2*(E!==0||D!==0?E+D:Mr(l.left,l.right)):x=h-2*(T!==0||R!==0?T+R:Mr(l.top,l.bottom))}await o({...e,availableWidth:k,availableHeight:x});const S=await i.getDimensions(s.floating);return d!==S.width||h!==S.height?{reset:{rects:!0}}:{}}}};function hc(t){return $_(t)?(t.nodeName||"").toLowerCase():"#document"}function _r(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Us(t){var e;return(e=($_(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function $_(t){return t instanceof Node||t instanceof _r(t).Node}function es(t){return t instanceof Element||t instanceof _r(t).Element}function ts(t){return t instanceof HTMLElement||t instanceof _r(t).HTMLElement}function G_(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof _r(t).ShadowRoot}function yh(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=Ai(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function GQ(t){return["table","td","th"].includes(hc(t))}function Rv(t){const e=Pv(),n=Ai(t);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function WQ(t){let e=Ko(t);for(;ts(e)&&!pc(e);){if(Rv(e))return e;e=Ko(e)}return null}function Pv(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function pc(t){return["html","body","#document"].includes(hc(t))}function Ai(t){return _r(t).getComputedStyle(t)}function vg(t){return es(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Ko(t){if(hc(t)==="html")return t;const e=t.assignedSlot||t.parentNode||G_(t)&&t.host||Us(t);return G_(e)?e.host:e}function W_(t){const e=Ko(t);return pc(e)?t.ownerDocument?t.ownerDocument.body:t.body:ts(e)&&yh(e)?e:W_(e)}function bh(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=W_(t),s=i===((r=t.ownerDocument)==null?void 0:r.body),o=_r(i);return s?e.concat(o,o.visualViewport||[],yh(i)?i:[],o.frameElement&&n?bh(o.frameElement):[]):e.concat(i,bh(i,[],n))}function K_(t){const e=Ai(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=ts(t),s=i?t.offsetWidth:n,o=i?t.offsetHeight:r,a=yg(n)!==s||yg(r)!==o;return a&&(n=s,r=o),{width:n,height:r,$:a}}function Iv(t){return es(t)?t:t.contextElement}function mc(t){const e=Iv(t);if(!ts(e))return Wo(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:s}=K_(e);let o=(s?yg(n.width):n.width)/r,a=(s?yg(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const KQ=Wo(0);function q_(t){const e=_r(t);return!Pv()||!e.visualViewport?KQ:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function qQ(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==_r(t)?!1:e}function wl(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=Iv(t);let o=Wo(1);e&&(r?es(r)&&(o=mc(r)):o=mc(t));const a=qQ(s,n,r)?q_(s):Wo(0);let l=(i.left+a.x)/o.x,u=(i.top+a.y)/o.y,c=i.width/o.x,f=i.height/o.y;if(s){const d=_r(s),h=r&&es(r)?_r(r):r;let p=d,m=p.frameElement;for(;m&&r&&h!==p;){const g=mc(m),b=m.getBoundingClientRect(),v=Ai(m),y=b.left+(m.clientLeft+parseFloat(v.paddingLeft))*g.x,A=b.top+(m.clientTop+parseFloat(v.paddingTop))*g.y;l*=g.x,u*=g.y,c*=g.x,f*=g.y,l+=y,u+=A,p=_r(m),m=p.frameElement}}return Ag({width:c,height:f,x:l,y:u})}const QQ=[":popover-open",":modal"];function Lv(t){return QQ.some(e=>{try{return t.matches(e)}catch{return!1}})}function JQ(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const s=i==="fixed",o=Us(r),a=e?Lv(e.floating):!1;if(r===o||a&&s)return n;let l={scrollLeft:0,scrollTop:0},u=Wo(1);const c=Wo(0),f=ts(r);if((f||!f&&!s)&&((hc(r)!=="body"||yh(o))&&(l=vg(r)),ts(r))){const d=wl(r);u=mc(r),c.x=d.x+r.clientLeft,c.y=d.y+r.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x,y:n.y*u.y-l.scrollTop*u.y+c.y}}function YQ(t){return Array.from(t.getClientRects())}function Q_(t){return wl(Us(t)).left+vg(t).scrollLeft}function XQ(t){const e=Us(t),n=vg(t),r=t.ownerDocument.body,i=Mr(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=Mr(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+Q_(t);const a=-n.scrollTop;return Ai(r).direction==="rtl"&&(o+=Mr(e.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}function ZQ(t,e){const n=_r(t),r=Us(t),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;const u=Pv();(!u||u&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:s,height:o,x:a,y:l}}function eJ(t,e){const n=wl(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,s=ts(t)?mc(t):Wo(1),o=t.clientWidth*s.x,a=t.clientHeight*s.y,l=i*s.x,u=r*s.y;return{width:o,height:a,x:l,y:u}}function J_(t,e,n){let r;if(e==="viewport")r=ZQ(t,n);else if(e==="document")r=XQ(Us(t));else if(es(e))r=eJ(e,n);else{const i=q_(t);r={...e,x:e.x-i.x,y:e.y-i.y}}return Ag(r)}function Y_(t,e){const n=Ko(t);return n===e||!es(n)||pc(n)?!1:Ai(n).position==="fixed"||Y_(n,e)}function tJ(t,e){const n=e.get(t);if(n)return n;let r=bh(t,[],!1).filter(a=>es(a)&&hc(a)!=="body"),i=null;const s=Ai(t).position==="fixed";let o=s?Ko(t):t;for(;es(o)&&!pc(o);){const a=Ai(o),l=Rv(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||yh(o)&&!l&&Y_(t,o))?r=r.filter(c=>c!==o):i=a,o=Ko(o)}return e.set(t,r),r}function nJ(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const o=[...n==="clippingAncestors"?Lv(e)?[]:tJ(e,this._c):[].concat(n),r],a=o[0],l=o.reduce((u,c)=>{const f=J_(e,c,i);return u.top=Mr(f.top,u.top),u.right=Zi(f.right,u.right),u.bottom=Zi(f.bottom,u.bottom),u.left=Mr(f.left,u.left),u},J_(e,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function rJ(t){const{width:e,height:n}=K_(t);return{width:e,height:n}}function iJ(t,e,n){const r=ts(e),i=Us(e),s=n==="fixed",o=wl(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const l=Wo(0);if(r||!r&&!s)if((hc(e)!=="body"||yh(i))&&(a=vg(e)),r){const f=wl(e,!0,s,e);l.x=f.x+e.clientLeft,l.y=f.y+e.clientTop}else i&&(l.x=Q_(i));const u=o.left+a.scrollLeft-l.x,c=o.top+a.scrollTop-l.y;return{x:u,y:c,width:o.width,height:o.height}}function Bv(t){return Ai(t).position==="static"}function X_(t,e){return!ts(t)||Ai(t).position==="fixed"?null:e?e(t):t.offsetParent}function Z_(t,e){const n=_r(t);if(Lv(t))return n;if(!ts(t)){let i=Ko(t);for(;i&&!pc(i);){if(es(i)&&!Bv(i))return i;i=Ko(i)}return n}let r=X_(t,e);for(;r&&GQ(r)&&Bv(r);)r=X_(r,e);return r&&pc(r)&&Bv(r)&&!Rv(r)?n:r||WQ(t)||n}const sJ=async function(t){const e=this.getOffsetParent||Z_,n=this.getDimensions,r=await n(t.floating);return{reference:iJ(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function oJ(t){return Ai(t).direction==="rtl"}const aJ={convertOffsetParentRelativeRectToViewportRelativeRect:JQ,getDocumentElement:Us,getClippingRect:nJ,getOffsetParent:Z_,getElementRects:sJ,getClientRects:YQ,getDimensions:rJ,getScale:mc,isElement:es,isRTL:oJ};function lJ(t,e){let n=null,r;const i=Us(t);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const{left:u,top:c,width:f,height:d}=t.getBoundingClientRect();if(a||e(),!f||!d)return;const h=bg(c),p=bg(i.clientWidth-(u+f)),m=bg(i.clientHeight-(c+d)),g=bg(u),v={rootMargin:-h+"px "+-p+"px "+-m+"px "+-g+"px",threshold:Mr(0,Zi(1,l))||1};let y=!0;function A(x){const k=x[0].intersectionRatio;if(k!==l){if(!y)return o();k?o(!1,k):r=setTimeout(()=>{o(!1,1e-7)},1e3)}y=!1}try{n=new IntersectionObserver(A,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(A,v)}n.observe(t)}return o(!0),s}function uJ(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=Iv(t),c=i||s?[...u?bh(u):[],...bh(e)]:[];c.forEach(b=>{i&&b.addEventListener("scroll",n,{passive:!0}),s&&b.addEventListener("resize",n)});const f=u&&a?lJ(u,n):null;let d=-1,h=null;o&&(h=new ResizeObserver(b=>{let[v]=b;v&&v.target===u&&h&&(h.unobserve(e),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var y;(y=h)==null||y.observe(e)})),n()}),u&&!l&&h.observe(u),h.observe(e));let p,m=l?wl(t):null;l&&g();function g(){const b=wl(t);m&&(b.x!==m.x||b.y!==m.y||b.width!==m.width||b.height!==m.height)&&n(),m=b,p=requestAnimationFrame(g)}return n(),()=>{var b;c.forEach(v=>{i&&v.removeEventListener("scroll",n),s&&v.removeEventListener("resize",n)}),f==null||f(),(b=h)==null||b.disconnect(),h=null,l&&cancelAnimationFrame(p)}}const cJ=VQ,fJ=HQ,dJ=FQ,hJ=$Q,pJ=jQ,eN=BQ,mJ=zQ,gJ=(t,e,n)=>{const r=new Map,i={platform:aJ,...n},s={...i.platform,_c:r};return LQ(t,e,{...i,platform:s})};var xg=typeof document<"u"?N.useLayoutEffect:N.useEffect;function kg(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!kg(t[r],e[r]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const s=i[r];if(!(s==="_owner"&&t.$$typeof)&&!kg(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function tN(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function nN(t,e){const n=tN(t);return Math.round(e*n)/n}function rN(t){const e=G.useRef(t);return xg(()=>{e.current=t}),e}function yJ(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:l,open:u}=t,[c,f]=G.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[d,h]=G.useState(r);kg(d,r)||h(r);const[p,m]=G.useState(null),[g,b]=G.useState(null),v=G.useCallback(Y=>{Y!==k.current&&(k.current=Y,m(Y))},[]),y=G.useCallback(Y=>{Y!==S.current&&(S.current=Y,b(Y))},[]),A=s||p,x=o||g,k=G.useRef(null),S=G.useRef(null),E=G.useRef(c),D=l!=null,T=rN(l),R=rN(i),L=G.useCallback(()=>{if(!k.current||!S.current)return;const Y={placement:e,strategy:n,middleware:d};R.current&&(Y.platform=R.current),gJ(k.current,S.current,Y).then(ie=>{const ee={...ie,isPositioned:!0};B.current&&!kg(E.current,ee)&&(E.current=ee,wb.flushSync(()=>{f(ee)}))})},[d,e,n,R]);xg(()=>{u===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,f(Y=>({...Y,isPositioned:!1})))},[u]);const B=G.useRef(!1);xg(()=>(B.current=!0,()=>{B.current=!1}),[]),xg(()=>{if(A&&(k.current=A),x&&(S.current=x),A&&x){if(T.current)return T.current(A,x,L);L()}},[A,x,L,T,D]);const z=G.useMemo(()=>({reference:k,floating:S,setReference:v,setFloating:y}),[v,y]),F=G.useMemo(()=>({reference:A,floating:x}),[A,x]),$=G.useMemo(()=>{const Y={position:n,left:0,top:0};if(!F.floating)return Y;const ie=nN(F.floating,c.x),ee=nN(F.floating,c.y);return a?{...Y,transform:"translate("+ie+"px, "+ee+"px)",...tN(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ie,top:ee}},[n,a,F.floating,c.x,c.y]);return G.useMemo(()=>({...c,update:L,refs:z,elements:F,floatingStyles:$}),[c,L,z,F,$])}const bJ=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:i}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?eN({element:r.current,padding:i}).fn(n):{}:r?eN({element:r,padding:i}).fn(n):{}}}},wJ=(t,e)=>({...cJ(t),options:[t,e]}),AJ=(t,e)=>({...fJ(t),options:[t,e]}),vJ=(t,e)=>({...mJ(t),options:[t,e]}),xJ=(t,e)=>({...dJ(t),options:[t,e]}),kJ=(t,e)=>({...hJ(t),options:[t,e]}),EJ=(t,e)=>({...pJ(t),options:[t,e]}),CJ=(t,e)=>({...bJ(t),options:[t,e]});var SJ="Arrow",iN=G.forwardRef((t,e)=>{const{children:n,width:r=10,height:i=5,...s}=t;return O.jsx(sr.svg,{...s,ref:e,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:O.jsx("polygon",{points:"0,0 30,0 15,10"})})});iN.displayName=SJ;var TJ=iN;function OJ(t){const[e,n]=G.useState(void 0);return tl(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,a;if("borderBoxSize"in s){const l=s.borderBoxSize,u=Array.isArray(l)?l[0]:l;o=u.inlineSize,a=u.blockSize}else o=t.offsetWidth,a=t.offsetHeight;n({width:o,height:a})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var Fv="Popper",[sN,oN]=fw(Fv),[DJ,aN]=sN(Fv),lN=t=>{const{__scopePopper:e,children:n}=t,[r,i]=G.useState(null);return O.jsx(DJ,{scope:e,anchor:r,onAnchorChange:i,children:n})};lN.displayName=Fv;var uN="PopperAnchor",cN=G.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...i}=t,s=aN(uN,n),o=G.useRef(null),a=Gr(e,o);return G.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:O.jsx(sr.div,{...i,ref:a})});cN.displayName=uN;var jv="PopperContent",[MJ,_J]=sN(jv),fN=G.forwardRef((t,e)=>{var Ve,me,Ke,fe,oe,de;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:c=0,sticky:f="partial",hideWhenDetached:d=!1,updatePositionStrategy:h="optimized",onPlaced:p,...m}=t,g=aN(jv,n),[b,v]=G.useState(null),y=Gr(e,ae=>v(ae)),[A,x]=G.useState(null),k=OJ(A),S=(k==null?void 0:k.width)??0,E=(k==null?void 0:k.height)??0,D=r+(s!=="center"?"-"+s:""),T=typeof c=="number"?c:{top:0,right:0,bottom:0,left:0,...c},R=Array.isArray(u)?u:[u],L=R.length>0,B={padding:T,boundary:R.filter(RJ),altBoundary:L},{refs:z,floatingStyles:F,placement:$,isPositioned:Y,middlewareData:ie}=yJ({strategy:"fixed",placement:D,whileElementsMounted:(...ae)=>uJ(...ae,{animationFrame:h==="always"}),elements:{reference:g.anchor},middleware:[wJ({mainAxis:i+E,alignmentAxis:o}),l&&AJ({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?vJ():void 0,...B}),l&&xJ({...B}),kJ({...B,apply:({elements:ae,rects:te,availableWidth:j,availableHeight:q})=>{const{width:K,height:pe}=te.reference,P=ae.floating.style;P.setProperty("--radix-popper-available-width",`${j}px`),P.setProperty("--radix-popper-available-height",`${q}px`),P.setProperty("--radix-popper-anchor-width",`${K}px`),P.setProperty("--radix-popper-anchor-height",`${pe}px`)}}),A&&CJ({element:A,padding:a}),PJ({arrowWidth:S,arrowHeight:E}),d&&EJ({strategy:"referenceHidden",...B})]}),[ee,Ae]=pN($),Me=Po(p);tl(()=>{Y&&(Me==null||Me())},[Y,Me]);const Be=(Ve=ie.arrow)==null?void 0:Ve.x,_e=(me=ie.arrow)==null?void 0:me.y,Ee=((Ke=ie.arrow)==null?void 0:Ke.centerOffset)!==0,[Ue,H]=G.useState();return tl(()=>{b&&H(window.getComputedStyle(b).zIndex)},[b]),O.jsx("div",{ref:z.setFloating,"data-radix-popper-content-wrapper":"",style:{...F,transform:Y?F.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Ue,"--radix-popper-transform-origin":[(fe=ie.transformOrigin)==null?void 0:fe.x,(oe=ie.transformOrigin)==null?void 0:oe.y].join(" "),...((de=ie.hide)==null?void 0:de.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:O.jsx(MJ,{scope:n,placedSide:ee,onArrowChange:x,arrowX:Be,arrowY:_e,shouldHideArrow:Ee,children:O.jsx(sr.div,{"data-side":ee,"data-align":Ae,...m,ref:y,style:{...m.style,animation:Y?void 0:"none"}})})})});fN.displayName=jv;var dN="PopperArrow",NJ={top:"bottom",right:"left",bottom:"top",left:"right"},hN=G.forwardRef(function(e,n){const{__scopePopper:r,...i}=e,s=_J(dN,r),o=NJ[s.placedSide];return O.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:O.jsx(TJ,{...i,ref:n,style:{...i.style,display:"block"}})})});hN.displayName=dN;function RJ(t){return t!==null}var PJ=t=>({name:"transformOrigin",options:t,fn(e){var g,b,v;const{placement:n,rects:r,middlewareData:i}=e,o=((g=i.arrow)==null?void 0:g.centerOffset)!==0,a=o?0:t.arrowWidth,l=o?0:t.arrowHeight,[u,c]=pN(n),f={start:"0%",center:"50%",end:"100%"}[c],d=(((b=i.arrow)==null?void 0:b.x)??0)+a/2,h=(((v=i.arrow)==null?void 0:v.y)??0)+l/2;let p="",m="";return u==="bottom"?(p=o?f:`${d}px`,m=`${-l}px`):u==="top"?(p=o?f:`${d}px`,m=`${r.floating.height+l}px`):u==="right"?(p=`${-l}px`,m=o?f:`${h}px`):u==="left"&&(p=`${r.floating.width+l}px`,m=o?f:`${h}px`),{data:{x:p,y:m}}}});function pN(t){const[e,n="center"]=t.split("-");return[e,n]}var IJ=lN,mN=cN,LJ=fN,BJ=hN,Uv="Popover",[gN,pde]=fw(Uv,[oN]),wh=oN(),[FJ,Al]=gN(Uv),yN=t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:o=!1}=t,a=wh(e),l=G.useRef(null),[u,c]=G.useState(!1),[f=!1,d]=i3({prop:r,defaultProp:i,onChange:s});return O.jsx(IJ,{...a,children:O.jsx(FJ,{scope:e,contentId:_0(),triggerRef:l,open:f,onOpenChange:d,onOpenToggle:G.useCallback(()=>d(h=>!h),[d]),hasCustomAnchor:u,onCustomAnchorAdd:G.useCallback(()=>c(!0),[]),onCustomAnchorRemove:G.useCallback(()=>c(!1),[]),modal:o,children:n})})};yN.displayName=Uv;var bN="PopoverAnchor",jJ=G.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Al(bN,n),s=wh(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:a}=i;return G.useEffect(()=>(o(),()=>a()),[o,a]),O.jsx(mN,{...s,...r,ref:e})});jJ.displayName=bN;var wN="PopoverTrigger",AN=G.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Al(wN,n),s=wh(n),o=Gr(e,i.triggerRef),a=O.jsx(sr.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":CN(i.open),...r,ref:o,onClick:Cr(t.onClick,i.onOpenToggle)});return i.hasCustomAnchor?a:O.jsx(mN,{asChild:!0,...s,children:a})});AN.displayName=wN;var UJ="PopoverPortal",[mde,VJ]=gN(UJ,{forceMount:void 0}),gc="PopoverContent",vN=G.forwardRef((t,e)=>{const n=VJ(gc,t.__scopePopover),{forceMount:r=n.forceMount,...i}=t,s=Al(gc,t.__scopePopover);return O.jsx(Rd,{present:r||s.open,children:s.modal?O.jsx(HJ,{...i,ref:e}):O.jsx(zJ,{...i,ref:e})})});vN.displayName=gc;var HJ=G.forwardRef((t,e)=>{const n=Al(gc,t.__scopePopover),r=G.useRef(null),i=Gr(e,r),s=G.useRef(!1);return G.useEffect(()=>{const o=r.current;if(o)return M3(o)},[]),O.jsx(xw,{as:N0,allowPinchZoom:!0,children:O.jsx(xN,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Cr(t.onCloseAutoFocus,o=>{var a;o.preventDefault(),s.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Cr(t.onPointerDownOutside,o=>{const a=o.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,u=a.button===2||l;s.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:Cr(t.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),zJ=G.forwardRef((t,e)=>{const n=Al(gc,t.__scopePopover),r=G.useRef(!1),i=G.useRef(!1);return O.jsx(xN,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o,a;(o=t.onCloseAutoFocus)==null||o.call(t,s),s.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{var l,u;(l=t.onInteractOutside)==null||l.call(t,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=s.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),xN=G.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:o,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:c,...f}=t,d=Al(gc,n),h=wh(n);return m3(),O.jsx(Vu,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:O.jsx(pw,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:c,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>d.onOpenChange(!1),children:O.jsx(LJ,{"data-state":CN(d.open),role:"dialog",id:d.contentId,...h,...f,ref:e,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),kN="PopoverClose",EN=G.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Al(kN,n);return O.jsx(sr.button,{type:"button",...r,ref:e,onClick:Cr(t.onClick,()=>i.onOpenChange(!1))})});EN.displayName=kN;var $J="PopoverArrow",GJ=G.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=wh(n);return O.jsx(BJ,{...i,...r,ref:e})});GJ.displayName=$J;function CN(t){return t?"open":"closed"}var WJ=yN,KJ=AN,qJ=vN,Eg=EN;const Cg=({children:t,isActive:e,onClick:n,disabled:r,className:i})=>{const s=ve("flex items-center gap-2 p-1.5 text-xs font-medium text-neutral-500 text-left w-full rounded-md border border-transparent transition-all",!e&&!r,"hover:border-neutral-200 hover:bg-neutral-100",e&&!r&&"bg-neutral-200 text-neutral-800",r&&"text-neutral-300 cursor-not-allowed",i);return O.jsx("button",{className:s,disabled:r,onClick:n,children:t})},QJ=(t,e,n)=>{const r=N.useCallback(()=>{const a=t.chain();a.setNodeSelection(n).unsetAllMarks(),(e==null?void 0:e.type.name)!=="paragraph"&&a.setParagraph(),a.run()},[t,n,e==null?void 0:e.type.name]),i=N.useCallback(()=>{t.commands.setNodeSelection(n);const{$anchor:a}=t.state.selection,l=a.node(1)||t.state.selection.node;t.chain().setMeta("hideDragHandle",!0).insertContentAt(n+((e==null?void 0:e.nodeSize)||0),l.toJSON()).run()},[t,n,e==null?void 0:e.nodeSize]),s=N.useCallback(()=>{t.chain().setMeta("hideDragHandle",!0).setNodeSelection(n).run(),document.execCommand("copy"),alert("copied")},[t,n]),o=N.useCallback(()=>{t.chain().setMeta("hideDragHandle",!0).setNodeSelection(n).deleteSelection().run()},[t,n]);return{resetTextFormatting:r,duplicateNode:i,copyNodeToClipboard:s,deleteNode:o}},JJ=({node:t,getPos:e,editor:n,deleteNode:r})=>{const[i,s]=N.useState(!1),o=QJ(n,t,e()),a=X0(),l=["https://twitter.com","https://x.com"],u=N.useMemo(()=>{const{content:D}=t.content;return D[0].type.name==="table"},[t.content]),c=N.useMemo(()=>{var T;const{content:D}=t.content;return(T=D[0].content.content[0])==null?void 0:T.text},[t.content]),f=N.useMemo(()=>{var T;const{content:D}=t.content;return(T=D[0].content.content[1])==null?void 0:T.text},[t.content]),d=N.useMemo(()=>{const{content:D}=t.content;return D[0].content.content.find(T=>{var R;return(R=T==null?void 0:T.text)==null?void 0:R.match(/\/status\/([0-9]*)/)})},[t.content]),h=()=>{if(!c)return;let D=c;if(c.includes("<iframe"))D=f;else switch(!0){case/youtu\.?be(?:\.com)?\/(?:.*v(?:\/|=)|(?:.*\/)?)([a-zA-Z0-9-_]+)/.test(c):{const z=c.match(/youtu\.?be(?:\.com)?\/(?:.*v(?:\/|=)|(?:.*\/)?)([a-zA-Z0-9-_]+)/);z&&z.length>0&&(D=`https://www.youtube.com/embed/${z[1]}`);break}case/vimeo\.com\/([a-zA-Z0-9-_]+)/.test(c):{const z=c.match(/vimeo\.com\/([a-zA-Z0-9-_]+)/);z&&z.length>0&&(D=`https://player.vimeo.com/video/${z[1]}`);break}default:return}const T=640,R=360,L=e(),B=L+t.nodeSize;D&&(n==null||n.chain().focus(L).deleteRange({from:L===0?L:L+1,to:B}).setIframe({src:D,width:T,height:R}).run())},p=D=>{const T=D.match(/\/status\/([0-9]*)/);return T&&T.length>0?T[1]:null},m=()=>{if(!c)return;let D=c;const T=l.some(z=>c.includes(z)),R=p(c);T&&R?D=R:d&&(D=p(d.text));const L=e(),B=L+t.nodeSize;D&&(n==null||n.chain().focus(L).deleteRange({from:L===2?L:L+1,to:B}).setTweetEmbed({tweetId:D}).run())},g=()=>{const D=e()+t.nodeSize;n.commands.insertContentAt(D,{type:"dBlock",content:[{type:"paragraph"}]})},b=()=>{const D=e();n.commands.insertContentAt(D,{type:"dBlock",content:[{type:"paragraph"}]})},v=()=>{r()},y=D=>{D.altKey?x():A()},A=()=>{g()},x=()=>{b()},k=D=>{D.altKey&&v()},E=j_(()=>{if(l.some(D=>c.includes(D))||d!=null&&d.text){m();return}else{h();return}},1e3);return N.useEffect(()=>{c&&E()},[c]),O.jsxs(Dd,{as:"div",className:ve("flex gap-2 group w-full relative justify-center items-start",a&&"pointer-events-none",u&&"pointer-events-auto"),children:[O.jsxs("section",{className:"lg:flex gap-1 hidden","aria-label":"left-menu",contentEditable:!1,children:[O.jsx(GO,{content:O.jsxs("div",{className:"flex flex-col w-40",children:[O.jsx("div",{className:"text-xs",children:"Click to add below"}),O.jsx("div",{className:"text-xs",children:"Opt + Click to add above"})]}),children:O.jsx("div",{className:`d-block-button cursor-pointer ${!a&&"group-hover:opacity-100"}`,contentEditable:!1,onClick:y,children:O.jsx(aV,{size:18})})}),O.jsx(Vu,{onMountAutoFocus:D=>D.preventDefault(),trapped:!1,children:O.jsxs(WJ,{open:i,onOpenChange:s,children:[O.jsx(KJ,{asChild:!0,children:O.jsx("div",{className:`d-block-button cursor-pointer ${!a&&"group-hover:opacity-100"}`,contentEditable:!1,draggable:!0,"data-drag-handle":!0,onClick:k,children:O.jsx(eV,{size:18})})}),O.jsx(qJ,{side:"bottom",align:"start",sideOffset:8,className:"z-10",children:O.jsxs(Jw,{className:"p-2 flex flex-col min-w-[16rem]",children:[O.jsx(Eg,{children:O.jsxs(Cg,{onClick:o.resetTextFormatting,children:[O.jsx(uV,{size:18}),"Clear formatting"]})}),O.jsx(Eg,{children:O.jsxs(Cg,{onClick:o.copyNodeToClipboard,children:[O.jsx(JU,{size:18}),"Copy to clipboard"]})}),O.jsx(Eg,{children:O.jsxs(Cg,{onClick:o.duplicateNode,children:[O.jsx(XU,{size:18}),"Duplicate"]})}),O.jsx(Wu.Divider,{horizontal:!0}),O.jsx(Eg,{children:O.jsxs(Cg,{onClick:o.deleteNode,className:"text-red-500 hover:bg-red-500 bg-opacity-10 hover:bg-opacity-20",children:[O.jsx(aw,{size:18}),"Delete"]})})]})})]})})]}),O.jsx(WT,{className:ve("node-view-content w-full",{"is-table":u})})]})},YJ=Xe.create({name:"dBlock",priority:1e3,group:"dBlock",content:"(block|columns)",draggable:!0,selectable:!1,inline:!1,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:'div[data-type="d-block"]'}]},renderHTML({HTMLAttributes:t}){return["div",rt(t,{"data-type":"d-block"}),0]},addCommands(){return{setDBlock:t=>({state:e,chain:n})=>{const{selection:{from:r}}=e,i=t!==void 0||t!==null?r:t;return n().insertContentAt(i,{type:this.name,content:[{type:"paragraph"}]}).focus(i+2).run()}}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setDBlock(),Enter:({editor:t})=>{var u;const{selection:{$head:e,from:n,to:r},doc:i}=t.state,s=e.node(e.depth-1);if((s==null?void 0:s.type.name)!=="dBlock"){const f=e.toString().split("/"),d=f.some(y=>y.includes("bulletList_0")||y.includes("orderedList_0")||y.includes("taskList_0")),h=f.some(y=>y.includes("paragraph_0:0")),p=e.parent.content.size===0,m=f.length===4&&h,g=f.some(y=>y.includes("paragraph_0:0"))&&f.length!==4,b=e.parent.content.size===0&&f.some(y=>y.includes("listItem_0")),v=f.some(y=>y.includes("paragraph_1:0"));if(m)return t.chain().liftListItem("listItem").focus().run();if(v)return t.chain().insertContent({type:"dBlock",content:[{type:"paragraph"}]}).focus().run();if(g&&d||b)return t.chain().liftListItem("listItem").focus().run();if(p&&d){const y=e.before(e.depth-1);return t.chain().deleteRange({from:y,to:y+s.nodeSize}).insertContentAt(n,{type:"dBlock",content:[{type:"paragraph"}]}).focus().run()}return!1}let o=-1,a="";i.descendants((c,f)=>{if(o!==-1)return!1;if(c.type.name===this.name)return;const[d,h]=[f,f+c.nodeSize];return d<=n&&r<=h&&(o=h,a=c.type.name),!1});const l=(u=i.slice(n,o))==null?void 0:u.toJSON().content;try{return a==="codeBlock"?t.chain().newlineInCode().focus().run():["columns","heading"].includes(a)?t.chain().insertContent({type:"dBlock",content:[{type:"paragraph"}]}).focus().run():t.chain().insertContentAt({from:n,to:o},{type:this.name,content:l}).focus().run()}catch(c){return console.error(`Error inserting content into dBlock node: ${c}`),!1}},Backspace:({editor:t})=>{var l;const{selection:{$head:e,from:n}}=t.state,r=e.node(e.depth-1),s=e.toString().split("/"),o=s.some(u=>u.includes("bulletList_0")||u.includes("orderedList_0")||u.includes("taskList_0"));if((r==null?void 0:r.type.name)!=="dBlock"){const c=s.some(g=>g.includes("listItem_0")||g.includes("taskItem_0"))&&s.some(g=>g.includes("paragraph_0:0")),d=s.some(g=>g.includes("dBlock_0"))&&c&&o,h=()=>e.node(e.depth-1).textContent,p=e.parent.content.size===0&&s.some(g=>g.includes("paragraph_0:0"))&&s.some(g=>g.includes("listItem_0")||g.includes("taskItem_0"))&&o&&s.length===4,m=e.node(e.depth-2).childCount>1;if(p){const g=e.before(e.depth-2);return m?t.chain().deleteRange({from:g+1,to:g+1+r.nodeSize}).insertContentAt(n-4,{type:"dBlock",content:[{type:"paragraph",content:[{type:"text",text:""}]}]}).focus().run():t.chain().liftListItem("listItem").focus().run()}if(d&&s.length===4){const g=e.node(e.depth-2),b=e.before(e.depth-2);return t.chain().deleteRange({from:b+1,to:b+1+(((l=g.firstChild)==null?void 0:l.nodeSize)||0)}).insertContentAt(n-4,{type:"dBlock",content:[{type:"paragraph",content:[{type:"text",text:h()}]}]}).focus("start").run()}}return e.toString().includes("dBlock_0")&&e.parent.content.size===0&&!o?t.chain().deleteNode("dBlock").focus().run():!1}}},addNodeView(){return el(JJ)}});let Vv,Hv;if(typeof WeakMap<"u"){let t=new WeakMap;Vv=e=>t.get(e),Hv=(e,n)=>(t.set(e,n),n)}else{let t=[],e=10,n=0;Vv=r=>{for(let i=0;i<t.length;i+=2)if(t[i]==r)return t[i+1]},Hv=(r,i)=>(n==e&&(n=0),t[n++]=r,t[n++]=i)}class yc{constructor(e,n,r,i){this.left=e,this.top=n,this.right=r,this.bottom=i}}class Vt{constructor(e,n,r,i){this.width=e,this.height=n,this.map=r,this.problems=i}findCell(e){for(let n=0;n<this.map.length;n++){let r=this.map[n];if(r!=e)continue;let i=n%this.width,s=n/this.width|0,o=i+1,a=s+1;for(let l=1;o<this.width&&this.map[n+l]==r;l++)o++;for(let l=1;a<this.height&&this.map[n+this.width*l]==r;l++)a++;return new yc(i,s,o,a)}throw new RangeError("No cell with offset "+e+" found")}colCount(e){for(let n=0;n<this.map.length;n++)if(this.map[n]==e)return n%this.width;throw new RangeError("No cell with offset "+e+" found")}nextCell(e,n,r){let{left:i,right:s,top:o,bottom:a}=this.findCell(e);return n=="horiz"?(r<0?i==0:s==this.width)?null:this.map[o*this.width+(r<0?i-1:s)]:(r<0?o==0:a==this.height)?null:this.map[i+this.width*(r<0?o-1:a)]}rectBetween(e,n){let{left:r,right:i,top:s,bottom:o}=this.findCell(e),{left:a,right:l,top:u,bottom:c}=this.findCell(n);return new yc(Math.min(r,a),Math.min(s,u),Math.max(i,l),Math.max(o,c))}cellsInRect(e){let n=[],r={};for(let i=e.top;i<e.bottom;i++)for(let s=e.left;s<e.right;s++){let o=i*this.width+s,a=this.map[o];r[a]||(r[a]=!0,(s!=e.left||!s||this.map[o-1]!=a)&&(i!=e.top||!i||this.map[o-this.width]!=a)&&n.push(a))}return n}positionAt(e,n,r){for(let i=0,s=0;;i++){let o=s+r.child(i).nodeSize;if(i==e){let a=n+e*this.width,l=(e+1)*this.width;for(;a<l&&this.map[a]<s;)a++;return a==l?o-1:this.map[a]}s=o}}static get(e){return Vv(e)||Hv(e,XJ(e))}}function XJ(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);let e=ZJ(t),n=t.childCount,r=[],i=0,s=null,o=[];for(let u=0,c=e*n;u<c;u++)r[u]=0;for(let u=0,c=0;u<n;u++){let f=t.child(u);c++;for(let p=0;;p++){for(;i<r.length&&r[i]!=0;)i++;if(p==f.childCount)break;let m=f.child(p),{colspan:g,rowspan:b,colwidth:v}=m.attrs;for(let y=0;y<b;y++){if(y+u>=n){(s||(s=[])).push({type:"overlong_rowspan",pos:c,n:b-y});break}let A=i+y*e;for(let x=0;x<g;x++){r[A+x]==0?r[A+x]=c:(s||(s=[])).push({type:"collision",row:u,pos:c,n:g-x});let k=v&&v[x];if(k){let S=(A+x)%e*2,E=o[S];E==null||E!=k&&o[S+1]==1?(o[S]=k,o[S+1]=1):E==k&&o[S+1]++}}}i+=g,c+=m.nodeSize}let d=(u+1)*e,h=0;for(;i<d;)r[i++]==0&&h++;h&&(s||(s=[])).push({type:"missing",row:u,n:h}),c++}let a=new Vt(e,n,r,s),l=!1;for(let u=0;!l&&u<o.length;u+=2)o[u]!=null&&o[u+1]<n&&(l=!0);return l&&eY(a,o,t),a}function ZJ(t){let e=-1,n=!1;for(let r=0;r<t.childCount;r++){let i=t.child(r),s=0;if(n)for(let o=0;o<r;o++){let a=t.child(o);for(let l=0;l<a.childCount;l++){let u=a.child(l);o+u.attrs.rowspan>r&&(s+=u.attrs.colspan)}}for(let o=0;o<i.childCount;o++){let a=i.child(o);s+=a.attrs.colspan,a.attrs.rowspan>1&&(n=!0)}e==-1?e=s:e!=s&&(e=Math.max(e,s))}return e}function eY(t,e,n){t.problems||(t.problems=[]);for(let r=0,i={};r<t.map.length;r++){let s=t.map[r];if(i[s])continue;i[s]=!0;let o=n.nodeAt(s),a=null;for(let l=0;l<o.attrs.colspan;l++){let u=(r+l)%t.width,c=e[u*2];c!=null&&(!o.attrs.colwidth||o.attrs.colwidth[l]!=c)&&((a||(a=tY(o.attrs)))[l]=c)}a&&t.problems.unshift({type:"colwidth mismatch",pos:s,colwidth:a})}}function tY(t){if(t.colwidth)return t.colwidth.slice();let e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}function Nn(t){let e=t.cached.tableNodeTypes;if(!e){e=t.cached.tableNodeTypes={};for(let n in t.nodes){let r=t.nodes[n],i=r.spec.tableRole;i&&(e[i]=r)}}return e}const qo=new Mt("selectingCells");function bc(t){for(let e=t.depth-1;e>0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}function nY(t){for(let e=t.depth;e>0;e--){const n=t.node(e).type.spec.tableRole;if(n==="cell"||n==="header_cell")return t.node(e)}return null}function vi(t){let e=t.selection.$head;for(let n=e.depth;n>0;n--)if(e.node(n).type.spec.tableRole=="row")return!0;return!1}function Sg(t){let e=t.selection;return e.$anchorCell?e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell:e.node&&e.node.type.spec.tableRole=="cell"?e.$anchor:bc(e.$head)||rY(e.$head)}function rY(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){let r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){let r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n-e.nodeSize)}}function zv(t){return t.parent.type.spec.tableRole=="row"&&t.nodeAfter}function iY(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function $v(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function SN(t,e,n){let r=t.start(-1),s=Vt.get(t.node(-1)).nextCell(t.pos-r,e,n);return s==null?null:t.node(0).resolve(r+s)}function hn(t,e,n){let r={};for(let i in t)r[i]=t[i];return r[e]=n,r}function vl(t,e,n=1){let r=hn(t,"colspan",t.colspan-n);return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some(i=>i>0)||(r.colwidth=null)),r}function TN(t,e,n=1){let r=hn(t,"colspan",t.colspan+n);if(r.colwidth){r.colwidth=r.colwidth.slice();for(let i=0;i<n;i++)r.colwidth.splice(e,0,0)}return r}function sY(t,e,n){let r=Nn(e.type.schema).header_cell;for(let i=0;i<t.height;i++)if(e.nodeAt(t.map[n+i*t.width]).type!=r)return!1;return!0}class at extends He{constructor(e,n=e){let r=e.node(-1),i=Vt.get(r),s=e.start(-1),o=i.rectBetween(e.pos-s,n.pos-s),a=e.node(0),l=i.cellsInRect(o).filter(c=>c!=n.pos-s);l.unshift(n.pos-s);let u=l.map(c=>{let f=r.nodeAt(c),d=c+s+1;return new Pb(a.resolve(d),a.resolve(d+f.content.size))});super(u[0].$from,u[0].$to,u),this.$anchorCell=e,this.$headCell=n}map(e,n){let r=e.resolve(n.map(this.$anchorCell.pos)),i=e.resolve(n.map(this.$headCell.pos));if(zv(r)&&zv(i)&&$v(r,i)){let s=this.$anchorCell.node(-1)!=r.node(-1);return s&&this.isRowSelection()?at.rowSelection(r,i):s&&this.isColSelection()?at.colSelection(r,i):new at(r,i)}return Fe.between(r,i)}content(){let e=this.$anchorCell.node(-1),n=Vt.get(e),r=this.$anchorCell.start(-1),i=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),s={},o=[];for(let l=i.top;l<i.bottom;l++){let u=[];for(let c=l*n.width+i.left,f=i.left;f<i.right;f++,c++){let d=n.map[c];if(!s[d]){s[d]=!0;let h=n.findCell(d),p=e.nodeAt(d),m=i.left-h.left,g=h.right-i.right;if(m>0||g>0){let b=p.attrs;m>0&&(b=vl(b,0,m)),g>0&&(b=vl(b,b.colspan-g,g)),h.left<i.left?p=p.type.createAndFill(b):p=p.type.create(b,p.content)}if(h.top<i.top||h.bottom>i.bottom){let b=hn(p.attrs,"rowspan",Math.min(h.bottom,i.bottom)-Math.max(h.top,i.top));h.top<i.top?p=p.type.createAndFill(b):p=p.type.create(b,p.content)}u.push(p)}}o.push(e.child(l).copy(le.from(u)))}const a=this.isColSelection()&&this.isRowSelection()?e:o;return new ge(le.from(a),1,1)}replace(e,n=ge.empty){let r=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:a,$to:l}=i[o],u=e.mapping.slice(r);e.replace(u.map(a.pos),u.map(l.pos),o?ge.empty:n)}let s=He.findFrom(e.doc.resolve(e.mapping.slice(r).map(this.to)),-1);s&&e.setSelection(s)}replaceWith(e,n){this.replace(e,new ge(le.from(n),0,0))}forEachCell(e){let n=this.$anchorCell.node(-1),r=Vt.get(n),i=this.$anchorCell.start(-1),s=r.cellsInRect(r.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i));for(let o=0;o<s.length;o++)e(n.nodeAt(s[o]),i+s[o])}isColSelection(){let e=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(e,n)>0)return!1;let r=e+this.$anchorCell.nodeAfter.attrs.rowspan,i=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,i)==this.$headCell.node(-1).childCount}static colSelection(e,n=e){let r=Vt.get(e.node(-1)),i=e.start(-1),s=r.findCell(e.pos-i),o=r.findCell(n.pos-i),a=e.node(0);return s.top<=o.top?(s.top>0&&(e=a.resolve(i+r.map[s.left])),o.bottom<r.height&&(n=a.resolve(i+r.map[r.width*(r.height-1)+o.right-1]))):(o.top>0&&(n=a.resolve(i+r.map[o.left])),s.bottom<r.height&&(e=a.resolve(i+r.map[r.width*(r.height-1)+s.right-1]))),new at(e,n)}isRowSelection(){let e=Vt.get(this.$anchorCell.node(-1)),n=this.$anchorCell.start(-1),r=e.colCount(this.$anchorCell.pos-n),i=e.colCount(this.$headCell.pos-n);if(Math.min(r,i)>0)return!1;let s=r+this.$anchorCell.nodeAfter.attrs.colspan,o=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(s,o)==e.width}eq(e){return e instanceof at&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){let r=Vt.get(e.node(-1)),i=e.start(-1),s=r.findCell(e.pos-i),o=r.findCell(n.pos-i),a=e.node(0);return s.left<=o.left?(s.left>0&&(e=a.resolve(i+r.map[s.top*r.width])),o.right<r.width&&(n=a.resolve(i+r.map[r.width*(o.top+1)-1]))):(o.left>0&&(n=a.resolve(i+r.map[o.top*r.width])),s.right<r.width&&(e=a.resolve(i+r.map[r.width*(s.top+1)-1]))),new at(e,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,n){return new at(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){return new at(e.resolve(n),e.resolve(r))}getBookmark(){return new Gv(this.$anchorCell.pos,this.$headCell.pos)}}at.prototype.visible=!1,He.jsonID("cell",at);class Gv{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Gv(e.map(this.anchor),e.map(this.head))}resolve(e){let n=e.resolve(this.anchor),r=e.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&r.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&r.index()<r.parent.childCount&&$v(n,r)?new at(n,r):He.near(r,1)}}function oY(t){if(!(t.selection instanceof at))return null;let e=[];return t.selection.forEachCell((n,r)=>{e.push(nn.node(r,r+n.nodeSize,{class:"selectedCell"}))}),kt.create(t.doc,e)}function aY({$from:t,$to:e}){if(t.pos==e.pos||t.pos<t.pos-6)return!1;let n=t.pos,r=e.pos,i=t.depth;for(;i>=0&&!(t.after(i+1)<t.end(i));i--,n++);for(let s=e.depth;s>=0&&!(e.before(s+1)>e.start(s));s--,r--);return n==r&&/row|table/.test(t.node(i).type.spec.tableRole)}function lY({$from:t,$to:e}){let n,r;for(let i=t.depth;i>0;i--){let s=t.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){n=s;break}}for(let i=e.depth;i>0;i--){let s=e.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){r=s;break}}return n!==r&&e.parentOffset===0}function uY(t,e,n){let r=(e||t).selection,i=(e||t).doc,s,o;if(r instanceof Pe&&(o=r.node.type.spec.tableRole)){if(o=="cell"||o=="header_cell")s=at.create(i,r.from);else if(o=="row"){let a=i.resolve(r.from+1);s=at.rowSelection(a,a)}else if(!n){let a=Vt.get(r.node),l=r.from+1,u=l+a.map[a.width*a.height-1];s=at.create(i,l+1,u)}}else r instanceof Fe&&aY(r)?s=Fe.create(i,r.from):r instanceof Fe&&lY(r)&&(s=Fe.create(i,r.$from.start(),r.$from.end()));return s&&(e||(e=t.tr)).setSelection(s),e}function cY(t){if(!t.size)return null;let{content:e,openStart:n,openEnd:r}=t;for(;e.childCount==1&&(n>0&&r>0||e.firstChild.type.spec.tableRole=="table");)n--,r--,e=e.firstChild.content;let i=e.firstChild,s=i.type.spec.tableRole,o=i.type.schema,a=[];if(s=="row")for(let l=0;l<e.childCount;l++){let u=e.child(l).content,c=l?0:Math.max(0,n-1),f=l<e.childCount-1?0:Math.max(0,r-1);(c||f)&&(u=Wv(Nn(o).row,new ge(u,c,f)).content),a.push(u)}else if(s=="cell"||s=="header_cell")a.push(n||r?Wv(Nn(o).row,new ge(e,n,r)).content:e);else return null;return fY(o,a)}function fY(t,e){let n=[];for(let i=0;i<e.length;i++){let s=e[i];for(let o=s.childCount-1;o>=0;o--){let{rowspan:a,colspan:l}=s.child(o).attrs;for(let u=i;u<i+a;u++)n[u]=(n[u]||0)+l}}let r=0;for(let i=0;i<n.length;i++)r=Math.max(r,n[i]);for(let i=0;i<n.length;i++)if(i>=e.length&&e.push(le.empty),n[i]<r){let s=Nn(t).cell.createAndFill(),o=[];for(let a=n[i];a<r;a++)o.push(s);e[i]=e[i].append(le.from(o))}return{height:e.length,width:r,rows:e}}function Wv(t,e){let n=t.createAndFill();return new Nb(n).replace(0,n.content.size,e).doc}function dY({width:t,height:e,rows:n},r,i){if(t!=r){let s=[],o=[];for(let a=0;a<n.length;a++){let l=n[a],u=[];for(let c=s[a]||0,f=0;c<r;f++){let d=l.child(f%l.childCount);c+d.attrs.colspan>r&&(d=d.type.create(vl(d.attrs,d.attrs.colspan,c+d.attrs.colspan-r),d.content)),u.push(d),c+=d.attrs.colspan;for(let h=1;h<d.attrs.rowspan;h++)s[a+h]=(s[a+h]||0)+d.attrs.colspan}o.push(le.from(u))}n=o,t=r}if(e!=i){let s=[];for(let o=0,a=0;o<i;o++,a++){let l=[],u=n[a%e];for(let c=0;c<u.childCount;c++){let f=u.child(c);o+f.attrs.rowspan>i&&(f=f.type.create(hn(f.attrs,"rowspan",Math.max(1,i-f.attrs.rowspan)),f.content)),l.push(f)}s.push(le.from(l))}n=s,e=i}return{width:t,height:e,rows:n}}function hY(t,e,n,r,i,s,o){let a=t.doc.type.schema,l=Nn(a),u,c;if(i>e.width)for(let f=0,d=0;f<e.height;f++){let h=n.child(f);d+=h.nodeSize;let p=[],m;h.lastChild==null||h.lastChild.type==l.cell?m=u||(u=l.cell.createAndFill()):m=c||(c=l.header_cell.createAndFill());for(let g=e.width;g<i;g++)p.push(m);t.insert(t.mapping.slice(o).map(d-1+r),p)}if(s>e.height){let f=[];for(let p=0,m=(e.height-1)*e.width;p<Math.max(e.width,i);p++){let g=p>=e.width?!1:n.nodeAt(e.map[m+p]).type==l.header_cell;f.push(g?c||(c=l.header_cell.createAndFill()):u||(u=l.cell.createAndFill()))}let d=l.row.create(null,le.from(f)),h=[];for(let p=e.height;p<s;p++)h.push(d);t.insert(t.mapping.slice(o).map(r+n.nodeSize-2),h)}return!!(u||c)}function ON(t,e,n,r,i,s,o,a){if(o==0||o==e.height)return!1;let l=!1;for(let u=i;u<s;u++){let c=o*e.width+u,f=e.map[c];if(e.map[c-e.width]==f){l=!0;let d=n.nodeAt(f),{top:h,left:p}=e.findCell(f);t.setNodeMarkup(t.mapping.slice(a).map(f+r),null,hn(d.attrs,"rowspan",o-h)),t.insert(t.mapping.slice(a).map(e.positionAt(o,p,n)),d.type.createAndFill(hn(d.attrs,"rowspan",h+d.attrs.rowspan-o))),u+=d.attrs.colspan-1}}return l}function DN(t,e,n,r,i,s,o,a){if(o==0||o==e.width)return!1;let l=!1;for(let u=i;u<s;u++){let c=u*e.width+o,f=e.map[c];if(e.map[c-1]==f){l=!0;let d=n.nodeAt(f),h=e.colCount(f),p=t.mapping.slice(a).map(f+r);t.setNodeMarkup(p,null,vl(d.attrs,o-h,d.attrs.colspan-(o-h))),t.insert(p+d.nodeSize,d.type.createAndFill(vl(d.attrs,0,o-h))),u+=d.attrs.rowspan-1}}return l}function MN(t,e,n,r,i){let s=n?t.doc.nodeAt(n-1):t.doc,o=Vt.get(s),{top:a,left:l}=r,u=l+i.width,c=a+i.height,f=t.tr,d=0;function h(){s=n?f.doc.nodeAt(n-1):f.doc,o=Vt.get(s),d=f.mapping.maps.length}hY(f,o,s,n,u,c,d)&&h(),ON(f,o,s,n,l,u,a,d)&&h(),ON(f,o,s,n,l,u,c,d)&&h(),DN(f,o,s,n,a,c,l,d)&&h(),DN(f,o,s,n,a,c,u,d)&&h();for(let p=a;p<c;p++){let m=o.positionAt(p,l,s),g=o.positionAt(p,u,s);f.replace(f.mapping.slice(d).map(m+n),f.mapping.slice(d).map(g+n),new ge(i.rows[p-a],0,0))}h(),f.setSelection(new at(f.doc.resolve(n+o.positionAt(a,l,s)),f.doc.resolve(n+o.positionAt(c-1,u-1,s)))),e(f)}const pY=u1({ArrowLeft:Og("horiz",-1),ArrowRight:Og("horiz",1),ArrowUp:Og("vert",-1),ArrowDown:Og("vert",1),"Shift-ArrowLeft":Dg("horiz",-1),"Shift-ArrowRight":Dg("horiz",1),"Shift-ArrowUp":Dg("vert",-1),"Shift-ArrowDown":Dg("vert",1),Backspace:Mg,"Mod-Backspace":Mg,Delete:Mg,"Mod-Delete":Mg});function Tg(t,e,n){return n.eq(t.selection)?!1:(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function Og(t,e){return(n,r,i)=>{let s=n.selection;if(s instanceof at)return Tg(n,r,He.near(s.$headCell,e));if(t!="horiz"&&!s.empty)return!1;let o=_N(i,t,e);if(o==null)return!1;if(t=="horiz")return Tg(n,r,He.near(n.doc.resolve(s.head+e),e));{let a=n.doc.resolve(o),l=SN(a,t,e),u;return l?u=He.near(l,1):e<0?u=He.near(n.doc.resolve(a.before(-1)),-1):u=He.near(n.doc.resolve(a.after(-1)),1),Tg(n,r,u)}}}function Dg(t,e){return(n,r,i)=>{let s=n.selection;if(!(s instanceof at)){let a=_N(i,t,e);if(a==null)return!1;s=new at(n.doc.resolve(a))}let o=SN(s.$headCell,t,e);return o?Tg(n,r,new at(s.$anchorCell,o)):!1}}function Mg(t,e){let n=t.selection;if(!(n instanceof at))return!1;if(e){let r=t.tr,i=Nn(t.schema).cell.createAndFill().content;n.forEachCell((s,o)=>{s.content.eq(i)||r.replace(r.mapping.map(o+1),r.mapping.map(o+s.nodeSize-1),new ge(i,0,0))}),r.docChanged&&e(r)}return!0}function mY(t,e){let n=t.state.doc,r=bc(n.resolve(e));return r?(t.dispatch(t.state.tr.setSelection(new at(r))),!0):!1}function gY(t,e,n){if(!vi(t.state))return!1;let r=cY(n),i=t.state.selection;if(i instanceof at){r||(r={width:1,height:1,rows:[le.from(Wv(Nn(t.state.schema).cell,n))]});let s=i.$anchorCell.node(-1),o=i.$anchorCell.start(-1),a=Vt.get(s).rectBetween(i.$anchorCell.pos-o,i.$headCell.pos-o);return r=dY(r,a.right-a.left,a.bottom-a.top),MN(t.state,t.dispatch,o,a,r),!0}else if(r){let s=Sg(t.state),o=s.start(-1);return MN(t.state,t.dispatch,o,Vt.get(s.node(-1)).findCell(s.pos-o),r),!0}else return!1}function yY(t,e){if(e.ctrlKey||e.metaKey)return;let n=NN(t,e.target),r;if(e.shiftKey&&t.state.selection instanceof at)i(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&n&&(r=bc(t.state.selection.$anchor))!=null&&Kv(t,e).pos!=r.pos)i(r,e),e.preventDefault();else if(!n)return;function i(a,l){let u=Kv(t,l),c=qo.getState(t.state)==null;if(!u||!$v(a,u))if(c)u=a;else return;let f=new at(a,u);if(c||!t.state.selection.eq(f)){let d=t.state.tr.setSelection(f);c&&d.setMeta(qo,a.pos),t.dispatch(d)}}function s(){t.root.removeEventListener("mouseup",s),t.root.removeEventListener("dragstart",s),t.root.removeEventListener("mousemove",o),qo.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(qo,-1))}function o(a){let l=qo.getState(t.state),u;if(l!=null)u=t.state.doc.resolve(l);else if(NN(t,a.target)!=n&&(u=Kv(t,e),!u))return s();u&&i(u,a)}t.root.addEventListener("mouseup",s),t.root.addEventListener("dragstart",s),t.root.addEventListener("mousemove",o)}function _N(t,e,n){if(!(t.state.selection instanceof Fe))return null;let{$head:r}=t.state.selection;for(let i=r.depth-1;i>=0;i--){let s=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:s.childCount))return null;if(s.type.spec.tableRole=="cell"||s.type.spec.tableRole=="header_cell"){let a=r.before(i),l=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(l)?a:null}}return null}function NN(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e}function Kv(t,e){let n=t.posAtCoords({left:e.clientX,top:e.clientY});return n&&n?bc(t.state.doc.resolve(n.pos)):null}const bY=new Mt("fix-tables");function RN(t,e,n,r){let i=t.childCount,s=e.childCount;e:for(let o=0,a=0;o<s;o++){let l=e.child(o);for(let u=a,c=Math.min(i,o+3);u<c;u++)if(t.child(u)==l){a=u+1,n+=l.nodeSize;continue e}r(l,n),a<i&&t.child(a).sameMarkup(l)?RN(t.child(a),l,n+1,r):l.nodesBetween(0,l.content.size,r,n+1),n+=l.nodeSize}}function PN(t,e){let n,r=(i,s)=>{i.type.spec.tableRole=="table"&&(n=wY(t,i,s,n))};return e?e.doc!=t.doc&&RN(e.doc,t.doc,0,r):t.doc.descendants(r),n}function wY(t,e,n,r){let i=Vt.get(e);if(!i.problems)return r;r||(r=t.tr);let s=[];for(let l=0;l<i.height;l++)s.push(0);for(let l=0;l<i.problems.length;l++){let u=i.problems[l];if(u.type=="collision"){let c=e.nodeAt(u.pos);for(let f=0;f<c.attrs.rowspan;f++)s[u.row+f]+=u.n;r.setNodeMarkup(r.mapping.map(n+1+u.pos),null,vl(c.attrs,c.attrs.colspan-u.n,u.n))}else if(u.type=="missing")s[u.row]+=u.n;else if(u.type=="overlong_rowspan"){let c=e.nodeAt(u.pos);r.setNodeMarkup(r.mapping.map(n+1+u.pos),null,hn(c.attrs,"rowspan",c.attrs.rowspan-u.n))}else if(u.type=="colwidth mismatch"){let c=e.nodeAt(u.pos);r.setNodeMarkup(r.mapping.map(n+1+u.pos),null,hn(c.attrs,"colwidth",u.colwidth))}}let o,a;for(let l=0;l<s.length;l++)s[l]&&(o==null&&(o=l),a=l);for(let l=0,u=n+1;l<i.height;l++){let c=e.child(l),f=u+c.nodeSize,d=s[l];if(d>0){let h="cell";c.firstChild&&(h=c.firstChild.type.spec.tableRole);let p=[];for(let g=0;g<d;g++)p.push(Nn(t.schema)[h].createAndFill());let m=(l==0||o==l-1)&&a==l?u+1:f-1;r.insert(r.mapping.map(m),p)}u=f}return r.setMeta(bY,{fixTables:!0})}function ns(t){let e=t.selection,n=Sg(t),r=n.node(-1),i=n.start(-1),s=Vt.get(r),o;return e instanceof at?o=s.rectBetween(e.$anchorCell.pos-i,e.$headCell.pos-i):o=s.findCell(n.pos-i),o.tableStart=i,o.map=s,o.table=r,o}function IN(t,{map:e,tableStart:n,table:r},i){let s=i>0?-1:0;sY(e,r,i+s)&&(s=i==0||i==e.width?null:0);for(let o=0;o<e.height;o++){let a=o*e.width+i;if(i>0&&i<e.width&&e.map[a-1]==e.map[a]){let l=e.map[a],u=r.nodeAt(l);t.setNodeMarkup(t.mapping.map(n+l),null,TN(u.attrs,i-e.colCount(l))),o+=u.attrs.rowspan-1}else{let l=s==null?Nn(r.type.schema).cell:r.nodeAt(e.map[a+s]).type,u=e.positionAt(o,i,r);t.insert(t.mapping.map(n+u),l.createAndFill())}}return t}function AY(t,e){if(!vi(t))return!1;if(e){let n=ns(t);e(IN(t.tr,n,n.left))}return!0}function vY(t,e){if(!vi(t))return!1;if(e){let n=ns(t);e(IN(t.tr,n,n.right))}return!0}function xY(t,{map:e,table:n,tableStart:r},i){let s=t.mapping.maps.length;for(let o=0;o<e.height;){let a=o*e.width+i,l=e.map[a],u=n.nodeAt(l);if(i>0&&e.map[a-1]==l||i<e.width-1&&e.map[a+1]==l)t.setNodeMarkup(t.mapping.slice(s).map(r+l),null,vl(u.attrs,i-e.colCount(l)));else{let c=t.mapping.slice(s).map(r+l);t.delete(c,c+u.nodeSize)}o+=u.attrs.rowspan}}function kY(t,e){if(!vi(t))return!1;if(e){let n=ns(t),r=t.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let i=n.right-1;xY(r,n,i),i!=n.left;i--)n.table=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc,n.map=Vt.get(n.table);e(r)}return!0}function EY(t,e,n){let r=Nn(e.type.schema).header_cell;for(let i=0;i<t.width;i++)if(e.nodeAt(t.map[i+n*t.width]).type!=r)return!1;return!0}function LN(t,{map:e,tableStart:n,table:r},i){let s=n;for(let l=0;l<i;l++)s+=r.child(l).nodeSize;let o=[],a=i>0?-1:0;EY(e,r,i+a)&&(a=i==0||i==e.height?null:0);for(let l=0,u=e.width*i;l<e.width;l++,u++)if(i>0&&i<e.height&&e.map[u]==e.map[u-e.width]){let c=e.map[u],f=r.nodeAt(c).attrs;t.setNodeMarkup(n+c,null,hn(f,"rowspan",f.rowspan+1)),l+=f.colspan-1}else{let c=a==null?Nn(r.type.schema).cell:r.nodeAt(e.map[u+a*e.width]).type;o.push(c.createAndFill())}return t.insert(s,Nn(r.type.schema).row.create(null,o)),t}function CY(t,e){if(!vi(t))return!1;if(e){let n=ns(t);e(LN(t.tr,n,n.top))}return!0}function SY(t,e){if(!vi(t))return!1;if(e){let n=ns(t);e(LN(t.tr,n,n.bottom))}return!0}function TY(t,{map:e,table:n,tableStart:r},i){let s=0;for(let l=0;l<i;l++)s+=n.child(l).nodeSize;let o=s+n.child(i).nodeSize,a=t.mapping.maps.length;t.delete(s+r,o+r);for(let l=0,u=i*e.width;l<e.width;l++,u++){let c=e.map[u];if(i>0&&c==e.map[u-e.width]){let f=n.nodeAt(c).attrs;t.setNodeMarkup(t.mapping.slice(a).map(c+r),null,hn(f,"rowspan",f.rowspan-1)),l+=f.colspan-1}else if(i<e.width&&c==e.map[u+e.width]){let f=n.nodeAt(c),d=f.type.create(hn(f.attrs,"rowspan",f.attrs.rowspan-1),f.content),h=e.positionAt(i+1,l,n);t.insert(t.mapping.slice(a).map(r+h),d),l+=f.attrs.colspan-1}}}function OY(t,e){if(!vi(t))return!1;if(e){let n=ns(t),r=t.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let i=n.bottom-1;TY(r,n,i),i!=n.top;i--)n.table=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc,n.map=Vt.get(n.table);e(r)}return!0}function BN(t){let e=t.content;return e.childCount==1&&e.firstChild.isTextblock&&e.firstChild.childCount==0}function DY({width:t,height:e,map:n},r){let i=r.top*t+r.left,s=i,o=(r.bottom-1)*t+r.left,a=i+(r.right-r.left-1);for(let l=r.top;l<r.bottom;l++){if(r.left>0&&n[s]==n[s-1]||r.right<t&&n[a]==n[a+1])return!0;s+=t,a+=t}for(let l=r.left;l<r.right;l++){if(r.top>0&&n[i]==n[i-t]||r.bottom<e&&n[o]==n[o+t])return!0;i++,o++}return!1}function FN(t,e){let n=t.selection;if(!(n instanceof at)||n.$anchorCell.pos==n.$headCell.pos)return!1;let r=ns(t),{map:i}=r;if(DY(i,r))return!1;if(e){let s=t.tr,o={},a=le.empty,l,u;for(let c=r.top;c<r.bottom;c++)for(let f=r.left;f<r.right;f++){let d=i.map[c*i.width+f],h=r.table.nodeAt(d);if(!o[d])if(o[d]=!0,l==null)l=d,u=h;else{BN(h)||(a=a.append(h.content));let p=s.mapping.map(d+r.tableStart);s.delete(p,p+h.nodeSize)}}if(s.setNodeMarkup(l+r.tableStart,null,hn(TN(u.attrs,u.attrs.colspan,r.right-r.left-u.attrs.colspan),"rowspan",r.bottom-r.top)),a.size){let c=l+1+u.content.size,f=BN(u)?l+1:c;s.replaceWith(f+r.tableStart,c+r.tableStart,a)}s.setSelection(new at(s.doc.resolve(l+r.tableStart))),e(s)}return!0}function jN(t,e){const n=Nn(t.schema);return MY(({node:r})=>n[r.type.spec.tableRole])(t,e)}function MY(t){return(e,n)=>{let r=e.selection,i,s;if(r instanceof at){if(r.$anchorCell.pos!=r.$headCell.pos)return!1;i=r.$anchorCell.nodeAfter,s=r.$anchorCell.pos}else{if(i=nY(r.$from),!i)return!1;s=bc(r.$from).pos}if(i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let o=i.attrs,a=[],l=o.colwidth;o.rowspan>1&&(o=hn(o,"rowspan",1)),o.colspan>1&&(o=hn(o,"colspan",1));let u=ns(e),c=e.tr;for(let d=0;d<u.right-u.left;d++)a.push(l?hn(o,"colwidth",l&&l[d]?[l[d]]:null):o);let f;for(let d=u.top;d<u.bottom;d++){let h=u.map.positionAt(d,u.left,u.table);d==u.top&&(h+=i.nodeSize);for(let p=u.left,m=0;p<u.right;p++,m++)p==u.left&&d==u.top||c.insert(f=c.mapping.map(h+u.tableStart,1),t({node:i,row:d,col:p}).createAndFill(a[m]))}c.setNodeMarkup(s,t({node:i,row:u.top,col:u.left}),a[0]),r instanceof at&&c.setSelection(new at(c.doc.resolve(r.$anchorCell.pos),f&&c.doc.resolve(f))),n(c)}return!0}}function _Y(t,e){return function(n,r){if(!vi(n))return!1;let i=Sg(n);if(i.nodeAfter.attrs[t]===e)return!1;if(r){let s=n.tr;n.selection instanceof at?n.selection.forEachCell((o,a)=>{o.attrs[t]!==e&&s.setNodeMarkup(a,null,hn(o.attrs,t,e))}):s.setNodeMarkup(i.pos,null,hn(i.nodeAfter.attrs,t,e)),r(s)}return!0}}function NY(t){return function(e,n){if(!vi(e))return!1;if(n){let r=Nn(e.schema),i=ns(e),s=e.tr,o=i.map.cellsInRect(t=="column"?new yc(i.left,0,i.right,i.map.height):t=="row"?new yc(0,i.top,i.map.width,i.bottom):i),a=o.map(l=>i.table.nodeAt(l));for(let l=0;l<o.length;l++)a[l].type==r.header_cell&&s.setNodeMarkup(i.tableStart+o[l],r.cell,a[l].attrs);if(s.steps.length==0)for(let l=0;l<o.length;l++)s.setNodeMarkup(i.tableStart+o[l],r.header_cell,a[l].attrs);n(s)}return!0}}function UN(t,e,n){const r=e.map.cellsInRect({left:0,top:0,right:t=="row"?e.map.width:1,bottom:t=="column"?e.map.height:1});for(let i=0;i<r.length;i++){const s=e.table.nodeAt(r[i]);if(s&&s.type!==n.header_cell)return!1}return!0}function Ah(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?NY(t):function(n,r){if(!vi(n))return!1;if(r){let i=Nn(n.schema),s=ns(n),o=n.tr,a=UN("row",s,i),l=UN("column",s,i),c=(t==="column"?a:t==="row"?l:!1)?1:0,f=t=="column"?new yc(0,c,1,s.map.height):t=="row"?new yc(c,0,s.map.width,1):s,d=t=="column"?l?i.cell:i.header_cell:t=="row"?a?i.cell:i.header_cell:i.cell;s.map.cellsInRect(f).forEach(h=>{const p=h+s.tableStart,m=o.doc.nodeAt(p);m&&o.setNodeMarkup(p,d,m.attrs)}),r(o)}return!0}}Ah("row",{useDeprecatedLogic:!0}),Ah("column",{useDeprecatedLogic:!0});let RY=Ah("cell",{useDeprecatedLogic:!0});function PY(t,e){if(e<0){let n=t.nodeBefore;if(n)return t.pos-n.nodeSize;for(let r=t.index(-1)-1,i=t.before();r>=0;r--){let s=t.node(-1).child(r);if(s.childCount)return i-1-s.lastChild.nodeSize;i-=s.nodeSize}}else{if(t.index()<t.parent.childCount-1)return t.pos+t.nodeAfter.nodeSize;let n=t.node(-1);for(let r=t.indexAfter(-1),i=t.after();r<n.childCount;r++){let s=n.child(r);if(s.childCount)return i+1;i+=s.nodeSize}}}function VN(t){return function(e,n){if(!vi(e))return!1;let r=PY(Sg(e),t);if(r!=null){if(n){let i=e.doc.resolve(r);n(e.tr.setSelection(Fe.between(i,iY(i))).scrollIntoView())}return!0}}}function IY(t,e){let n=t.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole=="table")return e&&e(t.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}let LY=class{constructor(e,n){this.node=e,this.cellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),qv(e,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!=this.node.type?!1:(this.node=e,qv(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function qv(t,e,n,r,i,s){let o=0,a=!0,l=e.firstChild,u=t.firstChild;for(let c=0,f=0;c<u.childCount;c++){let{colspan:d,colwidth:h}=u.child(c).attrs;for(let p=0;p<d;p++,f++){let m=i==f?s:h&&h[p],g=m?m+"px":"";o+=m||r,m||(a=!1),l?(l.style.width!=g&&(l.style.width=g),l=l.nextSibling):e.appendChild(document.createElement("col")).style.width=g}}for(;l;){let c=l.nextSibling;l.parentNode.removeChild(l),l=c}a?(n.style.width=o+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=o+"px")}const Yr=new Mt("tableColumnResizing");function BY({handleWidth:t=5,cellMinWidth:e=25,View:n=LY,lastColumnResizable:r=!0}={}){return new bt({key:Yr,state:{init(s,o){return this.spec.props.nodeViews[Nn(o.schema).table.name]=(a,l)=>new n(a,e,l),new vh(-1,!1)},apply(s,o){return o.apply(s)}},props:{attributes(s){return Yr.getState(s).activeHandle>-1?{class:"resize-cursor"}:null},handleDOMEvents:{mousemove(s,o){FY(s,o,t,e,r)},mouseleave(s){jY(s)},mousedown(s,o){UY(s,o,e)}},decorations(s){let o=Yr.getState(s);if(o.activeHandle>-1)return WY(s,o.activeHandle)},nodeViews:{}}})}class vh{constructor(e,n){this.activeHandle=e,this.dragging=n}apply(e){let n=this,r=e.getMeta(Yr);if(r&&r.setHandle!=null)return new vh(r.setHandle,null);if(r&&r.setDragging!==void 0)return new vh(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&e.docChanged){let i=e.mapping.map(n.activeHandle,-1);zv(e.doc.resolve(i))||(i=null),n=new vh(i,n.dragging)}return n}}function FY(t,e,n,r,i){let s=Yr.getState(t.state);if(!s.dragging){let o=HY(e.target),a=-1;if(o){let{left:l,right:u}=o.getBoundingClientRect();e.clientX-l<=n?a=HN(t,e,"left"):u-e.clientX<=n&&(a=HN(t,e,"right"))}if(a!=s.activeHandle){if(!i&&a!==-1){let l=t.state.doc.resolve(a),u=l.node(-1),c=Vt.get(u),f=l.start(-1);if(c.colCount(l.pos-f)+l.nodeAfter.attrs.colspan-1==c.width-1)return}$N(t,a)}}}function jY(t){let e=Yr.getState(t.state);e.activeHandle>-1&&!e.dragging&&$N(t,-1)}function UY(t,e,n){let r=Yr.getState(t.state);if(r.activeHandle==-1||r.dragging)return!1;let i=t.state.doc.nodeAt(r.activeHandle),s=VY(t,r.activeHandle,i.attrs);t.dispatch(t.state.tr.setMeta(Yr,{setDragging:{startX:e.clientX,startWidth:s}}));function o(l){window.removeEventListener("mouseup",o),window.removeEventListener("mousemove",a);let u=Yr.getState(t.state);u.dragging&&(zY(t,u.activeHandle,zN(u.dragging,l,n)),t.dispatch(t.state.tr.setMeta(Yr,{setDragging:null})))}function a(l){if(!l.which)return o(l);let u=Yr.getState(t.state),c=zN(u.dragging,l,n);$Y(t,u.activeHandle,c,n)}return window.addEventListener("mouseup",o),window.addEventListener("mousemove",a),e.preventDefault(),!0}function VY(t,e,{colspan:n,colwidth:r}){let i=r&&r[r.length-1];if(i)return i;let s=t.domAtPos(e),a=s.node.childNodes[s.offset].offsetWidth,l=n;if(r)for(let u=0;u<n;u++)r[u]&&(a-=r[u],l--);return a/l}function HY(t){for(;t&&t.nodeName!="TD"&&t.nodeName!="TH";)t=t.classList.contains("ProseMirror")?null:t.parentNode;return t}function HN(t,e,n){let r=t.posAtCoords({left:e.clientX,top:e.clientY});if(!r)return-1;let{pos:i}=r,s=bc(t.state.doc.resolve(i));if(!s)return-1;if(n=="right")return s.pos;let o=Vt.get(s.node(-1)),a=s.start(-1),l=o.map.indexOf(s.pos-a);return l%o.width==0?-1:a+o.map[l-1]}function zN(t,e,n){let r=e.clientX-t.startX;return Math.max(n,t.startWidth+r)}function $N(t,e){t.dispatch(t.state.tr.setMeta(Yr,{setHandle:e}))}function zY(t,e,n){let r=t.state.doc.resolve(e),i=r.node(-1),s=Vt.get(i),o=r.start(-1),a=s.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1,l=t.state.tr;for(let u=0;u<s.height;u++){let c=u*s.width+a;if(u&&s.map[c]==s.map[c-s.width])continue;let f=s.map[c],{attrs:d}=i.nodeAt(f),h=d.colspan==1?0:a-s.colCount(f);if(d.colwidth&&d.colwidth[h]==n)continue;let p=d.colwidth?d.colwidth.slice():GY(d.colspan);p[h]=n,l.setNodeMarkup(o+f,null,hn(d,"colwidth",p))}l.docChanged&&t.dispatch(l)}function $Y(t,e,n,r){let i=t.state.doc.resolve(e),s=i.node(-1),o=i.start(-1),a=Vt.get(s).colCount(i.pos-o)+i.nodeAfter.attrs.colspan-1,l=t.domAtPos(i.start(-1)).node;for(;l.nodeName!="TABLE";)l=l.parentNode;qv(s,l.firstChild,l,r,a,n)}function GY(t){let e=[];for(let n=0;n<t;n++)e.push(0);return e}function WY(t,e){let n=[],r=t.doc.resolve(e),i=r.node(-1),s=Vt.get(i),o=r.start(-1),a=s.colCount(r.pos-o)+r.nodeAfter.attrs.colspan;for(let l=0;l<s.height;l++){let u=a+l*s.width-1;if((a==s.width||s.map[u]!=s.map[u+1])&&(l==0||s.map[u-1]!=s.map[u-1-s.width])){let c=s.map[u],f=o+c+i.nodeAt(c).nodeSize-1,d=document.createElement("div");d.className="column-resize-handle",n.push(nn.widget(f,d))}}return kt.create(t.doc,n)}function KY({allowTableNodeSelection:t=!1}={}){return new bt({key:qo,state:{init(){return null},apply(e,n){let r=e.getMeta(qo);if(r!=null)return r==-1?null:r;if(n==null||!e.docChanged)return n;let{deleted:i,pos:s}=e.mapping.mapResult(n);return i?null:s}},props:{decorations:oY,handleDOMEvents:{mousedown:yY},createSelectionBetween(e){if(qo.getState(e.state)!=null)return e.state.selection},handleTripleClick:mY,handleKeyDown:pY,handlePaste:gY},appendTransaction(e,n,r){return uY(r,PN(r,n),t)}})}function GN(t,e,n,r,i,s){var c;let o=0,a=!0,l=e.firstChild;const u=t.firstChild;if(u)for(let f=0,d=0;f<u.childCount;f+=1){const{colspan:h,colwidth:p}=u.child(f).attrs;for(let m=0;m<h;m+=1,d+=1){const g=i===d?s:p&&p[m],b=g?`${g}px`:"";o+=g||r,g||(a=!1),l?(l.style.width!==b&&(l.style.width=b),l=l.nextSibling):e.appendChild(document.createElement("col")).style.width=b}}for(;l;){const f=l.nextSibling;(c=l==null?void 0:l.parentNode)==null||c.removeChild(l),l=f}a?(n.style.width=`${o}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${o}px`)}class qY{constructor(e,n){J(this,"node");J(this,"cellMinWidth");J(this,"dom");J(this,"table");J(this,"colgroup");J(this,"contentDOM");this.node=e,this.cellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),GN(e,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!==this.node.type?!1:(this.node=e,GN(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){return e.type==="attributes"&&(e.target===this.table||this.colgroup.contains(e.target))}}function WN(t,e){return t.createAndFill()}function QY(t){if(t.cached.tableNodeTypes)return t.cached.tableNodeTypes;const e={};return Object.keys(t.nodes).forEach(n=>{const r=t.nodes[n];r.spec.tableRole&&(e[r.spec.tableRole]=r)}),t.cached.tableNodeTypes=e,e}function JY(t,e,n,r,i){const s=QY(t),o=[],a=[];for(let u=0;u<n;u+=1){const c=WN(s.cell);if(c&&a.push(c),r){const f=WN(s.header_cell);f&&o.push(f)}}const l=[];for(let u=0;u<e;u+=1)l.push(s.row.createChecked(null,r&&u===0?o:a));return s.table.createChecked(null,l)}function YY(t){return t instanceof at}const _g=({editor:t})=>{const{selection:e}=t.state;if(!YY(e))return!1;let n=0;const r=w1(e.ranges[0].$from,s=>s.type.name==="table");return r==null||r.node.descendants(s=>{if(s.type.name==="table")return!1;["tableCell","tableHeader"].includes(s.type.name)&&(n+=1)}),n===e.ranges.length?(t.commands.deleteTable(),!0):!1},XY=Xe.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,View:qY,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:t,HTMLAttributes:e}){let n=0,r=!0;try{t.content.firstChild.content.forEach(s=>{if(s.attrs.colwidth)s.attrs.colwidth.forEach(o=>{o?n+=o:(r=!1,n+=this.options.cellMinWidth)});else{r=!1;const o=s.attrs.colspan?s.attrs.colspan:1;n+=this.options.cellMinWidth*o}})}catch{r=!1}return r&&n>0?e.style=`width: ${n}px;`:n&&n>0?e.style=`min-width: ${n}px`:e.style=null,["div",{class:"table-wrapper"},["table",rt(this.options.HTMLAttributes,e),["tbody",0]]]},addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:s})=>{const{selection:o}=r,a=JY(s.schema,t,e,n);if(i){const l=r.selection.anchor+1;r.replaceRangeWith(o.from-1,o.to,a).scrollIntoView().setSelection(Fe.near(r.doc.resolve(l)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>AY(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>vY(t,e),deleteColumn:()=>({state:t,dispatch:e})=>kY(t,e),addRowBefore:()=>({state:t,dispatch:e})=>CY(t,e),addRowAfter:()=>({state:t,dispatch:e})=>SY(t,e),deleteRow:()=>({state:t,dispatch:e})=>OY(t,e),deleteTable:()=>({state:t,dispatch:e})=>IY(t,e),mergeCells:()=>({state:t,dispatch:e})=>FN(t,e),splitCell:()=>({state:t,dispatch:e})=>jN(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>Ah("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>Ah("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>RY(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>FN(t,e)?!0:jN(t,e),setCellAttribute:(t,e)=>({state:n,dispatch:r})=>_Y(t,e)(n,r),goToNextCell:()=>({state:t,dispatch:e})=>VN(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>VN(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&PN(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>{if(n){const r=at.create(e.doc,t.anchorCell,t.headCell);e.setSelection(r)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:_g,"Mod-Backspace":_g,Delete:_g,"Mod-Delete":_g}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[BY({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],KY({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(t){const e={name:t.name,options:t.options,storage:t.storage};return{tableRole:tt(Oe(t,"tableRole",e))}}});function KN(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,s;for(s=0;s<r.length;s++)i=r[s],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}var qN=typeof window<"u"&&typeof document<"u";function Qv(t,e){t&&(typeof t=="function"&&t(e),{}.hasOwnProperty.call(t,"current")&&(t.current=e))}function QN(){return qN&&document.createElement("div")}function ZY(t){var e={"data-placement":t.placement};return t.referenceHidden&&(e["data-reference-hidden"]=""),t.escaped&&(e["data-escaped"]=""),e}function JN(t,e){if(t===e)return!0;if(typeof t=="object"&&t!=null&&typeof e=="object"&&e!=null){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(var n in t)if(e.hasOwnProperty(n)){if(!JN(t[n],e[n]))return!1}else return!1;return!0}else return!1}function eX(t){var e=[];return t.forEach(function(n){e.find(function(r){return JN(n,r)})||e.push(n)}),e}function tX(t,e){var n,r;return Object.assign({},e,{popperOptions:Object.assign({},t.popperOptions,e.popperOptions,{modifiers:eX([].concat(((n=t.popperOptions)==null?void 0:n.modifiers)||[],((r=e.popperOptions)==null?void 0:r.modifiers)||[]))})})}var Jv=qN?N.useLayoutEffect:N.useEffect;function nX(t){var e=N.useRef();return e.current||(e.current=typeof t=="function"?t():t),e.current}function YN(t,e,n){n.split(/\s+/).forEach(function(r){r&&t.classList[e](r)})}var rX={name:"className",defaultValue:"",fn:function(e){var n=e.popper.firstElementChild,r=function(){var a;return!!((a=e.props.render)!=null&&a.$$tippy)};function i(){if(e.props.className&&!r()){process.env.NODE_ENV!=="production"&&console.warn(["@tippyjs/react: Cannot use `className` prop in conjunction with","`render` prop. Place the className on the element you are","rendering."].join(" "));return}YN(n,"add",e.props.className)}function s(){r()&&YN(n,"remove",e.props.className)}return{onCreate:i,onBeforeUpdate:s,onAfterUpdate:i}}};function iX(t){function e(n){var r=n.children,i=n.content,s=n.visible,o=n.singleton,a=n.render,l=n.reference,u=n.disabled,c=u===void 0?!1:u,f=n.ignoreAttributes,d=f===void 0?!0:f;n.__source,n.__self;var h=KN(n,["children","content","visible","singleton","render","reference","disabled","ignoreAttributes","__source","__self"]),p=s!==void 0,m=o!==void 0,g=N.useState(!1),b=g[0],v=g[1],y=N.useState({}),A=y[0],x=y[1],k=N.useState(),S=k[0],E=k[1],D=nX(function(){return{container:QN(),renders:1}}),T=Object.assign({ignoreAttributes:d},h,{content:D.container});p&&(process.env.NODE_ENV!=="production"&&["trigger","hideOnClick","showOnCreate"].forEach(function(z){T[z]!==void 0&&console.warn(["@tippyjs/react: Cannot specify `"+z+"` prop in","controlled mode (`visible` prop)"].join(" "))}),T.trigger="manual",T.hideOnClick=!1),m&&(c=!0);var R=T,L=T.plugins||[];a&&(R=Object.assign({},T,{plugins:m&&o.data!=null?[].concat(L,[{fn:function(){return{onTrigger:function($,Y){var ie=o.data.children.find(function(ee){var Ae=ee.instance;return Ae.reference===Y.currentTarget});$.state.$$activeSingletonInstance=ie.instance,E(ie.content)}}}}]):L,render:function(){return{popper:D.container}}}));var B=[l].concat(r?[r.type]:[]);return Jv(function(){var z=l;l&&l.hasOwnProperty("current")&&(z=l.current);var F=t(z||D.ref||QN(),Object.assign({},R,{plugins:[rX].concat(T.plugins||[])}));return D.instance=F,c&&F.disable(),s&&F.show(),m&&o.hook({instance:F,content:i,props:R,setSingletonContent:E}),v(!0),function(){F.destroy(),o==null||o.cleanup(F)}},B),Jv(function(){var z;if(D.renders===1){D.renders++;return}var F=D.instance;F.setProps(tX(F.props,R)),(z=F.popperInstance)==null||z.forceUpdate(),c?F.disable():F.enable(),p&&(s?F.show():F.hide()),m&&o.hook({instance:F,content:i,props:R,setSingletonContent:E})}),Jv(function(){var z;if(a){var F=D.instance;F.setProps({popperOptions:Object.assign({},F.props.popperOptions,{modifiers:[].concat((((z=F.props.popperOptions)==null?void 0:z.modifiers)||[]).filter(function($){var Y=$.name;return Y!=="$$tippyReact"}),[{name:"$$tippyReact",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Y){var ie,ee=Y.state,Ae=(ie=ee.modifiersData)==null?void 0:ie.hide;(A.placement!==ee.placement||A.referenceHidden!==(Ae==null?void 0:Ae.isReferenceHidden)||A.escaped!==(Ae==null?void 0:Ae.hasPopperEscaped))&&x({placement:ee.placement,referenceHidden:Ae==null?void 0:Ae.isReferenceHidden,escaped:Ae==null?void 0:Ae.hasPopperEscaped}),ee.attributes.popper={}}}])})})}},[A.placement,A.referenceHidden,A.escaped].concat(B)),N.createElement(N.Fragment,null,r?N.cloneElement(r,{ref:function(F){D.ref=F,Qv(r.ref,F)}}):null,b&&Tt.createPortal(a?a(ZY(A),S,D.instance):i,D.container))}return e}var sX=function(t,e){return N.forwardRef(function(r,i){var s=r.children,o=KN(r,["children"]);return N.createElement(t,Object.assign({},e,o),s?N.cloneElement(s,{ref:function(l){Qv(i,l),Qv(s.ref,l)}}):null)})},oX=sX(iX(Za));const aX=[{name:"Add row above",action:t=>t.chain().focus().addRowBefore().run(),icon:O.jsx("svg",{viewBox:"0 0 24 24",children:O.jsx("path",{fill:"currentColor",d:"M22 14a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7h2v-2h4v2h2v-2h4v2h2v-2h4v2h2v-7M4 14h4v3H4v-3m6 0h4v3h-4v-3m10 0v3h-4v-3h4m-9-4h2V7h3V5h-3V2h-2v3H8v2h3v3Z"})})},{name:"Add row below",action:t=>t.chain().focus().addRowAfter().run(),icon:O.jsx("svg",{viewBox:"0 0 24 24",children:O.jsx("path",{fill:"currentColor",d:"M22 10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V3h2v2h4V3h2v2h4V3h2v2h4V3h2v7M4 10h4V7H4v3m6 0h4V7h-4v3m10 0V7h-4v3h4m-9 4h2v3h3v2h-3v3h-2v-3H8v-2h3v-3Z"})})},{name:"Add left column",action:t=>t.chain().focus().addColumnBefore().run(),icon:O.jsx("svg",{viewBox:"0 0 24 24",children:O.jsx("path",{fill:"currentColor",d:"M13 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h9V2h-9m7 8v4h-7v-4h7m0 6v4h-7v-4h7m0-12v4h-7V4h7M9 11H6V8H4v3H1v2h3v3h2v-3h3v-2Z"})})},{name:"Add right column",action:t=>t.chain().focus().addColumnAfter().run(),icon:O.jsx("svg",{viewBox:"0 0 24 24",children:O.jsx("path",{fill:"currentColor",d:"M11 2a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2H2V2h9m-7 8v4h7v-4H4m0 6v4h7v-4H4M4 4v4h7V4H4m11 7h3V8h2v3h3v2h-3v3h-2v-3h-3v-2Z"})})},{name:"Remove row",action:t=>t.chain().focus().deleteRow().run(),icon:O.jsx("svg",{viewBox:"0 0 24 24",children:O.jsx("path",{fill:"currentColor",d:"M9.41 13L12 15.59L14.59 13L16 14.41L13.41 17L16 19.59L14.59 21L12 18.41L9.41 21L8 19.59L10.59 17L8 14.41L9.41 13M22 9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v3M4 9h4V6H4v3m6 0h4V6h-4v3m6 0h4V6h-4v3Z"})})},{name:"Remove column",action:t=>t.chain().focus().deleteColumn().run(),icon:O.jsx("svg",{viewBox:"0 0 24 24",children:O.jsx("path",{fill:"currentColor",d:"M4 2h7a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2m0 8v4h7v-4H4m0 6v4h7v-4H4M4 4v4h7V4H4m13.59 8L15 9.41L16.41 8L19 10.59L21.59 8L23 9.41L20.41 12L23 14.59L21.59 16L19 13.41L16.41 16L15 14.59L17.59 12Z"})})},{name:"Toggle header row",action:t=>t.chain().focus().toggleHeaderRow().run(),icon:O.jsx("svg",{viewBox:"0 0 24 24",children:O.jsx("path",{fill:"currentColor",d:"M22 14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v4M4 14h4v-4H4v4m6 0h4v-4h-4v4m6 0h4v-4h-4v4Z"})})},{name:"Toggle header column",action:t=>t.chain().focus().toggleHeaderColumn().run(),icon:O.jsx("svg",{viewBox:"0 0 24 24",children:O.jsx("path",{fill:"currentColor",d:"M8 2h8a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2m0 8v4h8v-4H8m0 6v4h8v-4H8M8 4v4h8V4H8Z"})})},{name:"Toggle header cell",action:t=>t.chain().focus().toggleHeaderCell().run(),icon:O.jsx("svg",{viewBox:"0 0 24 24",children:O.jsx("path",{fill:"currentColor",d:"M21 19a1 1 0 0 1-1 1h-1v-2h2v1m-6 1v-2h2v2h-2m-4 0v-2h2v2h-2m-4 0v-2h2v2H7m-3 0a1 1 0 0 1-1-1v-1h2v2H4M19 4H5a2 2 0 0 0-2 2v2h18V6c0-1.11-.89-2-2-2M5 14H3v2h2v-2m0-4H3v2h2v-2m16 0h-2v2h2v-2m0 4h-2v2h2v-2m-10 2v-2h2v2h-2m0-4v-2h2v2h-2"})})},{name:"Remove table",action:t=>t.chain().focus().deleteTable().run(),icon:O.jsx("svg",{viewBox:"0 0 24 24",children:O.jsx("path",{fill:"currentColor",d:"M12.35 20H10v-3h2.09c.12-.72.37-1.39.72-2H10v-3h4v1.54c.58-.54 1.25-.93 2-1.19V12h4v.35c.75.26 1.42.65 2 1.19V5c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v15c0 1.1.9 2 2 2h9.54c-.54-.58-.93-1.25-1.19-2M16 7h4v3h-4V7m-6 0h4v3h-4V7M8 20H4v-3h4v3m0-5H4v-3h4v3m0-5H4V7h4v3m6.46 5.88l1.42-1.42L18 16.59l2.12-2.13l1.42 1.42L19.41 18l2.13 2.12l-1.42 1.42L18 19.41l-2.12 2.13l-1.42-1.42L16.59 18l-2.13-2.12"})})}],XN=({node:t,getPos:e,selected:n,editor:r})=>{const[i,s]=N.useState(!1),o=X0(),a=N.useRef(null),l=()=>{const{from:c,to:f}=r.state.selection,d=e(),h=d+t.nodeSize;s(d<=c&&f<=h)};N.useEffect(()=>(r.on("selectionUpdate",l),setTimeout(l,100),()=>{r.off("selectionUpdate",l)}));const u=()=>{var d,h;let c=(d=a.current)==null?void 0:d.clientTop;c&&(c+=5);let f=(h=a.current)==null?void 0:h.clientLeft;return f&&(f+=5),{top:`${c}px`,left:`${f}px`}};return O.jsxs(Dd,{className:"group",children:[O.jsx(WT,{as:"span"}),(i||n)&&O.jsx(oX,{appendTo:document.body,trigger:"click",interactive:!0,animation:"shift-toward-subtle",placement:"bottom-start",content:O.jsx("article",{className:"w-screen lg:w-full",contentEditable:!1,children:O.jsx("ul",{tabIndex:0,className:"static top-8 right-1/2 translate-x-1/2 lg:-translate-x-full menu menu-compact p-2 shadow bg-base-100 rounded-lg w-56",style:u(),children:aX.map(c=>O.jsx("li",{children:O.jsx(Lo,{variant:"ghost",className:"!items-center w-full !justify-start !font-[400]",onClick:()=>c.action(r),children:O.jsx("span",{children:c.name})})},c.name))})}),children:O.jsx("label",{tabIndex:0,className:ve("trigger-button",{hidden:o}),contentEditable:!1,children:O.jsx(ZU,{size:20})})})]})},lX=Xe.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?[parseInt(e,10)]:null}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",rt(this.options.HTMLAttributes,t),0]},addNodeView(){return el(XN,{as:"td",className:"relative"})}}),uX=Xe.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?[parseInt(e,10)]:null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",rt(this.options.HTMLAttributes,t),0]},addNodeView(){return el(XN,{as:"th",className:"relative"})}}),ZN=t=>(t.stopPropagation(),t.preventDefault(),t),cX=function(t){const e=t.scrollHeight>t.clientHeight,r=window.getComputedStyle(t).overflowY.indexOf("hidden")!==-1;return e&&!r},e6=function(t){return!t||t===document.body?document.body:cX(t)?t:e6(t.parentNode)},Yv=(t,e,n)=>{const r=document.createElement(t);if(!r)throw new Error(`Element with name ${t} can't be created.`);return e&&Object.entries(e).forEach(([i,s])=>r.setAttribute(i,s)),n&&Object.entries(n).forEach(([i,s])=>r.addEventListener(i,s)),r},fX=Xe.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",rt(this.options.HTMLAttributes,t),0]},addNodeView(){return({editor:t,HTMLAttributes:e,getPos:n})=>{const r=()=>n(),i=e6(t.options.element);let s=!1;const o={deleteRow:()=>{this.editor.chain().deleteNode("tableRow").focus().run()},selectRow:()=>{const b=r(),v=t.state.doc.resolve(b),y=new Pe(v);t.view.dispatch(t.state.tr.setSelection(y))}},a=()=>{s=!0},l=()=>{s=!1},u=Yv("section",{class:"absolute hidden flex items-center w-2 bg-gray-200 z-50 cursor-pointer border-1 border-indigo-600 rounded-l opacity-25 hover:opacity-100",contenteditable:"false"},{click:b=>{b&&ZN(b),o.selectRow()},mouseenter:()=>{a()},mouseover:()=>{a()},mouseleave:()=>{l(),d()}}),c=Yv("button",{class:"text-sm px-1 absolute -translate-x-[125%] hover:active:-translate-x-[125%] mr-2"},{click:b=>{b&&ZN(b),o.deleteRow()}}),f=()=>{m(),u.classList.remove("hidden")},d=()=>{setTimeout(()=>{s||u.classList.add("hidden")},100)},h=Yv("tr",{...e},{mouseenter:f,mouseover:f,mouseleave:d});u.append(c),document.body.append(u);let p="";const m=()=>{setTimeout(()=>{const b=h.getBoundingClientRect(),v=JSON.stringify(b);p!==v&&(u.style.top=`${b.top+document.documentElement.scrollTop}px`,u.style.left=`${b.x+document.documentElement.scrollLeft-8}px`,u.style.height=`${b.height+1}px`,p=v)})};return setTimeout(()=>{m()},100),t.on("selectionUpdate",m),t.on("update",m),i==null||i.addEventListener("scroll",m),document.addEventListener("scroll",m),{dom:h,contentDOM:h,destroy:()=>{u.remove(),t.off("selectionUpdate",m),t.off("update",m),i==null||i.removeEventListener("scroll",m),document.removeEventListener("scroll",m)}}}}}),dX=[XY.configure({resizable:!0}),lX,uX,fX],hX=o_.extend({content:"(dBlock|columns)+"});function t6({types:t,node:e}){return e!=null&&e.type?Array.isArray(t)&&t.includes(e.type)||e.type===t:!1}const pX=wt.create({name:"trailingNode",addOptions(){return{node:"paragraph",notAfter:["paragraph"]}},addProseMirrorPlugins(){const t=new Mt(this.name),e=Object.entries(this.editor.schema.nodes).map(([,n])=>n).filter(n=>this.options.notAfter.includes(n.name));return[new bt({key:t,appendTransaction:(n,r,i)=>{const{doc:s,tr:o,schema:a}=i,l=t.getState(i),u=s.content.size,c=a.nodes[this.options.node];if(l)return o.insert(u,c.create())},state:{init:(n,r)=>{const i=r.tr.doc.lastChild;return!t6({node:i,types:e})},apply:(n,r)=>{var s,o,a;if(!n.docChanged)return r;const i=(a=(o=(s=n.doc.lastChild)==null?void 0:s.content)==null?void 0:o.content)==null?void 0:a[0];return!t6({node:i,types:e})}}})]}}),mX=({node:t,editor:e,getPos:n})=>{const[r,i]=N.useState(""),s=X0(),o=["https://twitter.com","https://x.com"],a=()=>{switch(t.attrs.data){case"twitter":return O.jsx(t3,{size:20});case"iframe":return O.jsx(n3,{size:20});default:return O.jsx(cV,{size:20})}},l=()=>{switch(t.attrs.data){case"twitter":return"Embed a Twitter tweet";case"iframe":return"Embed a video";default:return"Embed an URL"}},u=()=>{if(!r){alert("Please enter a url");return}let p=r;if(r.includes("<iframe")){const y=r.match(/src="([^"]*)"/);y&&y.length>0&&(p=y[1])}else switch(!0){case/youtu\.?be(?:\.com)?\/(?:.*v(?:\/|=)|(?:.*\/)?)([a-zA-Z0-9-_]+)/.test(r):{const y=r.match(/youtu\.?be(?:\.com)?\/(?:.*v(?:\/|=)|(?:.*\/)?)([a-zA-Z0-9-_]+)/);y&&y.length>0&&(p=`https://www.youtube.com/embed/${y[1]}`);break}case/vimeo\.com\/([a-zA-Z0-9-_]+)/.test(r):{const y=r.match(/vimeo\.com\/([a-zA-Z0-9-_]+)/);y&&y.length>0&&(p=`https://player.vimeo.com/video/${y[1]}`);break}default:{alert("Please enter a valid url");return}}const m=640,g=360,b=n(),v=b+t.nodeSize;p&&(e==null||e.chain().focus(b).deleteRange({from:b,to:v}).setIframe({src:p,width:m,height:g}).run())},c=()=>{if(!r){alert("Please enter a url");return}let p=r;const m=o.some(A=>r.includes(A)),g=r.match(/\/status\/([0-9]*)/),b=g&&g.length>0;if(m&&b)p=g[1];else{alert("invalid url");return}const v=n(),y=v+t.nodeSize;p&&(e==null||e.chain().focus(v).deleteRange({from:v,to:y}).setTweetEmbed({tweetId:p}).run())},d=j_(()=>{switch(t.attrs.data){case"twitter":c();break;default:u();break}},500);N.useEffect(()=>{const p=m=>{if(m.key==="Backspace"&&r===""){const g=n(),b=g+t.nodeSize;(t.content.size===0||t.textContent==="")&&(e==null||e.chain().focus(g).deleteRange({from:g,to:b}).run(),m.preventDefault())}};return document.addEventListener("keydown",p),()=>{document.removeEventListener("keydown",p)}},[r,e,n,t]),N.useEffect(()=>{r&&d()},[r]),N.useEffect(()=>{e==null||e.chain().focus()},[]);const h=N.useRef(null);return N.useEffect(()=>{var p;(p=h.current)==null||p.focus()},[]),O.jsx(Dd,{as:"div",className:"flex gap-2 group w-full relative justify-center items-start",children:!s&&O.jsxs("div",{className:"relative w-full",children:[O.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none text-[#A1AAB1]",children:a()}),O.jsx("input",{ref:h,value:r,placeholder:l(),onChange:p=>i(p.target.value),onClick:p=>p.stopPropagation(),className:"rounded bg-[#f2f2f2] p-3 pl-10 w-full cursor-pointer transition-all ease-in-out text-sm"})]})})},gX=Xe.create({name:"actionButton",group:"block",content:"block*",atom:!0,draggable:!0,addOptions(){return{HTMLAttributes:{}}},addAttributes(){return{data:{default:null}}},addNodeView(){return el(mX)},parseHTML(){return[{tag:"div[data-action-node]"}]},renderHTML({HTMLAttributes:t}){return["div",rt(t,{"data-action-node":""}),0]},addCommands(){return{setActionButton:t=>({commands:e})=>e.insertContent({type:this.name,attrs:{data:t},content:[]})}}}),n6={};function yX(t){let e=n6[t];if(e)return e;e=n6[t]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);e.push(r)}for(let n=0;n<t.length;n++){const r=t.charCodeAt(n);e[r]="%"+("0"+r.toString(16).toUpperCase()).slice(-2)}return e}function wc(t,e){typeof e!="string"&&(e=wc.defaultChars);const n=yX(e);return t.replace(/(%[a-f0-9]{2})+/gi,function(r){let i="";for(let s=0,o=r.length;s<o;s+=3){const a=parseInt(r.slice(s+1,s+3),16);if(a<128){i+=n[a];continue}if((a&224)===192&&s+3<o){const l=parseInt(r.slice(s+4,s+6),16);if((l&192)===128){const u=a<<6&1984|l&63;u<128?i+="��":i+=String.fromCharCode(u),s+=3;continue}}if((a&240)===224&&s+6<o){const l=parseInt(r.slice(s+4,s+6),16),u=parseInt(r.slice(s+7,s+9),16);if((l&192)===128&&(u&192)===128){const c=a<<12&61440|l<<6&4032|u&63;c<2048||c>=55296&&c<=57343?i+="���":i+=String.fromCharCode(c),s+=6;continue}}if((a&248)===240&&s+9<o){const l=parseInt(r.slice(s+4,s+6),16),u=parseInt(r.slice(s+7,s+9),16),c=parseInt(r.slice(s+10,s+12),16);if((l&192)===128&&(u&192)===128&&(c&192)===128){let f=a<<18&1835008|l<<12&258048|u<<6&4032|c&63;f<65536||f>1114111?i+="����":(f-=65536,i+=String.fromCharCode(55296+(f>>10),56320+(f&1023))),s+=9;continue}}i+="�"}return i})}wc.defaultChars=";/?:@&=+$,#",wc.componentChars="";const r6={};function bX(t){let e=r6[t];if(e)return e;e=r6[t]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);/^[0-9a-z]$/i.test(r)?e.push(r):e.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<t.length;n++)e[t.charCodeAt(n)]=t[n];return e}function xh(t,e,n){typeof e!="string"&&(n=e,e=xh.defaultChars),typeof n>"u"&&(n=!0);const r=bX(e);let i="";for(let s=0,o=t.length;s<o;s++){const a=t.charCodeAt(s);if(n&&a===37&&s+2<o&&/^[0-9a-f]{2}$/i.test(t.slice(s+1,s+3))){i+=t.slice(s,s+3),s+=2;continue}if(a<128){i+=r[a];continue}if(a>=55296&&a<=57343){if(a>=55296&&a<=56319&&s+1<o){const l=t.charCodeAt(s+1);if(l>=56320&&l<=57343){i+=encodeURIComponent(t[s]+t[s+1]),s++;continue}}i+="%EF%BF%BD";continue}i+=encodeURIComponent(t[s])}return i}xh.defaultChars=";/?:@&=+$,-_.!~*'()#",xh.componentChars="-_.!~*'()";function Xv(t){let e="";return e+=t.protocol||"",e+=t.slashes?"//":"",e+=t.auth?t.auth+"@":"",t.hostname&&t.hostname.indexOf(":")!==-1?e+="["+t.hostname+"]":e+=t.hostname||"",e+=t.port?":"+t.port:"",e+=t.pathname||"",e+=t.search||"",e+=t.hash||"",e}function Ng(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const wX=/^([a-z0-9.+-]+:)/i,AX=/:[0-9]*$/,vX=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,xX=["<",">",'"',"`"," ","\r",`
485
485
  `," "],kX=["{","}","|","\\","^","`"].concat(xX),EX=["'"].concat(kX),i6=["%","/","?",";","#"].concat(EX),s6=["/","?","#"],CX=255,o6=/^[+a-z0-9A-Z_-]{0,63}$/,SX=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,a6={javascript:!0,"javascript:":!0},l6={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Zv(t,e){if(t&&t instanceof Ng)return t;const n=new Ng;return n.parse(t,e),n}Ng.prototype.parse=function(t,e){let n,r,i,s=t;if(s=s.trim(),!e&&t.split("#").length===1){const u=vX.exec(s);if(u)return this.pathname=u[1],u[2]&&(this.search=u[2]),this}let o=wX.exec(s);if(o&&(o=o[0],n=o.toLowerCase(),this.protocol=o,s=s.substr(o.length)),(e||o||s.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i=s.substr(0,2)==="//",i&&!(o&&a6[o])&&(s=s.substr(2),this.slashes=!0)),!a6[o]&&(i||o&&!l6[o])){let u=-1;for(let p=0;p<s6.length;p++)r=s.indexOf(s6[p]),r!==-1&&(u===-1||r<u)&&(u=r);let c,f;u===-1?f=s.lastIndexOf("@"):f=s.lastIndexOf("@",u),f!==-1&&(c=s.slice(0,f),s=s.slice(f+1),this.auth=c),u=-1;for(let p=0;p<i6.length;p++)r=s.indexOf(i6[p]),r!==-1&&(u===-1||r<u)&&(u=r);u===-1&&(u=s.length),s[u-1]===":"&&u--;const d=s.slice(0,u);s=s.slice(u),this.parseHost(d),this.hostname=this.hostname||"";const h=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!h){const p=this.hostname.split(/\./);for(let m=0,g=p.length;m<g;m++){const b=p[m];if(b&&!b.match(o6)){let v="";for(let y=0,A=b.length;y<A;y++)b.charCodeAt(y)>127?v+="x":v+=b[y];if(!v.match(o6)){const y=p.slice(0,m),A=p.slice(m+1),x=b.match(SX);x&&(y.push(x[1]),A.unshift(x[2])),A.length&&(s=A.join(".")+s),this.hostname=y.join(".");break}}}}this.hostname.length>CX&&(this.hostname=""),h&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const a=s.indexOf("#");a!==-1&&(this.hash=s.substr(a),s=s.slice(0,a));const l=s.indexOf("?");return l!==-1&&(this.search=s.substr(l),s=s.slice(0,l)),s&&(this.pathname=s),l6[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this},Ng.prototype.parseHost=function(t){let e=AX.exec(t);e&&(e=e[0],e!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};const TX=Object.freeze(Object.defineProperty({__proto__:null,decode:wc,encode:xh,format:Xv,parse:Zv},Symbol.toStringTag,{value:"Module"})),u6=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,c6=/[\0-\x1F\x7F-\x9F]/,OX=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,ex=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,f6=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,d6=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,DX=Object.freeze(Object.defineProperty({__proto__:null,Any:u6,Cc:c6,Cf:OX,P:ex,S:f6,Z:d6},Symbol.toStringTag,{value:"Module"})),MX=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(t=>t.charCodeAt(0))),_X=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(t=>t.charCodeAt(0)));var tx;const NX=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),RX=(tx=String.fromCodePoint)!==null&&tx!==void 0?tx:function(t){let e="";return t>65535&&(t-=65536,e+=String.fromCharCode(t>>>10&1023|55296),t=56320|t&1023),e+=String.fromCharCode(t),e};function PX(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=NX.get(t))!==null&&e!==void 0?e:t}var pn;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(pn||(pn={}));const IX=32;var Qo;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(Qo||(Qo={}));function nx(t){return t>=pn.ZERO&&t<=pn.NINE}function LX(t){return t>=pn.UPPER_A&&t<=pn.UPPER_F||t>=pn.LOWER_A&&t<=pn.LOWER_F}function BX(t){return t>=pn.UPPER_A&&t<=pn.UPPER_Z||t>=pn.LOWER_A&&t<=pn.LOWER_Z||nx(t)}function FX(t){return t===pn.EQUALS||BX(t)}var mn;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(mn||(mn={}));var Jo;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(Jo||(Jo={}));class jX{constructor(e,n,r){this.decodeTree=e,this.emitCodePoint=n,this.errors=r,this.state=mn.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Jo.Strict}startEntity(e){this.decodeMode=e,this.state=mn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,n){switch(this.state){case mn.EntityStart:return e.charCodeAt(n)===pn.NUM?(this.state=mn.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=mn.NamedEntity,this.stateNamedEntity(e,n));case mn.NumericStart:return this.stateNumericStart(e,n);case mn.NumericDecimal:return this.stateNumericDecimal(e,n);case mn.NumericHex:return this.stateNumericHex(e,n);case mn.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|IX)===pn.LOWER_X?(this.state=mn.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=mn.NumericDecimal,this.stateNumericDecimal(e,n))}addToNumericResult(e,n,r,i){if(n!==r){const s=r-n;this.result=this.result*Math.pow(i,s)+parseInt(e.substr(n,s),i),this.consumed+=s}}stateNumericHex(e,n){const r=n;for(;n<e.length;){const i=e.charCodeAt(n);if(nx(i)||LX(i))n+=1;else return this.addToNumericResult(e,r,n,16),this.emitNumericEntity(i,3)}return this.addToNumericResult(e,r,n,16),-1}stateNumericDecimal(e,n){const r=n;for(;n<e.length;){const i=e.charCodeAt(n);if(nx(i))n+=1;else return this.addToNumericResult(e,r,n,10),this.emitNumericEntity(i,2)}return this.addToNumericResult(e,r,n,10),-1}emitNumericEntity(e,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===pn.SEMI)this.consumed+=1;else if(this.decodeMode===Jo.Strict)return 0;return this.emitCodePoint(PX(this.result),this.consumed),this.errors&&(e!==pn.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,n){const{decodeTree:r}=this;let i=r[this.treeIndex],s=(i&Qo.VALUE_LENGTH)>>14;for(;n<e.length;n++,this.excess++){const o=e.charCodeAt(n);if(this.treeIndex=UX(r,i,this.treeIndex+Math.max(1,s),o),this.treeIndex<0)return this.result===0||this.decodeMode===Jo.Attribute&&(s===0||FX(o))?0:this.emitNotTerminatedNamedEntity();if(i=r[this.treeIndex],s=(i&Qo.VALUE_LENGTH)>>14,s!==0){if(o===pn.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==Jo.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:n,decodeTree:r}=this,i=(r[n]&Qo.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[e]&~Qo.VALUE_LENGTH:i[e+1],r),n===3&&this.emitCodePoint(i[e+2],r),r}end(){var e;switch(this.state){case mn.NamedEntity:return this.result!==0&&(this.decodeMode!==Jo.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case mn.NumericDecimal:return this.emitNumericEntity(0,2);case mn.NumericHex:return this.emitNumericEntity(0,3);case mn.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case mn.EntityStart:return 0}}}function h6(t){let e="";const n=new jX(t,r=>e+=RX(r));return function(i,s){let o=0,a=0;for(;(a=i.indexOf("&",a))>=0;){e+=i.slice(o,a),n.startEntity(s);const u=n.write(i,a+1);if(u<0){o=a+n.end();break}o=a+u,a=u===0?o+1:o}const l=e+i.slice(o);return e="",l}}function UX(t,e,n,r){const i=(e&Qo.BRANCH_LENGTH)>>7,s=e&Qo.JUMP_TABLE;if(i===0)return s!==0&&r===s?n:-1;if(s){const l=r-s;return l<0||l>=i?-1:t[n+l]-1}let o=n,a=o+i-1;for(;o<=a;){const l=o+a>>>1,u=t[l];if(u<r)o=l+1;else if(u>r)a=l-1;else return t[l+i]}return-1}const VX=h6(MX);h6(_X);function p6(t,e=Jo.Legacy){return VX(t,e)}function HX(t){return Object.prototype.toString.call(t)}function rx(t){return HX(t)==="[object String]"}const zX=Object.prototype.hasOwnProperty;function $X(t,e){return zX.call(t,e)}function Rg(t){return Array.prototype.slice.call(arguments,1).forEach(function(n){if(n){if(typeof n!="object")throw new TypeError(n+"must be object");Object.keys(n).forEach(function(r){t[r]=n[r]})}}),t}function m6(t,e,n){return[].concat(t.slice(0,e),n,t.slice(e+1))}function ix(t){return!(t>=55296&&t<=57343||t>=64976&&t<=65007||(t&65535)===65535||(t&65535)===65534||t>=0&&t<=8||t===11||t>=14&&t<=31||t>=127&&t<=159||t>1114111)}function Pg(t){if(t>65535){t-=65536;const e=55296+(t>>10),n=56320+(t&1023);return String.fromCharCode(e,n)}return String.fromCharCode(t)}const g6=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,GX=/&([a-z#][a-z0-9]{1,31});/gi,WX=new RegExp(g6.source+"|"+GX.source,"gi"),KX=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function qX(t,e){if(e.charCodeAt(0)===35&&KX.test(e)){const r=e[1].toLowerCase()==="x"?parseInt(e.slice(2),16):parseInt(e.slice(1),10);return ix(r)?Pg(r):t}const n=p6(t);return n!==t?n:t}function QX(t){return t.indexOf("\\")<0?t:t.replace(g6,"$1")}function Ac(t){return t.indexOf("\\")<0&&t.indexOf("&")<0?t:t.replace(WX,function(e,n,r){return n||qX(e,r)})}const JX=/[&<>"]/,YX=/[&<>"]/g,XX={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function ZX(t){return XX[t]}function Yo(t){return JX.test(t)?t.replace(YX,ZX):t}const eZ=/[.?*+^$[\]\\(){}|-]/g;function tZ(t){return t.replace(eZ,"\\$&")}function Ct(t){switch(t){case 9:case 32:return!0}return!1}function kh(t){if(t>=8192&&t<=8202)return!0;switch(t){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function Eh(t){return ex.test(t)||f6.test(t)}function Ch(t){switch(t){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function Ig(t){return t=t.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(t=t.replace(/ẞ/g,"ß")),t.toLowerCase().toUpperCase()}const nZ=Object.freeze(Object.defineProperty({__proto__:null,arrayReplaceAt:m6,assign:Rg,escapeHtml:Yo,escapeRE:tZ,fromCodePoint:Pg,has:$X,isMdAsciiPunct:Ch,isPunctChar:Eh,isSpace:Ct,isString:rx,isValidEntityCode:ix,isWhiteSpace:kh,lib:{mdurl:TX,ucmicro:DX},normalizeReference:Ig,unescapeAll:Ac,unescapeMd:QX},Symbol.toStringTag,{value:"Module"}));function rZ(t,e,n){let r,i,s,o;const a=t.posMax,l=t.pos;for(t.pos=e+1,r=1;t.pos<a;){if(s=t.src.charCodeAt(t.pos),s===93&&(r--,r===0)){i=!0;break}if(o=t.pos,t.md.inline.skipToken(t),s===91){if(o===t.pos-1)r++;else if(n)return t.pos=l,-1}}let u=-1;return i&&(u=t.pos),t.pos=l,u}function iZ(t,e,n){let r,i=e;const s={ok:!1,pos:0,str:""};if(t.charCodeAt(i)===60){for(i++;i<n;){if(r=t.charCodeAt(i),r===10||r===60)return s;if(r===62)return s.pos=i+1,s.str=Ac(t.slice(e+1,i)),s.ok=!0,s;if(r===92&&i+1<n){i+=2;continue}i++}return s}let o=0;for(;i<n&&(r=t.charCodeAt(i),!(r===32||r<32||r===127));){if(r===92&&i+1<n){if(t.charCodeAt(i+1)===32)break;i+=2;continue}if(r===40&&(o++,o>32))return s;if(r===41){if(o===0)break;o--}i++}return e===i||o!==0||(s.str=Ac(t.slice(e,i)),s.pos=i,s.ok=!0),s}function sZ(t,e,n,r){let i,s=e;const o={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(r)o.str=r.str,o.marker=r.marker;else{if(s>=n)return o;let a=t.charCodeAt(s);if(a!==34&&a!==39&&a!==40)return o;e++,s++,a===40&&(a=41),o.marker=a}for(;s<n;){if(i=t.charCodeAt(s),i===o.marker)return o.pos=s+1,o.str+=Ac(t.slice(e,s)),o.ok=!0,o;if(i===40&&o.marker===41)return o;i===92&&s+1<n&&s++,s++}return o.can_continue=!0,o.str+=Ac(t.slice(e,s)),o}const oZ=Object.freeze(Object.defineProperty({__proto__:null,parseLinkDestination:iZ,parseLinkLabel:rZ,parseLinkTitle:sZ},Symbol.toStringTag,{value:"Module"})),rs={};rs.code_inline=function(t,e,n,r,i){const s=t[e];return"<code"+i.renderAttrs(s)+">"+Yo(s.content)+"</code>"},rs.code_block=function(t,e,n,r,i){const s=t[e];return"<pre"+i.renderAttrs(s)+"><code>"+Yo(t[e].content)+`</code></pre>
486
486
  `},rs.fence=function(t,e,n,r,i){const s=t[e],o=s.info?Ac(s.info).trim():"";let a="",l="";if(o){const c=o.split(/(\s+)/g);a=c[0],l=c.slice(2).join("")}let u;if(n.highlight?u=n.highlight(s.content,a,l)||Yo(s.content):u=Yo(s.content),u.indexOf("<pre")===0)return u+`
487
487
  `;if(o){const c=s.attrIndex("class"),f=s.attrs?s.attrs.slice():[];c<0?f.push(["class",n.langPrefix+a]):(f[c]=f[c].slice(),f[c][1]+=" "+n.langPrefix+a);const d={attrs:f};return`<pre><code${i.renderAttrs(d)}>${u}</code></pre>
@@ -525,4 +525,4 @@ ${n.innerHTML}
525
525
  * Copyright 2014-2020 Benjamin Tan
526
526
  * Copyright 2011-2013 John-David Dalton
527
527
  * Available under MIT license
528
- */ib.exports,function(t,e){(function(){var n={function:!0,object:!0},r=n[typeof window]&&window||this,i=e,s=t&&!t.nodeType&&t,o=i&&s&&typeof An=="object"&&An;o&&(o.global===o||o.window===o||o.self===o)&&(r=o);var a=Math.pow(2,53)-1,l=/\bOpera/,u=Object.prototype,c=u.hasOwnProperty,f=u.toString;function d(E){return E=String(E),E.charAt(0).toUpperCase()+E.slice(1)}function h(E,D,T){var R={"10.0":"10","6.4":"10 Technical Preview","6.3":"8.1","6.2":"8","6.1":"Server 2008 R2 / 7","6.0":"Server 2008 / Vista","5.2":"Server 2003 / XP 64-bit","5.1":"XP","5.01":"2000 SP1","5.0":"2000","4.0":"NT","4.90":"ME"};return D&&T&&/^Win/i.test(E)&&!/^Windows Phone /i.test(E)&&(R=R[/[\d.]+$/.exec(E)])&&(E="Windows "+R),E=String(E),D&&T&&(E=E.replace(RegExp(D,"i"),T)),E=m(E.replace(/ ce$/i," CE").replace(/\bhpw/i,"web").replace(/\bMacintosh\b/,"Mac OS").replace(/_PowerPC\b/i," OS").replace(/\b(OS X) [^ \d]+/i,"$1").replace(/\bMac (OS X)\b/,"$1").replace(/\/(\d)/," $1").replace(/_/g,".").replace(/(?: BePC|[ .]*fc[ \d.]+)$/i,"").replace(/\bx86\.64\b/gi,"x86_64").replace(/\b(Windows Phone) OS\b/,"$1").replace(/\b(Chrome OS \w+) [\d.]+\b/,"$1").split(" on ")[0]),E}function p(E,D){var T=-1,R=E?E.length:0;if(typeof R=="number"&&R>-1&&R<=a)for(;++T<R;)D(E[T],T,E);else g(E,D)}function m(E){return E=x(E),/^(?:webOS|i(?:OS|P))/.test(E)?E:d(E)}function g(E,D){for(var T in E)c.call(E,T)&&D(E[T],T,E)}function b(E){return E==null?d(E):f.call(E).slice(8,-1)}function v(E,D){var T=E!=null?typeof E[D]:"number";return!/^(?:boolean|number|string|undefined)$/.test(T)&&(T=="object"?!!E[D]:!0)}function y(E){return String(E).replace(/([ -])(?!$)/g,"$1?")}function A(E,D){var T=null;return p(E,function(R,L){T=D(T,R,L,E)}),T}function x(E){return String(E).replace(/^ +| +$/g,"")}function k(E){var D=r,T=E&&typeof E=="object"&&b(E)!="String";T&&(D=E,E=null);var R=D.navigator||{},L=R.userAgent||"";E||(E=L);var B=T?!!R.likeChrome:/\bChrome\b/.test(E)&&!/internal|\n/i.test(f.toString()),z="Object",F=T?z:"ScriptBridgingProxyObject",$=T?z:"Environment",Y=T&&D.java?"JavaPackage":b(D.java),ie=T?z:"RuntimeObject",ee=/\bJava/.test(Y)&&D.java,Ae=ee&&b(D.environment)==$,Me=ee?"a":"α",Be=ee?"b":"β",_e=D.document||{},Ee=D.operamini||D.opera,Ue=l.test(Ue=T&&Ee?Ee["[[Class]]"]:b(Ee))?Ue:Ee=null,H,Ve=E,me=[],Ke=null,fe=E==L,oe=fe&&Ee&&typeof Ee.version=="function"&&Ee.version(),de,ae=pe([{label:"EdgeHTML",pattern:"Edge"},"Trident",{label:"WebKit",pattern:"AppleWebKit"},"iCab","Presto","NetFront","Tasman","KHTML","Gecko"]),te=w(["Adobe AIR","Arora","Avant Browser","Breach","Camino","Electron","Epiphany","Fennec","Flock","Galeon","GreenBrowser","iCab","Iceweasel","K-Meleon","Konqueror","Lunascape","Maxthon",{label:"Microsoft Edge",pattern:"(?:Edge|Edg|EdgA|EdgiOS)"},"Midori","Nook Browser","PaleMoon","PhantomJS","Raven","Rekonq","RockMelt",{label:"Samsung Internet",pattern:"SamsungBrowser"},"SeaMonkey",{label:"Silk",pattern:"(?:Cloud9|Silk-Accelerated)"},"Sleipnir","SlimBrowser",{label:"SRWare Iron",pattern:"Iron"},"Sunrise","Swiftfox","Vivaldi","Waterfox","WebPositive",{label:"Yandex Browser",pattern:"YaBrowser"},{label:"UC Browser",pattern:"UCBrowser"},"Opera Mini",{label:"Opera Mini",pattern:"OPiOS"},"Opera",{label:"Opera",pattern:"OPR"},"Chromium","Chrome",{label:"Chrome",pattern:"(?:HeadlessChrome)"},{label:"Chrome Mobile",pattern:"(?:CriOS|CrMo)"},{label:"Firefox",pattern:"(?:Firefox|Minefield)"},{label:"Firefox for iOS",pattern:"FxiOS"},{label:"IE",pattern:"IEMobile"},{label:"IE",pattern:"MSIE"},"Safari"]),j=_([{label:"BlackBerry",pattern:"BB10"},"BlackBerry",{label:"Galaxy S",pattern:"GT-I9000"},{label:"Galaxy S2",pattern:"GT-I9100"},{label:"Galaxy S3",pattern:"GT-I9300"},{label:"Galaxy S4",pattern:"GT-I9500"},{label:"Galaxy S5",pattern:"SM-G900"},{label:"Galaxy S6",pattern:"SM-G920"},{label:"Galaxy S6 Edge",pattern:"SM-G925"},{label:"Galaxy S7",pattern:"SM-G930"},{label:"Galaxy S7 Edge",pattern:"SM-G935"},"Google TV","Lumia","iPad","iPod","iPhone","Kindle",{label:"Kindle Fire",pattern:"(?:Cloud9|Silk-Accelerated)"},"Nexus","Nook","PlayBook","PlayStation Vita","PlayStation","TouchPad","Transformer",{label:"Wii U",pattern:"WiiU"},"Wii","Xbox One",{label:"Xbox 360",pattern:"Xbox"},"Xoom"]),q=P({Apple:{iPad:1,iPhone:1,iPod:1},Alcatel:{},Archos:{},Amazon:{Kindle:1,"Kindle Fire":1},Asus:{Transformer:1},"Barnes & Noble":{Nook:1},BlackBerry:{PlayBook:1},Google:{"Google TV":1,Nexus:1},HP:{TouchPad:1},HTC:{},Huawei:{},Lenovo:{},LG:{},Microsoft:{Xbox:1,"Xbox One":1},Motorola:{Xoom:1},Nintendo:{"Wii U":1,Wii:1},Nokia:{Lumia:1},Oppo:{},Samsung:{"Galaxy S":1,"Galaxy S2":1,"Galaxy S3":1,"Galaxy S4":1},Sony:{PlayStation:1,"PlayStation Vita":1},Xiaomi:{Mi:1,Redmi:1}}),K=C(["Windows Phone","KaiOS","Android","CentOS",{label:"Chrome OS",pattern:"CrOS"},"Debian",{label:"DragonFly BSD",pattern:"DragonFly"},"Fedora","FreeBSD","Gentoo","Haiku","Kubuntu","Linux Mint","OpenBSD","Red Hat","SuSE","Ubuntu","Xubuntu","Cygwin","Symbian OS","hpwOS","webOS ","webOS","Tablet OS","Tizen","Linux","Mac OS X","Macintosh","Mac","Windows 98;","Windows "]);function pe(he){return A(he,function(ye,ke){return ye||RegExp("\\b"+(ke.pattern||y(ke))+"\\b","i").exec(E)&&(ke.label||ke)})}function P(he){return A(he,function(ye,ke,Ne){return ye||(ke[j]||ke[/^[a-z]+(?: +[a-z]+\b)*/i.exec(j)]||RegExp("\\b"+y(Ne)+"(?:\\b|\\w*\\d)","i").exec(E))&&Ne})}function w(he){return A(he,function(ye,ke){return ye||RegExp("\\b"+(ke.pattern||y(ke))+"\\b","i").exec(E)&&(ke.label||ke)})}function C(he){return A(he,function(ye,ke){var Ne=ke.pattern||y(ke);return!ye&&(ye=RegExp("\\b"+Ne+"(?:/[\\d.]+|[ \\w.]*)","i").exec(E))&&(ye=h(ye,Ne,ke.label||ke)),ye})}function _(he){return A(he,function(ye,ke){var Ne=ke.pattern||y(ke);return!ye&&(ye=RegExp("\\b"+Ne+" *\\d+[.\\w_]*","i").exec(E)||RegExp("\\b"+Ne+" *\\w+-[\\w]*","i").exec(E)||RegExp("\\b"+Ne+"(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)","i").exec(E))&&((ye=String(ke.label&&!RegExp(Ne,"i").test(ke.label)?ke.label:ye).split("/"))[1]&&!/[\d.]+/.test(ye[0])&&(ye[0]+=" "+ye[1]),ke=ke.label||ke,ye=m(ye[0].replace(RegExp(Ne,"i"),ke).replace(RegExp("; *(?:"+ke+"[_-])?","i")," ").replace(RegExp("("+ke+")[-_.]?(\\w)","i"),"$1 $2"))),ye})}function U(he){return A(he,function(ye,ke){return ye||(RegExp(ke+"(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)","i").exec(E)||0)[1]||null})}function Q(){return this.description||""}if(ae&&(ae=[ae]),/\bAndroid\b/.test(K)&&!j&&(H=/\bAndroid[^;]*;(.*?)(?:Build|\) AppleWebKit)\b/i.exec(E))&&(j=x(H[1]).replace(/^[a-z]{2}-[a-z]{2};\s*/i,"")||null),q&&!j?j=_([q]):q&&j&&(j=j.replace(RegExp("^("+y(q)+")[-_.\\s]","i"),q+" ").replace(RegExp("^("+y(q)+")[-_.]?(\\w)","i"),q+" $2")),(H=/\bGoogle TV\b/.exec(j))&&(j=H[0]),/\bSimulator\b/i.test(E)&&(j=(j?j+" ":"")+"Simulator"),te=="Opera Mini"&&/\bOPiOS\b/.test(E)&&me.push("running in Turbo/Uncompressed mode"),te=="IE"&&/\blike iPhone OS\b/.test(E)?(H=k(E.replace(/like iPhone OS/,"")),q=H.manufacturer,j=H.product):/^iP/.test(j)?(te||(te="Safari"),K="iOS"+((H=/ OS ([\d_]+)/i.exec(E))?" "+H[1].replace(/_/g,"."):"")):te=="Konqueror"&&/^Linux\b/i.test(K)?K="Kubuntu":q&&q!="Google"&&(/Chrome/.test(te)&&!/\bMobile Safari\b/i.test(E)||/\bVita\b/.test(j))||/\bAndroid\b/.test(K)&&/^Chrome/.test(te)&&/\bVersion\//i.test(E)?(te="Android Browser",K=/\bAndroid\b/.test(K)?K:"Android"):te=="Silk"?(/\bMobi/i.test(E)||(K="Android",me.unshift("desktop mode")),/Accelerated *= *true/i.test(E)&&me.unshift("accelerated")):te=="UC Browser"&&/\bUCWEB\b/.test(E)?me.push("speed mode"):te=="PaleMoon"&&(H=/\bFirefox\/([\d.]+)\b/.exec(E))?me.push("identifying as Firefox "+H[1]):te=="Firefox"&&(H=/\b(Mobile|Tablet|TV)\b/i.exec(E))?(K||(K="Firefox OS"),j||(j=H[1])):!te||(H=!/\bMinefield\b/i.test(E)&&/\b(?:Firefox|Safari)\b/.exec(te))?(te&&!j&&/[\/,]|^[^(]+?\)/.test(E.slice(E.indexOf(H+"/")+8))&&(te=null),(H=j||q||K)&&(j||q||/\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(K))&&(te=/[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(K)?K:H)+" Browser")):te=="Electron"&&(H=(/\bChrome\/([\d.]+)\b/.exec(E)||0)[1])&&me.push("Chromium "+H),oe||(oe=U(["(?:Cloud9|CriOS|CrMo|Edge|Edg|EdgA|EdgiOS|FxiOS|HeadlessChrome|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$)|UCBrowser|YaBrowser)","Version",y(te),"(?:Firefox|Minefield|NetFront)"])),(H=ae=="iCab"&&parseFloat(oe)>3&&"WebKit"||/\bOpera\b/.test(te)&&(/\bOPR\b/.test(E)?"Blink":"Presto")||/\b(?:Midori|Nook|Safari)\b/i.test(E)&&!/^(?:Trident|EdgeHTML)$/.test(ae)&&"WebKit"||!ae&&/\bMSIE\b/i.test(E)&&(K=="Mac OS"?"Tasman":"Trident")||ae=="WebKit"&&/\bPlayStation\b(?! Vita\b)/i.test(te)&&"NetFront")&&(ae=[H]),te=="IE"&&(H=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(E)||0)[1])?(te+=" Mobile",K="Windows Phone "+(/\+$/.test(H)?H:H+".x"),me.unshift("desktop mode")):/\bWPDesktop\b/i.test(E)?(te="IE Mobile",K="Windows Phone 8.x",me.unshift("desktop mode"),oe||(oe=(/\brv:([\d.]+)/.exec(E)||0)[1])):te!="IE"&&ae=="Trident"&&(H=/\brv:([\d.]+)/.exec(E))&&(te&&me.push("identifying as "+te+(oe?" "+oe:"")),te="IE",oe=H[1]),fe){if(v(D,"global"))if(ee&&(H=ee.lang.System,Ve=H.getProperty("os.arch"),K=K||H.getProperty("os.name")+" "+H.getProperty("os.version")),Ae){try{oe=D.require("ringo/engine").version.join("."),te="RingoJS"}catch{(H=D.system)&&H.global.system==D.system&&(te="Narwhal",K||(K=H[0].os||null))}te||(te="Rhino")}else typeof D.process=="object"&&!D.process.browser&&(H=D.process)&&(typeof H.versions=="object"&&(typeof H.versions.electron=="string"?(me.push("Node "+H.versions.node),te="Electron",oe=H.versions.electron):typeof H.versions.nw=="string"&&(me.push("Chromium "+oe,"Node "+H.versions.node),te="NW.js",oe=H.versions.nw)),te||(te="Node.js",Ve=H.arch,K=H.platform,oe=/[\d.]+/.exec(H.version),oe=oe?oe[0]:null));else b(H=D.runtime)==F?(te="Adobe AIR",K=H.flash.system.Capabilities.os):b(H=D.phantom)==ie?(te="PhantomJS",oe=(H=H.version||null)&&H.major+"."+H.minor+"."+H.patch):typeof _e.documentMode=="number"&&(H=/\bTrident\/(\d+)/i.exec(E))?(oe=[oe,_e.documentMode],(H=+H[1]+4)!=oe[1]&&(me.push("IE "+oe[1]+" mode"),ae&&(ae[1]=""),oe[1]=H),oe=te=="IE"?String(oe[1].toFixed(1)):oe[0]):typeof _e.documentMode=="number"&&/^(?:Chrome|Firefox)\b/.test(te)&&(me.push("masking as "+te+" "+oe),te="IE",oe="11.0",ae=["Trident"],K="Windows");K=K&&m(K)}if(oe&&(H=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(oe)||/(?:alpha|beta)(?: ?\d)?/i.exec(E+";"+(fe&&R.appMinorVersion))||/\bMinefield\b/i.test(E)&&"a")&&(Ke=/b/i.test(H)?"beta":"alpha",oe=oe.replace(RegExp(H+"\\+?$"),"")+(Ke=="beta"?Be:Me)+(/\d+\+?/.exec(H)||"")),te=="Fennec"||te=="Firefox"&&/\b(?:Android|Firefox OS|KaiOS)\b/.test(K))te="Firefox Mobile";else if(te=="Maxthon"&&oe)oe=oe.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(j))j=="Xbox 360"&&(K=null),j=="Xbox 360"&&/\bIEMobile\b/.test(E)&&me.unshift("mobile mode");else if((/^(?:Chrome|IE|Opera)$/.test(te)||te&&!j&&!/Browser|Mobi/.test(te))&&(K=="Windows CE"||/Mobi/i.test(E)))te+=" Mobile";else if(te=="IE"&&fe)try{D.external===null&&me.unshift("platform preview")}catch{me.unshift("embedded")}else(/\bBlackBerry\b/.test(j)||/\bBB10\b/.test(E))&&(H=(RegExp(j.replace(/ +/g," *")+"/([.\\d]+)","i").exec(E)||0)[1]||oe)?(H=[H,/BB10/.test(E)],K=(H[1]?(j=null,q="BlackBerry"):"Device Software")+" "+H[0],oe=null):this!=g&&j!="Wii"&&(fe&&Ee||/Opera/.test(te)&&/\b(?:MSIE|Firefox)\b/i.test(E)||te=="Firefox"&&/\bOS X (?:\d+\.){2,}/.test(K)||te=="IE"&&(K&&!/^Win/.test(K)&&oe>5.5||/\bWindows XP\b/.test(K)&&oe>8||oe==8&&!/\bTrident\b/.test(E)))&&!l.test(H=k.call(g,E.replace(l,"")+";"))&&H.name&&(H="ing as "+H.name+((H=H.version)?" "+H:""),l.test(te)?(/\bIE\b/.test(H)&&K=="Mac OS"&&(K=null),H="identify"+H):(H="mask"+H,Ue?te=m(Ue.replace(/([a-z])([A-Z])/g,"$1 $2")):te="Opera",/\bIE\b/.test(H)&&(K=null),fe||(oe=null)),ae=["Presto"],me.push(H));(H=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(E)||0)[1])&&(H=[parseFloat(H.replace(/\.(\d)$/,".0$1")),H],te=="Safari"&&H[1].slice(-1)=="+"?(te="WebKit Nightly",Ke="alpha",oe=H[1].slice(0,-1)):(oe==H[1]||oe==(H[2]=(/\bSafari\/([\d.]+\+?)/i.exec(E)||0)[1]))&&(oe=null),H[1]=(/\b(?:Headless)?Chrome\/([\d.]+)/i.exec(E)||0)[1],H[0]==537.36&&H[2]==537.36&&parseFloat(H[1])>=28&&ae=="WebKit"&&(ae=["Blink"]),!fe||!B&&!H[1]?(ae&&(ae[1]="like Safari"),H=(H=H[0],H<400?1:H<500?2:H<526?3:H<533?4:H<534?"4+":H<535?5:H<537?6:H<538?7:H<601?8:H<602?9:H<604?10:H<606?11:H<608?12:"12")):(ae&&(ae[1]="like Chrome"),H=H[1]||(H=H[0],H<530?1:H<532?2:H<532.05?3:H<533?4:H<534.03?5:H<534.07?6:H<534.1?7:H<534.13?8:H<534.16?9:H<534.24?10:H<534.3?11:H<535.01?12:H<535.02?"13+":H<535.07?15:H<535.11?16:H<535.19?17:H<536.05?18:H<536.1?19:H<537.01?20:H<537.11?"21+":H<537.13?23:H<537.18?24:H<537.24?25:H<537.36?26:ae!="Blink"?"27":"28")),ae&&(ae[1]+=" "+(H+=typeof H=="number"?".x":/[.+]/.test(H)?"":"+")),te=="Safari"&&(!oe||parseInt(oe)>45)?oe=H:te=="Chrome"&&/\bHeadlessChrome/i.test(E)&&me.unshift("headless")),te=="Opera"&&(H=/\bzbov|zvav$/.exec(K))?(te+=" ",me.unshift("desktop mode"),H=="zvav"?(te+="Mini",oe=null):te+="Mobile",K=K.replace(RegExp(" *"+H+"$"),"")):te=="Safari"&&/\bChrome\b/.exec(ae&&ae[1])?(me.unshift("desktop mode"),te="Chrome Mobile",oe=null,/\bOS X\b/.test(K)?(q="Apple",K="iOS 4.3+"):K=null):/\bSRWare Iron\b/.test(te)&&!oe&&(oe=U("Chrome")),oe&&oe.indexOf(H=/[\d.]+$/.exec(K))==0&&E.indexOf("/"+H+"-")>-1&&(K=x(K.replace(H,""))),K&&K.indexOf(te)!=-1&&!RegExp(te+" OS").test(K)&&(K=K.replace(RegExp(" *"+y(te)+" *"),"")),ae&&!/\b(?:Avant|Nook)\b/.test(te)&&(/Browser|Lunascape|Maxthon/.test(te)||te!="Safari"&&/^iOS/.test(K)&&/\bSafari\b/.test(ae[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|SRWare Iron|Vivaldi|Web)/.test(te)&&ae[1])&&(H=ae[ae.length-1])&&me.push(H),me.length&&(me=["("+me.join("; ")+")"]),q&&j&&j.indexOf(q)<0&&me.push("on "+q),j&&me.push((/^on /.test(me[me.length-1])?"":"on ")+j),K&&(H=/ ([\d.+]+)$/.exec(K),de=H&&K.charAt(K.length-H[0].length-1)=="/",K={architecture:32,family:H&&!de?K.replace(H[0],""):K,version:H?H[1]:null,toString:function(){var he=this.version;return this.family+(he&&!de?" "+he:"")+(this.architecture==64?" 64-bit":"")}}),(H=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(Ve))&&!/\bi686\b/i.test(Ve)?(K&&(K.architecture=64,K.family=K.family.replace(RegExp(" *"+H),"")),te&&(/\bWOW64\b/i.test(E)||fe&&/\w(?:86|32)$/.test(R.cpuClass||R.platform)&&!/\bWin64; x64\b/i.test(E))&&me.unshift("32-bit")):K&&/^OS X/.test(K.family)&&te=="Chrome"&&parseFloat(oe)>=39&&(K.architecture=64),E||(E=null);var X={};return X.description=E,X.layout=ae&&ae[0],X.manufacturer=q,X.name=te,X.prerelease=Ke,X.product=j,X.ua=E,X.version=te&&oe,X.os=K||{architecture:null,family:null,version:null,toString:function(){return"null"}},X.parse=k,X.toString=Q,X.version&&me.unshift(oe),X.name&&me.unshift(te),K&&te&&!(K==String(K).split(" ")[0]&&(K==te.split(" ")[0]||j))&&me.push(j?"("+K+")":"on "+K),me.length&&(X.description=me.join(" ")),X}var S=k();i&&s?g(S,function(E,D){i[D]=E}):r.platform=S}).call(An)}(ib,ib.exports);var Nfe=ib.exports;const Rfe=Yf(Nfe),zk=()=>{var t;return(t=Rfe.os)==null?void 0:t.family},Pfe=N.forwardRef(({isPreviewMode:t=!1,initialContent:e,enableCollaboration:n,collaborationId:r,username:i,renderToolRightSection:s,renderToolLeftSection:o,walletAddress:a,onChange:l,onCollaboratorChange:u,onTextSelection:c,onCommentInteraction:f,handleCommentButtonClick:d,showCommentButton:h,ensResolutionUrl:p,disableBottomToolbar:m,onError:g},b)=>{const[v,y]=N.useState(!1),[A,x]=N.useState(!1),k=N.useRef(null),S=N.useRef(null),E=B2("(max-width: 640px)"),D=zk()==="iOS"||zk()==="Android"||zk()==="Windows Phone"||E,{editor:T,ref:R,ydoc:L}=cae({isPreviewMode:t,initialContent:e,enableCollaboration:n,collaborationId:r,walletAddress:a,username:i,onChange:l,onCollaboratorChange:u,onCommentInteraction:f,onTextSelection:c,ensResolutionUrl:p,onError:g});return N.useImperativeHandle(b,()=>({getEditor:()=>T,getYdoc:()=>L}),[T,L]),N.useEffect(()=>{if(!T)return;const B=$=>{const{key:Y}=$;return Y.length===1},z=$=>{B($)&&D&&(k.current&&clearTimeout(k.current),x(!0),k.current=setTimeout(()=>{x(!1)},500))},F=T.view.dom;return F.addEventListener("keydown",z),()=>{F.removeEventListener("keydown",z),k.current&&clearTimeout(k.current)}},[T,D]),N.useEffect(()=>{if(T&&D){const B=()=>{y(!0)},z=()=>{y(!1)};return T.on("focus",B),T.on("blur",z),()=>{T.off("focus",B),T.off("blur",z)}}},[D,T]),N.useEffect(()=>{if(!T)return;const B=F=>{F.key==="Enter"&&T.commands.scrollIntoView()},z=T.view.dom;return z.addEventListener("keydown",B),()=>{z.removeEventListener("keydown",B)}},[T]),N.useEffect(()=>{if(!D||!T)return;const B=()=>{R.current&&R.current.scrollIntoView()},z=T.view.dom;return z.addEventListener("resize",B),()=>{z.removeEventListener("resize",B)}},[T,R,D]),T?O.jsxs("main",{"data-cy":"single-webpage",className:"bg-[#f8f9fa] h-screen w-full",children:[O.jsx("div",{id:"toolbar",className:"flex items-center w-full h-16 sticky left-0 top-0 z-10 px-4 bg-[#f8f9fa]",children:O.jsxs("div",{className:"flex items-center justify-between gap-2 w-full",children:[O.jsx("div",{className:"grow",children:o==null?void 0:o({editor:T.getJSON()})}),!t&&O.jsx("div",{className:"grow relative hidden xl:block",children:O.jsx(p$,{onError:g,editor:T})}),s==null?void 0:s({editor:T.getJSON()})]})}),O.jsxs("div",{className:"p-4 sm:px-[88px] sm:py-[78px] bg-white w-full sm:w-[70%] max-w-[856px] mx-auto",style:{height:D?"calc(100vh - 8rem)":"100vh"},children:[O.jsxs("div",{ref:R,className:"w-full h-full overflow-y-scroll overflow-x-hidden no-scrollbar",children:[!t&&O.jsxs("div",{children:[O.jsx(s$,{editor:T}),O.jsx(d$,{editor:T,appendTo:R})]}),O.jsx(h$,{isPreviewMode:t,children:O.jsx(_U,{editor:T,id:"editor",className:"w-full h-full py-4"})})]}),h&&!D&&O.jsx(Lo,{ref:S,onClick:()=>{d==null||d(T)},variant:"ghost",className:ve("absolute w-12 h-12 bg-white rounded-full shadow-xl top-[70px] right-[-23px]"),children:O.jsx(rV,{})})]}),!t&&O.jsx(_fe,{children:!A&&!m&&O.jsx(kfe.div,{initial:{y:50,opacity:0},animate:{y:0,opacity:1},exit:{y:50,opacity:0},transition:{duration:.2},className:ve("flex xl:hidden items-center w-full h-16 fixed left-0 bottom-0 z-10 px-4 bg-[#f8f9fa] transition-all duration-300 ease-in-out",v&&"hidden"),children:O.jsx(dae,{onError:g,editor:T,isKeyboardVisible:v})})})]}):O.jsxs("div",{className:"w-screen h-screen flex flex-col gap-4 justify-center items-center",children:[O.jsx(JO,{}),O.jsx("p",{children:"Loading Editor..."})]})});ot.DdocEditor=Pfe,Object.defineProperty(ot,Symbol.toStringTag,{value:"Module"})});
528
+ */ib.exports,function(t,e){(function(){var n={function:!0,object:!0},r=n[typeof window]&&window||this,i=e,s=t&&!t.nodeType&&t,o=i&&s&&typeof An=="object"&&An;o&&(o.global===o||o.window===o||o.self===o)&&(r=o);var a=Math.pow(2,53)-1,l=/\bOpera/,u=Object.prototype,c=u.hasOwnProperty,f=u.toString;function d(E){return E=String(E),E.charAt(0).toUpperCase()+E.slice(1)}function h(E,D,T){var R={"10.0":"10","6.4":"10 Technical Preview","6.3":"8.1","6.2":"8","6.1":"Server 2008 R2 / 7","6.0":"Server 2008 / Vista","5.2":"Server 2003 / XP 64-bit","5.1":"XP","5.01":"2000 SP1","5.0":"2000","4.0":"NT","4.90":"ME"};return D&&T&&/^Win/i.test(E)&&!/^Windows Phone /i.test(E)&&(R=R[/[\d.]+$/.exec(E)])&&(E="Windows "+R),E=String(E),D&&T&&(E=E.replace(RegExp(D,"i"),T)),E=m(E.replace(/ ce$/i," CE").replace(/\bhpw/i,"web").replace(/\bMacintosh\b/,"Mac OS").replace(/_PowerPC\b/i," OS").replace(/\b(OS X) [^ \d]+/i,"$1").replace(/\bMac (OS X)\b/,"$1").replace(/\/(\d)/," $1").replace(/_/g,".").replace(/(?: BePC|[ .]*fc[ \d.]+)$/i,"").replace(/\bx86\.64\b/gi,"x86_64").replace(/\b(Windows Phone) OS\b/,"$1").replace(/\b(Chrome OS \w+) [\d.]+\b/,"$1").split(" on ")[0]),E}function p(E,D){var T=-1,R=E?E.length:0;if(typeof R=="number"&&R>-1&&R<=a)for(;++T<R;)D(E[T],T,E);else g(E,D)}function m(E){return E=x(E),/^(?:webOS|i(?:OS|P))/.test(E)?E:d(E)}function g(E,D){for(var T in E)c.call(E,T)&&D(E[T],T,E)}function b(E){return E==null?d(E):f.call(E).slice(8,-1)}function v(E,D){var T=E!=null?typeof E[D]:"number";return!/^(?:boolean|number|string|undefined)$/.test(T)&&(T=="object"?!!E[D]:!0)}function y(E){return String(E).replace(/([ -])(?!$)/g,"$1?")}function A(E,D){var T=null;return p(E,function(R,L){T=D(T,R,L,E)}),T}function x(E){return String(E).replace(/^ +| +$/g,"")}function k(E){var D=r,T=E&&typeof E=="object"&&b(E)!="String";T&&(D=E,E=null);var R=D.navigator||{},L=R.userAgent||"";E||(E=L);var B=T?!!R.likeChrome:/\bChrome\b/.test(E)&&!/internal|\n/i.test(f.toString()),z="Object",F=T?z:"ScriptBridgingProxyObject",$=T?z:"Environment",Y=T&&D.java?"JavaPackage":b(D.java),ie=T?z:"RuntimeObject",ee=/\bJava/.test(Y)&&D.java,Ae=ee&&b(D.environment)==$,Me=ee?"a":"α",Be=ee?"b":"β",_e=D.document||{},Ee=D.operamini||D.opera,Ue=l.test(Ue=T&&Ee?Ee["[[Class]]"]:b(Ee))?Ue:Ee=null,H,Ve=E,me=[],Ke=null,fe=E==L,oe=fe&&Ee&&typeof Ee.version=="function"&&Ee.version(),de,ae=pe([{label:"EdgeHTML",pattern:"Edge"},"Trident",{label:"WebKit",pattern:"AppleWebKit"},"iCab","Presto","NetFront","Tasman","KHTML","Gecko"]),te=w(["Adobe AIR","Arora","Avant Browser","Breach","Camino","Electron","Epiphany","Fennec","Flock","Galeon","GreenBrowser","iCab","Iceweasel","K-Meleon","Konqueror","Lunascape","Maxthon",{label:"Microsoft Edge",pattern:"(?:Edge|Edg|EdgA|EdgiOS)"},"Midori","Nook Browser","PaleMoon","PhantomJS","Raven","Rekonq","RockMelt",{label:"Samsung Internet",pattern:"SamsungBrowser"},"SeaMonkey",{label:"Silk",pattern:"(?:Cloud9|Silk-Accelerated)"},"Sleipnir","SlimBrowser",{label:"SRWare Iron",pattern:"Iron"},"Sunrise","Swiftfox","Vivaldi","Waterfox","WebPositive",{label:"Yandex Browser",pattern:"YaBrowser"},{label:"UC Browser",pattern:"UCBrowser"},"Opera Mini",{label:"Opera Mini",pattern:"OPiOS"},"Opera",{label:"Opera",pattern:"OPR"},"Chromium","Chrome",{label:"Chrome",pattern:"(?:HeadlessChrome)"},{label:"Chrome Mobile",pattern:"(?:CriOS|CrMo)"},{label:"Firefox",pattern:"(?:Firefox|Minefield)"},{label:"Firefox for iOS",pattern:"FxiOS"},{label:"IE",pattern:"IEMobile"},{label:"IE",pattern:"MSIE"},"Safari"]),j=_([{label:"BlackBerry",pattern:"BB10"},"BlackBerry",{label:"Galaxy S",pattern:"GT-I9000"},{label:"Galaxy S2",pattern:"GT-I9100"},{label:"Galaxy S3",pattern:"GT-I9300"},{label:"Galaxy S4",pattern:"GT-I9500"},{label:"Galaxy S5",pattern:"SM-G900"},{label:"Galaxy S6",pattern:"SM-G920"},{label:"Galaxy S6 Edge",pattern:"SM-G925"},{label:"Galaxy S7",pattern:"SM-G930"},{label:"Galaxy S7 Edge",pattern:"SM-G935"},"Google TV","Lumia","iPad","iPod","iPhone","Kindle",{label:"Kindle Fire",pattern:"(?:Cloud9|Silk-Accelerated)"},"Nexus","Nook","PlayBook","PlayStation Vita","PlayStation","TouchPad","Transformer",{label:"Wii U",pattern:"WiiU"},"Wii","Xbox One",{label:"Xbox 360",pattern:"Xbox"},"Xoom"]),q=P({Apple:{iPad:1,iPhone:1,iPod:1},Alcatel:{},Archos:{},Amazon:{Kindle:1,"Kindle Fire":1},Asus:{Transformer:1},"Barnes & Noble":{Nook:1},BlackBerry:{PlayBook:1},Google:{"Google TV":1,Nexus:1},HP:{TouchPad:1},HTC:{},Huawei:{},Lenovo:{},LG:{},Microsoft:{Xbox:1,"Xbox One":1},Motorola:{Xoom:1},Nintendo:{"Wii U":1,Wii:1},Nokia:{Lumia:1},Oppo:{},Samsung:{"Galaxy S":1,"Galaxy S2":1,"Galaxy S3":1,"Galaxy S4":1},Sony:{PlayStation:1,"PlayStation Vita":1},Xiaomi:{Mi:1,Redmi:1}}),K=C(["Windows Phone","KaiOS","Android","CentOS",{label:"Chrome OS",pattern:"CrOS"},"Debian",{label:"DragonFly BSD",pattern:"DragonFly"},"Fedora","FreeBSD","Gentoo","Haiku","Kubuntu","Linux Mint","OpenBSD","Red Hat","SuSE","Ubuntu","Xubuntu","Cygwin","Symbian OS","hpwOS","webOS ","webOS","Tablet OS","Tizen","Linux","Mac OS X","Macintosh","Mac","Windows 98;","Windows "]);function pe(he){return A(he,function(ye,ke){return ye||RegExp("\\b"+(ke.pattern||y(ke))+"\\b","i").exec(E)&&(ke.label||ke)})}function P(he){return A(he,function(ye,ke,Ne){return ye||(ke[j]||ke[/^[a-z]+(?: +[a-z]+\b)*/i.exec(j)]||RegExp("\\b"+y(Ne)+"(?:\\b|\\w*\\d)","i").exec(E))&&Ne})}function w(he){return A(he,function(ye,ke){return ye||RegExp("\\b"+(ke.pattern||y(ke))+"\\b","i").exec(E)&&(ke.label||ke)})}function C(he){return A(he,function(ye,ke){var Ne=ke.pattern||y(ke);return!ye&&(ye=RegExp("\\b"+Ne+"(?:/[\\d.]+|[ \\w.]*)","i").exec(E))&&(ye=h(ye,Ne,ke.label||ke)),ye})}function _(he){return A(he,function(ye,ke){var Ne=ke.pattern||y(ke);return!ye&&(ye=RegExp("\\b"+Ne+" *\\d+[.\\w_]*","i").exec(E)||RegExp("\\b"+Ne+" *\\w+-[\\w]*","i").exec(E)||RegExp("\\b"+Ne+"(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)","i").exec(E))&&((ye=String(ke.label&&!RegExp(Ne,"i").test(ke.label)?ke.label:ye).split("/"))[1]&&!/[\d.]+/.test(ye[0])&&(ye[0]+=" "+ye[1]),ke=ke.label||ke,ye=m(ye[0].replace(RegExp(Ne,"i"),ke).replace(RegExp("; *(?:"+ke+"[_-])?","i")," ").replace(RegExp("("+ke+")[-_.]?(\\w)","i"),"$1 $2"))),ye})}function U(he){return A(he,function(ye,ke){return ye||(RegExp(ke+"(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)","i").exec(E)||0)[1]||null})}function Q(){return this.description||""}if(ae&&(ae=[ae]),/\bAndroid\b/.test(K)&&!j&&(H=/\bAndroid[^;]*;(.*?)(?:Build|\) AppleWebKit)\b/i.exec(E))&&(j=x(H[1]).replace(/^[a-z]{2}-[a-z]{2};\s*/i,"")||null),q&&!j?j=_([q]):q&&j&&(j=j.replace(RegExp("^("+y(q)+")[-_.\\s]","i"),q+" ").replace(RegExp("^("+y(q)+")[-_.]?(\\w)","i"),q+" $2")),(H=/\bGoogle TV\b/.exec(j))&&(j=H[0]),/\bSimulator\b/i.test(E)&&(j=(j?j+" ":"")+"Simulator"),te=="Opera Mini"&&/\bOPiOS\b/.test(E)&&me.push("running in Turbo/Uncompressed mode"),te=="IE"&&/\blike iPhone OS\b/.test(E)?(H=k(E.replace(/like iPhone OS/,"")),q=H.manufacturer,j=H.product):/^iP/.test(j)?(te||(te="Safari"),K="iOS"+((H=/ OS ([\d_]+)/i.exec(E))?" "+H[1].replace(/_/g,"."):"")):te=="Konqueror"&&/^Linux\b/i.test(K)?K="Kubuntu":q&&q!="Google"&&(/Chrome/.test(te)&&!/\bMobile Safari\b/i.test(E)||/\bVita\b/.test(j))||/\bAndroid\b/.test(K)&&/^Chrome/.test(te)&&/\bVersion\//i.test(E)?(te="Android Browser",K=/\bAndroid\b/.test(K)?K:"Android"):te=="Silk"?(/\bMobi/i.test(E)||(K="Android",me.unshift("desktop mode")),/Accelerated *= *true/i.test(E)&&me.unshift("accelerated")):te=="UC Browser"&&/\bUCWEB\b/.test(E)?me.push("speed mode"):te=="PaleMoon"&&(H=/\bFirefox\/([\d.]+)\b/.exec(E))?me.push("identifying as Firefox "+H[1]):te=="Firefox"&&(H=/\b(Mobile|Tablet|TV)\b/i.exec(E))?(K||(K="Firefox OS"),j||(j=H[1])):!te||(H=!/\bMinefield\b/i.test(E)&&/\b(?:Firefox|Safari)\b/.exec(te))?(te&&!j&&/[\/,]|^[^(]+?\)/.test(E.slice(E.indexOf(H+"/")+8))&&(te=null),(H=j||q||K)&&(j||q||/\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(K))&&(te=/[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(K)?K:H)+" Browser")):te=="Electron"&&(H=(/\bChrome\/([\d.]+)\b/.exec(E)||0)[1])&&me.push("Chromium "+H),oe||(oe=U(["(?:Cloud9|CriOS|CrMo|Edge|Edg|EdgA|EdgiOS|FxiOS|HeadlessChrome|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$)|UCBrowser|YaBrowser)","Version",y(te),"(?:Firefox|Minefield|NetFront)"])),(H=ae=="iCab"&&parseFloat(oe)>3&&"WebKit"||/\bOpera\b/.test(te)&&(/\bOPR\b/.test(E)?"Blink":"Presto")||/\b(?:Midori|Nook|Safari)\b/i.test(E)&&!/^(?:Trident|EdgeHTML)$/.test(ae)&&"WebKit"||!ae&&/\bMSIE\b/i.test(E)&&(K=="Mac OS"?"Tasman":"Trident")||ae=="WebKit"&&/\bPlayStation\b(?! Vita\b)/i.test(te)&&"NetFront")&&(ae=[H]),te=="IE"&&(H=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(E)||0)[1])?(te+=" Mobile",K="Windows Phone "+(/\+$/.test(H)?H:H+".x"),me.unshift("desktop mode")):/\bWPDesktop\b/i.test(E)?(te="IE Mobile",K="Windows Phone 8.x",me.unshift("desktop mode"),oe||(oe=(/\brv:([\d.]+)/.exec(E)||0)[1])):te!="IE"&&ae=="Trident"&&(H=/\brv:([\d.]+)/.exec(E))&&(te&&me.push("identifying as "+te+(oe?" "+oe:"")),te="IE",oe=H[1]),fe){if(v(D,"global"))if(ee&&(H=ee.lang.System,Ve=H.getProperty("os.arch"),K=K||H.getProperty("os.name")+" "+H.getProperty("os.version")),Ae){try{oe=D.require("ringo/engine").version.join("."),te="RingoJS"}catch{(H=D.system)&&H.global.system==D.system&&(te="Narwhal",K||(K=H[0].os||null))}te||(te="Rhino")}else typeof D.process=="object"&&!D.process.browser&&(H=D.process)&&(typeof H.versions=="object"&&(typeof H.versions.electron=="string"?(me.push("Node "+H.versions.node),te="Electron",oe=H.versions.electron):typeof H.versions.nw=="string"&&(me.push("Chromium "+oe,"Node "+H.versions.node),te="NW.js",oe=H.versions.nw)),te||(te="Node.js",Ve=H.arch,K=H.platform,oe=/[\d.]+/.exec(H.version),oe=oe?oe[0]:null));else b(H=D.runtime)==F?(te="Adobe AIR",K=H.flash.system.Capabilities.os):b(H=D.phantom)==ie?(te="PhantomJS",oe=(H=H.version||null)&&H.major+"."+H.minor+"."+H.patch):typeof _e.documentMode=="number"&&(H=/\bTrident\/(\d+)/i.exec(E))?(oe=[oe,_e.documentMode],(H=+H[1]+4)!=oe[1]&&(me.push("IE "+oe[1]+" mode"),ae&&(ae[1]=""),oe[1]=H),oe=te=="IE"?String(oe[1].toFixed(1)):oe[0]):typeof _e.documentMode=="number"&&/^(?:Chrome|Firefox)\b/.test(te)&&(me.push("masking as "+te+" "+oe),te="IE",oe="11.0",ae=["Trident"],K="Windows");K=K&&m(K)}if(oe&&(H=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(oe)||/(?:alpha|beta)(?: ?\d)?/i.exec(E+";"+(fe&&R.appMinorVersion))||/\bMinefield\b/i.test(E)&&"a")&&(Ke=/b/i.test(H)?"beta":"alpha",oe=oe.replace(RegExp(H+"\\+?$"),"")+(Ke=="beta"?Be:Me)+(/\d+\+?/.exec(H)||"")),te=="Fennec"||te=="Firefox"&&/\b(?:Android|Firefox OS|KaiOS)\b/.test(K))te="Firefox Mobile";else if(te=="Maxthon"&&oe)oe=oe.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(j))j=="Xbox 360"&&(K=null),j=="Xbox 360"&&/\bIEMobile\b/.test(E)&&me.unshift("mobile mode");else if((/^(?:Chrome|IE|Opera)$/.test(te)||te&&!j&&!/Browser|Mobi/.test(te))&&(K=="Windows CE"||/Mobi/i.test(E)))te+=" Mobile";else if(te=="IE"&&fe)try{D.external===null&&me.unshift("platform preview")}catch{me.unshift("embedded")}else(/\bBlackBerry\b/.test(j)||/\bBB10\b/.test(E))&&(H=(RegExp(j.replace(/ +/g," *")+"/([.\\d]+)","i").exec(E)||0)[1]||oe)?(H=[H,/BB10/.test(E)],K=(H[1]?(j=null,q="BlackBerry"):"Device Software")+" "+H[0],oe=null):this!=g&&j!="Wii"&&(fe&&Ee||/Opera/.test(te)&&/\b(?:MSIE|Firefox)\b/i.test(E)||te=="Firefox"&&/\bOS X (?:\d+\.){2,}/.test(K)||te=="IE"&&(K&&!/^Win/.test(K)&&oe>5.5||/\bWindows XP\b/.test(K)&&oe>8||oe==8&&!/\bTrident\b/.test(E)))&&!l.test(H=k.call(g,E.replace(l,"")+";"))&&H.name&&(H="ing as "+H.name+((H=H.version)?" "+H:""),l.test(te)?(/\bIE\b/.test(H)&&K=="Mac OS"&&(K=null),H="identify"+H):(H="mask"+H,Ue?te=m(Ue.replace(/([a-z])([A-Z])/g,"$1 $2")):te="Opera",/\bIE\b/.test(H)&&(K=null),fe||(oe=null)),ae=["Presto"],me.push(H));(H=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(E)||0)[1])&&(H=[parseFloat(H.replace(/\.(\d)$/,".0$1")),H],te=="Safari"&&H[1].slice(-1)=="+"?(te="WebKit Nightly",Ke="alpha",oe=H[1].slice(0,-1)):(oe==H[1]||oe==(H[2]=(/\bSafari\/([\d.]+\+?)/i.exec(E)||0)[1]))&&(oe=null),H[1]=(/\b(?:Headless)?Chrome\/([\d.]+)/i.exec(E)||0)[1],H[0]==537.36&&H[2]==537.36&&parseFloat(H[1])>=28&&ae=="WebKit"&&(ae=["Blink"]),!fe||!B&&!H[1]?(ae&&(ae[1]="like Safari"),H=(H=H[0],H<400?1:H<500?2:H<526?3:H<533?4:H<534?"4+":H<535?5:H<537?6:H<538?7:H<601?8:H<602?9:H<604?10:H<606?11:H<608?12:"12")):(ae&&(ae[1]="like Chrome"),H=H[1]||(H=H[0],H<530?1:H<532?2:H<532.05?3:H<533?4:H<534.03?5:H<534.07?6:H<534.1?7:H<534.13?8:H<534.16?9:H<534.24?10:H<534.3?11:H<535.01?12:H<535.02?"13+":H<535.07?15:H<535.11?16:H<535.19?17:H<536.05?18:H<536.1?19:H<537.01?20:H<537.11?"21+":H<537.13?23:H<537.18?24:H<537.24?25:H<537.36?26:ae!="Blink"?"27":"28")),ae&&(ae[1]+=" "+(H+=typeof H=="number"?".x":/[.+]/.test(H)?"":"+")),te=="Safari"&&(!oe||parseInt(oe)>45)?oe=H:te=="Chrome"&&/\bHeadlessChrome/i.test(E)&&me.unshift("headless")),te=="Opera"&&(H=/\bzbov|zvav$/.exec(K))?(te+=" ",me.unshift("desktop mode"),H=="zvav"?(te+="Mini",oe=null):te+="Mobile",K=K.replace(RegExp(" *"+H+"$"),"")):te=="Safari"&&/\bChrome\b/.exec(ae&&ae[1])?(me.unshift("desktop mode"),te="Chrome Mobile",oe=null,/\bOS X\b/.test(K)?(q="Apple",K="iOS 4.3+"):K=null):/\bSRWare Iron\b/.test(te)&&!oe&&(oe=U("Chrome")),oe&&oe.indexOf(H=/[\d.]+$/.exec(K))==0&&E.indexOf("/"+H+"-")>-1&&(K=x(K.replace(H,""))),K&&K.indexOf(te)!=-1&&!RegExp(te+" OS").test(K)&&(K=K.replace(RegExp(" *"+y(te)+" *"),"")),ae&&!/\b(?:Avant|Nook)\b/.test(te)&&(/Browser|Lunascape|Maxthon/.test(te)||te!="Safari"&&/^iOS/.test(K)&&/\bSafari\b/.test(ae[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|SRWare Iron|Vivaldi|Web)/.test(te)&&ae[1])&&(H=ae[ae.length-1])&&me.push(H),me.length&&(me=["("+me.join("; ")+")"]),q&&j&&j.indexOf(q)<0&&me.push("on "+q),j&&me.push((/^on /.test(me[me.length-1])?"":"on ")+j),K&&(H=/ ([\d.+]+)$/.exec(K),de=H&&K.charAt(K.length-H[0].length-1)=="/",K={architecture:32,family:H&&!de?K.replace(H[0],""):K,version:H?H[1]:null,toString:function(){var he=this.version;return this.family+(he&&!de?" "+he:"")+(this.architecture==64?" 64-bit":"")}}),(H=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(Ve))&&!/\bi686\b/i.test(Ve)?(K&&(K.architecture=64,K.family=K.family.replace(RegExp(" *"+H),"")),te&&(/\bWOW64\b/i.test(E)||fe&&/\w(?:86|32)$/.test(R.cpuClass||R.platform)&&!/\bWin64; x64\b/i.test(E))&&me.unshift("32-bit")):K&&/^OS X/.test(K.family)&&te=="Chrome"&&parseFloat(oe)>=39&&(K.architecture=64),E||(E=null);var X={};return X.description=E,X.layout=ae&&ae[0],X.manufacturer=q,X.name=te,X.prerelease=Ke,X.product=j,X.ua=E,X.version=te&&oe,X.os=K||{architecture:null,family:null,version:null,toString:function(){return"null"}},X.parse=k,X.toString=Q,X.version&&me.unshift(oe),X.name&&me.unshift(te),K&&te&&!(K==String(K).split(" ")[0]&&(K==te.split(" ")[0]||j))&&me.push(j?"("+K+")":"on "+K),me.length&&(X.description=me.join(" ")),X}var S=k();i&&s?g(S,function(E,D){i[D]=E}):r.platform=S}).call(An)}(ib,ib.exports);var Nfe=ib.exports;const Rfe=Yf(Nfe),zk=()=>{var t;return(t=Rfe.os)==null?void 0:t.family},Pfe=N.forwardRef(({isPreviewMode:t=!1,initialContent:e,enableCollaboration:n,collaborationId:r,username:i,renderToolRightSection:s,renderToolLeftSection:o,walletAddress:a,onChange:l,onCollaboratorChange:u,onTextSelection:c,onCommentInteraction:f,handleCommentButtonClick:d,showCommentButton:h,ensResolutionUrl:p,disableBottomToolbar:m,onError:g},b)=>{const[v,y]=N.useState(!1),[A,x]=N.useState(!1),k=N.useRef(null),S=N.useRef(null),E=B2("(max-width: 640px)"),D=zk()==="iOS"||zk()==="Android"||zk()==="Windows Phone"||E,{editor:T,ref:R,ydoc:L}=cae({isPreviewMode:t,initialContent:e,enableCollaboration:n,collaborationId:r,walletAddress:a,username:i,onChange:l,onCollaboratorChange:u,onCommentInteraction:f,onTextSelection:c,ensResolutionUrl:p,onError:g});return N.useImperativeHandle(b,()=>({getEditor:()=>T,getYdoc:()=>L}),[T,L]),N.useEffect(()=>{if(!T)return;const B=$=>{const{key:Y}=$;return Y.length===1},z=$=>{B($)&&D&&(k.current&&clearTimeout(k.current),x(!0),k.current=setTimeout(()=>{x(!1)},500))},F=T.view.dom;return F.addEventListener("keydown",z),()=>{F.removeEventListener("keydown",z),k.current&&clearTimeout(k.current)}},[T,D]),N.useEffect(()=>{if(T&&D){const B=()=>{y(!0)},z=()=>{y(!1)};return T.on("focus",B),T.on("blur",z),()=>{T.off("focus",B),T.off("blur",z)}}},[D,T]),N.useEffect(()=>{if(!T)return;const B=F=>{F.key==="Enter"&&T.commands.scrollIntoView()},z=T.view.dom;return z.addEventListener("keydown",B),()=>{z.removeEventListener("keydown",B)}},[T]),N.useEffect(()=>{if(!D||!T)return;const B=()=>{R.current&&R.current.scrollIntoView()},z=T.view.dom;return z.addEventListener("resize",B),()=>{z.removeEventListener("resize",B)}},[T,R,D]),T?O.jsxs("div",{"data-cy":"single-webpage",className:"bg-[#f8f9fa] h-full w-full",children:[O.jsx("div",{id:"toolbar",className:"flex items-center w-full h-16 sticky left-0 top-0 z-10 px-4 bg-[#f8f9fa]",children:O.jsxs("div",{className:"flex items-center justify-between gap-2 w-full",children:[O.jsx("div",{className:"grow",children:o==null?void 0:o({editor:T.getJSON()})}),!t&&O.jsx("div",{className:"grow relative hidden xl:block",children:O.jsx(p$,{onError:g,editor:T})}),s==null?void 0:s({editor:T.getJSON()})]})}),O.jsxs("div",{className:"p-4 sm:px-[88px] sm:py-[78px] bg-white w-full sm:w-[70%] max-w-[856px] mx-auto",style:{height:D&&!t?"calc(100vh - 8rem)":"100vh"},children:[O.jsxs("div",{ref:R,className:"w-full h-full overflow-y-scroll overflow-x-hidden no-scrollbar",children:[!t&&O.jsxs("div",{children:[O.jsx(s$,{editor:T}),O.jsx(d$,{editor:T,appendTo:R})]}),O.jsx(h$,{isPreviewMode:t,children:O.jsx(_U,{editor:T,id:"editor",className:"w-full h-full py-4"})})]}),h&&!D&&O.jsx(Lo,{ref:S,onClick:()=>{d==null||d(T)},variant:"ghost",className:ve("absolute w-12 h-12 bg-white rounded-full shadow-xl top-[70px] right-[-23px]"),children:O.jsx(rV,{})})]}),!t&&O.jsx(_fe,{children:!A&&!m&&O.jsx(kfe.div,{initial:{y:50,opacity:0},animate:{y:0,opacity:1},exit:{y:50,opacity:0},transition:{duration:.2},className:ve("flex xl:hidden items-center w-full h-16 fixed left-0 bottom-0 z-10 px-4 bg-[#f8f9fa] transition-all duration-300 ease-in-out",v&&"hidden"),children:O.jsx(dae,{onError:g,editor:T,isKeyboardVisible:v})})})]}):O.jsxs("div",{className:"w-screen h-screen flex flex-col gap-4 justify-center items-center",children:[O.jsx(JO,{}),O.jsx("p",{children:"Loading Editor..."})]})});ot.DdocEditor=Pfe,Object.defineProperty(ot,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@fileverse-dev/ddoc",
3
3
  "private": false,
4
4
  "description": "DDoc",
5
- "version": "1.7.6-patch",
5
+ "version": "1.7.6-patch-2",
6
6
  "main": "dist/index.umd.js",
7
7
  "module": "dist/index.es.js",
8
8
  "exports": {