reactjs-tiptap-editor 0.1.11 → 0.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/bundle-full.cjs +420 -0
- package/lib/bundle-full.js +66070 -0
- package/lib/{reactjs-tiptap-editor.cjs → index.cjs} +1 -1
- package/lib/index.d.cts +61 -61
- package/lib/index.d.ts +61 -61
- package/lib/{reactjs-tiptap-editor.js → index.js} +2 -2
- package/lib/{locales-CAZfnzv4.js → locales-0_7hd40-.js} +15 -17
- package/lib/locales-BA8KlukH.cjs +1 -0
- package/lib/style.css +1 -1
- package/lib/{utils-B0SMxWW-.js → utils-BwnMHOHQ.js} +14 -22
- package/lib/utils-DLIpWZgM.cjs +152 -0
- package/package.json +18 -8
- package/lib/locales-CO2wcFqJ.cjs +0 -1
- package/lib/utils-BG7adOxz.cjs +0 -152
|
@@ -0,0 +1,420 @@
|
|
|
1
|
+
"use strict";var c2=Object.create;var cb=Object.defineProperty;var u2=Object.getOwnPropertyDescriptor;var d2=Object.getOwnPropertyNames;var f2=Object.getPrototypeOf,h2=Object.prototype.hasOwnProperty;var p2=(t,e,r)=>e in t?cb(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var m2=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of d2(e))!h2.call(t,i)&&i!==r&&cb(t,i,{get:()=>e[i],enumerable:!(n=u2(e,i))||n.enumerable});return t};var mk=(t,e,r)=>(r=t!=null?c2(f2(t)):{},m2(e||!t||!t.__esModule?cb(r,"default",{value:t,enumerable:!0}):r,t));var Tn=(t,e,r)=>p2(t,typeof e!="symbol"?e+"":e,r);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const x=require("react/jsx-runtime"),J=require("react"),He=require("lucide-react"),gd=require("tippy.js"),ds=require("react-dom"),y1=require("katex"),v1=require("@radix-ui/react-slot"),g2=require("@radix-ui/react-tooltip"),jp=require("@radix-ui/react-icons"),y2=require("@radix-ui/react-toggle"),ko=require("reactjs-signal"),v2=require("@radix-ui/react-popover"),b2=require("@radix-ui/react-label"),pR=require("re-resizable"),w2=require("@radix-ui/react-dialog"),Zm=require("mermaid"),x2=require("@radix-ui/react-separator"),S2=require("react-tweet"),k2=require("react-colorful"),_2=require("@radix-ui/react-switch"),C2=require("@radix-ui/react-dropdown-menu"),E2=require("@radix-ui/react-tabs"),Kf=require("shiki"),T2=require("@radix-ui/react-select"),A2=require("react-image-crop"),R2=require("@radix-ui/react-checkbox"),b1=require("scroll-into-view-if-needed");function bi(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const At=bi(J),Fh=bi(g2),mR=bi(y2),ch=bi(v2),gR=bi(b2),yi=bi(w2),yR=bi(x2),_0=bi(_2),tr=bi(C2),rc=bi(E2),cr=bi(T2),C0=bi(R2);function Lr(t){this.content=t}Lr.prototype={constructor:Lr,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,r){var n=r&&r!=t?this.remove(r):this,i=n.find(t),o=n.content.slice();return i==-1?o.push(r||t,e):(o[i+1]=e,r&&(o[i]=r)),new Lr(o)},remove:function(t){var e=this.find(t);if(e==-1)return this;var r=this.content.slice();return r.splice(e,2),new Lr(r)},addToStart:function(t,e){return new Lr([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var r=this.remove(t).content.slice();return r.push(t,e),new Lr(r)},addBefore:function(t,e,r){var n=this.remove(e),i=n.content.slice(),o=n.find(t);return i.splice(o==-1?i.length:o,0,e,r),new Lr(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=Lr.from(t),t.size?new Lr(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Lr.from(t),t.size?new Lr(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Lr.from(t);for(var r=0;r<t.content.length;r+=2)e=e.remove(t.content[r]);return e},toObject:function(){var t={};return this.forEach(function(e,r){t[e]=r}),t},get size(){return this.content.length>>1}};Lr.from=function(t){if(t instanceof Lr)return t;var e=[];if(t)for(var r in t)e.push(r,t[r]);return new Lr(e)};function vR(t,e,r){for(let n=0;;n++){if(n==t.childCount||n==e.childCount)return t.childCount==e.childCount?null:r;let i=t.child(n),o=e.child(n);if(i==o){r+=i.nodeSize;continue}if(!i.sameMarkup(o))return r;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)r++;return r}if(i.content.size||o.content.size){let s=vR(i.content,o.content,r+1);if(s!=null)return s}r+=i.nodeSize}}function bR(t,e,r,n){for(let i=t.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:r,b:n};let s=t.child(--i),a=e.child(--o),l=s.nodeSize;if(s==a){r-=l,n-=l;continue}if(!s.sameMarkup(a))return{a:r,b:n};if(s.isText&&s.text!=a.text){let c=0,d=Math.min(s.text.length,a.text.length);for(;c<d&&s.text[s.text.length-c-1]==a.text[a.text.length-c-1];)c++,r--,n--;return{a:r,b:n}}if(s.content.size||a.content.size){let c=bR(s.content,a.content,r-1,n-1);if(c)return c}r-=l,n-=l}}class Le{constructor(e,r){if(this.content=e,this.size=r||0,r==null)for(let n=0;n<e.length;n++)this.size+=e[n].nodeSize}nodesBetween(e,r,n,i=0,o){for(let s=0,a=0;a<r;s++){let l=this.content[s],c=a+l.nodeSize;if(c>e&&n(l,i+a,o||null,s)!==!1&&l.content.size){let d=a+1;l.nodesBetween(Math.max(0,e-d),Math.min(l.content.size,r-d),n,i+d)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,r,n,i){let o="",s=!0;return this.nodesBetween(e,r,(a,l)=>{let c=a.isText?a.text.slice(Math.max(e,l)-l,r-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&n&&(s?s=!1:o+=n),o+=c},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let r=this.lastChild,n=e.firstChild,i=this.content.slice(),o=0;for(r.isText&&r.sameMarkup(n)&&(i[i.length-1]=r.withText(r.text+n.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new Le(i,this.size+e.size)}cut(e,r=this.size){if(e==0&&r==this.size)return this;let n=[],i=0;if(r>e)for(let o=0,s=0;s<r;o++){let a=this.content[o],l=s+a.nodeSize;l>e&&((s<e||l>r)&&(a.isText?a=a.cut(Math.max(0,e-s),Math.min(a.text.length,r-s)):a=a.cut(Math.max(0,e-s-1),Math.min(a.content.size,r-s-1))),n.push(a),i+=a.nodeSize),s=l}return new Le(n,i)}cutByIndex(e,r){return e==r?Le.empty:e==0&&r==this.content.length?this:new Le(this.content.slice(e,r))}replaceChild(e,r){let n=this.content[e];if(n==r)return this;let i=this.content.slice(),o=this.size+r.nodeSize-n.nodeSize;return i[e]=r,new Le(i,o)}addToStart(e){return new Le([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Le(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let r=0;r<this.content.length;r++)if(!this.content[r].eq(e.content[r]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let r=this.content[e];if(!r)throw new RangeError("Index "+e+" out of range for "+this);return r}maybeChild(e){return this.content[e]||null}forEach(e){for(let r=0,n=0;r<this.content.length;r++){let i=this.content[r];e(i,n,r),n+=i.nodeSize}}findDiffStart(e,r=0){return vR(this,e,r)}findDiffEnd(e,r=this.size,n=e.size){return bR(this,e,r,n)}findIndex(e,r=-1){if(e==0)return Bp(0,e);if(e==this.size)return Bp(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,i=0;;n++){let o=this.child(n),s=i+o.nodeSize;if(s>=e)return s==e||r>0?Bp(n+1,s):Bp(n,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,r){if(!r)return Le.empty;if(!Array.isArray(r))throw new RangeError("Invalid input for Fragment.fromJSON");return new Le(r.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Le.empty;let r,n=0;for(let i=0;i<e.length;i++){let o=e[i];n+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(r||(r=e.slice(0,i)),r[r.length-1]=o.withText(r[r.length-1].text+o.text)):r&&r.push(o)}return new Le(r||e,n)}static from(e){if(!e)return Le.empty;if(e instanceof Le)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new Le([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Le.empty=new Le([],0);const ub={index:0,offset:0};function Bp(t,e){return ub.index=t,ub.offset=e,ub}function Qm(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let r=Array.isArray(t);if(Array.isArray(e)!=r)return!1;if(r){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!Qm(t[n],e[n]))return!1}else{for(let n in t)if(!(n in e)||!Qm(t[n],e[n]))return!1;for(let n in e)if(!(n in t))return!1}return!0}let $t=class E0{constructor(e,r){this.type=e,this.attrs=r}addToSet(e){let r,n=!1;for(let i=0;i<e.length;i++){let o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))r||(r=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!n&&o.type.rank>this.type.rank&&(r||(r=e.slice(0,i)),r.push(this),n=!0),r&&r.push(o)}}return r||(r=e.slice()),n||r.push(this),r}removeFromSet(e){for(let r=0;r<e.length;r++)if(this.eq(e[r]))return e.slice(0,r).concat(e.slice(r+1));return e}isInSet(e){for(let r=0;r<e.length;r++)if(this.eq(e[r]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Qm(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let r in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,r){if(!r)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[r.type];if(!n)throw new RangeError(`There is no mark type ${r.type} in this schema`);let i=n.create(r.attrs);return n.checkAttrs(i.attrs),i}static sameSet(e,r){if(e==r)return!0;if(e.length!=r.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(r[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return E0.none;if(e instanceof E0)return[e];let r=e.slice();return r.sort((n,i)=>n.type.rank-i.type.rank),r}};$t.none=[];class eg extends Error{}class qe{constructor(e,r,n){this.content=e,this.openStart=r,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,r){let n=xR(this.content,e+this.openStart,r);return n&&new qe(n,this.openStart,this.openEnd)}removeBetween(e,r){return new qe(wR(this.content,e+this.openStart,r+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,r){if(!r)return qe.empty;let n=r.openStart||0,i=r.openEnd||0;if(typeof n!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new qe(Le.fromJSON(e,r.content),n,i)}static maxOpen(e,r=!0){let n=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(r||!o.type.spec.isolating);o=o.firstChild)n++;for(let o=e.lastChild;o&&!o.isLeaf&&(r||!o.type.spec.isolating);o=o.lastChild)i++;return new qe(e,n,i)}}qe.empty=new qe(Le.empty,0,0);function wR(t,e,r){let{index:n,offset:i}=t.findIndex(e),o=t.maybeChild(n),{index:s,offset:a}=t.findIndex(r);if(i==e||o.isText){if(a!=r&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(r))}if(n!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(n,o.copy(wR(o.content,e-i-1,r-i-1)))}function xR(t,e,r,n){let{index:i,offset:o}=t.findIndex(e),s=t.maybeChild(i);if(o==e||s.isText)return t.cut(0,e).append(r).append(t.cut(e));let a=xR(s.content,e-o-1,r);return a&&t.replaceChild(i,s.copy(a))}function I2(t,e,r){if(r.openStart>t.depth)throw new eg("Inserted content deeper than insertion position");if(t.depth-r.openStart!=e.depth-r.openEnd)throw new eg("Inconsistent open depths");return SR(t,e,r,0)}function SR(t,e,r,n){let i=t.index(n),o=t.node(n);if(i==e.index(n)&&n<t.depth-r.openStart){let s=SR(t,e,r,n+1);return o.copy(o.content.replaceChild(i,s))}else if(r.content.size)if(!r.openStart&&!r.openEnd&&t.depth==n&&e.depth==n){let s=t.parent,a=s.content;return Fl(s,a.cut(0,t.parentOffset).append(r.content).append(a.cut(e.parentOffset)))}else{let{start:s,end:a}=O2(r,t);return Fl(o,_R(t,s,a,e,n))}else return Fl(o,tg(t,e,n))}function kR(t,e){if(!e.type.compatibleContent(t.type))throw new eg("Cannot join "+e.type.name+" onto "+t.type.name)}function T0(t,e,r){let n=t.node(r);return kR(n,e.node(r)),n}function Ll(t,e){let r=e.length-1;r>=0&&t.isText&&t.sameMarkup(e[r])?e[r]=t.withText(e[r].text+t.text):e.push(t)}function qf(t,e,r,n){let i=(e||t).node(r),o=0,s=e?e.index(r):i.childCount;t&&(o=t.index(r),t.depth>r?o++:t.textOffset&&(Ll(t.nodeAfter,n),o++));for(let a=o;a<s;a++)Ll(i.child(a),n);e&&e.depth==r&&e.textOffset&&Ll(e.nodeBefore,n)}function Fl(t,e){return t.type.checkContent(e),t.copy(e)}function _R(t,e,r,n,i){let o=t.depth>i&&T0(t,e,i+1),s=n.depth>i&&T0(r,n,i+1),a=[];return qf(null,t,i,a),o&&s&&e.index(i)==r.index(i)?(kR(o,s),Ll(Fl(o,_R(t,e,r,n,i+1)),a)):(o&&Ll(Fl(o,tg(t,e,i+1)),a),qf(e,r,i,a),s&&Ll(Fl(s,tg(r,n,i+1)),a)),qf(n,null,i,a),new Le(a)}function tg(t,e,r){let n=[];if(qf(null,t,r,n),t.depth>r){let i=T0(t,e,r+1);Ll(Fl(i,tg(t,e,r+1)),n)}return qf(e,null,r,n),new Le(n)}function O2(t,e){let r=e.depth-t.openStart,i=e.node(r).copy(t.content);for(let o=r-1;o>=0;o--)i=e.node(o).copy(Le.from(i));return{start:i.resolveNoCache(t.openStart+r),end:i.resolveNoCache(i.content.size-t.openEnd-r)}}class uh{constructor(e,r,n){this.pos=e,this.path=r,this.parentOffset=n,this.depth=r.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,r=this.index(this.depth);if(r==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],i=e.child(r);return n?e.child(r).cut(n):i}get nodeBefore(){let e=this.index(this.depth),r=this.pos-this.path[this.path.length-1];return r?this.parent.child(e).cut(0,r):e==0?null:this.parent.child(e-1)}posAtIndex(e,r){r=this.resolveDepth(r);let n=this.path[r*3],i=r==0?0:this.path[r*3-1]+1;for(let o=0;o<e;o++)i+=n.child(o).nodeSize;return i}marks(){let e=this.parent,r=this.index();if(e.content.size==0)return $t.none;if(this.textOffset)return e.child(r).marks;let n=e.maybeChild(r-1),i=e.maybeChild(r);if(!n){let a=n;n=i,i=a}let o=n.marks;for(var s=0;s<o.length;s++)o[s].type.spec.inclusive===!1&&(!i||!o[s].isInSet(i.marks))&&(o=o[s--].removeFromSet(o));return o}marksAcross(e){let r=this.parent.maybeChild(this.index());if(!r||!r.isInline)return null;let n=r.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<n.length;o++)n[o].type.spec.inclusive===!1&&(!i||!n[o].isInSet(i.marks))&&(n=n[o--].removeFromSet(n));return n}sharedDepth(e){for(let r=this.depth;r>0;r--)if(this.start(r)<=e&&this.end(r)>=e)return r;return 0}blockRange(e=this,r){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!r||r(this.node(n))))return new dh(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let r=1;r<=this.depth;r++)e+=(e?"/":"")+this.node(r).type.name+"_"+this.index(r-1);return e+":"+this.parentOffset}static resolve(e,r){if(!(r>=0&&r<=e.content.size))throw new RangeError("Position "+r+" out of range");let n=[],i=0,o=r;for(let s=e;;){let{index:a,offset:l}=s.content.findIndex(o),c=o-l;if(n.push(s,a,i+l),!c||(s=s.child(a),s.isText))break;o=c-1,i+=l+1}return new uh(r,n,o)}static resolveCached(e,r){let n=gk.get(e);if(n)for(let o=0;o<n.elts.length;o++){let s=n.elts[o];if(s.pos==r)return s}else gk.set(e,n=new M2);let i=n.elts[n.i]=uh.resolve(e,r);return n.i=(n.i+1)%N2,i}}class M2{constructor(){this.elts=[],this.i=0}}const N2=12,gk=new WeakMap;class dh{constructor(e,r,n){this.$from=e,this.$to=r,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const D2=Object.create(null);let ls=class A0{constructor(e,r,n,i=$t.none){this.type=e,this.attrs=r,this.marks=i,this.content=n||Le.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,r,n,i=0){this.content.nodesBetween(e,r,n,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,r,n,i){return this.content.textBetween(e,r,n,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,r,n){return this.type==e&&Qm(this.attrs,r||e.defaultAttrs||D2)&&$t.sameSet(this.marks,n||$t.none)}copy(e=null){return e==this.content?this:new A0(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new A0(this.type,this.attrs,this.content,e)}cut(e,r=this.content.size){return e==0&&r==this.content.size?this:this.copy(this.content.cut(e,r))}slice(e,r=this.content.size,n=!1){if(e==r)return qe.empty;let i=this.resolve(e),o=this.resolve(r),s=n?0:i.sharedDepth(r),a=i.start(s),c=i.node(s).content.cut(i.pos-a,o.pos-a);return new qe(c,i.depth-s,o.depth-s)}replace(e,r,n){return I2(this.resolve(e),this.resolve(r),n)}nodeAt(e){for(let r=this;;){let{index:n,offset:i}=r.content.findIndex(e);if(r=r.maybeChild(n),!r)return null;if(i==e||r.isText)return r;e-=i+1}}childAfter(e){let{index:r,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(r),index:r,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:r,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(r),index:r,offset:n};let i=this.content.child(r-1);return{node:i,index:r-1,offset:n-i.nodeSize}}resolve(e){return uh.resolveCached(this,e)}resolveNoCache(e){return uh.resolve(this,e)}rangeHasMark(e,r,n){let i=!1;return r>e&&this.nodesBetween(e,r,o=>(n.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),CR(this.marks,e)}contentMatchAt(e){let r=this.type.contentMatch.matchFragment(this.content,0,e);if(!r)throw new Error("Called contentMatchAt on a node with invalid content");return r}canReplace(e,r,n=Le.empty,i=0,o=n.childCount){let s=this.contentMatchAt(e).matchFragment(n,i,o),a=s&&s.matchFragment(this.content,r);if(!a||!a.validEnd)return!1;for(let l=i;l<o;l++)if(!this.type.allowsMarks(n.child(l).marks))return!1;return!0}canReplaceWith(e,r,n,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(n),s=o&&o.matchFragment(this.content,r);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=$t.none;for(let r=0;r<this.marks.length;r++){let n=this.marks[r];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!$t.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(r=>r.type.name)}`);this.content.forEach(r=>r.check())}toJSON(){let e={type:this.type.name};for(let r in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(r=>r.toJSON())),e}static fromJSON(e,r){if(!r)throw new RangeError("Invalid input for Node.fromJSON");let n;if(r.marks){if(!Array.isArray(r.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=r.marks.map(e.markFromJSON)}if(r.type=="text"){if(typeof r.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(r.text,n)}let i=Le.fromJSON(e,r.content),o=e.nodeType(r.type).create(r.attrs,i,n);return o.type.checkAttrs(o.attrs),o}};ls.prototype.text=void 0;class rg extends ls{constructor(e,r,n,i){if(super(e,r,null,i),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):CR(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,r){return this.text.slice(e,r)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new rg(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new rg(this.type,this.attrs,e,this.marks)}cut(e=0,r=this.text.length){return e==0&&r==this.text.length?this:this.withText(this.text.slice(e,r))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function CR(t,e){for(let r=t.length-1;r>=0;r--)e=t[r].type.name+"("+e+")";return e}class Wl{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,r){let n=new P2(e,r);if(n.next==null)return Wl.empty;let i=ER(n);n.next&&n.err("Unexpected trailing text");let o=$2(H2(i));return U2(o,n),o}matchType(e){for(let r=0;r<this.next.length;r++)if(this.next[r].type==e)return this.next[r].next;return null}matchFragment(e,r=0,n=e.childCount){let i=this;for(let o=r;i&&o<n;o++)i=i.matchType(e.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:r}=this.next[e];if(!(r.isText||r.hasRequiredAttrs()))return r}return null}compatible(e){for(let r=0;r<this.next.length;r++)for(let n=0;n<e.next.length;n++)if(this.next[r].type==e.next[n].type)return!0;return!1}fillBefore(e,r=!1,n=0){let i=[this];function o(s,a){let l=s.matchFragment(e,n);if(l&&(!r||l.validEnd))return Le.from(a.map(c=>c.createAndFill()));for(let c=0;c<s.next.length;c++){let{type:d,next:f}=s.next[c];if(!(d.isText||d.hasRequiredAttrs())&&i.indexOf(f)==-1){i.push(f);let p=o(f,a.concat(d));if(p)return p}}return null}return o(this,[])}findWrapping(e){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==e)return this.wrapCache[n+1];let r=this.computeWrapping(e);return this.wrapCache.push(e,r),r}computeWrapping(e){let r=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let i=n.shift(),o=i.match;if(o.matchType(e)){let s=[];for(let a=i;a.type;a=a.via)s.push(a.type);return s.reverse()}for(let s=0;s<o.next.length;s++){let{type:a,next:l}=o.next[s];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in r)&&(!i.type||l.validEnd)&&(n.push({match:a.contentMatch,type:a,via:i}),r[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function r(n){e.push(n);for(let i=0;i<n.next.length;i++)e.indexOf(n.next[i].next)==-1&&r(n.next[i].next)}return r(this),e.map((n,i)=>{let o=i+(n.validEnd?"*":" ")+" ";for(let s=0;s<n.next.length;s++)o+=(s?", ":"")+n.next[s].type.name+"->"+e.indexOf(n.next[s].next);return o}).join(`
|
|
2
|
+
`)}}Wl.empty=new Wl(!0);class P2{constructor(e,r){this.string=e,this.nodeTypes=r,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function ER(t){let e=[];do e.push(L2(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function L2(t){let e=[];do e.push(F2(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function F2(t){let e=z2(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=j2(t,e);else break;return e}function yk(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function j2(t,e){let r=yk(t),n=r;return t.eat(",")&&(t.next!="}"?n=yk(t):n=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:r,max:n,expr:e}}function B2(t,e){let r=t.nodeTypes,n=r[e];if(n)return[n];let i=[];for(let o in r){let s=r[o];s.isInGroup(e)&&i.push(s)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function z2(t){if(t.eat("(")){let e=ER(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=B2(t,t.next).map(r=>(t.inline==null?t.inline=r.isInline:t.inline!=r.isInline&&t.err("Mixing inline and block content"),{type:"name",value:r}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function H2(t){let e=[[]];return i(o(t,0),r()),e;function r(){return e.push([])-1}function n(s,a,l){let c={term:l,to:a};return e[s].push(c),c}function i(s,a){s.forEach(l=>l.to=a)}function o(s,a){if(s.type=="choice")return s.exprs.reduce((l,c)=>l.concat(o(c,a)),[]);if(s.type=="seq")for(let l=0;;l++){let c=o(s.exprs[l],a);if(l==s.exprs.length-1)return c;i(c,a=r())}else if(s.type=="star"){let l=r();return n(a,l),i(o(s.expr,l),l),[n(l)]}else if(s.type=="plus"){let l=r();return i(o(s.expr,a),l),i(o(s.expr,l),l),[n(l)]}else{if(s.type=="opt")return[n(a)].concat(o(s.expr,a));if(s.type=="range"){let l=a;for(let c=0;c<s.min;c++){let d=r();i(o(s.expr,l),d),l=d}if(s.max==-1)i(o(s.expr,l),l);else for(let c=s.min;c<s.max;c++){let d=r();n(l,d),i(o(s.expr,l),d),l=d}return[n(l)]}else{if(s.type=="name")return[n(a,void 0,s.value)];throw new Error("Unknown expr type")}}}}function TR(t,e){return e-t}function vk(t,e){let r=[];return n(e),r.sort(TR);function n(i){let o=t[i];if(o.length==1&&!o[0].term)return n(o[0].to);r.push(i);for(let s=0;s<o.length;s++){let{term:a,to:l}=o[s];!a&&r.indexOf(l)==-1&&n(l)}}}function $2(t){let e=Object.create(null);return r(vk(t,0));function r(n){let i=[];n.forEach(s=>{t[s].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let d=0;d<i.length;d++)i[d][0]==a&&(c=i[d][1]);vk(t,l).forEach(d=>{c||i.push([a,c=[]]),c.indexOf(d)==-1&&c.push(d)})})});let o=e[n.join(",")]=new Wl(n.indexOf(t.length-1)>-1);for(let s=0;s<i.length;s++){let a=i[s][1].sort(TR);o.next.push({type:i[s][0],next:e[a.join(",")]||r(a)})}return o}}function U2(t,e){for(let r=0,n=[t];r<n.length;r++){let i=n[r],o=!i.validEnd,s=[];for(let a=0;a<i.next.length;a++){let{type:l,next:c}=i.next[a];s.push(l.name),o&&!(l.isText||l.hasRequiredAttrs())&&(o=!1),n.indexOf(c)==-1&&n.push(c)}o&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function AR(t){let e=Object.create(null);for(let r in t){let n=t[r];if(!n.hasDefault)return null;e[r]=n.default}return e}function RR(t,e){let r=Object.create(null);for(let n in t){let i=e&&e[n];if(i===void 0){let o=t[n];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+n)}r[n]=i}return r}function IR(t,e,r,n){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${r} of type ${i}`);for(let i in t){let o=t[i];o.validate&&o.validate(e[i])}}function OR(t,e){let r=Object.create(null);if(e)for(let n in e)r[n]=new V2(t,n,e[n]);return r}let bk=class MR{constructor(e,r,n){this.name=e,this.schema=r,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=OR(e,n.attrs),this.defaultAttrs=AR(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Wl.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:RR(this.attrs,e)}create(e=null,r,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new ls(this,this.computeAttrs(e),Le.from(r),$t.setFrom(n))}createChecked(e=null,r,n){return r=Le.from(r),this.checkContent(r),new ls(this,this.computeAttrs(e),r,$t.setFrom(n))}createAndFill(e=null,r,n){if(e=this.computeAttrs(e),r=Le.from(r),r.size){let s=this.contentMatch.fillBefore(r);if(!s)return null;r=s.append(r)}let i=this.contentMatch.matchFragment(r),o=i&&i.fillBefore(Le.empty,!0);return o?new ls(this,e,r.append(o),$t.setFrom(n)):null}validContent(e){let r=this.contentMatch.matchFragment(e);if(!r||!r.validEnd)return!1;for(let n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){IR(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let r=0;r<e.length;r++)if(!this.allowsMarkType(e[r].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let r;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?r&&r.push(e[n]):r||(r=e.slice(0,n));return r?r.length?r:$t.none:e}static compile(e,r){let n=Object.create(null);e.forEach((o,s)=>n[o]=new MR(o,r,s));let i=r.spec.topNode||"doc";if(!n[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let o in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}};function W2(t,e,r){let n=r.split("|");return i=>{let o=i===null?"null":typeof i;if(n.indexOf(o)<0)throw new RangeError(`Expected value of type ${n} for attribute ${e} on type ${t}, got ${o}`)}}class V2{constructor(e,r,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate=typeof n.validate=="string"?W2(e,r,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class wy{constructor(e,r,n,i){this.name=e,this.rank=r,this.schema=n,this.spec=i,this.attrs=OR(e,i.attrs),this.excluded=null;let o=AR(this.attrs);this.instance=o?new $t(this,o):null}create(e=null){return!e&&this.instance?this.instance:new $t(this,RR(this.attrs,e))}static compile(e,r){let n=Object.create(null),i=0;return e.forEach((o,s)=>n[o]=new wy(o,i++,r,s)),n}removeFromSet(e){for(var r=0;r<e.length;r++)e[r].type==this&&(e=e.slice(0,r).concat(e.slice(r+1)),r--);return e}isInSet(e){for(let r=0;r<e.length;r++)if(e[r].type==this)return e[r]}checkAttrs(e){IR(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class NR{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let r=this.spec={};for(let i in e)r[i]=e[i];r.nodes=Lr.from(e.nodes),r.marks=Lr.from(e.marks||{}),this.nodes=bk.compile(this.spec.nodes,this),this.marks=wy.compile(this.spec.marks,this);let n=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],s=o.spec.content||"",a=o.spec.marks;if(o.contentMatch=n[s]||(n[s]=Wl.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=a=="_"?null:a?wk(this,a.split(" ")):a==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:wk(this,s.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,r=null,n,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof bk){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(r,n,i)}text(e,r){let n=this.nodes.text;return new rg(n,n.defaultAttrs,e,$t.setFrom(r))}mark(e,r){return typeof e=="string"&&(e=this.marks[e]),e.create(r)}nodeFromJSON(e){return ls.fromJSON(this,e)}markFromJSON(e){return $t.fromJSON(this,e)}nodeType(e){let r=this.nodes[e];if(!r)throw new RangeError("Unknown node type: "+e);return r}}function wk(t,e){let r=[];for(let n=0;n<e.length;n++){let i=e[n],o=t.marks[i],s=o;if(o)r.push(o);else for(let a in t.marks){let l=t.marks[a];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&r.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[n]+"'")}return r}function G2(t){return t.tag!=null}function K2(t){return t.style!=null}let Xf=class R0{constructor(e,r){this.schema=e,this.rules=r,this.tags=[],this.styles=[];let n=this.matchedStyles=[];r.forEach(i=>{if(G2(i))this.tags.push(i);else if(K2(i)){let o=/[^=]*/.exec(i.style)[0];n.indexOf(o)<0&&n.push(o),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let o=e.nodes[i.node];return o.contentMatch.matchType(o)})}parse(e,r={}){let n=new Sk(this,r,!1);return n.addAll(e,$t.none,r.from,r.to),n.finish()}parseSlice(e,r={}){let n=new Sk(this,r,!0);return n.addAll(e,$t.none,r.from,r.to),qe.maxOpen(n.finish())}matchTag(e,r,n){for(let i=n?this.tags.indexOf(n)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(Y2(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||r.matchesContext(o.context))){if(o.getAttrs){let s=o.getAttrs(e);if(s===!1)continue;o.attrs=s||void 0}return o}}}matchStyle(e,r,n,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let s=this.styles[o],a=s.style;if(!(a.indexOf(e)!=0||s.context&&!n.matchesContext(s.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=r))){if(s.getAttrs){let l=s.getAttrs(r);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){let r=[];function n(i){let o=i.priority==null?50:i.priority,s=0;for(;s<r.length;s++){let a=r[s];if((a.priority==null?50:a.priority)<o)break}r.splice(s,0,i)}for(let i in e.marks){let o=e.marks[i].spec.parseDOM;o&&o.forEach(s=>{n(s=kk(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(s=>{n(s=kk(s)),s.node||s.ignore||s.mark||(s.node=i)})}return r}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new R0(e,R0.schemaRules(e)))}};const DR={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},q2={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},PR={ol:!0,ul:!0},fh=1,I0=2,Yf=4;function xk(t,e,r){return e!=null?(e?fh:0)|(e==="full"?I0:0):t&&t.whitespace=="pre"?fh|I0:r&~Yf}class zp{constructor(e,r,n,i,o,s){this.type=e,this.attrs=r,this.marks=n,this.solid=i,this.options=s,this.content=[],this.activeMarks=$t.none,this.match=o||(s&Yf?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let r=this.type.contentMatch.fillBefore(Le.from(e));if(r)this.match=this.type.contentMatch.matchFragment(r);else{let n=this.type.contentMatch,i;return(i=n.findWrapping(e.type))?(this.match=n,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&fh)){let n=this.content[this.content.length-1],i;if(n&&n.isText&&(i=/[ \t\r\n\u000c]+$/.exec(n.text))){let o=n;n.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let r=Le.from(this.content);return!e&&this.match&&(r=r.append(this.match.fillBefore(Le.empty,!0))),this.type?this.type.create(this.attrs,r,this.marks):r}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!DR.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Sk{constructor(e,r,n){this.parser=e,this.options=r,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let i=r.topNode,o,s=xk(null,r.preserveWhitespace,0)|(n?Yf:0);i?o=new zp(i.type,i.attrs,$t.none,!0,r.topMatch||i.type.contentMatch,s):n?o=new zp(null,null,$t.none,!0,null,s):o=new zp(e.schema.topNodeType,null,$t.none,!0,null,s),this.nodes=[o],this.find=r.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,r){e.nodeType==3?this.addTextNode(e,r):e.nodeType==1&&this.addElement(e,r)}addTextNode(e,r){let n=e.nodeValue,i=this.top,o=i.options&I0?"full":this.localPreserveWS||(i.options&fh)>0;if(o==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(o)o!=="full"?n=n.replace(/\r?\n|\r/g," "):n=n.replace(/\r\n?/g,`
|
|
3
|
+
`);else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let s=i.content[i.content.length-1],a=e.previousSibling;(!s||a&&a.nodeName=="BR"||s.isText&&/[ \t\r\n\u000c]$/.test(s.text))&&(n=n.slice(1))}n&&this.insertNode(this.parser.schema.text(n),r),this.findInText(e)}else this.findInside(e)}addElement(e,r,n){let i=this.localPreserveWS,o=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let s=e.nodeName.toLowerCase(),a;PR.hasOwnProperty(s)&&this.parser.normalizeLists&&X2(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,n));e:if(l?l.ignore:q2.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,r);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let c,d=this.needsBlock;if(DR.hasOwnProperty(s))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),c=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,r);break e}let f=l&&l.skip?r:this.readStyles(e,r);f&&this.addAll(e,f),c&&this.sync(o),this.needsBlock=d}else{let c=this.readStyles(e,r);c&&this.addElementByRule(e,l,c,l.consuming===!1?a:void 0)}this.localPreserveWS=i}leafFallback(e,r){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
4
|
+
`),r)}ignoreFallback(e,r){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),r)}readStyles(e,r){let n=e.style;if(n&&n.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let o=this.parser.matchedStyles[i],s=n.getPropertyValue(o);if(s)for(let a=void 0;;){let l=this.parser.matchStyle(o,s,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?r=r.filter(c=>!l.clearMark(c)):r=r.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return r}addElementByRule(e,r,n,i){let o,s;if(r.node)if(s=this.parser.schema.nodes[r.node],s.isLeaf)this.insertNode(s.create(r.attrs),n)||this.leafFallback(e,n);else{let l=this.enter(s,r.attrs||null,n,r.preserveWhitespace);l&&(o=!0,n=l)}else{let l=this.parser.schema.marks[r.mark];n=n.concat(l.create(r.attrs))}let a=this.top;if(s&&s.isLeaf)this.findInside(e);else if(i)this.addElement(e,n,i);else if(r.getContent)this.findInside(e),r.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,n));else{let l=e;typeof r.contentElement=="string"?l=e.querySelector(r.contentElement):typeof r.contentElement=="function"?l=r.contentElement(e):r.contentElement&&(l=r.contentElement),this.findAround(e,l,!0),this.addAll(l,n),this.findAround(e,l,!1)}o&&this.sync(a)&&this.open--}addAll(e,r,n,i){let o=n||0;for(let s=n?e.childNodes[n]:e.firstChild,a=i==null?null:e.childNodes[i];s!=a;s=s.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(s,r);this.findAtPoint(e,o)}findPlace(e,r){let n,i;for(let o=this.open;o>=0;o--){let s=this.nodes[o],a=s.findWrapping(e);if(a&&(!n||n.length>a.length)&&(n=a,i=s,!a.length)||s.solid)break}if(!n)return null;this.sync(i);for(let o=0;o<n.length;o++)r=this.enterInner(n[o],null,r,!1);return r}insertNode(e,r){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(r=this.enterInner(i,null,r))}let n=this.findPlace(e,r);if(n){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let o=$t.none;for(let s of n.concat(e.marks))(i.type?i.type.allowsMarkType(s.type):_k(s.type,e.type))&&(o=s.addToSet(o));return i.content.push(e.mark(o)),!0}return!1}enter(e,r,n,i){let o=this.findPlace(e.create(r),n);return o&&(o=this.enterInner(e,r,n,!0,i)),o}enterInner(e,r,n,i=!1,o){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(e);let a=xk(e,o,s.options);s.options&Yf&&s.content.length==0&&(a|=Yf);let l=$t.none;return n=n.filter(c=>(s.type?s.type.allowsMarkType(c.type):_k(c.type,e))?(l=c.addToSet(l),!1):!0),this.nodes.push(new zp(e,r,l,i,null,a)),this.open++,n}closeExtra(e=!1){let r=this.nodes.length-1;if(r>this.open){for(;r>this.open;r--)this.nodes[r-1].content.push(this.nodes[r].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let r=this.open;r>=0;r--){if(this.nodes[r]==e)return this.open=r,!0;this.localPreserveWS&&(this.nodes[r].options|=fh)}return!1}get currentPos(){this.closeExtra();let e=0;for(let r=this.open;r>=0;r--){let n=this.nodes[r].content;for(let i=n.length-1;i>=0;i--)e+=n[i].nodeSize;r&&e++}return e}findAtPoint(e,r){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==r&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&(this.find[r].pos=this.currentPos)}findAround(e,r,n){if(e!=r&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&r.compareDocumentPosition(this.find[i].node)&(n?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&(this.find[r].pos=this.currentPos-(e.nodeValue.length-this.find[r].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let r=e.split("/"),n=this.options.context,i=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),o=-(n?n.depth+1:0)+(i?0:1),s=(a,l)=>{for(;a>=0;a--){let c=r[a];if(c==""){if(a==r.length-1||a==0)continue;for(;l>=o;l--)if(s(a-1,l))return!0;return!1}else{let d=l>0||l==0&&i?this.nodes[l].type:n&&l>=o?n.node(l-o).type:null;if(!d||d.name!=c&&!d.isInGroup(c))return!1;l--}}return!0};return s(r.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let r=e.depth;r>=0;r--){let n=e.node(r).contentMatchAt(e.indexAfter(r)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let r in this.parser.schema.nodes){let n=this.parser.schema.nodes[r];if(n.isTextblock&&n.defaultAttrs)return n}}}function X2(t){for(let e=t.firstChild,r=null;e;e=e.nextSibling){let n=e.nodeType==1?e.nodeName.toLowerCase():null;n&&PR.hasOwnProperty(n)&&r?(r.appendChild(e),e=r):n=="li"?r=e:n&&(r=null)}}function Y2(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function kk(t){let e={};for(let r in t)e[r]=t[r];return e}function _k(t,e){let r=e.schema.nodes;for(let n in r){let i=r[n];if(!i.allowsMarkType(t))continue;let o=[],s=a=>{o.push(a);for(let l=0;l<a.edgeCount;l++){let{type:c,next:d}=a.edge(l);if(c==e||o.indexOf(d)<0&&s(d))return!0}};if(s(i.contentMatch))return!0}}class nc{constructor(e,r){this.nodes=e,this.marks=r}serializeFragment(e,r={},n){n||(n=db(r).createDocumentFragment());let i=n,o=[];return e.forEach(s=>{if(o.length||s.marks.length){let a=0,l=0;for(;a<o.length&&l<s.marks.length;){let c=s.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(o[a][0])||c.type.spec.spanning===!1)break;a++,l++}for(;a<o.length;)i=o.pop()[1];for(;l<s.marks.length;){let c=s.marks[l++],d=this.serializeMark(c,s.isInline,r);d&&(o.push([c,i]),i.appendChild(d.dom),i=d.contentDOM||d.dom)}}i.appendChild(this.serializeNodeInner(s,r))}),n}serializeNodeInner(e,r){let{dom:n,contentDOM:i}=Am(db(r),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,r,i)}return n}serializeNode(e,r={}){let n=this.serializeNodeInner(e,r);for(let i=e.marks.length-1;i>=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,r);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n}serializeMark(e,r,n={}){let i=this.marks[e.type.name];return i&&Am(db(n),i(e,r),null,e.attrs)}static renderSpec(e,r,n=null,i){return Am(e,r,n,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new nc(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let r=Ck(e.nodes);return r.text||(r.text=n=>n.text),r}static marksFromSchema(e){return Ck(e.marks)}}function Ck(t){let e={};for(let r in t){let n=t[r].spec.toDOM;n&&(e[r]=n)}return e}function db(t){return t.document||window.document}const Ek=new WeakMap;function J2(t){let e=Ek.get(t);return e===void 0&&Ek.set(t,e=Z2(t)),e}function Z2(t){let e=null;function r(n){if(n&&typeof n=="object")if(Array.isArray(n))if(typeof n[0]=="string")e||(e=[]),e.push(n);else for(let i=0;i<n.length;i++)r(n[i]);else for(let i in n)r(n[i])}return r(t),e}function Am(t,e,r,n){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i=e[0],o;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(n&&(o=J2(n))&&o.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=i.indexOf(" ");s>0&&(r=i.slice(0,s),i=i.slice(s+1));let a,l=r?t.createElementNS(r,i):t.createElement(i),c=e[1],d=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){d=2;for(let f in c)if(c[f]!=null){let p=f.indexOf(" ");p>0?l.setAttributeNS(f.slice(0,p),f.slice(p+1),c[f]):l.setAttribute(f,c[f])}}for(let f=d;f<e.length;f++){let p=e[f];if(p===0){if(f<e.length-1||f>d)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:m,contentDOM:g}=Am(t,p,r,n);if(l.appendChild(m),g){if(a)throw new RangeError("Multiple content holes");a=g}}}return{dom:l,contentDOM:a}}const LR=65535,FR=Math.pow(2,16);function Q2(t,e){return t+e*FR}function Tk(t){return t&LR}function eP(t){return(t-(t&LR))/FR}const jR=1,BR=2,Rm=4,zR=8;class O0{constructor(e,r,n){this.pos=e,this.delInfo=r,this.recover=n}get deleted(){return(this.delInfo&zR)>0}get deletedBefore(){return(this.delInfo&(jR|Rm))>0}get deletedAfter(){return(this.delInfo&(BR|Rm))>0}get deletedAcross(){return(this.delInfo&Rm)>0}}class Un{constructor(e,r=!1){if(this.ranges=e,this.inverted=r,!e.length&&Un.empty)return Un.empty}recover(e){let r=0,n=Tk(e);if(!this.inverted)for(let i=0;i<n;i++)r+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[n*3]+r+eP(e)}mapResult(e,r=1){return this._map(e,r,!1)}map(e,r=1){return this._map(e,r,!0)}_map(e,r,n){let i=0,o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>e)break;let c=this.ranges[a+o],d=this.ranges[a+s],f=l+c;if(e<=f){let p=c?e==l?-1:e==f?1:r:r,m=l+i+(p<0?0:d);if(n)return m;let g=e==(r<0?l:f)?null:Q2(a/3,e-l),b=e==l?BR:e==f?jR:Rm;return(r<0?e!=l:e!=f)&&(b|=zR),new O0(m,b,g)}i+=d-c}return n?e+i:new O0(e+i,0,null)}touches(e,r){let n=0,i=Tk(r),o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?n:0);if(l>e)break;let c=this.ranges[a+o],d=l+c;if(e<=d&&a==i*3)return!0;n+=this.ranges[a+s]-c}return!1}forEach(e){let r=this.inverted?2:1,n=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let s=this.ranges[i],a=s-(this.inverted?o:0),l=s+(this.inverted?0:o),c=this.ranges[i+r],d=this.ranges[i+n];e(a,a+c,l,l+d),o+=d-c}}invert(){return new Un(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Un.empty:new Un(e<0?[0,-e,0]:[0,0,e])}}Un.empty=new Un([]);class Du{constructor(e=[],r,n=0,i=e.length){this.maps=e,this.mirror=r,this.from=n,this.to=i}slice(e=0,r=this.maps.length){return new Du(this.maps,this.mirror,e,r)}copy(){return new Du(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,r){this.to=this.maps.push(e),r!=null&&this.setMirror(this.maps.length-1,r)}appendMapping(e){for(let r=0,n=this.maps.length;r<e.maps.length;r++){let i=e.getMirror(r);this.appendMap(e.maps[r],i!=null&&i<r?n+i:void 0)}}getMirror(e){if(this.mirror){for(let r=0;r<this.mirror.length;r++)if(this.mirror[r]==e)return this.mirror[r+(r%2?-1:1)]}}setMirror(e,r){this.mirror||(this.mirror=[]),this.mirror.push(e,r)}appendMappingInverted(e){for(let r=e.maps.length-1,n=this.maps.length+e.maps.length;r>=0;r--){let i=e.getMirror(r);this.appendMap(e.maps[r].invert(),i!=null&&i>r?n-i-1:void 0)}}invert(){let e=new Du;return e.appendMappingInverted(this),e}map(e,r=1){if(this.mirror)return this._map(e,r,!0);for(let n=this.from;n<this.to;n++)e=this.maps[n].map(e,r);return e}mapResult(e,r=1){return this._map(e,r,!1)}_map(e,r,n){let i=0;for(let o=this.from;o<this.to;o++){let s=this.maps[o],a=s.mapResult(e,r);if(a.recover!=null){let l=this.getMirror(o);if(l!=null&&l>o&&l<this.to){o=l,e=this.maps[l].recover(a.recover);continue}}i|=a.delInfo,e=a.pos}return n?e:new O0(e,i,null)}}const fb=Object.create(null);class Qr{getMap(){return Un.empty}merge(e){return null}static fromJSON(e,r){if(!r||!r.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=fb[r.stepType];if(!n)throw new RangeError(`No step type ${r.stepType} defined`);return n.fromJSON(e,r)}static jsonID(e,r){if(e in fb)throw new RangeError("Duplicate use of step JSON ID "+e);return fb[e]=r,r.prototype.jsonID=e,r}}class fr{constructor(e,r){this.doc=e,this.failed=r}static ok(e){return new fr(e,null)}static fail(e){return new fr(null,e)}static fromReplace(e,r,n,i){try{return fr.ok(e.replace(r,n,i))}catch(o){if(o instanceof eg)return fr.fail(o.message);throw o}}}function w1(t,e,r){let n=[];for(let i=0;i<t.childCount;i++){let o=t.child(i);o.content.size&&(o=o.copy(w1(o.content,e,o))),o.isInline&&(o=e(o,r,i)),n.push(o)}return Le.fromArray(n)}class da extends Qr{constructor(e,r,n){super(),this.from=e,this.to=r,this.mark=n}apply(e){let r=e.slice(this.from,this.to),n=e.resolve(this.from),i=n.node(n.sharedDepth(this.to)),o=new qe(w1(r.content,(s,a)=>!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),r.openStart,r.openEnd);return fr.fromReplace(e,this.from,this.to,o)}invert(){return new po(this.from,this.to,this.mark)}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return r.deleted&&n.deleted||r.pos>=n.pos?null:new da(r.pos,n.pos,this.mark)}merge(e){return e instanceof da&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new da(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new da(r.from,r.to,e.markFromJSON(r.mark))}}Qr.jsonID("addMark",da);class po extends Qr{constructor(e,r,n){super(),this.from=e,this.to=r,this.mark=n}apply(e){let r=e.slice(this.from,this.to),n=new qe(w1(r.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),r.openStart,r.openEnd);return fr.fromReplace(e,this.from,this.to,n)}invert(){return new da(this.from,this.to,this.mark)}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return r.deleted&&n.deleted||r.pos>=n.pos?null:new po(r.pos,n.pos,this.mark)}merge(e){return e instanceof po&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new po(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new po(r.from,r.to,e.markFromJSON(r.mark))}}Qr.jsonID("removeMark",po);class fa extends Qr{constructor(e,r){super(),this.pos=e,this.mark=r}apply(e){let r=e.nodeAt(this.pos);if(!r)return fr.fail("No node at mark step's position");let n=r.type.create(r.attrs,null,this.mark.addToSet(r.marks));return fr.fromReplace(e,this.pos,this.pos+1,new qe(Le.from(n),0,r.isLeaf?0:1))}invert(e){let r=e.nodeAt(this.pos);if(r){let n=this.mark.addToSet(r.marks);if(n.length==r.marks.length){for(let i=0;i<r.marks.length;i++)if(!r.marks[i].isInSet(n))return new fa(this.pos,r.marks[i]);return new fa(this.pos,this.mark)}}return new Ku(this.pos,this.mark)}map(e){let r=e.mapResult(this.pos,1);return r.deletedAfter?null:new fa(r.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,r){if(typeof r.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new fa(r.pos,e.markFromJSON(r.mark))}}Qr.jsonID("addNodeMark",fa);class Ku extends Qr{constructor(e,r){super(),this.pos=e,this.mark=r}apply(e){let r=e.nodeAt(this.pos);if(!r)return fr.fail("No node at mark step's position");let n=r.type.create(r.attrs,null,this.mark.removeFromSet(r.marks));return fr.fromReplace(e,this.pos,this.pos+1,new qe(Le.from(n),0,r.isLeaf?0:1))}invert(e){let r=e.nodeAt(this.pos);return!r||!this.mark.isInSet(r.marks)?this:new fa(this.pos,this.mark)}map(e){let r=e.mapResult(this.pos,1);return r.deletedAfter?null:new Ku(r.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,r){if(typeof r.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Ku(r.pos,e.markFromJSON(r.mark))}}Qr.jsonID("removeNodeMark",Ku);class kr extends Qr{constructor(e,r,n,i=!1){super(),this.from=e,this.to=r,this.slice=n,this.structure=i}apply(e){return this.structure&&M0(e,this.from,this.to)?fr.fail("Structure replace would overwrite content"):fr.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Un([this.from,this.to-this.from,this.slice.size])}invert(e){return new kr(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return r.deletedAcross&&n.deletedAcross?null:new kr(r.pos,Math.max(r.pos,n.pos),this.slice)}merge(e){if(!(e instanceof kr)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let r=this.slice.size+e.slice.size==0?qe.empty:new qe(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new kr(this.from,this.to+(e.to-e.from),r,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let r=this.slice.size+e.slice.size==0?qe.empty:new qe(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new kr(e.from,this.to,r,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new kr(r.from,r.to,qe.fromJSON(e,r.slice),!!r.structure)}}Qr.jsonID("replace",kr);class _r extends Qr{constructor(e,r,n,i,o,s,a=!1){super(),this.from=e,this.to=r,this.gapFrom=n,this.gapTo=i,this.slice=o,this.insert=s,this.structure=a}apply(e){if(this.structure&&(M0(e,this.from,this.gapFrom)||M0(e,this.gapTo,this.to)))return fr.fail("Structure gap-replace would overwrite content");let r=e.slice(this.gapFrom,this.gapTo);if(r.openStart||r.openEnd)return fr.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,r.content);return n?fr.fromReplace(e,this.from,this.to,n):fr.fail("Content does not fit in gap")}getMap(){return new Un([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let r=this.gapTo-this.gapFrom;return new _r(this.from,this.from+this.slice.size+r,this.from+this.insert,this.from+this.insert+r,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),i=this.from==this.gapFrom?r.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return r.deletedAcross&&n.deletedAcross||i<r.pos||o>n.pos?null:new _r(r.pos,n.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,r){if(typeof r.from!="number"||typeof r.to!="number"||typeof r.gapFrom!="number"||typeof r.gapTo!="number"||typeof r.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new _r(r.from,r.to,r.gapFrom,r.gapTo,qe.fromJSON(e,r.slice),r.insert,!!r.structure)}}Qr.jsonID("replaceAround",_r);function M0(t,e,r){let n=t.resolve(e),i=r-e,o=n.depth;for(;i>0&&o>0&&n.indexAfter(o)==n.node(o).childCount;)o--,i--;if(i>0){let s=n.node(o).maybeChild(n.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function tP(t,e,r,n){let i=[],o=[],s,a;t.doc.nodesBetween(e,r,(l,c,d)=>{if(!l.isInline)return;let f=l.marks;if(!n.isInSet(f)&&d.type.allowsMarkType(n.type)){let p=Math.max(c,e),m=Math.min(c+l.nodeSize,r),g=n.addToSet(f);for(let b=0;b<f.length;b++)f[b].isInSet(g)||(s&&s.to==p&&s.mark.eq(f[b])?s.to=m:i.push(s=new po(p,m,f[b])));a&&a.to==p?a.to=m:o.push(a=new da(p,m,n))}}),i.forEach(l=>t.step(l)),o.forEach(l=>t.step(l))}function rP(t,e,r,n){let i=[],o=0;t.doc.nodesBetween(e,r,(s,a)=>{if(!s.isInline)return;o++;let l=null;if(n instanceof wy){let c=s.marks,d;for(;d=n.isInSet(c);)(l||(l=[])).push(d),c=d.removeFromSet(c)}else n?n.isInSet(s.marks)&&(l=[n]):l=s.marks;if(l&&l.length){let c=Math.min(a+s.nodeSize,r);for(let d=0;d<l.length;d++){let f=l[d],p;for(let m=0;m<i.length;m++){let g=i[m];g.step==o-1&&f.eq(i[m].style)&&(p=g)}p?(p.to=c,p.step=o):i.push({style:f,from:Math.max(a,e),to:c,step:o})}}}),i.forEach(s=>t.step(new po(s.from,s.to,s.style)))}function x1(t,e,r,n=r.contentMatch,i=!0){let o=t.doc.nodeAt(e),s=[],a=e+1;for(let l=0;l<o.childCount;l++){let c=o.child(l),d=a+c.nodeSize,f=n.matchType(c.type);if(!f)s.push(new kr(a,d,qe.empty));else{n=f;for(let p=0;p<c.marks.length;p++)r.allowsMarkType(c.marks[p].type)||t.step(new po(a,d,c.marks[p]));if(i&&c.isText&&r.whitespace!="pre"){let p,m=/\r?\n|\r/g,g;for(;p=m.exec(c.text);)g||(g=new qe(Le.from(r.schema.text(" ",r.allowedMarks(c.marks))),0,0)),s.push(new kr(a+p.index,a+p.index+p[0].length,g))}}a=d}if(!n.validEnd){let l=n.fillBefore(Le.empty,!0);t.replace(a,a,new qe(l,0,0))}for(let l=s.length-1;l>=0;l--)t.step(s[l])}function nP(t,e,r){return(e==0||t.canReplace(e,t.childCount))&&(r==t.childCount||t.canReplace(0,r))}function yd(t){let r=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth;;--n){let i=t.$from.node(n),o=t.$from.index(n),s=t.$to.indexAfter(n);if(n<t.depth&&i.canReplace(o,s,r))return n;if(n==0||i.type.spec.isolating||!nP(i,o,s))break}return null}function iP(t,e,r){let{$from:n,$to:i,depth:o}=e,s=n.before(o+1),a=i.after(o+1),l=s,c=a,d=Le.empty,f=0;for(let g=o,b=!1;g>r;g--)b||n.index(g)>0?(b=!0,d=Le.from(n.node(g).copy(d)),f++):l--;let p=Le.empty,m=0;for(let g=o,b=!1;g>r;g--)b||i.after(g+1)<i.end(g)?(b=!0,p=Le.from(i.node(g).copy(p)),m++):c++;t.step(new _r(l,c,s,a,new qe(d.append(p),f,m),d.size-f,!0))}function S1(t,e,r=null,n=t){let i=oP(t,e),o=i&&sP(n,e);return o?i.map(Ak).concat({type:e,attrs:r}).concat(o.map(Ak)):null}function Ak(t){return{type:t,attrs:null}}function oP(t,e){let{parent:r,startIndex:n,endIndex:i}=t,o=r.contentMatchAt(n).findWrapping(e);if(!o)return null;let s=o.length?o[0]:e;return r.canReplaceWith(n,i,s)?o:null}function sP(t,e){let{parent:r,startIndex:n,endIndex:i}=t,o=r.child(n),s=e.contentMatch.findWrapping(o.type);if(!s)return null;let l=(s.length?s[s.length-1]:e).contentMatch;for(let c=n;l&&c<i;c++)l=l.matchType(r.child(c).type);return!l||!l.validEnd?null:s}function aP(t,e,r){let n=Le.empty;for(let s=r.length-1;s>=0;s--){if(n.size){let a=r[s].type.contentMatch.matchFragment(n);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}n=Le.from(r[s].type.create(r[s].attrs,n))}let i=e.start,o=e.end;t.step(new _r(i,o,i,o,new qe(n,0,0),r.length,!0))}function lP(t,e,r,n,i){if(!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=t.steps.length;t.doc.nodesBetween(e,r,(s,a)=>{let l=typeof i=="function"?i(s):i;if(s.isTextblock&&!s.hasMarkup(n,l)&&cP(t.doc,t.mapping.slice(o).map(a),n)){let c=null;if(n.schema.linebreakReplacement){let m=n.whitespace=="pre",g=!!n.contentMatch.matchType(n.schema.linebreakReplacement);m&&!g?c=!1:!m&&g&&(c=!0)}c===!1&&$R(t,s,a,o),x1(t,t.mapping.slice(o).map(a,1),n,void 0,c===null);let d=t.mapping.slice(o),f=d.map(a,1),p=d.map(a+s.nodeSize,1);return t.step(new _r(f,p,f+1,p-1,new qe(Le.from(n.create(l,null,s.marks)),0,0),1,!0)),c===!0&&HR(t,s,a,o),!1}})}function HR(t,e,r,n){e.forEach((i,o)=>{if(i.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(i.text);){let l=t.mapping.slice(n).map(r+1+o+s.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function $R(t,e,r,n){e.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let s=t.mapping.slice(n).map(r+1+o);t.replaceWith(s,s+1,e.type.schema.text(`
|
|
5
|
+
`))}})}function cP(t,e,r){let n=t.resolve(e),i=n.index();return n.parent.canReplaceWith(i,i+1,r)}function uP(t,e,r,n,i){let o=t.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");r||(r=o.type);let s=r.create(n,null,i||o.marks);if(o.isLeaf)return t.replaceWith(e,e+o.nodeSize,s);if(!r.validContent(o.content))throw new RangeError("Invalid content for node type "+r.name);t.step(new _r(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new qe(Le.from(s),0,0),1,!0))}function Pu(t,e,r=1,n){let i=t.resolve(e),o=i.depth-r,s=n&&n[n.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,d=r-2;c>o;c--,d--){let f=i.node(c),p=i.index(c);if(f.type.spec.isolating)return!1;let m=f.content.cutByIndex(p,f.childCount),g=n&&n[d+1];g&&(m=m.replaceChild(0,g.type.create(g.attrs)));let b=n&&n[d]||f;if(!f.canReplace(p+1,f.childCount)||!b.type.validContent(m))return!1}let a=i.indexAfter(o),l=n&&n[0];return i.node(o).canReplaceWith(a,a,l?l.type:i.node(o+1).type)}function dP(t,e,r=1,n){let i=t.doc.resolve(e),o=Le.empty,s=Le.empty;for(let a=i.depth,l=i.depth-r,c=r-1;a>l;a--,c--){o=Le.from(i.node(a).copy(o));let d=n&&n[c];s=Le.from(d?d.type.create(d.attrs,s):i.node(a).copy(s))}t.step(new kr(e,e,new qe(o.append(s),r,r),!0))}function Ea(t,e){let r=t.resolve(e),n=r.index();return UR(r.nodeBefore,r.nodeAfter)&&r.parent.canReplace(n,n+1)}function fP(t,e){e.content.size||t.type.compatibleContent(e.type);let r=t.contentMatchAt(t.childCount),{linebreakReplacement:n}=t.type.schema;for(let i=0;i<e.childCount;i++){let o=e.child(i),s=o.type==n?t.type.schema.nodes.text:o.type;if(r=r.matchType(s),!r||!t.type.allowsMarks(o.marks))return!1}return r.validEnd}function UR(t,e){return!!(t&&e&&!t.isLeaf&&fP(t,e))}function xy(t,e,r=-1){let n=t.resolve(e);for(let i=n.depth;;i--){let o,s,a=n.index(i);if(i==n.depth?(o=n.nodeBefore,s=n.nodeAfter):r>0?(o=n.node(i+1),a++,s=n.node(i).maybeChild(a)):(o=n.node(i).maybeChild(a-1),s=n.node(i+1)),o&&!o.isTextblock&&UR(o,s)&&n.node(i).canReplace(a,a+1))return e;if(i==0)break;e=r<0?n.before(i):n.after(i)}}function hP(t,e,r){let n=null,{linebreakReplacement:i}=t.doc.type.schema,o=t.doc.resolve(e-r),s=o.node().type;if(i&&s.inlineContent){let d=s.whitespace=="pre",f=!!s.contentMatch.matchType(i);d&&!f?n=!1:!d&&f&&(n=!0)}let a=t.steps.length;if(n===!1){let d=t.doc.resolve(e+r);$R(t,d.node(),d.before(),a)}s.inlineContent&&x1(t,e+r-1,s,o.node().contentMatchAt(o.index()),n==null);let l=t.mapping.slice(a),c=l.map(e-r);if(t.step(new kr(c,l.map(e+r,-1),qe.empty,!0)),n===!0){let d=t.doc.resolve(c);HR(t,d.node(),d.before(),t.steps.length)}return t}function pP(t,e,r){let n=t.resolve(e);if(n.parent.canReplaceWith(n.index(),n.index(),r))return e;if(n.parentOffset==0)for(let i=n.depth-1;i>=0;i--){let o=n.index(i);if(n.node(i).canReplaceWith(o,o,r))return n.before(i+1);if(o>0)return null}if(n.parentOffset==n.parent.content.size)for(let i=n.depth-1;i>=0;i--){let o=n.indexAfter(i);if(n.node(i).canReplaceWith(o,o,r))return n.after(i+1);if(o<n.node(i).childCount)return null}return null}function WR(t,e,r){let n=t.resolve(e);if(!r.content.size)return e;let i=r.content;for(let o=0;o<r.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(r.openStart==0&&r.size?2:1);o++)for(let s=n.depth;s>=0;s--){let a=s==n.depth?0:n.pos<=(n.start(s+1)+n.end(s+1))/2?-1:1,l=n.index(s)+(a>0?1:0),c=n.node(s),d=!1;if(o==1)d=c.canReplace(l,l,i);else{let f=c.contentMatchAt(l).findWrapping(i.firstChild.type);d=f&&c.canReplaceWith(l,l,f[0])}if(d)return a==0?n.pos:a<0?n.before(s+1):n.after(s+1)}return null}function Sy(t,e,r=e,n=qe.empty){if(e==r&&!n.size)return null;let i=t.resolve(e),o=t.resolve(r);return VR(i,o,n)?new kr(e,r,n):new mP(i,o,n).fit()}function VR(t,e,r){return!r.openStart&&!r.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),r.content)}class mP{constructor(e,r,n){this.$from=e,this.$to=r,this.unplaced=n,this.frontier=[],this.placed=Le.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=Le.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),r=this.placed.size-this.depth-this.$from.depth,n=this.$from,i=this.close(e<0?this.$to:n.doc.resolve(e));if(!i)return null;let o=this.placed,s=n.depth,a=i.depth;for(;s&&a&&o.childCount==1;)o=o.firstChild.content,s--,a--;let l=new qe(o,s,a);return e>-1?new _r(n.pos,e,this.$to.pos,this.$to.end(),l,r):l.size||n.pos!=this.$to.pos?new kr(n.pos,i.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let r=this.unplaced.content,n=0,i=this.unplaced.openEnd;n<e;n++){let o=r.firstChild;if(r.childCount>1&&(i=0),o.type.spec.isolating&&i<=n){e=n;break}r=o.content}for(let r=1;r<=2;r++)for(let n=r==1?e:this.unplaced.openStart;n>=0;n--){let i,o=null;n?(o=hb(this.unplaced.content,n-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:c}=this.frontier[a],d,f=null;if(r==1&&(s?c.matchType(s.type)||(f=c.fillBefore(Le.from(s),!1)):o&&l.compatibleContent(o.type)))return{sliceDepth:n,frontierDepth:a,parent:o,inject:f};if(r==2&&s&&(d=c.findWrapping(s.type)))return{sliceDepth:n,frontierDepth:a,parent:o,wrap:d};if(o&&c.matchType(o.type))break}}}openMore(){let{content:e,openStart:r,openEnd:n}=this.unplaced,i=hb(e,r);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new qe(e,r+1,Math.max(n,i.size+r>=e.size-n?r+1:0)),!0)}dropNode(){let{content:e,openStart:r,openEnd:n}=this.unplaced,i=hb(e,r);if(i.childCount<=1&&r>0){let o=e.size-r<=r+i.size;this.unplaced=new qe(zf(e,r-1,1),r-1,o?r-1:n)}else this.unplaced=new qe(zf(e,r,1),r,n)}placeNodes({sliceDepth:e,frontierDepth:r,parent:n,inject:i,wrap:o}){for(;this.depth>r;)this.closeFrontierNode();if(o)for(let b=0;b<o.length;b++)this.openFrontierNode(o[b]);let s=this.unplaced,a=n?n.content:s.content,l=s.openStart-e,c=0,d=[],{match:f,type:p}=this.frontier[r];if(i){for(let b=0;b<i.childCount;b++)d.push(i.child(b));f=f.matchFragment(i)}let m=a.size+e-(s.content.size-s.openEnd);for(;c<a.childCount;){let b=a.child(c),S=f.matchType(b.type);if(!S)break;c++,(c>1||l==0||b.content.size)&&(f=S,d.push(GR(b.mark(p.allowedMarks(b.marks)),c==1?l:0,c==a.childCount?m:-1)))}let g=c==a.childCount;g||(m=-1),this.placed=Hf(this.placed,r,Le.from(d)),this.frontier[r].match=f,g&&m<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let b=0,S=a;b<m;b++){let w=S.lastChild;this.frontier.push({type:w.type,match:w.contentMatchAt(w.childCount)}),S=w.content}this.unplaced=g?e==0?qe.empty:new qe(zf(s.content,e-1,1),e-1,m<0?s.openEnd:e-1):new qe(zf(s.content,e,c),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],r;if(!e.type.isTextblock||!pb(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(r=this.findCloseLevel(this.$to))&&r.depth==this.depth)return-1;let{depth:n}=this.$to,i=this.$to.after(n);for(;n>1&&i==this.$to.end(--n);)++i;return i}findCloseLevel(e){e:for(let r=Math.min(this.depth,e.depth);r>=0;r--){let{match:n,type:i}=this.frontier[r],o=r<e.depth&&e.end(r+1)==e.pos+(e.depth-(r+1)),s=pb(e,r,i,n,o);if(s){for(let a=r-1;a>=0;a--){let{match:l,type:c}=this.frontier[a],d=pb(e,a,c,l,!0);if(!d||d.childCount)continue e}return{depth:r,fit:s,move:o?e.doc.resolve(e.after(r+1)):e}}}}close(e){let r=this.findCloseLevel(e);if(!r)return null;for(;this.depth>r.depth;)this.closeFrontierNode();r.fit.childCount&&(this.placed=Hf(this.placed,r.depth,r.fit)),e=r.move;for(let n=r.depth+1;n<=e.depth;n++){let i=e.node(n),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(n));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,r=null,n){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=Hf(this.placed,this.depth,Le.from(e.create(r,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let r=this.frontier.pop().match.fillBefore(Le.empty,!0);r.childCount&&(this.placed=Hf(this.placed,this.frontier.length,r))}}function zf(t,e,r){return e==0?t.cutByIndex(r,t.childCount):t.replaceChild(0,t.firstChild.copy(zf(t.firstChild.content,e-1,r)))}function Hf(t,e,r){return e==0?t.append(r):t.replaceChild(t.childCount-1,t.lastChild.copy(Hf(t.lastChild.content,e-1,r)))}function hb(t,e){for(let r=0;r<e;r++)t=t.firstChild.content;return t}function GR(t,e,r){if(e<=0)return t;let n=t.content;return e>1&&(n=n.replaceChild(0,GR(n.firstChild,e-1,n.childCount==1?r-1:0))),e>0&&(n=t.type.contentMatch.fillBefore(n).append(n),r<=0&&(n=n.append(t.type.contentMatch.matchFragment(n).fillBefore(Le.empty,!0)))),t.copy(n)}function pb(t,e,r,n,i){let o=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==o.childCount&&!r.compatibleContent(o.type))return null;let a=n.fillBefore(o.content,!0,s);return a&&!gP(r,o.content,s)?a:null}function gP(t,e,r){for(let n=r;n<e.childCount;n++)if(!t.allowsMarks(e.child(n).marks))return!0;return!1}function yP(t){return t.spec.defining||t.spec.definingForContent}function vP(t,e,r,n){if(!n.size)return t.deleteRange(e,r);let i=t.doc.resolve(e),o=t.doc.resolve(r);if(VR(i,o,n))return t.step(new kr(e,r,n));let s=qR(i,t.doc.resolve(r));s[s.length-1]==0&&s.pop();let a=-(i.depth+1);s.unshift(a);for(let p=i.depth,m=i.pos-1;p>0;p--,m--){let g=i.node(p).type.spec;if(g.defining||g.definingAsContext||g.isolating)break;s.indexOf(p)>-1?a=p:i.before(p)==m&&s.splice(1,0,-p)}let l=s.indexOf(a),c=[],d=n.openStart;for(let p=n.content,m=0;;m++){let g=p.firstChild;if(c.push(g),m==n.openStart)break;p=g.content}for(let p=d-1;p>=0;p--){let m=c[p],g=yP(m.type);if(g&&!m.sameMarkup(i.node(Math.abs(a)-1)))d=p;else if(g||!m.type.isTextblock)break}for(let p=n.openStart;p>=0;p--){let m=(p+d+1)%(n.openStart+1),g=c[m];if(g)for(let b=0;b<s.length;b++){let S=s[(b+l)%s.length],w=!0;S<0&&(w=!1,S=-S);let T=i.node(S-1),M=i.index(S-1);if(T.canReplaceWith(M,M,g.type,g.marks))return t.replace(i.before(S),w?o.after(S):r,new qe(KR(n.content,0,n.openStart,m),m,n.openEnd))}}let f=t.steps.length;for(let p=s.length-1;p>=0&&(t.replace(e,r,n),!(t.steps.length>f));p--){let m=s[p];m<0||(e=i.before(m),r=o.after(m))}}function KR(t,e,r,n,i){if(e<r){let o=t.firstChild;t=t.replaceChild(0,o.copy(KR(o.content,e+1,r,n,o)))}if(e>n){let o=i.contentMatchAt(0),s=o.fillBefore(t).append(t);t=s.append(o.matchFragment(s).fillBefore(Le.empty,!0))}return t}function bP(t,e,r,n){if(!n.isInline&&e==r&&t.doc.resolve(e).parent.content.size){let i=pP(t.doc,e,n.type);i!=null&&(e=r=i)}t.replaceRange(e,r,new qe(Le.from(n),0,0))}function wP(t,e,r){let n=t.doc.resolve(e),i=t.doc.resolve(r),o=qR(n,i);for(let s=0;s<o.length;s++){let a=o[s],l=s==o.length-1;if(l&&a==0||n.node(a).type.contentMatch.validEnd)return t.delete(n.start(a),i.end(a));if(a>0&&(l||n.node(a-1).canReplace(n.index(a-1),i.indexAfter(a-1))))return t.delete(n.before(a),i.after(a))}for(let s=1;s<=n.depth&&s<=i.depth;s++)if(e-n.start(s)==n.depth-s&&r>n.end(s)&&i.end(s)-r!=i.depth-s&&n.start(s-1)==i.start(s-1)&&n.node(s-1).canReplace(n.index(s-1),i.index(s-1)))return t.delete(n.before(s),r);t.delete(e,r)}function qR(t,e){let r=[],n=Math.min(t.depth,e.depth);for(let i=n;i>=0;i--){let o=t.start(i);if(o<t.pos-(t.depth-i)||e.end(i)>e.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&r.push(i)}return r}class Lu extends Qr{constructor(e,r,n){super(),this.pos=e,this.attr=r,this.value=n}apply(e){let r=e.nodeAt(this.pos);if(!r)return fr.fail("No node at attribute step's position");let n=Object.create(null);for(let o in r.attrs)n[o]=r.attrs[o];n[this.attr]=this.value;let i=r.type.create(n,null,r.marks);return fr.fromReplace(e,this.pos,this.pos+1,new qe(Le.from(i),0,r.isLeaf?0:1))}getMap(){return Un.empty}invert(e){return new Lu(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let r=e.mapResult(this.pos,1);return r.deletedAfter?null:new Lu(r.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,r){if(typeof r.pos!="number"||typeof r.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Lu(r.pos,r.attr,r.value)}}Qr.jsonID("attr",Lu);class hh extends Qr{constructor(e,r){super(),this.attr=e,this.value=r}apply(e){let r=Object.create(null);for(let i in e.attrs)r[i]=e.attrs[i];r[this.attr]=this.value;let n=e.type.create(r,e.content,e.marks);return fr.ok(n)}getMap(){return Un.empty}invert(e){return new hh(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,r){if(typeof r.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new hh(r.attr,r.value)}}Qr.jsonID("docAttr",hh);let qu=class extends Error{};qu=function t(e){let r=Error.call(this,e);return r.__proto__=t.prototype,r};qu.prototype=Object.create(Error.prototype);qu.prototype.constructor=qu;qu.prototype.name="TransformError";class k1{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Du}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let r=this.maybeStep(e);if(r.failed)throw new qu(r.failed);return this}maybeStep(e){let r=e.apply(this.doc);return r.failed||this.addStep(e,r.doc),r}get docChanged(){return this.steps.length>0}addStep(e,r){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=r}replace(e,r=e,n=qe.empty){let i=Sy(this.doc,e,r,n);return i&&this.step(i),this}replaceWith(e,r,n){return this.replace(e,r,new qe(Le.from(n),0,0))}delete(e,r){return this.replace(e,r,qe.empty)}insert(e,r){return this.replaceWith(e,e,r)}replaceRange(e,r,n){return vP(this,e,r,n),this}replaceRangeWith(e,r,n){return bP(this,e,r,n),this}deleteRange(e,r){return wP(this,e,r),this}lift(e,r){return iP(this,e,r),this}join(e,r=1){return hP(this,e,r),this}wrap(e,r){return aP(this,e,r),this}setBlockType(e,r=e,n,i=null){return lP(this,e,r,n,i),this}setNodeMarkup(e,r,n=null,i){return uP(this,e,r,n,i),this}setNodeAttribute(e,r,n){return this.step(new Lu(e,r,n)),this}setDocAttribute(e,r){return this.step(new hh(e,r)),this}addNodeMark(e,r){return this.step(new fa(e,r)),this}removeNodeMark(e,r){if(!(r instanceof $t)){let n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(r=r.isInSet(n.marks),!r)return this}return this.step(new Ku(e,r)),this}split(e,r=1,n){return dP(this,e,r,n),this}addMark(e,r,n){return tP(this,e,r,n),this}removeMark(e,r,n){return rP(this,e,r,n),this}clearIncompatible(e,r,n){return x1(this,e,r,n),this}}const mb=Object.create(null);let ot=class{constructor(e,r,n){this.$anchor=e,this.$head=r,this.ranges=n||[new _1(e.min(r),e.max(r))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let r=0;r<e.length;r++)if(e[r].$from.pos!=e[r].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,r=qe.empty){let n=r.content.lastChild,i=null;for(let a=0;a<r.openEnd;a++)i=n,n=n.lastChild;let o=e.steps.length,s=this.ranges;for(let a=0;a<s.length;a++){let{$from:l,$to:c}=s[a],d=e.mapping.slice(o);e.replaceRange(d.map(l.pos),d.map(c.pos),a?qe.empty:r),a==0&&Ok(e,o,(n?n.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,r){let n=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:s,$to:a}=i[o],l=e.mapping.slice(n),c=l.map(s.pos),d=l.map(a.pos);o?e.deleteRange(c,d):(e.replaceRangeWith(c,d,r),Ok(e,n,r.isInline?-1:1))}}static findFrom(e,r,n=!1){let i=e.parent.inlineContent?new et(e):_u(e.node(0),e.parent,e.pos,e.index(),r,n);if(i)return i;for(let o=e.depth-1;o>=0;o--){let s=r<0?_u(e.node(0),e.node(o),e.before(o+1),e.index(o),r,n):_u(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,r,n);if(s)return s}return null}static near(e,r=1){return this.findFrom(e,r)||this.findFrom(e,-r)||new Gn(e.node(0))}static atStart(e){return _u(e,e,0,0,1)||new Gn(e)}static atEnd(e){return _u(e,e,e.content.size,e.childCount,-1)||new Gn(e)}static fromJSON(e,r){if(!r||!r.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=mb[r.type];if(!n)throw new RangeError(`No selection type ${r.type} defined`);return n.fromJSON(e,r)}static jsonID(e,r){if(e in mb)throw new RangeError("Duplicate use of selection JSON ID "+e);return mb[e]=r,r.prototype.jsonID=e,r}getBookmark(){return et.between(this.$anchor,this.$head).getBookmark()}};ot.prototype.visible=!0;class _1{constructor(e,r){this.$from=e,this.$to=r}}let Rk=!1;function Ik(t){!Rk&&!t.parent.inlineContent&&(Rk=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class et extends ot{constructor(e,r=e){Ik(e),Ik(r),super(e,r)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,r){let n=e.resolve(r.map(this.head));if(!n.parent.inlineContent)return ot.near(n);let i=e.resolve(r.map(this.anchor));return new et(i.parent.inlineContent?i:n,n)}replace(e,r=qe.empty){if(super.replace(e,r),r==qe.empty){let n=this.$from.marksAcross(this.$to);n&&e.ensureMarks(n)}}eq(e){return e instanceof et&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new ky(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,r){if(typeof r.anchor!="number"||typeof r.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new et(e.resolve(r.anchor),e.resolve(r.head))}static create(e,r,n=r){let i=e.resolve(r);return new this(i,n==r?i:e.resolve(n))}static between(e,r,n){let i=e.pos-r.pos;if((!n||i)&&(n=i>=0?1:-1),!r.parent.inlineContent){let o=ot.findFrom(r,n,!0)||ot.findFrom(r,-n,!0);if(o)r=o.$head;else return ot.near(r,n)}return e.parent.inlineContent||(i==0?e=r:(e=(ot.findFrom(e,-n,!0)||ot.findFrom(e,n,!0)).$anchor,e.pos<r.pos!=i<0&&(e=r))),new et(e,r)}}ot.jsonID("text",et);class ky{constructor(e,r){this.anchor=e,this.head=r}map(e){return new ky(e.map(this.anchor),e.map(this.head))}resolve(e){return et.between(e.resolve(this.anchor),e.resolve(this.head))}}class rt extends ot{constructor(e){let r=e.nodeAfter,n=e.node(0).resolve(e.pos+r.nodeSize);super(e,n),this.node=r}map(e,r){let{deleted:n,pos:i}=r.mapResult(this.anchor),o=e.resolve(i);return n?ot.near(o):new rt(o)}content(){return new qe(Le.from(this.node),0,0)}eq(e){return e instanceof rt&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new C1(this.anchor)}static fromJSON(e,r){if(typeof r.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new rt(e.resolve(r.anchor))}static create(e,r){return new rt(e.resolve(r))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}rt.prototype.visible=!1;ot.jsonID("node",rt);class C1{constructor(e){this.anchor=e}map(e){let{deleted:r,pos:n}=e.mapResult(this.anchor);return r?new ky(n,n):new C1(n)}resolve(e){let r=e.resolve(this.anchor),n=r.nodeAfter;return n&&rt.isSelectable(n)?new rt(r):ot.near(r)}}class Gn extends ot{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,r=qe.empty){if(r==qe.empty){e.delete(0,e.doc.content.size);let n=ot.atStart(e.doc);n.eq(e.selection)||e.setSelection(n)}else super.replace(e,r)}toJSON(){return{type:"all"}}static fromJSON(e){return new Gn(e)}map(e){return new Gn(e)}eq(e){return e instanceof Gn}getBookmark(){return xP}}ot.jsonID("all",Gn);const xP={map(){return this},resolve(t){return new Gn(t)}};function _u(t,e,r,n,i,o=!1){if(e.inlineContent)return et.create(t,r);for(let s=n-(i>0?0:1);i>0?s<e.childCount:s>=0;s+=i){let a=e.child(s);if(a.isAtom){if(!o&&rt.isSelectable(a))return rt.create(t,r-(i<0?a.nodeSize:0))}else{let l=_u(t,a,r+i,i<0?a.childCount:0,i,o);if(l)return l}r+=a.nodeSize*i}return null}function Ok(t,e,r){let n=t.steps.length-1;if(n<e)return;let i=t.steps[n];if(!(i instanceof kr||i instanceof _r))return;let o=t.mapping.maps[n],s;o.forEach((a,l,c,d)=>{s==null&&(s=d)}),t.setSelection(ot.near(t.doc.resolve(s),r))}const Mk=1,Hp=2,Nk=4;let SP=class extends k1{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|Mk)&~Hp,this.storedMarks=null,this}get selectionSet(){return(this.updated&Mk)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Hp,this}ensureMarks(e){return $t.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Hp)>0}addStep(e,r){super.addStep(e,r),this.updated=this.updated&~Hp,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,r=!0){let n=this.selection;return r&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||$t.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,r,n){let i=this.doc.type.schema;if(r==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(n==null&&(n=r),n=n??r,!e)return this.deleteRange(r,n);let o=this.storedMarks;if(!o){let s=this.doc.resolve(r);o=n==r?s.marks():s.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(r,n,i.text(e,o)),this.selection.empty||this.setSelection(ot.near(this.selection.$to)),this}}setMeta(e,r){return this.meta[typeof e=="string"?e:e.key]=r,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=Nk,this}get scrolledIntoView(){return(this.updated&Nk)>0}};function Dk(t,e){return!e||!t?t:t.bind(e)}class $f{constructor(e,r,n){this.name=e,this.init=Dk(r.init,n),this.apply=Dk(r.apply,n)}}const kP=[new $f("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new $f("selection",{init(t,e){return t.selection||ot.atStart(e.doc)},apply(t){return t.selection}}),new $f("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,r,n){return n.selection.$cursor?t.storedMarks:null}}),new $f("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class gb{constructor(e,r){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=kP.slice(),r&&r.forEach(n=>{if(this.pluginsByKey[n.key])throw new RangeError("Adding different instances of a keyed plugin ("+n.key+")");this.plugins.push(n),this.pluginsByKey[n.key]=n,n.spec.state&&this.fields.push(new $f(n.key,n.spec.state,n))})}}class Ou{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,r=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=r){let i=this.config.plugins[n];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let r=[e],n=this.applyInner(e),i=null;for(;;){let o=!1;for(let s=0;s<this.config.plugins.length;s++){let a=this.config.plugins[s];if(a.spec.appendTransaction){let l=i?i[s].n:0,c=i?i[s].state:this,d=l<r.length&&a.spec.appendTransaction.call(a,l?r.slice(l):r,c,n);if(d&&n.filterTransaction(d,s)){if(d.setMeta("appendedTransaction",e),!i){i=[];for(let f=0;f<this.config.plugins.length;f++)i.push(f<s?{state:n,n:r.length}:{state:this,n:0})}r.push(d),n=n.applyInner(d),o=!0}i&&(i[s]={state:n,n:r.length})}}if(!o)return{state:n,transactions:r}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let r=new Ou(this.config),n=this.config.fields;for(let i=0;i<n.length;i++){let o=n[i];r[o.name]=o.apply(e,this[o.name],this,r)}return r}get tr(){return new SP(this)}static create(e){let r=new gb(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new Ou(r);for(let i=0;i<r.fields.length;i++)n[r.fields[i].name]=r.fields[i].init(e,n);return n}reconfigure(e){let r=new gb(this.schema,e.plugins),n=r.fields,i=new Ou(r);for(let o=0;o<n.length;o++){let s=n[o].name;i[s]=this.hasOwnProperty(s)?this[s]:n[o].init(e,i)}return i}toJSON(e){let r={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(r.storedMarks=this.storedMarks.map(n=>n.toJSON())),e&&typeof e=="object")for(let n in e){if(n=="doc"||n=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[n],o=i.spec.state;o&&o.toJSON&&(r[n]=o.toJSON.call(i,this[i.key]))}return r}static fromJSON(e,r,n){if(!r)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new gb(e.schema,e.plugins),o=new Ou(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=ls.fromJSON(e.schema,r.doc);else if(s.name=="selection")o.selection=ot.fromJSON(o.doc,r.selection);else if(s.name=="storedMarks")r.storedMarks&&(o.storedMarks=r.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let a in n){let l=n[a],c=l.spec.state;if(l.key==s.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(r,a)){o[s.name]=c.fromJSON.call(l,e,r[a],o);return}}o[s.name]=s.init(e,o)}}),o}}function XR(t,e,r){for(let n in t){let i=t[n];i instanceof Function?i=i.bind(e):n=="handleDOMEvents"&&(i=XR(i,e,{})),r[n]=i}return r}class _t{constructor(e){this.spec=e,this.props={},e.props&&XR(e.props,this,this.props),this.key=e.key?e.key.key:YR("plugin")}getState(e){return e[this.key]}}const yb=Object.create(null);function YR(t){return t in yb?t+"$"+ ++yb[t]:(yb[t]=0,t+"$")}class St{constructor(e="key"){this.key=YR(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Fr=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},ph=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let N0=null;const ts=function(t,e,r){let n=N0||(N0=document.createRange());return n.setEnd(t,r??t.nodeValue.length),n.setStart(t,e||0),n},_P=function(){N0=null},Vl=function(t,e,r,n){return r&&(Pk(t,e,r,n,-1)||Pk(t,e,r,n,1))},CP=/^(img|br|input|textarea|hr)$/i;function Pk(t,e,r,n,i){for(;;){if(t==r&&e==n)return!0;if(e==(i<0?0:pi(t))){let o=t.parentNode;if(!o||o.nodeType!=1||jh(t)||CP.test(t.nodeName)||t.contentEditable=="false")return!1;e=Fr(t)+(i<0?0:1),t=o}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.contentEditable=="false")return!1;e=i<0?pi(t):0}else return!1}}function pi(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function EP(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=pi(t)}else if(t.parentNode&&!jh(t))e=Fr(t),t=t.parentNode;else return null}}function TP(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!jh(t))e=Fr(t)+1,t=t.parentNode;else return null}}function AP(t,e,r){for(let n=e==0,i=e==pi(t);n||i;){if(t==r)return!0;let o=Fr(t);if(t=t.parentNode,!t)return!1;n=n&&o==0,i=i&&o==pi(t)}}function jh(t){let e;for(let r=t;r&&!(e=r.pmViewDesc);r=r.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const _y=function(t){return t.focusNode&&Vl(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Cl(t,e){let r=document.createEvent("Event");return r.initEvent("keydown",!0,!0),r.keyCode=t,r.key=r.code=e,r}function RP(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function IP(t,e,r){if(t.caretPositionFromPoint)try{let n=t.caretPositionFromPoint(e,r);if(n)return{node:n.offsetNode,offset:Math.min(pi(n.offsetNode),n.offset)}}catch{}if(t.caretRangeFromPoint){let n=t.caretRangeFromPoint(e,r);if(n)return{node:n.startContainer,offset:Math.min(pi(n.startContainer),n.startOffset)}}}const bo=typeof navigator<"u"?navigator:null,Lk=typeof document<"u"?document:null,Ta=bo&&bo.userAgent||"",D0=/Edge\/(\d+)/.exec(Ta),JR=/MSIE \d/.exec(Ta),P0=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ta),On=!!(JR||P0||D0),ga=JR?document.documentMode:P0?+P0[1]:D0?+D0[1]:0,zi=!On&&/gecko\/(\d+)/i.test(Ta);zi&&+(/Firefox\/(\d+)/.exec(Ta)||[0,0])[1];const L0=!On&&/Chrome\/(\d+)/.exec(Ta),Vr=!!L0,ZR=L0?+L0[1]:0,pn=!On&&!!bo&&/Apple Computer/.test(bo.vendor),Xu=pn&&(/Mobile\/\w+/.test(Ta)||!!bo&&bo.maxTouchPoints>2),hi=Xu||(bo?/Mac/.test(bo.platform):!1),OP=bo?/Win/.test(bo.platform):!1,rs=/Android \d/.test(Ta),Bh=!!Lk&&"webkitFontSmoothing"in Lk.documentElement.style,MP=Bh?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function NP(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function qo(t,e){return typeof t=="number"?t:t[e]}function DP(t){let e=t.getBoundingClientRect(),r=e.width/t.offsetWidth||1,n=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*r,top:e.top,bottom:e.top+t.clientHeight*n}}function Fk(t,e,r){let n=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,o=t.dom.ownerDocument;for(let s=r||t.dom;s;s=ph(s)){if(s.nodeType!=1)continue;let a=s,l=a==o.body,c=l?NP(o):DP(a),d=0,f=0;if(e.top<c.top+qo(n,"top")?f=-(c.top-e.top+qo(i,"top")):e.bottom>c.bottom-qo(n,"bottom")&&(f=e.bottom-e.top>c.bottom-c.top?e.top+qo(i,"top")-c.top:e.bottom-c.bottom+qo(i,"bottom")),e.left<c.left+qo(n,"left")?d=-(c.left-e.left+qo(i,"left")):e.right>c.right-qo(n,"right")&&(d=e.right-c.right+qo(i,"right")),d||f)if(l)o.defaultView.scrollBy(d,f);else{let p=a.scrollLeft,m=a.scrollTop;f&&(a.scrollTop+=f),d&&(a.scrollLeft+=d);let g=a.scrollLeft-p,b=a.scrollTop-m;e={left:e.left-g,top:e.top-b,right:e.right-g,bottom:e.bottom-b}}if(l||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function PP(t){let e=t.dom.getBoundingClientRect(),r=Math.max(0,e.top),n,i;for(let o=(e.left+e.right)/2,s=r+1;s<Math.min(innerHeight,e.bottom);s+=5){let a=t.root.elementFromPoint(o,s);if(!a||a==t.dom||!t.dom.contains(a))continue;let l=a.getBoundingClientRect();if(l.top>=r-20){n=a,i=l.top;break}}return{refDOM:n,refTop:i,stack:QR(t.dom)}}function QR(t){let e=[],r=t.ownerDocument;for(let n=t;n&&(e.push({dom:n,top:n.scrollTop,left:n.scrollLeft}),t!=r);n=ph(n));return e}function LP({refDOM:t,refTop:e,stack:r}){let n=t?t.getBoundingClientRect().top:0;eI(r,n==0?0:n-e)}function eI(t,e){for(let r=0;r<t.length;r++){let{dom:n,top:i,left:o}=t[r];n.scrollTop!=i+e&&(n.scrollTop=i+e),n.scrollLeft!=o&&(n.scrollLeft=o)}}let pu=null;function FP(t){if(t.setActive)return t.setActive();if(pu)return t.focus(pu);let e=QR(t);t.focus(pu==null?{get preventScroll(){return pu={preventScroll:!0},!0}}:void 0),pu||(pu=!1,eI(e,0))}function tI(t,e){let r,n=2e8,i,o=0,s=e.top,a=e.top,l,c;for(let d=t.firstChild,f=0;d;d=d.nextSibling,f++){let p;if(d.nodeType==1)p=d.getClientRects();else if(d.nodeType==3)p=ts(d).getClientRects();else continue;for(let m=0;m<p.length;m++){let g=p[m];if(g.top<=s&&g.bottom>=a){s=Math.max(g.bottom,s),a=Math.min(g.top,a);let b=g.left>e.left?g.left-e.left:g.right<e.left?e.left-g.right:0;if(b<n){r=d,n=b,i=b&&r.nodeType==3?{left:g.right<e.left?g.right:g.left,top:e.top}:e,d.nodeType==1&&b&&(o=f+(e.left>=(g.left+g.right)/2?1:0));continue}}else g.top>e.top&&!l&&g.left<=e.left&&g.right>=e.left&&(l=d,c={left:Math.max(g.left,Math.min(g.right,e.left)),top:g.top});!r&&(e.left>=g.right&&e.top>=g.top||e.left>=g.left&&e.top>=g.bottom)&&(o=f+1)}}return!r&&l&&(r=l,i=c,n=0),r&&r.nodeType==3?jP(r,i):!r||n&&r.nodeType==1?{node:t,offset:o}:tI(r,i)}function jP(t,e){let r=t.nodeValue.length,n=document.createRange();for(let i=0;i<r;i++){n.setEnd(t,i+1),n.setStart(t,i);let o=ta(n,1);if(o.top!=o.bottom&&E1(e,o))return{node:t,offset:i+(e.left>=(o.left+o.right)/2?1:0)}}return{node:t,offset:0}}function E1(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function BP(t,e){let r=t.parentNode;return r&&/^li$/i.test(r.nodeName)&&e.left<t.getBoundingClientRect().left?r:t}function zP(t,e,r){let{node:n,offset:i}=tI(e,r),o=-1;if(n.nodeType==1&&!n.firstChild){let s=n.getBoundingClientRect();o=s.left!=s.right&&r.left>(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(n,i,o)}function HP(t,e,r,n){let i=-1;for(let o=e,s=!1;o!=t.dom;){let a=t.docView.nearestDesc(o,!0),l;if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((l=a.dom.getBoundingClientRect()).width||l.height)&&(a.node.isBlock&&a.parent&&(!s&&l.left>n.left||l.top>n.top?i=a.posBefore:(!s&&l.right<n.left||l.bottom<n.top)&&(i=a.posAfter),s=!0),!a.contentDOM&&i<0&&!a.node.isText))return(a.node.isBlock?n.top<(l.top+l.bottom)/2:n.left<(l.left+l.right)/2)?a.posBefore:a.posAfter;o=a.dom.parentNode}return i>-1?i:t.docView.posFromDOM(e,r,-1)}function rI(t,e,r){let n=t.childNodes.length;if(n&&r.top<r.bottom)for(let i=Math.max(0,Math.min(n-1,Math.floor(n*(e.top-r.top)/(r.bottom-r.top))-2)),o=i;;){let s=t.childNodes[o];if(s.nodeType==1){let a=s.getClientRects();for(let l=0;l<a.length;l++){let c=a[l];if(E1(e,c))return rI(s,e,c)}}if((o=(o+1)%n)==i)break}return t}function $P(t,e){let r=t.dom.ownerDocument,n,i=0,o=IP(r,e.left,e.top);o&&({node:n,offset:i}=o);let s=(t.root.elementFromPoint?t.root:r).elementFromPoint(e.left,e.top),a;if(!s||!t.dom.contains(s.nodeType!=1?s.parentNode:s)){let c=t.dom.getBoundingClientRect();if(!E1(e,c)||(s=rI(t.dom,e,c),!s))return null}if(pn)for(let c=s;n&&c;c=ph(c))c.draggable&&(n=void 0);if(s=BP(s,e),n){if(zi&&n.nodeType==1&&(i=Math.min(i,n.childNodes.length),i<n.childNodes.length)){let d=n.childNodes[i],f;d.nodeName=="IMG"&&(f=d.getBoundingClientRect()).right<=e.left&&f.bottom>e.top&&i++}let c;Bh&&i&&n.nodeType==1&&(c=n.childNodes[i-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&i--,n==t.dom&&i==n.childNodes.length-1&&n.lastChild.nodeType==1&&e.top>n.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(i==0||n.nodeType!=1||n.childNodes[i-1].nodeName!="BR")&&(a=HP(t,n,i,e))}a==null&&(a=zP(t,s,e));let l=t.docView.nearestDesc(s,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function jk(t){return t.top<t.bottom||t.left<t.right}function ta(t,e){let r=t.getClientRects();if(r.length){let n=r[e<0?0:r.length-1];if(jk(n))return n}return Array.prototype.find.call(r,jk)||t.getBoundingClientRect()}const UP=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function nI(t,e,r){let{node:n,offset:i,atom:o}=t.docView.domFromPos(e,r<0?-1:1),s=Bh||zi;if(n.nodeType==3)if(s&&(UP.test(n.nodeValue)||(r<0?!i:i==n.nodeValue.length))){let l=ta(ts(n,i,i),r);if(zi&&i&&/\s/.test(n.nodeValue[i-1])&&i<n.nodeValue.length){let c=ta(ts(n,i-1,i-1),-1);if(c.top==l.top){let d=ta(ts(n,i,i+1),-1);if(d.top!=l.top)return Cf(d,d.left<c.left)}}return l}else{let l=i,c=i,d=r<0?1:-1;return r<0&&!i?(c++,d=-1):r>=0&&i==n.nodeValue.length?(l--,d=1):r<0?l--:c++,Cf(ta(ts(n,l,c),d),d<0)}if(!t.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(r<0||i==pi(n))){let l=n.childNodes[i-1];if(l.nodeType==1)return vb(l.getBoundingClientRect(),!1)}if(o==null&&i<pi(n)){let l=n.childNodes[i];if(l.nodeType==1)return vb(l.getBoundingClientRect(),!0)}return vb(n.getBoundingClientRect(),r>=0)}if(o==null&&i&&(r<0||i==pi(n))){let l=n.childNodes[i-1],c=l.nodeType==3?ts(l,pi(l)-(s?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return Cf(ta(c,1),!1)}if(o==null&&i<pi(n)){let l=n.childNodes[i];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let c=l?l.nodeType==3?ts(l,0,s?0:1):l.nodeType==1?l:null:null;if(c)return Cf(ta(c,-1),!0)}return Cf(ta(n.nodeType==3?ts(n):n,-r),r>=0)}function Cf(t,e){if(t.width==0)return t;let r=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:r,right:r}}function vb(t,e){if(t.height==0)return t;let r=e?t.top:t.bottom;return{top:r,bottom:r,left:t.left,right:t.right}}function iI(t,e,r){let n=t.state,i=t.root.activeElement;n!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return r()}finally{n!=e&&t.updateState(n),i!=t.dom&&i&&i.focus()}}function WP(t,e,r){let n=e.selection,i=r=="up"?n.$from:n.$to;return iI(t,e,()=>{let{node:o}=t.docView.domFromPos(i.pos,r=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(o,!0);if(!a)break;if(a.node.isBlock){o=a.contentDOM||a.dom;break}o=a.dom.parentNode}let s=nI(t,i.pos,1);for(let a=o.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=ts(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;c<l.length;c++){let d=l[c];if(d.bottom>d.top+1&&(r=="up"?s.top-d.top>(d.bottom-s.top)*2:d.bottom-s.bottom>(s.bottom-d.top)*2))return!1}}return!0})}const VP=/[\u0590-\u08ac]/;function GP(t,e,r){let{$head:n}=e.selection;if(!n.parent.isTextblock)return!1;let i=n.parentOffset,o=!i,s=i==n.parent.content.size,a=t.domSelection();return a?!VP.test(n.parent.textContent)||!a.modify?r=="left"||r=="backward"?o:s:iI(t,e,()=>{let{focusNode:l,focusOffset:c,anchorNode:d,anchorOffset:f}=t.domSelectionRange(),p=a.caretBidiLevel;a.modify("move",r,"character");let m=n.depth?t.docView.domAfterPos(n.before()):t.dom,{focusNode:g,focusOffset:b}=t.domSelectionRange(),S=g&&!m.contains(g.nodeType==1?g:g.parentNode)||l==g&&c==b;try{a.collapse(d,f),l&&(l!=d||c!=f)&&a.extend&&a.extend(l,c)}catch{}return p!=null&&(a.caretBidiLevel=p),S}):n.pos==n.start()||n.pos==n.end()}let Bk=null,zk=null,Hk=!1;function KP(t,e,r){return Bk==e&&zk==r?Hk:(Bk=e,zk=r,Hk=r=="up"||r=="down"?WP(t,e,r):GP(t,e,r))}const mi=0,$k=1,Rl=2,wo=3;class zh{constructor(e,r,n,i){this.parent=e,this.children=r,this.dom=n,this.contentDOM=i,this.dirty=mi,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,r,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let r=0;r<this.children.length;r++)e+=this.children[r].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let r=0,n=this.posAtStart;;r++){let i=this.children[r];if(i==e)return n;n+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,r,n){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(n<0){let o,s;if(e==this.contentDOM)o=e.childNodes[r-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.previousSibling}for(;o&&!((s=o.pmViewDesc)&&s.parent==this);)o=o.previousSibling;return o?this.posBeforeChild(s)+s.size:this.posAtStart}else{let o,s;if(e==this.contentDOM)o=e.childNodes[r];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.nextSibling}for(;o&&!((s=o.pmViewDesc)&&s.parent==this);)o=o.nextSibling;return o?this.posBeforeChild(s):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=r>Fr(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(r==0)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&r==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??n>0?this.posAtEnd:this.posAtStart}nearestDesc(e,r=!1){for(let n=!0,i=e;i;i=i.parentNode){let o=this.getDesc(i),s;if(o&&(!r||o.node))if(n&&(s=o.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))n=!1;else return o}}getDesc(e){let r=e.pmViewDesc;for(let n=r;n;n=n.parent)if(n==this)return r}posFromDOM(e,r,n){for(let i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,r,n)}return-1}descAt(e){for(let r=0,n=0;r<this.children.length;r++){let i=this.children[r],o=n+i.size;if(n==e&&o!=n){for(;!i.border&&i.children.length;)i=i.children[0];return i}if(e<o)return i.descAt(e-n-i.border);n=o}}domFromPos(e,r){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,i=0;for(let o=0;n<this.children.length;n++){let s=this.children[n],a=o+s.size;if(a>e||s instanceof sI){i=e-o;break}o=a}if(i)return this.children[n].domFromPos(i-this.children[n].border,r);for(let o;n&&!(o=this.children[n-1]).size&&o instanceof oI&&o.side>=0;n--);if(r<=0){let o,s=!0;for(;o=n?this.children[n-1]:null,!(!o||o.dom.parentNode==this.contentDOM);n--,s=!1);return o&&r&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,r):{node:this.contentDOM,offset:o?Fr(o.dom)+1:0}}else{let o,s=!0;for(;o=n<this.children.length?this.children[n]:null,!(!o||o.dom.parentNode==this.contentDOM);n++,s=!1);return o&&s&&!o.border&&!o.domAtom?o.domFromPos(0,r):{node:this.contentDOM,offset:o?Fr(o.dom):this.contentDOM.childNodes.length}}}parseRange(e,r,n=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:r,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,o=-1;for(let s=n,a=0;;a++){let l=this.children[a],c=s+l.size;if(i==-1&&e<=c){let d=s+l.border;if(e>=d&&r<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,r,d);e=s;for(let f=a;f>0;f--){let p=this.children[f-1];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(1)){i=Fr(p.dom)+1;break}e-=p.size}i==-1&&(i=0)}if(i>-1&&(c>r||a==this.children.length-1)){r=c;for(let d=a+1;d<this.children.length;d++){let f=this.children[d];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){o=Fr(f.dom);break}r+=f.size}o==-1&&(o=this.contentDOM.childNodes.length);break}s=c}return{node:this.contentDOM,from:e,to:r,fromOffset:i,toOffset:o}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let r=this.children[e<0?0:this.children.length-1];return r.size==0||r.emptyChildAt(e)}domAfterPos(e){let{node:r,offset:n}=this.domFromPos(e,0);if(r.nodeType!=1||n==r.childNodes.length)throw new RangeError("No node after pos "+e);return r.childNodes[n]}setSelection(e,r,n,i=!1){let o=Math.min(e,r),s=Math.max(e,r);for(let m=0,g=0;m<this.children.length;m++){let b=this.children[m],S=g+b.size;if(o>g&&s<S)return b.setSelection(e-g-b.border,r-g-b.border,n,i);g=S}let a=this.domFromPos(e,e?-1:1),l=r==e?a:this.domFromPos(r,r?-1:1),c=n.root.getSelection(),d=n.domSelectionRange(),f=!1;if((zi||pn)&&e==r){let{node:m,offset:g}=a;if(m.nodeType==3){if(f=!!(g&&m.nodeValue[g-1]==`
|
|
6
|
+
`),f&&g==m.nodeValue.length)for(let b=m,S;b;b=b.parentNode){if(S=b.nextSibling){S.nodeName=="BR"&&(a=l={node:S.parentNode,offset:Fr(S)+1});break}let w=b.pmViewDesc;if(w&&w.node&&w.node.isBlock)break}}else{let b=m.childNodes[g-1];f=b&&(b.nodeName=="BR"||b.contentEditable=="false")}}if(zi&&d.focusNode&&d.focusNode!=l.node&&d.focusNode.nodeType==1){let m=d.focusNode.childNodes[d.focusOffset];m&&m.contentEditable=="false"&&(i=!0)}if(!(i||f&&pn)&&Vl(a.node,a.offset,d.anchorNode,d.anchorOffset)&&Vl(l.node,l.offset,d.focusNode,d.focusOffset))return;let p=!1;if((c.extend||e==r)&&!f){c.collapse(a.node,a.offset);try{e!=r&&c.extend(l.node,l.offset),p=!0}catch{}}if(!p){if(e>r){let g=a;a=l,l=g}let m=document.createRange();m.setEnd(l.node,l.offset),m.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(m)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,r){for(let n=0,i=0;i<this.children.length;i++){let o=this.children[i],s=n+o.size;if(n==s?e<=s&&r>=n:e<s&&r>n){let a=n+o.border,l=s-o.border;if(e>=a&&r<=l){this.dirty=e==n||r==s?Rl:$k,e==a&&r==l&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=wo:o.markDirty(e-a,r-a);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?Rl:wo}n=s}this.dirty=Rl}markParentsDirty(){let e=1;for(let r=this.parent;r;r=r.parent,e++){let n=e==1?Rl:$k;r.dirty<n&&(r.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(e){return!1}}class oI extends zh{constructor(e,r,n,i){let o,s=r.type.toDOM;if(typeof s=="function"&&(s=s(n,()=>{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!r.type.spec.raw){if(s.nodeType!=1){let a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=r,this.widget=r,o=this}matchesWidget(e){return this.dirty==mi&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let r=this.widget.spec.stopEvent;return r?r(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class qP extends zh{constructor(e,r,n,i){super(e,[],r,null),this.textDOM=n,this.text=i}get size(){return this.text.length}localPosFromDOM(e,r){return e!=this.textDOM?this.posAtStart+(r?this.size:0):this.posAtStart+r}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class Gl extends zh{constructor(e,r,n,i,o){super(e,[],n,i),this.mark=r,this.spec=o}static create(e,r,n,i){let o=i.nodeViews[r.type.name],s=o&&o(r,i,n);return(!s||!s.dom)&&(s=nc.renderSpec(document,r.type.spec.toDOM(r,n),null,r.attrs)),new Gl(e,r,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&wo||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=wo&&this.mark.eq(e)}markDirty(e,r){if(super.markDirty(e,r),this.dirty!=mi){let n=this.parent;for(;!n.node;)n=n.parent;n.dirty<this.dirty&&(n.dirty=this.dirty),this.dirty=mi}}slice(e,r,n){let i=Gl.create(this.parent,this.mark,!0,n),o=this.children,s=this.size;r<s&&(o=j0(o,r,s,n)),e>0&&(o=j0(o,0,e,n));for(let a=0;a<o.length;a++)o[a].parent=i;return i.children=o,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class ya extends zh{constructor(e,r,n,i,o,s,a,l,c){super(e,[],o,s),this.node=r,this.outerDeco=n,this.innerDeco=i,this.nodeDOM=a}static create(e,r,n,i,o,s){let a=o.nodeViews[r.type.name],l,c=a&&a(r,o,()=>{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},n,i),d=c&&c.dom,f=c&&c.contentDOM;if(r.isText){if(!d)d=document.createTextNode(r.text);else if(d.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else d||({dom:d,contentDOM:f}=nc.renderSpec(document,r.type.spec.toDOM(r),null,r.attrs));!f&&!r.isText&&d.nodeName!="BR"&&(d.hasAttribute("contenteditable")||(d.contentEditable="false"),r.type.spec.draggable&&(d.draggable=!0));let p=d;return d=cI(d,n,r),c?l=new XP(e,r,n,i,d,f||null,p,c,o,s+1):r.isText?new Cy(e,r,n,i,d,p,o):new ya(e,r,n,i,d,f||null,p,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let r=this.children.length-1;r>=0;r--){let n=this.children[r];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>Le.empty)}return e}matchesNode(e,r,n){return this.dirty==mi&&e.eq(this.node)&&ng(r,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,r){let n=this.node.inlineContent,i=r,o=e.composing?this.localCompositionInfo(e,r):null,s=o&&o.pos>-1?o:null,a=o&&o.pos<0,l=new JP(this,s&&s.node,e);eL(this.node,this.innerDeco,(c,d,f)=>{c.spec.marks?l.syncToMarks(c.spec.marks,n,e):c.type.side>=0&&!f&&l.syncToMarks(d==this.node.childCount?$t.none:this.node.child(d).marks,n,e),l.placeWidget(c,e,i)},(c,d,f,p)=>{l.syncToMarks(c.marks,n,e);let m;l.findNodeMatch(c,d,f,p)||a&&e.state.selection.from>i&&e.state.selection.to<i+c.nodeSize&&(m=l.findIndexWithChild(o.node))>-1&&l.updateNodeAt(c,d,f,m,e)||l.updateNextNode(c,d,f,e,p,i)||l.addNode(c,d,f,e,i),i+=c.nodeSize}),l.syncToMarks([],n,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==Rl)&&(s&&this.protectLocalComposition(e,s),aI(this.contentDOM,this.children,e),Xu&&tL(this.dom))}localCompositionInfo(e,r){let{from:n,to:i}=e.state.selection;if(!(e.state.selection instanceof et)||n<r||i>r+this.node.content.size)return null;let o=e.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let s=o.nodeValue,a=rL(this.node.content,s,n-r,i-r);return a<0?null:{node:o,pos:a,text:s}}else return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:r,pos:n,text:i}){if(this.getDesc(r))return;let o=r;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let s=new qP(this,o,r,i);e.input.compositionNodes.push(s),this.children=j0(this.children,n,n+i.length,e,s)}update(e,r,n,i){return this.dirty==wo||!e.sameMarkup(this.node)?!1:(this.updateInner(e,r,n,i),!0)}updateInner(e,r,n,i){this.updateOuterDeco(r),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=mi}updateOuterDeco(e){if(ng(e,this.outerDeco))return;let r=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=lI(this.dom,this.nodeDOM,F0(this.outerDeco,this.node,r),F0(e,this.node,r)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function Uk(t,e,r,n,i){cI(n,e,t);let o=new ya(void 0,t,e,r,n,n,n,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class Cy extends ya{constructor(e,r,n,i,o,s,a){super(e,r,n,i,o,null,s,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,r,n,i){return this.dirty==wo||this.dirty!=mi&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(r),(this.dirty!=mi||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=mi,!0)}inParent(){let e=this.parent.contentDOM;for(let r=this.nodeDOM;r;r=r.parentNode)if(r==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,r,n){return e==this.nodeDOM?this.posAtStart+Math.min(r,this.node.text.length):super.localPosFromDOM(e,r,n)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,r,n){let i=this.node.cut(e,r),o=document.createTextNode(i.text);return new Cy(this.parent,i,this.outerDeco,this.innerDeco,o,o,n)}markDirty(e,r){super.markDirty(e,r),this.dom!=this.nodeDOM&&(e==0||r==this.nodeDOM.nodeValue.length)&&(this.dirty=wo)}get domAtom(){return!1}isText(e){return this.node.text==e}}class sI extends zh{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==mi&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class XP extends ya{constructor(e,r,n,i,o,s,a,l,c,d){super(e,r,n,i,o,s,a,c,d),this.spec=l}update(e,r,n,i){if(this.dirty==wo)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let o=this.spec.update(e,r,n);return o&&this.updateInner(e,r,n,i),o}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,r,n,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,r,n,i){this.spec.setSelection?this.spec.setSelection(e,r,n.root):super.setSelection(e,r,n,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function aI(t,e,r){let n=t.firstChild,i=!1;for(let o=0;o<e.length;o++){let s=e[o],a=s.dom;if(a.parentNode==t){for(;a!=n;)n=Wk(n),i=!0;n=n.nextSibling}else i=!0,t.insertBefore(a,n);if(s instanceof Gl){let l=n?n.previousSibling:t.lastChild;aI(s.contentDOM,s.children,r),n=l?l.nextSibling:t.firstChild}}for(;n;)n=Wk(n),i=!0;i&&r.trackWrites==t&&(r.trackWrites=null)}const Jf=function(t){t&&(this.nodeName=t)};Jf.prototype=Object.create(null);const Il=[new Jf];function F0(t,e,r){if(t.length==0)return Il;let n=r?Il[0]:new Jf,i=[n];for(let o=0;o<t.length;o++){let s=t[o].type.attrs;if(s){s.nodeName&&i.push(n=new Jf(s.nodeName));for(let a in s){let l=s[a];l!=null&&(r&&i.length==1&&i.push(n=new Jf(e.isInline?"span":"div")),a=="class"?n.class=(n.class?n.class+" ":"")+l:a=="style"?n.style=(n.style?n.style+";":"")+l:a!="nodeName"&&(n[a]=l))}}}return i}function lI(t,e,r,n){if(r==Il&&n==Il)return e;let i=e;for(let o=0;o<n.length;o++){let s=n[o],a=r[o];if(o){let l;a&&a.nodeName==s.nodeName&&i!=t&&(l=i.parentNode)&&l.nodeName.toLowerCase()==s.nodeName||(l=document.createElement(s.nodeName),l.pmIsDeco=!0,l.appendChild(i),a=Il[0]),i=l}YP(i,a||Il[0],s)}return i}function YP(t,e,r){for(let n in e)n!="class"&&n!="style"&&n!="nodeName"&&!(n in r)&&t.removeAttribute(n);for(let n in r)n!="class"&&n!="style"&&n!="nodeName"&&r[n]!=e[n]&&t.setAttribute(n,r[n]);if(e.class!=r.class){let n=e.class?e.class.split(" ").filter(Boolean):[],i=r.class?r.class.split(" ").filter(Boolean):[];for(let o=0;o<n.length;o++)i.indexOf(n[o])==-1&&t.classList.remove(n[o]);for(let o=0;o<i.length;o++)n.indexOf(i[o])==-1&&t.classList.add(i[o]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=r.style){if(e.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=n.exec(e.style);)t.style.removeProperty(i[1])}r.style&&(t.style.cssText+=r.style)}}function cI(t,e,r){return lI(t,t,Il,F0(e,r,t.nodeType!=1))}function ng(t,e){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!t[r].type.eq(e[r].type))return!1;return!0}function Wk(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class JP{constructor(e,r,n){this.lock=r,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=ZP(e.node.content,e)}destroyBetween(e,r){if(e!=r){for(let n=e;n<r;n++)this.top.children[n].destroy();this.top.children.splice(e,r-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,r,n){let i=0,o=this.stack.length>>1,s=Math.min(o,e.length);for(;i<s&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=mi,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let a=-1;for(let l=this.index;l<Math.min(this.index+3,this.top.children.length);l++){let c=this.top.children[l];if(c.matchesMark(e[o])&&!this.isLocked(c.dom)){a=l;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=Gl.create(this.top,e[o],r,n);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,o++}}findNodeMatch(e,r,n,i){let o=-1,s;if(i>=this.preMatch.index&&(s=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&s.matchesNode(e,r,n))o=this.top.children.indexOf(s,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let c=this.top.children[a];if(c.matchesNode(e,r,n)&&!this.preMatch.matched.has(c)){o=a;break}}return o<0?!1:(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(e,r,n,i,o){let s=this.top.children[i];return s.dirty==wo&&s.dom==s.contentDOM&&(s.dirty=Rl),s.update(e,r,n,o)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(e){for(;;){let r=e.parentNode;if(!r)return-1;if(r==this.top.contentDOM){let n=e.pmViewDesc;if(n){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==n)return i}return-1}e=r}}updateNextNode(e,r,n,i,o,s){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof ya){let c=this.preMatch.matched.get(l);if(c!=null&&c!=o)return!1;let d=l.dom,f,p=this.isLocked(d)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=wo&&ng(r,l.outerDeco));if(!p&&l.update(e,r,n,i))return this.destroyBetween(this.index,a),l.dom!=d&&(this.changed=!0),this.index++,!0;if(!p&&(f=this.recreateWrapper(l,e,r,n,i,s)))return this.destroyBetween(this.index,a),this.top.children[this.index]=f,f.contentDOM&&(f.dirty=Rl,f.updateChildren(i,s+1),f.dirty=mi),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,r,n,i,o,s){if(e.dirty||r.isAtom||!e.children.length||!e.node.content.eq(r.content)||!ng(n,e.outerDeco)||!i.eq(e.innerDeco))return null;let a=ya.create(this.top,r,n,i,o,s);if(a.contentDOM){a.children=e.children,e.children=[];for(let l of a.children)l.parent=a}return e.destroy(),a}addNode(e,r,n,i,o){let s=ya.create(this.top,e,r,n,i,o);s.contentDOM&&s.updateChildren(i,o+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(e,r,n){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let o=new oI(this.top,e,r,n);this.top.children.splice(this.index++,0,o),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],r=this.top;for(;e instanceof Gl;)r=e,e=r.children[r.children.length-1];(!e||!(e instanceof Cy)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((pn||Vr)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",r),this.addHackNode("BR",this.top))}addHackNode(e,r){if(r==this.top&&this.index<r.children.length&&r.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);e=="IMG"&&(n.className="ProseMirror-separator",n.alt=""),e=="BR"&&(n.className="ProseMirror-trailingBreak");let i=new sI(this.top,[],n,null);r!=this.top?r.children.push(i):r.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function ZP(t,e){let r=e,n=r.children.length,i=t.childCount,o=new Map,s=[];e:for(;i>0;){let a;for(;;)if(n){let c=r.children[n-1];if(c instanceof Gl)r=c,n=c.children.length;else{a=c,n--;break}}else{if(r==e)break e;n=r.parent.children.indexOf(r),r=r.parent}let l=a.node;if(l){if(l!=t.child(i-1))break;--i,o.set(a,i),s.push(a)}}return{index:i,matched:o,matches:s.reverse()}}function QP(t,e){return t.type.side-e.type.side}function eL(t,e,r,n){let i=e.locals(t),o=0;if(i.length==0){for(let c=0;c<t.childCount;c++){let d=t.child(c);n(d,i,e.forChild(o,d),c),o+=d.nodeSize}return}let s=0,a=[],l=null;for(let c=0;;){let d,f;for(;s<i.length&&i[s].to==o;){let S=i[s++];S.widget&&(d?(f||(f=[d])).push(S):d=S)}if(d)if(f){f.sort(QP);for(let S=0;S<f.length;S++)r(f[S],c,!!l)}else r(d,c,!!l);let p,m;if(l)m=-1,p=l,l=null;else if(c<t.childCount)m=c,p=t.child(c++);else break;for(let S=0;S<a.length;S++)a[S].to<=o&&a.splice(S--,1);for(;s<i.length&&i[s].from<=o&&i[s].to>o;)a.push(i[s++]);let g=o+p.nodeSize;if(p.isText){let S=g;s<i.length&&i[s].from<S&&(S=i[s].from);for(let w=0;w<a.length;w++)a[w].to<S&&(S=a[w].to);S<g&&(l=p.cut(S-o),p=p.cut(0,S-o),g=S,m=-1)}else for(;s<i.length&&i[s].to<g;)s++;let b=p.isInline&&!p.isLeaf?a.filter(S=>!S.inline):a.slice();n(p,b,e.forChild(o,p),m),o=g}}function tL(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function rL(t,e,r,n){for(let i=0,o=0;i<t.childCount&&o<=n;){let s=t.child(i++),a=o;if(o+=s.nodeSize,!s.isText)continue;let l=s.text;for(;i<t.childCount;){let c=t.child(i++);if(o+=c.nodeSize,!c.isText)break;l+=c.text}if(o>=r){if(o>=n&&l.slice(n-e.length-a,n-a)==e)return n-e.length;let c=a<n?l.lastIndexOf(e,n-a-1):-1;if(c>=0&&c+e.length+a>=r)return a+c;if(r==n&&l.length>=n+e.length-a&&l.slice(n-a,n-a+e.length)==e)return n}}return-1}function j0(t,e,r,n,i){let o=[];for(let s=0,a=0;s<t.length;s++){let l=t[s],c=a,d=a+=l.size;c>=r||d<=e?o.push(l):(c<e&&o.push(l.slice(0,e-c,n)),i&&(o.push(i),i=void 0),d>r&&o.push(l.slice(r-c,l.size,n)))}return o}function T1(t,e=null){let r=t.domSelectionRange(),n=t.state.doc;if(!r.focusNode)return null;let i=t.docView.nearestDesc(r.focusNode),o=i&&i.size==0,s=t.docView.posFromDOM(r.focusNode,r.focusOffset,1);if(s<0)return null;let a=n.resolve(s),l,c;if(_y(r)){for(l=s;i&&!i.node;)i=i.parent;let f=i.node;if(i&&f.isAtom&&rt.isSelectable(f)&&i.parent&&!(f.isInline&&AP(r.focusNode,r.focusOffset,i.dom))){let p=i.posBefore;c=new rt(s==p?a:n.resolve(p))}}else{if(r instanceof t.dom.ownerDocument.defaultView.Selection&&r.rangeCount>1){let f=s,p=s;for(let m=0;m<r.rangeCount;m++){let g=r.getRangeAt(m);f=Math.min(f,t.docView.posFromDOM(g.startContainer,g.startOffset,1)),p=Math.max(p,t.docView.posFromDOM(g.endContainer,g.endOffset,-1))}if(f<0)return null;[l,s]=p==t.state.selection.anchor?[p,f]:[f,p],a=n.resolve(s)}else l=t.docView.posFromDOM(r.anchorNode,r.anchorOffset,1);if(l<0)return null}let d=n.resolve(l);if(!c){let f=e=="pointer"||t.state.selection.head<a.pos&&!o?1:-1;c=A1(t,d,a,f)}return c}function uI(t){return t.editable?t.hasFocus():fI(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function cs(t,e=!1){let r=t.state.selection;if(dI(t,r),!!uI(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&Vr){let n=t.domSelectionRange(),i=t.domObserver.currentSelection;if(n.anchorNode&&i.anchorNode&&Vl(n.anchorNode,n.anchorOffset,i.anchorNode,i.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)iL(t);else{let{anchor:n,head:i}=r,o,s;Vk&&!(r instanceof et)&&(r.$from.parent.inlineContent||(o=Gk(t,r.from)),!r.empty&&!r.$from.parent.inlineContent&&(s=Gk(t,r.to))),t.docView.setSelection(n,i,t,e),Vk&&(o&&Kk(o),s&&Kk(s)),r.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&nL(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const Vk=pn||Vr&&ZR<63;function Gk(t,e){let{node:r,offset:n}=t.docView.domFromPos(e,0),i=n<r.childNodes.length?r.childNodes[n]:null,o=n?r.childNodes[n-1]:null;if(pn&&i&&i.contentEditable=="false")return bb(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return bb(i);if(o)return bb(o)}}function bb(t){return t.contentEditable="true",pn&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function Kk(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function nL(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let r=t.domSelectionRange(),n=r.anchorNode,i=r.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(r.anchorNode!=n||r.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!uI(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function iL(t){let e=t.domSelection(),r=document.createRange();if(!e)return;let n=t.cursorWrapper.dom,i=n.nodeName=="IMG";i?r.setStart(n.parentNode,Fr(n)+1):r.setStart(n,0),r.collapse(!0),e.removeAllRanges(),e.addRange(r),!i&&!t.state.selection.visible&&On&&ga<=11&&(n.disabled=!0,n.disabled=!1)}function dI(t,e){if(e instanceof rt){let r=t.docView.descAt(e.from);r!=t.lastSelectedViewDesc&&(qk(t),r&&r.selectNode(),t.lastSelectedViewDesc=r)}else qk(t)}function qk(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function A1(t,e,r,n){return t.someProp("createSelectionBetween",i=>i(t,e,r))||et.between(e,r,n)}function Xk(t){return t.editable&&!t.hasFocus()?!1:fI(t)}function fI(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function oL(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),r=t.domSelectionRange();return Vl(e.node,e.offset,r.anchorNode,r.anchorOffset)}function B0(t,e){let{$anchor:r,$head:n}=t.selection,i=e>0?r.max(n):r.min(n),o=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return o&&ot.findFrom(o,e)}function ra(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Yk(t,e,r){let n=t.state.selection;if(n instanceof et)if(r.indexOf("s")>-1){let{$head:i}=n,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let s=t.state.doc.resolve(i.pos+o.nodeSize*(e<0?-1:1));return ra(t,new et(n.$anchor,s))}else if(n.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=B0(t.state,e);return i&&i instanceof rt?ra(t,i):!1}else if(!(hi&&r.indexOf("m")>-1)){let i=n.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,s;if(!o||o.isText)return!1;let a=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(s=t.docView.descAt(a))&&!s.contentDOM?rt.isSelectable(o)?ra(t,new rt(e<0?t.state.doc.resolve(i.pos-o.nodeSize):i)):Bh?ra(t,new et(t.state.doc.resolve(e<0?a:a+o.nodeSize))):!1:!1}}else return!1;else{if(n instanceof rt&&n.node.isInline)return ra(t,new et(e>0?n.$to:n.$from));{let i=B0(t.state,e);return i?ra(t,i):!1}}}function ig(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Zf(t,e){let r=t.pmViewDesc;return r&&r.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function mu(t,e){return e<0?sL(t):aL(t)}function sL(t){let e=t.domSelectionRange(),r=e.focusNode,n=e.focusOffset;if(!r)return;let i,o,s=!1;for(zi&&r.nodeType==1&&n<ig(r)&&Zf(r.childNodes[n],-1)&&(s=!0);;)if(n>0){if(r.nodeType!=1)break;{let a=r.childNodes[n-1];if(Zf(a,-1))i=r,o=--n;else if(a.nodeType==3)r=a,n=r.nodeValue.length;else break}}else{if(hI(r))break;{let a=r.previousSibling;for(;a&&Zf(a,-1);)i=r.parentNode,o=Fr(a),a=a.previousSibling;if(a)r=a,n=ig(r);else{if(r=r.parentNode,r==t.dom)break;n=0}}}s?z0(t,r,n):i&&z0(t,i,o)}function aL(t){let e=t.domSelectionRange(),r=e.focusNode,n=e.focusOffset;if(!r)return;let i=ig(r),o,s;for(;;)if(n<i){if(r.nodeType!=1)break;let a=r.childNodes[n];if(Zf(a,1))o=r,s=++n;else break}else{if(hI(r))break;{let a=r.nextSibling;for(;a&&Zf(a,1);)o=a.parentNode,s=Fr(a)+1,a=a.nextSibling;if(a)r=a,n=0,i=ig(r);else{if(r=r.parentNode,r==t.dom)break;n=i=0}}}o&&z0(t,o,s)}function hI(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function lL(t,e){for(;t&&e==t.childNodes.length&&!jh(t);)e=Fr(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let r=t.childNodes[e];if(r.nodeType==3)return r;if(r.nodeType==1&&r.contentEditable=="false")break;t=r,e=0}}function cL(t,e){for(;t&&!e&&!jh(t);)e=Fr(t),t=t.parentNode;for(;t&&e;){let r=t.childNodes[e-1];if(r.nodeType==3)return r;if(r.nodeType==1&&r.contentEditable=="false")break;t=r,e=t.childNodes.length}}function z0(t,e,r){if(e.nodeType!=3){let o,s;(s=lL(e,r))?(e=s,r=0):(o=cL(e,r))&&(e=o,r=o.nodeValue.length)}let n=t.domSelection();if(!n)return;if(_y(n)){let o=document.createRange();o.setEnd(e,r),o.setStart(e,r),n.removeAllRanges(),n.addRange(o)}else n.extend&&n.extend(e,r);t.domObserver.setCurSelection();let{state:i}=t;setTimeout(()=>{t.state==i&&cs(t)},50)}function Jk(t,e){let r=t.state.doc.resolve(e);if(!(Vr||OP)&&r.parent.inlineContent){let i=t.coordsAtPos(e);if(e>r.start()){let o=t.coordsAtPos(e-1),s=(o.top+o.bottom)/2;if(s>i.top&&s<i.bottom&&Math.abs(o.left-i.left)>1)return o.left<i.left?"ltr":"rtl"}if(e<r.end()){let o=t.coordsAtPos(e+1),s=(o.top+o.bottom)/2;if(s>i.top&&s<i.bottom&&Math.abs(o.left-i.left)>1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function Zk(t,e,r){let n=t.state.selection;if(n instanceof et&&!n.empty||r.indexOf("s")>-1||hi&&r.indexOf("m")>-1)return!1;let{$from:i,$to:o}=n;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=B0(t.state,e);if(s&&s instanceof rt)return ra(t,s)}if(!i.parent.inlineContent){let s=e<0?i:o,a=n instanceof Gn?ot.near(s,e):ot.findFrom(s,e);return a?ra(t,a):!1}return!1}function Qk(t,e){if(!(t.state.selection instanceof et))return!0;let{$head:r,$anchor:n,empty:i}=t.state.selection;if(!r.sameParent(n))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!r.textOffset&&(e<0?r.nodeBefore:r.nodeAfter);if(o&&!o.isText){let s=t.state.tr;return e<0?s.delete(r.pos-o.nodeSize,r.pos):s.delete(r.pos,r.pos+o.nodeSize),t.dispatch(s),!0}return!1}function e_(t,e,r){t.domObserver.stop(),e.contentEditable=r,t.domObserver.start()}function uL(t){if(!pn||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:r}=t.domSelectionRange();if(e&&e.nodeType==1&&r==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let n=e.firstChild;e_(t,n,"true"),setTimeout(()=>e_(t,n,"false"),20)}return!1}function dL(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function fL(t,e){let r=e.keyCode,n=dL(e);if(r==8||hi&&r==72&&n=="c")return Qk(t,-1)||mu(t,-1);if(r==46&&!e.shiftKey||hi&&r==68&&n=="c")return Qk(t,1)||mu(t,1);if(r==13||r==27)return!0;if(r==37||hi&&r==66&&n=="c"){let i=r==37?Jk(t,t.state.selection.from)=="ltr"?-1:1:-1;return Yk(t,i,n)||mu(t,i)}else if(r==39||hi&&r==70&&n=="c"){let i=r==39?Jk(t,t.state.selection.from)=="ltr"?1:-1:1;return Yk(t,i,n)||mu(t,i)}else{if(r==38||hi&&r==80&&n=="c")return Zk(t,-1,n)||mu(t,-1);if(r==40||hi&&r==78&&n=="c")return uL(t)||Zk(t,1,n)||mu(t,1);if(n==(hi?"m":"c")&&(r==66||r==73||r==89||r==90))return!0}return!1}function pI(t,e){t.someProp("transformCopied",m=>{e=m(e,t)});let r=[],{content:n,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&n.childCount==1&&n.firstChild.childCount==1;){i--,o--;let m=n.firstChild;r.push(m.type.name,m.attrs!=m.type.defaultAttrs?m.attrs:null),n=m.content}let s=t.someProp("clipboardSerializer")||nc.fromSchema(t.state.schema),a=wI(),l=a.createElement("div");l.appendChild(s.serializeFragment(n,{document:a}));let c=l.firstChild,d,f=0;for(;c&&c.nodeType==1&&(d=bI[c.nodeName.toLowerCase()]);){for(let m=d.length-1;m>=0;m--){let g=a.createElement(d[m]);for(;l.firstChild;)g.appendChild(l.firstChild);l.appendChild(g),f++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${i} ${o}${f?` -${f}`:""} ${JSON.stringify(r)}`);let p=t.someProp("clipboardTextSerializer",m=>m(e,t))||e.content.textBetween(0,e.content.size,`
|
|
7
|
+
|
|
8
|
+
`);return{dom:l,text:p,slice:e}}function mI(t,e,r,n,i){let o=i.parent.type.spec.code,s,a;if(!r&&!e)return null;let l=e&&(n||o||!r);if(l){if(t.someProp("transformPastedText",p=>{e=p(e,o||n,t)}),o)return e?new qe(Le.from(t.state.schema.text(e.replace(/\r\n?/g,`
|
|
9
|
+
`))),0,0):qe.empty;let f=t.someProp("clipboardTextParser",p=>p(e,i,n,t));if(f)a=f;else{let p=i.marks(),{schema:m}=t.state,g=nc.fromSchema(m);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(b=>{let S=s.appendChild(document.createElement("p"));b&&S.appendChild(g.serializeNode(m.text(b,p)))})}}else t.someProp("transformPastedHTML",f=>{r=f(r,t)}),s=gL(r),Bh&&yL(s);let c=s&&s.querySelector("[data-pm-slice]"),d=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let f=+d[3];f>0;f--){let p=s.firstChild;for(;p&&p.nodeType!=1;)p=p.nextSibling;if(!p)break;s=p}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||Xf.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||d),context:i,ruleFromNode(p){return p.nodeName=="BR"&&!p.nextSibling&&p.parentNode&&!hL.test(p.parentNode.nodeName)?{ignore:!0}:null}})),d)a=vL(t_(a,+d[1],+d[2]),d[4]);else if(a=qe.maxOpen(pL(a.content,i),!0),a.openStart||a.openEnd){let f=0,p=0;for(let m=a.content.firstChild;f<a.openStart&&!m.type.spec.isolating;f++,m=m.firstChild);for(let m=a.content.lastChild;p<a.openEnd&&!m.type.spec.isolating;p++,m=m.lastChild);a=t_(a,f,p)}return t.someProp("transformPasted",f=>{a=f(a,t)}),a}const hL=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function pL(t,e){if(t.childCount<2)return t;for(let r=e.depth;r>=0;r--){let i=e.node(r).contentMatchAt(e.index(r)),o,s=[];if(t.forEach(a=>{if(!s)return;let l=i.findWrapping(a.type),c;if(!l)return s=null;if(c=s.length&&o.length&&yI(l,o,a,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=vI(s[s.length-1],o.length));let d=gI(a,l);s.push(d),i=i.matchType(d.type),o=l}}),s)return Le.from(s)}return t}function gI(t,e,r=0){for(let n=e.length-1;n>=r;n--)t=e[n].create(null,Le.from(t));return t}function yI(t,e,r,n,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let o=yI(t,e,r,n.lastChild,i+1);if(o)return n.copy(n.content.replaceChild(n.childCount-1,o));if(n.contentMatchAt(n.childCount).matchType(i==t.length-1?r.type:t[i+1]))return n.copy(n.content.append(Le.from(gI(r,t,i+1))))}}function vI(t,e){if(e==0)return t;let r=t.content.replaceChild(t.childCount-1,vI(t.lastChild,e-1)),n=t.contentMatchAt(t.childCount).fillBefore(Le.empty,!0);return t.copy(r.append(n))}function H0(t,e,r,n,i,o){let s=e<0?t.firstChild:t.lastChild,a=s.content;return t.childCount>1&&(o=0),i<n-1&&(a=H0(a,e,r,n,i+1,o)),i>=r&&(a=e<0?s.contentMatchAt(0).fillBefore(a,o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(Le.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(a))}function t_(t,e,r){return e<t.openStart&&(t=new qe(H0(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),r<t.openEnd&&(t=new qe(H0(t.content,1,r,t.openEnd,0,0),t.openStart,r)),t}const bI={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let r_=null;function wI(){return r_||(r_=document.implementation.createHTMLDocument("title"))}let wb=null;function mL(t){let e=window.trustedTypes;return e?(wb||(wb=e.createPolicy("ProseMirrorClipboard",{createHTML:r=>r})),wb.createHTML(t)):t}function gL(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let r=wI().createElement("div"),n=/<([a-z][^>\s]+)/i.exec(t),i;if((i=n&&bI[n[1].toLowerCase()])&&(t=i.map(o=>"<"+o+">").join("")+t+i.map(o=>"</"+o+">").reverse().join("")),r.innerHTML=mL(t),i)for(let o=0;o<i.length;o++)r=r.querySelector(i[o])||r;return r}function yL(t){let e=t.querySelectorAll(Vr?"span:not([class]):not([style])":"span.Apple-converted-space");for(let r=0;r<e.length;r++){let n=e[r];n.childNodes.length==1&&n.textContent==" "&&n.parentNode&&n.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),n)}}function vL(t,e){if(!t.size)return t;let r=t.content.firstChild.type.schema,n;try{n=JSON.parse(e)}catch{return t}let{content:i,openStart:o,openEnd:s}=t;for(let a=n.length-2;a>=0;a-=2){let l=r.nodes[n[a]];if(!l||l.hasRequiredAttrs())break;i=Le.from(l.create(n[a+1],i)),o++,s++}return new qe(i,o,s)}const mn={},gn={},bL={touchstart:!0,touchmove:!0};class wL{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function xL(t){for(let e in mn){let r=mn[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=n=>{kL(t,n)&&!R1(t,n)&&(t.editable||!(n.type in gn))&&r(t,n)},bL[e]?{passive:!0}:void 0)}pn&&t.dom.addEventListener("input",()=>null),$0(t)}function ha(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function SL(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function $0(t){t.someProp("handleDOMEvents",e=>{for(let r in e)t.input.eventHandlers[r]||t.dom.addEventListener(r,t.input.eventHandlers[r]=n=>R1(t,n))})}function R1(t,e){return t.someProp("handleDOMEvents",r=>{let n=r[e.type];return n?n(t,e)||e.defaultPrevented:!1})}function kL(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let r=e.target;r!=t.dom;r=r.parentNode)if(!r||r.nodeType==11||r.pmViewDesc&&r.pmViewDesc.stopEvent(e))return!1;return!0}function _L(t,e){!R1(t,e)&&mn[e.type]&&(t.editable||!(e.type in gn))&&mn[e.type](t,e)}gn.keydown=(t,e)=>{let r=e;if(t.input.shiftKey=r.keyCode==16||r.shiftKey,!SI(t,r)&&(t.input.lastKeyCode=r.keyCode,t.input.lastKeyCodeTime=Date.now(),!(rs&&Vr&&r.keyCode==13)))if(r.keyCode!=229&&t.domObserver.forceFlush(),Xu&&r.keyCode==13&&!r.ctrlKey&&!r.altKey&&!r.metaKey){let n=Date.now();t.input.lastIOSEnter=n,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==n&&(t.someProp("handleKeyDown",i=>i(t,Cl(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",n=>n(t,r))||fL(t,r)?r.preventDefault():ha(t,"key")};gn.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};gn.keypress=(t,e)=>{let r=e;if(SI(t,r)||!r.charCode||r.ctrlKey&&!r.altKey||hi&&r.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,r))){r.preventDefault();return}let n=t.state.selection;if(!(n instanceof et)||!n.$from.sameParent(n.$to)){let i=String.fromCharCode(r.charCode);!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",o=>o(t,n.$from.pos,n.$to.pos,i))&&t.dispatch(t.state.tr.insertText(i).scrollIntoView()),r.preventDefault()}};function Ey(t){return{left:t.clientX,top:t.clientY}}function CL(t,e){let r=e.x-t.clientX,n=e.y-t.clientY;return r*r+n*n<100}function I1(t,e,r,n,i){if(n==-1)return!1;let o=t.state.doc.resolve(n);for(let s=o.depth+1;s>0;s--)if(t.someProp(e,a=>s>o.depth?a(t,r,o.nodeAfter,o.before(s),i,!0):a(t,r,o.node(s),o.before(s),i,!1)))return!0;return!1}function Fu(t,e,r){if(t.focused||t.focus(),t.state.selection.eq(e))return;let n=t.state.tr.setSelection(e);n.setMeta("pointer",!0),t.dispatch(n)}function EL(t,e){if(e==-1)return!1;let r=t.state.doc.resolve(e),n=r.nodeAfter;return n&&n.isAtom&&rt.isSelectable(n)?(Fu(t,new rt(r)),!0):!1}function TL(t,e){if(e==-1)return!1;let r=t.state.selection,n,i;r instanceof rt&&(n=r.node);let o=t.state.doc.resolve(e);for(let s=o.depth+1;s>0;s--){let a=s>o.depth?o.nodeAfter:o.node(s);if(rt.isSelectable(a)){n&&r.$from.depth>0&&s>=r.$from.depth&&o.before(r.$from.depth+1)==r.$from.pos?i=o.before(r.$from.depth):i=o.before(s);break}}return i!=null?(Fu(t,rt.create(t.state.doc,i)),!0):!1}function AL(t,e,r,n,i){return I1(t,"handleClickOn",e,r,n)||t.someProp("handleClick",o=>o(t,e,n))||(i?TL(t,r):EL(t,r))}function RL(t,e,r,n){return I1(t,"handleDoubleClickOn",e,r,n)||t.someProp("handleDoubleClick",i=>i(t,e,n))}function IL(t,e,r,n){return I1(t,"handleTripleClickOn",e,r,n)||t.someProp("handleTripleClick",i=>i(t,e,n))||OL(t,r,n)}function OL(t,e,r){if(r.button!=0)return!1;let n=t.state.doc;if(e==-1)return n.inlineContent?(Fu(t,et.create(n,0,n.content.size)),!0):!1;let i=n.resolve(e);for(let o=i.depth+1;o>0;o--){let s=o>i.depth?i.nodeAfter:i.node(o),a=i.before(o);if(s.inlineContent)Fu(t,et.create(n,a+1,a+1+s.content.size));else if(rt.isSelectable(s))Fu(t,rt.create(n,a));else continue;return!0}}function O1(t){return og(t)}const xI=hi?"metaKey":"ctrlKey";mn.mousedown=(t,e)=>{let r=e;t.input.shiftKey=r.shiftKey;let n=O1(t),i=Date.now(),o="singleClick";i-t.input.lastClick.time<500&&CL(r,t.input.lastClick)&&!r[xI]&&(t.input.lastClick.type=="singleClick"?o="doubleClick":t.input.lastClick.type=="doubleClick"&&(o="tripleClick")),t.input.lastClick={time:i,x:r.clientX,y:r.clientY,type:o};let s=t.posAtCoords(Ey(r));s&&(o=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new ML(t,s,r,!!n)):(o=="doubleClick"?RL:IL)(t,s.pos,s.inside,r)?r.preventDefault():ha(t,"pointer"))};class ML{constructor(e,r,n,i){this.view=e,this.pos=r,this.event=n,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[xI],this.allowDefault=n.shiftKey;let o,s;if(r.inside>-1)o=e.state.doc.nodeAt(r.inside),s=r.inside;else{let d=e.state.doc.resolve(r.pos);o=d.parent,s=d.depth?d.before():0}const a=i?null:n.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l&&l.dom.nodeType==1?l.dom:null;let{selection:c}=e.state;(n.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||c instanceof rt&&c.from<=s&&c.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&zi&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),ha(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>cs(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let r=this.pos;this.view.state.doc!=this.startDoc&&(r=this.view.posAtCoords(Ey(e))),this.updateAllowDefault(e),this.allowDefault||!r?ha(this.view,"pointer"):AL(this.view,r.pos,r.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||pn&&this.mightDrag&&!this.mightDrag.node.isAtom||Vr&&!this.view.state.selection.visible&&Math.min(Math.abs(r.pos-this.view.state.selection.from),Math.abs(r.pos-this.view.state.selection.to))<=2)?(Fu(this.view,ot.near(this.view.state.doc.resolve(r.pos))),e.preventDefault()):ha(this.view,"pointer")}move(e){this.updateAllowDefault(e),ha(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}mn.touchstart=t=>{t.input.lastTouch=Date.now(),O1(t),ha(t,"pointer")};mn.touchmove=t=>{t.input.lastTouch=Date.now(),ha(t,"pointer")};mn.contextmenu=t=>O1(t);function SI(t,e){return t.composing?!0:pn&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const NL=rs?5e3:-1;gn.compositionstart=gn.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,r=e.selection.$to;if(e.selection instanceof et&&(e.storedMarks||!r.textOffset&&r.parentOffset&&r.nodeBefore.marks.some(n=>n.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||r.marks(),og(t,!0),t.markCursor=null;else if(og(t,!e.selection.empty),zi&&e.selection.empty&&r.parentOffset&&!r.textOffset&&r.nodeBefore.marks.length){let n=t.domSelectionRange();for(let i=n.focusNode,o=n.focusOffset;i&&i.nodeType==1&&o!=0;){let s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(s.nodeType==3){let a=t.domSelection();a&&a.collapse(s,s.nodeValue.length);break}else i=s,o=-1}}t.input.composing=!0}kI(t,NL)};gn.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,kI(t,20))};function kI(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>og(t),e))}function _I(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=PL());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function DL(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let r=EP(e.focusNode,e.focusOffset),n=TP(e.focusNode,e.focusOffset);if(r&&n&&r!=n){let i=n.pmViewDesc,o=t.domObserver.lastChangedTextNode;if(r==o||n==o)return o;if(!i||!i.isText(n.nodeValue))return n;if(t.input.compositionNode==n){let s=r.pmViewDesc;if(!(!s||!s.isText(r.nodeValue)))return n}}return r||n}function PL(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function og(t,e=!1){if(!(rs&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),_I(t),e||t.docView&&t.docView.dirty){let r=T1(t);return r&&!r.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(r)):(t.markCursor||e)&&!t.state.selection.empty?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function LL(t,e){if(!t.dom.parentNode)return;let r=t.dom.parentNode.appendChild(document.createElement("div"));r.appendChild(e),r.style.cssText="position: fixed; left: -10000px; top: 10px";let n=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),n.removeAllRanges(),n.addRange(i),setTimeout(()=>{r.parentNode&&r.parentNode.removeChild(r),t.focus()},50)}const mh=On&&ga<15||Xu&&MP<604;mn.copy=gn.cut=(t,e)=>{let r=e,n=t.state.selection,i=r.type=="cut";if(n.empty)return;let o=mh?null:r.clipboardData,s=n.content(),{dom:a,text:l}=pI(t,s);o?(r.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):LL(t,a),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function FL(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function jL(t,e){if(!t.dom.parentNode)return;let r=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,n=t.dom.parentNode.appendChild(document.createElement(r?"textarea":"div"));r||(n.contentEditable="true"),n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus();let i=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),n.parentNode&&n.parentNode.removeChild(n),r?gh(t,n.value,null,i,e):gh(t,n.textContent,n.innerHTML,i,e)},50)}function gh(t,e,r,n,i){let o=mI(t,e,r,n,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,i,o||qe.empty)))return!0;if(!o)return!1;let s=FL(o),a=s?t.state.tr.replaceSelectionWith(s,n):t.state.tr.replaceSelection(o);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function CI(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let r=t.getData("text/uri-list");return r?r.replace(/\r?\n/g," "):""}gn.paste=(t,e)=>{let r=e;if(t.composing&&!rs)return;let n=mh?null:r.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;n&&gh(t,CI(n),n.getData("text/html"),i,r)?r.preventDefault():jL(t,r)};class EI{constructor(e,r,n){this.slice=e,this.move=r,this.node=n}}const TI=hi?"altKey":"ctrlKey";mn.dragstart=(t,e)=>{let r=e,n=t.input.mouseDown;if(n&&n.done(),!r.dataTransfer)return;let i=t.state.selection,o=i.empty?null:t.posAtCoords(Ey(r)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof rt?i.to-1:i.to))){if(n&&n.mightDrag)s=rt.create(t.state.doc,n.mightDrag.pos);else if(r.target&&r.target.nodeType==1){let f=t.docView.nearestDesc(r.target,!0);f&&f.node.type.spec.draggable&&f!=t.docView&&(s=rt.create(t.state.doc,f.posBefore))}}let a=(s||t.state.selection).content(),{dom:l,text:c,slice:d}=pI(t,a);(!r.dataTransfer.files.length||!Vr||ZR>120)&&r.dataTransfer.clearData(),r.dataTransfer.setData(mh?"Text":"text/html",l.innerHTML),r.dataTransfer.effectAllowed="copyMove",mh||r.dataTransfer.setData("text/plain",c),t.dragging=new EI(d,!r[TI],s)};mn.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};gn.dragover=gn.dragenter=(t,e)=>e.preventDefault();gn.drop=(t,e)=>{let r=e,n=t.dragging;if(t.dragging=null,!r.dataTransfer)return;let i=t.posAtCoords(Ey(r));if(!i)return;let o=t.state.doc.resolve(i.pos),s=n&&n.slice;s?t.someProp("transformPasted",g=>{s=g(s,t)}):s=mI(t,CI(r.dataTransfer),mh?null:r.dataTransfer.getData("text/html"),!1,o);let a=!!(n&&!r[TI]);if(t.someProp("handleDrop",g=>g(t,r,s||qe.empty,a))){r.preventDefault();return}if(!s)return;r.preventDefault();let l=s?WR(t.state.doc,o.pos,s):o.pos;l==null&&(l=o.pos);let c=t.state.tr;if(a){let{node:g}=n;g?g.replace(c):c.deleteSelection()}let d=c.mapping.map(l),f=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,p=c.doc;if(f?c.replaceRangeWith(d,d,s.content.firstChild):c.replaceRange(d,d,s),c.doc.eq(p))return;let m=c.doc.resolve(d);if(f&&rt.isSelectable(s.content.firstChild)&&m.nodeAfter&&m.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new rt(m));else{let g=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((b,S,w,T)=>g=T),c.setSelection(A1(t,m,c.doc.resolve(g)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))};mn.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&cs(t)},20))};mn.blur=(t,e)=>{let r=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),r.relatedTarget&&t.dom.contains(r.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};mn.beforeinput=(t,e)=>{if(Vr&&rs&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:n}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=n||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",o=>o(t,Cl(8,"Backspace")))))return;let{$cursor:i}=t.state.selection;i&&i.pos>0&&t.dispatch(t.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let t in gn)mn[t]=gn[t];function yh(t,e){if(t==e)return!0;for(let r in t)if(t[r]!==e[r])return!1;for(let r in e)if(!(r in t))return!1;return!0}class sg{constructor(e,r){this.toDOM=e,this.spec=r||jl,this.side=this.spec.side||0}map(e,r,n,i){let{pos:o,deleted:s}=e.mapResult(r.from+i,this.side<0?-1:1);return s?null:new Qt(o-n,o-n,this)}valid(){return!0}eq(e){return this==e||e instanceof sg&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&yh(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class va{constructor(e,r){this.attrs=e,this.spec=r||jl}map(e,r,n,i){let o=e.map(r.from+i,this.spec.inclusiveStart?-1:1)-n,s=e.map(r.to+i,this.spec.inclusiveEnd?1:-1)-n;return o>=s?null:new Qt(o,s,this)}valid(e,r){return r.from<r.to}eq(e){return this==e||e instanceof va&&yh(this.attrs,e.attrs)&&yh(this.spec,e.spec)}static is(e){return e.type instanceof va}destroy(){}}class M1{constructor(e,r){this.attrs=e,this.spec=r||jl}map(e,r,n,i){let o=e.mapResult(r.from+i,1);if(o.deleted)return null;let s=e.mapResult(r.to+i,-1);return s.deleted||s.pos<=o.pos?null:new Qt(o.pos-n,s.pos-n,this)}valid(e,r){let{index:n,offset:i}=e.content.findIndex(r.from),o;return i==r.from&&!(o=e.child(n)).isText&&i+o.nodeSize==r.to}eq(e){return this==e||e instanceof M1&&yh(this.attrs,e.attrs)&&yh(this.spec,e.spec)}destroy(){}}class Qt{constructor(e,r,n){this.from=e,this.to=r,this.type=n}copy(e,r){return new Qt(e,r,this.type)}eq(e,r=0){return this.type.eq(e.type)&&this.from+r==e.from&&this.to+r==e.to}map(e,r,n){return this.type.map(e,this,r,n)}static widget(e,r,n){return new Qt(e,e,new sg(r,n))}static inline(e,r,n,i){return new Qt(e,r,new va(n,i))}static node(e,r,n,i){return new Qt(e,r,new M1(n,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof va}get widget(){return this.type instanceof sg}}const Cu=[],jl={};class Tt{constructor(e,r){this.local=e.length?e:Cu,this.children=r.length?r:Cu}static create(e,r){return r.length?ag(r,e,0,jl):Wr}find(e,r,n){let i=[];return this.findInner(e??0,r??1e9,i,0,n),i}findInner(e,r,n,i,o){for(let s=0;s<this.local.length;s++){let a=this.local[s];a.from<=r&&a.to>=e&&(!o||o(a.spec))&&n.push(a.copy(a.from+i,a.to+i))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<r&&this.children[s+1]>e){let a=this.children[s]+1;this.children[s+2].findInner(e-a,r-a,n,i+a,o)}}map(e,r,n){return this==Wr||e.maps.length==0?this:this.mapInner(e,r,0,0,n||jl)}mapInner(e,r,n,i,o){let s;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(e,n,i);l&&l.type.valid(r,l)?(s||(s=[])).push(l):o.onRemove&&o.onRemove(this.local[a].spec)}return this.children.length?BL(this.children,s||[],e,r,n,i,o):s?new Tt(s.sort(Bl),Cu):Wr}add(e,r){return r.length?this==Wr?Tt.create(e,r):this.addInner(e,r,0):this}addInner(e,r,n){let i,o=0;e.forEach((a,l)=>{let c=l+n,d;if(d=RI(r,a,c)){for(i||(i=this.children.slice());o<i.length&&i[o]<l;)o+=3;i[o]==l?i[o+2]=i[o+2].addInner(a,d,c+1):i.splice(o,0,l,l+a.nodeSize,ag(d,a,c+1,jl)),o+=3}});let s=AI(o?II(r):r,-n);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||s.splice(a--,1);return new Tt(s.length?this.local.concat(s).sort(Bl):this.local,i||this.children)}remove(e){return e.length==0||this==Wr?this:this.removeInner(e,0)}removeInner(e,r){let n=this.children,i=this.local;for(let o=0;o<n.length;o+=3){let s,a=n[o]+r,l=n[o+1]+r;for(let d=0,f;d<e.length;d++)(f=e[d])&&f.from>a&&f.to<l&&(e[d]=null,(s||(s=[])).push(f));if(!s)continue;n==this.children&&(n=this.children.slice());let c=n[o+2].removeInner(s,a+1);c!=Wr?n[o+2]=c:(n.splice(o,3),o-=3)}if(i.length){for(let o=0,s;o<e.length;o++)if(s=e[o])for(let a=0;a<i.length;a++)i[a].eq(s,r)&&(i==this.local&&(i=this.local.slice()),i.splice(a--,1))}return n==this.children&&i==this.local?this:i.length||n.length?new Tt(i,n):Wr}forChild(e,r){if(this==Wr)return this;if(r.isLeaf)return Tt.empty;let n,i;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(n=this.children[a+2]);break}let o=e+1,s=o+r.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<s&&l.to>o&&l.type instanceof va){let c=Math.max(o,l.from)-o,d=Math.min(s,l.to)-o;c<d&&(i||(i=[])).push(l.copy(c,d))}}if(i){let a=new Tt(i.sort(Bl),Cu);return n?new aa([a,n]):a}return n||Wr}eq(e){if(this==e)return!0;if(!(e instanceof Tt)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let r=0;r<this.local.length;r++)if(!this.local[r].eq(e.local[r]))return!1;for(let r=0;r<this.children.length;r+=3)if(this.children[r]!=e.children[r]||this.children[r+1]!=e.children[r+1]||!this.children[r+2].eq(e.children[r+2]))return!1;return!0}locals(e){return N1(this.localsInner(e))}localsInner(e){if(this==Wr)return Cu;if(e.inlineContent||!this.local.some(va.is))return this.local;let r=[];for(let n=0;n<this.local.length;n++)this.local[n].type instanceof va||r.push(this.local[n]);return r}forEachSet(e){e(this)}}Tt.empty=new Tt([],[]);Tt.removeOverlap=N1;const Wr=Tt.empty;class aa{constructor(e){this.members=e}map(e,r){const n=this.members.map(i=>i.map(e,r,jl));return aa.from(n)}forChild(e,r){if(r.isLeaf)return Tt.empty;let n=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,r);o!=Wr&&(o instanceof aa?n=n.concat(o.members):n.push(o))}return aa.from(n)}eq(e){if(!(e instanceof aa)||e.members.length!=this.members.length)return!1;for(let r=0;r<this.members.length;r++)if(!this.members[r].eq(e.members[r]))return!1;return!0}locals(e){let r,n=!0;for(let i=0;i<this.members.length;i++){let o=this.members[i].localsInner(e);if(o.length)if(!r)r=o;else{n&&(r=r.slice(),n=!1);for(let s=0;s<o.length;s++)r.push(o[s])}}return r?N1(n?r:r.sort(Bl)):Cu}static from(e){switch(e.length){case 0:return Wr;case 1:return e[0];default:return new aa(e.every(r=>r instanceof Tt)?e:e.reduce((r,n)=>r.concat(n instanceof Tt?n:n.members),[]))}}forEachSet(e){for(let r=0;r<this.members.length;r++)this.members[r].forEachSet(e)}}function BL(t,e,r,n,i,o,s){let a=t.slice();for(let c=0,d=o;c<r.maps.length;c++){let f=0;r.maps[c].forEach((p,m,g,b)=>{let S=b-g-(m-p);for(let w=0;w<a.length;w+=3){let T=a[w+1];if(T<0||p>T+d-f)continue;let M=a[w]+d-f;m>=M?a[w+1]=p<=M?-2:-1:p>=d&&S&&(a[w]+=S,a[w+1]+=S)}f+=S}),d=r.maps[c].map(d,-1)}let l=!1;for(let c=0;c<a.length;c+=3)if(a[c+1]<0){if(a[c+1]==-2){l=!0,a[c+1]=-1;continue}let d=r.map(t[c]+o),f=d-i;if(f<0||f>=n.content.size){l=!0;continue}let p=r.map(t[c+1]+o,-1),m=p-i,{index:g,offset:b}=n.content.findIndex(f),S=n.maybeChild(g);if(S&&b==f&&b+S.nodeSize==m){let w=a[c+2].mapInner(r,S,d+1,t[c]+o+1,s);w!=Wr?(a[c]=f,a[c+1]=m,a[c+2]=w):(a[c+1]=-2,l=!0)}else l=!0}if(l){let c=zL(a,t,e,r,i,o,s),d=ag(c,n,0,s);e=d.local;for(let f=0;f<a.length;f+=3)a[f+1]<0&&(a.splice(f,3),f-=3);for(let f=0,p=0;f<d.children.length;f+=3){let m=d.children[f];for(;p<a.length&&a[p]<m;)p+=3;a.splice(p,0,d.children[f],d.children[f+1],d.children[f+2])}}return new Tt(e.sort(Bl),a)}function AI(t,e){if(!e||!t.length)return t;let r=[];for(let n=0;n<t.length;n++){let i=t[n];r.push(new Qt(i.from+e,i.to+e,i.type))}return r}function zL(t,e,r,n,i,o,s){function a(l,c){for(let d=0;d<l.local.length;d++){let f=l.local[d].map(n,i,c);f?r.push(f):s.onRemove&&s.onRemove(l.local[d].spec)}for(let d=0;d<l.children.length;d+=3)a(l.children[d+2],l.children[d]+c+1)}for(let l=0;l<t.length;l+=3)t[l+1]==-1&&a(t[l+2],e[l]+o+1);return r}function RI(t,e,r){if(e.isLeaf)return null;let n=r+e.nodeSize,i=null;for(let o=0,s;o<t.length;o++)(s=t[o])&&s.from>r&&s.to<n&&((i||(i=[])).push(s),t[o]=null);return i}function II(t){let e=[];for(let r=0;r<t.length;r++)t[r]!=null&&e.push(t[r]);return e}function ag(t,e,r,n){let i=[],o=!1;e.forEach((a,l)=>{let c=RI(t,a,l+r);if(c){o=!0;let d=ag(c,a,r+l+1,n);d!=Wr&&i.push(l,l+a.nodeSize,d)}});let s=AI(o?II(t):t,-r).sort(Bl);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||(n.onRemove&&n.onRemove(s[a].spec),s.splice(a--,1));return s.length||i.length?new Tt(s,i):Wr}function Bl(t,e){return t.from-e.from||t.to-e.to}function N1(t){let e=t;for(let r=0;r<e.length-1;r++){let n=e[r];if(n.from!=n.to)for(let i=r+1;i<e.length;i++){let o=e[i];if(o.from==n.from){o.to!=n.to&&(e==t&&(e=t.slice()),e[i]=o.copy(o.from,n.to),n_(e,i+1,o.copy(n.to,o.to)));continue}else{o.from<n.to&&(e==t&&(e=t.slice()),e[r]=n.copy(n.from,o.from),n_(e,i,n.copy(o.from,n.to)));break}}}return e}function n_(t,e,r){for(;e<t.length&&Bl(r,t[e])>0;)e++;t.splice(e,0,r)}function xb(t){let e=[];return t.someProp("decorations",r=>{let n=r(t.state);n&&n!=Wr&&e.push(n)}),t.cursorWrapper&&e.push(Tt.create(t.state.doc,[t.cursorWrapper.deco])),aa.from(e)}const HL={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},$L=On&&ga<=11;class UL{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class WL{constructor(e,r){this.view=e,this.handleDOMChange=r,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new UL,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(n=>{for(let i=0;i<n.length;i++)this.queue.push(n[i]);On&&ga<=11&&n.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),$L&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,HL)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let r=0;r<e.length;r++)this.queue.push(e[r]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Xk(this.view)){if(this.suppressingSelectionUpdates)return cs(this.view);if(On&&ga<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Vl(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let r=new Set,n;for(let o=e.focusNode;o;o=ph(o))r.add(o);for(let o=e.anchorNode;o;o=ph(o))if(r.has(o)){n=o;break}let i=n&&this.view.docView.nearestDesc(n);if(i&&i.ignoreMutation({type:"selection",target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let r=this.pendingRecords();r.length&&(this.queue=[]);let n=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&Xk(e)&&!this.ignoreSelectionChange(n),o=-1,s=-1,a=!1,l=[];if(e.editable)for(let d=0;d<r.length;d++){let f=this.registerMutation(r[d],l);f&&(o=o<0?f.from:Math.min(f.from,o),s=s<0?f.to:Math.max(f.to,s),f.typeOver&&(a=!0))}if(zi&&l.length){let d=l.filter(f=>f.nodeName=="BR");if(d.length==2){let[f,p]=d;f.parentNode&&f.parentNode.parentNode==p.parentNode?p.remove():f.remove()}else{let{focusNode:f}=this.currentSelection;for(let p of d){let m=p.parentNode;m&&m.nodeName=="LI"&&(!f||KL(e,f)!=m)&&p.remove()}}}let c=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&_y(n)&&(c=T1(e))&&c.eq(ot.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,cs(e),this.currentSelection.set(n),e.scrollToSelection()):(o>-1||i)&&(o>-1&&(e.docView.markDirty(o,s),VL(e)),this.handleDOMChange(o,s,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||cs(e),this.currentSelection.set(n))}registerMutation(e,r){if(r.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(n==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!n||n.ignoreMutation(e))return null;if(e.type=="childList"){for(let d=0;d<e.addedNodes.length;d++){let f=e.addedNodes[d];r.push(f),f.nodeType==3&&(this.lastChangedTextNode=f)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let i=e.previousSibling,o=e.nextSibling;if(On&&ga<=11&&e.addedNodes.length)for(let d=0;d<e.addedNodes.length;d++){let{previousSibling:f,nextSibling:p}=e.addedNodes[d];(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(i=f),(!p||Array.prototype.indexOf.call(e.addedNodes,p)<0)&&(o=p)}let s=i&&i.parentNode==e.target?Fr(i)+1:0,a=n.localPosFromDOM(e.target,s,-1),l=o&&o.parentNode==e.target?Fr(o):e.target.childNodes.length,c=n.localPosFromDOM(e.target,l,1);return{from:a,to:c}}else return e.type=="attributes"?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let i_=new WeakMap,o_=!1;function VL(t){if(!i_.has(t)&&(i_.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=zi,o_)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),o_=!0}}function s_(t,e){let r=e.startContainer,n=e.startOffset,i=e.endContainer,o=e.endOffset,s=t.domAtPos(t.state.selection.anchor);return Vl(s.node,s.offset,i,o)&&([r,n,i,o]=[i,o,r,n]),{anchorNode:r,anchorOffset:n,focusNode:i,focusOffset:o}}function GL(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return s_(t,i)}let r;function n(i){i.preventDefault(),i.stopImmediatePropagation(),r=i.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",n,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",n,!0),r?s_(t,r):null}function KL(t,e){for(let r=e.parentNode;r&&r!=t.dom;r=r.parentNode){let n=t.docView.nearestDesc(r,!0);if(n&&n.node.isBlock)return r}return null}function qL(t,e,r){let{node:n,fromOffset:i,toOffset:o,from:s,to:a}=t.docView.parseRange(e,r),l=t.domSelectionRange(),c,d=l.anchorNode;if(d&&t.dom.contains(d.nodeType==1?d:d.parentNode)&&(c=[{node:d,offset:l.anchorOffset}],_y(l)||c.push({node:l.focusNode,offset:l.focusOffset})),Vr&&t.input.lastKeyCode===8)for(let S=o;S>i;S--){let w=n.childNodes[S-1],T=w.pmViewDesc;if(w.nodeName=="BR"&&!T){o=S;break}if(!T||T.size)break}let f=t.state.doc,p=t.someProp("domParser")||Xf.fromSchema(t.state.schema),m=f.resolve(s),g=null,b=p.parse(n,{topNode:m.parent,topMatch:m.parent.contentMatchAt(m.index()),topOpen:!0,from:i,to:o,preserveWhitespace:m.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:XL,context:m});if(c&&c[0].pos!=null){let S=c[0].pos,w=c[1]&&c[1].pos;w==null&&(w=S),g={anchor:S+s,head:w+s}}return{doc:b,sel:g,from:s,to:a}}function XL(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(pn&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let r=document.createElement("div");return r.appendChild(document.createElement("li")),{skip:r}}else if(t.parentNode.lastChild==t||pn&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const YL=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function JL(t,e,r,n,i){let o=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let P=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,fe=T1(t,P);if(fe&&!t.state.selection.eq(fe)){if(Vr&&rs&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",U=>U(t,Cl(13,"Enter"))))return;let de=t.state.tr.setSelection(fe);P=="pointer"?de.setMeta("pointer",!0):P=="key"&&de.scrollIntoView(),o&&de.setMeta("composition",o),t.dispatch(de)}return}let s=t.state.doc.resolve(e),a=s.sharedDepth(r);e=s.before(a+1),r=t.state.doc.resolve(r).after(a+1);let l=t.state.selection,c=qL(t,e,r),d=t.state.doc,f=d.slice(c.from,c.to),p,m;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(p=t.state.selection.to,m="end"):(p=t.state.selection.from,m="start"),t.input.lastKeyCode=null;let g=e5(f.content,c.doc.content,c.from,p,m);if(g&&t.input.domChangeCount++,(Xu&&t.input.lastIOSEnter>Date.now()-225||rs)&&i.some(P=>P.nodeType==1&&!YL.test(P.nodeName))&&(!g||g.endA>=g.endB)&&t.someProp("handleKeyDown",P=>P(t,Cl(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!g)if(n&&l instanceof et&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))g={start:l.from,endA:l.to,endB:l.to};else{if(c.sel){let P=a_(t,t.state.doc,c.sel);if(P&&!P.eq(t.state.selection)){let fe=t.state.tr.setSelection(P);o&&fe.setMeta("composition",o),t.dispatch(fe)}}return}t.state.selection.from<t.state.selection.to&&g.start==g.endB&&t.state.selection instanceof et&&(g.start>t.state.selection.from&&g.start<=t.state.selection.from+2&&t.state.selection.from>=c.from?g.start=t.state.selection.from:g.endA<t.state.selection.to&&g.endA>=t.state.selection.to-2&&t.state.selection.to<=c.to&&(g.endB+=t.state.selection.to-g.endA,g.endA=t.state.selection.to)),On&&ga<=11&&g.endB==g.start+1&&g.endA==g.start&&g.start>c.from&&c.doc.textBetween(g.start-c.from-1,g.start-c.from+1)==" "&&(g.start--,g.endA--,g.endB--);let b=c.doc.resolveNoCache(g.start-c.from),S=c.doc.resolveNoCache(g.endB-c.from),w=d.resolve(g.start),T=b.sameParent(S)&&b.parent.inlineContent&&w.end()>=g.endA,M;if((Xu&&t.input.lastIOSEnter>Date.now()-225&&(!T||i.some(P=>P.nodeName=="DIV"||P.nodeName=="P"))||!T&&b.pos<c.doc.content.size&&!b.sameParent(S)&&(M=ot.findFrom(c.doc.resolve(b.pos+1),1,!0))&&M.head==S.pos)&&t.someProp("handleKeyDown",P=>P(t,Cl(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>g.start&&QL(d,g.start,g.endA,b,S)&&t.someProp("handleKeyDown",P=>P(t,Cl(8,"Backspace")))){rs&&Vr&&t.domObserver.suppressSelectionUpdates();return}Vr&&g.endB==g.start&&(t.input.lastChromeDelete=Date.now()),rs&&!T&&b.start()!=S.start()&&S.parentOffset==0&&b.depth==S.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==g.endA&&(g.endB-=2,S=c.doc.resolveNoCache(g.endB-c.from),setTimeout(()=>{t.someProp("handleKeyDown",function(P){return P(t,Cl(13,"Enter"))})},20));let j=g.start,$=g.endA,W,Y,ee;if(T){if(b.pos==S.pos)On&&ga<=11&&b.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>cs(t),20)),W=t.state.tr.delete(j,$),Y=d.resolve(g.start).marksAcross(d.resolve(g.endA));else if(g.endA==g.endB&&(ee=ZL(b.parent.content.cut(b.parentOffset,S.parentOffset),w.parent.content.cut(w.parentOffset,g.endA-w.start()))))W=t.state.tr,ee.type=="add"?W.addMark(j,$,ee.mark):W.removeMark(j,$,ee.mark);else if(b.parent.child(b.index()).isText&&b.index()==S.index()-(S.textOffset?0:1)){let P=b.parent.textBetween(b.parentOffset,S.parentOffset);if(t.someProp("handleTextInput",fe=>fe(t,j,$,P)))return;W=t.state.tr.insertText(P,j,$)}}if(W||(W=t.state.tr.replace(j,$,c.doc.slice(g.start-c.from,g.endB-c.from))),c.sel){let P=a_(t,W.doc,c.sel);P&&!(Vr&&t.composing&&P.empty&&(g.start!=g.endB||t.input.lastChromeDelete<Date.now()-100)&&(P.head==j||P.head==W.mapping.map($)-1)||On&&P.empty&&P.head==j)&&W.setSelection(P)}Y&&W.ensureMarks(Y),o&&W.setMeta("composition",o),t.dispatch(W.scrollIntoView())}function a_(t,e,r){return Math.max(r.anchor,r.head)>e.content.size?null:A1(t,e.resolve(r.anchor),e.resolve(r.head))}function ZL(t,e){let r=t.firstChild.marks,n=e.firstChild.marks,i=r,o=n,s,a,l;for(let d=0;d<n.length;d++)i=n[d].removeFromSet(i);for(let d=0;d<r.length;d++)o=r[d].removeFromSet(o);if(i.length==1&&o.length==0)a=i[0],s="add",l=d=>d.mark(a.addToSet(d.marks));else if(i.length==0&&o.length==1)a=o[0],s="remove",l=d=>d.mark(a.removeFromSet(d.marks));else return null;let c=[];for(let d=0;d<e.childCount;d++)c.push(l(e.child(d)));if(Le.from(c).eq(t))return{mark:a,type:s}}function QL(t,e,r,n,i){if(r-e<=i.pos-n.pos||Sb(n,!0,!1)<i.pos)return!1;let o=t.resolve(e);if(!n.parent.isTextblock){let a=o.nodeAfter;return a!=null&&r==e+a.nodeSize}if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let s=t.resolve(Sb(o,!0,!0));return!s.parent.isTextblock||s.pos>r||Sb(s,!0,!1)<r?!1:n.parent.content.cut(n.parentOffset).eq(s.parent.content)}function Sb(t,e,r){let n=t.depth,i=e?t.end():t.pos;for(;n>0&&(e||t.indexAfter(n)==t.node(n).childCount);)n--,i++,e=!1;if(r){let o=t.node(n).maybeChild(t.indexAfter(n));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function e5(t,e,r,n,i){let o=t.findDiffStart(e,r);if(o==null)return null;let{a:s,b:a}=t.findDiffEnd(e,r+t.size,r+e.size);if(i=="end"){let l=Math.max(0,o-Math.min(s,a));n-=s+l-o}if(s<o&&t.size<e.size){let l=n<=o&&n>=s?o-n:0;o-=l,o&&o<e.size&&l_(e.textBetween(o-1,o+1))&&(o+=l?1:-1),a=o+(a-s),s=o}else if(a<o){let l=n<=o&&n>=a?o-n:0;o-=l,o&&o<t.size&&l_(t.textBetween(o-1,o+1))&&(o+=l?1:-1),s=o+(s-a),a=o}return{start:o,endA:s,endB:a}}function l_(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),r=t.charCodeAt(1);return e>=56320&&e<=57343&&r>=55296&&r<=56319}class t5{constructor(e,r){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new wL,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=r,this.state=r.state,this.directPlugins=r.plugins||[],this.directPlugins.forEach(h_),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=d_(this),u_(this),this.nodeViews=f_(this),this.docView=Uk(this.state.doc,c_(this),xb(this),this.dom,this),this.domObserver=new WL(this,(n,i,o,s)=>JL(this,n,i,o,s)),this.domObserver.start(),xL(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let r in e)this._props[r]=e[r];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&$0(this);let r=this._props;this._props=e,e.plugins&&(e.plugins.forEach(h_),this.directPlugins=e.plugins),this.updateStateInner(e.state,r)}setProps(e){let r={};for(let n in this._props)r[n]=this._props[n];r.state=this.state;for(let n in e)r[n]=e[n];this.update(r)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,r){var n;let i=this.state,o=!1,s=!1;e.storedMarks&&this.composing&&(_I(this),s=!0),this.state=e;let a=i.plugins!=e.plugins||this._props.plugins!=r.plugins;if(a||this._props.plugins!=r.plugins||this._props.nodeViews!=r.nodeViews){let m=f_(this);n5(m,this.nodeViews)&&(this.nodeViews=m,o=!0)}(a||r.handleDOMEvents!=this._props.handleDOMEvents)&&$0(this),this.editable=d_(this),u_(this);let l=xb(this),c=c_(this),d=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",f=o||!this.docView.matchesNode(e.doc,c,l);(f||!e.selection.eq(i.selection))&&(s=!0);let p=d=="preserve"&&s&&this.dom.style.overflowAnchor==null&&PP(this);if(s){this.domObserver.stop();let m=f&&(On||Vr)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&r5(i.selection,e.selection);if(f){let g=Vr?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=DL(this)),(o||!this.docView.update(e.doc,c,l,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=Uk(e.doc,c,l,this.dom,this)),g&&!this.trackWrites&&(m=!0)}m||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&oL(this))?cs(this,m):(dI(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((n=this.dragging)===null||n===void 0)&&n.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),d=="reset"?this.dom.scrollTop=0:d=="to selection"?this.scrollToSelection():p&&LP(p)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",r=>r(this)))if(this.state.selection instanceof rt){let r=this.docView.domAfterPos(this.state.selection.from);r.nodeType==1&&Fk(this,r.getBoundingClientRect(),e)}else Fk(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let r=0;r<this.directPlugins.length;r++){let n=this.directPlugins[r];n.spec.view&&this.pluginViews.push(n.spec.view(this))}for(let r=0;r<this.state.plugins.length;r++){let n=this.state.plugins[r];n.spec.view&&this.pluginViews.push(n.spec.view(this))}}else for(let r=0;r<this.pluginViews.length;r++){let n=this.pluginViews[r];n.update&&n.update(this,e)}}updateDraggedNode(e,r){let n=e.node,i=-1;if(this.state.doc.nodeAt(n.from)==n.node)i=n.from;else{let o=n.from+(this.state.doc.content.size-r.doc.content.size);(o>0&&this.state.doc.nodeAt(o))==n.node&&(i=o)}this.dragging=new EI(e.slice,e.move,i<0?void 0:rt.create(this.state.doc,i))}someProp(e,r){let n=this._props&&this._props[e],i;if(n!=null&&(i=r?r(n):n))return i;for(let s=0;s<this.directPlugins.length;s++){let a=this.directPlugins[s].props[e];if(a!=null&&(i=r?r(a):a))return i}let o=this.state.plugins;if(o)for(let s=0;s<o.length;s++){let a=o[s].props[e];if(a!=null&&(i=r?r(a):a))return i}}hasFocus(){if(On){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&FP(this.dom),cs(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let r=this.dom.parentNode;r;r=r.parentNode)if(r.nodeType==9||r.nodeType==11&&r.host)return r.getSelection||(Object.getPrototypeOf(r).getSelection=()=>r.ownerDocument.getSelection()),this._root=r}return e||document}updateRoot(){this._root=null}posAtCoords(e){return $P(this,e)}coordsAtPos(e,r=1){return nI(this,e,r)}domAtPos(e,r=0){return this.docView.domFromPos(e,r)}nodeDOM(e){let r=this.docView.descAt(e);return r?r.nodeDOM:null}posAtDOM(e,r,n=-1){let i=this.docView.posFromDOM(e,r,n);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,r){return KP(this,r||this.state,e)}pasteHTML(e,r){return gh(this,"",e,!1,r||new ClipboardEvent("paste"))}pasteText(e,r){return gh(this,e,null,!0,r||new ClipboardEvent("paste"))}destroy(){this.docView&&(SL(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],xb(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,_P())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return _L(this,e)}dispatch(e){let r=this._props.dispatchTransaction;r?r.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){let e=this.domSelection();return e?pn&&this.root.nodeType===11&&RP(this.dom.ownerDocument)==this.dom&&GL(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function c_(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",r=>{if(typeof r=="function"&&(r=r(t.state)),r)for(let n in r)n=="class"?e.class+=" "+r[n]:n=="style"?e.style=(e.style?e.style+";":"")+r[n]:!e[n]&&n!="contenteditable"&&n!="nodeName"&&(e[n]=String(r[n]))}),e.translate||(e.translate="no"),[Qt.node(0,t.state.doc.content.size,e)]}function u_(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:Qt.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function d_(t){return!t.someProp("editable",e=>e(t.state)===!1)}function r5(t,e){let r=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(r)!=e.$anchor.start(r)}function f_(t){let e=Object.create(null);function r(n){for(let i in n)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=n[i])}return t.someProp("nodeViews",r),t.someProp("markViews",r),e}function n5(t,e){let r=0,n=0;for(let i in t){if(t[i]!=e[i])return!0;r++}for(let i in e)n++;return r!=n}function h_(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var wa={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},lg={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},i5=typeof navigator<"u"&&/Mac/.test(navigator.platform),o5=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var jr=0;jr<10;jr++)wa[48+jr]=wa[96+jr]=String(jr);for(var jr=1;jr<=24;jr++)wa[jr+111]="F"+jr;for(var jr=65;jr<=90;jr++)wa[jr]=String.fromCharCode(jr+32),lg[jr]=String.fromCharCode(jr);for(var kb in wa)lg.hasOwnProperty(kb)||(lg[kb]=wa[kb]);function s5(t){var e=i5&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||o5&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",r=!e&&t.key||(t.shiftKey?lg:wa)[t.keyCode]||t.key||"Unidentified";return r=="Esc"&&(r="Escape"),r=="Del"&&(r="Delete"),r=="Left"&&(r="ArrowLeft"),r=="Up"&&(r="ArrowUp"),r=="Right"&&(r="ArrowRight"),r=="Down"&&(r="ArrowDown"),r}const a5=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function l5(t){let e=t.split(/-(?!$)/),r=e[e.length-1];r=="Space"&&(r=" ");let n,i,o,s;for(let a=0;a<e.length-1;a++){let l=e[a];if(/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))n=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))o=!0;else if(/^mod$/i.test(l))a5?s=!0:i=!0;else throw new Error("Unrecognized modifier name: "+l)}return n&&(r="Alt-"+r),i&&(r="Ctrl-"+r),s&&(r="Meta-"+r),o&&(r="Shift-"+r),r}function c5(t){let e=Object.create(null);for(let r in t)e[l5(r)]=t[r];return e}function _b(t,e,r=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),r&&e.shiftKey&&(t="Shift-"+t),t}function u5(t){return new _t({props:{handleKeyDown:D1(t)}})}function D1(t){let e=c5(t);return function(r,n){let i=s5(n),o,s=e[_b(i,n)];if(s&&s(r.state,r.dispatch,r))return!0;if(i.length==1&&i!=" "){if(n.shiftKey){let a=e[_b(i,n,!1)];if(a&&a(r.state,r.dispatch,r))return!0}if((n.shiftKey||n.altKey||n.metaKey||i.charCodeAt(0)>127)&&(o=wa[n.keyCode])&&o!=i){let a=e[_b(o,n)];if(a&&a(r.state,r.dispatch,r))return!0}}return!1}}const Hh=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function OI(t,e){let{$cursor:r}=t.selection;return!r||(e?!e.endOfTextblock("backward",t):r.parentOffset>0)?null:r}const d5=(t,e,r)=>{let n=OI(t,r);if(!n)return!1;let i=P1(n);if(!i){let s=n.blockRange(),a=s&&yd(s);return a==null?!1:(e&&e(t.tr.lift(s,a).scrollIntoView()),!0)}let o=i.nodeBefore;if(PI(t,i,e,-1))return!0;if(n.parent.content.size==0&&(Yu(o,"end")||rt.isSelectable(o)))for(let s=n.depth;;s--){let a=Sy(t.doc,n.before(s),n.after(s),qe.empty);if(a&&a.slice.size<a.to-a.from){if(e){let l=t.tr.step(a);l.setSelection(Yu(o,"end")?ot.findFrom(l.doc.resolve(l.mapping.map(i.pos,-1)),-1):rt.create(l.doc,i.pos-o.nodeSize)),e(l.scrollIntoView())}return!0}if(s==1||n.node(s-1).childCount>1)break}return o.isAtom&&i.depth==n.depth-1?(e&&e(t.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1},f5=(t,e,r)=>{let n=OI(t,r);if(!n)return!1;let i=P1(n);return i?MI(t,i,e):!1},h5=(t,e,r)=>{let n=NI(t,r);if(!n)return!1;let i=L1(n);return i?MI(t,i,e):!1};function MI(t,e,r){let n=e.nodeBefore,i=n,o=e.pos-1;for(;!i.isTextblock;o--){if(i.type.spec.isolating)return!1;let d=i.lastChild;if(!d)return!1;i=d}let s=e.nodeAfter,a=s,l=e.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let d=a.firstChild;if(!d)return!1;a=d}let c=Sy(t.doc,o,l,qe.empty);if(!c||c.from!=o||c instanceof kr&&c.slice.size>=l-o)return!1;if(r){let d=t.tr.step(c);d.setSelection(et.create(d.doc,o)),r(d.scrollIntoView())}return!0}function Yu(t,e,r=!1){for(let n=t;n;n=e=="start"?n.firstChild:n.lastChild){if(n.isTextblock)return!0;if(r&&n.childCount!=1)return!1}return!1}const p5=(t,e,r)=>{let{$head:n,empty:i}=t.selection,o=n;if(!i)return!1;if(n.parent.isTextblock){if(r?!r.endOfTextblock("backward",t):n.parentOffset>0)return!1;o=P1(n)}let s=o&&o.nodeBefore;return!s||!rt.isSelectable(s)?!1:(e&&e(t.tr.setSelection(rt.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function P1(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function NI(t,e){let{$cursor:r}=t.selection;return!r||(e?!e.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)?null:r}const m5=(t,e,r)=>{let n=NI(t,r);if(!n)return!1;let i=L1(n);if(!i)return!1;let o=i.nodeAfter;if(PI(t,i,e,1))return!0;if(n.parent.content.size==0&&(Yu(o,"start")||rt.isSelectable(o))){let s=Sy(t.doc,n.before(),n.after(),qe.empty);if(s&&s.slice.size<s.to-s.from){if(e){let a=t.tr.step(s);a.setSelection(Yu(o,"start")?ot.findFrom(a.doc.resolve(a.mapping.map(i.pos)),1):rt.create(a.doc,a.mapping.map(i.pos))),e(a.scrollIntoView())}return!0}}return o.isAtom&&i.depth==n.depth-1?(e&&e(t.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0):!1},g5=(t,e,r)=>{let{$head:n,empty:i}=t.selection,o=n;if(!i)return!1;if(n.parent.isTextblock){if(r?!r.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)return!1;o=L1(n)}let s=o&&o.nodeAfter;return!s||!rt.isSelectable(s)?!1:(e&&e(t.tr.setSelection(rt.create(t.doc,o.pos)).scrollIntoView()),!0)};function L1(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let r=t.node(e);if(t.index(e)+1<r.childCount)return t.doc.resolve(t.after(e+1));if(r.type.spec.isolating)break}return null}const y5=(t,e)=>{let r=t.selection,n=r instanceof rt,i;if(n){if(r.node.isTextblock||!Ea(t.doc,r.from))return!1;i=r.from}else if(i=xy(t.doc,r.from,-1),i==null)return!1;if(e){let o=t.tr.join(i);n&&o.setSelection(rt.create(o.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},v5=(t,e)=>{let r=t.selection,n;if(r instanceof rt){if(r.node.isTextblock||!Ea(t.doc,r.to))return!1;n=r.to}else if(n=xy(t.doc,r.to,1),n==null)return!1;return e&&e(t.tr.join(n).scrollIntoView()),!0},b5=(t,e)=>{let{$from:r,$to:n}=t.selection,i=r.blockRange(n),o=i&&yd(i);return o==null?!1:(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)},w5=(t,e)=>{let{$head:r,$anchor:n}=t.selection;return!r.parent.type.spec.code||!r.sameParent(n)?!1:(e&&e(t.tr.insertText(`
|
|
10
|
+
`).scrollIntoView()),!0)};function DI(t){for(let e=0;e<t.edgeCount;e++){let{type:r}=t.edge(e);if(r.isTextblock&&!r.hasRequiredAttrs())return r}return null}const x5=(t,e)=>{let{$head:r,$anchor:n}=t.selection;if(!r.parent.type.spec.code||!r.sameParent(n))return!1;let i=r.node(-1),o=r.indexAfter(-1),s=DI(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let a=r.after(),l=t.tr.replaceWith(a,a,s.createAndFill());l.setSelection(ot.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},S5=(t,e)=>{let r=t.selection,{$from:n,$to:i}=r;if(r instanceof Gn||n.parent.inlineContent||i.parent.inlineContent)return!1;let o=DI(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let s=(!n.parentOffset&&i.index()<i.parent.childCount?n:i).pos,a=t.tr.insert(s,o.createAndFill());a.setSelection(et.create(a.doc,s+1)),e(a.scrollIntoView())}return!0},k5=(t,e)=>{let{$cursor:r}=t.selection;if(!r||r.parent.content.size)return!1;if(r.depth>1&&r.after()!=r.end(-1)){let o=r.before();if(Pu(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let n=r.blockRange(),i=n&&yd(n);return i==null?!1:(e&&e(t.tr.lift(n,i).scrollIntoView()),!0)},_5=(t,e)=>{let{$from:r,to:n}=t.selection,i,o=r.sharedDepth(n);return o==0?!1:(i=r.before(o),e&&e(t.tr.setSelection(rt.create(t.doc,i))),!0)};function C5(t,e,r){let n=e.nodeBefore,i=e.nodeAfter,o=e.index();return!n||!i||!n.type.compatibleContent(i.type)?!1:!n.content.size&&e.parent.canReplace(o-1,o)?(r&&r(t.tr.delete(e.pos-n.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||Ea(t.doc,e.pos))?!1:(r&&r(t.tr.join(e.pos).scrollIntoView()),!0)}function PI(t,e,r,n){let i=e.nodeBefore,o=e.nodeAfter,s,a,l=i.type.spec.isolating||o.type.spec.isolating;if(!l&&C5(t,e,r))return!0;let c=!l&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(s=(a=i.contentMatchAt(i.childCount)).findWrapping(o.type))&&a.matchType(s[0]||o.type).validEnd){if(r){let m=e.pos+o.nodeSize,g=Le.empty;for(let w=s.length-1;w>=0;w--)g=Le.from(s[w].create(null,g));g=Le.from(i.copy(g));let b=t.tr.step(new _r(e.pos-1,m,e.pos,m,new qe(g,1,0),s.length,!0)),S=b.doc.resolve(m+2*s.length);S.nodeAfter&&S.nodeAfter.type==i.type&&Ea(b.doc,S.pos)&&b.join(S.pos),r(b.scrollIntoView())}return!0}let d=o.type.spec.isolating||n>0&&l?null:ot.findFrom(e,1),f=d&&d.$from.blockRange(d.$to),p=f&&yd(f);if(p!=null&&p>=e.depth)return r&&r(t.tr.lift(f,p).scrollIntoView()),!0;if(c&&Yu(o,"start",!0)&&Yu(i,"end")){let m=i,g=[];for(;g.push(m),!m.isTextblock;)m=m.lastChild;let b=o,S=1;for(;!b.isTextblock;b=b.firstChild)S++;if(m.canReplace(m.childCount,m.childCount,b.content)){if(r){let w=Le.empty;for(let M=g.length-1;M>=0;M--)w=Le.from(g[M].copy(w));let T=t.tr.step(new _r(e.pos-g.length,e.pos+o.nodeSize,e.pos+S,e.pos+o.nodeSize-S,new qe(w,g.length,0),0,!0));r(T.scrollIntoView())}return!0}}return!1}function LI(t){return function(e,r){let n=e.selection,i=t<0?n.$from:n.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(r&&r(e.tr.setSelection(et.create(e.doc,t<0?i.start(o):i.end(o)))),!0):!1}}const E5=LI(-1),T5=LI(1);function A5(t,e=null){return function(r,n){let{$from:i,$to:o}=r.selection,s=i.blockRange(o),a=s&&S1(s,t,e);return a?(n&&n(r.tr.wrap(s,a).scrollIntoView()),!0):!1}}function p_(t,e=null){return function(r,n){let i=!1;for(let o=0;o<r.selection.ranges.length&&!i;o++){let{$from:{pos:s},$to:{pos:a}}=r.selection.ranges[o];r.doc.nodesBetween(s,a,(l,c)=>{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)i=!0;else{let d=r.doc.resolve(c),f=d.index();i=d.parent.canReplaceWith(f,f+1,t)}})}if(!i)return!1;if(n){let o=r.tr;for(let s=0;s<r.selection.ranges.length;s++){let{$from:{pos:a},$to:{pos:l}}=r.selection.ranges[s];o.setBlockType(a,l,t,e)}n(o.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function R5(t,e=null){return function(r,n){let{$from:i,$to:o}=r.selection,s=i.blockRange(o),a=!1,l=s;if(!s)return!1;if(s.depth>=2&&i.node(s.depth-1).type.compatibleContent(t)&&s.startIndex==0){if(i.index(s.depth-1)==0)return!1;let d=r.doc.resolve(s.start-2);l=new dh(d,d,s.depth),s.endIndex<s.parent.childCount&&(s=new dh(i,r.doc.resolve(o.end(s.depth)),s.depth)),a=!0}let c=S1(l,t,e,s);return c?(n&&n(I5(r.tr,s,c,a,t).scrollIntoView()),!0):!1}}function I5(t,e,r,n,i){let o=Le.empty;for(let d=r.length-1;d>=0;d--)o=Le.from(r[d].type.create(r[d].attrs,o));t.step(new _r(e.start-(n?2:0),e.end,e.start,e.end,new qe(o,0,0),r.length,!0));let s=0;for(let d=0;d<r.length;d++)r[d].type==i&&(s=d+1);let a=r.length-s,l=e.start+r.length-(n?2:0),c=e.parent;for(let d=e.startIndex,f=e.endIndex,p=!0;d<f;d++,p=!1)!p&&Pu(t.doc,l,a)&&(t.split(l,a),l+=2*a),l+=c.child(d).nodeSize;return t}function O5(t){return function(e,r){let{$from:n,$to:i}=e.selection,o=n.blockRange(i,s=>s.childCount>0&&s.firstChild.type==t);return o?r?n.node(o.depth-1).type==t?M5(e,r,t,o):N5(e,r,o):!0:!1}}function M5(t,e,r,n){let i=t.tr,o=n.end,s=n.$to.end(n.depth);o<s&&(i.step(new _r(o-1,s,o,s,new qe(Le.from(r.create(null,n.parent.copy())),1,0),1,!0)),n=new dh(i.doc.resolve(n.$from.pos),i.doc.resolve(s),n.depth));const a=yd(n);if(a==null)return!1;i.lift(n,a);let l=i.mapping.map(o,-1)-1;return Ea(i.doc,l)&&i.join(l),e(i.scrollIntoView()),!0}function N5(t,e,r){let n=t.tr,i=r.parent;for(let m=r.end,g=r.endIndex-1,b=r.startIndex;g>b;g--)m-=i.child(g).nodeSize,n.delete(m-1,m+1);let o=n.doc.resolve(r.start),s=o.nodeAfter;if(n.mapping.map(r.end)!=r.start+o.nodeAfter.nodeSize)return!1;let a=r.startIndex==0,l=r.endIndex==i.childCount,c=o.node(-1),d=o.index(-1);if(!c.canReplace(d+(a?0:1),d+1,s.content.append(l?Le.empty:Le.from(i))))return!1;let f=o.pos,p=f+s.nodeSize;return n.step(new _r(f-(a?1:0),p+(l?1:0),f+1,p-1,new qe((a?Le.empty:Le.from(i.copy(Le.empty))).append(l?Le.empty:Le.from(i.copy(Le.empty))),a?0:1,l?0:1),a?0:1)),e(n.scrollIntoView()),!0}function D5(t){return function(e,r){let{$from:n,$to:i}=e.selection,o=n.blockRange(i,c=>c.childCount>0&&c.firstChild.type==t);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let a=o.parent,l=a.child(s-1);if(l.type!=t)return!1;if(r){let c=l.lastChild&&l.lastChild.type==a.type,d=Le.from(c?t.create():null),f=new qe(Le.from(t.create(null,Le.from(a.type.create(null,d)))),c?3:1,0),p=o.start,m=o.end;r(e.tr.step(new _r(p-(c?3:1),m,p,m,f,1,!0)).scrollIntoView())}return!0}}function Ty(t){const{state:e,transaction:r}=t;let{selection:n}=r,{doc:i}=r,{storedMarks:o}=r;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return o},get selection(){return n},get doc(){return i},get tr(){return n=r.selection,i=r.doc,o=r.storedMarks,r}}}class Ay{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:r,state:n}=this,{view:i}=r,{tr:o}=n,s=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...d)=>{const f=l(...d)(s);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),f}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,r=!0){const{rawCommands:n,editor:i,state:o}=this,{view:s}=i,a=[],l=!!e,c=e||o.tr,d=()=>(!l&&r&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(c),a.every(p=>p===!0)),f={...Object.fromEntries(Object.entries(n).map(([p,m])=>[p,(...b)=>{const S=this.buildProps(c,r),w=m(...b)(S);return a.push(w),f}])),run:d};return f}createCan(e){const{rawCommands:r,state:n}=this,i=!1,o=e||n.tr,s=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(r).map(([l,c])=>[l,(...d)=>c(...d)({...s,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(e,r=!0){const{rawCommands:n,editor:i,state:o}=this,{view:s}=i,a={tr:e,editor:i,view:s,state:Ty({state:o,transaction:e}),dispatch:r?()=>{}:void 0,chain:()=>this.createChain(e,r),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([l,c])=>[l,(...d)=>c(...d)(a)]))}};return a}}let P5=class{constructor(){this.callbacks={}}on(e,r){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(r),this}emit(e,...r){const n=this.callbacks[e];return n&&n.forEach(i=>i.apply(this,r)),this}off(e,r){const n=this.callbacks[e];return n&&(r?this.callbacks[e]=n.filter(i=>i!==r):delete this.callbacks[e]),this}once(e,r){const n=(...i)=>{this.off(e,n),r.apply(this,i)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}};function Ze(t,e,r){return t.config[e]===void 0&&t.parent?Ze(t.parent,e,r):typeof t.config[e]=="function"?t.config[e].bind({...r,parent:t.parent?Ze(t.parent,e,r):null}):t.config[e]}function Ry(t){const e=t.filter(i=>i.type==="extension"),r=t.filter(i=>i.type==="node"),n=t.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:r,markExtensions:n}}function FI(t){const e=[],{nodeExtensions:r,markExtensions:n}=Ry(t),i=[...r,...n],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage,extensions:i},l=Ze(s,"addGlobalAttributes",a);if(!l)return;l().forEach(d=>{d.types.forEach(f=>{Object.entries(d.attributes).forEach(([p,m])=>{e.push({type:f,name:p,attribute:{...o,...m}})})})})}),i.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage},l=Ze(s,"addAttributes",a);if(!l)return;const c=l();Object.entries(c).forEach(([d,f])=>{const p={...o,...f};typeof(p==null?void 0:p.default)=="function"&&(p.default=p.default()),p!=null&&p.isRequired&&(p==null?void 0:p.default)===void 0&&delete p.default,e.push({type:s.name,name:d,attribute:p})})}),e}function Er(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function lt(...t){return t.filter(e=>!!e).reduce((e,r)=>{const n={...e};return Object.entries(r).forEach(([i,o])=>{if(!n[i]){n[i]=o;return}if(i==="class"){const a=o?o.split(" "):[],l=n[i]?n[i].split(" "):[],c=a.filter(d=>!l.includes(d));n[i]=[...l,...c].join(" ")}else if(i==="style"){const a=o?o.split(";").map(d=>d.trim()).filter(Boolean):[],l=n[i]?n[i].split(";").map(d=>d.trim()).filter(Boolean):[],c=new Map;l.forEach(d=>{const[f,p]=d.split(":").map(m=>m.trim());c.set(f,p)}),a.forEach(d=>{const[f,p]=d.split(":").map(m=>m.trim());c.set(f,p)}),n[i]=Array.from(c.entries()).map(([d,f])=>`${d}: ${f}`).join("; ")}else n[i]=o}),n},{})}function cg(t,e){return e.filter(r=>r.type===t.type.name).filter(r=>r.attribute.rendered).map(r=>r.attribute.renderHTML?r.attribute.renderHTML(t.attrs)||{}:{[r.name]:t.attrs[r.name]}).reduce((r,n)=>lt(r,n),{})}function jI(t){return typeof t=="function"}function dt(t,e=void 0,...r){return jI(t)?e?t.bind(e)(...r):t(...r):t}function L5(t={}){return Object.keys(t).length===0&&t.constructor===Object}function F5(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function m_(t,e){return"style"in t?t:{...t,getAttrs:r=>{const n=t.getAttrs?t.getAttrs(r):t.attrs;if(n===!1)return!1;const i=e.reduce((o,s)=>{const a=s.attribute.parseHTML?s.attribute.parseHTML(r):F5(r.getAttribute(s.name));return a==null?o:{...o,[s.name]:a}},{});return{...n,...i}}}}function g_(t){return Object.fromEntries(Object.entries(t).filter(([e,r])=>e==="attrs"&&L5(r)?!1:r!=null))}function j5(t,e){var r;const n=FI(t),{nodeExtensions:i,markExtensions:o}=Ry(t),s=(r=i.find(c=>Ze(c,"topNode")))===null||r===void 0?void 0:r.name,a=Object.fromEntries(i.map(c=>{const d=n.filter(w=>w.type===c.name),f={name:c.name,options:c.options,storage:c.storage,editor:e},p=t.reduce((w,T)=>{const M=Ze(T,"extendNodeSchema",f);return{...w,...M?M(c):{}}},{}),m=g_({...p,content:dt(Ze(c,"content",f)),marks:dt(Ze(c,"marks",f)),group:dt(Ze(c,"group",f)),inline:dt(Ze(c,"inline",f)),atom:dt(Ze(c,"atom",f)),selectable:dt(Ze(c,"selectable",f)),draggable:dt(Ze(c,"draggable",f)),code:dt(Ze(c,"code",f)),whitespace:dt(Ze(c,"whitespace",f)),linebreakReplacement:dt(Ze(c,"linebreakReplacement",f)),defining:dt(Ze(c,"defining",f)),isolating:dt(Ze(c,"isolating",f)),attrs:Object.fromEntries(d.map(w=>{var T;return[w.name,{default:(T=w==null?void 0:w.attribute)===null||T===void 0?void 0:T.default}]}))}),g=dt(Ze(c,"parseHTML",f));g&&(m.parseDOM=g.map(w=>m_(w,d)));const b=Ze(c,"renderHTML",f);b&&(m.toDOM=w=>b({node:w,HTMLAttributes:cg(w,d)}));const S=Ze(c,"renderText",f);return S&&(m.toText=S),[c.name,m]})),l=Object.fromEntries(o.map(c=>{const d=n.filter(S=>S.type===c.name),f={name:c.name,options:c.options,storage:c.storage,editor:e},p=t.reduce((S,w)=>{const T=Ze(w,"extendMarkSchema",f);return{...S,...T?T(c):{}}},{}),m=g_({...p,inclusive:dt(Ze(c,"inclusive",f)),excludes:dt(Ze(c,"excludes",f)),group:dt(Ze(c,"group",f)),spanning:dt(Ze(c,"spanning",f)),code:dt(Ze(c,"code",f)),attrs:Object.fromEntries(d.map(S=>{var w;return[S.name,{default:(w=S==null?void 0:S.attribute)===null||w===void 0?void 0:w.default}]}))}),g=dt(Ze(c,"parseHTML",f));g&&(m.parseDOM=g.map(S=>m_(S,d)));const b=Ze(c,"renderHTML",f);return b&&(m.toDOM=S=>b({mark:S,HTMLAttributes:cg(S,d)})),[c.name,m]}));return new NR({topNode:s,nodes:a,marks:l})}function Cb(t,e){return e.nodes[t]||e.marks[t]||null}function y_(t,e){return Array.isArray(e)?e.some(r=>(typeof r=="string"?r:r.name)===t.name):e}function F1(t,e){const r=nc.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(r),i.innerHTML}const B5=(t,e=500)=>{let r="";const n=t.parentOffset;return t.parent.nodesBetween(Math.max(0,n-e),n,(i,o,s,a)=>{var l,c;const d=((c=(l=i.type.spec).toText)===null||c===void 0?void 0:c.call(l,{node:i,pos:o,parent:s,index:a}))||i.textContent||"%leaf%";r+=i.isAtom&&!i.isText?d:d.slice(0,Math.max(0,n-o))}),r};function j1(t){return Object.prototype.toString.call(t)==="[object RegExp]"}class Iy{constructor(e){this.find=e.find,this.handler=e.handler}}const z5=(t,e)=>{if(j1(e))return e.exec(t);const r=e(t);if(!r)return null;const n=[r.text];return n.index=r.index,n.input=t,n.data=r.data,r.replaceWith&&(r.text.includes(r.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),n.push(r.replaceWith)),n};function $p(t){var e;const{editor:r,from:n,to:i,text:o,rules:s,plugin:a}=t,{view:l}=r;if(l.composing)return!1;const c=l.state.doc.resolve(n);if(c.parent.type.spec.code||!((e=c.nodeBefore||c.nodeAfter)===null||e===void 0)&&e.marks.find(p=>p.type.spec.code))return!1;let d=!1;const f=B5(c)+o;return s.forEach(p=>{if(d)return;const m=z5(f,p.find);if(!m)return;const g=l.state.tr,b=Ty({state:l.state,transaction:g}),S={from:n-(m[0].length-o.length),to:i},{commands:w,chain:T,can:M}=new Ay({editor:r,state:b});p.handler({state:b,range:S,match:m,commands:w,chain:T,can:M})===null||!g.steps.length||(g.setMeta(a,{transform:g,from:n,to:i,text:o}),l.dispatch(g),d=!0)}),d}function H5(t){const{editor:e,rules:r}=t,n=new _t({state:{init(){return null},apply(i,o,s){const a=i.getMeta(n);if(a)return a;const l=i.getMeta("applyInputRules");return!!l&&setTimeout(()=>{let{text:d}=l;typeof d=="string"?d=d:d=F1(Le.from(d),s.schema);const{from:f}=l,p=f+d.length;$p({editor:e,from:f,to:p,text:d,rules:r,plugin:n})}),i.selectionSet||i.docChanged?null:o}},props:{handleTextInput(i,o,s,a){return $p({editor:e,from:o,to:s,text:a,rules:r,plugin:n})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&$p({editor:e,from:o.pos,to:o.pos,text:"",rules:r,plugin:n})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;const{$cursor:s}=i.state.selection;return s?$p({editor:e,from:s.pos,to:s.pos,text:`
|
|
11
|
+
`,rules:r,plugin:n}):!1}},isInputRules:!0});return n}function $5(t){return Object.prototype.toString.call(t).slice(8,-1)}function Up(t){return $5(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function Oy(t,e){const r={...t};return Up(t)&&Up(e)&&Object.keys(e).forEach(n=>{Up(e[n])&&Up(t[n])?r[n]=Oy(t[n],e[n]):r[n]=e[n]}),r}class Mn{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=dt(Ze(this,"addOptions",{name:this.name}))),this.storage=dt(Ze(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Mn(e)}configure(e={}){const r=this.extend({...this.config,addOptions:()=>Oy(this.options,e)});return r.name=this.name,r.parent=this.parent,r}extend(e={}){const r=new Mn(e);return r.parent=this,this.child=r,r.name=e.name?e.name:r.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${r.name}".`),r.options=dt(Ze(r,"addOptions",{name:r.name})),r.storage=dt(Ze(r,"addStorage",{name:r.name,options:r.options})),r}static handleExit({editor:e,mark:r}){const{tr:n}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const s=i.marks();if(!!!s.find(c=>(c==null?void 0:c.type.name)===r.name))return!1;const l=s.find(c=>(c==null?void 0:c.type.name)===r.name);return l&&n.removeStoredMark(l),n.insertText(" ",i.pos),e.view.dispatch(n),!0}return!1}}function U0(t){return typeof t=="number"}class BI{constructor(e){this.find=e.find,this.handler=e.handler}}const U5=(t,e,r)=>{if(j1(e))return[...t.matchAll(e)];const n=e(t,r);return n?n.map(i=>{const o=[i.text];return o.index=i.index,o.input=t,o.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(i.replaceWith)),o}):[]};function W5(t){const{editor:e,state:r,from:n,to:i,rule:o,pasteEvent:s,dropEvent:a}=t,{commands:l,chain:c,can:d}=new Ay({editor:e,state:r}),f=[];return r.doc.nodesBetween(n,i,(m,g)=>{if(!m.isTextblock||m.type.spec.code)return;const b=Math.max(n,g),S=Math.min(i,g+m.content.size),w=m.textBetween(b-g,S-g,void 0,"");U5(w,o.find,s).forEach(M=>{if(M.index===void 0)return;const j=b+M.index+1,$=j+M[0].length,W={from:r.tr.mapping.map(j),to:r.tr.mapping.map($)},Y=o.handler({state:r,range:W,match:M,commands:l,chain:c,can:d,pasteEvent:s,dropEvent:a});f.push(Y)})}),f.every(m=>m!==null)}const V5=t=>{var e;const r=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=r.clipboardData)===null||e===void 0||e.setData("text/html",t),r};function G5(t){const{editor:e,rules:r}=t;let n=null,i=!1,o=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a;try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}const l=({state:d,from:f,to:p,rule:m,pasteEvt:g})=>{const b=d.tr,S=Ty({state:d,transaction:b});if(!(!W5({editor:e,state:S,from:Math.max(f-1,0),to:p.b-1,rule:m,pasteEvent:g,dropEvent:a})||!b.steps.length)){try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}return s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,b}};return r.map(d=>new _t({view(f){const p=m=>{var g;n=!((g=f.dom.parentElement)===null||g===void 0)&&g.contains(m.target)?f.dom.parentElement:null};return window.addEventListener("dragstart",p),{destroy(){window.removeEventListener("dragstart",p)}}},props:{handleDOMEvents:{drop:(f,p)=>(o=n===f.dom.parentElement,a=p,!1),paste:(f,p)=>{var m;const g=(m=p.clipboardData)===null||m===void 0?void 0:m.getData("text/html");return s=p,i=!!(g!=null&&g.includes("data-pm-slice")),!1}}},appendTransaction:(f,p,m)=>{const g=f[0],b=g.getMeta("uiEvent")==="paste"&&!i,S=g.getMeta("uiEvent")==="drop"&&!o,w=g.getMeta("applyPasteRules"),T=!!w;if(!b&&!S&&!T)return;if(T){let{text:$}=w;typeof $=="string"?$=$:$=F1(Le.from($),m.schema);const{from:W}=w,Y=W+$.length,ee=V5($);return l({rule:d,state:m,from:W,to:{b:Y},pasteEvt:ee})}const M=p.doc.content.findDiffStart(m.doc.content),j=p.doc.content.findDiffEnd(m.doc.content);if(!(!U0(M)||!j||M===j.b))return l({rule:d,state:m,from:M,to:j,pasteEvt:s})}}))}function K5(t){const e=t.filter((r,n)=>t.indexOf(r)!==n);return Array.from(new Set(e))}class Mu{constructor(e,r){this.splittableMarks=[],this.editor=r,this.extensions=Mu.resolve(e),this.schema=j5(this.extensions,r),this.setupExtensions()}static resolve(e){const r=Mu.sort(Mu.flatten(e)),n=K5(r.map(i=>i.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),r}static flatten(e){return e.map(r=>{const n={name:r.name,options:r.options,storage:r.storage},i=Ze(r,"addExtensions",n);return i?[r,...this.flatten(i())]:r}).flat(10)}static sort(e){return e.sort((n,i)=>{const o=Ze(n,"priority")||100,s=Ze(i,"priority")||100;return o>s?-1:o<s?1:0})}get commands(){return this.extensions.reduce((e,r)=>{const n={name:r.name,options:r.options,storage:r.storage,editor:this.editor,type:Cb(r.name,this.schema)},i=Ze(r,"addCommands",n);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,r=Mu.sort([...this.extensions].reverse()),n=[],i=[],o=r.map(s=>{const a={name:s.name,options:s.options,storage:s.storage,editor:e,type:Cb(s.name,this.schema)},l=[],c=Ze(s,"addKeyboardShortcuts",a);let d={};if(s.type==="mark"&&Ze(s,"exitable",a)&&(d.ArrowRight=()=>Mn.handleExit({editor:e,mark:s})),c){const b=Object.fromEntries(Object.entries(c()).map(([S,w])=>[S,()=>w({editor:e})]));d={...d,...b}}const f=u5(d);l.push(f);const p=Ze(s,"addInputRules",a);y_(s,e.options.enableInputRules)&&p&&n.push(...p());const m=Ze(s,"addPasteRules",a);y_(s,e.options.enablePasteRules)&&m&&i.push(...m());const g=Ze(s,"addProseMirrorPlugins",a);if(g){const b=g();l.push(...b)}return l}).flat();return[H5({editor:e,rules:n}),...G5({editor:e,rules:i}),...o]}get attributes(){return FI(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:r}=Ry(this.extensions);return Object.fromEntries(r.filter(n=>!!Ze(n,"addNodeView")).map(n=>{const i=this.attributes.filter(l=>l.type===n.name),o={name:n.name,options:n.options,storage:n.storage,editor:e,type:Er(n.name,this.schema)},s=Ze(n,"addNodeView",o);if(!s)return[];const a=(l,c,d,f,p)=>{const m=cg(l,i);return s()({node:l,view:c,getPos:d,decorations:f,innerDecorations:p,editor:e,extension:n,HTMLAttributes:m})};return[n.name,a]}))}setupExtensions(){this.extensions.forEach(e=>{var r;this.editor.extensionStorage[e.name]=e.storage;const n={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:Cb(e.name,this.schema)};e.type==="mark"&&(!((r=dt(Ze(e,"keepOnSplit",n)))!==null&&r!==void 0)||r)&&this.splittableMarks.push(e.name);const i=Ze(e,"onBeforeCreate",n),o=Ze(e,"onCreate",n),s=Ze(e,"onUpdate",n),a=Ze(e,"onSelectionUpdate",n),l=Ze(e,"onTransaction",n),c=Ze(e,"onFocus",n),d=Ze(e,"onBlur",n),f=Ze(e,"onDestroy",n);i&&this.editor.on("beforeCreate",i),o&&this.editor.on("create",o),s&&this.editor.on("update",s),a&&this.editor.on("selectionUpdate",a),l&&this.editor.on("transaction",l),c&&this.editor.on("focus",c),d&&this.editor.on("blur",d),f&&this.editor.on("destroy",f)})}}class yt{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=dt(Ze(this,"addOptions",{name:this.name}))),this.storage=dt(Ze(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new yt(e)}configure(e={}){const r=this.extend({...this.config,addOptions:()=>Oy(this.options,e)});return r.name=this.name,r.parent=this.parent,r}extend(e={}){const r=new yt({...this.config,...e});return r.parent=this,this.child=r,r.name=e.name?e.name:r.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${r.name}".`),r.options=dt(Ze(r,"addOptions",{name:r.name})),r.storage=dt(Ze(r,"addStorage",{name:r.name,options:r.options})),r}}function zI(t,e,r){const{from:n,to:i}=e,{blockSeparator:o=`
|
|
12
|
+
|
|
13
|
+
`,textSerializers:s={}}=r||{};let a="";return t.nodesBetween(n,i,(l,c,d,f)=>{var p;l.isBlock&&c>n&&(a+=o);const m=s==null?void 0:s[l.type.name];if(m)return d&&(a+=m({node:l,pos:c,parent:d,index:f,range:e})),!1;l.isText&&(a+=(p=l==null?void 0:l.text)===null||p===void 0?void 0:p.slice(Math.max(n,c)-c,i-c))}),a}function HI(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,r])=>[e,r.spec.toText]))}const q5=yt.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new _t({key:new St("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:r}=t,{doc:n,selection:i}=e,{ranges:o}=i,s=Math.min(...o.map(d=>d.$from.pos)),a=Math.max(...o.map(d=>d.$to.pos)),l=HI(r);return zI(n,{from:s,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),X5=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var r;t.isDestroyed||(e.dom.blur(),(r=window==null?void 0:window.getSelection())===null||r===void 0||r.removeAllRanges())}),!0),Y5=(t=!1)=>({commands:e})=>e.setContent("",t),J5=()=>({state:t,tr:e,dispatch:r})=>{const{selection:n}=e,{ranges:i}=n;return r&&i.forEach(({$from:o,$to:s})=>{t.doc.nodesBetween(o.pos,s.pos,(a,l)=>{if(a.type.isText)return;const{doc:c,mapping:d}=e,f=c.resolve(d.map(l)),p=c.resolve(d.map(l+a.nodeSize)),m=f.blockRange(p);if(!m)return;const g=yd(m);if(a.type.isTextblock){const{defaultType:b}=f.parent.contentMatchAt(f.index());e.setNodeMarkup(m.start,b)}(g||g===0)&&e.lift(m,g)})}),!0},Z5=t=>e=>t(e),Q5=()=>({state:t,dispatch:e})=>S5(t,e),e6=(t,e)=>({editor:r,tr:n})=>{const{state:i}=r,o=i.doc.slice(t.from,t.to);n.deleteRange(t.from,t.to);const s=n.mapping.map(e);return n.insert(s,o.content),n.setSelection(new et(n.doc.resolve(s-1))),!0},t6=()=>({tr:t,dispatch:e})=>{const{selection:r}=t,n=r.$anchor.node();if(n.content.size>0)return!1;const i=t.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===n.type){if(e){const a=i.before(o),l=i.after(o);t.delete(a,l).scrollIntoView()}return!0}return!1},r6=t=>({tr:e,state:r,dispatch:n})=>{const i=Er(t,r.schema),o=e.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===i){if(n){const l=o.before(s),c=o.after(s);e.delete(l,c).scrollIntoView()}return!0}return!1},n6=t=>({tr:e,dispatch:r})=>{const{from:n,to:i}=t;return r&&e.delete(n,i),!0},i6=()=>({state:t,dispatch:e})=>Hh(t,e),o6=()=>({commands:t})=>t.keyboardShortcut("Enter"),s6=()=>({state:t,dispatch:e})=>x5(t,e);function ug(t,e,r={strict:!0}){const n=Object.keys(e);return n.length?n.every(i=>r.strict?e[i]===t[i]:j1(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function $I(t,e,r={}){return t.find(n=>n.type===e&&ug(Object.fromEntries(Object.keys(r).map(i=>[i,n.attrs[i]])),r))}function v_(t,e,r={}){return!!$I(t,e,r)}function My(t,e,r){var n;if(!t||!e)return;let i=t.parent.childAfter(t.parentOffset);if((!i.node||!i.node.marks.some(d=>d.type===e))&&(i=t.parent.childBefore(t.parentOffset)),!i.node||!i.node.marks.some(d=>d.type===e)||(r=r||((n=i.node.marks[0])===null||n===void 0?void 0:n.attrs),!$I([...i.node.marks],e,r)))return;let s=i.index,a=t.start()+i.offset,l=s+1,c=a+i.node.nodeSize;for(;s>0&&v_([...t.parent.child(s-1).marks],e,r);)s-=1,a-=t.parent.child(s).nodeSize;for(;l<t.parent.childCount&&v_([...t.parent.child(l).marks],e,r);)c+=t.parent.child(l).nodeSize,l+=1;return{from:a,to:c}}function Aa(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}const a6=(t,e={})=>({tr:r,state:n,dispatch:i})=>{const o=Aa(t,n.schema),{doc:s,selection:a}=r,{$from:l,from:c,to:d}=a;if(i){const f=My(l,o,e);if(f&&f.from<=c&&f.to>=d){const p=et.create(s,f.from,f.to);r.setSelection(p)}}return!0},l6=t=>e=>{const r=typeof t=="function"?t(e):t;for(let n=0;n<r.length;n+=1)if(r[n](e))return!0;return!1};function B1(t){return t instanceof et}function ns(t=0,e=0,r=0){return Math.min(Math.max(t,e),r)}function UI(t,e=null){if(!e)return null;const r=ot.atStart(t),n=ot.atEnd(t);if(e==="start"||e===!0)return r;if(e==="end")return n;const i=r.from,o=n.to;return e==="all"?et.create(t,ns(0,i,o),ns(t.content.size,i,o)):et.create(t,ns(e,i,o),ns(e,i,o))}function Ny(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const c6=(t=null,e={})=>({editor:r,view:n,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const s=()=>{Ny()&&n.dom.focus(),requestAnimationFrame(()=>{r.isDestroyed||(n.focus(),e!=null&&e.scrollIntoView&&r.commands.scrollIntoView())})};if(n.hasFocus()&&t===null||t===!1)return!0;if(o&&t===null&&!B1(r.state.selection))return s(),!0;const a=UI(i.doc,t)||r.state.selection,l=r.state.selection.eq(a);return o&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},u6=(t,e)=>r=>t.every((n,i)=>e(n,{...r,index:i})),d6=(t,e)=>({tr:r,commands:n})=>n.insertContentAt({from:r.selection.from,to:r.selection.to},t,e),WI=t=>{const e=t.childNodes;for(let r=e.length-1;r>=0;r-=1){const n=e[r];n.nodeType===3&&n.nodeValue&&/^(\n\s\s|\n)$/.test(n.nodeValue)?t.removeChild(n):n.nodeType===1&&WI(n)}return t};function Wp(t){const e=`<body>${t}</body>`,r=new window.DOMParser().parseFromString(e,"text/html").body;return WI(r)}function dg(t,e,r){if(t instanceof ls||t instanceof Le)return t;r={slice:!0,parseOptions:{},...r};const n=typeof t=="object"&&t!==null,i=typeof t=="string";if(n)try{if(Array.isArray(t)&&t.length>0)return Le.fromArray(t.map(a=>e.nodeFromJSON(a)));const s=e.nodeFromJSON(t);return r.errorOnInvalidContent&&s.check(),s}catch(o){if(r.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",o),dg("",e,r)}if(i){if(r.errorOnInvalidContent){let s=!1,a="";const l=new NR({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(s=!0,a=typeof c=="string"?c:c.outerHTML,null)}]}})});if(r.slice?Xf.fromSchema(l).parseSlice(Wp(t),r.parseOptions):Xf.fromSchema(l).parse(Wp(t),r.parseOptions),r.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const o=Xf.fromSchema(e);return r.slice?o.parseSlice(Wp(t),r.parseOptions).content:o.parse(Wp(t),r.parseOptions)}return dg("",e,r)}function f6(t,e,r){const n=t.steps.length-1;if(n<e)return;const i=t.steps[n];if(!(i instanceof kr||i instanceof _r))return;const o=t.mapping.maps[n];let s=0;o.forEach((a,l,c,d)=>{s===0&&(s=d)}),t.setSelection(ot.near(t.doc.resolve(s),r))}const h6=t=>!("type"in t),p6=(t,e,r)=>({tr:n,dispatch:i,editor:o})=>{var s;if(i){r={parseOptions:o.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...r};let a;try{a=dg(e,o.schema,{parseOptions:{preserveWhitespace:"full",...r.parseOptions},errorOnInvalidContent:(s=r.errorOnInvalidContent)!==null&&s!==void 0?s:o.options.enableContentCheck})}catch(g){return o.emit("contentError",{editor:o,error:g,disableCollaboration:()=>{o.storage.collaboration&&(o.storage.collaboration.isDisabled=!0)}}),!1}let{from:l,to:c}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},d=!0,f=!0;if((h6(a)?a:[a]).forEach(g=>{g.check(),d=d?g.isText&&g.marks.length===0:!1,f=f?g.isBlock:!1}),l===c&&f){const{parent:g}=n.doc.resolve(l);g.isTextblock&&!g.type.spec.code&&!g.childCount&&(l-=1,c+=1)}let m;if(d){if(Array.isArray(e))m=e.map(g=>g.text||"").join("");else if(e instanceof Le){let g="";e.forEach(b=>{b.text&&(g+=b.text)}),m=g}else typeof e=="object"&&e&&e.text?m=e.text:m=e;n.insertText(m,l,c)}else m=a,n.replaceWith(l,c,m);r.updateSelection&&f6(n,n.steps.length-1,-1),r.applyInputRules&&n.setMeta("applyInputRules",{from:l,text:m}),r.applyPasteRules&&n.setMeta("applyPasteRules",{from:l,text:m})}return!0},m6=()=>({state:t,dispatch:e})=>y5(t,e),g6=()=>({state:t,dispatch:e})=>v5(t,e),y6=()=>({state:t,dispatch:e})=>d5(t,e),v6=()=>({state:t,dispatch:e})=>m5(t,e),b6=()=>({state:t,dispatch:e,tr:r})=>{try{const n=xy(t.doc,t.selection.$from.pos,-1);return n==null?!1:(r.join(n,2),e&&e(r),!0)}catch{return!1}},w6=()=>({state:t,dispatch:e,tr:r})=>{try{const n=xy(t.doc,t.selection.$from.pos,1);return n==null?!1:(r.join(n,2),e&&e(r),!0)}catch{return!1}},x6=()=>({state:t,dispatch:e})=>f5(t,e),S6=()=>({state:t,dispatch:e})=>h5(t,e);function VI(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function k6(t){const e=t.split(/-(?!$)/);let r=e[e.length-1];r==="Space"&&(r=" ");let n,i,o,s;for(let a=0;a<e.length-1;a+=1){const l=e[a];if(/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))n=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))o=!0;else if(/^mod$/i.test(l))Ny()||VI()?s=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return n&&(r=`Alt-${r}`),i&&(r=`Ctrl-${r}`),s&&(r=`Meta-${r}`),o&&(r=`Shift-${r}`),r}const _6=t=>({editor:e,view:r,tr:n,dispatch:i})=>{const o=k6(t).split(/-(?!$)/),s=o.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),a=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{r.someProp("handleKeyDown",c=>c(r,a))});return l==null||l.steps.forEach(c=>{const d=c.map(n.mapping);d&&i&&n.maybeStep(d)}),!0};function vh(t,e,r={}){const{from:n,to:i,empty:o}=t.selection,s=e?Er(e,t.schema):null,a=[];t.doc.nodesBetween(n,i,(f,p)=>{if(f.isText)return;const m=Math.max(n,p),g=Math.min(i,p+f.nodeSize);a.push({node:f,from:m,to:g})});const l=i-n,c=a.filter(f=>s?s.name===f.node.type.name:!0).filter(f=>ug(f.node.attrs,r,{strict:!1}));return o?!!c.length:c.reduce((f,p)=>f+p.to-p.from,0)>=l}const C6=(t,e={})=>({state:r,dispatch:n})=>{const i=Er(t,r.schema);return vh(r,i,e)?b5(r,n):!1},E6=()=>({state:t,dispatch:e})=>k5(t,e),T6=t=>({state:e,dispatch:r})=>{const n=Er(t,e.schema);return O5(n)(e,r)},A6=()=>({state:t,dispatch:e})=>w5(t,e);function Dy(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function b_(t,e){const r=typeof e=="string"?[e]:e;return Object.keys(t).reduce((n,i)=>(r.includes(i)||(n[i]=t[i]),n),{})}const R6=(t,e)=>({tr:r,state:n,dispatch:i})=>{let o=null,s=null;const a=Dy(typeof t=="string"?t:t.name,n.schema);return a?(a==="node"&&(o=Er(t,n.schema)),a==="mark"&&(s=Aa(t,n.schema)),i&&r.selection.ranges.forEach(l=>{n.doc.nodesBetween(l.$from.pos,l.$to.pos,(c,d)=>{o&&o===c.type&&r.setNodeMarkup(d,void 0,b_(c.attrs,e)),s&&c.marks.length&&c.marks.forEach(f=>{s===f.type&&r.addMark(d,d+c.nodeSize,s.create(b_(f.attrs,e)))})})}),!0):!1},I6=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),O6=()=>({tr:t,commands:e})=>e.setTextSelection({from:0,to:t.doc.content.size}),M6=()=>({state:t,dispatch:e})=>p5(t,e),N6=()=>({state:t,dispatch:e})=>g5(t,e),D6=()=>({state:t,dispatch:e})=>_5(t,e),P6=()=>({state:t,dispatch:e})=>T5(t,e),L6=()=>({state:t,dispatch:e})=>E5(t,e);function W0(t,e,r={},n={}){return dg(t,e,{slice:!1,parseOptions:r,errorOnInvalidContent:n.errorOnInvalidContent})}const F6=(t,e=!1,r={},n={})=>({editor:i,tr:o,dispatch:s,commands:a})=>{var l,c;const{doc:d}=o;if(r.preserveWhitespace!=="full"){const f=W0(t,i.schema,r,{errorOnInvalidContent:(l=n.errorOnInvalidContent)!==null&&l!==void 0?l:i.options.enableContentCheck});return s&&o.replaceWith(0,d.content.size,f).setMeta("preventUpdate",!e),!0}return s&&o.setMeta("preventUpdate",!e),a.insertContentAt({from:0,to:d.content.size},t,{parseOptions:r,errorOnInvalidContent:(c=n.errorOnInvalidContent)!==null&&c!==void 0?c:i.options.enableContentCheck})};function z1(t,e){const r=Aa(e,t.schema),{from:n,to:i,empty:o}=t.selection,s=[];o?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(n,i,l=>{s.push(...l.marks)});const a=s.find(l=>l.type.name===r.name);return a?{...a.attrs}:{}}function j6(t,e){const r=new k1(t);return e.forEach(n=>{n.steps.forEach(i=>{r.step(i)})}),r}function B6(t){for(let e=0;e<t.edgeCount;e+=1){const{type:r}=t.edge(e);if(r.isTextblock&&!r.hasRequiredAttrs())return r}return null}function Qf(t,e){const r=[];return t.descendants((n,i)=>{e(n)&&r.push({node:n,pos:i})}),r}function z6(t,e,r){const n=[];return t.nodesBetween(e.from,e.to,(i,o)=>{r(i)&&n.push({node:i,pos:o})}),n}function GI(t,e){for(let r=t.depth;r>0;r-=1){const n=t.node(r);if(e(n))return{pos:r>0?t.before(r):0,start:t.start(r),depth:r,node:n}}}function Kl(t){return e=>GI(e.$from,t)}function H6(t,e){const r={from:0,to:t.content.size};return zI(t,r,e)}function $6(t,e){const r=Er(e,t.schema),{from:n,to:i}=t.selection,o=[];t.doc.nodesBetween(n,i,a=>{o.push(a)});const s=o.reverse().find(a=>a.type.name===r.name);return s?{...s.attrs}:{}}function KI(t,e){const r=Dy(typeof e=="string"?e:e.name,t.schema);return r==="node"?$6(t,e):r==="mark"?z1(t,e):{}}function U6(t,e=JSON.stringify){const r={};return t.filter(n=>{const i=e(n);return Object.prototype.hasOwnProperty.call(r,i)?!1:r[i]=!0})}function W6(t){const e=U6(t);return e.length===1?e:e.filter((r,n)=>!e.filter((o,s)=>s!==n).some(o=>r.oldRange.from>=o.oldRange.from&&r.oldRange.to<=o.oldRange.to&&r.newRange.from>=o.newRange.from&&r.newRange.to<=o.newRange.to))}function V6(t){const{mapping:e,steps:r}=t,n=[];return e.maps.forEach((i,o)=>{const s=[];if(i.ranges.length)i.forEach((a,l)=>{s.push({from:a,to:l})});else{const{from:a,to:l}=r[o];if(a===void 0||l===void 0)return;s.push({from:a,to:l})}s.forEach(({from:a,to:l})=>{const c=e.slice(o).map(a,-1),d=e.slice(o).map(l),f=e.invert().map(c,-1),p=e.invert().map(d);n.push({oldRange:{from:f,to:p},newRange:{from:c,to:d}})})}),W6(n)}function H1(t,e,r){const n=[];return t===e?r.resolve(t).marks().forEach(i=>{const o=r.resolve(t),s=My(o,i.type);s&&n.push({mark:i,...s})}):r.nodesBetween(t,e,(i,o)=>{!i||(i==null?void 0:i.nodeSize)===void 0||n.push(...i.marks.map(s=>({from:o,to:o+i.nodeSize,mark:s})))}),n}function Im(t,e,r){return Object.fromEntries(Object.entries(r).filter(([n])=>{const i=t.find(o=>o.type===e&&o.name===n);return i?i.attribute.keepOnSplit:!1}))}function V0(t,e,r={}){const{empty:n,ranges:i}=t.selection,o=e?Aa(e,t.schema):null;if(n)return!!(t.storedMarks||t.selection.$from.marks()).filter(f=>o?o.name===f.type.name:!0).find(f=>ug(f.attrs,r,{strict:!1}));let s=0;const a=[];if(i.forEach(({$from:f,$to:p})=>{const m=f.pos,g=p.pos;t.doc.nodesBetween(m,g,(b,S)=>{if(!b.isText&&!b.marks.length)return;const w=Math.max(m,S),T=Math.min(g,S+b.nodeSize),M=T-w;s+=M,a.push(...b.marks.map(j=>({mark:j,from:w,to:T})))})}),s===0)return!1;const l=a.filter(f=>o?o.name===f.mark.type.name:!0).filter(f=>ug(f.mark.attrs,r,{strict:!1})).reduce((f,p)=>f+p.to-p.from,0),c=a.filter(f=>o?f.mark.type!==o&&f.mark.type.excludes(o):!0).reduce((f,p)=>f+p.to-p.from,0);return(l>0?l+c:l)>=s}function qI(t,e,r={}){if(!e)return vh(t,null,r)||V0(t,null,r);const n=Dy(e,t.schema);return n==="node"?vh(t,e,r):n==="mark"?V0(t,e,r):!1}function G0(t,e){const{nodeExtensions:r}=Ry(e),n=r.find(s=>s.name===t);if(!n)return!1;const i={name:n.name,options:n.options,storage:n.storage},o=dt(Ze(n,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function Py(t,{checkChildren:e=!0,ignoreWhitespace:r=!1}={}){var n;if(r){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((n=t.text)!==null&&n!==void 0?n:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let i=!0;return t.content.forEach(o=>{i!==!1&&(Py(o,{ignoreWhitespace:r,checkChildren:e})||(i=!1))}),i}return!1}function XI(t){return t instanceof rt}function G6(t,e,r){const i=t.state.doc.content.size,o=ns(e,0,i),s=ns(r,0,i),a=t.coordsAtPos(o),l=t.coordsAtPos(s,-1),c=Math.min(a.top,l.top),d=Math.max(a.bottom,l.bottom),f=Math.min(a.left,l.left),p=Math.max(a.right,l.right),m=p-f,g=d-c,w={top:c,bottom:d,left:f,right:p,width:m,height:g,x:f,y:c};return{...w,toJSON:()=>w}}function K6(t,e,r){var n;const{selection:i}=e;let o=null;if(B1(i)&&(o=i.$cursor),o){const a=(n=t.storedMarks)!==null&&n!==void 0?n:o.marks();return!!r.isInSet(a)||!a.some(l=>l.type.excludes(r))}const{ranges:s}=i;return s.some(({$from:a,$to:l})=>{let c=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(r):!1;return t.doc.nodesBetween(a.pos,l.pos,(d,f,p)=>{if(c)return!1;if(d.isInline){const m=!p||p.type.allowsMarkType(r),g=!!r.isInSet(d.marks)||!d.marks.some(b=>b.type.excludes(r));c=m&&g}return!c}),c})}const q6=(t,e={})=>({tr:r,state:n,dispatch:i})=>{const{selection:o}=r,{empty:s,ranges:a}=o,l=Aa(t,n.schema);if(i)if(s){const c=z1(n,l);r.addStoredMark(l.create({...c,...e}))}else a.forEach(c=>{const d=c.$from.pos,f=c.$to.pos;n.doc.nodesBetween(d,f,(p,m)=>{const g=Math.max(m,d),b=Math.min(m+p.nodeSize,f);p.marks.find(w=>w.type===l)?p.marks.forEach(w=>{l===w.type&&r.addMark(g,b,l.create({...w.attrs,...e}))}):r.addMark(g,b,l.create(e))})});return K6(n,r,l)},X6=(t,e)=>({tr:r})=>(r.setMeta(t,e),!0),Y6=(t,e={})=>({state:r,dispatch:n,chain:i})=>{const o=Er(t,r.schema);let s;return r.selection.$anchor.sameParent(r.selection.$head)&&(s=r.selection.$anchor.parent.attrs),o.isTextblock?i().command(({commands:a})=>p_(o,{...s,...e})(r)?!0:a.clearNodes()).command(({state:a})=>p_(o,{...s,...e})(a,n)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},J6=t=>({tr:e,dispatch:r})=>{if(r){const{doc:n}=e,i=ns(t,0,n.content.size),o=rt.create(n,i);e.setSelection(o)}return!0},Z6=t=>({tr:e,dispatch:r})=>{if(r){const{doc:n}=e,{from:i,to:o}=typeof t=="number"?{from:t,to:t}:t,s=et.atStart(n).from,a=et.atEnd(n).to,l=ns(i,s,a),c=ns(o,s,a),d=et.create(n,l,c);e.setSelection(d)}return!0},Q6=t=>({state:e,dispatch:r})=>{const n=Er(t,e.schema);return D5(n)(e,r)};function w_(t,e){const r=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(r){const n=r.filter(i=>e==null?void 0:e.includes(i.type.name));t.tr.ensureMarks(n)}}const e4=({keepMarks:t=!0}={})=>({tr:e,state:r,dispatch:n,editor:i})=>{const{selection:o,doc:s}=e,{$from:a,$to:l}=o,c=i.extensionManager.attributes,d=Im(c,a.node().type.name,a.node().attrs);if(o instanceof rt&&o.node.isBlock)return!a.parentOffset||!Pu(s,a.pos)?!1:(n&&(t&&w_(r,i.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const f=l.parentOffset===l.parent.content.size,p=a.depth===0?void 0:B6(a.node(-1).contentMatchAt(a.indexAfter(-1)));let m=f&&p?[{type:p,attrs:d}]:void 0,g=Pu(e.doc,e.mapping.map(a.pos),1,m);if(!m&&!g&&Pu(e.doc,e.mapping.map(a.pos),1,p?[{type:p}]:void 0)&&(g=!0,m=p?[{type:p,attrs:d}]:void 0),n){if(g&&(o instanceof et&&e.deleteSelection(),e.split(e.mapping.map(a.pos),1,m),p&&!f&&!a.parentOffset&&a.parent.type!==p)){const b=e.mapping.map(a.before()),S=e.doc.resolve(b);a.node(-1).canReplaceWith(S.index(),S.index()+1,p)&&e.setNodeMarkup(e.mapping.map(a.before()),p)}t&&w_(r,i.extensionManager.splittableMarks),e.scrollIntoView()}return g},t4=(t,e={})=>({tr:r,state:n,dispatch:i,editor:o})=>{var s;const a=Er(t,n.schema),{$from:l,$to:c}=n.selection,d=n.selection.node;if(d&&d.isBlock||l.depth<2||!l.sameParent(c))return!1;const f=l.node(-1);if(f.type!==a)return!1;const p=o.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(i){let w=Le.empty;const T=l.index(-1)?1:l.index(-2)?2:3;for(let ee=l.depth-T;ee>=l.depth-3;ee-=1)w=Le.from(l.node(ee).copy(w));const M=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,j={...Im(p,l.node().type.name,l.node().attrs),...e},$=((s=a.contentMatch.defaultType)===null||s===void 0?void 0:s.createAndFill(j))||void 0;w=w.append(Le.from(a.createAndFill(null,$)||void 0));const W=l.before(l.depth-(T-1));r.replace(W,l.after(-M),new qe(w,4-T,0));let Y=-1;r.doc.nodesBetween(W,r.doc.content.size,(ee,P)=>{if(Y>-1)return!1;ee.isTextblock&&ee.content.size===0&&(Y=P+1)}),Y>-1&&r.setSelection(et.near(r.doc.resolve(Y))),r.scrollIntoView()}return!0}const m=c.pos===l.end()?f.contentMatchAt(0).defaultType:null,g={...Im(p,f.type.name,f.attrs),...e},b={...Im(p,l.node().type.name,l.node().attrs),...e};r.delete(l.pos,c.pos);const S=m?[{type:a,attrs:g},{type:m,attrs:b}]:[{type:a,attrs:g}];if(!Pu(r.doc,l.pos,2))return!1;if(i){const{selection:w,storedMarks:T}=n,{splittableMarks:M}=o.extensionManager,j=T||w.$to.parentOffset&&w.$from.marks();if(r.split(l.pos,2,S).scrollIntoView(),!j||!i)return!0;const $=j.filter(W=>M.includes(W.type.name));r.ensureMarks($)}return!0},Eb=(t,e)=>{const r=Kl(s=>s.type===e)(t.selection);if(!r)return!0;const n=t.doc.resolve(Math.max(0,r.pos-1)).before(r.depth);if(n===void 0)return!0;const i=t.doc.nodeAt(n);return r.node.type===(i==null?void 0:i.type)&&Ea(t.doc,r.pos)&&t.join(r.pos),!0},Tb=(t,e)=>{const r=Kl(s=>s.type===e)(t.selection);if(!r)return!0;const n=t.doc.resolve(r.start).after(r.depth);if(n===void 0)return!0;const i=t.doc.nodeAt(n);return r.node.type===(i==null?void 0:i.type)&&Ea(t.doc,n)&&t.join(n),!0},r4=(t,e,r,n={})=>({editor:i,tr:o,state:s,dispatch:a,chain:l,commands:c,can:d})=>{const{extensions:f,splittableMarks:p}=i.extensionManager,m=Er(t,s.schema),g=Er(e,s.schema),{selection:b,storedMarks:S}=s,{$from:w,$to:T}=b,M=w.blockRange(T),j=S||b.$to.parentOffset&&b.$from.marks();if(!M)return!1;const $=Kl(W=>G0(W.type.name,f))(b);if(M.depth>=1&&$&&M.depth-$.depth<=1){if($.node.type===m)return c.liftListItem(g);if(G0($.node.type.name,f)&&m.validContent($.node.content)&&a)return l().command(()=>(o.setNodeMarkup($.pos,m),!0)).command(()=>Eb(o,m)).command(()=>Tb(o,m)).run()}return!r||!j||!a?l().command(()=>d().wrapInList(m,n)?!0:c.clearNodes()).wrapInList(m,n).command(()=>Eb(o,m)).command(()=>Tb(o,m)).run():l().command(()=>{const W=d().wrapInList(m,n),Y=j.filter(ee=>p.includes(ee.type.name));return o.ensureMarks(Y),W?!0:c.clearNodes()}).wrapInList(m,n).command(()=>Eb(o,m)).command(()=>Tb(o,m)).run()},n4=(t,e={},r={})=>({state:n,commands:i})=>{const{extendEmptyMarkRange:o=!1}=r,s=Aa(t,n.schema);return V0(n,s,e)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,e)},i4=(t,e,r={})=>({state:n,commands:i})=>{const o=Er(t,n.schema),s=Er(e,n.schema),a=vh(n,o,r);let l;return n.selection.$anchor.sameParent(n.selection.$head)&&(l=n.selection.$anchor.parent.attrs),a?i.setNode(s,l):i.setNode(o,{...l,...r})},o4=(t,e={})=>({state:r,commands:n})=>{const i=Er(t,r.schema);return vh(r,i,e)?n.lift(i):n.wrapIn(i,e)},s4=()=>({state:t,dispatch:e})=>{const r=t.plugins;for(let n=0;n<r.length;n+=1){const i=r[n];let o;if(i.spec.isInputRules&&(o=i.getState(t))){if(e){const s=t.tr,a=o.transform;for(let l=a.steps.length-1;l>=0;l-=1)s.step(a.steps[l].invert(a.docs[l]));if(o.text){const l=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,t.schema.text(o.text,l))}else s.delete(o.from,o.to)}return!0}}return!1},a4=()=>({tr:t,dispatch:e})=>{const{selection:r}=t,{empty:n,ranges:i}=r;return n||e&&i.forEach(o=>{t.removeMark(o.$from.pos,o.$to.pos)}),!0},l4=(t,e={})=>({tr:r,state:n,dispatch:i})=>{var o;const{extendEmptyMarkRange:s=!1}=e,{selection:a}=r,l=Aa(t,n.schema),{$from:c,empty:d,ranges:f}=a;if(!i)return!0;if(d&&s){let{from:p,to:m}=a;const g=(o=c.marks().find(S=>S.type===l))===null||o===void 0?void 0:o.attrs,b=My(c,l,g);b&&(p=b.from,m=b.to),r.removeMark(p,m,l)}else f.forEach(p=>{r.removeMark(p.$from.pos,p.$to.pos,l)});return r.removeStoredMark(l),!0},c4=(t,e={})=>({tr:r,state:n,dispatch:i})=>{let o=null,s=null;const a=Dy(typeof t=="string"?t:t.name,n.schema);return a?(a==="node"&&(o=Er(t,n.schema)),a==="mark"&&(s=Aa(t,n.schema)),i&&r.selection.ranges.forEach(l=>{const c=l.$from.pos,d=l.$to.pos;let f,p,m,g;r.selection.empty?n.doc.nodesBetween(c,d,(b,S)=>{o&&o===b.type&&(m=Math.max(S,c),g=Math.min(S+b.nodeSize,d),f=S,p=b)}):n.doc.nodesBetween(c,d,(b,S)=>{S<c&&o&&o===b.type&&(m=Math.max(S,c),g=Math.min(S+b.nodeSize,d),f=S,p=b),S>=c&&S<=d&&(o&&o===b.type&&r.setNodeMarkup(S,void 0,{...b.attrs,...e}),s&&b.marks.length&&b.marks.forEach(w=>{if(s===w.type){const T=Math.max(S,c),M=Math.min(S+b.nodeSize,d);r.addMark(T,M,s.create({...w.attrs,...e}))}}))}),p&&(f!==void 0&&r.setNodeMarkup(f,void 0,{...p.attrs,...e}),s&&p.marks.length&&p.marks.forEach(b=>{s===b.type&&r.addMark(m,g,s.create({...b.attrs,...e}))}))}),!0):!1},u4=(t,e={})=>({state:r,dispatch:n})=>{const i=Er(t,r.schema);return A5(i,e)(r,n)},d4=(t,e={})=>({state:r,dispatch:n})=>{const i=Er(t,r.schema);return R5(i,e)(r,n)};var f4=Object.freeze({__proto__:null,blur:X5,clearContent:Y5,clearNodes:J5,command:Z5,createParagraphNear:Q5,cut:e6,deleteCurrentNode:t6,deleteNode:r6,deleteRange:n6,deleteSelection:i6,enter:o6,exitCode:s6,extendMarkRange:a6,first:l6,focus:c6,forEach:u6,insertContent:d6,insertContentAt:p6,joinBackward:y6,joinDown:g6,joinForward:v6,joinItemBackward:b6,joinItemForward:w6,joinTextblockBackward:x6,joinTextblockForward:S6,joinUp:m6,keyboardShortcut:_6,lift:C6,liftEmptyBlock:E6,liftListItem:T6,newlineInCode:A6,resetAttributes:R6,scrollIntoView:I6,selectAll:O6,selectNodeBackward:M6,selectNodeForward:N6,selectParentNode:D6,selectTextblockEnd:P6,selectTextblockStart:L6,setContent:F6,setMark:q6,setMeta:X6,setNode:Y6,setNodeSelection:J6,setTextSelection:Z6,sinkListItem:Q6,splitBlock:e4,splitListItem:t4,toggleList:r4,toggleMark:n4,toggleNode:i4,toggleWrap:o4,undoInputRule:s4,unsetAllMarks:a4,unsetMark:l4,updateAttributes:c4,wrapIn:u4,wrapInList:d4});const h4=yt.create({name:"commands",addCommands(){return{...f4}}}),p4=yt.create({name:"drop",addProseMirrorPlugins(){return[new _t({key:new St("tiptapDrop"),props:{handleDrop:(t,e,r,n)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:r,moved:n})}}})]}}),m4=yt.create({name:"editable",addProseMirrorPlugins(){return[new _t({key:new St("editable"),props:{editable:()=>this.editor.options.editable}})]}}),g4=yt.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new _t({key:new St("focusEvents"),props:{handleDOMEvents:{focus:(e,r)=>{t.isFocused=!0;const n=t.state.tr.setMeta("focus",{event:r}).setMeta("addToHistory",!1);return e.dispatch(n),!1},blur:(e,r)=>{t.isFocused=!1;const n=t.state.tr.setMeta("blur",{event:r}).setMeta("addToHistory",!1);return e.dispatch(n),!1}}}})]}}),y4=yt.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:a})=>{const{selection:l,doc:c}=a,{empty:d,$anchor:f}=l,{pos:p,parent:m}=f,g=f.parent.isTextblock&&p>0?a.doc.resolve(p-1):f,b=g.parent.type.spec.isolating,S=f.pos-f.parentOffset,w=b&&g.parent.childCount===1?S===f.pos:ot.atStart(c).from===p;return!d||!m.type.isTextblock||m.textContent.length||!w||w&&f.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...n},o={...n,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Ny()||VI()?o:i},addProseMirrorPlugins(){return[new _t({key:new St("clearDocument"),appendTransaction:(t,e,r)=>{const n=t.some(b=>b.docChanged)&&!e.doc.eq(r.doc),i=t.some(b=>b.getMeta("preventClearDocument"));if(!n||i)return;const{empty:o,from:s,to:a}=e.selection,l=ot.atStart(e.doc).from,c=ot.atEnd(e.doc).to;if(o||!(s===l&&a===c)||!Py(r.doc))return;const p=r.tr,m=Ty({state:r,transaction:p}),{commands:g}=new Ay({editor:this.editor,state:m});if(g.clearNodes(),!!p.steps.length)return p}})]}}),v4=yt.create({name:"paste",addProseMirrorPlugins(){return[new _t({key:new St("tiptapPaste"),props:{handlePaste:(t,e,r)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:r})}}})]}}),b4=yt.create({name:"tabindex",addProseMirrorPlugins(){return[new _t({key:new St("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class El{get name(){return this.node.type.name}constructor(e,r,n=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=r,this.currentNode=i}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!==null&&e!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let r=this.from,n=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}r=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:r,to:n},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),r=this.resolvedPos.doc.resolve(e);return new El(r,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new El(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new El(e,this.editor)}get children(){const e=[];return this.node.content.forEach((r,n)=>{const i=r.isBlock&&!r.isTextblock,o=r.isAtom&&!r.isText,s=this.pos+n+(o?0:1),a=this.resolvedPos.doc.resolve(s);if(!i&&a.depth<=this.depth)return;const l=new El(a,this.editor,i,i?r:null);i&&(l.actualDepth=this.depth+1),e.push(new El(a,this.editor,i,i?r:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,r={}){let n=null,i=this.parent;for(;i&&!n;){if(i.node.type.name===e)if(Object.keys(r).length>0){const o=i.node.attrs,s=Object.keys(r);for(let a=0;a<s.length;a+=1){const l=s[a];if(o[l]!==r[l])break}}else n=i;i=i.parent}return n}querySelector(e,r={}){return this.querySelectorAll(e,r,!0)[0]||null}querySelectorAll(e,r={},n=!1){let i=[];if(!this.children||this.children.length===0)return i;const o=Object.keys(r);return this.children.forEach(s=>{n&&i.length>0||(s.node.type.name===e&&o.every(l=>r[l]===s.node.attrs[l])&&i.push(s),!(n&&i.length>0)&&(i=i.concat(s.querySelectorAll(e,r,n))))}),i}setAttribute(e){const{tr:r}=this.editor.state;r.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(r)}}const w4=`.ProseMirror {
|
|
14
|
+
position: relative;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.ProseMirror {
|
|
18
|
+
word-wrap: break-word;
|
|
19
|
+
white-space: pre-wrap;
|
|
20
|
+
white-space: break-spaces;
|
|
21
|
+
-webkit-font-variant-ligatures: none;
|
|
22
|
+
font-variant-ligatures: none;
|
|
23
|
+
font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.ProseMirror [contenteditable="false"] {
|
|
27
|
+
white-space: normal;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.ProseMirror [contenteditable="false"] [contenteditable="true"] {
|
|
31
|
+
white-space: pre-wrap;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.ProseMirror pre {
|
|
35
|
+
white-space: pre-wrap;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
img.ProseMirror-separator {
|
|
39
|
+
display: inline !important;
|
|
40
|
+
border: none !important;
|
|
41
|
+
margin: 0 !important;
|
|
42
|
+
width: 0 !important;
|
|
43
|
+
height: 0 !important;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.ProseMirror-gapcursor {
|
|
47
|
+
display: none;
|
|
48
|
+
pointer-events: none;
|
|
49
|
+
position: absolute;
|
|
50
|
+
margin: 0;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.ProseMirror-gapcursor:after {
|
|
54
|
+
content: "";
|
|
55
|
+
display: block;
|
|
56
|
+
position: absolute;
|
|
57
|
+
top: -2px;
|
|
58
|
+
width: 20px;
|
|
59
|
+
border-top: 1px solid black;
|
|
60
|
+
animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@keyframes ProseMirror-cursor-blink {
|
|
64
|
+
to {
|
|
65
|
+
visibility: hidden;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.ProseMirror-hideselection *::selection {
|
|
70
|
+
background: transparent;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.ProseMirror-hideselection *::-moz-selection {
|
|
74
|
+
background: transparent;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.ProseMirror-hideselection * {
|
|
78
|
+
caret-color: transparent;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.ProseMirror-focused .ProseMirror-gapcursor {
|
|
82
|
+
display: block;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.tippy-box[data-animation=fade][data-state=hidden] {
|
|
86
|
+
opacity: 0
|
|
87
|
+
}`;function x4(t,e,r){const n=document.querySelector("style[data-tiptap-style]");if(n!==null)return n;const i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute("data-tiptap-style",""),i.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(i),i}class S4 extends P5{constructor(e={}){super(),this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:r})=>{throw r},onPaste:()=>null,onDrop:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:r,slice:n,moved:i})=>this.options.onDrop(r,n,i)),this.on("paste",({event:r,slice:n})=>this.options.onPaste(r,n)),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=x4(w4,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,r=!0){this.setOptions({editable:e}),r&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,r){const n=jI(r)?r(e,[...this.state.plugins]):[...this.state.plugins,e],i=this.state.reconfigure({plugins:n});return this.view.updateState(i),i}unregisterPlugin(e){if(this.isDestroyed)return;const r=this.state.plugins;let n=r;if([].concat(e).forEach(o=>{const s=typeof o=="string"?`${o}$`:o.key;n=r.filter(a=>!a.key.startsWith(s))}),r.length===n.length)return;const i=this.state.reconfigure({plugins:n});return this.view.updateState(i),i}createExtensionManager(){var e,r;const i=[...this.options.enableCoreExtensions?[m4,q5.configure({blockSeparator:(r=(e=this.options.coreExtensionOptions)===null||e===void 0?void 0:e.clipboardTextSerializer)===null||r===void 0?void 0:r.blockSeparator}),h4,g4,y4,b4,p4,v4].filter(o=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[o.name]!==!1:!0):[],...this.options.extensions].filter(o=>["extension","node","mark"].includes(o==null?void 0:o.type));this.extensionManager=new Mu(i,this)}createCommandManager(){this.commandManager=new Ay({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){var e;let r;try{r=W0(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(s){if(!(s instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(s.message))throw s;this.emit("contentError",{editor:this,error:s,disableCollaboration:()=>{this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(a=>a.name!=="collaboration"),this.createExtensionManager()}}),r=W0(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const n=UI(r,this.options.autofocus);this.view=new t5(this.options.element,{...this.options.editorProps,attributes:{role:"textbox",...(e=this.options.editorProps)===null||e===void 0?void 0:e.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:Ou.create({doc:r,selection:n||void 0})});const i=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(i),this.createNodeViews(),this.prependClass();const o=this.view.dom;o.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const r=this.capturedTransaction;return this.capturedTransaction=null,r}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(s=>{var a;return(a=this.capturedTransaction)===null||a===void 0?void 0:a.step(s)});return}const r=this.state.apply(e),n=!this.state.selection.eq(r.selection);this.emit("beforeTransaction",{editor:this,transaction:e,nextState:r}),this.view.updateState(r),this.emit("transaction",{editor:this,transaction:e}),n&&this.emit("selectionUpdate",{editor:this,transaction:e});const i=e.getMeta("focus"),o=e.getMeta("blur");i&&this.emit("focus",{editor:this,event:i.event,transaction:e}),o&&this.emit("blur",{editor:this,event:o.event,transaction:e}),!(!e.docChanged||e.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return KI(this.state,e)}isActive(e,r){const n=typeof e=="string"?e:null,i=typeof e=="string"?r:e;return qI(this.state,n,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return F1(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:r=`
|
|
88
|
+
|
|
89
|
+
`,textSerializers:n={}}=e||{};return H6(this.state.doc,{blockSeparator:r,textSerializers:{...HI(this.schema),...n}})}get isEmpty(){return Py(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){if(this.emit("destroy"),this.view){const e=this.view.dom;e&&e.editor&&delete e.editor,this.view.destroy()}this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}$node(e,r){var n;return((n=this.$doc)===null||n===void 0?void 0:n.querySelector(e,r))||null}$nodes(e,r){var n;return((n=this.$doc)===null||n===void 0?void 0:n.querySelectorAll(e,r))||null}$pos(e){const r=this.state.doc.resolve(e);return new El(r,this)}get $doc(){return this.$pos(0)}}function ql(t){return new Iy({find:t.find,handler:({state:e,range:r,match:n})=>{const i=dt(t.getAttributes,void 0,n);if(i===!1||i===null)return null;const{tr:o}=e,s=n[n.length-1],a=n[0];if(s){const l=a.search(/\S/),c=r.from+a.indexOf(s),d=c+s.length;if(H1(r.from,r.to,e.doc).filter(m=>m.mark.type.excluded.find(b=>b===t.type&&b!==m.mark.type)).filter(m=>m.to>c).length)return null;d<r.to&&o.delete(d,r.to),c>r.from&&o.delete(r.from+l,c);const p=r.from+l+s.length;o.addMark(r.from+l,p,t.type.create(i||{})),o.removeStoredMark(t.type)}}})}function $h(t){return new Iy({find:t.find,handler:({state:e,range:r,match:n})=>{const i=dt(t.getAttributes,void 0,n)||{},{tr:o}=e,s=r.from;let a=r.to;const l=t.type.create(i);if(n[1]){const c=n[0].lastIndexOf(n[1]);let d=s+c;d>a?d=a:a=d+n[1].length;const f=n[0][n[0].length-1];o.insertText(f,s+n[0].length-1),o.replaceWith(d,a,l)}else if(n[0]){const c=t.type.isInline?s:s-1;o.insert(c,t.type.create(i)).delete(o.mapping.map(s),o.mapping.map(a))}o.scrollIntoView()}})}function K0(t){return new Iy({find:t.find,handler:({state:e,range:r,match:n})=>{const i=e.doc.resolve(r.from),o=dt(t.getAttributes,void 0,n)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(r.from,r.to).setBlockType(r.from,r.from,t.type,o)}})}function Ju(t){return new Iy({find:t.find,handler:({state:e,range:r,match:n,chain:i})=>{const o=dt(t.getAttributes,void 0,n)||{},s=e.tr.delete(r.from,r.to),l=s.doc.resolve(r.from).blockRange(),c=l&&S1(l,t.type,o);if(!c)return null;if(s.wrap(l,c),t.keepMarks&&t.editor){const{selection:f,storedMarks:p}=e,{splittableMarks:m}=t.editor.extensionManager,g=p||f.$to.parentOffset&&f.$from.marks();if(g){const b=g.filter(S=>m.includes(S.type.name));s.ensureMarks(b)}}if(t.keepAttributes){const f=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(f,o).run()}const d=s.doc.resolve(r.from-1).nodeBefore;d&&d.type===t.type&&Ea(s.doc,r.from-1)&&(!t.joinPredicate||t.joinPredicate(n,d))&&s.join(r.from-1)}})}let Nt=class q0{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=dt(Ze(this,"addOptions",{name:this.name}))),this.storage=dt(Ze(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new q0(e)}configure(e={}){const r=this.extend({...this.config,addOptions:()=>Oy(this.options,e)});return r.name=this.name,r.parent=this.parent,r}extend(e={}){const r=new q0(e);return r.parent=this,this.child=r,r.name=e.name?e.name:r.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${r.name}".`),r.options=dt(Ze(r,"addOptions",{name:r.name})),r.storage=dt(Ze(r,"addStorage",{name:r.name,options:r.options})),r}};function k4(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}class _4{constructor(e,r,n){this.isDragging=!1,this.component=e,this.editor=r.editor,this.options={stopEvent:null,ignoreMutation:null,...n},this.extension=r.extension,this.node=r.node,this.decorations=r.decorations,this.innerDecorations=r.innerDecorations,this.view=r.view,this.HTMLAttributes=r.HTMLAttributes,this.getPos=r.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var r,n,i,o,s,a,l;const{view:c}=this.editor,d=e.target,f=d.nodeType===3?(r=d.parentElement)===null||r===void 0?void 0:r.closest("[data-drag-handle]"):d.closest("[data-drag-handle]");if(!this.dom||!((n=this.contentDOM)===null||n===void 0)&&n.contains(d)||!f)return;let p=0,m=0;if(this.dom!==f){const w=this.dom.getBoundingClientRect(),T=f.getBoundingClientRect(),M=(i=e.offsetX)!==null&&i!==void 0?i:(o=e.nativeEvent)===null||o===void 0?void 0:o.offsetX,j=(s=e.offsetY)!==null&&s!==void 0?s:(a=e.nativeEvent)===null||a===void 0?void 0:a.offsetY;p=T.x-w.x+M,m=T.y-w.y+j}(l=e.dataTransfer)===null||l===void 0||l.setDragImage(this.dom,p,m);const g=this.getPos();if(typeof g!="number")return;const b=rt.create(c.state.doc,g),S=c.state.tr.setSelection(b);c.dispatch(S)}stopEvent(e){var r;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:e});const n=e.target;if(!(this.dom.contains(n)&&!(!((r=this.contentDOM)===null||r===void 0)&&r.contains(n))))return!1;const o=e.type.startsWith("drag"),s=e.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(n.tagName)||n.isContentEditable)&&!s&&!o)return!0;const{isEditable:l}=this.editor,{isDragging:c}=this,d=!!this.node.type.spec.draggable,f=rt.isSelectable(this.node),p=e.type==="copy",m=e.type==="paste",g=e.type==="cut",b=e.type==="mousedown";if(!d&&f&&o&&e.preventDefault(),d&&o&&!c)return e.preventDefault(),!1;if(d&&l&&!c&&b){const S=n.closest("[data-drag-handle]");S&&(this.dom===S||this.dom.contains(S))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(c||s||p||m||g||b&&f)}ignoreMutation(e){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:e}):this.node.isLeaf||this.node.isAtom?!0:e.type==="selection"||this.dom.contains(e.target)&&e.type==="childList"&&(Ny()||k4())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(n=>n.isContentEditable)?!1:this.contentDOM===e.target&&e.type==="attributes"?!0:!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command(({tr:r})=>{const n=this.getPos();return typeof n!="number"?!1:(r.setNodeMarkup(n,void 0,{...this.node.attrs,...e}),!0)})}deleteNode(){const e=this.getPos();if(typeof e!="number")return;const r=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:r})}}function xa(t){return new BI({find:t.find,handler:({state:e,range:r,match:n,pasteEvent:i})=>{const o=dt(t.getAttributes,void 0,n,i);if(o===!1||o===null)return null;const{tr:s}=e,a=n[n.length-1],l=n[0];let c=r.to;if(a){const d=l.search(/\S/),f=r.from+l.indexOf(a),p=f+a.length;if(H1(r.from,r.to,e.doc).filter(g=>g.mark.type.excluded.find(S=>S===t.type&&S!==g.mark.type)).filter(g=>g.to>f).length)return null;p<r.to&&s.delete(p,r.to),f>r.from&&s.delete(r.from+d,f),c=r.from+d+a.length,s.addMark(r.from+d,c,t.type.create(o||{})),s.removeStoredMark(t.type)}}})}function C4(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function E4(t){return new BI({find:t.find,handler({match:e,chain:r,range:n,pasteEvent:i}){const o=dt(t.getAttributes,void 0,e,i),s=dt(t.getContent,void 0,o);if(o===!1||o===null)return null;const a={type:t.type.name,attrs:o};s&&(a.content=s),e.input&&r().deleteRange(n).insertContentAt(n.from,a)}})}const T4=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,A4=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,R4=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,I4=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,O4=Mn.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",lt(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[ql({find:T4,type:this.type}),ql({find:R4,type:this.type})]},addPasteRules(){return[xa({find:A4,type:this.type}),xa({find:I4,type:this.type})]}});let Ab;function Rb(){return Ab===void 0&&(Ab=navigator.platform.includes("Mac")),Ab}function Ly(t){return`${t}`.toLowerCase()==="mod"?Rb()?"⌘":"Ctrl":`${t}`.toLowerCase()==="alt"?Rb()?"⌥":"Alt":`${t}`.toLowerCase()==="shift"?Rb()?"⇧":"Shift":t}function Fy(t){return t.map(Ly).join(" ")}function YI(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(r=YI(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function Gr(){for(var t,e,r=0,n="",i=arguments.length;r<i;r++)(t=arguments[r])&&(e=YI(t))&&(n&&(n+=" "),n+=e);return n}const $1="-",M4=t=>{const e=D4(t),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=t;return{getClassGroupId:s=>{const a=s.split($1);return a[0]===""&&a.length!==1&&a.shift(),JI(a,e)||N4(s)},getConflictingClassGroupIds:(s,a)=>{const l=r[s]||[];return a&&n[s]?[...l,...n[s]]:l}}},JI=(t,e)=>{var s;if(t.length===0)return e.classGroupId;const r=t[0],n=e.nextPart.get(r),i=n?JI(t.slice(1),n):void 0;if(i)return i;if(e.validators.length===0)return;const o=t.join($1);return(s=e.validators.find(({validator:a})=>a(o)))==null?void 0:s.classGroupId},x_=/^\[(.+)\]$/,N4=t=>{if(x_.test(t)){const e=x_.exec(t)[1],r=e==null?void 0:e.substring(0,e.indexOf(":"));if(r)return"arbitrary.."+r}},D4=t=>{const{theme:e,prefix:r}=t,n={nextPart:new Map,validators:[]};return L4(Object.entries(t.classGroups),r).forEach(([o,s])=>{X0(s,n,o,e)}),n},X0=(t,e,r,n)=>{t.forEach(i=>{if(typeof i=="string"){const o=i===""?e:S_(e,i);o.classGroupId=r;return}if(typeof i=="function"){if(P4(i)){X0(i(n),e,r,n);return}e.validators.push({validator:i,classGroupId:r});return}Object.entries(i).forEach(([o,s])=>{X0(s,S_(e,o),r,n)})})},S_=(t,e)=>{let r=t;return e.split($1).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},P4=t=>t.isThemeGetter,L4=(t,e)=>e?t.map(([r,n])=>{const i=n.map(o=>typeof o=="string"?e+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([s,a])=>[e+s,a])):o);return[r,i]}):t,F4=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,r=new Map,n=new Map;const i=(o,s)=>{r.set(o,s),e++,e>t&&(e=0,n=r,r=new Map)};return{get(o){let s=r.get(o);if(s!==void 0)return s;if((s=n.get(o))!==void 0)return i(o,s),s},set(o,s){r.has(o)?r.set(o,s):i(o,s)}}},ZI="!",j4=t=>{const{separator:e,experimentalParseClassName:r}=t,n=e.length===1,i=e[0],o=e.length,s=a=>{const l=[];let c=0,d=0,f;for(let S=0;S<a.length;S++){let w=a[S];if(c===0){if(w===i&&(n||a.slice(S,S+o)===e)){l.push(a.slice(d,S)),d=S+o;continue}if(w==="/"){f=S;continue}}w==="["?c++:w==="]"&&c--}const p=l.length===0?a:a.substring(d),m=p.startsWith(ZI),g=m?p.substring(1):p,b=f&&f>d?f-d:void 0;return{modifiers:l,hasImportantModifier:m,baseClassName:g,maybePostfixModifierPosition:b}};return r?a=>r({className:a,parseClassName:s}):s},B4=t=>{if(t.length<=1)return t;const e=[];let r=[];return t.forEach(n=>{n[0]==="["?(e.push(...r.sort(),n),r=[]):r.push(n)}),e.push(...r.sort()),e},z4=t=>({cache:F4(t.cacheSize),parseClassName:j4(t),...M4(t)}),H4=/\s+/,$4=(t,e)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:i}=e,o=[],s=t.trim().split(H4);let a="";for(let l=s.length-1;l>=0;l-=1){const c=s[l],{modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=r(c);let g=!!m,b=n(g?p.substring(0,m):p);if(!b){if(!g){a=c+(a.length>0?" "+a:a);continue}if(b=n(p),!b){a=c+(a.length>0?" "+a:a);continue}g=!1}const S=B4(d).join(":"),w=f?S+ZI:S,T=w+b;if(o.includes(T))continue;o.push(T);const M=i(b,g);for(let j=0;j<M.length;++j){const $=M[j];o.push(w+$)}a=c+(a.length>0?" "+a:a)}return a};function U4(){let t=0,e,r,n="";for(;t<arguments.length;)(e=arguments[t++])&&(r=QI(e))&&(n&&(n+=" "),n+=r);return n}const QI=t=>{if(typeof t=="string")return t;let e,r="";for(let n=0;n<t.length;n++)t[n]&&(e=QI(t[n]))&&(r&&(r+=" "),r+=e);return r};function W4(t,...e){let r,n,i,o=s;function s(l){const c=e.reduce((d,f)=>f(d),t());return r=z4(c),n=r.cache.get,i=r.cache.set,o=a,a(l)}function a(l){const c=n(l);if(c)return c;const d=$4(l,r);return i(l,d),d}return function(){return o(U4.apply(null,arguments))}}const Kt=t=>{const e=r=>r[t]||[];return e.isThemeGetter=!0,e},eO=/^\[(?:([a-z-]+):)?(.+)\]$/i,V4=/^\d+\/\d+$/,G4=new Set(["px","full","screen"]),K4=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,q4=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,X4=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Y4=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,J4=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Xo=t=>ju(t)||G4.has(t)||V4.test(t),Ys=t=>vd(t,"length",oF),ju=t=>!!t&&!Number.isNaN(Number(t)),Ib=t=>vd(t,"number",ju),Ef=t=>!!t&&Number.isInteger(Number(t)),Z4=t=>t.endsWith("%")&&ju(t.slice(0,-1)),ft=t=>eO.test(t),Js=t=>K4.test(t),Q4=new Set(["length","size","percentage"]),eF=t=>vd(t,Q4,tO),tF=t=>vd(t,"position",tO),rF=new Set(["image","url"]),nF=t=>vd(t,rF,aF),iF=t=>vd(t,"",sF),Tf=()=>!0,vd=(t,e,r)=>{const n=eO.exec(t);return n?n[1]?typeof e=="string"?n[1]===e:e.has(n[1]):r(n[2]):!1},oF=t=>q4.test(t)&&!X4.test(t),tO=()=>!1,sF=t=>Y4.test(t),aF=t=>J4.test(t),lF=()=>{const t=Kt("colors"),e=Kt("spacing"),r=Kt("blur"),n=Kt("brightness"),i=Kt("borderColor"),o=Kt("borderRadius"),s=Kt("borderSpacing"),a=Kt("borderWidth"),l=Kt("contrast"),c=Kt("grayscale"),d=Kt("hueRotate"),f=Kt("invert"),p=Kt("gap"),m=Kt("gradientColorStops"),g=Kt("gradientColorStopPositions"),b=Kt("inset"),S=Kt("margin"),w=Kt("opacity"),T=Kt("padding"),M=Kt("saturate"),j=Kt("scale"),$=Kt("sepia"),W=Kt("skew"),Y=Kt("space"),ee=Kt("translate"),P=()=>["auto","contain","none"],fe=()=>["auto","hidden","clip","visible","scroll"],de=()=>["auto",ft,e],U=()=>[ft,e],ne=()=>["",Xo,Ys],R=()=>["auto",ju,ft],le=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Ee=()=>["solid","dashed","dotted","double","none"],he=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Fe=()=>["start","end","center","between","around","evenly","stretch"],ye=()=>["","0",ft],ze=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ue=()=>[ju,ft];return{cacheSize:500,separator:":",theme:{colors:[Tf],spacing:[Xo,Ys],blur:["none","",Js,ft],brightness:ue(),borderColor:[t],borderRadius:["none","","full",Js,ft],borderSpacing:U(),borderWidth:ne(),contrast:ue(),grayscale:ye(),hueRotate:ue(),invert:ye(),gap:U(),gradientColorStops:[t],gradientColorStopPositions:[Z4,Ys],inset:de(),margin:de(),opacity:ue(),padding:U(),saturate:ue(),scale:ue(),sepia:ye(),skew:ue(),space:U(),translate:U()},classGroups:{aspect:[{aspect:["auto","square","video",ft]}],container:["container"],columns:[{columns:[Js]}],"break-after":[{"break-after":ze()}],"break-before":[{"break-before":ze()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...le(),ft]}],overflow:[{overflow:fe()}],"overflow-x":[{"overflow-x":fe()}],"overflow-y":[{"overflow-y":fe()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[b]}],"inset-x":[{"inset-x":[b]}],"inset-y":[{"inset-y":[b]}],start:[{start:[b]}],end:[{end:[b]}],top:[{top:[b]}],right:[{right:[b]}],bottom:[{bottom:[b]}],left:[{left:[b]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ef,ft]}],basis:[{basis:de()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ft]}],grow:[{grow:ye()}],shrink:[{shrink:ye()}],order:[{order:["first","last","none",Ef,ft]}],"grid-cols":[{"grid-cols":[Tf]}],"col-start-end":[{col:["auto",{span:["full",Ef,ft]},ft]}],"col-start":[{"col-start":R()}],"col-end":[{"col-end":R()}],"grid-rows":[{"grid-rows":[Tf]}],"row-start-end":[{row:["auto",{span:[Ef,ft]},ft]}],"row-start":[{"row-start":R()}],"row-end":[{"row-end":R()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ft]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ft]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...Fe()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Fe(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Fe(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[T]}],px:[{px:[T]}],py:[{py:[T]}],ps:[{ps:[T]}],pe:[{pe:[T]}],pt:[{pt:[T]}],pr:[{pr:[T]}],pb:[{pb:[T]}],pl:[{pl:[T]}],m:[{m:[S]}],mx:[{mx:[S]}],my:[{my:[S]}],ms:[{ms:[S]}],me:[{me:[S]}],mt:[{mt:[S]}],mr:[{mr:[S]}],mb:[{mb:[S]}],ml:[{ml:[S]}],"space-x":[{"space-x":[Y]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[Y]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ft,e]}],"min-w":[{"min-w":[ft,e,"min","max","fit"]}],"max-w":[{"max-w":[ft,e,"none","full","min","max","fit","prose",{screen:[Js]},Js]}],h:[{h:[ft,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ft,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ft,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ft,e,"auto","min","max","fit"]}],"font-size":[{text:["base",Js,Ys]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ib]}],"font-family":[{font:[Tf]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ft]}],"line-clamp":[{"line-clamp":["none",ju,Ib]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Xo,ft]}],"list-image":[{"list-image":["none",ft]}],"list-style-type":[{list:["none","disc","decimal",ft]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ee(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Xo,Ys]}],"underline-offset":[{"underline-offset":["auto",Xo,ft]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:U()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ft]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ft]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...le(),tF]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",eF]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},nF]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[w]}],"border-style":[{border:[...Ee(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[w]}],"divide-style":[{divide:Ee()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...Ee()]}],"outline-offset":[{"outline-offset":[Xo,ft]}],"outline-w":[{outline:[Xo,Ys]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[Xo,Ys]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",Js,iF]}],"shadow-color":[{shadow:[Tf]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":[...he(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":he()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Js,ft]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[M]}],sepia:[{sepia:[$]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[M]}],"backdrop-sepia":[{"backdrop-sepia":[$]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ft]}],duration:[{duration:ue()}],ease:[{ease:["linear","in","out","in-out",ft]}],delay:[{delay:ue()}],animate:[{animate:["none","spin","ping","pulse","bounce",ft]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[j]}],"scale-x":[{"scale-x":[j]}],"scale-y":[{"scale-y":[j]}],rotate:[{rotate:[Ef,ft]}],"translate-x":[{"translate-x":[ee]}],"translate-y":[{"translate-y":[ee]}],"skew-x":[{"skew-x":[W]}],"skew-y":[{"skew-y":[W]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ft]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ft]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":U()}],"scroll-mx":[{"scroll-mx":U()}],"scroll-my":[{"scroll-my":U()}],"scroll-ms":[{"scroll-ms":U()}],"scroll-me":[{"scroll-me":U()}],"scroll-mt":[{"scroll-mt":U()}],"scroll-mr":[{"scroll-mr":U()}],"scroll-mb":[{"scroll-mb":U()}],"scroll-ml":[{"scroll-ml":U()}],"scroll-p":[{"scroll-p":U()}],"scroll-px":[{"scroll-px":U()}],"scroll-py":[{"scroll-py":U()}],"scroll-ps":[{"scroll-ps":U()}],"scroll-pe":[{"scroll-pe":U()}],"scroll-pt":[{"scroll-pt":U()}],"scroll-pr":[{"scroll-pr":U()}],"scroll-pb":[{"scroll-pb":U()}],"scroll-pl":[{"scroll-pl":U()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ft]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[Xo,Ys,Ib]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},cF=W4(lF);function pt(...t){return cF(Gr(t))}const Ve=J.forwardRef((t,e)=>{const{icon:r=void 0,tooltip:n=void 0,disabled:i=!1,customClass:o="",loading:s=void 0,shortcutKeys:a=void 0,tooltipOptions:l={},action:c=void 0,isActive:d=void 0,children:f,asChild:p=!1,upload:m=!1,...g}=t,b=Kh[r],S=p?v1.Slot:Gh;return x.jsxs(Sd,{children:[x.jsx(kd,{asChild:!0,children:x.jsxs(S,{ref:e,size:"sm",className:pt("richtext-w-[32px] richtext-h-[32px]",o),disabled:i,onClick:c,"data-state":d!=null&&d()?"on":"off",...g,children:[b&&x.jsx(b,{className:"richtext-w-4 richtext-h-4"}),f]})}),n&&x.jsx(ac,{...l,children:x.jsxs("div",{className:"richtext-flex richtext-flex-col richtext-items-center richtext-text-center richtext-max-w-24",children:[x.jsx("div",{children:n}),!!(a!=null&&a.length)&&x.jsx("span",{children:Fy(a)})]})})]})}),U1=J.forwardRef(({asChild:t,...e},r)=>{var o;const n=Kh[e.icon],i=t?v1.Slot:Mt;return x.jsxs(Sd,{children:[x.jsx(kd,{asChild:!0,children:x.jsx(i,{ref:r,className:"richtext-h-[32px] richtext-px-[5px] richtext-py-0 richtext-min-w-24 richtext-overflow-hidden",variant:"ghost",disabled:e==null?void 0:e.disabled,...e,children:x.jsxs("div",{className:"richtext-flex richtext-items-center richtext-h-full richtext-font-normal",children:[(e==null?void 0:e.title)&&x.jsx("div",{className:"richtext-flex-grow richtext-text-sm richtext-text-left richtext-truncate",children:e==null?void 0:e.title}),n&&x.jsx(n,{className:"richtext-flex-shrink-0 richtext-w-3 richtext-h-3 richtext-ml-1 richtext-text-zinc-500"})]})})}),x.jsx(ac,{children:x.jsxs("div",{className:"richtext-flex richtext-flex-col richtext-items-center richtext-text-center richtext-max-w-24",children:[(e==null?void 0:e.tooltip)&&x.jsx("div",{children:e==null?void 0:e.tooltip}),x.jsx("div",{className:"richtext-flex",children:!!((o=e==null?void 0:e.shortcutKeys)!=null&&o.length)&&x.jsx("span",{children:Fy(e==null?void 0:e.shortcutKeys)})})]})})]})});class uF{constructor({editor:e,element:r,view:n,tippyOptions:i={},updateDelay:o=250,shouldShow:s}){this.preventHide=!1,this.shouldShow=({view:a,state:l,from:c,to:d})=>{const{doc:f,selection:p}=l,{empty:m}=p,g=!f.textBetween(c,d).length&&B1(l.selection),b=this.element.contains(document.activeElement);return!(!(a.hasFocus()||b)||m||g||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:a})=>{var l;if(this.preventHide){this.preventHide=!1;return}a!=null&&a.relatedTarget&&(!((l=this.element.parentNode)===null||l===void 0)&&l.contains(a.relatedTarget))||(a==null?void 0:a.relatedTarget)!==this.editor.view.dom&&this.hide()},this.tippyBlurHandler=a=>{this.blurHandler({event:a})},this.handleDebouncedUpdate=(a,l)=>{const c=!(l!=null&&l.selection.eq(a.state.selection)),d=!(l!=null&&l.doc.eq(a.state.doc));!c&&!d||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(a,c,d,l)},this.updateDelay))},this.updateHandler=(a,l,c,d)=>{var f,p,m;const{state:g,composing:b}=a,{selection:S}=g;if(b||!l&&!c)return;this.createTooltip();const{ranges:T}=S,M=Math.min(...T.map(W=>W.$from.pos)),j=Math.max(...T.map(W=>W.$to.pos));if(!((f=this.shouldShow)===null||f===void 0?void 0:f.call(this,{editor:this.editor,element:this.element,view:a,state:g,oldState:d,from:M,to:j}))){this.hide();return}(p=this.tippy)===null||p===void 0||p.setProps({getReferenceClientRect:((m=this.tippyOptions)===null||m===void 0?void 0:m.getReferenceClientRect)||(()=>{if(XI(g.selection)){let W=a.nodeDOM(M);if(W){const Y=W.dataset.nodeViewWrapper?W:W.querySelector("[data-node-view-wrapper]");if(Y&&(W=Y.firstChild),W)return W.getBoundingClientRect()}}return G6(a,M,j)})}),this.show()},this.editor=e,this.element=r,this.view=n,this.updateDelay=o,s&&(this.shouldShow=s),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,r=!!e.parentElement;this.tippy||!r||(this.tippy=gd(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,r){const{state:n}=e,i=n.selection.from!==n.selection.to;if(this.updateDelay>0&&i){this.handleDebouncedUpdate(e,r);return}const o=!(r!=null&&r.selection.eq(e.state.selection)),s=!(r!=null&&r.doc.eq(e.state.doc));this.updateHandler(e,o,s,r)}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,r;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(r=this.tippy)===null||r===void 0||r.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const rO=t=>new _t({key:typeof t.pluginKey=="string"?new St(t.pluginKey):t.pluginKey,view:e=>new uF({view:e,...t})});yt.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[rO({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});function dF(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Y0={exports:{}},Ob={};/**
|
|
90
|
+
* @license React
|
|
91
|
+
* use-sync-external-store-shim.production.min.js
|
|
92
|
+
*
|
|
93
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
94
|
+
*
|
|
95
|
+
* This source code is licensed under the MIT license found in the
|
|
96
|
+
* LICENSE file in the root directory of this source tree.
|
|
97
|
+
*/var k_;function fF(){if(k_)return Ob;k_=1;var t=J;function e(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}var r=typeof Object.is=="function"?Object.is:e,n=t.useState,i=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function a(f,p){var m=p(),g=n({inst:{value:m,getSnapshot:p}}),b=g[0].inst,S=g[1];return o(function(){b.value=m,b.getSnapshot=p,l(b)&&S({inst:b})},[f,m,p]),i(function(){return l(b)&&S({inst:b}),f(function(){l(b)&&S({inst:b})})},[f]),s(m),m}function l(f){var p=f.getSnapshot;f=f.value;try{var m=p();return!r(f,m)}catch{return!0}}function c(f,p){return p()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return Ob.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:d,Ob}var Mb={};/**
|
|
98
|
+
* @license React
|
|
99
|
+
* use-sync-external-store-shim.development.js
|
|
100
|
+
*
|
|
101
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
102
|
+
*
|
|
103
|
+
* This source code is licensed under the MIT license found in the
|
|
104
|
+
* LICENSE file in the root directory of this source tree.
|
|
105
|
+
*/var __;function hF(){return __||(__=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var t=J,e=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function r(M){{for(var j=arguments.length,$=new Array(j>1?j-1:0),W=1;W<j;W++)$[W-1]=arguments[W];n("error",M,$)}}function n(M,j,$){{var W=e.ReactDebugCurrentFrame,Y=W.getStackAddendum();Y!==""&&(j+="%s",$=$.concat([Y]));var ee=$.map(function(P){return String(P)});ee.unshift("Warning: "+j),Function.prototype.apply.call(console[M],console,ee)}}function i(M,j){return M===j&&(M!==0||1/M===1/j)||M!==M&&j!==j}var o=typeof Object.is=="function"?Object.is:i,s=t.useState,a=t.useEffect,l=t.useLayoutEffect,c=t.useDebugValue,d=!1,f=!1;function p(M,j,$){d||t.startTransition!==void 0&&(d=!0,r("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var W=j();if(!f){var Y=j();o(W,Y)||(r("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}var ee=s({inst:{value:W,getSnapshot:j}}),P=ee[0].inst,fe=ee[1];return l(function(){P.value=W,P.getSnapshot=j,m(P)&&fe({inst:P})},[M,W,j]),a(function(){m(P)&&fe({inst:P});var de=function(){m(P)&&fe({inst:P})};return M(de)},[M]),c(W),W}function m(M){var j=M.getSnapshot,$=M.value;try{var W=j();return!o($,W)}catch{return!0}}function g(M,j,$){return j()}var b=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",S=!b,w=S?g:p,T=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:w;Mb.useSyncExternalStore=T,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Mb}process.env.NODE_ENV==="production"?Y0.exports=fF():Y0.exports=hF();var jy=Y0.exports;const pF=(...t)=>e=>{t.forEach(r=>{typeof r=="function"?r(e):r&&(r.current=e)})},mF=({contentComponent:t})=>{const e=jy.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return J.createElement(J.Fragment,null,Object.values(e))};function gF(){const t=new Set;let e={};return{subscribe(r){return t.add(r),()=>{t.delete(r)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(r,n){e={...e,[r]:ds.createPortal(n.reactElement,n.element,r)},t.forEach(i=>i())},removeRenderer(r){const n={...e};delete n[r],e=n,t.forEach(i=>i())}}}class yF extends J.Component{constructor(e){var r;super(e),this.editorContentRef=J.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!(!((r=e.editor)===null||r===void 0)&&r.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const e=this.props.editor;if(e&&!e.isDestroyed&&e.options.element){if(e.contentComponent)return;const r=this.editorContentRef.current;r.append(...e.options.element.childNodes),e.setOptions({element:r}),e.contentComponent=gF(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=e.contentComponent.subscribe(()=>{this.setState(n=>n.hasContentComponentInitialized?n:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),e.createNodeViews(),this.initialized=!0}}componentWillUnmount(){const e=this.props.editor;if(!e||(this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),e.contentComponent=null,!e.options.element.firstChild))return;const r=document.createElement("div");r.append(...e.options.element.childNodes),e.setOptions({element:r})}render(){const{editor:e,innerRef:r,...n}=this.props;return J.createElement(J.Fragment,null,J.createElement("div",{ref:pF(r,this.editorContentRef),...n}),(e==null?void 0:e.contentComponent)&&J.createElement(mF,{contentComponent:e.contentComponent}))}}const vF=J.forwardRef((t,e)=>{const r=J.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return J.createElement(yF,{key:r,innerRef:e,...t})}),bF=J.memo(vF);var wF=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,i,o;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!t(e[i],r[i]))return!1;return!0}if(e instanceof Map&&r instanceof Map){if(e.size!==r.size)return!1;for(i of e.entries())if(!r.has(i[0]))return!1;for(i of e.entries())if(!t(i[1],r.get(i[0])))return!1;return!0}if(e instanceof Set&&r instanceof Set){if(e.size!==r.size)return!1;for(i of e.entries())if(!r.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(r)){if(n=e.length,n!=r.length)return!1;for(i=n;i--!==0;)if(e[i]!==r[i])return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(o=Object.keys(e),n=o.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;i--!==0;){var s=o[i];if(!(s==="_owner"&&e.$$typeof)&&!t(e[s],r[s]))return!1}return!0}return e!==e&&r!==r},xF=dF(wF),J0={exports:{}},Nb={};/**
|
|
106
|
+
* @license React
|
|
107
|
+
* use-sync-external-store-shim/with-selector.production.min.js
|
|
108
|
+
*
|
|
109
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
110
|
+
*
|
|
111
|
+
* This source code is licensed under the MIT license found in the
|
|
112
|
+
* LICENSE file in the root directory of this source tree.
|
|
113
|
+
*/var C_;function SF(){if(C_)return Nb;C_=1;var t=J,e=jy;function r(c,d){return c===d&&(c!==0||1/c===1/d)||c!==c&&d!==d}var n=typeof Object.is=="function"?Object.is:r,i=e.useSyncExternalStore,o=t.useRef,s=t.useEffect,a=t.useMemo,l=t.useDebugValue;return Nb.useSyncExternalStoreWithSelector=function(c,d,f,p,m){var g=o(null);if(g.current===null){var b={hasValue:!1,value:null};g.current=b}else b=g.current;g=a(function(){function w(W){if(!T){if(T=!0,M=W,W=p(W),m!==void 0&&b.hasValue){var Y=b.value;if(m(Y,W))return j=Y}return j=W}if(Y=j,n(M,W))return Y;var ee=p(W);return m!==void 0&&m(Y,ee)?Y:(M=W,j=ee)}var T=!1,M,j,$=f===void 0?null:f;return[function(){return w(d())},$===null?void 0:function(){return w($())}]},[d,f,p,m]);var S=i(c,g[0],g[1]);return s(function(){b.hasValue=!0,b.value=S},[S]),l(S),S},Nb}var Db={};/**
|
|
114
|
+
* @license React
|
|
115
|
+
* use-sync-external-store-shim/with-selector.development.js
|
|
116
|
+
*
|
|
117
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
118
|
+
*
|
|
119
|
+
* This source code is licensed under the MIT license found in the
|
|
120
|
+
* LICENSE file in the root directory of this source tree.
|
|
121
|
+
*/var E_;function kF(){return E_||(E_=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var t=J,e=jy;function r(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var n=typeof Object.is=="function"?Object.is:r,i=e.useSyncExternalStore,o=t.useRef,s=t.useEffect,a=t.useMemo,l=t.useDebugValue;function c(d,f,p,m,g){var b=o(null),S;b.current===null?(S={hasValue:!1,value:null},b.current=S):S=b.current;var w=a(function(){var $=!1,W,Y,ee=function(U){if(!$){$=!0,W=U;var ne=m(U);if(g!==void 0&&S.hasValue){var R=S.value;if(g(R,ne))return Y=R,R}return Y=ne,ne}var le=W,Ee=Y;if(n(le,U))return Ee;var he=m(U);return g!==void 0&&g(Ee,he)?Ee:(W=U,Y=he,he)},P=p===void 0?null:p,fe=function(){return ee(f())},de=P===null?void 0:function(){return ee(P())};return[fe,de]},[f,p,m,g]),T=w[0],M=w[1],j=i(d,T,M);return s(function(){S.hasValue=!0,S.value=j},[j]),l(j),j}Db.useSyncExternalStoreWithSelector=c,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Db}process.env.NODE_ENV==="production"?J0.exports=SF():J0.exports=kF();var _F=J0.exports;const CF=typeof window<"u"?J.useLayoutEffect:J.useEffect;class EF{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){const r=()=>{this.transactionNumber+=1,this.subscribers.forEach(i=>i())},n=this.editor;return n.on("transaction",r),()=>{n.off("transaction",r)}}}}function TF(t){var e;const[r]=J.useState(()=>new EF(t.editor)),n=_F.useSyncExternalStoreWithSelector(r.subscribe,r.getSnapshot,r.getServerSnapshot,t.selector,(e=t.equalityFn)!==null&&e!==void 0?e:xF);return CF(()=>r.watch(t.editor),[t.editor,r]),J.useDebugValue(n),n}const T_=process.env.NODE_ENV!=="production",Z0=typeof window>"u",AF=Z0||!!(typeof window<"u"&&window.next);class RF{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(r=>r())}getInitialEditor(){if(this.options.current.immediatelyRender===void 0)return Z0||AF?(T_&&console.warn("Tiptap Error: SSR has been detected, please set `immediatelyRender` explicitly to `false` to avoid hydration mismatches."),null):this.createEditor();if(this.options.current.immediatelyRender&&Z0&&T_)throw new Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");return this.options.current.immediatelyRender?this.createEditor():null}createEditor(){const e={...this.options.current,onBeforeCreate:(...n)=>{var i,o;return(o=(i=this.options.current).onBeforeCreate)===null||o===void 0?void 0:o.call(i,...n)},onBlur:(...n)=>{var i,o;return(o=(i=this.options.current).onBlur)===null||o===void 0?void 0:o.call(i,...n)},onCreate:(...n)=>{var i,o;return(o=(i=this.options.current).onCreate)===null||o===void 0?void 0:o.call(i,...n)},onDestroy:(...n)=>{var i,o;return(o=(i=this.options.current).onDestroy)===null||o===void 0?void 0:o.call(i,...n)},onFocus:(...n)=>{var i,o;return(o=(i=this.options.current).onFocus)===null||o===void 0?void 0:o.call(i,...n)},onSelectionUpdate:(...n)=>{var i,o;return(o=(i=this.options.current).onSelectionUpdate)===null||o===void 0?void 0:o.call(i,...n)},onTransaction:(...n)=>{var i,o;return(o=(i=this.options.current).onTransaction)===null||o===void 0?void 0:o.call(i,...n)},onUpdate:(...n)=>{var i,o;return(o=(i=this.options.current).onUpdate)===null||o===void 0?void 0:o.call(i,...n)},onContentError:(...n)=>{var i,o;return(o=(i=this.options.current).onContentError)===null||o===void 0?void 0:o.call(i,...n)},onDrop:(...n)=>{var i,o;return(o=(i=this.options.current).onDrop)===null||o===void 0?void 0:o.call(i,...n)},onPaste:(...n)=>{var i,o;return(o=(i=this.options.current).onPaste)===null||o===void 0?void 0:o.call(i,...n)}};return new S4(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((n,i)=>n===e[i]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,r=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){r&&r.setOptions(this.options.current);return}r&&!r.isDestroyed&&(r.destroy(),this.instanceId===e&&this.setEditor(null))},1)}}function IF(t={},e=[]){const r=J.useRef(t);r.current=t;const[n]=J.useState(()=>new RF(r)),i=jy.useSyncExternalStore(n.subscribe,n.getEditor,n.getServerSnapshot);return J.useDebugValue(i),J.useEffect(n.onRender(e)),TF({editor:i,selector:({transactionNumber:o})=>t.shouldRerenderOnTransaction===!1?null:t.immediatelyRender&&o===0?0:o+1}),i}const nO=J.createContext({editor:null});nO.Consumer;const OF=()=>J.useContext(nO),qn=t=>{const[e,r]=J.useState(null),{editor:n}=OF();return J.useEffect(()=>{var i;if(!e||!((i=t.editor)===null||i===void 0)&&i.isDestroyed||n!=null&&n.isDestroyed)return;const{pluginKey:o="bubbleMenu",editor:s,tippyOptions:a={},updateDelay:l,shouldShow:c=null}=t,d=s||n;if(!d){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const f=rO({updateDelay:l,editor:d,element:e,pluginKey:o,shouldShow:c,tippyOptions:a});return d.registerPlugin(f),()=>{d.unregisterPlugin(o)}},[t.editor,n,e]),J.createElement("div",{ref:r,className:t.className,style:{visibility:"hidden"}},t.children)},iO=J.createContext({onDragStart:void 0}),oO=()=>J.useContext(iO),MF=t=>{const e=t.as||"div",{nodeViewContentRef:r}=oO();return J.createElement(e,{...t,ref:r,"data-node-view-content":"",style:{whiteSpace:"pre-wrap",...t.style}})},gi=J.forwardRef((t,e)=>{const{onDragStart:r}=oO(),n=t.as||"div";return J.createElement(n,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:r,style:{whiteSpace:"normal",...t.style}})});function NF(t){return!!(typeof t=="function"&&t.prototype&&t.prototype.isReactComponent)}function DF(t){var e;return typeof t=="object"&&((e=t.$$typeof)===null||e===void 0?void 0:e.toString())==="Symbol(react.forward_ref)"}class By{constructor(e,{editor:r,props:n={},as:i="div",className:o=""}){this.ref=null,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=e,this.editor=r,this.props=n,this.element=document.createElement(i),this.element.classList.add("react-renderer"),o&&this.element.classList.add(...o.split(" ")),this.editor.isInitialized?ds.flushSync(()=>{this.render()}):this.render()}render(){var e;const r=this.component,n=this.props,i=this.editor;(NF(r)||DF(r))&&(n.ref=o=>{this.ref=o}),this.reactElement=J.createElement(r,{...n}),(e=i==null?void 0:i.contentComponent)===null||e===void 0||e.setRenderer(this.id,this)}updateProps(e={}){this.props={...this.props,...e},this.render()}destroy(){var e;const r=this.editor;(e=r==null?void 0:r.contentComponent)===null||e===void 0||e.removeRenderer(this.id)}updateAttributes(e){Object.keys(e).forEach(r=>{this.element.setAttribute(r,e[r])})}}class PF extends _4{mount(){const e={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extension,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(c={})=>this.updateAttributes(c),deleteNode:()=>this.deleteNode()};if(!this.component.displayName){const c=d=>d.charAt(0).toUpperCase()+d.substring(1);this.component.displayName=c(this.extension.name)}const i={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:c=>{c&&this.contentDOMElement&&c.firstChild!==this.contentDOMElement&&c.appendChild(this.contentDOMElement)}},o=this.component,s=J.memo(c=>J.createElement(iO.Provider,{value:i},J.createElement(o,c)));s.displayName="ReactNodeView",this.node.isLeaf?this.contentDOMElement=null:this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement&&(this.contentDOMElement.dataset.nodeViewContentReact="",this.contentDOMElement.style.whiteSpace="inherit");let a=this.node.isInline?"span":"div";this.options.as&&(a=this.options.as);const{className:l=""}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.renderer=new By(s,{editor:this.editor,props:e,as:a,className:`node-${this.node.type.name} ${l}`.trim()}),this.updateElementAttributes()}get dom(){var e;if(this.renderer.element.firstElementChild&&!(!((e=this.renderer.element.firstElementChild)===null||e===void 0)&&e.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}handleSelectionUpdate(){const{from:e,to:r}=this.editor.state.selection,n=this.getPos();if(typeof n=="number")if(e<=n&&r>=n+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}}update(e,r,n){const i=o=>{this.renderer.updateProps(o),typeof this.options.attrs=="function"&&this.updateElementAttributes()};if(e.type!==this.node.type)return!1;if(typeof this.options.update=="function"){const o=this.node,s=this.decorations,a=this.innerDecorations;return this.node=e,this.decorations=r,this.innerDecorations=n,this.options.update({oldNode:o,oldDecorations:s,newNode:e,newDecorations:r,oldInnerDecorations:a,innerDecorations:n,updateProps:()=>i({node:e,decorations:r,innerDecorations:n})})}return e===this.node&&this.decorations===r&&this.innerDecorations===n||(this.node=e,this.decorations=r,this.innerDecorations=n,i({node:e,decorations:r,innerDecorations:n})),!0}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove("ProseMirror-selectednode")}destroy(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate),this.contentDOMElement=null}updateElementAttributes(){if(this.options.attrs){let e={};if(typeof this.options.attrs=="function"){const r=this.editor.extensionManager.attributes,n=cg(this.node,r);e=this.options.attrs({node:this.node,HTMLAttributes:n})}else e=this.options.attrs;this.renderer.updateAttributes(e)}}}function _o(t,e){return r=>r.editor.contentComponent?new PF(t,r,e):{}}function bd(t,e){const{state:r}=e,n=r.selection.$anchor;let i=!1;if(n.depth)for(let o=n.depth;o>0;o--)n.node(o).type.name===t&&(e.dispatchTransaction&&e.dispatchTransaction(r.tr.delete(n.before(o),n.after(o)).scrollIntoView()),i=!0);else{const o=r.selection.node;o&&o.type.name===t&&(e.chain().deleteSelection().run(),i=!0)}if(!i){const o=n.pos;if(o){const s=r.tr.doc.nodeAt(o);s&&s.type.name===t&&(e.dispatchTransaction&&e.dispatchTransaction(r.tr.delete(o,o+s.nodeSize)),i=!0)}}return i}var bh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function W1(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function LF(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var A_=Object.prototype.toString,sO=function(e){var r=A_.call(e),n=r==="[object Arguments]";return n||(n=r!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&A_.call(e.callee)==="[object Function]"),n},Pb,R_;function FF(){if(R_)return Pb;R_=1;var t;if(!Object.keys){var e=Object.prototype.hasOwnProperty,r=Object.prototype.toString,n=sO,i=Object.prototype.propertyIsEnumerable,o=!i.call({toString:null},"toString"),s=i.call(function(){},"prototype"),a=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],l=function(p){var m=p.constructor;return m&&m.prototype===p},c={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},d=function(){if(typeof window>"u")return!1;for(var p in window)try{if(!c["$"+p]&&e.call(window,p)&&window[p]!==null&&typeof window[p]=="object")try{l(window[p])}catch{return!0}}catch{return!0}return!1}(),f=function(p){if(typeof window>"u"||!d)return l(p);try{return l(p)}catch{return!1}};t=function(m){var g=m!==null&&typeof m=="object",b=r.call(m)==="[object Function]",S=n(m),w=g&&r.call(m)==="[object String]",T=[];if(!g&&!b&&!S)throw new TypeError("Object.keys called on a non-object");var M=s&&b;if(w&&m.length>0&&!e.call(m,0))for(var j=0;j<m.length;++j)T.push(String(j));if(S&&m.length>0)for(var $=0;$<m.length;++$)T.push(String($));else for(var W in m)!(M&&W==="prototype")&&e.call(m,W)&&T.push(String(W));if(o)for(var Y=f(m),ee=0;ee<a.length;++ee)!(Y&&a[ee]==="constructor")&&e.call(m,a[ee])&&T.push(a[ee]);return T}}return Pb=t,Pb}var jF=Array.prototype.slice,BF=sO,I_=Object.keys,Om=I_?function(e){return I_(e)}:FF(),O_=Object.keys;Om.shim=function(){if(Object.keys){var e=function(){var r=Object.keys(arguments);return r&&r.length===arguments.length}(1,2);e||(Object.keys=function(n){return BF(n)?O_(jF.call(n)):O_(n)})}else Object.keys=Om;return Object.keys||Om};var V1=Om,zF=Error,HF=EvalError,$F=RangeError,UF=ReferenceError,aO=SyntaxError,Ra=TypeError,WF=URIError,zy=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[r]=i;for(r in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var o=Object.getOwnPropertySymbols(e);if(o.length!==1||o[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(e,r);if(s.value!==i||s.enumerable!==!0)return!1}return!0},M_=typeof Symbol<"u"&&Symbol,VF=zy,G1=function(){return typeof M_!="function"||typeof Symbol!="function"||typeof M_("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:VF()},Lb={__proto__:null,foo:{}},GF=Object,KF=function(){return{__proto__:Lb}.foo===Lb.foo&&!(Lb instanceof GF)},qF="Function.prototype.bind called on incompatible ",XF=Object.prototype.toString,YF=Math.max,JF="[object Function]",N_=function(e,r){for(var n=[],i=0;i<e.length;i+=1)n[i]=e[i];for(var o=0;o<r.length;o+=1)n[o+e.length]=r[o];return n},ZF=function(e,r){for(var n=[],i=r,o=0;i<e.length;i+=1,o+=1)n[o]=e[i];return n},QF=function(t,e){for(var r="",n=0;n<t.length;n+=1)r+=t[n],n+1<t.length&&(r+=e);return r},ej=function(e){var r=this;if(typeof r!="function"||XF.apply(r)!==JF)throw new TypeError(qF+r);for(var n=ZF(arguments,1),i,o=function(){if(this instanceof i){var d=r.apply(this,N_(n,arguments));return Object(d)===d?d:this}return r.apply(e,N_(n,arguments))},s=YF(0,r.length-n.length),a=[],l=0;l<s;l++)a[l]="$"+l;if(i=Function("binder","return function ("+QF(a,",")+"){ return binder.apply(this,arguments); }")(o),r.prototype){var c=function(){};c.prototype=r.prototype,i.prototype=new c,c.prototype=null}return i},tj=ej,K1=Function.prototype.bind||tj,rj=Function.prototype.call,nj=Object.prototype.hasOwnProperty,ij=K1,lO=ij.call(rj,nj),bt,oj=zF,sj=HF,aj=$F,lj=UF,Zu=aO,Bu=Ra,cj=WF,cO=Function,Fb=function(t){try{return cO('"use strict"; return ('+t+").constructor;")()}catch{}},zl=Object.getOwnPropertyDescriptor;if(zl)try{zl({},"")}catch{zl=null}var jb=function(){throw new Bu},uj=zl?function(){try{return arguments.callee,jb}catch{try{return zl(arguments,"callee").get}catch{return jb}}}():jb,gu=G1(),dj=KF(),xr=Object.getPrototypeOf||(dj?function(t){return t.__proto__}:null),Eu={},fj=typeof Uint8Array>"u"||!xr?bt:xr(Uint8Array),Hl={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?bt:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?bt:ArrayBuffer,"%ArrayIteratorPrototype%":gu&&xr?xr([][Symbol.iterator]()):bt,"%AsyncFromSyncIteratorPrototype%":bt,"%AsyncFunction%":Eu,"%AsyncGenerator%":Eu,"%AsyncGeneratorFunction%":Eu,"%AsyncIteratorPrototype%":Eu,"%Atomics%":typeof Atomics>"u"?bt:Atomics,"%BigInt%":typeof BigInt>"u"?bt:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?bt:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?bt:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?bt:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":oj,"%eval%":eval,"%EvalError%":sj,"%Float32Array%":typeof Float32Array>"u"?bt:Float32Array,"%Float64Array%":typeof Float64Array>"u"?bt:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?bt:FinalizationRegistry,"%Function%":cO,"%GeneratorFunction%":Eu,"%Int8Array%":typeof Int8Array>"u"?bt:Int8Array,"%Int16Array%":typeof Int16Array>"u"?bt:Int16Array,"%Int32Array%":typeof Int32Array>"u"?bt:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":gu&&xr?xr(xr([][Symbol.iterator]())):bt,"%JSON%":typeof JSON=="object"?JSON:bt,"%Map%":typeof Map>"u"?bt:Map,"%MapIteratorPrototype%":typeof Map>"u"||!gu||!xr?bt:xr(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?bt:Promise,"%Proxy%":typeof Proxy>"u"?bt:Proxy,"%RangeError%":aj,"%ReferenceError%":lj,"%Reflect%":typeof Reflect>"u"?bt:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?bt:Set,"%SetIteratorPrototype%":typeof Set>"u"||!gu||!xr?bt:xr(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?bt:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":gu&&xr?xr(""[Symbol.iterator]()):bt,"%Symbol%":gu?Symbol:bt,"%SyntaxError%":Zu,"%ThrowTypeError%":uj,"%TypedArray%":fj,"%TypeError%":Bu,"%Uint8Array%":typeof Uint8Array>"u"?bt:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?bt:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?bt:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?bt:Uint32Array,"%URIError%":cj,"%WeakMap%":typeof WeakMap>"u"?bt:WeakMap,"%WeakRef%":typeof WeakRef>"u"?bt:WeakRef,"%WeakSet%":typeof WeakSet>"u"?bt:WeakSet};if(xr)try{null.error}catch(t){var hj=xr(xr(t));Hl["%Error.prototype%"]=hj}var pj=function t(e){var r;if(e==="%AsyncFunction%")r=Fb("async function () {}");else if(e==="%GeneratorFunction%")r=Fb("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=Fb("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=t("%AsyncGenerator%");i&&xr&&(r=xr(i.prototype))}return Hl[e]=r,r},D_={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Uh=K1,fg=lO,mj=Uh.call(Function.call,Array.prototype.concat),gj=Uh.call(Function.apply,Array.prototype.splice),P_=Uh.call(Function.call,String.prototype.replace),hg=Uh.call(Function.call,String.prototype.slice),yj=Uh.call(Function.call,RegExp.prototype.exec),vj=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,bj=/\\(\\)?/g,wj=function(e){var r=hg(e,0,1),n=hg(e,-1);if(r==="%"&&n!=="%")throw new Zu("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Zu("invalid intrinsic syntax, expected opening `%`");var i=[];return P_(e,vj,function(o,s,a,l){i[i.length]=a?P_(l,bj,"$1"):s||o}),i},xj=function(e,r){var n=e,i;if(fg(D_,n)&&(i=D_[n],n="%"+i[0]+"%"),fg(Hl,n)){var o=Hl[n];if(o===Eu&&(o=pj(n)),typeof o>"u"&&!r)throw new Bu("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:o}}throw new Zu("intrinsic "+e+" does not exist!")},Co=function(e,r){if(typeof e!="string"||e.length===0)throw new Bu("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Bu('"allowMissing" argument must be a boolean');if(yj(/^%?[^%]*%?$/,e)===null)throw new Zu("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=wj(e),i=n.length>0?n[0]:"",o=xj("%"+i+"%",r),s=o.name,a=o.value,l=!1,c=o.alias;c&&(i=c[0],gj(n,mj([0,1],c)));for(var d=1,f=!0;d<n.length;d+=1){var p=n[d],m=hg(p,0,1),g=hg(p,-1);if((m==='"'||m==="'"||m==="`"||g==='"'||g==="'"||g==="`")&&m!==g)throw new Zu("property names with quotes must have matching quotes");if((p==="constructor"||!f)&&(l=!0),i+="."+p,s="%"+i+"%",fg(Hl,s))a=Hl[s];else if(a!=null){if(!(p in a)){if(!r)throw new Bu("base intrinsic for "+e+" exists, but the property is not available.");return}if(zl&&d+1>=n.length){var b=zl(a,p);f=!!b,f&&"get"in b&&!("originalValue"in b.get)?a=b.get:a=a[p]}else f=fg(a,p),a=a[p];f&&!l&&(Hl[s]=a)}}return a},Sj=Co,Mm=Sj("%Object.defineProperty%",!0)||!1;if(Mm)try{Mm({},"a",{value:1})}catch{Mm=!1}var q1=Mm,kj=Co,Nm=kj("%Object.getOwnPropertyDescriptor%",!0);if(Nm)try{Nm([],"length")}catch{Nm=null}var X1=Nm,L_=q1,_j=aO,yu=Ra,F_=X1,Y1=function(e,r,n){if(!e||typeof e!="object"&&typeof e!="function")throw new yu("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new yu("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new yu("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new yu("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new yu("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new yu("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,s=arguments.length>5?arguments[5]:null,a=arguments.length>6?arguments[6]:!1,l=!!F_&&F_(e,r);if(L_)L_(e,r,{configurable:s===null&&l?l.configurable:!s,enumerable:i===null&&l?l.enumerable:!i,value:n,writable:o===null&&l?l.writable:!o});else if(a||!i&&!o&&!s)e[r]=n;else throw new _j("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Q0=q1,uO=function(){return!!Q0};uO.hasArrayLengthDefineBug=function(){if(!Q0)return null;try{return Q0([],"length",{value:1}).length!==1}catch{return!0}};var J1=uO,Cj=V1,Ej=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",Tj=Object.prototype.toString,Aj=Array.prototype.concat,j_=Y1,Rj=function(t){return typeof t=="function"&&Tj.call(t)==="[object Function]"},dO=J1(),Ij=function(t,e,r,n){if(e in t){if(n===!0){if(t[e]===r)return}else if(!Rj(n)||!n())return}dO?j_(t,e,r,!0):j_(t,e,r)},fO=function(t,e){var r=arguments.length>2?arguments[2]:{},n=Cj(e);Ej&&(n=Aj.call(n,Object.getOwnPropertySymbols(e)));for(var i=0;i<n.length;i+=1)Ij(t,n[i],e[n[i]],r[n[i]])};fO.supportsDescriptors=!!dO;var ic=fO,hO={exports:{}},Oj=Co,B_=Y1,Mj=J1(),z_=X1,H_=Ra,Nj=Oj("%Math.floor%"),Dj=function(e,r){if(typeof e!="function")throw new H_("`fn` is not a function");if(typeof r!="number"||r<0||r>4294967295||Nj(r)!==r)throw new H_("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],i=!0,o=!0;if("length"in e&&z_){var s=z_(e,"length");s&&!s.configurable&&(i=!1),s&&!s.writable&&(o=!1)}return(i||o||!n)&&(Mj?B_(e,"length",r,!0,!0):B_(e,"length",r)),e};(function(t){var e=K1,r=Co,n=Dj,i=Ra,o=r("%Function.prototype.apply%"),s=r("%Function.prototype.call%"),a=r("%Reflect.apply%",!0)||e.call(s,o),l=q1,c=r("%Math.max%");t.exports=function(p){if(typeof p!="function")throw new i("a function is required");var m=a(e,s,arguments);return n(m,1+c(0,p.length-(arguments.length-1)),!0)};var d=function(){return a(e,o,arguments)};l?l(t.exports,"apply",{value:d}):t.exports.apply=d})(hO);var wd=hO.exports,pO=Co,mO=wd,Pj=mO(pO("String.prototype.indexOf")),wi=function(e,r){var n=pO(e,!!r);return typeof n=="function"&&Pj(e,".prototype.")>-1?mO(n):n},Lj=V1,gO=zy(),yO=wi,$_=Object,Fj=yO("Array.prototype.push"),U_=yO("Object.prototype.propertyIsEnumerable"),jj=gO?Object.getOwnPropertySymbols:null,vO=function(e,r){if(e==null)throw new TypeError("target must be an object");var n=$_(e);if(arguments.length===1)return n;for(var i=1;i<arguments.length;++i){var o=$_(arguments[i]),s=Lj(o),a=gO&&(Object.getOwnPropertySymbols||jj);if(a)for(var l=a(o),c=0;c<l.length;++c){var d=l[c];U_(o,d)&&Fj(s,d)}for(var f=0;f<s.length;++f){var p=s[f];if(U_(o,p)){var m=o[p];n[p]=m}}}return n},Bb=vO,Bj=function(){if(!Object.assign)return!1;for(var t="abcdefghijklmnopqrst",e=t.split(""),r={},n=0;n<e.length;++n)r[e[n]]=e[n];var i=Object.assign({},r),o="";for(var s in i)o+=s;return t!==o},zj=function(){if(!Object.assign||!Object.preventExtensions)return!1;var t=Object.preventExtensions({1:2});try{Object.assign(t,"xy")}catch{return t[1]==="y"}return!1},bO=function(){return!Object.assign||Bj()||zj()?Bb:Object.assign},Hj=ic,$j=bO,Uj=function(){var e=$j();return Hj(Object,{assign:e},{assign:function(){return Object.assign!==e}}),e},Wj=ic,Vj=wd,Gj=vO,wO=bO,Kj=Uj,qj=Vj.apply(wO()),xO=function(e,r){return qj(Object,arguments)};Wj(xO,{getPolyfill:wO,implementation:Gj,shim:Kj});var Xj=xO,wh=function(){return typeof(function(){}).name=="string"},eh=Object.getOwnPropertyDescriptor;if(eh)try{eh([],"length")}catch{eh=null}wh.functionsHaveConfigurableNames=function(){if(!wh()||!eh)return!1;var e=eh(function(){},"name");return!!e&&!!e.configurable};var Yj=Function.prototype.bind;wh.boundFunctionsHaveNames=function(){return wh()&&typeof Yj=="function"&&(function(){}).bind().name!==""};var Jj=wh,W_=Y1,Zj=J1(),Qj=Jj.functionsHaveConfigurableNames(),eB=Ra,tB=function(e,r){if(typeof e!="function")throw new eB("`fn` is not a function");var n=arguments.length>2&&!!arguments[2];return(!n||Qj)&&(Zj?W_(e,"name",r,!0,!0):W_(e,"name",r)),e},rB=tB,nB=Ra,iB=Object,SO=rB(function(){if(this==null||this!==iB(this))throw new nB("RegExp.prototype.flags getter called on non-object");var e="";return this.hasIndices&&(e+="d"),this.global&&(e+="g"),this.ignoreCase&&(e+="i"),this.multiline&&(e+="m"),this.dotAll&&(e+="s"),this.unicode&&(e+="u"),this.unicodeSets&&(e+="v"),this.sticky&&(e+="y"),e},"get flags",!0),oB=SO,sB=ic.supportsDescriptors,aB=Object.getOwnPropertyDescriptor,kO=function(){if(sB&&/a/mig.flags==="gim"){var e=aB(RegExp.prototype,"flags");if(e&&typeof e.get=="function"&&typeof RegExp.prototype.dotAll=="boolean"&&typeof RegExp.prototype.hasIndices=="boolean"){var r="",n={};if(Object.defineProperty(n,"hasIndices",{get:function(){r+="d"}}),Object.defineProperty(n,"sticky",{get:function(){r+="y"}}),r==="dy")return e.get}}return oB},lB=ic.supportsDescriptors,cB=kO,uB=Object.getOwnPropertyDescriptor,dB=Object.defineProperty,fB=TypeError,V_=Object.getPrototypeOf,hB=/a/,pB=function(){if(!lB||!V_)throw new fB("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var e=cB(),r=V_(hB),n=uB(r,"flags");return(!n||n.get!==e)&&dB(r,"flags",{configurable:!0,enumerable:!1,get:e}),e},mB=ic,gB=wd,yB=SO,_O=kO,vB=pB,CO=gB(_O());mB(CO,{getPolyfill:_O,implementation:yB,shim:vB});var bB=CO,Dm={exports:{}},wB=zy,oc=function(){return wB()&&!!Symbol.toStringTag},xB=oc(),SB=wi,ex=SB("Object.prototype.toString"),Hy=function(e){return xB&&e&&typeof e=="object"&&Symbol.toStringTag in e?!1:ex(e)==="[object Arguments]"},EO=function(e){return Hy(e)?!0:e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&ex(e)!=="[object Array]"&&ex(e.callee)==="[object Function]"},kB=function(){return Hy(arguments)}();Hy.isLegacyArguments=EO;var TO=kB?Hy:EO;const _B={},CB=Object.freeze(Object.defineProperty({__proto__:null,default:_B},Symbol.toStringTag,{value:"Module"})),EB=LF(CB);var Z1=typeof Map=="function"&&Map.prototype,zb=Object.getOwnPropertyDescriptor&&Z1?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,pg=Z1&&zb&&typeof zb.get=="function"?zb.get:null,G_=Z1&&Map.prototype.forEach,Q1=typeof Set=="function"&&Set.prototype,Hb=Object.getOwnPropertyDescriptor&&Q1?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,mg=Q1&&Hb&&typeof Hb.get=="function"?Hb.get:null,K_=Q1&&Set.prototype.forEach,TB=typeof WeakMap=="function"&&WeakMap.prototype,th=TB?WeakMap.prototype.has:null,AB=typeof WeakSet=="function"&&WeakSet.prototype,rh=AB?WeakSet.prototype.has:null,RB=typeof WeakRef=="function"&&WeakRef.prototype,q_=RB?WeakRef.prototype.deref:null,IB=Boolean.prototype.valueOf,OB=Object.prototype.toString,MB=Function.prototype.toString,NB=String.prototype.match,eS=String.prototype.slice,pa=String.prototype.replace,DB=String.prototype.toUpperCase,X_=String.prototype.toLowerCase,AO=RegExp.prototype.test,Y_=Array.prototype.concat,fo=Array.prototype.join,PB=Array.prototype.slice,J_=Math.floor,tx=typeof BigInt=="function"?BigInt.prototype.valueOf:null,$b=Object.getOwnPropertySymbols,rx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Qu=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Yr=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Qu||!0)?Symbol.toStringTag:null,RO=Object.prototype.propertyIsEnumerable,Z_=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function Q_(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||AO.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-J_(-t):J_(t);if(n!==t){var i=String(n),o=eS.call(e,i.length+1);return pa.call(i,r,"$&_")+"."+pa.call(pa.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return pa.call(e,r,"$&_")}var nx=EB,eC=nx.custom,tC=OO(eC)?eC:null,LB=function t(e,r,n,i){var o=r||{};if(na(o,"quoteStyle")&&o.quoteStyle!=="single"&&o.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(na(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=na(o,"customInspect")?o.customInspect:!0;if(typeof s!="boolean"&&s!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(na(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(na(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=o.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return NO(e,o);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var l=String(e);return a?Q_(e,l):l}if(typeof e=="bigint"){var c=String(e)+"n";return a?Q_(e,c):c}var d=typeof o.depth>"u"?5:o.depth;if(typeof n>"u"&&(n=0),n>=d&&d>0&&typeof e=="object")return ix(e)?"[Array]":"[Object]";var f=e8(o,n);if(typeof i>"u")i=[];else if(MO(i,e)>=0)return"[Circular]";function p(ne,R,le){if(R&&(i=PB.call(i),i.push(R)),le){var Ee={depth:o.depth};return na(o,"quoteStyle")&&(Ee.quoteStyle=o.quoteStyle),t(ne,Ee,n+1,i)}return t(ne,o,n+1,i)}if(typeof e=="function"&&!rC(e)){var m=VB(e),g=Vp(e,p);return"[Function"+(m?": "+m:" (anonymous)")+"]"+(g.length>0?" { "+fo.call(g,", ")+" }":"")}if(OO(e)){var b=Qu?pa.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):rx.call(e);return typeof e=="object"&&!Qu?Af(b):b}if(JB(e)){for(var S="<"+X_.call(String(e.nodeName)),w=e.attributes||[],T=0;T<w.length;T++)S+=" "+w[T].name+"="+IO(FB(w[T].value),"double",o);return S+=">",e.childNodes&&e.childNodes.length&&(S+="..."),S+="</"+X_.call(String(e.nodeName))+">",S}if(ix(e)){if(e.length===0)return"[]";var M=Vp(e,p);return f&&!QB(M)?"["+ox(M,f)+"]":"[ "+fo.call(M,", ")+" ]"}if(BB(e)){var j=Vp(e,p);return!("cause"in Error.prototype)&&"cause"in e&&!RO.call(e,"cause")?"{ ["+String(e)+"] "+fo.call(Y_.call("[cause]: "+p(e.cause),j),", ")+" }":j.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+fo.call(j,", ")+" }"}if(typeof e=="object"&&s){if(tC&&typeof e[tC]=="function"&&nx)return nx(e,{depth:d-n});if(s!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(GB(e)){var $=[];return G_&&G_.call(e,function(ne,R){$.push(p(R,e,!0)+" => "+p(ne,e))}),nC("Map",pg.call(e),$,f)}if(XB(e)){var W=[];return K_&&K_.call(e,function(ne){W.push(p(ne,e))}),nC("Set",mg.call(e),W,f)}if(KB(e))return Ub("WeakMap");if(YB(e))return Ub("WeakSet");if(qB(e))return Ub("WeakRef");if(HB(e))return Af(p(Number(e)));if(UB(e))return Af(p(tx.call(e)));if($B(e))return Af(IB.call(e));if(zB(e))return Af(p(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(typeof globalThis<"u"&&e===globalThis||typeof bh<"u"&&e===bh)return"{ [object globalThis] }";if(!jB(e)&&!rC(e)){var Y=Vp(e,p),ee=Z_?Z_(e)===Object.prototype:e instanceof Object||e.constructor===Object,P=e instanceof Object?"":"null prototype",fe=!ee&&Yr&&Object(e)===e&&Yr in e?eS.call(Ia(e),8,-1):P?"Object":"",de=ee||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",U=de+(fe||P?"["+fo.call(Y_.call([],fe||[],P||[]),": ")+"] ":"");return Y.length===0?U+"{}":f?U+"{"+ox(Y,f)+"}":U+"{ "+fo.call(Y,", ")+" }"}return String(e)};function IO(t,e,r){var n=(r.quoteStyle||e)==="double"?'"':"'";return n+t+n}function FB(t){return pa.call(String(t),/"/g,""")}function ix(t){return Ia(t)==="[object Array]"&&(!Yr||!(typeof t=="object"&&Yr in t))}function jB(t){return Ia(t)==="[object Date]"&&(!Yr||!(typeof t=="object"&&Yr in t))}function rC(t){return Ia(t)==="[object RegExp]"&&(!Yr||!(typeof t=="object"&&Yr in t))}function BB(t){return Ia(t)==="[object Error]"&&(!Yr||!(typeof t=="object"&&Yr in t))}function zB(t){return Ia(t)==="[object String]"&&(!Yr||!(typeof t=="object"&&Yr in t))}function HB(t){return Ia(t)==="[object Number]"&&(!Yr||!(typeof t=="object"&&Yr in t))}function $B(t){return Ia(t)==="[object Boolean]"&&(!Yr||!(typeof t=="object"&&Yr in t))}function OO(t){if(Qu)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!rx)return!1;try{return rx.call(t),!0}catch{}return!1}function UB(t){if(!t||typeof t!="object"||!tx)return!1;try{return tx.call(t),!0}catch{}return!1}var WB=Object.prototype.hasOwnProperty||function(t){return t in this};function na(t,e){return WB.call(t,e)}function Ia(t){return OB.call(t)}function VB(t){if(t.name)return t.name;var e=NB.call(MB.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function MO(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}function GB(t){if(!pg||!t||typeof t!="object")return!1;try{pg.call(t);try{mg.call(t)}catch{return!0}return t instanceof Map}catch{}return!1}function KB(t){if(!th||!t||typeof t!="object")return!1;try{th.call(t,th);try{rh.call(t,rh)}catch{return!0}return t instanceof WeakMap}catch{}return!1}function qB(t){if(!q_||!t||typeof t!="object")return!1;try{return q_.call(t),!0}catch{}return!1}function XB(t){if(!mg||!t||typeof t!="object")return!1;try{mg.call(t);try{pg.call(t)}catch{return!0}return t instanceof Set}catch{}return!1}function YB(t){if(!rh||!t||typeof t!="object")return!1;try{rh.call(t,rh);try{th.call(t,th)}catch{return!0}return t instanceof WeakSet}catch{}return!1}function JB(t){return!t||typeof t!="object"?!1:typeof HTMLElement<"u"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}function NO(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return NO(eS.call(t,0,e.maxStringLength),e)+n}var i=pa.call(pa.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,ZB);return IO(i,"single",e)}function ZB(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+DB.call(e.toString(16))}function Af(t){return"Object("+t+")"}function Ub(t){return t+" { ? }"}function nC(t,e,r,n){var i=n?ox(r,n):fo.call(r,", ");return t+" ("+e+") {"+i+"}"}function QB(t){for(var e=0;e<t.length;e++)if(MO(t[e],`
|
|
122
|
+
`)>=0)return!1;return!0}function e8(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=fo.call(Array(t.indent+1)," ");else return null;return{base:r,prev:fo.call(Array(e+1),r)}}function ox(t,e){if(t.length===0)return"";var r=`
|
|
123
|
+
`+e.prev+e.base;return r+fo.call(t,","+r)+`
|
|
124
|
+
`+e.prev}function Vp(t,e){var r=ix(t),n=[];if(r){n.length=t.length;for(var i=0;i<t.length;i++)n[i]=na(t,i)?e(t[i],t):""}var o=typeof $b=="function"?$b(t):[],s;if(Qu){s={};for(var a=0;a<o.length;a++)s["$"+o[a]]=o[a]}for(var l in t)na(t,l)&&(r&&String(Number(l))===l&&l<t.length||Qu&&s["$"+l]instanceof Symbol||(AO.call(/[^\w$]/,l)?n.push(e(l,t)+": "+e(t[l],t)):n.push(l+": "+e(t[l],t))));if(typeof $b=="function")for(var c=0;c<o.length;c++)RO.call(t,o[c])&&n.push("["+e(o[c])+"]: "+e(t[o[c]],t));return n}var DO=Co,xd=wi,t8=LB,r8=Ra,Gp=DO("%WeakMap%",!0),Kp=DO("%Map%",!0),n8=xd("WeakMap.prototype.get",!0),i8=xd("WeakMap.prototype.set",!0),o8=xd("WeakMap.prototype.has",!0),s8=xd("Map.prototype.get",!0),a8=xd("Map.prototype.set",!0),l8=xd("Map.prototype.has",!0),tS=function(t,e){for(var r=t,n;(n=r.next)!==null;r=n)if(n.key===e)return r.next=n.next,n.next=t.next,t.next=n,n},c8=function(t,e){var r=tS(t,e);return r&&r.value},u8=function(t,e,r){var n=tS(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}},d8=function(t,e){return!!tS(t,e)},PO=function(){var e,r,n,i={assert:function(o){if(!i.has(o))throw new r8("Side channel does not contain "+t8(o))},get:function(o){if(Gp&&o&&(typeof o=="object"||typeof o=="function")){if(e)return n8(e,o)}else if(Kp){if(r)return s8(r,o)}else if(n)return c8(n,o)},has:function(o){if(Gp&&o&&(typeof o=="object"||typeof o=="function")){if(e)return o8(e,o)}else if(Kp){if(r)return l8(r,o)}else if(n)return d8(n,o);return!1},set:function(o,s){Gp&&o&&(typeof o=="object"||typeof o=="function")?(e||(e=new Gp),i8(e,o,s)):Kp?(r||(r=new Kp),a8(r,o,s)):(n||(n={key:{},next:null}),u8(n,o,s))}};return i},f8=lO,Rf=PO(),Yo=Ra,rS={assert:function(t,e){if(!t||typeof t!="object"&&typeof t!="function")throw new Yo("`O` is not an object");if(typeof e!="string")throw new Yo("`slot` must be a string");if(Rf.assert(t),!rS.has(t,e))throw new Yo("`"+e+"` is not present on `O`")},get:function(t,e){if(!t||typeof t!="object"&&typeof t!="function")throw new Yo("`O` is not an object");if(typeof e!="string")throw new Yo("`slot` must be a string");var r=Rf.get(t);return r&&r["$"+e]},has:function(t,e){if(!t||typeof t!="object"&&typeof t!="function")throw new Yo("`O` is not an object");if(typeof e!="string")throw new Yo("`slot` must be a string");var r=Rf.get(t);return!!r&&f8(r,"$"+e)},set:function(t,e,r){if(!t||typeof t!="object"&&typeof t!="function")throw new Yo("`O` is not an object");if(typeof e!="string")throw new Yo("`slot` must be a string");var n=Rf.get(t);n||(n={},Rf.set(t,n)),n["$"+e]=r}};Object.freeze&&Object.freeze(rS);var h8=rS,If=h8,p8=SyntaxError,iC=typeof StopIteration=="object"?StopIteration:null,m8=function(e){if(!iC)throw new p8("this environment lacks StopIteration");If.set(e,"[[Done]]",!1);var r={next:function(){var i=If.get(this,"[[Iterator]]"),o=If.get(i,"[[Done]]");try{return{done:o,value:o?void 0:i.next()}}catch(s){if(If.set(i,"[[Done]]",!0),s!==iC)throw s;return{done:!0,value:void 0}}}};return If.set(r,"[[Iterator]]",e),r},g8={}.toString,LO=Array.isArray||function(t){return g8.call(t)=="[object Array]"},y8=String.prototype.valueOf,v8=function(e){try{return y8.call(e),!0}catch{return!1}},b8=Object.prototype.toString,w8="[object String]",x8=oc(),FO=function(e){return typeof e=="string"?!0:typeof e!="object"?!1:x8?v8(e):b8.call(e)===w8},nS=typeof Map=="function"&&Map.prototype?Map:null,S8=typeof Set=="function"&&Set.prototype?Set:null,gg;nS||(gg=function(e){return!1});var jO=nS?Map.prototype.has:null,oC=S8?Set.prototype.has:null;!gg&&!jO&&(gg=function(e){return!1});var BO=gg||function(e){if(!e||typeof e!="object")return!1;try{if(jO.call(e),oC)try{oC.call(e)}catch{return!0}return e instanceof nS}catch{}return!1},k8=typeof Map=="function"&&Map.prototype?Map:null,iS=typeof Set=="function"&&Set.prototype?Set:null,yg;iS||(yg=function(e){return!1});var sC=k8?Map.prototype.has:null,zO=iS?Set.prototype.has:null;!yg&&!zO&&(yg=function(e){return!1});var HO=yg||function(e){if(!e||typeof e!="object")return!1;try{if(zO.call(e),sC)try{sC.call(e)}catch{return!0}return e instanceof iS}catch{}return!1},aC=TO,lC=m8;if(G1()||zy()){var Wb=Symbol.iterator;Dm.exports=function(e){if(e!=null&&typeof e[Wb]<"u")return e[Wb]();if(aC(e))return Array.prototype[Wb].call(e)}}else{var _8=LO,C8=FO,cC=Co,E8=cC("%Map%",!0),T8=cC("%Set%",!0),Di=wi,uC=Di("Array.prototype.push"),dC=Di("String.prototype.charCodeAt"),A8=Di("String.prototype.slice"),R8=function(e,r){var n=e.length;if(r+1>=n)return r+1;var i=dC(e,r);if(i<55296||i>56319)return r+1;var o=dC(e,r+1);return o<56320||o>57343?r+1:r+2},Vb=function(e){var r=0;return{next:function(){var i=r>=e.length,o;return i||(o=e[r],r+=1),{done:i,value:o}}}},fC=function(e,r){if(_8(e)||aC(e))return Vb(e);if(C8(e)){var n=0;return{next:function(){var o=R8(e,n),s=A8(e,n,o);return n=o,{done:o>e.length,value:s}}}}if(r&&typeof e["_es6-shim iterator_"]<"u")return e["_es6-shim iterator_"]()};if(!E8&&!T8)Dm.exports=function(e){if(e!=null)return fC(e,!0)};else{var I8=BO,O8=HO,hC=Di("Map.prototype.forEach",!0),pC=Di("Set.prototype.forEach",!0);if(typeof process>"u"||!process.versions||!process.versions.node)var mC=Di("Map.prototype.iterator",!0),gC=Di("Set.prototype.iterator",!0);var yC=Di("Map.prototype.@@iterator",!0)||Di("Map.prototype._es6-shim iterator_",!0),vC=Di("Set.prototype.@@iterator",!0)||Di("Set.prototype._es6-shim iterator_",!0),M8=function(e){if(I8(e)){if(mC)return lC(mC(e));if(yC)return yC(e);if(hC){var r=[];return hC(e,function(i,o){uC(r,[o,i])}),Vb(r)}}if(O8(e)){if(gC)return lC(gC(e));if(vC)return vC(e);if(pC){var n=[];return pC(e,function(i){uC(n,i)}),Vb(n)}}};Dm.exports=function(e){return M8(e)||fC(e)}}}var N8=Dm.exports,bC=function(t){return t!==t},$O=function(e,r){return e===0&&r===0?1/e===1/r:!!(e===r||bC(e)&&bC(r))},D8=$O,UO=function(){return typeof Object.is=="function"?Object.is:D8},P8=UO,L8=ic,F8=function(){var e=P8();return L8(Object,{is:e},{is:function(){return Object.is!==e}}),e},j8=ic,B8=wd,z8=$O,WO=UO,H8=F8,VO=B8(WO(),Object);j8(VO,{getPolyfill:WO,implementation:z8,shim:H8});var $8=VO,U8=wd,GO=wi,W8=Co,sx=W8("%ArrayBuffer%",!0),Pm=GO("ArrayBuffer.prototype.byteLength",!0),V8=GO("Object.prototype.toString"),wC=!!sx&&!Pm&&new sx(0).slice,xC=!!wC&&U8(wC),KO=Pm||xC?function(e){if(!e||typeof e!="object")return!1;try{return Pm?Pm(e):xC(e,0),!0}catch{return!1}}:sx?function(e){return V8(e)==="[object ArrayBuffer]"}:function(e){return!1},G8=Date.prototype.getDay,K8=function(e){try{return G8.call(e),!0}catch{return!1}},q8=Object.prototype.toString,X8="[object Date]",Y8=oc(),J8=function(e){return typeof e!="object"||e===null?!1:Y8?K8(e):q8.call(e)===X8},ax=wi,qO=oc(),XO,YO,lx,cx;if(qO){XO=ax("Object.prototype.hasOwnProperty"),YO=ax("RegExp.prototype.exec"),lx={};var Gb=function(){throw lx};cx={toString:Gb,valueOf:Gb},typeof Symbol.toPrimitive=="symbol"&&(cx[Symbol.toPrimitive]=Gb)}var Z8=ax("Object.prototype.toString"),Q8=Object.getOwnPropertyDescriptor,ez="[object RegExp]",tz=qO?function(e){if(!e||typeof e!="object")return!1;var r=Q8(e,"lastIndex"),n=r&&XO(r,"value");if(!n)return!1;try{YO(e,cx)}catch(i){return i===lx}}:function(e){return!e||typeof e!="object"&&typeof e!="function"?!1:Z8(e)===ez},rz=wi,SC=rz("SharedArrayBuffer.prototype.byteLength",!0),nz=SC?function(e){if(!e||typeof e!="object")return!1;try{return SC(e),!0}catch{return!1}}:function(e){return!1},iz=Number.prototype.toString,oz=function(e){try{return iz.call(e),!0}catch{return!1}},sz=Object.prototype.toString,az="[object Number]",lz=oc(),cz=function(e){return typeof e=="number"?!0:typeof e!="object"?!1:lz?oz(e):sz.call(e)===az},JO=wi,uz=JO("Boolean.prototype.toString"),dz=JO("Object.prototype.toString"),fz=function(e){try{return uz(e),!0}catch{return!1}},hz="[object Boolean]",pz=oc(),mz=function(e){return typeof e=="boolean"?!0:e===null||typeof e!="object"?!1:pz&&Symbol.toStringTag in e?fz(e):dz(e)===hz},ux={exports:{}},gz=Object.prototype.toString,yz=G1();if(yz){var vz=Symbol.prototype.toString,bz=/^Symbol\(.*\)$/,wz=function(e){return typeof e.valueOf()!="symbol"?!1:bz.test(vz.call(e))};ux.exports=function(e){if(typeof e=="symbol")return!0;if(gz.call(e)!=="[object Symbol]")return!1;try{return wz(e)}catch{return!1}}}else ux.exports=function(e){return!1};var xz=ux.exports,dx={exports:{}},kC=typeof BigInt<"u"&&BigInt,Sz=function(){return typeof kC=="function"&&typeof BigInt=="function"&&typeof kC(42)=="bigint"&&typeof BigInt(42)=="bigint"},kz=Sz();if(kz){var _z=BigInt.prototype.valueOf,Cz=function(e){try{return _z.call(e),!0}catch{}return!1};dx.exports=function(e){return e===null||typeof e>"u"||typeof e=="boolean"||typeof e=="string"||typeof e=="number"||typeof e=="symbol"||typeof e=="function"?!1:typeof e=="bigint"?!0:Cz(e)}}else dx.exports=function(e){return!1};var Ez=dx.exports,Tz=FO,Az=cz,Rz=mz,Iz=xz,Oz=Ez,Mz=function(e){if(e==null||typeof e!="object"&&typeof e!="function")return null;if(Tz(e))return"String";if(Az(e))return"Number";if(Rz(e))return"Boolean";if(Iz(e))return"Symbol";if(Oz(e))return"BigInt"},vg=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,_C=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,bg;vg||(bg=function(e){return!1});var fx=vg?vg.prototype.has:null,Kb=_C?_C.prototype.has:null;!bg&&!fx&&(bg=function(e){return!1});var Nz=bg||function(e){if(!e||typeof e!="object")return!1;try{if(fx.call(e,fx),Kb)try{Kb.call(e,Kb)}catch{return!0}return e instanceof vg}catch{}return!1},hx={exports:{}},Dz=Co,ZO=wi,Pz=Dz("%WeakSet%",!0),qb=ZO("WeakSet.prototype.has",!0);if(qb){var Xb=ZO("WeakMap.prototype.has",!0);hx.exports=function(e){if(!e||typeof e!="object")return!1;try{if(qb(e,qb),Xb)try{Xb(e,Xb)}catch{return!0}return e instanceof Pz}catch{}return!1}}else hx.exports=function(e){return!1};var Lz=hx.exports,Fz=BO,jz=HO,Bz=Nz,zz=Lz,Hz=function(e){if(e&&typeof e=="object"){if(Fz(e))return"Map";if(jz(e))return"Set";if(Bz(e))return"WeakMap";if(zz(e))return"WeakSet"}return!1},QO=Function.prototype.toString,Nu=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,px,Lm;if(typeof Nu=="function"&&typeof Object.defineProperty=="function")try{px=Object.defineProperty({},"length",{get:function(){throw Lm}}),Lm={},Nu(function(){throw 42},null,px)}catch(t){t!==Lm&&(Nu=null)}else Nu=null;var $z=/^\s*class\b/,mx=function(e){try{var r=QO.call(e);return $z.test(r)}catch{return!1}},Yb=function(e){try{return mx(e)?!1:(QO.call(e),!0)}catch{return!1}},Fm=Object.prototype.toString,Uz="[object Object]",Wz="[object Function]",Vz="[object GeneratorFunction]",Gz="[object HTMLAllCollection]",Kz="[object HTML document.all class]",qz="[object HTMLCollection]",Xz=typeof Symbol=="function"&&!!Symbol.toStringTag,Yz=!(0 in[,]),gx=function(){return!1};if(typeof document=="object"){var Jz=document.all;Fm.call(Jz)===Fm.call(document.all)&&(gx=function(e){if((Yz||!e)&&(typeof e>"u"||typeof e=="object"))try{var r=Fm.call(e);return(r===Gz||r===Kz||r===qz||r===Uz)&&e("")==null}catch{}return!1})}var Zz=Nu?function(e){if(gx(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;try{Nu(e,null,px)}catch(r){if(r!==Lm)return!1}return!mx(e)&&Yb(e)}:function(e){if(gx(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;if(Xz)return Yb(e);if(mx(e))return!1;var r=Fm.call(e);return r!==Wz&&r!==Vz&&!/^\[object HTML/.test(r)?!1:Yb(e)},Qz=Zz,eH=Object.prototype.toString,eM=Object.prototype.hasOwnProperty,tH=function(e,r,n){for(var i=0,o=e.length;i<o;i++)eM.call(e,i)&&(n==null?r(e[i],i,e):r.call(n,e[i],i,e))},rH=function(e,r,n){for(var i=0,o=e.length;i<o;i++)n==null?r(e.charAt(i),i,e):r.call(n,e.charAt(i),i,e)},nH=function(e,r,n){for(var i in e)eM.call(e,i)&&(n==null?r(e[i],i,e):r.call(n,e[i],i,e))},iH=function(e,r,n){if(!Qz(r))throw new TypeError("iterator must be a function");var i;arguments.length>=3&&(i=n),eH.call(e)==="[object Array]"?tH(e,r,i):typeof e=="string"?rH(e,r,i):nH(e,r,i)},oH=iH,sH=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"],Jb=sH,aH=typeof globalThis>"u"?bh:globalThis,lH=function(){for(var e=[],r=0;r<Jb.length;r++)typeof aH[Jb[r]]=="function"&&(e[e.length]=Jb[r]);return e},wg=oH,cH=lH,CC=wd,oS=wi,jm=X1,uH=oS("Object.prototype.toString"),tM=oc(),EC=typeof globalThis>"u"?bh:globalThis,yx=cH(),sS=oS("String.prototype.slice"),Zb=Object.getPrototypeOf,dH=oS("Array.prototype.indexOf",!0)||function(e,r){for(var n=0;n<e.length;n+=1)if(e[n]===r)return n;return-1},xg={__proto__:null};tM&&jm&&Zb?wg(yx,function(t){var e=new EC[t];if(Symbol.toStringTag in e){var r=Zb(e),n=jm(r,Symbol.toStringTag);if(!n){var i=Zb(r);n=jm(i,Symbol.toStringTag)}xg["$"+t]=CC(n.get)}}):wg(yx,function(t){var e=new EC[t],r=e.slice||e.set;r&&(xg["$"+t]=CC(r))});var fH=function(e){var r=!1;return wg(xg,function(n,i){if(!r)try{"$"+n(e)===i&&(r=sS(i,1))}catch{}}),r},hH=function(e){var r=!1;return wg(xg,function(n,i){if(!r)try{n(e),r=sS(i,1)}catch{}}),r},pH=function(e){if(!e||typeof e!="object")return!1;if(!tM){var r=sS(uH(e),8,-1);return dH(yx,r)>-1?r:r!=="Object"?!1:hH(e)}return jm?fH(e):null},mH=wi,TC=mH("ArrayBuffer.prototype.byteLength",!0),gH=KO,yH=function(e){return gH(e)?TC?TC(e):e.byteLength:NaN},rM=Xj,Eo=wi,AC=bB,vH=Co,ed=N8,bH=PO,RC=$8,IC=TO,OC=LO,MC=KO,NC=J8,DC=tz,PC=nz,LC=V1,FC=Mz,jC=Hz,BC=pH,zC=yH,HC=Eo("SharedArrayBuffer.prototype.byteLength",!0),$C=Eo("Date.prototype.getTime"),Qb=Object.getPrototypeOf,UC=Eo("Object.prototype.toString"),Sg=vH("%Set%",!0),vx=Eo("Map.prototype.has",!0),kg=Eo("Map.prototype.get",!0),WC=Eo("Map.prototype.size",!0),_g=Eo("Set.prototype.add",!0),nM=Eo("Set.prototype.delete",!0),Cg=Eo("Set.prototype.has",!0),Bm=Eo("Set.prototype.size",!0);function VC(t,e,r,n){for(var i=ed(t),o;(o=i.next())&&!o.done;)if(ji(e,o.value,r,n))return nM(t,o.value),!0;return!1}function iM(t){if(typeof t>"u")return null;if(typeof t!="object")return typeof t=="symbol"?!1:typeof t=="string"||typeof t=="number"?+t==+t:!0}function wH(t,e,r,n,i,o){var s=iM(r);if(s!=null)return s;var a=kg(e,s),l=rM({},i,{strict:!1});return typeof a>"u"&&!vx(e,s)||!ji(n,a,l,o)?!1:!vx(t,s)&&ji(n,a,l,o)}function xH(t,e,r){var n=iM(r);return n??(Cg(e,n)&&!Cg(t,n))}function GC(t,e,r,n,i,o){for(var s=ed(t),a,l;(a=s.next())&&!a.done;)if(l=a.value,ji(r,l,i,o)&&ji(n,kg(e,l),i,o))return nM(t,l),!0;return!1}function ji(t,e,r,n){var i=r||{};if(i.strict?RC(t,e):t===e)return!0;var o=FC(t),s=FC(e);if(o!==s)return!1;if(!t||!e||typeof t!="object"&&typeof e!="object")return i.strict?RC(t,e):t==e;var a=n.has(t),l=n.has(e),c;if(a&&l){if(n.get(t)===n.get(e))return!0}else c={};return a||n.set(t,c),l||n.set(e,c),_H(t,e,i,n)}function KC(t){return!t||typeof t!="object"||typeof t.length!="number"||typeof t.copy!="function"||typeof t.slice!="function"||t.length>0&&typeof t[0]!="number"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))}function SH(t,e,r,n){if(Bm(t)!==Bm(e))return!1;for(var i=ed(t),o=ed(e),s,a,l;(s=i.next())&&!s.done;)if(s.value&&typeof s.value=="object")l||(l=new Sg),_g(l,s.value);else if(!Cg(e,s.value)){if(r.strict||!xH(t,e,s.value))return!1;l||(l=new Sg),_g(l,s.value)}if(l){for(;(a=o.next())&&!a.done;)if(a.value&&typeof a.value=="object"){if(!VC(l,a.value,r.strict,n))return!1}else if(!r.strict&&!Cg(t,a.value)&&!VC(l,a.value,r.strict,n))return!1;return Bm(l)===0}return!0}function kH(t,e,r,n){if(WC(t)!==WC(e))return!1;for(var i=ed(t),o=ed(e),s,a,l,c,d,f;(s=i.next())&&!s.done;)if(c=s.value[0],d=s.value[1],c&&typeof c=="object")l||(l=new Sg),_g(l,c);else if(f=kg(e,c),typeof f>"u"&&!vx(e,c)||!ji(d,f,r,n)){if(r.strict||!wH(t,e,c,d,r,n))return!1;l||(l=new Sg),_g(l,c)}if(l){for(;(a=o.next())&&!a.done;)if(c=a.value[0],f=a.value[1],c&&typeof c=="object"){if(!GC(l,t,c,f,r,n))return!1}else if(!r.strict&&(!t.has(c)||!ji(kg(t,c),f,r,n))&&!GC(l,t,c,f,rM({},r,{strict:!1}),n))return!1;return Bm(l)===0}return!0}function _H(t,e,r,n){var i,o;if(typeof t!=typeof e||t==null||e==null||UC(t)!==UC(e)||IC(t)!==IC(e))return!1;var s=OC(t),a=OC(e);if(s!==a)return!1;var l=t instanceof Error,c=e instanceof Error;if(l!==c||(l||c)&&(t.name!==e.name||t.message!==e.message))return!1;var d=DC(t),f=DC(e);if(d!==f||(d||f)&&(t.source!==e.source||AC(t)!==AC(e)))return!1;var p=NC(t),m=NC(e);if(p!==m||(p||m)&&$C(t)!==$C(e)||r.strict&&Qb&&Qb(t)!==Qb(e))return!1;var g=BC(t),b=BC(e);if(g!==b)return!1;if(g||b){if(t.length!==e.length)return!1;for(i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}var S=KC(t),w=KC(e);if(S!==w)return!1;if(S||w){if(t.length!==e.length)return!1;for(i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}var T=MC(t),M=MC(e);if(T!==M)return!1;if(T||M)return zC(t)!==zC(e)?!1:typeof Uint8Array=="function"&&ji(new Uint8Array(t),new Uint8Array(e),r,n);var j=PC(t),$=PC(e);if(j!==$)return!1;if(j||$)return HC(t)!==HC(e)?!1:typeof Uint8Array=="function"&&ji(new Uint8Array(t),new Uint8Array(e),r,n);if(typeof t!=typeof e)return!1;var W=LC(t),Y=LC(e);if(W.length!==Y.length)return!1;for(W.sort(),Y.sort(),i=W.length-1;i>=0;i--)if(W[i]!=Y[i])return!1;for(i=W.length-1;i>=0;i--)if(o=W[i],!ji(t[o],e[o],r,n))return!1;var ee=jC(t),P=jC(e);return ee!==P?!1:ee==="Set"||P==="Set"?SH(t,e,r,n):ee==="Map"?kH(t,e,r,n):!0}var CH=function(e,r,n){return ji(e,r,n,bH())};const aS=W1(CH);function EH(t){return t}function Wh(t,e,r,n){const i=EH,[o,s]=J.useState(i(r)),a=J.useRef(o);return J.useEffect(()=>{const l=()=>{const c={...r,...t.getAttributes(e)};Object.keys(c).forEach(f=>{(c[f]===null||c[f]===void 0)&&(c[f]=r?r[f]:null)});const d=i(c);aS(a.current,d)||(s(d),a.current=d)};return t.on("selectionUpdate",l),t.on("transaction",l),()=>{t.off("selectionUpdate",l),t.off("transaction",l)}},[t,r,e,i]),o}const Vh=At.forwardRef(({className:t,...e},r)=>x.jsx("textarea",{className:pt("richtext-flex richtext-min-h-[80px] richtext-w-full richtext-rounded-md !richtext-border richtext-border-input richtext-bg-background richtext-px-3 richtext-py-2 richtext-text-sm richtext-ring-offset-background placeholder:richtext-text-muted-foreground focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-2 disabled:richtext-cursor-not-allowed disabled:richtext-opacity-50",t),ref:r,...e}));Vh.displayName="Textarea";const qC=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,XC=Gr,lS=(t,e)=>r=>{var n;if((e==null?void 0:e.variants)==null)return XC(t,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:i,defaultVariants:o}=e,s=Object.keys(i).map(c=>{const d=r==null?void 0:r[c],f=o==null?void 0:o[c];if(d===null)return null;const p=qC(d)||qC(f);return i[c][p]}),a=r&&Object.entries(r).reduce((c,d)=>{let[f,p]=d;return p===void 0||(c[f]=p),c},{}),l=e==null||(n=e.compoundVariants)===null||n===void 0?void 0:n.reduce((c,d)=>{let{class:f,className:p,...m}=d;return Object.entries(m).every(g=>{let[b,S]=g;return Array.isArray(S)?S.includes({...o,...a}[b]):{...o,...a}[b]===S})?[...c,f,p]:c},[]);return XC(t,s,l,r==null?void 0:r.class,r==null?void 0:r.className)},TH=lS("richtext-inline-flex richtext-items-center richtext-justify-center richtext-whitespace-nowrap richtext-rounded-md richtext-text-sm richtext-font-medium richtext-ring-offset-background richtext-transition-colors focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-2 disabled:richtext-pointer-events-none disabled:richtext-opacity-50",{variants:{variant:{default:"!richtext-bg-primary !richtext-text-primary-foreground hover:!richtext-bg-primary/90",destructive:"richtext-bg-destructive richtext-text-destructive-foreground hover:richtext-bg-destructive/90",outline:"richtext-border richtext-border-input richtext-bg-background hover:richtext-bg-accent hover:richtext-text-accent-foreground",secondary:"richtext-bg-secondary richtext-text-secondary-foreground hover:richtext-bg-secondary/80",ghost:"hover:richtext-bg-accent hover:richtext-text-accent-foreground",link:"richtext-text-primary richtext-underline-offset-4 hover:richtext-underline"},size:{default:"richtext-h-10 richtext-px-4 richtext-py-2",sm:"richtext-h-9 richtext-rounded-md richtext-px-3",lg:"richtext-h-11 richtext-rounded-md richtext-px-8",icon:"richtext-h-10 richtext-w-10"}},defaultVariants:{variant:"default",size:"default"}}),Mt=At.forwardRef(({className:t,variant:e,size:r,asChild:n=!1,...i},o)=>{const s=n?v1.Slot:"button";return x.jsx(s,{className:pt(TH({variant:e,size:r,className:t})),ref:o,...i})});Mt.displayName="Button";const Oa=tr.Root,Ma=tr.Trigger,YC=tr.Portal,JC=tr.Sub,bx=At.forwardRef(({className:t,inset:e,children:r,...n},i)=>x.jsxs(tr.SubTrigger,{ref:i,className:pt("richtext-flex richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-px-2 richtext-py-1.5 richtext-text-sm richtext-outline-none focus:richtext-bg-accent data-[state=open]:richtext-bg-accent",e&&"richtext-pl-8",t),...n,children:[r,x.jsx(He.ChevronRight,{className:"richtext-ml-auto richtext-h-4 richtext-w-4"})]}));bx.displayName=tr.SubTrigger.displayName;const wx=At.forwardRef(({className:t,...e},r)=>x.jsx(tr.SubContent,{ref:r,className:pt("richtext-z-50 richtext-min-w-[8rem] richtext-overflow-hidden richtext-rounded-md !richtext-border richtext-bg-popover richtext-p-1 richtext-text-popover-foreground richtext-shadow-lg data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0 data-[state=closed]:richtext-zoom-out-95 data-[state=open]:richtext-zoom-in-95 data-[side=bottom]:richtext-slide-in-from-top-2 data-[side=left]:richtext-slide-in-from-right-2 data-[side=right]:richtext-slide-in-from-left-2 data-[side=top]:richtext-slide-in-from-bottom-2",t),...e}));wx.displayName=tr.SubContent.displayName;const ms=At.forwardRef(({className:t,sideOffset:e=4,...r},n)=>x.jsx(tr.Portal,{children:x.jsx(tr.Content,{ref:n,sideOffset:e,className:pt("richtext-z-50 richtext-min-w-[8rem] richtext-overflow-hidden richtext-rounded-md !richtext-border richtext-bg-popover richtext-p-1 richtext-text-popover-foreground richtext-shadow-md data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0 data-[state=closed]:richtext-zoom-out-95 data-[state=open]:richtext-zoom-in-95 data-[side=bottom]:richtext-slide-in-from-top-2 data-[side=left]:richtext-slide-in-from-right-2 data-[side=right]:richtext-slide-in-from-left-2 data-[side=top]:richtext-slide-in-from-bottom-2",t),...r})}));ms.displayName=tr.Content.displayName;const Pi=At.forwardRef(({className:t,inset:e,...r},n)=>x.jsx(tr.Item,{ref:n,className:pt("richtext-relative richtext-flex richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-px-2 richtext-py-1.5 richtext-text-sm richtext-outline-none richtext-transition-colors focus:richtext-bg-accent focus:richtext-text-accent-foreground data-[disabled]:richtext-pointer-events-none data-[disabled]:richtext-opacity-50",e&&"richtext-pl-8",t),...r}));Pi.displayName=tr.Item.displayName;const sc=At.forwardRef(({className:t,children:e,checked:r,...n},i)=>x.jsxs(tr.CheckboxItem,{ref:i,className:pt("richtext-relative richtext-flex richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-py-1.5 richtext-pl-8 richtext-pr-2 richtext-text-sm richtext-outline-none richtext-transition-colors focus:richtext-bg-accent focus:richtext-text-accent-foreground data-[disabled]:richtext-pointer-events-none data-[disabled]:richtext-opacity-50",t),checked:r,...n,children:[x.jsx("span",{className:"richtext-absolute richtext-left-2 richtext-flex richtext-h-3.5 richtext-w-3.5 richtext-items-center richtext-justify-center",children:x.jsx(tr.ItemIndicator,{children:x.jsx(He.Check,{className:"richtext-h-4 richtext-w-4"})})}),e]}));sc.displayName=tr.CheckboxItem.displayName;const AH=At.forwardRef(({className:t,children:e,...r},n)=>x.jsxs(tr.RadioItem,{ref:n,className:pt("richtext-relative richtext-flex richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-py-1.5 richtext-pl-8 richtext-pr-2 richtext-text-sm richtext-outline-none richtext-transition-colors focus:richtext-bg-accent focus:richtext-text-accent-foreground data-[disabled]:richtext-pointer-events-none data-[disabled]:richtext-opacity-50",t),...r,children:[x.jsx("span",{className:"richtext-absolute richtext-left-2 richtext-flex richtext-h-3.5 richtext-w-3.5 richtext-items-center richtext-justify-center",children:x.jsx(tr.ItemIndicator,{children:x.jsx(He.Circle,{className:"richtext-h-2 richtext-w-2 richtext-fill-current"})})}),e]}));AH.displayName=tr.RadioItem.displayName;const RH=At.forwardRef(({className:t,inset:e,...r},n)=>x.jsx(tr.Label,{ref:n,className:pt("richtext-px-2 richtext-py-1.5 richtext-text-sm richtext-font-semibold",e&&"richtext-pl-8",t),...r}));RH.displayName=tr.Label.displayName;const $y=At.forwardRef(({className:t,...e},r)=>x.jsx(tr.Separator,{ref:r,className:pt("richtext--mx-1 richtext-my-1 richtext-h-px richtext-bg-muted",t),...e}));$y.displayName=tr.Separator.displayName;function oM({className:t,...e}){return x.jsx("span",{className:pt("richtext-ml-auto richtext-text-xs richtext-tracking-widest richtext-opacity-60",t),...e})}oM.displayName="DropdownMenuShortcut";const hn=At.forwardRef(({className:t,type:e,...r},n)=>x.jsx("input",{type:e,className:pt("richtext-flex richtext-h-10 richtext-w-full richtext-rounded-md !richtext-border richtext-border-input richtext-bg-background richtext-px-3 richtext-py-2 richtext-text-sm richtext-ring-offset-background file:richtext-border-0 file:richtext-bg-transparent file:richtext-text-sm file:richtext-font-medium placeholder:richtext-text-muted-foreground focus-visible:richtext-outline-none disabled:richtext-cursor-not-allowed disabled:richtext-opacity-50",t),ref:n,...r}));hn.displayName="Input";const IH=lS("richtext-text-sm richtext-font-medium richtext-leading-none peer-disabled:richtext-cursor-not-allowed peer-disabled:richtext-opacity-70"),Kn=At.forwardRef(({className:t,...e},r)=>x.jsx(gR.Root,{ref:r,className:pt(IH(),t),...e}));Kn.displayName=gR.Root.displayName;const xi=ch.Root,Si=ch.Trigger,Xn=At.forwardRef(({className:t,align:e="center",sideOffset:r=4,...n},i)=>x.jsx(ch.Portal,{children:x.jsx(ch.Content,{ref:i,align:e,sideOffset:r,className:pt("richtext-z-50 richtext-w-72 richtext-rounded-md !richtext-border richtext-bg-popover richtext-p-4 richtext-text-popover-foreground richtext-shadow-md richtext-outline-none data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0 data-[state=closed]:richtext-zoom-out-95 data-[state=open]:richtext-zoom-in-95 data-[side=bottom]:richtext-slide-in-from-top-2 data-[side=left]:richtext-slide-in-from-right-2 data-[side=right]:richtext-slide-in-from-left-2 data-[side=top]:richtext-slide-in-from-bottom-2",t),...n})}));Xn.displayName=ch.Content.displayName;const Bi=At.forwardRef(({className:t,orientation:e="horizontal",decorative:r=!0,...n},i)=>x.jsx(yR.Root,{ref:i,decorative:r,orientation:e,className:pt("richtext-shrink-0 richtext-bg-border",e==="horizontal"?"richtext-h-[1px] richtext-w-full":"richtext-h-full richtext-w-[1px]",t),...n}));Bi.displayName=yR.Root.displayName;const cS=At.forwardRef(({className:t,...e},r)=>x.jsx(_0.Root,{className:pt("richtext-peer richtext-inline-flex richtext-h-6 richtext-w-11 richtext-shrink-0 richtext-cursor-pointer richtext-items-center richtext-rounded-full richtext-border-2 richtext-border-transparent richtext-transition-colors focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-2 focus-visible:richtext-ring-offset-background disabled:richtext-cursor-not-allowed disabled:richtext-opacity-50 data-[state=checked]:richtext-bg-primary data-[state=unchecked]:richtext-bg-input",t),...e,ref:r,children:x.jsx(_0.Thumb,{className:pt("richtext-pointer-events-none richtext-block richtext-h-5 richtext-w-5 richtext-rounded-full richtext-bg-background richtext-shadow-lg richtext-ring-0 richtext-transition-transform data-[state=checked]:richtext-translate-x-5 data-[state=unchecked]:richtext-translate-x-0")})}));cS.displayName=_0.Root.displayName;const uS=rc.Root,Uy=At.forwardRef(({className:t,...e},r)=>x.jsx(rc.List,{ref:r,className:pt("richtext-inline-flex richtext-h-10 richtext-items-center richtext-justify-center richtext-rounded-md richtext-bg-muted richtext-p-1 richtext-text-muted-foreground",t),...e}));Uy.displayName=rc.List.displayName;const td=At.forwardRef(({className:t,...e},r)=>x.jsx(rc.Trigger,{ref:r,className:pt("richtext-inline-flex richtext-items-center richtext-justify-center richtext-whitespace-nowrap richtext-rounded-sm richtext-px-3 richtext-py-1.5 richtext-text-sm richtext-font-medium richtext-ring-offset-background richtext-transition-all focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-2 disabled:richtext-pointer-events-none disabled:richtext-opacity-50 data-[state=active]:richtext-bg-background data-[state=active]:richtext-text-foreground data-[state=active]:richtext-shadow-sm",t),...e}));td.displayName=rc.Trigger.displayName;const rd=At.forwardRef(({className:t,...e},r)=>x.jsx(rc.Content,{ref:r,className:pt("richtext-mt-2 richtext-ring-offset-background focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-2",t),...e}));rd.displayName=rc.Content.displayName;const OH=lS("richtext-inline-flex richtext-items-center richtext-justify-center richtext-rounded-md richtext-text-sm richtext-font-medium richtext-ring-offset-background richtext-transition-colors hover:richtext-bg-muted hover:richtext-text-muted-foreground focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-2 disabled:richtext-pointer-events-none disabled:richtext-opacity-50 data-[state=on]:richtext-bg-accent data-[state=on]:richtext-text-accent-foreground",{variants:{variant:{default:"richtext-bg-transparent",outline:"richtext-border richtext-border-input richtext-bg-transparent hover:richtext-bg-accent hover:richtext-text-accent-foreground"},size:{default:"richtext-h-10 richtext-px-3",sm:"richtext-h-9 richtext-px-2",lg:"richtext-h-11 richtext-px-5"}},defaultVariants:{variant:"default",size:"default"}}),Gh=At.forwardRef(({className:t,variant:e,size:r,...n},i)=>x.jsx(mR.Root,{ref:i,className:pt(OH({variant:e,size:r,className:t})),...n}));Gh.displayName=mR.Root.displayName;const MH=Fh.Provider,Sd=Fh.Root,kd=Fh.Trigger,ac=At.forwardRef(({className:t,sideOffset:e=4,...r},n)=>x.jsx(Fh.Content,{ref:n,sideOffset:e,className:pt("richtext-z-50 richtext-overflow-hidden richtext-rounded-md !richtext-border richtext-bg-popover richtext-px-3 richtext-py-1.5 richtext-text-sm richtext-text-popover-foreground richtext-shadow-md richtext-animate-in richtext-fade-in-0 richtext-zoom-in-95 data-[side=bottom]:richtext-slide-in-from-top-2 data-[side=left]:richtext-slide-in-from-right-2 data-[side=right]:richtext-slide-in-from-left-2 data-[side=top]:richtext-slide-in-from-bottom-2",t),...r}));ac.displayName=Fh.Content.displayName;const NH=cr.Root,DH=cr.Value,sM=At.forwardRef(({className:t,children:e,...r},n)=>x.jsxs(cr.Trigger,{ref:n,className:pt("richtext-flex richtext-h-10 richtext-w-full richtext-items-center richtext-justify-between richtext-rounded-md richtext-border richtext-border-input richtext-bg-background richtext-px-3 richtext-py-2 richtext-text-sm richtext-ring-offset-background placeholder:richtext-text-muted-foreground focus:richtext-outline-none focus:richtext-ring-2 focus:richtext-ring-ring focus:richtext-ring-offset-2 disabled:richtext-cursor-not-allowed disabled:richtext-opacity-50 [&>span]:richtext-line-clamp-1",t),...r,children:[e,x.jsx(cr.Icon,{asChild:!0,children:x.jsx(He.ChevronDown,{className:"richtext-h-4 richtext-w-4 richtext-opacity-50"})})]}));sM.displayName=cr.Trigger.displayName;const aM=At.forwardRef(({className:t,...e},r)=>x.jsx(cr.ScrollUpButton,{ref:r,className:pt("richtext-flex richtext-cursor-default richtext-items-center richtext-justify-center richtext-py-1",t),...e,children:x.jsx(He.ChevronUp,{className:"richtext-h-4 richtext-w-4"})}));aM.displayName=cr.ScrollUpButton.displayName;const lM=At.forwardRef(({className:t,...e},r)=>x.jsx(cr.ScrollDownButton,{ref:r,className:pt("richtext-flex richtext-cursor-default richtext-items-center richtext-justify-center richtext-py-1",t),...e,children:x.jsx(He.ChevronDown,{className:"richtext-h-4 richtext-w-4"})}));lM.displayName=cr.ScrollDownButton.displayName;const cM=At.forwardRef(({className:t,children:e,position:r="popper",...n},i)=>x.jsx(cr.Portal,{children:x.jsxs(cr.Content,{ref:i,className:pt("richtext-relative richtext-z-50 richtext-max-h-60 richtext-overflow-y-auto richtext-min-w-[8rem] richtext-overflow-hidden richtext-rounded-md richtext-border richtext-bg-popover richtext-text-popover-foreground richtext-shadow-md data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0 data-[state=closed]:richtext-zoom-out-95 data-[state=open]:richtext-zoom-in-95 data-[side=bottom]:richtext-slide-in-from-top-2 data-[side=left]:richtext-slide-in-from-right-2 data-[side=right]:richtext-slide-in-from-left-2 data-[side=top]:richtext-slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:richtext-translate-y-1 data-[side=left]:richtext--translate-x-1 data-[side=right]:richtext-translate-x-1 data-[side=top]:richtext--translate-y-1",t),position:r,...n,children:[x.jsx(aM,{}),x.jsx(cr.Viewport,{className:pt("richtext-p-1",r==="popper"&&"richtext-h-[var(--radix-select-trigger-height)] richtext-w-full richtext-min-w-[var(--radix-select-trigger-width)]"),children:e}),x.jsx(lM,{})]})}));cM.displayName=cr.Content.displayName;const PH=At.forwardRef(({className:t,...e},r)=>x.jsx(cr.Label,{ref:r,className:pt("richtext-py-1.5 richtext-pl-8 richtext-pr-2 richtext-text-sm richtext-font-semibold",t),...e}));PH.displayName=cr.Label.displayName;const xx=At.forwardRef(({className:t,children:e,...r},n)=>x.jsxs(cr.Item,{ref:n,className:pt("richtext-relative richtext-flex richtext-w-full richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-py-1.5 richtext-pl-8 richtext-pr-2 richtext-text-sm richtext-outline-none focus:richtext-bg-accent focus:richtext-text-accent-foreground data-[disabled]:richtext-pointer-events-none data-[disabled]:richtext-opacity-50",t),...r,children:[x.jsx("span",{className:"richtext-absolute richtext-left-2 richtext-flex richtext-h-3.5 richtext-w-3.5 richtext-items-center richtext-justify-center",children:x.jsx(cr.ItemIndicator,{children:x.jsx(He.Check,{className:"richtext-h-4 richtext-w-4"})})}),x.jsx(cr.ItemText,{children:e})]}));xx.displayName=cr.Item.displayName;const LH=At.forwardRef(({className:t,...e},r)=>x.jsx(cr.Separator,{ref:r,className:pt("richtext--mx-1 richtext-my-1 richtext-h-px richtext-bg-muted",t),...e}));LH.displayName=cr.Separator.displayName;const uM=At.forwardRef(({className:t,...e},r)=>x.jsx(C0.Root,{ref:r,className:pt("!richtext-peer !richtext-h-4 !richtext-w-4 !richtext-p-0 !richtext-shrink-0 !richtext-rounded-sm !richtext-border !richtext-border-primary !richtext-ring-offset-background focus-visible:!richtext-outline-none focus-visible:!richtext-ring-2 focus-visible:!richtext-ring-ring focus-visible:!richtext-ring-offset-2 disabled:!richtext-cursor-not-allowed disabled:!richtext-opacity-50 data-[state=checked]:!richtext-bg-primary data-[state=checked]:!richtext-text-primary-foreground",t),...e,children:x.jsx(C0.Indicator,{className:pt("!richtext-flex !richtext-p-0 !richtext-items-center !richtext-justify-center !richtext-text-current"),children:x.jsx(He.Check,{className:"!richtext-h-4 !richtext-w-4"})})}));uM.displayName=C0.Root.displayName;function FH({editor:t,...e}){const r=Wh(t,Nl.name,{text:"",defaultShowPicker:!1}),{text:n,defaultShowPicker:i}=r,[o,s]=J.useState(""),[a,l]=J.useState(!1),c=J.useCallback(()=>t.isActive(Nl.name),[t]),d=J.useCallback(()=>bd(Nl.name,t),[t]),f=J.useCallback(()=>{t.chain().focus().setKatex({text:o}).run(),l(!1)},[t,o]);J.useEffect(()=>{i&&(l(!0),t.chain().updateAttributes(Nl.name,{defaultShowPicker:!1}).focus().run())},[t,i,l]),J.useEffect(()=>{a&&s(n||"")},[a]);const p=J.useMemo(()=>{try{return y1.renderToString(`${o}`)}catch{return o}},[o]),m=J.useMemo(()=>`${o}`.trim()?x.jsx("span",{contentEditable:!1,dangerouslySetInnerHTML:{__html:p||""}}):null,[o,p]);return x.jsx(qn,{editor:t,pluginKey:"Katex-bubble-menu",shouldShow:c,tippyOptions:{popperOptions:{modifiers:[{name:"flip",enabled:!1}]},placement:"bottom-start",offset:[-2,16],zIndex:9999,onHidden:()=>{l(!1)}},children:e!=null&&e.disabled?x.jsx(x.Fragment,{}):x.jsx("div",{className:"richtext-p-2 richtext-bg-white !richtext-border richtext-rounded-lg richtext-shadow-sm dark:richtext-bg-black richtext-border-neutral-200 dark:richtext-border-neutral-800",children:a?x.jsxs(x.Fragment,{children:[x.jsx(Vh,{value:o,onChange:g=>s(g.target.value),autoFocus:!0,placeholder:"Formula text",rows:3,defaultValue:n,style:{marginBottom:8}}),m&&x.jsx("div",{className:"richtext-my-[10px] richtext-p-[10px] richtext-rounded-[6px] !richtext-border-[1px] richtext-whitespace-nowrap richtext-overflow-auto",children:m}),x.jsxs("div",{className:"richtext-flex richtext-items-center richtext-justify-between richtext-gap-[6px]",children:[x.jsx(Mt,{onClick:f,className:"richtext-flex-1",children:"Submit"}),x.jsx("a",{href:"https://katex.org/docs/supported",target:"_blank",rel:"noreferrer noopener",children:x.jsx(He.HelpCircle,{size:16})})]})]}):x.jsxs("div",{className:"richtext-flex richtext-items-center richtext-justify-center richtext-gap-[6px]",children:[x.jsx(Ve,{tooltip:"Edit",action:()=>l(!a),children:x.jsx(He.Pencil,{size:16})}),x.jsx(Ve,{tooltip:"Delete",action:d,children:x.jsx(He.Trash2,{size:16})})]})})})}const jH={"editor.remove":"Remove","editor.copy":"Copy","editor.words":"WORDS","editor.characters":"CHARACTERS","editor.default":"Default","editor.recent":"Recently Used","editor.nofill":"No Fill","editor.format":"Format Painter","editor.delete":"Delete","editor.edit":"Edit","editor.settings":"Settings","editor.table_of_content":"Table of Content","editor.draghandle.tooltip":"Modify","editor.copyToClipboard":"CopyToClipboard","editor.importWord.tooltip":"Import Word","editor.slash":"Press '/' for commands","editor.slash.empty":"No Result","editor.slash.format":"Format","editor.slash.insert":"Insert","editor.slash.embed":"Embed Services","editor.content":"Please input content","editor.fontFamily.tooltip":"Font Family","editor.fontFamily.default.tooltip":"Default","editor.moremark":"More Text Styles","editor.size.small.tooltip":"Small","editor.size.medium.tooltip":"Medium","editor.size.large.tooltip":"Cover","editor.bold.tooltip":"Bold","editor.italic.tooltip":"Italic","editor.underline.tooltip":"Underline","editor.strike.tooltip":"Strike","editor.color.tooltip":"Color","editor.color.more":"More Colors","editor.highlight.tooltip":"Highlight","editor.lineheight.tooltip":"Line Height","editor.heading.tooltip":"Headings","editor.heading.h1.tooltip":"Heading 1","editor.heading.h2.tooltip":"Heading 2","editor.heading.h3.tooltip":"Heading 3","editor.heading.h4.tooltip":"Heading 4","editor.heading.h5.tooltip":"Heading 5","editor.heading.h6.tooltip":"Heading 6","editor.paragraph.tooltip":"Paragraph","editor.textalign.tooltip":"Align","editor.textalign.left.tooltip":"Left","editor.textalign.center.tooltip":"Center","editor.textalign.right.tooltip":"Right","editor.textalign.justify.tooltip":"Justify","editor.indent":"Indent","editor.indent.indent":"Increase Indent","editor.indent.outdent":"Decrease Indent","editor.fontSize.tooltip":"Font size","editor.fontSize.default.tooltip":"Default","editor.superscript.tooltip":"Superscript","editor.subscript.tooltip":"Subscript","editor.bulletlist.tooltip":"Bullet List","editor.orderedlist.tooltip":"Ordered List","editor.tasklist.tooltip":"Task List","editor.indent.tooltip":"Indent","editor.outdent.tooltip":"Outdent","editor.columns.tooltip":"Columns","editor.link.tooltip":"Link","editor.link.unlink.tooltip":"UnLink","editor.link.open.tooltip":"Open Link","editor.link.edit.tooltip":"Edit Link","editor.link.dialog.title":"Insert Link","editor.link.dialog.link":"Link","editor.link.dialog.text":"Text","editor.link.dialog.openInNewTab":"Open In New Tab","editor.link.dialog.link.placeholder":"Link Address","editor.link.dialog.text.placeholder":"Add Description","editor.link.dialog.button.apply":"Apply","editor.image.tooltip":"Image","editor.image.dragger.tooltip":"Click or drag the image to the area to upload","editor.image.float.left.tooltip":"Float left","editor.image.float.none.tooltip":"Float none","editor.image.float.right.tooltip":"Float right","editor.image.dialog.title":"Add an image","editor.image.dialog.tab.url":"Url","editor.image.dialog.tab.upload":"Upload","editor.image.dialog.tab.uploadCrop":"Upload & Crop","editor.image.dialog.uploading":"Uploading","editor.link.dialog.inline":"Inline","editor.image.dialog.form.link":"Link","editor.image.dialog.placeholder":"Link","editor.image.dialog.form.alt":"Alt","editor.image.dialog.form.aspectRatio":"Lock original aspect ratio","editor.image.dialog.form.file":"File","editor.image.dialog.button.apply":"Apply","editor.video.tooltip":"Video","editor.video.dialog.tab.upload":"Upload","editor.video.dialog.uploading":"Uploading","editor.video.dialog.title":"Embed or upload a video","editor.video.dialog.link":"Link","editor.video.dialog.placeholder":"Link","editor.video.dialog.button.apply":"Apply","editor.table.tooltip":"Table","editor.table.menu.insert_table":"Insert Table","editor.table.menu.insert_table.with_header_row":"With header row","editor.table.menu.add_column_before":"Add Column Before","editor.table.menu.add_column_after":"Add Column After","editor.table.menu.delete_column":"Delete Column","editor.table.menu.add_row_before":"Add Row Before","editor.table.menu.add_row_after":"Add Row After","editor.table.menu.delete_row":"Delete Row","editor.table.menu.merge_or_split_cells":"Merge Or Split Cells","editor.table.menu.delete_table":"Delete Table","editor.blockquote.tooltip":"Blockquote","editor.horizontalrule.tooltip":"Horizontal Rule","editor.code.tooltip":"Code","editor.codeblock.tooltip":"Code Block","editor.clear.tooltip":"Clear Format","editor.undo.tooltip":"Undo","editor.redo.tooltip":"Redo","editor.fullscreen.tooltip.fullscreen":"Fullscreen","editor.fullscreen.tooltip.exit":"Fullscreen Exit","editor.imageUpload.cancel":"Cancel","editor.imageUpload.crop":"Crop","editor.imageUpload.fileTypeNotSupported":"File type not supported","editor.imageUpload.fileSizeTooBig":"File size too big, Maximum size is","editor.table.menu.insertColumnBefore":"Insert Column Before","editor.table.menu.insertColumnAfter":"Insert Column After","editor.table.menu.deleteColumn":"Delete Column","editor.table.menu.insertRowAbove":"Insert Row Above","editor.table.menu.insertRowBelow":"Insert Row Below","editor.table.menu.deleteRow":"Delete Row","editor.table.menu.mergeCells":"Merge Cells","editor.table.menu.splitCells":"Split Cells","editor.table.menu.deleteTable":"Delete Table","editor.table.menu.setCellsBgColor":"Cell Background Color","editor.emoji.tooltip":"Emoji","editor.iframe.tooltip":"Iframe","editor.searchAndReplace.tooltip":"Search and Replace","editor.search.dialog.text":"Search","editor.replace.dialog.text":"Replace","editor.replaceAll.dialog.text":"Replace All","editor.previous.dialog.text":"Previous","editor.next.dialog.text":"Next",no_result_found:"No results found","Smileys & People":"Smileys & People","Animals & Nature":"Animals & Nature","Food & Drink":"Food & Drink",Activity:"Activity","Travel & Places":"Travel & Places",Object:"Objects",Symbol:"Symbols",Flags:"Flags","Frequently used":"Frequently used","editor.formula.dialog.text":"Formula","editor.katex.tooltip":"Math Formula","editor.exportPdf.tooltip":"Export PDF","editor.exportWord.tooltip":"Export Word","editor.importWrod.tooltip":"Import Word","editor.textDirection.tooltip":"Text Direction","editor.textDirection.auto.tooltip":"Auto","editor.textDirection.ltr.tooltip":"Left to Right","editor.textDirection.rtl.tooltip":"Right to Left","editor.attachment.tooltip":"Attachment","editor.attachment.uploading":"Uploading","editor.attachment.please_upload":"Please upload the file","editor.imageGif.tooltip":"Gif","editor.replace.caseSensitive":"Case Sensitive","editor.mermaid.tooltip":"Mermaid","editor.twitter.tooltip":"Twitter","editor.tooltip.flipX":"Flip Horizontal","editor.tooltip.flipY":"Flip Vertical"},dM=jH,BH={"editor.remove":"Remover","editor.copy":"Copiar","editor.words":"PALAVRAS","editor.characters":"CARACTERES","editor.default":"Padrão","editor.recent":"Usado recentemente","editor.nofill":"Sem preenchimento","editor.format":"Format Painter","editor.delete":"Deletar","editor.edit":"Editar","editor.settings":"Configurações","editor.table_of_content":"Tabela de conteúdos","editor.draghandle.tooltip":"Modificar","editor.copyToClipboard":"Copiar para a área de transferência","editor.importWord.tooltip":"Importar Word","editor.slash":"Pressione '/' para comandos","editor.slash.empty":"Nenhum resultado","editor.slash.format":"Formato","editor.slash.insert":"Inserir","editor.slash.embed":"Incorporar serviços","editor.content":"Por favor, insira o conteúdo","editor.fontFamily.tooltip":"Fonte","editor.fontFamily.default.tooltip":"Padrão","editor.moremark":"Mais estilos de texto","editor.size.small.tooltip":"Pequeno","editor.size.medium.tooltip":"Médio","editor.size.large.tooltip":"Grande","editor.bold.tooltip":"Negrito","editor.italic.tooltip":"Itálico","editor.underline.tooltip":"Sublinhado","editor.strike.tooltip":"Riscado","editor.color.tooltip":"Cor","editor.color.more":"Mais cores","editor.highlight.tooltip":"Destaque","editor.lineheight.tooltip":"Altura da linha","editor.heading.tooltip":"Cabeçalhos","editor.heading.h1.tooltip":"Cabeçalho 1","editor.heading.h2.tooltip":"Cabeçalho 2","editor.heading.h3.tooltip":"Cabeçalho 3","editor.heading.h4.tooltip":"Cabeçalho 4","editor.heading.h5.tooltip":"Cabeçalho 5","editor.heading.h6.tooltip":"Cabeçalho 6","editor.paragraph.tooltip":"Parágrafo","editor.textalign.tooltip":"Alinhar","editor.textalign.left.tooltip":"Esquerda","editor.textalign.center.tooltip":"Centro","editor.textalign.right.tooltip":"Direita","editor.textalign.justify.tooltip":"Justificar","editor.indent":"Recuo","editor.indent.indent":"Aumentar recuo","editor.indent.outdent":"Diminuir recuo","editor.fontSize.tooltip":"Tamanho da fonte","editor.fontSize.default.tooltip":"Padrão","editor.superscript.tooltip":"Sobrescrito","editor.subscript.tooltip":"Subscrito","editor.bulletlist.tooltip":"Lista de marcadores","editor.orderedlist.tooltip":"Lista numerada","editor.tasklist.tooltip":"Lista de tarefas","editor.indent.tooltip":"Recuo","editor.outdent.tooltip":"Diminuir recuo","editor.columns.tooltip":"Colunas","editor.link.tooltip":"Link","editor.link.unlink.tooltip":"Desvincular","editor.link.open.tooltip":"Abrir link","editor.link.edit.tooltip":"Editar link","editor.link.dialog.title":"Inserir link","editor.link.dialog.link":"Link","editor.link.dialog.text":"Texto","editor.link.dialog.openInNewTab":"Abrir em nova guia","editor.link.dialog.link.placeholder":"Endereço do link","editor.link.dialog.text.placeholder":"Texto do link","editor.link.dialog.button.apply":"Aplicar","editor.image.tooltip":"Imagem","editor.image.dragger.tooltip":"Clique ou arraste a imagem para a área de upload","editor.image.float.left.tooltip":"Flutuar à esquerda","editor.image.float.none.tooltip":"Nenhum flutuante","editor.image.float.right.tooltip":"Flutuar à direita","editor.image.dialog.title":"Adicionar uma imagem","editor.image.dialog.tab.url":"Url","editor.image.dialog.tab.upload":"Enviar","editor.link.dialog.inline":"Inline","editor.image.dialog.tab.uploadCrop":"Enviar e cortar","editor.image.dialog.uploading":"Enviando","editor.image.dialog.form.link":"Link","editor.image.dialog.placeholder":"Link","editor.image.dialog.form.alt":"Alt","editor.image.dialog.form.aspectRatio":"Bloquear proporção original","editor.image.dialog.form.file":"Arquivo","editor.image.dialog.button.apply":"Aplicar","editor.video.tooltip":"Vídeo","editor.video.dialog.tab.upload":"Enviar","editor.video.dialog.uploading":"Enviando","editor.video.dialog.title":"Incorporar ou enviar um vídeo","editor.video.dialog.link":"Link","editor.video.dialog.placeholder":"Link","editor.video.dialog.button.apply":"Aplicar","editor.table.tooltip":"Tabela","editor.table.menu.insert_table":"Inserir tabela","editor.table.menu.insert_table.with_header_row":"Com linha de cabeçalho","editor.table.menu.add_column_before":"Adicionar coluna antes","editor.table.menu.add_column_after":"Adicionar coluna depois","editor.table.menu.delete_column":"Excluir coluna","editor.table.menu.add_row_before":"Adicionar linha antes","editor.table.menu.add_row_after":"Adicionar linha depois","editor.table.menu.delete_row":"Deletar linha","editor.table.menu.merge_or_split_cells":"Mesclar ou dividir células","editor.table.menu.delete_table":"Deletar tabela","editor.blockquote.tooltip":"Citação","editor.horizontalrule.tooltip":"Regra horizontal","editor.code.tooltip":"Código","editor.codeblock.tooltip":"Bloco de código","editor.clear.tooltip":"Limpar formato","editor.undo.tooltip":"Desfazer","editor.redo.tooltip":"Refazer","editor.fullscreen.tooltip.fullscreen":"Tela cheia","editor.fullscreen.tooltip.exit":"Sair da tela cheia","editor.imageUpload.cancel":"Cancelar","editor.imageUpload.crop":"Cortar","editor.imageUpload.fileTypeNotSupported":"Tipo de arquivo não suportado","editor.imageUpload.fileSizeTooBig":"Tamanho do arquivo muito grande, tamanho máximo é","editor.table.menu.insertColumnBefore":"Inserir coluna antes","editor.table.menu.insertColumnAfter":"Inserir coluna depois","editor.table.menu.deleteColumn":"Excluir coluna","editor.table.menu.insertRowAbove":"Inserir linha acima","editor.table.menu.insertRowBelow":"Inserir linha abaixo","editor.table.menu.deleteRow":"Deletar linha","editor.table.menu.mergeCells":"Mesclar células","editor.table.menu.splitCells":"Dividir células","editor.table.menu.deleteTable":"Deletar tabela","editor.table.menu.setCellsBgColor":"Cor de fundo da célula","editor.emoji.tooltip":"Emoji","editor.iframe.tooltip":"Iframe","editor.searchAndReplace.tooltip":"Pesquisar e substituir","editor.search.dialog.text":"Pesquisar","editor.replace.dialog.text":"Substituir","editor.replaceAll.dialog.text":"Substituir tudo","editor.previous.dialog.text":"Anterior","editor.next.dialog.text":"Próximo",no_result_found:"Nenhum resultado encontrado","Smileys & People":"Emoticons & Pessoas","Animals & Nature":"Animais & Natureza","Food & Drink":"Comida & Bebida",Activity:"Atividade","Travel & Places":"Viagem & Lugares",Object:"Objetos",Symbol:"Símbolos",Flags:"Bandeiras","Frequently used":"Frequentemente usado","editor.formula.dialog.text":"Fórmula","editor.katex.tooltip":"Fórmula matemática","editor.exportPdf.tooltip":"Exportar PDF","editor.exportWord.tooltip":"Exportar Word","editor.importWrod.tooltip":"Importar Word","editor.textDirection.tooltip":"Direção do texto","editor.textDirection.auto.tooltip":"Automático","editor.textDirection.ltr.tooltip":"Esquerda para Direita","editor.textDirection.rtl.tooltip":"Direita para Esquerda","editor.attachment.tooltip":"Anexo","editor.attachment.uploading":"Enviando","editor.attachment.please_upload":"Por favor, envie o arquivo","editor.imageGif.tooltip":"Gif","editor.replace.caseSensitive":"Sensível a maiúsculas e minúsculas","editor.mermaid.tooltip":"Mermaid","editor.twitter.tooltip":"Twitter","editor.tooltip.flipX":"Inverter Horizontal","editor.tooltip.flipY":"Inverter Vertical"},fM=BH,zH={"editor.remove":"Xóa","editor.copy":"Sao chép","editor.words":"TỪ","editor.characters":"KÝ TỰ","editor.default":"Mặc định","editor.recent":"Đã sử dụng gần đây","editor.nofill":"Không tô","editor.format":"Format Painter","editor.delete":"Xóa","editor.edit":"Chỉnh sửa","editor.settings":"Cài đặt","editor.table_of_content":"Mục lục","editor.draghandle.tooltip":"Sửa đổi","editor.copyToClipboard":"CopyToClipboard","editor.importWord.tooltip":"Nhập Word","editor.slash":"Nhấn '/' để biết lệnh","editor.slash.empty":"Không có kết quả","editor.slash.format":"Định dạng","editor.slash.insert":"Chèn","editor.slash.embed":"Dịch vụ nhúng","editor.content":"Vui lòng nhập nội dung","editor.moremark":"Nhiều kiểu văn bản hơn","editor.size.small.tooltip":"Nhỏ","editor.fontFamily.tooltip":"Phông chữ","editor.fontFamily.default.tooltip":"Mặc định","editor.size.medium.tooltip":"Trung bình","editor.size.large.tooltip":"Lớn","editor.bold.tooltip":"Đậm","editor.italic.tooltip":"In nghiêng","editor.underline.tooltip":"Gạch chân","editor.strike.tooltip":"Gạch","editor.color.tooltip":"Màu","editor.color.more":"Nhiều màu hơn","editor.highlight.tooltip":"Đánh dấu","editor.lineheight.tooltip":"Chiều cao dòng","editor.heading.tooltip":"Tiêu đề","editor.heading.h1.tooltip":"Tiêu đề 1","editor.heading.h2.tooltip":"Tiêu đề 2","editor.heading.h3.tooltip":"Tiêu đề 3","editor.heading.h4.tooltip":"Tiêu đề 4","editor.heading.h5.tooltip":"Tiêu đề 5","editor.heading.h6.tooltip":"Tiêu đề 6","editor.paragraph.tooltip":"Đoạn văn","editor.textalign.tooltip":"Căn chỉnh","editor.textalign.left.tooltip":"Trái","editor.textalign.center.tooltip":"Giữa","editor.textalign.right.tooltip":"Phải","editor.textalign.justify.tooltip":"Căn đều","editor.indent":"Thụt lề","editor.indent.indent":"Tăng thụt lề","editor.indent.outdent":"Giảm thụt lề","editor.fontSize.tooltip":"Kích thước phông chữ","editor.fontSize.default.tooltip":"Mặc định","editor.superscript.tooltip":"Chỉ số trên","editor.subscript.tooltip":"Chỉ số dưới","editor.bulletlist.tooltip":"Danh sách dấu đầu dòng","editor.orderedlist.tooltip":"Danh sách có thứ tự","editor.tasklist.tooltip":"Danh sách tác vụ","editor.indent.tooltip":"Tăng thụt lề","editor.outdent.tooltip":"Giảm thụt lề","editor.columns.tooltip":"Cột","editor.link.tooltip":"Liên kết","editor.link.unlink.tooltip":"Hủy liên kết","editor.link.open.tooltip":"Mở liên kết","editor.link.edit.tooltip":"Chỉnh sửa liên kết","editor.link.dialog.title":"Chèn liên kết","editor.link.dialog.link":"Liên kết","editor.link.dialog.text":"Văn bản","editor.link.dialog.openInNewTab":"Mở trong tab mới","editor.link.dialog.link.placeholder":"Địa chỉ liên kết","editor.link.dialog.text.placeholder":"Thêm mô tả","editor.link.dialog.button.apply":"Áp dụng","editor.image.tooltip":"Hình ảnh","editor.image.dragger.tooltip":"Nhấp hoặc kéo hình ảnh đến khu vực để tải lên","editor.image.float.left.tooltip":"Trôi sang trái","editor.image.float.none.tooltip":"Trôi không","editor.image.float.right.tooltip":"Trôi sang phải","editor.image.dialog.title":"Thêm hình ảnh","editor.image.dialog.tab.url":"Url","editor.image.dialog.tab.upload":"Tải lên","editor.link.dialog.inline":"Inline","editor.image.dialog.tab.uploadCrop":"Tải lên & Cắt","editor.image.dialog.uploading":"Đang tải lên","editor.image.dialog.form.link":"Liên kết","editor.image.dialog.placeholder":"Liên kết","editor.image.dialog.form.alt":"Alt","editor.image.dialog.form.aspectRatio":"Khóa tỷ lệ khung hình gốc","editor.image.dialog.form.file":"Tệp","editor.image.dialog.button.apply":"Áp dụng","editor.video.tooltip":"Video","editor.video.dialog.tab.upload":"Tải lên","editor.video.dialog.uploading":"Đang tải lên","editor.video.dialog.title":"Nhúng hoặc tải lên video","editor.video.dialog.link":"Liên kết","editor.video.dialog.placeholder":"Liên kết","editor.video.dialog.button.apply":"Áp dụng","editor.table.tooltip":"Bảng","editor.table.menu.insert_table":"Chèn Bảng","editor.table.menu.insert_table.with_header_row":"Có hàng tiêu đề","editor.table.menu.add_column_before":"Thêm Cột Trước","editor.table.menu.add_column_after":"Thêm Cột Sau","editor.table.menu.delete_column":"Xóa Cột","editor.table.menu.add_row_before":"Thêm Hàng Trước","editor.table.menu.add_row_after":"Thêm Hàng Sau","editor.table.menu.delete_row":"Xóa Hàng","editor.table.menu.merge_or_split_cells":"Gộp Hoặc Tách Ô","editor.table.menu.delete_table":"Xóa Bảng","editor.blockquote.tooltip":"Blockquote","editor.horizontalrule.tooltip":"Quy tắc ngang","editor.code.tooltip":"Mã","editor.codeblock.tooltip":"Khối mã","editor.clear.tooltip":"Xóa định dạng","editor.undo.tooltip":"Hoàn tác","editor.redo.tooltip":"Làm lại","editor.fullscreen.tooltip.fullscreen":"Toàn màn hình","editor.fullscreen.tooltip.exit":"Thoát toàn màn hình","editor.imageUpload.cancel":"Hủy","editor.imageUpload.crop":"Cắt","editor.imageUpload.fileTypeNotSupported":"Loại tệp không được hỗ trợ","editor.imageUpload.fileSizeTooBig":"Kích thước tệp quá lớn, Kích thước tối đa là","editor.table.menu.insertColumnBefore":"Chèn cột trước","editor.table.menu.insertColumnAfter":"Chèn cột sau","editor.table.menu.deleteColumn":"Xóa cột","editor.table.menu.insertRowAbove":"Chèn hàng ở trên","editor.table.menu.insertRowBelow":"Chèn hàng ở dưới","editor.table.menu.deleteRow":"Xóa hàng","editor.table.menu.mergeCells":"Gộp các ô","editor.table.menu.splitCells":"Chia ô","editor.table.menu.deleteTable":"Xóa bảng","editor.table.menu.setCellsBgColor":"Màu nền ô","editor.emoji.tooltip":"Biểu tượng","editor.iframe.tooltip":"Iframe","editor.searchAndReplace.tooltip":"Tìm kiếm và thay thế","editor.search.dialog.text":"Tìm kiếm","editor.replace.dialog.text":"Thay thế","editor.replaceAll.dialog.text":"Thay thế tất cả","editor.previous.dialog.text":"Trước","editor.next.dialog.text":"Tiếp theo",no_result_found:"Không tìm thấy kết quả","Smileys & People":"Cười & Mọi người","Animals & Nature":"Động vật & Thiên nhiên","Food & Drink":"Thức ăn & Đồ uống",Activity:"Hoạt động","Travel & Places":"Du lịch & Địa điểm",Object:"Vật",Symbol:"Ký hiệu",Flags:"Cờ","Frequently used":"Thường xuyên sử dụng","editor.formula.dialog.text":"Công thức","editor.katex.tooltip":"Công thức toán học","editor.exportPdf.tooltip":"Xuất PDF","editor.exportWord.tooltip":"Xuất Word","editor.importWrod.tooltip":"Nhập Word","editor.textDirection.tooltip":"Hướng văn bản","editor.textDirection.auto.tooltip":"Tự động","editor.textDirection.ltr.tooltip":"Trái sang Phải","editor.textDirection.rtl.tooltip":"Phải sang Trái","editor.attachment.tooltip":"Đính kèm","editor.attachment.uploading":"Đang tải lên","editor.attachment.please_upload":"Vui lòng tải lên tệp","editor.imageGif.tooltip":"Gif","editor.replace.caseSensitive":"Phân biệt chữ hoa chữ thường","editor.mermaid.tooltip":"Mermaid","editor.twitter.tooltip":"Twitter","editor.tooltip.flipX":"Lật Ngang","editor.tooltip.flipY":"Lật Dọc"},hM=zH,HH={"editor.remove":"移除","editor.copy":"复制","editor.words":"字数","editor.characters":"字符数","editor.default":"默认","editor.recent":"最近使用","editor.nofill":"无填充","editor.format":"格式刷","editor.delete":"删除","editor.edit":"编辑","editor.settings":"设置","editor.table_of_content":"目录","editor.draghandle.tooltip":"修改","editor.copyToClipboard":"复制到剪贴板","editor.importWord.tooltip":"导入 Word","editor.slash":"按 '/' 使用命令","editor.slash.empty":"无结果","editor.slash.format":"格式","editor.slash.insert":"插入","editor.slash.embed":"嵌入服务","editor.content":"请输入内容","editor.fontFamily.tooltip":"字体","editor.fontFamily.default.tooltip":"默认","editor.moremark":"更多文本样式","editor.size.small.tooltip":"小","editor.size.medium.tooltip":"中","editor.size.large.tooltip":"封面","editor.bold.tooltip":"粗体","editor.italic.tooltip":"斜体","editor.underline.tooltip":"下划线","editor.strike.tooltip":"删除线","editor.color.tooltip":"颜色","editor.color.more":"更多颜色","editor.highlight.tooltip":"高亮","editor.lineheight.tooltip":"行高","editor.heading.tooltip":"标题","editor.heading.h1.tooltip":"标题 1","editor.heading.h2.tooltip":"标题 2","editor.heading.h3.tooltip":"标题 3","editor.heading.h4.tooltip":"标题 4","editor.heading.h5.tooltip":"标题 5","editor.heading.h6.tooltip":"标题 6","editor.paragraph.tooltip":"段落","editor.textalign.tooltip":"对齐","editor.textalign.left.tooltip":"左对齐","editor.textalign.center.tooltip":"居中","editor.textalign.right.tooltip":"右对齐","editor.textalign.justify.tooltip":"两端对齐","editor.indent":"缩进","editor.indent.indent":"增加缩进","editor.indent.outdent":"减少缩进","editor.fontSize.tooltip":"字号","editor.fontSize.default.tooltip":"默认","editor.superscript.tooltip":"上标","editor.subscript.tooltip":"下标","editor.bulletlist.tooltip":"无序列表","editor.orderedlist.tooltip":"有序列表","editor.tasklist.tooltip":"任务列表","editor.indent.tooltip":"缩进","editor.outdent.tooltip":"减少缩进","editor.columns.tooltip":"列","editor.link.tooltip":"链接","editor.link.unlink.tooltip":"取消链接","editor.link.open.tooltip":"打开链接","editor.link.edit.tooltip":"编辑链接","editor.link.dialog.title":"插入链接","editor.link.dialog.link":"链接","editor.link.dialog.text":"文本","editor.link.dialog.openInNewTab":"在新标签页中打开","editor.link.dialog.link.placeholder":"链接地址","editor.link.dialog.text.placeholder":"添加描述","editor.link.dialog.button.apply":"应用","editor.image.tooltip":"图片","editor.image.dragger.tooltip":"点击或拖拽图片到此区域上传","editor.image.float.left.tooltip":"左浮动","editor.image.float.none.tooltip":"无浮动","editor.image.float.right.tooltip":"右浮动","editor.image.dialog.title":"添加图片","editor.image.dialog.tab.url":"链接","editor.image.dialog.tab.upload":"上传","editor.link.dialog.inline":"Inline","editor.image.dialog.uploading":"上传中","editor.image.dialog.form.link":"链接","editor.image.dialog.placeholder":"链接","editor.image.dialog.form.alt":"替代文本","editor.image.dialog.form.aspectRatio":"锁定原始宽高比","editor.image.dialog.form.file":"文件","editor.image.dialog.button.apply":"应用","editor.video.tooltip":"视频","editor.video.dialog.tab.upload":"上传","editor.image.dialog.tab.uploadCrop":"上传并裁剪","editor.video.dialog.uploading":"上传中","editor.video.dialog.title":"嵌入或上传视频","editor.video.dialog.link":"链接","editor.video.dialog.placeholder":"链接","editor.video.dialog.button.apply":"应用","editor.table.tooltip":"表格","editor.table.menu.insert_table":"插入表格","editor.table.menu.insert_table.with_header_row":"带标题行","editor.table.menu.add_column_before":"在前面插入列","editor.table.menu.add_column_after":"在后面插入列","editor.table.menu.delete_column":"删除列","editor.table.menu.add_row_before":"在上方插入行","editor.table.menu.add_row_after":"在下方插入行","editor.table.menu.delete_row":"删除行","editor.table.menu.merge_or_split_cells":"合并或拆分单元格","editor.table.menu.delete_table":"删除表格","editor.blockquote.tooltip":"引用","editor.horizontalrule.tooltip":"水平线","editor.code.tooltip":"代码","editor.codeblock.tooltip":"代码块","editor.clear.tooltip":"清除格式","editor.undo.tooltip":"撤销","editor.redo.tooltip":"重做","editor.fullscreen.tooltip.fullscreen":"全屏","editor.fullscreen.tooltip.exit":"退出全屏","editor.imageUpload.cancel":"取消","editor.imageUpload.crop":"裁剪","editor.imageUpload.fileTypeNotSupported":"不支持的文件类型","editor.imageUpload.fileSizeTooBig":"文件大小超出限制,最大大小为","editor.table.menu.insertColumnBefore":"在前面插入列","editor.table.menu.insertColumnAfter":"在后面插入列","editor.table.menu.deleteColumn":"删除列","editor.table.menu.insertRowAbove":"在上方插入行","editor.table.menu.insertRowBelow":"在下方插入行","editor.table.menu.deleteRow":"删除行","editor.table.menu.mergeCells":"合并单元格","editor.table.menu.splitCells":"拆分单元格","editor.table.menu.deleteTable":"删除表格","editor.table.menu.setCellsBgColor":"设置单元格背景色","editor.emoji.tooltip":"表情","editor.iframe.tooltip":"内嵌框架","editor.searchAndReplace.tooltip":"搜索和替换","editor.search.dialog.text":"搜索","editor.replace.dialog.text":"替换","editor.replaceAll.dialog.text":"全部替换","editor.previous.dialog.text":"上一个","editor.next.dialog.text":"下一个",no_result_found:"未找到结果","Smileys & People":"笑脸和人","Animals & Nature":"动物和自然","Food & Drink":"食物和饮料",Activity:"活动","Travel & Places":"旅行和地点",Object:"物体",Symbol:"符号",Flags:"旗帜","Frequently used":"常用","editor.formula.dialog.text":"公式","editor.katex.tooltip":"数学公式","editor.exportPdf.tooltip":"导出 PDF","editor.exportWord.tooltip":"导出 Word","editor.importWrod.tooltip":"导入 Word","editor.textDirection.tooltip":"文本方向","editor.textDirection.auto.tooltip":"自动","editor.textDirection.ltr.tooltip":"从左到右","editor.textDirection.rtl.tooltip":"从右到左","editor.attachment.tooltip":"附件","editor.attachment.uploading":"上传中","editor.attachment.please_upload":"请上传文件","editor.imageGif.tooltip":"Gif","editor.replace.caseSensitive":"区分大小写","editor.mermaid.tooltip":"Mermaid","editor.twitter.tooltip":"Twitter","editor.tooltip.flipX":"水平翻转","editor.tooltip.flipY":"垂直翻转"},pM=HH,$H={"editor.remove":"Eltávolítás","editor.copy":"Másolás","editor.words":"SZAVAK","editor.characters":"KARAKTEREK","editor.default":"Alapértelmezett","editor.recent":"Gyakran használt","editor.nofill":"Kitöltés törlése","editor.format":"Formátummásoló","editor.delete":"Törlés","editor.edit":"Szerkesztés","editor.settings":"Beállítások","editor.table_of_content":"Tartalomjegyzék","editor.draghandle.tooltip":"Módosítás","editor.copyToClipboard":"Másolás vágólapra","editor.importWord.tooltip":"Word importálása","editor.slash":"Nyomja meg a '/' gombot a parancsokhoz","editor.slash.empty":"Nincs találat","editor.slash.format":"Formátum","editor.slash.insert":"Beszúrás","editor.slash.embed":"Szolgáltatások beágyazása","editor.content":"Írjon be tartalmat","editor.fontFamily.tooltip":"Betűtípus","editor.fontFamily.default.tooltip":"Alapértelmezett","editor.moremark":"Több betűstílus","editor.size.small.tooltip":"Kicsi","editor.size.medium.tooltip":"Közepes","editor.size.large.tooltip":"Borítókép","editor.bold.tooltip":"Félkövér","editor.italic.tooltip":"Dőlt betű","editor.underline.tooltip":"Aláhúzott","editor.strike.tooltip":"Áthúzott","editor.color.tooltip":"Szín","editor.color.more":"Több szín","editor.highlight.tooltip":"Kiemelés","editor.lineheight.tooltip":"Sorköz","editor.heading.tooltip":"Fejlécek","editor.heading.h1.tooltip":"Fejléc 1","editor.heading.h2.tooltip":"Fejléc 2","editor.heading.h3.tooltip":"Fejléc 3","editor.heading.h4.tooltip":"Fejléc 4","editor.heading.h5.tooltip":"Fejléc 5","editor.heading.h6.tooltip":"Fejléc 6","editor.paragraph.tooltip":"Bekezdés","editor.textalign.tooltip":"Igazítás","editor.textalign.left.tooltip":"Bal","editor.textalign.center.tooltip":"Közép","editor.textalign.right.tooltip":"Jobb","editor.textalign.justify.tooltip":"Sorkizárt","editor.indent":"Behúzás","editor.indent.indent":"Behúzás Növelése","editor.indent.outdent":"Behúzás Csökkentése","editor.fontSize.tooltip":"Betűméret","editor.fontSize.default.tooltip":"Alapértelmezett","editor.superscript.tooltip":"Felső index","editor.subscript.tooltip":"Alsó index","editor.bulletlist.tooltip":"Felsorolás","editor.orderedlist.tooltip":"Rendezett lista","editor.tasklist.tooltip":"Feladat lista","editor.indent.tooltip":"Behúzás növelése","editor.outdent.tooltip":"Behúzás csökkentése","editor.columns.tooltip":"Oszlopok","editor.link.tooltip":"Link","editor.link.unlink.tooltip":"Link törlése","editor.link.open.tooltip":"Link megnyitása","editor.link.edit.tooltip":"Link szerkesztése","editor.link.dialog.title":"Link beszúrása","editor.link.dialog.link":"Link","editor.link.dialog.text":"Szöveg","editor.link.dialog.openInNewTab":"Megnyitás új lapon","editor.link.dialog.link.placeholder":"Link célpont","editor.link.dialog.text.placeholder":"Szöveg","editor.link.dialog.button.apply":"Alkalmaz","editor.image.tooltip":"Kép","editor.image.dragger.tooltip":"Kattintson vagy húzza a feltölteni kívánt képet a területre","editor.image.float.left.tooltip":"Lebegtetés balra","editor.image.float.none.tooltip":"Lebegtetés törlése","editor.image.float.right.tooltip":"Lebegtetés jobbra","editor.image.dialog.title":"Kép hozzáadása","editor.image.dialog.tab.url":"URL","editor.image.dialog.tab.upload":"Feltöltés","editor.image.dialog.tab.uploadCrop":"Feltöltés és körbevágás","editor.image.dialog.uploading":"Feltöltés alatt","editor.link.dialog.inline":"Soron belüli","editor.image.dialog.form.link":"Link","editor.image.dialog.placeholder":"Link","editor.image.dialog.form.alt":"Alternatív szöveg","editor.image.dialog.form.aspectRatio":"Eredeti képarány megtartása","editor.image.dialog.form.file":"Fájl","editor.image.dialog.button.apply":"Alkalmaz","editor.video.tooltip":"Videó","editor.video.dialog.tab.upload":"Feltöltés","editor.video.dialog.uploading":"Feltöltés alatt","editor.video.dialog.title":"Videó beágyazása vagy feltöltése","editor.video.dialog.link":"Link","editor.video.dialog.placeholder":"Link","editor.video.dialog.button.apply":"Alkalmaz","editor.table.tooltip":"Táblázat","editor.table.menu.insert_table":"Táblázat beszúrása","editor.table.menu.insert_table.with_header_row":"Fejléc sorral","editor.table.menu.add_column_before":"Oszlop beszúrása balra","editor.table.menu.add_column_after":"Oszlop beszúrása jobbra","editor.table.menu.delete_column":"Oszlop törlése","editor.table.menu.add_row_before":"Sor beszúrása felülre","editor.table.menu.add_row_after":"Sor beszúrása alulra","editor.table.menu.delete_row":"Sor törlése","editor.table.menu.merge_or_split_cells":"Cellák egyesítése vagy szétválasztása","editor.table.menu.delete_table":"Táblázat törlése","editor.blockquote.tooltip":"Blokkidézet","editor.horizontalrule.tooltip":"Vízszintes vonal","editor.code.tooltip":"Kód","editor.codeblock.tooltip":"Kód Blokk","editor.clear.tooltip":"Formatálás Törlése","editor.undo.tooltip":"Visszavonás","editor.redo.tooltip":"Visszaállítás","editor.fullscreen.tooltip.fullscreen":"Teljes képernyős mód","editor.fullscreen.tooltip.exit":"Kilépés teljes képernyős módból","editor.imageUpload.cancel":"Mégsem","editor.imageUpload.crop":"Körbevágás","editor.imageUpload.fileTypeNotSupported":"Fájltípus nem támogatott","editor.imageUpload.fileSizeTooBig":"A fájlméret túl nagy, a maximum méret","editor.table.menu.insertColumnBefore":"Oszlop beszúrása balra","editor.table.menu.insertColumnAfter":"Oszlop beszúrása jobbra","editor.table.menu.deleteColumn":"Oszlop törlése","editor.table.menu.insertRowAbove":"Sor beszúrása felülre","editor.table.menu.insertRowBelow":"Sor beszúrása alulra","editor.table.menu.deleteRow":"Sor törlése","editor.table.menu.mergeCells":"Cellák egyesítése","editor.table.menu.splitCells":"Cellék szétválasztása","editor.table.menu.deleteTable":"Táblázat törlése","editor.table.menu.setCellsBgColor":"Cella háttérszín","editor.emoji.tooltip":"Emoji","editor.iframe.tooltip":"Beágyazás","editor.searchAndReplace.tooltip":"Keresés és csere","editor.search.dialog.text":"Keres","editor.replace.dialog.text":"Csere","editor.replaceAll.dialog.text":"Összes cseréje","editor.previous.dialog.text":"Előző","editor.next.dialog.text":"Következő",no_result_found:"Nincs találat","Smileys & People":"Arcok és emberek","Animals & Nature":"Állatok és természet","Food & Drink":"Étel és ital",Activity:"Aktivitás","Travel & Places":"Utazás és helyek",Object:"Tárgyak",Symbol:"Szimbólumok",Flags:"Zászlók","Frequently used":"Gyakran használt","editor.formula.dialog.text":"Formula","editor.katex.tooltip":"Matematikai formula","editor.exportPdf.tooltip":"PDF exportálása","editor.exportWord.tooltip":"Word exportálása","editor.importWrod.tooltip":"Word importálása","editor.textDirection.tooltip":"Szövegirány","editor.textDirection.auto.tooltip":"Automatikus","editor.textDirection.ltr.tooltip":"Balról jobbra","editor.textDirection.rtl.tooltip":"Jobbról balra","editor.attachment.tooltip":"Csatolmány","editor.attachment.uploading":"Feltöltés alatt","editor.attachment.please_upload":"Töltse fel a fájlt","editor.imageGif.tooltip":"Gif","editor.replace.caseSensitive":"Kisbetű-nagybetű érzékenység","editor.mermaid.tooltip":"Mermaid","editor.twitter.tooltip":"Twitter","editor.tooltip.flipX":"Vízszintes tükrözés","editor.tooltip.flipY":"Függőleges tükrözés"},mM=$H;function gM(t){return t=t||new Map,{all:t,on(e,r){const n=t.get(e);n?n.push(r):t.set(e,[r])},off(e,r){const n=t.get(e);n&&(r?n.splice(n.indexOf(r)>>>0,1):t.set(e,[]))},emit(e,r){let n=t.get(e);n&&[...n].map(i=>{i(r)}),n=t.get("*"),n&&[...n].map(i=>{i(e,r)})}}}const UH="en",WH=200,VH=WH-80,dS=20,nd=1e5,id=16,qp=10,Xp=10,Yp=2,GH=["#000000","#262626","#595959","#8C8C8C","#BFBFBF","#D9D9D9","#E9E9E9","#F5F5F5","#FAFAFA","#FFFFFF","#F5222D","#FA541C","#FA8C16","#FADB14","#52C41A","#13C2C2","#1890FF","#2F54EB","#722ED1","#EB2F96","#FFE8E6","#FFECE0","#FFEFD1","#FCFCCA","#E4F7D2","#D3F5F0","#D4EEFC","#DEE8FC","#EFE1FA","#FAE1EB","#FFA39E","#FFBB96","#FFD591","#FFFB8F","#B7EB8F","#87E8DE","#91D5FF","#ADC6FF","#D3ADF7","#FFADD2","#FF4D4F","#FF7A45","#FFA940","#FFEC3D","#73D13D","#36CFC9","#40A9FF","#597EF7","#9254DE","#F759AB","#CF1322","#D4380D","#D46B08","#D4B106","#389E0D","#08979C","#096DD9","#1D39C4","#531DAB","#C41D7F","#820014","#871400","#873800","#614700","#135200","#00474F","#003A8C","#061178","#22075E","#780650"],KH=["Inter","Comic Sans MS, Comic Sans","serif","cursive","Arial","Arial Black","Georgia","Impact","Tahoma","Times New Roman","Verdana","Courier New","Lucida Console","Monaco","monospace"],yM=["html","css","js","ts","bash"],qH={html:"HTML",css:"CSS",js:"JavaScript",ts:"TypeScript",bash:"Bash"},XH=["10px","11px","12px","14px","16px","18px","20px","22px","24px","26px","28px","36px","48px","72px"],ZC="default";var xh=(t=>(t[t["size-small"]=200]="size-small",t[t["size-medium"]=500]="size-medium",t["size-large"]="100%",t))(xh||{}),Eg=(t=>(t[t["size-small"]=480]="size-small",t[t["size-medium"]=640]="size-medium",t["size-large"]="100%",t))(Eg||{});const YH=["100%","115%","150%","200%","250%","300%"],vM="1",JH=["bold","italic","underline","strike","code","link","divider","color","highlight","textAlign"],Tu={lang:UH,message:{en:dM,hu_HU:mM,vi:hM,zh_CN:pM,pt_BR:fM}};class ZH{constructor(){Tn(this,"emitter");this.emitter=gM()}get lang(){return Tu.lang}set lang(e){if(!this.isLangSupported(e)){console.warn(`Can't find the current language "${e}", Using language "${Tu.lang}" by default`);return}Tu.lang=e,this.emitter.emit("lang",e)}get message(){return Tu.message}set message(e){Tu.message=e}loadLangMessage(e){return this.message[e]}isLangSupported(e){return Object.keys(this.message).includes(e)}setLang(e){this.lang=e}registerWatchLang(e){return this.emitter.on("lang",e),{unsubscribe:()=>{this.emitter.off("lang",e)}}}setMessage(e,r){this.message[e]=r}buildLocalesHandler(e){e||(e=this.lang);const r=this.loadLangMessage(e);return function(i){return r[i]||i}}}const Tg=new ZH,bM=ko.createSignal(Tu.lang);function Ct(){const[t,e]=ko.useSignal(bM),r=J.useMemo(()=>Tg.buildLocalesHandler(t),[t]);return J.useEffect(()=>{const n=Tg.registerWatchLang(i=>{e(i)});return()=>{n.unsubscribe()}},[]),{lang:t,t:r}}const Ot={t:t=>Tg.buildLocalesHandler(bM.get())(t)},QH=Tg,e7={padding:"0 12px 12px"},wM=({width:t,maxWidth:e,height:r,onOk:n,children:i})=>{const{t:o}=Ct(),[s,a]=J.useState({width:"",height:"",maxWidth:""});J.useEffect(()=>{a({width:t,height:r,maxWidth:e})},[r,e,t]);function l(c){c.preventDefault(),c.stopPropagation(),n(s)}return x.jsxs(xi,{modal:!0,children:[x.jsx(Si,{asChild:!0,children:i}),x.jsx(Xn,{children:x.jsx("div",{style:e7,children:x.jsxs("form",{className:"richtext-flex richtext-flex-col richtext-gap-2",onSubmit:l,children:[x.jsx(Kn,{className:"mb-[6px]",children:"Width"}),x.jsx("div",{className:"richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:x.jsx("div",{className:"richtext-relative richtext-items-center richtext-w-full richtext-max-w-sm",children:x.jsx(hn,{type:"number",value:s.width,required:!0,onChange:c=>a({...s,width:c.target.value})})})}),x.jsx(Kn,{className:"mb-[6px]",children:"Max Width"}),x.jsx("div",{className:"richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:x.jsx("div",{className:"richtext-relative richtext-items-center richtext-w-full richtext-max-w-sm",children:x.jsx(hn,{type:"number",value:s.maxWidth,required:!0,onChange:c=>a({...s,maxWidth:c.target.value})})})}),x.jsx(Kn,{className:"mb-[6px]",children:"Height"}),x.jsx("div",{className:"richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:x.jsx("div",{className:"richtext-relative richtext-items-center richtext-w-full richtext-max-w-sm",children:x.jsx(hn,{type:"number",value:s.height,required:!0,onChange:c=>a({...s,height:c.target.value})})})}),x.jsx(Mt,{type:"submit",className:"richtext-self-end richtext-mt-2",children:o("editor.link.dialog.button.apply")})]})})})]})};var xM={exports:{}};(function(t,e){(function(n,i){t.exports=i(J,ds)})(bh,function(r,n){return function(i){var o={};function s(a){if(o[a])return o[a].exports;var l=o[a]={i:a,l:!1,exports:{}};return i[a].call(l.exports,l,l.exports,s),l.l=!0,l.exports}return s.m=i,s.c=o,s.d=function(a,l,c){s.o(a,l)||Object.defineProperty(a,l,{enumerable:!0,get:c})},s.r=function(a){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},s.t=function(a,l){if(l&1&&(a=s(a)),l&8||l&4&&typeof a=="object"&&a&&a.__esModule)return a;var c=Object.create(null);if(s.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:a}),l&2&&typeof a!="string")for(var d in a)s.d(c,d,(function(f){return a[f]}).bind(null,d));return c},s.n=function(a){var l=a&&a.__esModule?function(){return a.default}:function(){return a};return s.d(l,"a",l),l},s.o=function(a,l){return Object.prototype.hasOwnProperty.call(a,l)},s.p="",s(s.s=4)}([function(i,o,s){i.exports=s(5)()},function(i,o){i.exports=r},function(i,o){i.exports=n},function(i,o){i.exports=function(s,a,l){var c=s.direction,d=s.value;switch(c){case"top":return l.top+d<a.top&&l.bottom>a.bottom&&l.left<a.left&&l.right>a.right;case"left":return l.left+d<a.left&&l.bottom>a.bottom&&l.top<a.top&&l.right>a.right;case"bottom":return l.bottom-d>a.bottom&&l.left<a.left&&l.right>a.right&&l.top<a.top;case"right":return l.right-d>a.right&&l.left<a.left&&l.top<a.top&&l.bottom>a.bottom}}},function(i,o,s){s.r(o),s.d(o,"default",function(){return fe});var a=s(1),l=s.n(a),c=s(2),d=s.n(c),f=s(0),p=s.n(f),m=s(3),g=s.n(m);function b(de){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?b=function(ne){return typeof ne}:b=function(ne){return ne&&typeof Symbol=="function"&&ne.constructor===Symbol&&ne!==Symbol.prototype?"symbol":typeof ne},b(de)}function S(de,U){if(!(de instanceof U))throw new TypeError("Cannot call a class as a function")}function w(de,U){for(var ne=0;ne<U.length;ne++){var R=U[ne];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(de,R.key,R)}}function T(de,U,ne){return U&&w(de.prototype,U),de}function M(de,U){return U&&(b(U)==="object"||typeof U=="function")?U:$(de)}function j(de){return j=Object.setPrototypeOf?Object.getPrototypeOf:function(ne){return ne.__proto__||Object.getPrototypeOf(ne)},j(de)}function $(de){if(de===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return de}function W(de,U){if(typeof U!="function"&&U!==null)throw new TypeError("Super expression must either be null or a function");de.prototype=Object.create(U&&U.prototype,{constructor:{value:de,writable:!0,configurable:!0}}),U&&Y(de,U)}function Y(de,U){return Y=Object.setPrototypeOf||function(R,le){return R.__proto__=le,R},Y(de,U)}function ee(de,U,ne){return U in de?Object.defineProperty(de,U,{value:ne,enumerable:!0,configurable:!0,writable:!0}):de[U]=ne,de}function P(de){return de.width===void 0&&(de.width=de.right-de.left),de.height===void 0&&(de.height=de.bottom-de.top),de}var fe=function(de){W(U,de);function U(ne){var R;return S(this,U),R=M(this,j(U).call(this,ne)),ee($(R),"getContainer",function(){return R.props.containment||window}),ee($(R),"addEventListener",function(le,Ee,he,Fe){R.debounceCheck||(R.debounceCheck={});var ye,ze,ue=function(){ye=null,R.check()};Fe>-1?ze=function(){ye||(ye=setTimeout(ue,Fe||0))}:ze=function(){clearTimeout(ye),ye=setTimeout(ue,he||0)};var V={target:le,fn:ze,getLastTimeout:function(){return ye}};le.addEventListener(Ee,V.fn),R.debounceCheck[Ee]=V}),ee($(R),"startWatching",function(){R.debounceCheck||R.interval||(R.props.intervalCheck&&(R.interval=setInterval(R.check,R.props.intervalDelay)),R.props.scrollCheck&&R.addEventListener(R.getContainer(),"scroll",R.props.scrollDelay,R.props.scrollThrottle),R.props.resizeCheck&&R.addEventListener(window,"resize",R.props.resizeDelay,R.props.resizeThrottle),!R.props.delayedCall&&R.check())}),ee($(R),"stopWatching",function(){if(R.debounceCheck){for(var le in R.debounceCheck)if(R.debounceCheck.hasOwnProperty(le)){var Ee=R.debounceCheck[le];clearTimeout(Ee.getLastTimeout()),Ee.target.removeEventListener(le,Ee.fn),R.debounceCheck[le]=null}}R.debounceCheck=null,R.interval&&(R.interval=clearInterval(R.interval))}),ee($(R),"check",function(){var le=R.node,Ee,he;if(!le)return R.state;if(Ee=P(R.roundRectDown(le.getBoundingClientRect())),R.props.containment){var Fe=R.props.containment.getBoundingClientRect();he={top:Fe.top,left:Fe.left,bottom:Fe.bottom,right:Fe.right}}else he={top:0,left:0,bottom:window.innerHeight||document.documentElement.clientHeight,right:window.innerWidth||document.documentElement.clientWidth};var ye=R.props.offset||{},ze=b(ye)==="object";ze&&(he.top+=ye.top||0,he.left+=ye.left||0,he.bottom-=ye.bottom||0,he.right-=ye.right||0);var ue={top:Ee.top>=he.top,left:Ee.left>=he.left,bottom:Ee.bottom<=he.bottom,right:Ee.right<=he.right},V=Ee.height>0&&Ee.width>0,me=V&&ue.top&&ue.left&&ue.bottom&&ue.right;if(V&&R.props.partialVisibility){var ge=Ee.top<=he.bottom&&Ee.bottom>=he.top&&Ee.left<=he.right&&Ee.right>=he.left;typeof R.props.partialVisibility=="string"&&(ge=ue[R.props.partialVisibility]),me=R.props.minTopValue?ge&&Ee.top<=he.bottom-R.props.minTopValue:ge}typeof ye.direction=="string"&&typeof ye.value=="number"&&(console.warn("[notice] offset.direction and offset.value have been deprecated. They still work for now, but will be removed in next major version. Please upgrade to the new syntax: { %s: %d }",ye.direction,ye.value),me=g()(ye,Ee,he));var ke=R.state;return R.state.isVisible!==me&&(ke={isVisible:me,visibilityRect:ue},R.setState(ke),R.props.onChange&&R.props.onChange(me)),ke}),R.state={isVisible:null,visibilityRect:{}},R}return T(U,[{key:"componentDidMount",value:function(){this.node=d.a.findDOMNode(this),this.props.active&&this.startWatching()}},{key:"componentWillUnmount",value:function(){this.stopWatching()}},{key:"componentDidUpdate",value:function(R){this.node=d.a.findDOMNode(this),this.props.active&&!R.active?(this.setState({isVisible:null,visibilityRect:{}}),this.startWatching()):this.props.active||this.stopWatching()}},{key:"roundRectDown",value:function(R){return{top:Math.floor(R.top),left:Math.floor(R.left),bottom:Math.floor(R.bottom),right:Math.floor(R.right)}}},{key:"render",value:function(){return this.props.children instanceof Function?this.props.children({isVisible:this.state.isVisible,visibilityRect:this.state.visibilityRect}):l.a.Children.only(this.props.children)}}]),U}(l.a.Component);ee(fe,"defaultProps",{active:!0,partialVisibility:!1,minTopValue:0,scrollCheck:!1,scrollDelay:250,scrollThrottle:-1,resizeCheck:!1,resizeDelay:250,resizeThrottle:-1,intervalCheck:!0,intervalDelay:100,delayedCall:!1,offset:{},containment:null,children:l.a.createElement("span",null)}),ee(fe,"propTypes",{onChange:p.a.func,active:p.a.bool,partialVisibility:p.a.oneOfType([p.a.bool,p.a.oneOf(["top","right","bottom","left"])]),delayedCall:p.a.bool,offset:p.a.oneOfType([p.a.shape({top:p.a.number,left:p.a.number,bottom:p.a.number,right:p.a.number}),p.a.shape({direction:p.a.oneOf(["top","right","bottom","left"]),value:p.a.number})]),scrollCheck:p.a.bool,scrollDelay:p.a.number,scrollThrottle:p.a.number,resizeCheck:p.a.bool,resizeDelay:p.a.number,resizeThrottle:p.a.number,intervalCheck:p.a.bool,intervalDelay:p.a.number,containment:typeof window<"u"?p.a.instanceOf(window.Element):p.a.any,children:p.a.oneOfType([p.a.element,p.a.func]),minTopValue:p.a.number})},function(i,o,s){var a=s(6);function l(){}function c(){}c.resetWarningCache=l,i.exports=function(){function d(m,g,b,S,w,T){if(T!==a){var M=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw M.name="Invariant Violation",M}}d.isRequired=d;function f(){return d}var p={array:d,bool:d,func:d,number:d,object:d,string:d,symbol:d,any:d,arrayOf:f,element:d,elementType:d,instanceOf:f,node:d,objectOf:f,oneOf:f,oneOfType:f,shape:f,exact:f,checkPropTypes:c,resetWarningCache:l};return p.PropTypes=p,p}},function(i,o,s){var a="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";i.exports=a}])})})(xM);var t7=xM.exports;const r7=W1(t7),n7="_wrap_15k3c_1",i7="_renderWrap_15k3c_7",o7="_title_15k3c_14",s7="_icon_15k3c_20",a7="_handlerWrap_15k3c_30",Of={wrap:n7,renderWrap:i7,title:o7,icon:s7,handlerWrap:a7};function SM(t,e,r){return t<e?e:t>r?r:t}const l7=t=>typeof t=="number",c7=t=>typeof t=="string",u7=t=>typeof t=="function";function d7(t,e="px"){if(!t)return t;const r=l7(t)?String(t):t,n=Number.parseFloat(r),i=r.match(/[a-z%]+$/i),o=i?i[0]:e;return Number.isNaN(n)?t:n+o}function kM(t,e){if(!t)return!1;const{extensions:r=[]}=(t==null?void 0:t.extensionManager)??{};return!!r.find(i=>i.name===e)}function Sx(t){return t.map(e=>c7(e)?{value:e,name:e}:e)}const f7=10,h7=200,QC=15,eE={width:"100%",height:"100%",maxWidth:"100%"};function p7({editor:t,node:e,updateAttributes:r}){const n=J.useRef(null),i=t.isActive(Tl.name),{data:o,width:s,height:a}=e.attrs,[l,c]=J.useState(null),[d,f]=J.useState(!0),[p,m]=J.useState(null),[g,b]=J.useState(!1),[S,w]=J.useState(100),T=J.useCallback($=>{$&&b(!0)},[b]),M=J.useCallback($=>()=>{w(W=>SM($==="minus"?W-QC:W+QC,f7,h7))},[]);J.useEffect(()=>{let $=!1;return import("@excalidraw/excalidraw").then(W=>{$||(n.current=W.exportToSvg)}).catch(W=>!$&&m(W)).finally(()=>!$&&f(!1)),()=>{$=!0}},[f,o]),J.useEffect(()=>{let $=!1;return(async()=>{if($||d||p||!g||!o)return;const Y=await n.current(o);$||(Y.setAttribute("width","100%"),Y.setAttribute("height","100%"),Y.setAttribute("display","block"),c(Y))})(),()=>{$=!0}},[o,d,p,g]);const j=$=>{r({width:$.width,height:$.height})};return x.jsx(gi,{className:Gr(Of.wrap,i&&Of.isActive),children:x.jsx(r7,{onChange:T,children:x.jsx(pR.Resizable,{size:{width:Number.parseInt(s),height:Number.parseInt(a)},onResizeStop:($,W,Y,ee)=>{j({width:Number.parseInt(s)+ee.width,height:Number.parseInt(a)+ee.height})},children:x.jsxs("div",{className:Gr(Of.renderWrap,"render-wrapper"),style:{...eE,overflow:"hidden"},children:[p&&x.jsx("div",{style:eE,children:x.jsx("p",{children:p.message||p})}),d&&x.jsx("p",{children:"Loading..."}),!d&&!p&&g&&x.jsx("div",{style:{height:"100%",maxHeight:"100%",padding:24,overflow:"hidden",display:"flex",justifyContent:"center",alignItems:"center",transform:`scale(${S/100})`,transition:"all ease-in-out .3s"},dangerouslySetInnerHTML:{__html:(l==null?void 0:l.outerHTML)??""}}),x.jsx("div",{className:Of.title}),x.jsxs("div",{className:Of.handlerWrap,children:[x.jsx(Ve,{icon:"ZoomOut",action:M("minus"),tooltip:"Zoom Out"}),x.jsx(Ve,{icon:"ZoomIn",action:M("plus"),tooltip:"Zoom In"})]})]})})})})}const m7=J.memo(p7,(t,e)=>!!aS(t.node.attrs,e.node.attrs));function g7(t,e="{}"){try{return JSON.stringify(t)}catch{return e}}function y7(t){try{return JSON.stringify(t)}catch{return JSON.stringify({})}}function fn(t,e=!1){return r=>{const n=t.startsWith("data-")?t:`data-${t}`;let i=decodeURIComponent(r.getAttribute(n));if(i==null||typeof i=="string"&&i==="null")try{const a=r.outerHTML.match(/([\s\S])+?="([\s\S])+?"/g);a&&a.length&&(i=(a.map(c=>c.trim()).reduce((c,d)=>{const f=d.indexOf("="),p=[d.slice(0,f),d.slice(f+1).slice(1,-1)];return c[p[0]]=p[1],c},{})[t.toLowerCase()]||"").replaceAll(""",'"'))}catch(s){console.error("Error getDatasetAttribute ",s.message,r)}if(e)try{return JSON.parse(i)}catch{return{}}if(i.includes("%")||i.includes("auto"))return i;const o=Number.parseInt(i);return o!==o?i:o}}function v7(t){const{attrs:e}=t;return Object.keys(e).reduce((r,n)=>{const i=e[n];if(i==null)return r;let o="";return typeof i=="object"?o=y7(i):o=i,r[n]=o,r},Object.create(null))}const lc=yi.Root,cc=yi.Trigger,b7=yi.Portal,_M=At.forwardRef(({className:t,...e},r)=>x.jsx(yi.Overlay,{ref:r,className:pt("richtext-fixed richtext-inset-0 richtext-z-50 richtext-bg-black/80 richtext- data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0",t),...e}));_M.displayName=yi.Overlay.displayName;const Na=At.forwardRef(({className:t,children:e,...r},n)=>x.jsxs(b7,{children:[x.jsx(_M,{}),x.jsxs(yi.Content,{ref:n,className:pt("richtext-dialog-content richtext-fixed richtext-left-[50%] richtext-top-[50%] richtext-z-50 richtext-grid richtext-w-full richtext-max-w-lg richtext-translate-x-[-50%] richtext-translate-y-[-50%] richtext-gap-4 richtext-border richtext-bg-background richtext-p-6 richtext-shadow-lg richtext-duration-200 data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0 data-[state=closed]:richtext-zoom-out-95 data-[state=open]:richtext-zoom-in-95 data-[state=closed]:richtext-slide-out-to-left-1/2 data-[state=closed]:richtext-slide-out-to-top-[48%] data-[state=open]:richtext-slide-in-from-left-1/2 data-[state=open]:richtext-slide-in-from-top-[48%] sm:richtext-rounded-lg",t),...r,children:[e,x.jsxs(yi.Close,{className:"richtext-absolute richtext-right-4 richtext-top-4 richtext-rounded-sm richtext-opacity-70 richtext-ring-offset-background richtext-transition-opacity hover:richtext-opacity-100 focus:richtext-outline-none focus:richtext-ring-2 focus:richtext-ring-ring focus:richtext-ring-offset-2 disabled:richtext-pointer-events-none data-[state=open]:richtext-bg-accent data-[state=open]:richtext-text-muted-foreground",children:[x.jsx(He.X,{className:"richtext-h-4 richtext-w-4"}),x.jsx("span",{className:"richtext-sr-only",children:"Close"})]})]})]}));Na.displayName=yi.Content.displayName;function CM({className:t,...e}){return x.jsx("div",{className:pt("richtext-flex richtext-flex-col richtext-space-y-1.5 richtext-text-center sm:richtext-text-left",t),...e})}CM.displayName="DialogHeader";function _d({className:t,...e}){return x.jsx("div",{className:pt("richtext-flex richtext-flex-col-reverse sm:richtext-flex-row sm:richtext-justify-end sm:richtext-space-x-2",t),...e})}_d.displayName="DialogFooter";const Da=At.forwardRef(({className:t,...e},r)=>x.jsx(yi.Title,{ref:r,className:pt("richtext-text-lg richtext-font-semibold richtext-leading-none richtext-tracking-tight",t),...e}));Da.displayName=yi.Title.displayName;const w7=At.forwardRef(({className:t,...e},r)=>x.jsx(yi.Description,{ref:r,className:pt("richtext-text-sm richtext-text-muted-foreground",t),...e}));w7.displayName=yi.Description.displayName;let ew;function fS(){try{return ew||(ew=gM()),ew}catch{throw new Error("Error EventEmitter")}}const kx="OPEN_EXCALIDRAW_SETTING_MODAL";function x7(t,e){fS().on(t,e)}function S7(t,e){fS().off(t,e)}function k7(t){fS().emit(kx,t)}const _7=({editor:t})=>{const[e,r]=J.useState(null),[n,i]=J.useState({}),[o,s]=J.useState({elements:[],appState:{isLoading:!1},files:null}),[a,l]=J.useState(!1),[c,d]=J.useState(!0),[f,p]=J.useState(null),m=J.useCallback(w=>{w&&import("@excalidraw/excalidraw").then(T=>{r(T.Excalidraw)}).catch(p).finally(()=>d(!1))},[d]),g=J.useCallback(w=>{setTimeout(()=>{w.refresh()})},[]),b=J.useCallback((w,T,M)=>{i({elements:w,appState:{isLoading:!1},files:M})},[]),S=J.useCallback(()=>{if(!e){l(!1);return}t.chain().focus().setExcalidraw({data:n}).run(),l(!1)},[e,t,n,l]);return J.useEffect(()=>{const w=T=>{l(!0),T&&s(T.data)};return x7(kx,w),()=>{S7(kx,w)}},[t,l]),x.jsxs(lc,{open:a,onOpenChange:l,children:[x.jsx(cc,{asChild:!0,children:x.jsx(Ve,{icon:"Excalidraw",tooltip:"Excalidraw",action:()=>l(!0)})}),x.jsxs(Na,{className:"!richtext-max-w-[1300px] richtext-z-[99999]",children:[x.jsx(Da,{children:"Excalidraw"}),x.jsxs("div",{style:{height:"100%",borderWidth:1},children:[c&&x.jsx("p",{children:"Loading..."}),f&&x.jsx("p",{children:f&&f.message||"Error"}),x.jsx("div",{style:{width:"100%",height:600},ref:m,children:!c&&!f&&e?x.jsx(e,{ref:g,onChange:b,langCode:"en",initialData:o}):null})]}),x.jsx(_d,{children:x.jsx(Mt,{type:"button",onClick:S,children:"Save changes"})})]})]})},tE={elements:[]},Tl=Nt.create({name:"excalidraw",group:"block",selectable:!0,atom:!0,draggable:!0,inline:!1,addAttributes(){return{defaultShowPicker:{default:!1},createUser:{default:null},width:{default:"100%",parseHTML:fn("width")},height:{default:240,parseHTML:fn("height")},data:{default:tE,parseHTML:fn("data",!0)}}},addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),HTMLAttributes:{class:"excalidraw"},button:({editor:e})=>({component:_7,componentProps:{editor:e}})}},parseHTML(){return[{tag:"div[class=excalidraw]"}]},renderHTML({HTMLAttributes:t,node:e}){return["div",lt(this.options.HTMLAttributes,t,v7(e))]},addCommands(){return{setExcalidraw:t=>({tr:e,commands:r,chain:n})=>{var i,o,s;return t=t||{},t.data=t.data||tE,((s=(o=(i=e.selection)==null?void 0:i.node)==null?void 0:o.type)==null?void 0:s.name)==this.name?r.updateAttributes(this.name,t):n().insertContent({type:this.name,attrs:t}).run()}}},addNodeView(){return _o(m7)},addInputRules(){return[$h({find:/^\$excalidraw\$$/,type:this.type,getAttributes:()=>({width:"100%"})})]}}),vl=new Map;function C7(t){const e=t.options.element;vl.has("width")||vl.set("width",e.clientWidth),vl.has("width")&&vl.get("width")<=0&&vl.set("width",e.clientWidth);const r={attributes:!0,childList:!0,subtree:!0},n=function(){vl.set("width",e.clientWidth)},i=new MutationObserver(n);return i.observe(e,r),t.on("destroy",()=>{i.disconnect()}),{width:vl.get("width")}}function E7({editor:t}){const{t:e}=Ct(),{width:r}=C7(t),n=Wh(t,Tl.name,{defaultShowPicker:!1,createUser:"",width:0,height:0}),{defaultShowPicker:i,createUser:o,width:s,height:a}=n,l=J.useCallback(p=>{t.chain().updateAttributes(Tl.name,p).setNodeSelection(t.state.selection.from).focus().run()},[t]),c=J.useCallback(()=>{k7(n)},[t,n]),d=J.useCallback(()=>t.isActive(Tl.name),[t]),f=J.useCallback(()=>bd(Tl.name,t),[t]);return J.useEffect(()=>{i&&(c(),t.chain().updateAttributes(Tl.name,{defaultShowPicker:!1}).focus().run())},[o,i,t,c]),x.jsx(qn,{className:"bubble-menu",editor:t,pluginKey:"excalidraw-bubble-menu",shouldShow:d,tippyOptions:{popperOptions:{modifiers:[{name:"flip",enabled:!1}]},placement:"bottom-start",offset:[-2,16],zIndex:9999},children:x.jsxs("div",{className:"richtext-w-auto richtext-px-3 richtext-py-2 richtext-transition-all !richtext-border richtext-rounded-sm richtext-shadow-sm richtext-pointer-events-auto richtext-select-none richtext-border-neutral-200 dark:richtext-border-neutral-800 richtext-bg-background",children:[x.jsx(Ve,{icon:"Pencil",action:c,tooltip:e("editor.edit")}),x.jsx(wM,{width:s,maxWidth:r,height:a,onOk:l,children:x.jsx(Ve,{icon:"Settings",tooltip:e("editor.settings")})}),x.jsx(Ve,{icon:"Trash2",action:f,tooltip:e("editor.delete")})]})})}const T7="_wrap_5y04w_1",A7="_handlerWrap_5y04w_11",R7="_innerWrap_5y04w_15",I7="_emptyWrap_5y04w_23",rE={wrap:T7,handlerWrap:A7,innerWrap:R7,emptyWrap:I7},EM=ko.createSignal(!1);function Wy(){return ko.useSignalValue(EM)}const O7={setDisable:t=>{EM.set(t)}};function M7({editor:t,node:e,updateAttributes:r}){const n=Wy(),{url:i,width:o,height:s}=e.attrs,[a,l]=J.useState("");function c(){a&&t.chain().updateAttributes(Al.name,{url:a}).setNodeSelection(t.state.selection.from).focus().run()}const d=J.useCallback(f=>{r({width:f.width,height:f.height})},[r]);return x.jsxs(gi,{children:[!i&&x.jsxs("div",{className:"richtext-max-w-[600px] richtext-mx-[auto] richtext-my-[12px] richtext-flex richtext-items-center richtext-justify-center richtext-gap-[10px] richtext-p-[10px] richtext-border-[1px] richtext-border-solid richtext-border-[#ccc] richtext-rounded-[12px]",children:[x.jsx(hn,{value:a,onInput:f=>l(f.target.value),type:"url",className:"richtext-flex-1",autoFocus:!0,placeholder:"Enter link"}),x.jsx(Mt,{className:"richtext-w-[60px]",onClick:c,children:"OK"})]}),i&&x.jsx(pR.Resizable,{size:{width:Number.parseInt(o),height:Number.parseInt(s)},onResizeStop:(f,p,m,g)=>{d({width:Number.parseInt(o)+g.width,height:Number.parseInt(s)+g.height})},children:x.jsx("div",{className:Gr(rE.wrap,"render-wrapper"),children:x.jsx("div",{className:rE.innerWrap,style:{pointerEvents:n?"none":"auto"},children:x.jsx("iframe",{src:i,className:"richtext-my-[12px] "})})})})]})}const Al=Nt.create({name:"iframe",content:"",marks:"",group:"block",selectable:!0,atom:!0,draggable:!0,addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),HTMLAttributes:{class:"iframe"},button:({editor:e,extension:r,t:n})=>({component:Ve,componentProps:{action:i=>e.commands.setIframe(i),upload:r.options.upload,disabled:!e.can().setIframe({}),icon:"Iframe",tooltip:n("editor.iframe.tooltip")}})}},addAttributes(){return{width:{default:600,parseHTML:fn("width")},height:{default:300,parseHTML:fn("height")},url:{default:null,parseHTML:fn("url")},defaultShowPicker:{default:!1},frameborder:{default:0},allowfullscreen:{default:this.options.allowFullscreen,parseHTML:()=>this.options.allowFullscreen}}},parseHTML(){return[{tag:"iframe"}]},renderHTML({HTMLAttributes:t}){return["iframe",lt(this.options.HTMLAttributes,t)]},addCommands(){return{setIframe:t=>({tr:e,commands:r,chain:n})=>{var o,s,a;if(((a=(s=(o=e.selection)==null?void 0:o.node)==null?void 0:s.type)==null?void 0:a.name)==this.name)return r.updateAttributes(this.name,t);const i=t||{url:""};return n().insertContent({type:this.name,attrs:i}).run()}}},addInputRules(){return[$h({find:/^\$iframe\$$/,type:this.type,getAttributes:()=>({width:"100%"})})]},addNodeView(){return _o(M7)}});function N7({editor:t}){const{t:e}=Ct(),{width:r,height:n,url:i}=Wh(t,Al.name,{width:0,height:0,url:"",defaultShowPicker:!1}),[o,s]=J.useState(!1),[a,l]=J.useState(""),c=J.useCallback(()=>{s(!1)},[s]);J.useEffect(()=>{o&&l(i)},[o,i]);const d=J.useCallback(()=>{t.chain().updateAttributes(Al.name,{url:a}).setNodeSelection(t.state.selection.from).focus().run(),s(!1)},[t,a,s]),f=J.useCallback(()=>{window.open(i,"_blank")},[i]),p=J.useCallback(()=>{s(!0)},[s]),m=J.useCallback(S=>{t.chain().updateAttributes(Al.name,S).setNodeSelection(t.state.selection.from).focus().run()},[t]),g=J.useCallback(()=>t.isActive(Al.name)&&!i,[t,i]),b=J.useCallback(()=>bd(Al.name,t),[t]);return x.jsxs(x.Fragment,{children:[x.jsx(qn,{className:"bubble-menu",editor:t,pluginKey:"iframe-bubble-menu",shouldShow:g,tippyOptions:{popperOptions:{modifiers:[{name:"flip",enabled:!1}]},placement:"bottom-start",offset:[-2,16],zIndex:9999},children:x.jsxs("div",{className:"richtext-w-auto richtext-px-3 richtext-py-2 richtext-transition-all !richtext-border richtext-rounded-sm richtext-shadow-sm richtext-pointer-events-auto richtext-select-none richtext-border-neutral-200 dark:richtext-border-neutral-800 richtext-bg-background",children:[x.jsx(Ve,{action:f,icon:"Eye",tooltip:"Visit Link"}),x.jsx(Ve,{action:p,icon:"Pencil",tooltip:"Open Edit Link"}),x.jsx(wM,{width:r,height:n,onOk:m,children:x.jsx(Ve,{icon:"Settings",tooltip:e("editor.settings")})}),x.jsx(Ve,{action:b,icon:"Trash2",tooltip:e("editor.delete")})]})}),x.jsxs(lc,{open:o,onOpenChange:s,children:[x.jsx(cc,{}),x.jsxs(Na,{children:[x.jsx(CM,{children:x.jsx(Da,{children:"Edit Link Iframe"})}),x.jsx(hn,{value:a,onInput:S=>l(S.target.value),type:"url",autoFocus:!0,placeholder:"Enter link"}),x.jsxs(_d,{children:[x.jsx(Mt,{onClick:c,children:"Cancel"}),x.jsx(Mt,{onClick:d,children:"OK"})]})]})]})]})}const Jp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",D7=t=>{t=t.replace(/\r\n/g,`
|
|
125
|
+
`);let e=0,r="";for(;e<t.length;e++){const n=t.charCodeAt(e);n<128?r+=String.fromCharCode(n):n>127&&n<2048?(r+=String.fromCharCode(n>>6|192),r+=String.fromCharCode(63&n|128)):(r+=String.fromCharCode(n>>12|224),r+=String.fromCharCode(n>>6&63|128),r+=String.fromCharCode(63&n|128))}return r},P7=t=>{let e,r,n,i,o,s,a,l=0,c="";for(t=D7(t);l<t.length;)e=t.charCodeAt(l++),r=t.charCodeAt(l++),n=t.charCodeAt(l++),i=e>>2,o=(3&e)<<4|r>>4,s=(15&r)<<2|n>>6,a=63&n,isNaN(r)?s=a=64:isNaN(n)&&(a=64),c=c+Jp.charAt(i)+Jp.charAt(o)+Jp.charAt(s)+Jp.charAt(a);return c},L7=t=>typeof t=="string"?"string":typeof SVGElement<"u"&&t instanceof SVGElement?"element":void 0,TM=t=>"data:image/svg+xml;base64,"+P7(t),F7=t=>TM(new XMLSerializer().serializeToString(t)),AM=t=>{switch(L7(t)){case"string":return TM(t);case"element":return F7(t);default:return t}};function RM(t=8){return Math.random().toString(36).substring(2,t+2)}function j7(t){return t.replace(/^.*\/|\..+$/g,"")}function B7(t){return t.split(".").pop()}function IM(t){return t<1024?`${t} Byte`:t<1024*1024?`${(t/1024).toFixed(2)} KB`:`${(t/1024/1024).toFixed(2)} MB`}function z7(t){return t?t==="application/pdf"?"pdf":t.startsWith("application/")&&[".document","word"].some(e=>t.includes(e))?"word":t.startsWith("application/")&&["presentation"].some(e=>t.includes(e))?"excel":t.startsWith("application/")&&["sheet"].some(e=>t.includes(e))?"ppt":t.startsWith("image")?"image":t.startsWith("audio")?"audio":t.startsWith("video")?"video":"file":"file"}function H7(t){return new Promise(e=>{const r=new FileReader;r.addEventListener("load",()=>{e({alt:t.name,src:r.result})},!1),r.readAsDataURL(t)})}function hS(t,e){const r=t.split(","),n=r[0].match(/:(.*?);/)[1],i=atob(r[r.length-1]);let o=i.length;const s=new Uint8Array(o);for(;o--;)s[o]=i.charCodeAt(o);return new File([s],e,{type:n})}const nE=`graph TB
|
|
126
|
+
a-->b`,$7=({editor:t,attrs:e,extension:r})=>{const{alt:n,align:i}=e,[o,s]=J.useState(decodeURIComponent(n??nE)),[a,l]=J.useState(""),[c,d]=J.useState(!1),f=J.useRef(null),p=r==null?void 0:r.options.upload,m=async S=>{try{const{svg:w}=await Zm.render("mermaid-svg",S);l(w)}catch{l("")}},g=()=>{Zm.initialize({darkMode:!1,startOnLoad:!1,fontSize:12,theme:"base"}),m(o)};J.useEffect(()=>{c&&g()},[c]),J.useEffect(()=>{c&&m(o)},[o]);const b=async()=>{if(o!==""){if(o){const S=f.current.querySelector("svg"),{width:w,height:T}=S.getBoundingClientRect(),M=`mermaid-${RM()}.svg`;let j=AM(S.outerHTML);if(p){const $=hS(j,M);j=await p($)}t==null||t.chain().focus().setMermaid({type:"mermaid",src:j,alt:encodeURIComponent(o),width:w,height:T},!!o).run(),t==null||t.commands.setAlignImageMermaid(i)}d(!1)}};return x.jsxs(lc,{open:c,onOpenChange:d,children:[x.jsx(cc,{asChild:!0,children:x.jsx(Ve,{icon:"Pencil",tooltip:"Edit Mermaid",action:()=>d(!0)})}),x.jsxs(Na,{className:"!richtext-max-w-[1300px] richtext-z-[99999]",children:[x.jsx(Da,{children:"Edit Mermaid"}),x.jsx("div",{style:{height:"100%",border:"1px solid hsl(var(--border))"},children:x.jsxs("div",{className:"richtext-flex richtext-gap-[10px] richtext-rounded-[10px] richtext-p-[10px]",children:[x.jsx(Vh,{className:"richtext-flex-1",value:o,onChange:S=>s(S.target.value),autoFocus:!0,required:!0,rows:10,defaultValue:nE,placeholder:"Text",style:{color:"hsl(var(--richtext-foreground))"}}),x.jsx("div",{className:"richtext-flex-1 richtext-flex richtext-items-center richtext-justify-center richtext-rounded-[10px] richtext-p-[10px]",style:{height:"100%",border:"1px solid hsl(var(--border))",minHeight:500,background:"#fff"},ref:f,dangerouslySetInnerHTML:{__html:a}})]})}),x.jsx(_d,{children:x.jsx(Mt,{type:"button",onClick:b,children:"Save changes"})})]})]})};function U7(t,e){const[r,n]=J.useState(void 0);return J.useEffect(()=>{const i=()=>{const o=t.extensionManager.extensions.find(s=>s.name===e);o&&n(o)};return t.on("selectionUpdate",i),t.on("transaction",i),()=>{t.off("selectionUpdate",i),t.off("transaction",i)}},[t,e]),r}const W7={maxWidth:"auto",zIndex:20,appendTo:"parent",moveTransition:"transform 0.1s ease-out"};function V7({item:t,disabled:e,editor:r}){var i;const n=t.component;return n?x.jsx(J.Fragment,{children:t.type==="divider"?x.jsx(Bi,{orientation:"vertical",className:"!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]"}):x.jsx(n,{...t.componentProps,editor:r,disabled:e||((i=t==null?void 0:t.componentProps)==null?void 0:i.disabled)})}):x.jsx(x.Fragment,{})}function G7(t){return t.type.name==="mermaid"}function K7(t){const{lang:e}=Ct(),r=Wh(t.editor,g1.name),n=U7(t.editor,g1.name),i=({editor:s})=>{const{selection:a}=s.view.state,{$from:l,to:c}=a;let d=!1;return s.view.state.doc.nodesBetween(l.pos,c,f=>{if(G7(f))return d=!0,!1}),d},o=J.useMemo(()=>t.disabled?[]:kG(t.editor),[t.disabled,t.editor,e]);return x.jsx(x.Fragment,{children:x.jsx(qn,{shouldShow:i,editor:t==null?void 0:t.editor,tippyOptions:W7,children:o!=null&&o.length?x.jsx("div",{className:"richtext-w-auto richtext-px-3 richtext-py-2 richtext-transition-all !richtext-border richtext-rounded-sm richtext-shadow-sm richtext-pointer-events-auto richtext-select-none richtext-border-neutral-200 dark:richtext-border-neutral-800 richtext-bg-background",children:x.jsx("div",{className:"richtext-flex richtext-items-center richtext-flex-nowrap richtext-whitespace-nowrap richtext-h-[26px] richtext-justify-start richtext-relative",children:o==null?void 0:o.map((s,a)=>s.type==="edit"&&(r!=null&&r.src)?x.jsx($7,{editor:t.editor,attrs:r,extension:n},`bubbleMenu-mermaid-${a}`):x.jsx(V7,{item:s,disabled:t.disabled,editor:t.editor},`bubbleMenu-mermaid-${a}`))})}):x.jsx(x.Fragment,{})})})}function q7({node:t}){var n;const e=((n=t==null?void 0:t.attrs)==null?void 0:n.src)||"",r=e==null?void 0:e.split("/").pop();return r?x.jsx(gi,{children:x.jsx("div",{"data-twitter":"",children:x.jsx(S2.Tweet,{id:r})})}):null}function X7(t){function e(r){t.action&&t.action(r)}return x.jsxs(xi,{modal:!0,children:[x.jsx(Si,{disabled:t==null?void 0:t.disabled,asChild:!0,children:x.jsx(Ve,{tooltip:t==null?void 0:t.tooltip,isActive:t==null?void 0:t.isActive,disabled:t==null?void 0:t.disabled,children:x.jsx(Rt,{name:t==null?void 0:t.icon})})}),x.jsx(Xn,{hideWhenDetached:!0,className:"richtext-w-full",align:"start",side:"bottom",children:x.jsx(OM,{editor:t.editor,onSetLink:e})})]})}const Y7=/(https?:\/\/)?(www\.)?x\.com\/(\w{1,15})(\/status\/(\d+))?(\/\S*)?/g,J7=/^https?:\/\/(www\.)?x\.com\/(\w{1,15})(\/status\/(\d+))?(\/\S*)?$/;function iE(t){return t.match(J7)}const Ag=Nt.create({name:"twitter",draggable:!0,selectable:!0,addOptions(){return{addPasteHandler:!0,HTMLAttributes:{},inline:!1,origin:"",button:({editor:t,t:e})=>({component:X7,componentProps:{action:r=>{t.commands.setTweet({src:r})},isActive:()=>!1,disabled:!1,icon:"Twitter",tooltip:e("editor.twitter.tooltip"),editor:t}})}},addNodeView(){return _o(q7,{attrs:this.options.HTMLAttributes})},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},addAttributes(){return{src:{default:null}}},parseHTML(){return[{tag:"div[data-twitter]"}]},addCommands(){return{setTweet:t=>({commands:e})=>iE(t.src)?e.insertContent({type:this.name,attrs:t}):!1,updateTweet:t=>({commands:e})=>iE(t.src)?e.updateAttributes(this.name,{src:t.src}):!1}},addPasteRules(){return this.options.addPasteHandler?[E4({find:Y7,type:this.type,getAttributes:t=>({src:t.input})})]:[]},renderHTML({HTMLAttributes:t}){return["div",lt({"data-twitter":""},t)]}});function OM(t){const{t:e}=Ct(),[r,n]=J.useState("");J.useEffect(()=>{var o;if(t!=null&&t.editor){const{src:s}=(o=t.editor)==null?void 0:o.getAttributes(Ag.name);s&&n(s)}},[t==null?void 0:t.editor]);function i(o){o.preventDefault(),o.stopPropagation(),t==null||t.onSetLink(r)}return x.jsx("div",{className:"richtext-p-2 richtext-bg-white !richtext-border richtext-rounded-lg richtext-shadow-sm dark:richtext-bg-black border-neutral-200 dark:richtext-border-neutral-800",children:x.jsxs("form",{className:"richtext-flex richtext-flex-col richtext-gap-2",onSubmit:i,children:[x.jsx(Kn,{className:"mb-[6px]",children:e("editor.link.dialog.text")}),x.jsx("div",{className:"richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5 richtext-mb-[10px]",children:x.jsx("div",{className:"richtext-relative richtext-items-center richtext-w-full richtext-max-w-sm",children:x.jsx(hn,{type:"text",value:r,required:!0,className:"richtext-w-80",placeholder:"Text",onChange:o=>n(o.target.value)})})}),x.jsx(Mt,{type:"submit",className:"richtext-self-end richtext-mt-2",children:e("editor.link.dialog.button.apply")})]})})}function Z7({editor:t,disabled:e}){const[r,n]=J.useState(!1),{t:i}=Ct(),o=J.useCallback(({editor:l})=>l.isActive(Ag.name),[]),s=l=>{t.commands.updateTweet({src:l}),n(!1)},a=J.useCallback(()=>bd(Ag.name,t),[t]);return x.jsx(x.Fragment,{children:x.jsx(qn,{editor:t,shouldShow:o,tippyOptions:{popperOptions:{modifiers:[{name:"flip",enabled:!1}]},placement:"bottom-start",offset:[-2,16],zIndex:9999,onHidden:()=>{n(!1)}},children:e?x.jsx(x.Fragment,{}):x.jsx(x.Fragment,{children:r?x.jsx(OM,{onSetLink:s,editor:t}):x.jsx("div",{className:"richtext-flex richtext-items-center richtext-gap-2 richtext-p-2 richtext-bg-white !richtext-border richtext-rounded-lg richtext-shadow-sm dark:richtext-bg-black richtext-border-neutral-200 dark:richtext-border-neutral-800",children:x.jsxs("div",{className:"richtext-flex richtext-flex-nowrap",children:[x.jsx(Ve,{icon:"Pencil",tooltip:i("editor.link.edit.tooltip"),action:()=>{n(!0)},tooltipOptions:{sideOffset:15}}),x.jsx(Ve,{icon:"Trash",tooltip:i("editor.delete"),action:a,tooltipOptions:{sideOffset:15}})]})})})})})}function Q7({editor:t,disabled:e,bubbleMenu:r}){const n=t.extensionManager.extensions.map(o=>o.name),i=()=>{var o,s,a,l,c,d,f,p,m,g,b,S,w;return[n.includes("columns")&&!((o=r==null?void 0:r.columnConfig)!=null&&o.hidden)?x.jsx(Bq,{editor:t},"columns"):null,n.includes("table")&&!((s=r==null?void 0:r.tableConfig)!=null&&s.hidden)?x.jsx(Iq,{editor:t},"table"):null,n.includes("link")&&!((a=r==null?void 0:r.linkConfig)!=null&&a.hidden)?x.jsx(Mq,{editor:t,disabled:e},"link"):null,n.includes("image")&&!((l=r==null?void 0:r.imageConfig)!=null&&l.hidden)?x.jsx(Lq,{editor:t,disabled:e},"image"):null,n.includes(pk.name)&&!((c=r==null?void 0:r.imageGifConfig)!=null&&c.hidden)?x.jsx(Fq,{editor:t,disabled:e},"imageGif"):null,n.includes("video")&&!((d=r==null?void 0:r.videoConfig)!=null&&d.hidden)?x.jsx(jq,{editor:t,disabled:e},"video"):null,n.includes("katex")&&!((f=r==null?void 0:r.katexConfig)!=null&&f.hidden)?x.jsx(FH,{editor:t,disabled:e},"katex"):null,n.includes("excalidraw")&&!((p=r==null?void 0:r.excalidrawConfig)!=null&&p.hidden)?x.jsx(E7,{editor:t,disabled:e},"excalidraw"):null,n.includes("mermaid")&&!((m=r==null?void 0:r.mermaidConfig)!=null&&m.hidden)?x.jsx(K7,{editor:t,disabled:e},"mermaid"):null,n.includes("iframe")&&!((g=r==null?void 0:r.iframeConfig)!=null&&g.hidden)?x.jsx(N7,{editor:t,disabled:e},"iframe"):null,n.includes("twitter")&&!((b=r==null?void 0:r.twitterConfig)!=null&&b.hidden)?x.jsx(Z7,{editor:t,disabled:e},"twitter"):null,(S=r==null?void 0:r.floatingMenuConfig)!=null&&S.hidden?null:x.jsx(Cq,{editor:t,disabled:e},"content"),(w=r==null?void 0:r.textConfig)!=null&&w.hidden?null:x.jsx(Aq,{editor:t,disabled:e},"text")]};return r!=null&&r.render?r.render({editor:t,disabled:e||!1,bubbleMenu:r},i()):i().filter(Boolean)}function oE(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:x.jsx("path",{fill:"currentColor",d:"M18 14c0-4-6-10.8-6-10.8s-1.33 1.51-2.73 3.52l8.59 8.59c.09-.42.14-.86.14-1.31m-.88 3.12L12.5 12.5L5.27 5.27L4 6.55l3.32 3.32C6.55 11.32 6 12.79 6 14c0 3.31 2.69 6 6 6c1.52 0 2.9-.57 3.96-1.5l2.63 2.63l1.27-1.27z"})})}function MM(t){const{t:e}=Ct(),{highlight:r=!1,disabled:n=!1,selectedColor:i,setSelectedColor:o,onChange:s,colors:a=GH}=t,l=J.useMemo(()=>{const m=a,g=[];for(let b=0;b<m.length;b+=10)g.push(m.slice(b,b+10));return g},[a]),[c,d]=J.useState([]),f=m=>{const g=[...c],b=g.indexOf(m);b!==-1&&g.splice(b,1),g.unshift(m),g.length>10&&g.pop(),d(g)};function p(m){if(m===void 0){o==null||o(m),s==null||s(m);return}/^#([\da-f]{3}){1,2}$/i.test(m)&&(o==null||o(m),s==null||s(m),f(m))}return x.jsxs(xi,{modal:!0,children:[x.jsx(Si,{className:"!richtext-p-0",disabled:n,asChild:!0,children:t==null?void 0:t.children}),x.jsx(Xn,{hideWhenDetached:!0,className:"richtext-w-full richtext-h-full richtext-p-2",align:"start",side:"bottom",children:x.jsxs("div",{className:"richtext-flex richtext-flex-col",children:[r?x.jsxs("div",{className:"richtext-flex richtext-items-center richtext-p-1 richtext-cursor-pointer rd-1 richtext-gap-[4px] hover:richtext-bg-accent",onClick:()=>p(void 0),children:[x.jsx(oE,{}),x.jsx("span",{className:"richtext-ml-1 richtext-text-sm",children:e("editor.nofill")})]}):x.jsxs("div",{className:"richtext-flex richtext-items-center richtext-p-1 richtext-cursor-pointer rd-1 richtext-gap-[4px] hover:richtext-bg-accent",onClick:()=>{p(void 0)},children:[x.jsx(oE,{}),x.jsx("span",{className:"richtext-ml-1 richtext-text-sm",children:e("editor.default")})]}),l.map((m,g)=>x.jsx("span",{className:"richtext-relative richtext-flex richtext-w-full richtext-h-auto richtext-p-0 last:richtext-pb-2",children:m.map((b,S)=>x.jsx("span",{className:"richtext-w-6 richtext-h-6 richtext-p-0.5 richtext-inline-block richtext-rounded-sm !richtext-border richtext-border-transparent richtext-flex-[0_0_auto] richtext-cursor-pointer hover:richtext-border-border hover:richtext-shadow-sm",onClick:()=>p(b),children:x.jsx("span",{style:{backgroundColor:b},className:"richtext-relative richtext-w-[18px] richtext-h-[18px] richtext-block richtext-rounded-[2px] richtext-border-transparent",children:b===i?x.jsx("svg",{className:"richtext-absolute richtext-block richtext-top-[-1px] richtext-left-[1px] richtext-w-3 richtext-h-3",viewBox:"0 0 18 18",style:{fill:"rgb(255, 255, 255)"},children:x.jsx("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})}):x.jsx("svg",{viewBox:"0 0 18 18",style:{fill:"rgb(255, 255, 255)",display:"none"},children:x.jsx("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})})})},`sub-color-${S}`))},g)),x.jsxs("div",{children:[x.jsx("div",{className:"richtext-my-1 richtext-text-sm",children:e("editor.recent")}),x.jsx("span",{className:"richtext-relative richtext-flex richtext-w-full richtext-h-auto richtext-p-0 last:richtext-pb-2",children:c==null?void 0:c.map((m,g)=>x.jsx("span",{className:"richtext-w-6 richtext-h-6 richtext-p-0.5 richtext-inline-block richtext-rounded-sm !richtext-border richtext-border-transparent richtext-flex-[0_0_auto] richtext-cursor-pointer hover:richtext-border-border hover:richtext-shadow-sm",onClick:()=>p(m),children:x.jsx("span",{className:"richtext-relative richtext-w-[18px] richtext-h-[18px] richtext-block richtext-rounded-[2px] richtext-border-transparent",style:{backgroundColor:m},children:x.jsx("svg",{viewBox:"0 0 18 18",style:{fill:"rgb(255, 255, 255)",display:"none"},children:x.jsx("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})})})},`sub-color-recent-${g}`))})]}),x.jsx(e9,{setColor:p})]})})]})}function e9({setColor:t}){const[e,r]=J.useState("#000000"),[n,i]=J.useState(!1),{t:o}=Ct();return J.useEffect(()=>()=>{i(!1)},[]),x.jsxs(xi,{open:n,children:[x.jsx(Si,{asChild:!0,children:x.jsxs("div",{onClick:s=>{s.preventDefault(),i(!0)},className:"richtext-text-sm hover:richtext-cursor-pointer hover:richtext-bg-accent richtext-py-1.5 richtext-px-1.5",children:[o("editor.color.more"),"..."]})}),x.jsxs(Xn,{children:[x.jsxs("div",{className:"richtext-flex richtext-flex-col richtext-items-center richtext-justify-center",children:[x.jsx(k2.HexColorPicker,{color:e,onChange:r}),x.jsx(hn,{className:"richtext-mt-[8px] richtext-w-full",type:"text",onChange:s=>{s.preventDefault(),r(`#${s.target.value}`)},value:e.slice(1)})]}),x.jsx(Bi,{className:"richtext-my-[10px]"}),x.jsx(Mt,{onClick:s=>{s.preventDefault(),t(e),i(!1)},className:"richtext-w-full",children:x.jsx(He.Plus,{size:16})})]})]})}var NM=typeof global=="object"&&global&&global.Object===Object&&global,t9=typeof self=="object"&&self&&self.Object===Object&&self,To=NM||t9||Function("return this")(),xo=To.Symbol,DM=Object.prototype,r9=DM.hasOwnProperty,n9=DM.toString,Mf=xo?xo.toStringTag:void 0;function i9(t){var e=r9.call(t,Mf),r=t[Mf];try{t[Mf]=void 0;var n=!0}catch{}var i=n9.call(t);return n&&(e?t[Mf]=r:delete t[Mf]),i}var o9=Object.prototype,s9=o9.toString;function a9(t){return s9.call(t)}var l9="[object Null]",c9="[object Undefined]",sE=xo?xo.toStringTag:void 0;function Pa(t){return t==null?t===void 0?c9:l9:sE&&sE in Object(t)?i9(t):a9(t)}function fs(t){return t!=null&&typeof t=="object"}var u9="[object Symbol]";function Vy(t){return typeof t=="symbol"||fs(t)&&Pa(t)==u9}function PM(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}var So=Array.isArray,d9=1/0,aE=xo?xo.prototype:void 0,lE=aE?aE.toString:void 0;function Rg(t){if(typeof t=="string")return t;if(So(t))return PM(t,Rg)+"";if(Vy(t))return lE?lE.call(t):"";var e=t+"";return e=="0"&&1/t==-d9?"-0":e}var f9=/\s/;function h9(t){for(var e=t.length;e--&&f9.test(t.charAt(e)););return e}var p9=/^\s+/;function m9(t){return t&&t.slice(0,h9(t)+1).replace(p9,"")}function Sa(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var cE=NaN,g9=/^[-+]0x[0-9a-f]+$/i,y9=/^0b[01]+$/i,v9=/^0o[0-7]+$/i,b9=parseInt;function zu(t){if(typeof t=="number")return t;if(Vy(t))return cE;if(Sa(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Sa(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=m9(t);var r=y9.test(t);return r||v9.test(t)?b9(t.slice(2),r?2:8):g9.test(t)?cE:+t}var uE=1/0,w9=17976931348623157e292;function x9(t){if(!t)return t===0?t:0;if(t=zu(t),t===uE||t===-uE){var e=t<0?-1:1;return e*w9}return t===t?t:0}function S9(t){var e=x9(t),r=e%1;return e===e?r?e-r:e:0}function pS(t){return t}var k9="[object AsyncFunction]",_9="[object Function]",C9="[object GeneratorFunction]",E9="[object Proxy]";function LM(t){if(!Sa(t))return!1;var e=Pa(t);return e==_9||e==C9||e==k9||e==E9}var tw=To["__core-js_shared__"],dE=function(){var t=/[^.]+$/.exec(tw&&tw.keys&&tw.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function T9(t){return!!dE&&dE in t}var A9=Function.prototype,R9=A9.toString;function uc(t){if(t!=null){try{return R9.call(t)}catch{}try{return t+""}catch{}}return""}var I9=/[\\^$.*+?()[\]{}|]/g,O9=/^\[object .+?Constructor\]$/,M9=Function.prototype,N9=Object.prototype,D9=M9.toString,P9=N9.hasOwnProperty,L9=RegExp("^"+D9.call(P9).replace(I9,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function F9(t){if(!Sa(t)||T9(t))return!1;var e=LM(t)?L9:O9;return e.test(uc(t))}function j9(t,e){return t==null?void 0:t[e]}function dc(t,e){var r=j9(t,e);return F9(r)?r:void 0}var _x=dc(To,"WeakMap");function B9(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}var z9=800,H9=16,$9=Date.now;function U9(t){var e=0,r=0;return function(){var n=$9(),i=H9-(n-r);if(r=n,i>0){if(++e>=z9)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function W9(t){return function(){return t}}var fE=function(){try{var t=dc(Object,"defineProperty");return t({},"",{}),t}catch{}}(),V9=fE?function(t,e){return fE(t,"toString",{configurable:!0,enumerable:!1,value:W9(e),writable:!0})}:pS,G9=U9(V9);function K9(t,e,r,n){for(var i=t.length,o=r+-1;++o<i;)if(e(t[o],o,t))return o;return-1}function q9(t){return t!==t}function X9(t,e,r){for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}function Y9(t,e,r){return e===e?X9(t,e,r):K9(t,q9,r)}function J9(t,e){var r=t==null?0:t.length;return!!r&&Y9(t,e,0)>-1}var Z9=9007199254740991,Q9=/^(?:0|[1-9]\d*)$/;function FM(t,e){var r=typeof t;return e=e??Z9,!!e&&(r=="number"||r!="symbol"&&Q9.test(t))&&t>-1&&t%1==0&&t<e}function jM(t,e){return t===e||t!==t&&e!==e}var hE=Math.max;function e$(t,e,r){return e=hE(e===void 0?t.length-1:e,0),function(){for(var n=arguments,i=-1,o=hE(n.length-e,0),s=Array(o);++i<o;)s[i]=n[e+i];i=-1;for(var a=Array(e+1);++i<e;)a[i]=n[i];return a[e]=r(s),B9(t,this,a)}}function t$(t,e){return G9(e$(t,e,pS),t+"")}var r$=9007199254740991;function mS(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=r$}function BM(t){return t!=null&&mS(t.length)&&!LM(t)}var n$=Object.prototype;function i$(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||n$;return t===r}function o$(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var s$="[object Arguments]";function pE(t){return fs(t)&&Pa(t)==s$}var zM=Object.prototype,a$=zM.hasOwnProperty,l$=zM.propertyIsEnumerable,gS=pE(function(){return arguments}())?pE:function(t){return fs(t)&&a$.call(t,"callee")&&!l$.call(t,"callee")};function c$(){return!1}var HM=typeof exports=="object"&&exports&&!exports.nodeType&&exports,mE=HM&&typeof module=="object"&&module&&!module.nodeType&&module,u$=mE&&mE.exports===HM,gE=u$?To.Buffer:void 0,d$=gE?gE.isBuffer:void 0,Cx=d$||c$,f$="[object Arguments]",h$="[object Array]",p$="[object Boolean]",m$="[object Date]",g$="[object Error]",y$="[object Function]",v$="[object Map]",b$="[object Number]",w$="[object Object]",x$="[object RegExp]",S$="[object Set]",k$="[object String]",_$="[object WeakMap]",C$="[object ArrayBuffer]",E$="[object DataView]",T$="[object Float32Array]",A$="[object Float64Array]",R$="[object Int8Array]",I$="[object Int16Array]",O$="[object Int32Array]",M$="[object Uint8Array]",N$="[object Uint8ClampedArray]",D$="[object Uint16Array]",P$="[object Uint32Array]",qt={};qt[T$]=qt[A$]=qt[R$]=qt[I$]=qt[O$]=qt[M$]=qt[N$]=qt[D$]=qt[P$]=!0;qt[f$]=qt[h$]=qt[C$]=qt[p$]=qt[E$]=qt[m$]=qt[g$]=qt[y$]=qt[v$]=qt[b$]=qt[w$]=qt[x$]=qt[S$]=qt[k$]=qt[_$]=!1;function L$(t){return fs(t)&&mS(t.length)&&!!qt[Pa(t)]}function yS(t){return function(e){return t(e)}}var $M=typeof exports=="object"&&exports&&!exports.nodeType&&exports,nh=$M&&typeof module=="object"&&module&&!module.nodeType&&module,F$=nh&&nh.exports===$M,rw=F$&&NM.process,Ig=function(){try{var t=nh&&nh.require&&nh.require("util").types;return t||rw&&rw.binding&&rw.binding("util")}catch{}}(),yE=Ig&&Ig.isTypedArray,UM=yE?yS(yE):L$,j$=Object.prototype,B$=j$.hasOwnProperty;function z$(t,e){var r=So(t),n=!r&&gS(t),i=!r&&!n&&Cx(t),o=!r&&!n&&!i&&UM(t),s=r||n||i||o,a=s?o$(t.length,String):[],l=a.length;for(var c in t)B$.call(t,c)&&!(s&&(c=="length"||i&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||FM(c,l)))&&a.push(c);return a}function H$(t,e){return function(r){return t(e(r))}}var $$=H$(Object.keys,Object),U$=Object.prototype,W$=U$.hasOwnProperty;function V$(t){if(!i$(t))return $$(t);var e=[];for(var r in Object(t))W$.call(t,r)&&r!="constructor"&&e.push(r);return e}function WM(t){return BM(t)?z$(t):V$(t)}var G$=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,K$=/^\w*$/;function vS(t,e){if(So(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||Vy(t)?!0:K$.test(t)||!G$.test(t)||e!=null&&t in Object(e)}var Sh=dc(Object,"create");function q$(){this.__data__=Sh?Sh(null):{},this.size=0}function X$(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Y$="__lodash_hash_undefined__",J$=Object.prototype,Z$=J$.hasOwnProperty;function Q$(t){var e=this.__data__;if(Sh){var r=e[t];return r===Y$?void 0:r}return Z$.call(e,t)?e[t]:void 0}var eU=Object.prototype,tU=eU.hasOwnProperty;function rU(t){var e=this.__data__;return Sh?e[t]!==void 0:tU.call(e,t)}var nU="__lodash_hash_undefined__";function iU(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Sh&&e===void 0?nU:e,this}function Xl(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Xl.prototype.clear=q$;Xl.prototype.delete=X$;Xl.prototype.get=Q$;Xl.prototype.has=rU;Xl.prototype.set=iU;function oU(){this.__data__=[],this.size=0}function Gy(t,e){for(var r=t.length;r--;)if(jM(t[r][0],e))return r;return-1}var sU=Array.prototype,aU=sU.splice;function lU(t){var e=this.__data__,r=Gy(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():aU.call(e,r,1),--this.size,!0}function cU(t){var e=this.__data__,r=Gy(e,t);return r<0?void 0:e[r][1]}function uU(t){return Gy(this.__data__,t)>-1}function dU(t,e){var r=this.__data__,n=Gy(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function gs(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}gs.prototype.clear=oU;gs.prototype.delete=lU;gs.prototype.get=cU;gs.prototype.has=uU;gs.prototype.set=dU;var kh=dc(To,"Map");function fU(){this.size=0,this.__data__={hash:new Xl,map:new(kh||gs),string:new Xl}}function hU(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Ky(t,e){var r=t.__data__;return hU(e)?r[typeof e=="string"?"string":"hash"]:r.map}function pU(t){var e=Ky(this,t).delete(t);return this.size-=e?1:0,e}function mU(t){return Ky(this,t).get(t)}function gU(t){return Ky(this,t).has(t)}function yU(t,e){var r=Ky(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function ys(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}ys.prototype.clear=fU;ys.prototype.delete=pU;ys.prototype.get=mU;ys.prototype.has=gU;ys.prototype.set=yU;var vU="Expected a function";function bS(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(vU);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=t.apply(this,n);return r.cache=o.set(i,s)||o,s};return r.cache=new(bS.Cache||ys),r}bS.Cache=ys;var bU=500;function wU(t){var e=bS(t,function(n){return r.size===bU&&r.clear(),n}),r=e.cache;return e}var xU=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,SU=/\\(\\)?/g,kU=wU(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(xU,function(r,n,i,o){e.push(i?o.replace(SU,"$1"):n||r)}),e});function Ex(t){return t==null?"":Rg(t)}function VM(t,e){return So(t)?t:vS(t,e)?[t]:kU(Ex(t))}var _U=1/0;function qy(t){if(typeof t=="string"||Vy(t))return t;var e=t+"";return e=="0"&&1/t==-_U?"-0":e}function GM(t,e){e=VM(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[qy(e[r++])];return r&&r==n?t:void 0}function CU(t,e,r){var n=t==null?void 0:GM(t,e);return n===void 0?r:n}function KM(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}var vE=xo?xo.isConcatSpreadable:void 0;function EU(t){return So(t)||gS(t)||!!(vE&&t&&t[vE])}function TU(t,e,r,n,i){var o=-1,s=t.length;for(r||(r=EU),i||(i=[]);++o<s;){var a=t[o];r(a)&&KM(i,a)}return i}function AU(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),r=r>i?i:r,r<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var o=Array(i);++n<i;)o[n]=t[n+e];return o}function RU(t,e,r){var n=t.length;return r=r===void 0?n:r,!e&&r>=n?t:AU(t,e,r)}var IU="\\ud800-\\udfff",OU="\\u0300-\\u036f",MU="\\ufe20-\\ufe2f",NU="\\u20d0-\\u20ff",DU=OU+MU+NU,PU="\\ufe0e\\ufe0f",LU="\\u200d",FU=RegExp("["+LU+IU+DU+PU+"]");function wS(t){return FU.test(t)}function jU(t){return t.split("")}var qM="\\ud800-\\udfff",BU="\\u0300-\\u036f",zU="\\ufe20-\\ufe2f",HU="\\u20d0-\\u20ff",$U=BU+zU+HU,UU="\\ufe0e\\ufe0f",WU="["+qM+"]",Tx="["+$U+"]",Ax="\\ud83c[\\udffb-\\udfff]",VU="(?:"+Tx+"|"+Ax+")",XM="[^"+qM+"]",YM="(?:\\ud83c[\\udde6-\\uddff]){2}",JM="[\\ud800-\\udbff][\\udc00-\\udfff]",GU="\\u200d",ZM=VU+"?",QM="["+UU+"]?",KU="(?:"+GU+"(?:"+[XM,YM,JM].join("|")+")"+QM+ZM+")*",qU=QM+ZM+KU,XU="(?:"+[XM+Tx+"?",Tx,YM,JM,WU].join("|")+")",YU=RegExp(Ax+"(?="+Ax+")|"+XU+qU,"g");function JU(t){return t.match(YU)||[]}function ZU(t){return wS(t)?JU(t):jU(t)}function QU(t,e,r){return t===t&&(r!==void 0&&(t=t<=r?t:r),e!==void 0&&(t=t>=e?t:e)),t}function eN(t,e,r){return r===void 0&&(r=e,e=void 0),r!==void 0&&(r=zu(r),r=r===r?r:0),e!==void 0&&(e=zu(e),e=e===e?e:0),QU(zu(t),e,r)}function eW(){this.__data__=new gs,this.size=0}function tW(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function rW(t){return this.__data__.get(t)}function nW(t){return this.__data__.has(t)}var iW=200;function oW(t,e){var r=this.__data__;if(r instanceof gs){var n=r.__data__;if(!kh||n.length<iW-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new ys(n)}return r.set(t,e),this.size=r.size,this}function us(t){var e=this.__data__=new gs(t);this.size=e.size}us.prototype.clear=eW;us.prototype.delete=tW;us.prototype.get=rW;us.prototype.has=nW;us.prototype.set=oW;function sW(t,e){for(var r=-1,n=t==null?0:t.length,i=0,o=[];++r<n;){var s=t[r];e(s,r,t)&&(o[i++]=s)}return o}function aW(){return[]}var lW=Object.prototype,cW=lW.propertyIsEnumerable,bE=Object.getOwnPropertySymbols,uW=bE?function(t){return t==null?[]:(t=Object(t),sW(bE(t),function(e){return cW.call(t,e)}))}:aW;function dW(t,e,r){var n=e(t);return So(t)?n:KM(n,r(t))}function wE(t){return dW(t,WM,uW)}var Rx=dc(To,"DataView"),Ix=dc(To,"Promise"),Ox=dc(To,"Set"),xE="[object Map]",fW="[object Object]",SE="[object Promise]",kE="[object Set]",_E="[object WeakMap]",CE="[object DataView]",hW=uc(Rx),pW=uc(kh),mW=uc(Ix),gW=uc(Ox),yW=uc(_x),ia=Pa;(Rx&&ia(new Rx(new ArrayBuffer(1)))!=CE||kh&&ia(new kh)!=xE||Ix&&ia(Ix.resolve())!=SE||Ox&&ia(new Ox)!=kE||_x&&ia(new _x)!=_E)&&(ia=function(t){var e=Pa(t),r=e==fW?t.constructor:void 0,n=r?uc(r):"";if(n)switch(n){case hW:return CE;case pW:return xE;case mW:return SE;case gW:return kE;case yW:return _E}return e});var EE=To.Uint8Array,vW="__lodash_hash_undefined__";function bW(t){return this.__data__.set(t,vW),this}function wW(t){return this.__data__.has(t)}function _h(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new ys;++e<r;)this.add(t[e])}_h.prototype.add=_h.prototype.push=bW;_h.prototype.has=wW;function xW(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function tN(t,e){return t.has(e)}var SW=1,kW=2;function rN(t,e,r,n,i,o){var s=r&SW,a=t.length,l=e.length;if(a!=l&&!(s&&l>a))return!1;var c=o.get(t),d=o.get(e);if(c&&d)return c==e&&d==t;var f=-1,p=!0,m=r&kW?new _h:void 0;for(o.set(t,e),o.set(e,t);++f<a;){var g=t[f],b=e[f];if(n)var S=s?n(b,g,f,e,t,o):n(g,b,f,t,e,o);if(S!==void 0){if(S)continue;p=!1;break}if(m){if(!xW(e,function(w,T){if(!tN(m,T)&&(g===w||i(g,w,r,n,o)))return m.push(T)})){p=!1;break}}else if(!(g===b||i(g,b,r,n,o))){p=!1;break}}return o.delete(t),o.delete(e),p}function _W(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}function CW(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var EW=1,TW=2,AW="[object Boolean]",RW="[object Date]",IW="[object Error]",OW="[object Map]",MW="[object Number]",NW="[object RegExp]",DW="[object Set]",PW="[object String]",LW="[object Symbol]",FW="[object ArrayBuffer]",jW="[object DataView]",TE=xo?xo.prototype:void 0,nw=TE?TE.valueOf:void 0;function BW(t,e,r,n,i,o,s){switch(r){case jW:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case FW:return!(t.byteLength!=e.byteLength||!o(new EE(t),new EE(e)));case AW:case RW:case MW:return jM(+t,+e);case IW:return t.name==e.name&&t.message==e.message;case NW:case PW:return t==e+"";case OW:var a=_W;case DW:var l=n&EW;if(a||(a=CW),t.size!=e.size&&!l)return!1;var c=s.get(t);if(c)return c==e;n|=TW,s.set(t,e);var d=rN(a(t),a(e),n,i,o,s);return s.delete(t),d;case LW:if(nw)return nw.call(t)==nw.call(e)}return!1}var zW=1,HW=Object.prototype,$W=HW.hasOwnProperty;function UW(t,e,r,n,i,o){var s=r&zW,a=wE(t),l=a.length,c=wE(e),d=c.length;if(l!=d&&!s)return!1;for(var f=l;f--;){var p=a[f];if(!(s?p in e:$W.call(e,p)))return!1}var m=o.get(t),g=o.get(e);if(m&&g)return m==e&&g==t;var b=!0;o.set(t,e),o.set(e,t);for(var S=s;++f<l;){p=a[f];var w=t[p],T=e[p];if(n)var M=s?n(T,w,p,e,t,o):n(w,T,p,t,e,o);if(!(M===void 0?w===T||i(w,T,r,n,o):M)){b=!1;break}S||(S=p=="constructor")}if(b&&!S){var j=t.constructor,$=e.constructor;j!=$&&"constructor"in t&&"constructor"in e&&!(typeof j=="function"&&j instanceof j&&typeof $=="function"&&$ instanceof $)&&(b=!1)}return o.delete(t),o.delete(e),b}var WW=1,AE="[object Arguments]",RE="[object Array]",Zp="[object Object]",VW=Object.prototype,IE=VW.hasOwnProperty;function GW(t,e,r,n,i,o){var s=So(t),a=So(e),l=s?RE:ia(t),c=a?RE:ia(e);l=l==AE?Zp:l,c=c==AE?Zp:c;var d=l==Zp,f=c==Zp,p=l==c;if(p&&Cx(t)){if(!Cx(e))return!1;s=!0,d=!1}if(p&&!d)return o||(o=new us),s||UM(t)?rN(t,e,r,n,i,o):BW(t,e,l,r,n,i,o);if(!(r&WW)){var m=d&&IE.call(t,"__wrapped__"),g=f&&IE.call(e,"__wrapped__");if(m||g){var b=m?t.value():t,S=g?e.value():e;return o||(o=new us),i(b,S,r,n,o)}}return p?(o||(o=new us),UW(t,e,r,n,i,o)):!1}function xS(t,e,r,n,i){return t===e?!0:t==null||e==null||!fs(t)&&!fs(e)?t!==t&&e!==e:GW(t,e,r,n,xS,i)}var KW=1,qW=2;function XW(t,e,r,n){var i=r.length,o=i;if(t==null)return!o;for(t=Object(t);i--;){var s=r[i];if(s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++i<o;){s=r[i];var a=s[0],l=t[a],c=s[1];if(s[2]){if(l===void 0&&!(a in t))return!1}else{var d=new us,f;if(!(f===void 0?xS(c,l,KW|qW,n,d):f))return!1}}return!0}function nN(t){return t===t&&!Sa(t)}function YW(t){for(var e=WM(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,nN(i)]}return e}function iN(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function JW(t){var e=YW(t);return e.length==1&&e[0][2]?iN(e[0][0],e[0][1]):function(r){return r===t||XW(r,t,e)}}function ZW(t,e){return t!=null&&e in Object(t)}function QW(t,e,r){e=VM(e,t);for(var n=-1,i=e.length,o=!1;++n<i;){var s=qy(e[n]);if(!(o=t!=null&&r(t,s)))break;t=t[s]}return o||++n!=i?o:(i=t==null?0:t.length,!!i&&mS(i)&&FM(s,i)&&(So(t)||gS(t)))}function eV(t,e){return t!=null&&QW(t,e,ZW)}var tV=1,rV=2;function nV(t,e){return vS(t)&&nN(e)?iN(qy(t),e):function(r){var n=CU(r,t);return n===void 0&&n===e?eV(r,t):xS(e,n,tV|rV)}}function oN(t){return function(e){return e==null?void 0:e[t]}}function iV(t){return function(e){return GM(e,t)}}function oV(t){return vS(t)?oN(qy(t)):iV(t)}function sV(t){return typeof t=="function"?t:t==null?pS:typeof t=="object"?So(t)?nV(t[0],t[1]):JW(t):oV(t)}var iw=function(){return To.Date.now()},aV="Expected a function",lV=Math.max,cV=Math.min;function Xy(t,e,r){var n,i,o,s,a,l,c=0,d=!1,f=!1,p=!0;if(typeof t!="function")throw new TypeError(aV);e=zu(e)||0,Sa(r)&&(d=!!r.leading,f="maxWait"in r,o=f?lV(zu(r.maxWait)||0,e):o,p="trailing"in r?!!r.trailing:p);function m(W){var Y=n,ee=i;return n=i=void 0,c=W,s=t.apply(ee,Y),s}function g(W){return c=W,a=setTimeout(w,e),d?m(W):s}function b(W){var Y=W-l,ee=W-c,P=e-Y;return f?cV(P,o-ee):P}function S(W){var Y=W-l,ee=W-c;return l===void 0||Y>=e||Y<0||f&&ee>=o}function w(){var W=iw();if(S(W))return T(W);a=setTimeout(w,b(W))}function T(W){return a=void 0,p&&n?m(W):(n=i=void 0,s)}function M(){a!==void 0&&clearTimeout(a),c=0,n=l=i=a=void 0}function j(){return a===void 0?s:T(iw())}function $(){var W=iw(),Y=S(W);if(n=arguments,i=this,l=W,Y){if(a===void 0)return g(l);if(f)return clearTimeout(a),a=setTimeout(w,e),m(l)}return a===void 0&&(a=setTimeout(w,e)),s}return $.cancel=M,$.flush=j,$}function ow(t){return fs(t)&&BM(t)}var uV=200;function dV(t,e,r,n){var i=-1,o=J9,s=!0,a=t.length,l=[],c=e.length;if(!a)return l;r&&(e=PM(e,yS(r))),e.length>=uV&&(o=tN,s=!1,e=new _h(e));e:for(;++i<a;){var d=t[i],f=r==null?d:r(d);if(d=d!==0?d:0,s&&f===f){for(var p=c;p--;)if(e[p]===f)continue e;l.push(d)}else o(e,f,n)||l.push(d)}return l}function fV(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var hV=t$(function(t,e){var r=fV(e);return ow(r)&&(r=void 0),ow(t)?dV(t,TU(e,1,ow),sV(r)):[]}),pV="[object Number]";function Og(t){return typeof t=="number"||fs(t)&&Pa(t)==pV}var mV="[object RegExp]";function gV(t){return fs(t)&&Pa(t)==mV}var OE=Ig&&Ig.isRegExp,yV=OE?yS(OE):gV,vV=oN("length"),sN="\\ud800-\\udfff",bV="\\u0300-\\u036f",wV="\\ufe20-\\ufe2f",xV="\\u20d0-\\u20ff",SV=bV+wV+xV,kV="\\ufe0e\\ufe0f",_V="["+sN+"]",Mx="["+SV+"]",Nx="\\ud83c[\\udffb-\\udfff]",CV="(?:"+Mx+"|"+Nx+")",aN="[^"+sN+"]",lN="(?:\\ud83c[\\udde6-\\uddff]){2}",cN="[\\ud800-\\udbff][\\udc00-\\udfff]",EV="\\u200d",uN=CV+"?",dN="["+kV+"]?",TV="(?:"+EV+"(?:"+[aN,lN,cN].join("|")+")"+dN+uN+")*",AV=dN+uN+TV,RV="(?:"+[aN+Mx+"?",Mx,lN,cN,_V].join("|")+")",ME=RegExp(Nx+"(?="+Nx+")|"+RV+AV,"g");function IV(t){for(var e=ME.lastIndex=0;ME.test(t);)++e;return e}function OV(t){return wS(t)?IV(t):vV(t)}var MV="Expected a function";function Yl(t,e,r){var n=!0,i=!0;if(typeof t!="function")throw new TypeError(MV);return Sa(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),Xy(t,e,{leading:n,maxWait:e,trailing:i})}var NV=30,DV="...",PV=/\w*$/;function LV(t,e){var r=NV,n=DV;if(Sa(e)){var i="separator"in e?e.separator:i;r="length"in e?S9(e.length):r,n="omission"in e?Rg(e.omission):n}t=Ex(t);var o=t.length;if(wS(t)){var s=ZU(t);o=s.length}if(r>=o)return t;var a=r-OV(n);if(a<1)return n;var l=s?RU(s,0,a).join(""):t.slice(0,a);if(i===void 0)return l+n;if(s&&(a+=l.length-a),yV(i)){if(t.slice(a).search(i)){var c,d=l;for(i.global||(i=RegExp(i.source,Ex(PV.exec(i))+"g")),i.lastIndex=0;c=i.exec(d);)var f=c.index;l=l.slice(0,f===void 0?a:f)}}else if(t.indexOf(Rg(i),a)!=a){var p=l.lastIndexOf(i);p>-1&&(l=l.slice(0,p))}return l+n}const FV=`
|
|
127
|
+
.reactjs-tiptap-editor, .richtext-dialog-content {
|
|
128
|
+
button,
|
|
129
|
+
input:where([type=button]),
|
|
130
|
+
input:where([type=reset]),
|
|
131
|
+
input:where([type=submit]) {
|
|
132
|
+
-webkit-appearance: button;
|
|
133
|
+
background-color: transparent;
|
|
134
|
+
background-image: none
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
input,
|
|
138
|
+
optgroup,
|
|
139
|
+
select,
|
|
140
|
+
textarea {
|
|
141
|
+
font-family: inherit;
|
|
142
|
+
font-feature-settings: inherit;
|
|
143
|
+
font-variation-settings: inherit;
|
|
144
|
+
font-size: 100%;
|
|
145
|
+
font-weight: inherit;
|
|
146
|
+
line-height: inherit;
|
|
147
|
+
letter-spacing: inherit;
|
|
148
|
+
color: inherit;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
button {
|
|
152
|
+
font-family: inherit;
|
|
153
|
+
font-feature-settings: inherit;
|
|
154
|
+
font-variation-settings: inherit;
|
|
155
|
+
font-size: 100%;
|
|
156
|
+
font-weight: inherit;
|
|
157
|
+
line-height: inherit;
|
|
158
|
+
letter-spacing: inherit;
|
|
159
|
+
color: inherit;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.reactjs-tiptap-editor,
|
|
164
|
+
.richtext-dialog-content,
|
|
165
|
+
div[data-radix-popper-content-wrapper],
|
|
166
|
+
div[data-tippy-root] {
|
|
167
|
+
*,
|
|
168
|
+
:before,
|
|
169
|
+
:after {
|
|
170
|
+
box-sizing: border-box;
|
|
171
|
+
border-width: 0;
|
|
172
|
+
border-style: solid;
|
|
173
|
+
border-color: hsl(var(--richtext-border));
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
background-color: hsl(var(--richtext-background));
|
|
177
|
+
color: hsl(var(--richtext-foreground));
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
html,
|
|
181
|
+
:host {
|
|
182
|
+
line-height: 1.5;
|
|
183
|
+
-webkit-text-size-adjust: 100%;
|
|
184
|
+
-moz-tab-size: 4;
|
|
185
|
+
tab-size: 4;
|
|
186
|
+
font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", Segoe UI Symbol, "Noto Color Emoji";
|
|
187
|
+
font-feature-settings: normal;
|
|
188
|
+
font-variation-settings: normal;
|
|
189
|
+
-webkit-tap-highlight-color: transparent
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
hr {
|
|
193
|
+
height: 0;
|
|
194
|
+
color: inherit;
|
|
195
|
+
border-top-width: 1px
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
a {
|
|
199
|
+
color: inherit;
|
|
200
|
+
text-decoration: inherit
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
b,
|
|
204
|
+
strong {
|
|
205
|
+
font-weight: bolder
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
code,
|
|
209
|
+
kbd,
|
|
210
|
+
samp,
|
|
211
|
+
pre {
|
|
212
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace;
|
|
213
|
+
font-feature-settings: normal;
|
|
214
|
+
font-variation-settings: normal;
|
|
215
|
+
font-size: 1em
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
table {
|
|
219
|
+
text-indent: 0;
|
|
220
|
+
border-color: inherit;
|
|
221
|
+
border-collapse: collapse
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
input, textarea {
|
|
225
|
+
border-width: 1px;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
textarea {
|
|
229
|
+
resize: vertical
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
input::placeholder,
|
|
233
|
+
textarea::placeholder {
|
|
234
|
+
opacity: 1;
|
|
235
|
+
color: #9ca3af
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
button, input, textarea {
|
|
239
|
+
cursor: pointer;
|
|
240
|
+
color: inherit;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
img,
|
|
244
|
+
svg,
|
|
245
|
+
video,
|
|
246
|
+
canvas,
|
|
247
|
+
audio,
|
|
248
|
+
iframe,
|
|
249
|
+
embed,
|
|
250
|
+
object {
|
|
251
|
+
display: block;
|
|
252
|
+
vertical-align: middle
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
img,
|
|
256
|
+
video {
|
|
257
|
+
max-width: 100%;
|
|
258
|
+
height: auto
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
`,fN=ko.createSignal("light");function jV(){return ko.useSignalValue(fN)}const BV={setTheme:t=>{fN.set(t)}},NE="data-rc-order",DE="data-rc-priority",zV="rc-util-key",Dx=new Map;function HV(t,e){if(!t)return!1;if(t.contains)return t.contains(e);let r=e;for(;r;){if(r===t)return!0;r=r.parentNode}return!1}function hN({mark:t}={}){return t?t.startsWith("data-")?t:`data-${t}`:zV}function SS(t){return t.attachTo?t.attachTo:document.querySelector("head")||document.body}function $V(t){return t==="queue"?"prependQueue":t?"prepend":"append"}function pN(t){return[...(Dx.get(t)||t).children].filter(e=>e.tagName==="STYLE")}function mN(t,e={}){const{csp:r,prepend:n,priority:i=0}=e,o=$V(n),s=o==="prependQueue",a=document.createElement("style");a.setAttribute(NE,o),s&&i&&a.setAttribute(DE,`${i}`),r!=null&&r.nonce&&(a.nonce=r==null?void 0:r.nonce),a.innerHTML=t;const l=SS(e),{firstChild:c}=l;if(n){if(s){const d=pN(l).filter(f=>{if(!["prepend","prependQueue"].includes(f.getAttribute(NE)))return!1;const p=Number(f.getAttribute(DE)||0);return i>=p});if(d.length>0)return l.insertBefore(a,d.at(-1).nextSibling),a}c.before(a)}else l.append(a);return a}function gN(t,e={}){const r=SS(e);return pN(r).find(n=>n.getAttribute(hN(e))===t)}function UV(t,e={}){const r=gN(t,e);r&&r.remove()}function WV(t,e){const r=Dx.get(t);if(!r||!HV(document,r)){const n=mN("",e),{parentNode:i}=n;Dx.set(t,i),n.remove()}}function VV(t,e,r={}){var s,a,l;const n=SS(r);WV(n,r);const i=gN(e,r);if(i)return(s=r.csp)!=null&&s.nonce&&i.nonce!==((a=r.csp)==null?void 0:a.nonce)&&(i.nonce=(l=r.csp)==null?void 0:l.nonce),i.innerHTML!==t&&(i.innerHTML=t),i;const o=mN(t,r);return o.setAttribute(hN(r),e),o}function GV({editor:t,extensions:e}){const{t:r}=Ct(),n=J.useMemo(()=>{var i,o,s;return(s=(o=(i=e==null?void 0:e.find(a=>a.name==="base-kit"))==null?void 0:i.options)==null?void 0:o.characterCount)==null?void 0:s.limit},[e]);return n?x.jsx("div",{className:"richtext-flex richtext-items-center richtext-justify-between richtext-p-3 richtext-border-t",children:x.jsx("div",{className:"richtext-flex richtext-flex-col",children:x.jsx("div",{className:"richtext-flex richtext-justify-end richtext-gap-3 richtext-text-sm",children:x.jsxs("span",{children:[t.storage.characterCount.characters(),"/",n," ",r("editor.characters")]})})})}):x.jsx("div",{className:"richtext-flex richtext-items-center richtext-justify-between richtext-p-3 richtext-border-t",children:x.jsx("div",{className:"richtext-flex richtext-flex-col",children:x.jsx("div",{className:"richtext-flex richtext-justify-end richtext-gap-3 richtext-text-sm",children:x.jsxs("span",{children:[t.storage.characterCount.characters()," ",r("editor.characters")]})})})})}function KV(t,e){const{content:r,extensions:n,useEditorOptions:i={}}=t,o=J.useMemo(()=>{const d=hV(n,n,"name");return[...n.map(p=>{const m=n.find(g=>g.name===p.name);return m?p.configure(m.options):p}),...d].map((p,m)=>p.configure({sort:m}))},[n]),s=Yl(d=>{var p;const f=l(d,t.output);(p=t==null?void 0:t.onChangeContent)==null||p.call(t,f)},VH),a=IF({extensions:o,content:r,onUpdate:({editor:d})=>{s&&s(d)},...i});J.useImperativeHandle(e,()=>({editor:a})),J.useEffect(()=>{document.documentElement.classList.toggle("dark",t.dark),BV.setTheme(t.dark?"dark":"light")},[t.dark]),J.useEffect(()=>{a==null||a.setEditable(!(t!=null&&t.disabled)),O7.setDisable(!(t!=null&&t.disabled))},[a,t==null?void 0:t.disabled]),J.useEffect(()=>((t==null?void 0:t.resetCSS)!==!1&&VV(FV,"react-tiptap-reset"),()=>{UV("react-tiptap-reset")}),[t==null?void 0:t.resetCSS]);function l(d,f){return t!=null&&t.removeDefaultWrapper?f==="html"?d.isEmpty?"":d.getHTML():f==="json"?d.isEmpty?{}:d.getJSON():f==="text"?d.isEmpty?"":d.getText():"":f==="html"?d.getHTML():f==="json"?d.getJSON():f==="text"?d.getText():""}J.useEffect(()=>()=>{var d;(d=a==null?void 0:a.destroy)==null||d.call(a)},[]);const c=kM(a,"characterCount");return a?x.jsx("div",{className:"reactjs-tiptap-editor",children:x.jsx(MH,{delayDuration:0,disableHoverableContent:!0,children:x.jsx("div",{className:"richtext-rounded-[0.5rem] richtext-bg-background richtext-shadow richtext-overflow-hidden richtext-outline richtext-outline-1",children:x.jsxs("div",{className:"richtext-flex richtext-flex-col richtext-w-full richtext-max-h-full",children:[!(t!=null&&t.hideToolbar)&&x.jsx(XV,{editor:a,disabled:!!(t!=null&&t.disabled)}),x.jsx(bF,{className:`richtext-relative ${(t==null?void 0:t.contentClass)||""}`,editor:a}),c&&x.jsx(GV,{editor:a,extensions:n}),!(t!=null&&t.hideBubble)&&x.jsx(Q7,{bubbleMenu:t==null?void 0:t.bubbleMenu,editor:a,disabled:t==null?void 0:t.disabled})]})})})}):x.jsx(x.Fragment,{})}const qV=J.forwardRef(KV);function XV({editor:t,disabled:e}){const{t:r,lang:n}=Ct(),i=J.useMemo(()=>{const s=[...t.extensionManager.extensions].sort((l,c)=>{const d=l.options.sort??-1,f=c.options.sort??-1;return d-f});let a=[];for(const l of s){const{button:c,divider:d=!1,spacer:f=!1,toolbar:p=!0}=l.options;if(!c||!u7(c)||!p)continue;const m=c({editor:t,extension:l,t:r});if(Array.isArray(m)){const g=m.map((b,S)=>({button:b,divider:S===m.length-1?d:!1,spacer:S===0?f:!1}));a=[...a,...g];continue}a.push({button:m,divider:d,spacer:f})}return a},[t,r,n]);return x.jsx("div",{className:"richtext-px-1 richtext-py-2 !richtext-border-b",style:{pointerEvents:e?"none":"auto",opacity:e?.5:1},children:x.jsx("div",{className:"richtext-relative richtext-flex richtext-flex-wrap richtext-h-auto richtext-gap-y-1 richtext-gap-x-1",children:i.map((o,s)=>{var l,c;const a=o.button.component;return x.jsxs("div",{className:"richtext-flex richtext-items-center",children:[(o==null?void 0:o.spacer)&&x.jsx(Bi,{orientation:"vertical",className:"!richtext-h-[16px] !richtext-mx-[10px]"}),x.jsx(a,{...o.button.componentProps,disabled:e||((c=(l=o==null?void 0:o.button)==null?void 0:l.componentProps)==null?void 0:c.disabled)}),(o==null?void 0:o.divider)&&x.jsx(Bi,{orientation:"vertical",className:"!richtext-h-auto !richtext-mx-2"})]},`toolbar-item-${s}`)})})})}function YV(t){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...t,children:x.jsx("path",{fill:"currentColor",d:"M19 12h-2v3h-3v2h5zM7 9h3V7H5v5h2zm14-6H3a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2m0 16H3V5h18z"})})}function JV(t){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...t,children:x.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 15h15m0 4H6m9-8h6m0-4h-6M9 9h1a1 1 0 1 1-1 1V7.5a2 2 0 0 1 2-2M3 9h1a1 1 0 1 1-1 1V7.5a2 2 0 0 1 2-2"})})}function ZV(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",className:"richtext-w-4 richtext-h-4",width:"1em",height:"1em",viewBox:"0 0 24 24",children:x.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M5.5 3c1.404 0 2.107 0 2.611.38c.219.164.406.375.552.62C9 4.568 9 5.358 9 6.938v10.125c0 1.58 0 2.37-.337 2.937a2.1 2.1 0 0 1-.552.621c-.504.38-1.207.38-2.611.38s-2.107 0-2.611-.38a2.1 2.1 0 0 1-.552-.62C2 19.432 2 18.642 2 17.062V6.938c0-1.58 0-2.37.337-2.938a2.1 2.1 0 0 1 .552-.62C3.393 3 4.096 3 5.5 3M20 11.938v5.124c0 1.58 0 2.37-.337 2.938a2.1 2.1 0 0 1-.552.62c-.504.38-1.207.38-2.611.38s-2.107 0-2.611-.38a2.1 2.1 0 0 1-.552-.62C13 19.433 13 18.642 13 17.063V6.938c0-1.58 0-2.37.337-2.938M22 9l-6-6m6 0l-6 6",color:"currentColor"})})}function QV(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",className:"richtext-w-4 richtext-h-4",width:"1em",height:"1em",viewBox:"0 0 24 24",children:x.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M21 18.5c0 1.404 0 2.107-.38 2.611a2.1 2.1 0 0 1-.62.552c-.567.337-1.358.337-2.937.337H6.938c-1.58 0-2.37 0-2.938-.337a2.1 2.1 0 0 1-.62-.552C3 20.607 3 19.904 3 18.5s0-2.107.38-2.611c.163-.218.374-.406.62-.552C4.567 15 5.357 15 6.938 15h10.125c1.58 0 2.37 0 2.937.337c.246.146.457.334.62.552c.38.504.38 1.207.38 2.611M12.063 4H6.937C5.358 4 4.568 4 4 4.337a2.1 2.1 0 0 0-.62.552C3 5.393 3 6.096 3 7.5s0 2.107.38 2.611c.163.218.374.406.62.552C4.567 11 5.357 11 6.938 11h10.125c1.58 0 2.37 0 2.937-.337M21 8l-6-6m6 0l-6 6",color:"currentColor"})})}function eG(t){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...t,children:x.jsx("path",{fill:"currentColor",d:"M14 2H6a2 2 0 0 0-2 2v16c0 1.11.89 2 2 2h12c1.11 0 2-.89 2-2V8zm4 18H6V4h7v5h5zm-.65-10l-2.1 9h-1.4l-1.8-6.79l-1.8 6.79h-1.4l-2.2-9h1.5l1.4 6.81l1.8-6.81h1.3l1.8 6.81l1.4-6.81z"})})}function Rt(t){const e=Kh[t.name];return e?x.jsx(e,{onClick:t==null?void 0:t.onClick,className:`richtext-w-4 richtext-h-4 ${(t==null?void 0:t.className)||""}`}):null}function tG(t){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...t,children:x.jsx("path",{fill:"currentColor",d:"M21 22H3v-2h18zm0-18H3V2h18zm-11 9.7h4l-2-5.4zM11.2 6h1.7l4.7 12h-2l-.9-2.6H9.4L8.5 18h-2z"})})}function yN(t){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 48 48",...t,children:x.jsx("path",{fill:"currentColor",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:4,d:"M36 19L24 31L12 19z"})})}function rG(t){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...t,children:x.jsx("path",{fill:"currentColor",d:"M9 7v10h6v-2h-4V7z"})})}function nG(t){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...t,children:x.jsx("path",{fill:"currentColor",d:"M9 7c-1.1 0-2 .9-2 2v8h2V9h2v7h2V9h2v8h2V9a2 2 0 0 0-2-2z"})})}function iG(t){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...t,children:x.jsx("path",{fill:"currentColor",d:"M11 7c-1.1 0-2 .9-2 2v2a2 2 0 0 0 2 2h2v2H9v2h4c1.11 0 2-.89 2-2v-2a2 2 0 0 0-2-2h-2V9h4V7z"})})}function oG(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",children:x.jsx("path",{fill:"currentColor",d:"M14 2H6a2 2 0 0 0-2 2v16c0 1.11.89 2 2 2h12c1.11 0 2-.89 2-2V8zm4 18H6V4h7v5h5zm-.65-10l-2.1 9h-1.4l-1.8-6.79l-1.8 6.79h-1.4l-2.2-9h1.5l1.4 6.81l1.8-6.81h1.3l1.8 6.81l1.4-6.81z"})})}function vN(){return x.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 32 32",children:[x.jsx("path",{fill:"currentColor",d:"M30 18v-2h-6v10h2v-4h3v-2h-3v-2zm-11 8h-4V16h4a3.003 3.003 0 0 1 3 3v4a3.003 3.003 0 0 1-3 3m-2-2h2a1 1 0 0 0 1-1v-4a1 1 0 0 0-1-1h-2zm-6-8H6v10h2v-3h3a2.003 2.003 0 0 0 2-2v-3a2 2 0 0 0-2-2m-3 5v-3h3l.001 3z"}),x.jsx("path",{fill:"currentColor",d:"M22 14v-4a.91.91 0 0 0-.3-.7l-7-7A.9.9 0 0 0 14 2H4a2.006 2.006 0 0 0-2 2v24a2 2 0 0 0 2 2h16v-2H4V4h8v6a2.006 2.006 0 0 0 2 2h6v2Zm-8-4V4.4l5.6 5.6Z"})]})}function bN(){return x.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",className:"icon",viewBox:"0 0 1024 1024",children:[x.jsx("path",{fill:"currentColor",d:"M679.253 402.364 618.77 561.015l-60.348-158.651a30.04 30.04 0 0 0-30.447-18.637 29.76 29.76 0 0 0-30.447 18.637l-60.416 158.651-60.416-158.651a30.515 30.515 0 0 0-38.843-17.272 28.945 28.945 0 0 0-17.954 37.547l88.815 233.267c4.369 11.469 15.7 19.115 28.398 19.115a30.31 30.31 0 0 0 28.468-19.115l62.395-163.908 62.396 163.84c4.437 11.605 15.701 19.183 28.4 19.183a30.31 30.31 0 0 0 28.466-19.115l88.747-233.267a28.945 28.945 0 0 0-17.886-37.547 30.447 30.447 0 0 0-38.912 17.272zm219.478 395.605-51.883-29.218c-28.672-16.18-52.224-3.072-52.224 29.082v.273H643.209a29.833 29.833 0 0 0-30.31 29.354c0 16.18 13.584 29.218 30.31 29.218h151.825c1.092 30.516 24.03 43.077 52.224 27.648l51.063-27.989c29.013-15.906 29.15-42.189.41-58.368"}),x.jsx("path",{fill:"currentColor",d:"m810.667 913.135-.478.068H201.796c-19.865 0-36.727-11.673-36.727-25.6v-618.36h154.965c51.268 0 92.911-39.39 92.911-87.858v-87.86H810.19c19.797 0 36.522 11.742 36.522 25.669V739.26h61.987V119.262c0-46.421-44.169-84.241-98.51-84.241H328.364l-225.28 194.56v658.09c0 46.285 44.236 84.105 98.713 84.105H810.19c43.759 0 80.554-24.713 93.32-58.573h-92.842zM350.89 94.89v86.562c0 16.11-13.858 29.286-30.925 29.286H216.815L350.959 94.891z"})]})}function sG(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:x.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M14 4h4a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1m-9 8h4m-2-2v4"})})}function aG(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:x.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 4h4a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1m9 8h4m-2-2v4"})})}function lG(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:x.jsx("path",{fill:"currentColor",d:"M23.943 19.806a.2.2 0 0 0-.168-.034c-1.26-1.855-2.873-3.61-4.419-5.315l-.252-.284c-.001-.073-.067-.12-.134-.15l-.084-.084c-.05-.1-.169-.167-.286-.1c-.47.234-.907.585-1.327.919c-.554.434-1.109.87-1.63 1.354a5 5 0 0 0-.588.618c-.084.117-.017.217.084.267c-.37.368-.74.736-1.109 1.12a.2.2 0 0 0-.05.134c0 .05.033.1.067.117l.655.502v.016c.924.92 2.554 2.173 4.285 3.527c.251.201.52.402.773.602c.117.134.234.285.335.418c.05.066.169.084.236.033c.033.034.084.067.118.1a.24.24 0 0 0 .1.034a.15.15 0 0 0 .135-.066a.24.24 0 0 0 .033-.1c.017 0 .017.016.034.016a.2.2 0 0 0 .134-.05l3.058-3.327c.12-.116.014-.267 0-.267m-7.628-.134l-1.546-1.17l-.15-.1c-.035-.017-.068-.05-.102-.067l-.117-.1c.66-.66 1.33-1.308 2-1.956c-.488.484-1.463 1.906-1.261 2.373c.002 0 .018.042.067.084zm4.1 3.126l-1.277-.97a27 27 0 0 0-1.58-1.504c.69.518 1.277.97 1.361 1.053c.673.585.638.485 1.093.87l.554.4c-.074.103-.151.148-.151.151m.336.25l-.034-.016a1 1 0 0 0 .152-.117zM.588 3.476c.033.217.084.435.117.636c.201 1.103.403 2.106.772 2.858l.152.568c.05.217.134.485.219.552a67 67 0 0 0 3.578 2.942a.18.18 0 0 0 .219 0s0 .016.016.016a.15.15 0 0 0 .118.05a.2.2 0 0 0 .134-.05c1.798-1.989 3.142-3.627 4.1-4.998c.068-.066.084-.167.084-.25c.067-.067.118-.151.185-.201c.067-.067.067-.184 0-.235l-.017-.016c0-.033-.017-.084-.05-.1c-.42-.401-.722-.685-1.042-.986a94 94 0 0 1-2.352-2.273c-.017-.017-.034-.034-.067-.034c-.336-.117-1.025-.234-1.882-.385c-1.277-.216-3.008-.517-4.57-.986c0 0-.101 0-.118.017l-.05.05C.05.714.022.707 0 .718c.017.1.017.167.05.284c0 .033.068.301.068.334zm7.19 4.78l-.033.034a.036.036 0 0 1 .033-.034M6.553 2.238c.101.1.521.502.622.585c-.437-.2-1.529-.702-2.034-.869c.505.1 1.194.201 1.412.284M.79 1.403c.252.434.454 1.939.655 3.41c-.118-.469-.201-.936-.302-1.372C.992 2.673.84 1.988.638 1.386c.124 0 .152.021.152.017m-.286-.369c0-.016 0-.033-.017-.033c.085 0 .135.017.202.05c0 .006-.145-.017-.185-.017m23.17-.217c.017-.066-.336-.367-.219-.384c.253-.017.253-.401 0-.401c-.335.017-.688.1-1.008.15c-.587.117-1.192.234-1.78.367a80 80 0 0 0-3.949.937c-.403.117-.857.2-1.243.401c-.135.067-.118.2-.05.284c-.034.017-.051.017-.085.034c-.117.017-.218.034-.335.05c-.102.017-.152.1-.135.2c0 .017.017.05.017.067c-.706.936-1.496 1.923-2.353 2.976c-.84.969-1.73 1.989-2.62 3.042c-2.84 3.31-6.05 7.07-9.594 10.38a.16.16 0 0 0 0 .234c.016.016.033.033.05.033c-.05.05-.101.085-.152.134q-.05.05-.05.1a.4.4 0 0 0-.067.084c-.067.067-.067.184.017.234c.067.066.185.066.235-.017c.017-.017.017-.033.033-.033a.265.265 0 0 1 .37 0c.202.217.404.435.588.618l-.42-.35c-.067-.067-.184-.05-.234.016c-.068.066-.051.184.016.234l4.469 3.727c.034.034.067.034.118.034a.15.15 0 0 0 .117-.05l.101-.1c.017.016.05.016.067.016c.05 0 .084-.016.118-.05c6.049-6.05 10.922-10.614 16.5-14.693c.05-.033.067-.1.067-.15c.067 0 .118-.05.15-.117c1.026-3.125 1.228-5.9 1.295-7.27c0-.059.016-.038.016-.068c.017-.033.017-.05.017-.05a.98.98 0 0 0-.067-.619m-10.82 4.915c.268-.301.537-.619.806-.903c-1.73 2.273-4.603 5.767-8.67 9.929c2.773-3.059 5.562-6.218 7.864-9.026M5.14 23.466c-.016-.017-.016-.017 0-.017zm2.504-2.156c.135-.15.27-.284.42-.434c0 0 0 .016.017.016c-.224.198-.433.418-.437.418m.69-.668c.099-.1.14-.173.284-.318c.992-1.02 2.017-2.04 3.059-3.076l.016-.016c.252-.2.555-.418.824-.619a228 228 0 0 0-4.184 4.029M14.852 3.91c-.554.719-1.176 1.671-1.697 2.423c-1.646 2.374-6.94 8.174-7.057 8.274a1190 1190 0 0 1-4.839 4.597l-.1.1c-.085-.1-.085-.25.016-.334C8.652 11.966 13.19 6.133 15.021 3.576c-.05.116-.084.216-.168.334zm2.906 3.427c-.671-.386-.99-.987-.806-1.572l.05-.2a.8.8 0 0 1 .085-.167a1.9 1.9 0 0 1 .756-.703c.016 0 .033 0 .05-.016c-.017-.034-.017-.084-.017-.134c.017-.1.085-.167.202-.167c.202 0 .824.184 1.059.384c.067.05.134.117.202.184c.084.1.218.268.285.401c.034.017.067.184.118.268c.033.134.067.284.05.418c-.017.016 0 .116-.017.116a1.6 1.6 0 0 1-.218.619c-.03.03.006.012-.05.067a1.2 1.2 0 0 1-.32.334a1.49 1.49 0 0 1-1.26.234a2 2 0 0 0-.169-.066m4.37 1.403c0 .017-.017.05 0 .067c-.034 0-.05.017-.085.034a110 110 0 0 0-3.915 3.025c1.11-.986 2.218-1.989 3.378-2.975c.336-.301.571-.686.638-1.12l.168-1.003v-.033c.085-.201.404-.118.353.1c-.004-.001-.173.795-.537 1.905"})})}function cG(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:x.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 21v-4m0-4V9m0-4V3m-2 18h4M8 5v4h11l2-2l-2-2zm6 8v4H6l-2-2l2-2z"})})}function uG(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 20 20",children:x.jsx("path",{fill:"currentColor",d:"M6.5 3a.75.75 0 0 1 .697.471l3 7.5a.75.75 0 0 1-1.393.557L7.992 9.5H5.008l-.811 2.028a.75.75 0 0 1-1.393-.556l3-7.5A.75.75 0 0 1 6.5 3m0 2.77L5.608 8h1.784zm8.28-1.55a.75.75 0 1 0-1.06 1.06l.72.72h-3.69a.75.75 0 0 0 0 1.5h3.69l-.72.72a.75.75 0 0 0 1.06 1.06l2-2a.75.75 0 0 0 0-1.06zm0 7.5a.75.75 0 1 0-1.06 1.06l.72.72H3.75a.75.75 0 0 0 0 1.5h10.69l-.72.72a.75.75 0 1 0 1.06 1.06l2-2a.75.75 0 0 0 0-1.06z"})})}function dG(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 20 20",children:x.jsx("path",{fill:"currentColor",d:"M13.5 3a.75.75 0 0 0-.697.471l-3 7.5a.75.75 0 0 0 1.393.557l.812-2.028h2.984l.811 2.028a.75.75 0 0 0 1.393-.556l-3-7.5A.75.75 0 0 0 13.5 3m0 2.77L14.392 8h-1.784zM5.22 4.22a.75.75 0 0 1 1.06 1.06L5.56 6h3.69a.75.75 0 0 1 0 1.5H5.56l.72.72a.75.75 0 0 1-1.06 1.06l-2-2a.75.75 0 0 1 0-1.06zm0 7.5a.75.75 0 0 1 1.06 1.06l-.72.72h10.69a.75.75 0 0 1 0 1.5H5.56l.72.72a.75.75 0 1 1-1.06 1.06l-2-2a.75.75 0 0 1 0-1.06z"})})}function fG(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:x.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",color:"currentColor",children:[x.jsx("path",{d:"M14.86 22h-4.312c-3.291 0-4.937 0-6.08-.798a4.2 4.2 0 0 1-.863-.805c-.855-1.066-.855-2.6-.855-5.67v-2.545c0-2.963 0-4.445.473-5.628c.761-1.903 2.37-3.403 4.41-4.113C8.9 2 10.49 2 13.667 2c1.816 0 2.723 0 3.448.252c1.166.406 2.085 1.263 2.52 2.35c.27.676.27 1.523.27 3.216V10"}),x.jsx("path",{d:"M2.75 12c0-1.84 1.506-3.333 3.364-3.333c.672 0 1.464.116 2.117-.057a1.67 1.67 0 0 0 1.19-1.179c.174-.647.057-1.432.057-2.098C9.478 3.493 10.984 2 12.84 2m.002 16h2.523m-4.949-4.15c-.126-.8-.281-.801-1.61-.85h-1.01c-.557 0-1.009.448-1.009 1v3c0 .552.452 1 1.01 1h1.816c.39 0 .803-.313.803-.7v-1.1c0-.11-.113-.304-.224-.304H9.068M12.842 13h1.261m0 0h1.262m-1.262 0v4.875M21.251 13h-2.523c-.557 0-1.009.448-1.009 1v1.5m0 0V18m0-2.5h2.523"})]})})}function hG(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 48 48",children:x.jsxs("g",{fill:"none",stroke:"currentColor",strokeWidth:"4",children:[x.jsx("circle",{cx:"10",cy:"24",r:"4"}),x.jsx("circle",{cx:"38",cy:"10",r:"4"}),x.jsx("circle",{cx:"38",cy:"24",r:"4"}),x.jsx("circle",{cx:"38",cy:"38",r:"4"}),x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M34 38H22V10h12M14 24h20"})]})})}function pG(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:x.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"m3 21l7.548-7.548M21 3l-7.548 7.548m0 0L8 3H3l7.548 10.452m2.904-2.904L21 21h-5l-5.452-7.548",color:"currentColor"})})}const Kh={Bold:He.Bold,LoaderCircle:He.LoaderCircle,Italic:He.Italic,Underline:He.Underline,Quote:He.Quote,TextQuote:JV,Strikethrough:He.Strikethrough,Minus:He.Minus,Eraser:He.Eraser,PaintRoller:He.PaintRoller,Redo2:He.Redo2,Undo2:He.Undo2,AlignCenter:jp.TextAlignCenterIcon,AlignJustify:jp.TextAlignJustifyIcon,AlignLeft:jp.TextAlignLeftIcon,AlignRight:jp.TextAlignRightIcon,ChevronDown:He.ChevronDown,Subscript:He.Subscript,Superscript:He.Superscript,Code:He.Code,Code2:He.CodeXml,Type:He.Type,IndentIncrease:He.IndentIncrease,IndentDecrease:He.IndentDecrease,List:He.List,ListOrdered:He.ListOrdered,ListTodo:He.ListTodo,Link:He.Link,ImageUp:He.ImageUp,Video:He.Video,Maximize:He.Maximize,Minimize:He.Minimize,Table:He.Table,Sparkles:He.Sparkles,Pencil:He.Pencil,Unlink:He.Unlink,BetweenHorizonalEnd:He.BetweenHorizonalEnd,BetweenHorizonalStart:He.BetweenHorizonalStart,BetweenVerticalStart:He.BetweenVerticalStart,BetweenVerticalEnd:He.BetweenVerticalEnd,TableCellsMerge:He.TableCellsMerge,TableCellsSplit:He.TableCellsSplit,Trash2:He.Trash2,Trash:He.Trash,Replace:He.Replace,ChevronsUpDown:He.ChevronsUpDown,LineHeight:tG,Word:eG,Heading1:He.Heading1,Heading2:He.Heading2,Heading3:He.Heading3,Heading4:He.Heading4,Heading5:He.Heading5,Heading6:He.Heading6,Columns2:He.Columns2,Columns3:He.Columns3,Columns4:He.Columns4,Plus:He.Plus,Grip:He.GripVertical,Copy:He.Copy,Clipboard:He.Clipboard,PanelLeft:He.PanelLeft,PanelRight:He.PanelRight,Columns:He.Columns2,Iframe:He.Frame,MenuDown:yN,SizeS:iG,SizeM:nG,SizeL:rG,AspectRatio:YV,Emoji:He.SmilePlus,DeleteColumn:ZV,DeleteRow:QV,SearchAndReplace:He.Replace,EmojiIcon:He.SmilePlusIcon,KatexIcon:He.Sigma,ExportPdf:vN,ExportWord:bN,ImportWord:oG,ColumnAddLeft:sG,ColumnAddRight:aG,BookMarked:He.BookMarked,Excalidraw:lG,ZoomIn:He.ZoomIn,ZoomOut:He.ZoomOut,Settings:He.Settings,Eye:He.Eye,TextDirection:cG,LeftToRight:uG,RightToLeft:dG,Attachment:He.Paperclip,GifIcon:fG,ChevronUp:He.ChevronUp,Crop:He.CropIcon,Mermaid:hG,Twitter:pG,FlipX:He.FlipVertical,FlipY:He.FlipHorizontal};function mG(t){const e=["size-small","size-medium","size-large"],r=["SizeS","SizeM","SizeL"];return e.map((n,i)=>({type:`image-${n}`,component:Ve,componentProps:{tooltip:Ot.t(`editor.${n.replace("-",".")}.tooltip`),icon:r[i],action:()=>t.commands.updateImage({width:xh[n]}),isActive:()=>t.isActive("image",{width:xh[n]})}}))}function gG(t){const e=["size-small","size-medium","size-large"],r=["SizeS","SizeM","SizeL"];return e.map((n,i)=>({type:`image-${n}`,component:Ve,componentProps:{tooltip:Ot.t(`editor.${n.replace("-",".")}.tooltip`),icon:r[i],action:()=>t.commands.updateImageGif({width:xh[n]}),isActive:()=>t.isActive("image",{width:xh[n]})}}))}function yG(t){const e=["left","center","right"],r={left:"AlignLeft",center:"AlignCenter",right:"AlignRight"};return e.map(n=>({type:`image-${n}`,component:Ve,componentProps:{tooltip:Ot.t(`editor.textalign.${n}.tooltip`),icon:r[n],action:()=>{var i,o;return(o=(i=t.commands)==null?void 0:i.setAlignImage)==null?void 0:o.call(i,n)},isActive:()=>t.isActive({align:n})||!1,disabled:!1}}))}function vG(t){const e=["left","center","right"],r={left:"AlignLeft",center:"AlignCenter",right:"AlignRight"};return e.map(n=>({type:`image-${n}`,component:Ve,componentProps:{tooltip:Ot.t(`editor.textalign.${n}.tooltip`),icon:r[n],action:()=>{var i,o;return(o=(i=t.commands)==null?void 0:i.setAlignImageGif)==null?void 0:o.call(i,n)},isActive:()=>t.isActive({align:n})||!1,disabled:!1}}))}function bG(t){const e=["left","center","right"],r={left:"AlignLeft",center:"AlignCenter",right:"AlignRight"};return e.map(n=>({type:`image-${n}`,component:Ve,componentProps:{tooltip:Ot.t(`editor.textalign.${n}.tooltip`),icon:r[n],action:()=>{var i,o;return(o=(i=t.commands)==null?void 0:i.setAlignImageMermaid)==null?void 0:o.call(i,n)},isActive:()=>t.isActive({align:n})||!1,disabled:!1}}))}function wG(t){const e=["size-small","size-medium","size-large"],r=["SizeS","SizeM","SizeL"];return e.map((n,i)=>({type:`video-${n}`,component:Ve,componentProps:{tooltip:Ot.t(`editor.${n.replace("-",".")}.tooltip`),icon:r[i],action:()=>t.commands.updateVideo({width:Eg[n]}),isActive:()=>t.isActive("video",{width:Eg[n]})}}))}function xG(t){return[{type:"flipX",component:Ve,componentProps:{editor:t,tooltip:Ot.t("editor.tooltip.flipX"),icon:"FlipX",action:()=>{const e=t.getAttributes("image"),{flipX:r}=e;t.chain().focus(void 0,{scrollIntoView:!1}).updateImage({flipX:!r}).run()}}},{type:"flipY",component:Ve,componentProps:{editor:t,tooltip:Ot.t("editor.tooltip.flipY"),icon:"FlipY",action:()=>{const e=t.getAttributes("image"),{flipY:r}=e;t.chain().focus(void 0,{scrollIntoView:!1}).updateImage({flipY:!r}).run()}}},...mG(t),...yG(t),{type:"remove",component:Ve,componentProps:{editor:t,tooltip:Ot.t("editor.remove"),icon:"Trash2",action:()=>{const{state:e,dispatch:r}=t.view;Hh(e,r)}}}]}function SG(t){return[...gG(t),...vG(t),{type:"remove",component:Ve,componentProps:{editor:t,tooltip:Ot.t("editor.remove"),icon:"Trash2",action:()=>{const{state:e,dispatch:r}=t.view;Hh(e,r)}}}]}function kG(t){return[...bG(t),{type:"edit",component:Ve,componentProps:{editor:t,tooltip:Ot.t("editor.edit"),icon:"Pencil",action:()=>{}}},{type:"remove",component:Ve,componentProps:{editor:t,tooltip:Ot.t("editor.remove"),icon:"Trash2",action:()=>{const{state:e,dispatch:r}=t.view;Hh(e,r)}}}]}function _G(t){return[...wG(t),{type:"remove",component:Ve,componentProps:{editor:t,tooltip:Ot.t("editor.remove"),icon:"Trash2",action:()=>{const{state:e,dispatch:r}=t.view;Hh(e,r)}}}]}function CG(t,e){return JH.reduce((r,n)=>{if(n==="divider"&&r.length>0)return[...r,{type:"divider",component:void 0,componentProps:{}}];const i=t.extensionManager.extensions.find(o=>o.name===n);return i?[...r,i.configure().options.button({editor:t,t:e,extension:i})]:r},[])}const go=()=>new Map,Px=t=>{const e=go();return t.forEach((r,n)=>{e.set(n,r)}),e},Cd=(t,e,r)=>{let n=t.get(e);return n===void 0&&t.set(e,n=r()),n},EG=(t,e)=>{const r=[];for(const[n,i]of t)r.push(e(i,n));return r},TG=(t,e)=>{for(const[r,n]of t)if(e(n,r))return!0;return!1},od=()=>new Set,sw=t=>t[t.length-1],sd=Array.from,AG=Array.isArray;class RG{constructor(){this._observers=go()}on(e,r){return Cd(this._observers,e,od).add(r),r}once(e,r){const n=(...i)=>{this.off(e,n),r(...i)};this.on(e,n)}off(e,r){const n=this._observers.get(e);n!==void 0&&(n.delete(r),n.size===0&&this._observers.delete(e))}emit(e,r){return sd((this._observers.get(e)||go()).values()).forEach(n=>n(...r))}destroy(){this._observers=go()}}const Jl=Math.floor,zm=Math.abs,wN=(t,e)=>t<e?t:e,Ed=(t,e)=>t>e?t:e,IG=t=>t!==0?t<0:1/t<0,PE=1,LE=2,aw=4,lw=8,OG=32,xN=64,Mg=128,MG=31,FE=63,ih=127,NG=2147483647,DG=Number.isInteger||(t=>typeof t=="number"&&isFinite(t)&&Jl(t)===t),PG=t=>t.toLowerCase(),LG=/^\s*/g,FG=t=>t.replace(LG,""),jG=/([A-Z])/g,jE=(t,e)=>FG(t.replace(jG,r=>`${e}${PG(r)}`)),BG=t=>{const e=unescape(encodeURIComponent(t)),r=e.length,n=new Uint8Array(r);for(let i=0;i<r;i++)n[i]=e.codePointAt(i);return n},Ch=typeof TextEncoder<"u"?new TextEncoder:null,zG=t=>Ch.encode(t),HG=Ch?zG:BG;let cw=typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});cw&&cw.decode(new Uint8Array).length===1&&(cw=null);class qh{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}const kS=()=>new qh,$G=t=>{let e=t.cpos;for(let r=0;r<t.bufs.length;r++)e+=t.bufs[r].length;return e},is=t=>{const e=new Uint8Array($G(t));let r=0;for(let n=0;n<t.bufs.length;n++){const i=t.bufs[n];e.set(i,r),r+=i.length}return e.set(new Uint8Array(t.cbuf.buffer,0,t.cpos),r),e},UG=(t,e)=>{const r=t.cbuf.length;r-t.cpos<e&&(t.bufs.push(new Uint8Array(t.cbuf.buffer,0,t.cpos)),t.cbuf=new Uint8Array(Ed(r,e)*2),t.cpos=0)},Sr=(t,e)=>{const r=t.cbuf.length;t.cpos===r&&(t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(r*2),t.cpos=0),t.cbuf[t.cpos++]=e},Lx=Sr,Ht=(t,e)=>{for(;e>ih;)Sr(t,Mg|ih&e),e=Jl(e/128);Sr(t,ih&e)},_S=(t,e)=>{const r=IG(e);for(r&&(e=-e),Sr(t,(e>FE?Mg:0)|(r?xN:0)|FE&e),e=Jl(e/64);e>0;)Sr(t,(e>ih?Mg:0)|ih&e),e=Jl(e/128)},Fx=new Uint8Array(3e4),WG=Fx.length/3,VG=(t,e)=>{if(e.length<WG){const r=Ch.encodeInto(e,Fx).written||0;Ht(t,r);for(let n=0;n<r;n++)Sr(t,Fx[n])}else Hn(t,HG(e))},GG=(t,e)=>{const r=unescape(encodeURIComponent(e)),n=r.length;Ht(t,n);for(let i=0;i<n;i++)Sr(t,r.codePointAt(i))},Hu=Ch&&Ch.encodeInto?VG:GG,CS=(t,e)=>{const r=t.cbuf.length,n=t.cpos,i=wN(r-n,e.length),o=e.length-i;t.cbuf.set(e.subarray(0,i),n),t.cpos+=i,o>0&&(t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(Ed(r*2,o)),t.cbuf.set(e.subarray(i)),t.cpos=o)},Hn=(t,e)=>{Ht(t,e.byteLength),CS(t,e)},ES=(t,e)=>{UG(t,e);const r=new DataView(t.cbuf.buffer,t.cpos,e);return t.cpos+=e,r},KG=(t,e)=>ES(t,4).setFloat32(0,e,!1),qG=(t,e)=>ES(t,8).setFloat64(0,e,!1),XG=(t,e)=>ES(t,8).setBigInt64(0,e,!1),BE=new DataView(new ArrayBuffer(4)),YG=t=>(BE.setFloat32(0,t),BE.getFloat32(0)===t),Eh=(t,e)=>{switch(typeof e){case"string":Sr(t,119),Hu(t,e);break;case"number":DG(e)&&zm(e)<=NG?(Sr(t,125),_S(t,e)):YG(e)?(Sr(t,124),KG(t,e)):(Sr(t,123),qG(t,e));break;case"bigint":Sr(t,122),XG(t,e);break;case"object":if(e===null)Sr(t,126);else if(AG(e)){Sr(t,117),Ht(t,e.length);for(let r=0;r<e.length;r++)Eh(t,e[r])}else if(e instanceof Uint8Array)Sr(t,116),Hn(t,e);else{Sr(t,118);const r=Object.keys(e);Ht(t,r.length);for(let n=0;n<r.length;n++){const i=r[n];Hu(t,i),Eh(t,e[i])}}break;case"boolean":Sr(t,e?120:121);break;default:Sr(t,127)}};class zE extends qh{constructor(e){super(),this.w=e,this.s=null,this.count=0}write(e){this.s===e?this.count++:(this.count>0&&Ht(this,this.count-1),this.count=1,this.w(this,e),this.s=e)}}const HE=t=>{t.count>0&&(_S(t.encoder,t.count===1?t.s:-t.s),t.count>1&&Ht(t.encoder,t.count-2))};class Hm{constructor(){this.encoder=new qh,this.s=0,this.count=0}write(e){this.s===e?this.count++:(HE(this),this.count=1,this.s=e)}toUint8Array(){return HE(this),is(this.encoder)}}const $E=t=>{if(t.count>0){const e=t.diff*2+(t.count===1?0:1);_S(t.encoder,e),t.count>1&&Ht(t.encoder,t.count-2)}};class uw{constructor(){this.encoder=new qh,this.s=0,this.count=0,this.diff=0}write(e){this.diff===e-this.s?(this.s=e,this.count++):($E(this),this.count=1,this.diff=e-this.s,this.s=e)}toUint8Array(){return $E(this),is(this.encoder)}}class JG{constructor(){this.sarr=[],this.s="",this.lensE=new Hm}write(e){this.s+=e,this.s.length>19&&(this.sarr.push(this.s),this.s=""),this.lensE.write(e.length)}toUint8Array(){const e=new qh;return this.sarr.push(this.s),this.s="",Hu(e,this.sarr.join("")),CS(e,this.lensE.toUint8Array()),is(e)}}const ad=t=>new Error(t),yo=()=>{throw ad("Method unimplemented")},ka=()=>{throw ad("Unexpected case")},ZG=crypto.getRandomValues.bind(crypto),SN=()=>ZG(new Uint32Array(1))[0],QG="10000000-1000-4000-8000"+-1e11,eK=()=>QG.replace(/[018]/g,t=>(t^SN()&15>>t/4).toString(16)),UE=t=>new Promise(t);Promise.all.bind(Promise);const WE=t=>t===void 0?null:t;class tK{constructor(){this.map=new Map}setItem(e,r){this.map.set(e,r)}getItem(e){return this.map.get(e)}}let kN=new tK,rK=!0;try{typeof localStorage<"u"&&localStorage&&(kN=localStorage,rK=!1)}catch{}const nK=kN,iK=Object.assign,oK=Object.keys,sK=(t,e)=>{for(const r in t)e(t[r],r)},VE=t=>oK(t).length,aK=t=>{for(const e in t)return!1;return!0},lK=(t,e)=>{for(const r in t)if(!e(t[r],r))return!1;return!0},cK=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),uK=(t,e)=>t===e||VE(t)===VE(e)&&lK(t,(r,n)=>(r!==void 0||cK(e,n))&&e[n]===r),dK=Object.freeze,_N=t=>{for(const e in t){const r=t[e];(typeof r=="object"||typeof r=="function")&&_N(t[e])}return dK(t)},TS=(t,e,r=0)=>{try{for(;r<t.length;r++)t[r](...e)}finally{r<t.length&&TS(t,e,r+1)}},fK=(t,e)=>e.includes(t),Th=typeof process<"u"&&process.release&&/node|io\.js/.test(process.release.name)&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]";let io;const hK=()=>{if(io===void 0)if(Th){io=go();const t=process.argv;let e=null;for(let r=0;r<t.length;r++){const n=t[r];n[0]==="-"?(e!==null&&io.set(e,""),e=n):e!==null&&(io.set(e,n),e=null)}e!==null&&io.set(e,"")}else typeof location=="object"?(io=go(),(location.search||"?").slice(1).split("&").forEach(t=>{if(t.length!==0){const[e,r]=t.split("=");io.set(`--${jE(e,"-")}`,r),io.set(`-${jE(e,"-")}`,r)}})):io=go();return io},jx=t=>hK().has(t),Ng=t=>WE(Th?process.env[t.toUpperCase().replaceAll("-","_")]:nK.getItem(t)),CN=t=>jx("--"+t)||Ng(t)!==null;CN("production");const pK=Th&&fK(process.env.FORCE_COLOR,["true","1","2"]),mK=pK||!jx("--no-colors")&&!CN("no-color")&&(!Th||process.stdout.isTTY)&&(!Th||jx("--color")||Ng("COLORTERM")!==null||(Ng("TERM")||"").includes("color"));class gK{constructor(e,r){this.left=e,this.right=r}}const Jo=(t,e)=>new gK(t,e);typeof DOMParser<"u"&&new DOMParser;const yK=t=>EG(t,(e,r)=>`${r}:${e};`).join(""),vs=Symbol,EN=vs(),TN=vs(),vK=vs(),bK=vs(),wK=vs(),AN=vs(),xK=vs(),AS=vs(),SK=vs(),kK=t=>{var i;t.length===1&&((i=t[0])==null?void 0:i.constructor)===Function&&(t=t[0]());const e=[],r=[];let n=0;for(;n<t.length;n++){const o=t[n];if(o===void 0)break;if(o.constructor===String||o.constructor===Number)e.push(o);else if(o.constructor===Object)break}for(n>0&&r.push(e.join(""));n<t.length;n++){const o=t[n];o instanceof Symbol||r.push(o)}return r},_K={[EN]:Jo("font-weight","bold"),[TN]:Jo("font-weight","normal"),[vK]:Jo("color","blue"),[wK]:Jo("color","green"),[bK]:Jo("color","grey"),[AN]:Jo("color","red"),[xK]:Jo("color","purple"),[AS]:Jo("color","orange"),[SK]:Jo("color","black")},CK=t=>{var s;t.length===1&&((s=t[0])==null?void 0:s.constructor)===Function&&(t=t[0]());const e=[],r=[],n=go();let i=[],o=0;for(;o<t.length;o++){const a=t[o],l=_K[a];if(l!==void 0)n.set(l.left,l.right);else{if(a===void 0)break;if(a.constructor===String||a.constructor===Number){const c=yK(n);o>0||c.length>0?(e.push("%c"+a),r.push(c)):e.push(a)}else break}}for(o>0&&(i=r,i.unshift(e.join("")));o<t.length;o++){const a=t[o];a instanceof Symbol||i.push(a)}return i},RN=mK?CK:kK,EK=(...t)=>{console.log(...RN(t)),IN.forEach(e=>e.print(t))},TK=(...t)=>{console.warn(...RN(t)),t.unshift(AS),IN.forEach(e=>e.print(t))},IN=od(),ON=t=>({[Symbol.iterator](){return this},next:t}),AK=(t,e)=>ON(()=>{let r;do r=t.next();while(!r.done&&!e(r.value));return r}),dw=(t,e)=>ON(()=>{const{done:r,value:n}=t.next();return{done:r,value:r?void 0:e(n)}});class RK{constructor(e,r){this.clock=e,this.len=r}}class IK{constructor(){this.clients=new Map}}const MN=(t,e,r)=>e.clients.forEach((n,i)=>{const o=t.doc.store.clients.get(i);for(let s=0;s<n.length;s++){const a=n[s];BN(t,o,a.clock,a.len,r)}}),OK=(t,e)=>{let r=0,n=t.length-1;for(;r<=n;){const i=Jl((r+n)/2),o=t[i],s=o.clock;if(s<=e){if(e<s+o.len)return i;r=i+1}else n=i-1}return null},NN=(t,e)=>{const r=t.clients.get(e.client);return r!==void 0&&OK(r,e.clock)!==null},DN=t=>{t.clients.forEach(e=>{e.sort((i,o)=>i.clock-o.clock);let r,n;for(r=1,n=1;r<e.length;r++){const i=e[n-1],o=e[r];i.clock+i.len>=o.clock?i.len=Ed(i.len,o.clock+o.len-i.clock):(n<r&&(e[n]=o),n++)}e.length=n})},PN=(t,e,r,n)=>{Cd(t.clients,e,()=>[]).push(new RK(r,n))},MK=(t,e)=>{Ht(t.restEncoder,e.clients.size),sd(e.clients.entries()).sort((r,n)=>n[0]-r[0]).forEach(([r,n])=>{t.resetDsCurVal(),Ht(t.restEncoder,r);const i=n.length;Ht(t.restEncoder,i);for(let o=0;o<i;o++){const s=n[o];t.writeDsClock(s.clock),t.writeDsLen(s.len)}})},LN=SN;class Xh extends RG{constructor({guid:e=eK(),collectionid:r=null,gc:n=!0,gcFilter:i=()=>!0,meta:o=null,autoLoad:s=!1,shouldLoad:a=!0}={}){super(),this.gc=n,this.gcFilter=i,this.clientID=LN(),this.guid=e,this.collectionid=r,this.share=new Map,this.store=new HK,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=a,this.autoLoad=s,this.meta=o,this.isLoaded=!1,this.isSynced=!1,this.isDestroyed=!1,this.whenLoaded=UE(c=>{this.on("load",()=>{this.isLoaded=!0,c(this)})});const l=()=>UE(c=>{const d=f=>{(f===void 0||f===!0)&&(this.off("sync",d),c())};this.on("sync",d)});this.on("sync",c=>{c===!1&&this.isSynced&&(this.whenSynced=l()),this.isSynced=c===void 0||c===!0,this.isSynced&&!this.isLoaded&&this.emit("load",[this])}),this.whenSynced=l()}load(){const e=this._item;e!==null&&!this.shouldLoad&&Xt(e.parent.doc,r=>{r.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(sd(this.subdocs).map(e=>e.guid))}transact(e,r=null){return Xt(this,e,r)}get(e,r=zr){const n=Cd(this.share,e,()=>{const o=new r;return o._integrate(this,null),o}),i=n.constructor;if(r!==zr&&i!==r)if(i===zr){const o=new r;o._map=n._map,n._map.forEach(s=>{for(;s!==null;s=s.left)s.parent=o}),o._start=n._start;for(let s=o._start;s!==null;s=s.right)s.parent=o;return o._length=n._length,this.share.set(e,o),o._integrate(this,null),o}else throw new Error(`Type with the name ${e} has already been defined with a different constructor`);return n}getArray(e=""){return this.get(e,oh)}getText(e=""){return this.get(e,Oh)}getMap(e=""){return this.get(e,Fg)}getXmlElement(e=""){return this.get(e,Mh)}getXmlFragment(e=""){return this.get(e,ld)}toJSON(){const e={};return this.share.forEach((r,n)=>{e[n]=r.toJSON()}),e}destroy(){this.isDestroyed=!0,sd(this.subdocs).forEach(r=>r.destroy());const e=this._item;if(e!==null){this._item=null;const r=e.content;r.doc=new Xh({guid:this.guid,...r.opts,shouldLoad:!1}),r.doc._item=e,Xt(e.parent.doc,n=>{const i=r.doc;e.deleted||n.subdocsAdded.add(i),n.subdocsRemoved.add(this)},null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}}class NK{constructor(){this.restEncoder=kS()}toUint8Array(){return is(this.restEncoder)}resetDsCurVal(){}writeDsClock(e){Ht(this.restEncoder,e)}writeDsLen(e){Ht(this.restEncoder,e)}}class DK extends NK{writeLeftID(e){Ht(this.restEncoder,e.client),Ht(this.restEncoder,e.clock)}writeRightID(e){Ht(this.restEncoder,e.client),Ht(this.restEncoder,e.clock)}writeClient(e){Ht(this.restEncoder,e)}writeInfo(e){Lx(this.restEncoder,e)}writeString(e){Hu(this.restEncoder,e)}writeParentInfo(e){Ht(this.restEncoder,e?1:0)}writeTypeRef(e){Ht(this.restEncoder,e)}writeLen(e){Ht(this.restEncoder,e)}writeAny(e){Eh(this.restEncoder,e)}writeBuf(e){Hn(this.restEncoder,e)}writeJSON(e){Hu(this.restEncoder,JSON.stringify(e))}writeKey(e){Hu(this.restEncoder,e)}}class PK{constructor(){this.restEncoder=kS(),this.dsCurrVal=0}toUint8Array(){return is(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(e){const r=e-this.dsCurrVal;this.dsCurrVal=e,Ht(this.restEncoder,r)}writeDsLen(e){e===0&&ka(),Ht(this.restEncoder,e-1),this.dsCurrVal+=e}}class LK extends PK{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new uw,this.clientEncoder=new Hm,this.leftClockEncoder=new uw,this.rightClockEncoder=new uw,this.infoEncoder=new zE(Lx),this.stringEncoder=new JG,this.parentInfoEncoder=new zE(Lx),this.typeRefEncoder=new Hm,this.lenEncoder=new Hm}toUint8Array(){const e=kS();return Ht(e,0),Hn(e,this.keyClockEncoder.toUint8Array()),Hn(e,this.clientEncoder.toUint8Array()),Hn(e,this.leftClockEncoder.toUint8Array()),Hn(e,this.rightClockEncoder.toUint8Array()),Hn(e,is(this.infoEncoder)),Hn(e,this.stringEncoder.toUint8Array()),Hn(e,is(this.parentInfoEncoder)),Hn(e,this.typeRefEncoder.toUint8Array()),Hn(e,this.lenEncoder.toUint8Array()),CS(e,is(this.restEncoder)),is(e)}writeLeftID(e){this.clientEncoder.write(e.client),this.leftClockEncoder.write(e.clock)}writeRightID(e){this.clientEncoder.write(e.client),this.rightClockEncoder.write(e.clock)}writeClient(e){this.clientEncoder.write(e)}writeInfo(e){this.infoEncoder.write(e)}writeString(e){this.stringEncoder.write(e)}writeParentInfo(e){this.parentInfoEncoder.write(e?1:0)}writeTypeRef(e){this.typeRefEncoder.write(e)}writeLen(e){this.lenEncoder.write(e)}writeAny(e){Eh(this.restEncoder,e)}writeBuf(e){Hn(this.restEncoder,e)}writeJSON(e){Eh(this.restEncoder,e)}writeKey(e){const r=this.keyMap.get(e);r===void 0?(this.keyClockEncoder.write(this.keyClock++),this.stringEncoder.write(e)):this.keyClockEncoder.write(r)}}const FK=(t,e,r,n)=>{n=Ed(n,e[0].id.clock);const i=hs(e,n);Ht(t.restEncoder,e.length-i),t.writeClient(r),Ht(t.restEncoder,n);const o=e[i];o.write(t,n-o.id.clock);for(let s=i+1;s<e.length;s++)e[s].write(t,0)},jK=(t,e,r)=>{const n=new Map;r.forEach((i,o)=>{In(e,o)>i&&n.set(o,i)}),RS(e).forEach((i,o)=>{r.has(o)||n.set(o,0)}),Ht(t.restEncoder,n.size),sd(n.entries()).sort((i,o)=>o[0]-i[0]).forEach(([i,o])=>{FK(t,e.clients.get(i),i,o)})},BK=(t,e)=>jK(t,e.doc.store,e.beforeState);class zK{constructor(){this.l=[]}}const GE=()=>new zK,KE=(t,e)=>t.l.push(e),qE=(t,e)=>{const r=t.l,n=r.length;t.l=r.filter(i=>e!==i),n===t.l.length&&console.error("[yjs] Tried to remove event handler that doesn't exist.")},FN=(t,e,r)=>TS(t.l,[e,r]);class $m{constructor(e,r){this.client=e,this.clock=r}}const Qp=(t,e)=>t===e||t!==null&&e!==null&&t.client===e.client&&t.clock===e.clock,Yt=(t,e)=>new $m(t,e),Ah=t=>{for(const[e,r]of t.doc.share.entries())if(r===t)return e;throw ka()};class Dg{constructor(e,r,n,i=0){this.type=e,this.tname=r,this.item=n,this.assoc=i}}const em=(t,e,r)=>{let n=null,i=null;return t._item===null?i=Ah(t):n=Yt(t._item.id.client,t._item.id.clock),new Dg(n,i,e,r)},fw=(t,e,r=0)=>{let n=t._start;if(r<0){if(e===0)return em(t,null,r);e--}for(;n!==null;){if(!n.deleted&&n.countable){if(n.length>e)return em(t,Yt(n.id.client,n.id.clock+e),r);e-=n.length}if(n.right===null&&r<0)return em(t,n.lastId,r);n=n.right}return em(t,null,r)},Au=(t,e)=>e===void 0?!t.deleted:e.sv.has(t.id.client)&&(e.sv.get(t.id.client)||0)>t.id.clock&&!NN(e.ds,t.id),Bx=(t,e)=>{const r=Cd(t.meta,Bx,od),n=t.doc.store;r.has(e)||(e.sv.forEach((i,o)=>{i<In(n,o)&&_a(t,Yt(o,i))}),MN(t,e.ds,i=>{}),r.add(e))};class HK{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}const RS=t=>{const e=new Map;return t.clients.forEach((r,n)=>{const i=r[r.length-1];e.set(n,i.id.clock+i.length)}),e},In=(t,e)=>{const r=t.clients.get(e);if(r===void 0)return 0;const n=r[r.length-1];return n.id.clock+n.length},jN=(t,e)=>{let r=t.clients.get(e.id.client);if(r===void 0)r=[],t.clients.set(e.id.client,r);else{const n=r[r.length-1];if(n.id.clock+n.length!==e.id.clock)throw ka()}r.push(e)},hs=(t,e)=>{let r=0,n=t.length-1,i=t[n],o=i.id.clock;if(o===e)return n;let s=Jl(e/(o+i.length-1)*n);for(;r<=n;){if(i=t[s],o=i.id.clock,o<=e){if(e<o+i.length)return s;r=s+1}else n=s-1;s=Jl((r+n)/2)}throw ka()},$K=(t,e)=>{const r=t.clients.get(e.client);return r[hs(r,e.clock)]},hw=$K,zx=(t,e,r)=>{const n=hs(e,r),i=e[n];return i.id.clock<r&&i instanceof Vn?(e.splice(n+1,0,nD(t,i,r-i.id.clock)),n+1):n},_a=(t,e)=>{const r=t.doc.store.clients.get(e.client);return r[zx(t,r,e.clock)]},XE=(t,e,r)=>{const n=e.clients.get(r.client),i=hs(n,r.clock),o=n[i];return r.clock!==o.id.clock+o.length-1&&o.constructor!==la&&n.splice(i+1,0,nD(t,o,r.clock-o.id.clock+1)),o},UK=(t,e,r)=>{const n=t.clients.get(e.id.client);n[hs(n,e.id.clock)]=r},BN=(t,e,r,n,i)=>{if(n===0)return;const o=r+n;let s=zx(t,e,r),a;do a=e[s++],o<a.id.clock+a.length&&zx(t,e,o),i(a);while(s<e.length&&e[s].id.clock<o)};class WK{constructor(e,r,n){this.doc=e,this.deleteSet=new IK,this.beforeState=RS(e.store),this.afterState=new Map,this.changed=new Map,this.changedParentTypes=new Map,this._mergeStructs=[],this.origin=r,this.meta=new Map,this.local=n,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1}}const YE=(t,e)=>e.deleteSet.clients.size===0&&!TG(e.afterState,(r,n)=>e.beforeState.get(n)!==r)?!1:(DN(e.deleteSet),BK(t,e),MK(t,e.deleteSet),!0),JE=(t,e,r)=>{const n=e._item;(n===null||n.id.clock<(t.beforeState.get(n.id.client)||0)&&!n.deleted)&&Cd(t.changed,e,od).add(r)},Um=(t,e)=>{let r=t[e],n=t[e-1],i=e;for(;i>0;r=n,n=t[--i-1]){if(n.deleted===r.deleted&&n.constructor===r.constructor&&n.mergeWith(r)){r instanceof Vn&&r.parentSub!==null&&r.parent._map.get(r.parentSub)===r&&r.parent._map.set(r.parentSub,n);continue}break}const o=e-i;return o&&t.splice(e+1-o,o),o},VK=(t,e,r)=>{for(const[n,i]of t.clients.entries()){const o=e.clients.get(n);for(let s=i.length-1;s>=0;s--){const a=i[s],l=a.clock+a.len;for(let c=hs(o,a.clock),d=o[c];c<o.length&&d.id.clock<l;d=o[++c]){const f=o[c];if(a.clock+a.len<=f.id.clock)break;f instanceof Vn&&f.deleted&&!f.keep&&r(f)&&f.gc(e,!1)}}}},GK=(t,e)=>{t.clients.forEach((r,n)=>{const i=e.clients.get(n);for(let o=r.length-1;o>=0;o--){const s=r[o],a=wN(i.length-1,1+hs(i,s.clock+s.len-1));for(let l=a,c=i[l];l>0&&c.id.clock>=s.clock;c=i[l])l-=1+Um(i,l)}})},zN=(t,e)=>{if(e<t.length){const r=t[e],n=r.doc,i=n.store,o=r.deleteSet,s=r._mergeStructs;try{DN(o),r.afterState=RS(r.doc.store),n.emit("beforeObserverCalls",[r,n]);const a=[];r.changed.forEach((l,c)=>a.push(()=>{(c._item===null||!c._item.deleted)&&c._callObserver(r,l)})),a.push(()=>{r.changedParentTypes.forEach((l,c)=>{c._dEH.l.length>0&&(c._item===null||!c._item.deleted)&&(l=l.filter(d=>d.target._item===null||!d.target._item.deleted),l.forEach(d=>{d.currentTarget=c,d._path=null}),l.sort((d,f)=>d.path.length-f.path.length),FN(c._dEH,l,r))})}),a.push(()=>n.emit("afterTransaction",[r,n])),TS(a,[]),r._needFormattingCleanup&&iq(r)}finally{n.gc&&VK(o,i,n.gcFilter),GK(o,i),r.afterState.forEach((d,f)=>{const p=r.beforeState.get(f)||0;if(p!==d){const m=i.clients.get(f),g=Ed(hs(m,p),1);for(let b=m.length-1;b>=g;)b-=1+Um(m,b)}});for(let d=s.length-1;d>=0;d--){const{client:f,clock:p}=s[d].id,m=i.clients.get(f),g=hs(m,p);g+1<m.length&&Um(m,g+1)>1||g>0&&Um(m,g)}if(!r.local&&r.afterState.get(n.clientID)!==r.beforeState.get(n.clientID)&&(EK(AS,EN,"[yjs] ",TN,AN,"Changed the client-id because another client seems to be using it."),n.clientID=LN()),n.emit("afterTransactionCleanup",[r,n]),n._observers.has("update")){const d=new DK;YE(d,r)&&n.emit("update",[d.toUint8Array(),r.origin,n,r])}if(n._observers.has("updateV2")){const d=new LK;YE(d,r)&&n.emit("updateV2",[d.toUint8Array(),r.origin,n,r])}const{subdocsAdded:a,subdocsLoaded:l,subdocsRemoved:c}=r;(a.size>0||c.size>0||l.size>0)&&(a.forEach(d=>{d.clientID=n.clientID,d.collectionid==null&&(d.collectionid=n.collectionid),n.subdocs.add(d)}),c.forEach(d=>n.subdocs.delete(d)),n.emit("subdocs",[{loaded:l,added:a,removed:c},n,r]),c.forEach(d=>d.destroy())),t.length<=e+1?(n._transactionCleanups=[],n.emit("afterAllTransactions",[n,t])):zN(t,e+1)}}},Xt=(t,e,r=null,n=!0)=>{const i=t._transactionCleanups;let o=!1,s=null;t._transaction===null&&(o=!0,t._transaction=new WK(t,r,n),i.push(t._transaction),i.length===1&&t.emit("beforeAllTransactions",[t]),t.emit("beforeTransaction",[t._transaction,t]));try{s=e(t._transaction)}finally{if(o){const a=t._transaction===i[0];t._transaction=null,a&&zN(i,0)}}return s},ZE="You must not compute changes after the event-handler fired.";class Yy{constructor(e,r){this.target=e,this.currentTarget=e,this.transaction=r,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||(this._path=KK(this.currentTarget,this.target))}deletes(e){return NN(this.transaction.deleteSet,e.id)}get keys(){if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0)throw ad(ZE);const e=new Map,r=this.target;this.transaction.changed.get(r).forEach(i=>{if(i!==null){const o=r._map.get(i);let s,a;if(this.adds(o)){let l=o.left;for(;l!==null&&this.adds(l);)l=l.left;if(this.deletes(o))if(l!==null&&this.deletes(l))s="delete",a=sw(l.content.getContent());else return;else l!==null&&this.deletes(l)?(s="update",a=sw(l.content.getContent())):(s="add",a=void 0)}else if(this.deletes(o))s="delete",a=sw(o.content.getContent());else return;e.set(i,{action:s,oldValue:a})}}),this._keys=e}return this._keys}get delta(){return this.changes.delta}adds(e){return e.id.clock>=(this.transaction.beforeState.get(e.id.client)||0)}get changes(){let e=this._changes;if(e===null){if(this.transaction.doc._transactionCleanups.length===0)throw ad(ZE);const r=this.target,n=od(),i=od(),o=[];if(e={added:n,deleted:i,delta:o,keys:this.keys},this.transaction.changed.get(r).has(null)){let a=null;const l=()=>{a&&o.push(a)};for(let c=r._start;c!==null;c=c.right)c.deleted?this.deletes(c)&&!this.adds(c)&&((a===null||a.delete===void 0)&&(l(),a={delete:0}),a.delete+=c.length,i.add(c)):this.adds(c)?((a===null||a.insert===void 0)&&(l(),a={insert:[]}),a.insert=a.insert.concat(c.content.getContent()),n.add(c)):((a===null||a.retain===void 0)&&(l(),a={retain:0}),a.retain+=c.length);a!==null&&a.retain===void 0&&l()}this._changes=e}return e}}const KK=(t,e)=>{const r=[];for(;e._item!==null&&e!==t;){if(e._item.parentSub!==null)r.unshift(e._item.parentSub);else{let n=0,i=e._item.parent._start;for(;i!==e._item&&i!==null;)!i.deleted&&i.countable&&(n+=i.length),i=i.right;r.unshift(n)}e=e._item.parent}return r},Kr=()=>{TK("Invalid access: Add Yjs type to a document before reading data.")},HN=80;let IS=0;class qK{constructor(e,r){e.marker=!0,this.p=e,this.index=r,this.timestamp=IS++}}const XK=t=>{t.timestamp=IS++},$N=(t,e,r)=>{t.p.marker=!1,t.p=e,e.marker=!0,t.index=r,t.timestamp=IS++},YK=(t,e,r)=>{if(t.length>=HN){const n=t.reduce((i,o)=>i.timestamp<o.timestamp?i:o);return $N(n,e,r),n}else{const n=new qK(e,r);return t.push(n),n}},Jy=(t,e)=>{if(t._start===null||e===0||t._searchMarker===null)return null;const r=t._searchMarker.length===0?null:t._searchMarker.reduce((o,s)=>zm(e-o.index)<zm(e-s.index)?o:s);let n=t._start,i=0;for(r!==null&&(n=r.p,i=r.index,XK(r));n.right!==null&&i<e;){if(!n.deleted&&n.countable){if(e<i+n.length)break;i+=n.length}n=n.right}for(;n.left!==null&&i>e;)n=n.left,!n.deleted&&n.countable&&(i-=n.length);for(;n.left!==null&&n.left.id.client===n.id.client&&n.left.id.clock+n.left.length===n.id.clock;)n=n.left,!n.deleted&&n.countable&&(i-=n.length);return r!==null&&zm(r.index-i)<n.parent.length/HN?($N(r,n,i),r):YK(t._searchMarker,n,i)},Rh=(t,e,r)=>{for(let n=t.length-1;n>=0;n--){const i=t[n];if(r>0){let o=i.p;for(o.marker=!1;o&&(o.deleted||!o.countable);)o=o.left,o&&!o.deleted&&o.countable&&(i.index-=o.length);if(o===null||o.marker===!0){t.splice(n,1);continue}i.p=o,o.marker=!0}(e<i.index||r>0&&e===i.index)&&(i.index=Ed(e,i.index+r))}},Zy=(t,e,r)=>{const n=t,i=e.changedParentTypes;for(;Cd(i,t,()=>[]).push(r),t._item!==null;)t=t._item.parent;FN(n._eH,r,e)};class zr{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=GE(),this._dEH=GE(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(e,r){this.doc=e,this._item=r}_copy(){throw yo()}clone(){throw yo()}_write(e){}get _first(){let e=this._start;for(;e!==null&&e.deleted;)e=e.right;return e}_callObserver(e,r){!e.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(e){KE(this._eH,e)}observeDeep(e){KE(this._dEH,e)}unobserve(e){qE(this._eH,e)}unobserveDeep(e){qE(this._dEH,e)}toJSON(){}}const UN=(t,e,r)=>{t.doc??Kr(),e<0&&(e=t._length+e),r<0&&(r=t._length+r);let n=r-e;const i=[];let o=t._start;for(;o!==null&&n>0;){if(o.countable&&!o.deleted){const s=o.content.getContent();if(s.length<=e)e-=s.length;else{for(let a=e;a<s.length&&n>0;a++)i.push(s[a]),n--;e=0}}o=o.right}return i},WN=t=>{t.doc??Kr();const e=[];let r=t._start;for(;r!==null;){if(r.countable&&!r.deleted){const n=r.content.getContent();for(let i=0;i<n.length;i++)e.push(n[i])}r=r.right}return e},Ih=(t,e)=>{let r=0,n=t._start;for(t.doc??Kr();n!==null;){if(n.countable&&!n.deleted){const i=n.content.getContent();for(let o=0;o<i.length;o++)e(i[o],r++,t)}n=n.right}},VN=(t,e)=>{const r=[];return Ih(t,(n,i)=>{r.push(e(n,i,t))}),r},JK=t=>{let e=t._start,r=null,n=0;return{[Symbol.iterator](){return this},next:()=>{if(r===null){for(;e!==null&&e.deleted;)e=e.right;if(e===null)return{done:!0,value:void 0};r=e.content.getContent(),n=0,e=e.right}const i=r[n++];return r.length<=n&&(r=null),{done:!1,value:i}}}},GN=(t,e)=>{t.doc??Kr();const r=Jy(t,e);let n=t._start;for(r!==null&&(n=r.p,e-=r.index);n!==null;n=n.right)if(!n.deleted&&n.countable){if(e<n.length)return n.content.getContent()[e];e-=n.length}},Pg=(t,e,r,n)=>{let i=r;const o=t.doc,s=o.clientID,a=o.store,l=r===null?e._start:r.right;let c=[];const d=()=>{c.length>0&&(i=new Vn(Yt(s,In(a,s)),i,i&&i.lastId,l,l&&l.id,e,null,new cd(c)),i.integrate(t,0),c=[])};n.forEach(f=>{if(f===null)c.push(f);else switch(f.constructor){case Number:case Object:case Boolean:case Array:case String:c.push(f);break;default:switch(d(),f.constructor){case Uint8Array:case ArrayBuffer:i=new Vn(Yt(s,In(a,s)),i,i&&i.lastId,l,l&&l.id,e,null,new Qy(new Uint8Array(f))),i.integrate(t,0);break;case Xh:i=new Vn(Yt(s,In(a,s)),i,i&&i.lastId,l,l&&l.id,e,null,new ev(f)),i.integrate(t,0);break;default:if(f instanceof zr)i=new Vn(Yt(s,In(a,s)),i,i&&i.lastId,l,l&&l.id,e,null,new La(f)),i.integrate(t,0);else throw new Error("Unexpected content type in insert operation")}}}),d()},KN=()=>ad("Length exceeded!"),qN=(t,e,r,n)=>{if(r>e._length)throw KN();if(r===0)return e._searchMarker&&Rh(e._searchMarker,r,n.length),Pg(t,e,null,n);const i=r,o=Jy(e,r);let s=e._start;for(o!==null&&(s=o.p,r-=o.index,r===0&&(s=s.prev,r+=s&&s.countable&&!s.deleted?s.length:0));s!==null;s=s.right)if(!s.deleted&&s.countable){if(r<=s.length){r<s.length&&_a(t,Yt(s.id.client,s.id.clock+r));break}r-=s.length}return e._searchMarker&&Rh(e._searchMarker,i,n.length),Pg(t,e,s,n)},ZK=(t,e,r)=>{let i=(e._searchMarker||[]).reduce((o,s)=>s.index>o.index?s:o,{index:0,p:e._start}).p;if(i)for(;i.right;)i=i.right;return Pg(t,e,i,r)},XN=(t,e,r,n)=>{if(n===0)return;const i=r,o=n,s=Jy(e,r);let a=e._start;for(s!==null&&(a=s.p,r-=s.index);a!==null&&r>0;a=a.right)!a.deleted&&a.countable&&(r<a.length&&_a(t,Yt(a.id.client,a.id.clock+r)),r-=a.length);for(;n>0&&a!==null;)a.deleted||(n<a.length&&_a(t,Yt(a.id.client,a.id.clock+n)),a.delete(t),n-=a.length),a=a.right;if(n>0)throw KN();e._searchMarker&&Rh(e._searchMarker,i,-o+n)},Lg=(t,e,r)=>{const n=e._map.get(r);n!==void 0&&n.delete(t)},OS=(t,e,r,n)=>{const i=e._map.get(r)||null,o=t.doc,s=o.clientID;let a;if(n==null)a=new cd([n]);else switch(n.constructor){case Number:case Object:case Boolean:case Array:case String:a=new cd([n]);break;case Uint8Array:a=new Qy(n);break;case Xh:a=new ev(n);break;default:if(n instanceof zr)a=new La(n);else throw new Error("Unexpected content type")}new Vn(Yt(s,In(o.store,s)),i,i&&i.lastId,null,null,e,r,a).integrate(t,0)},MS=(t,e)=>{t.doc??Kr();const r=t._map.get(e);return r!==void 0&&!r.deleted?r.content.getContent()[r.length-1]:void 0},YN=t=>{const e={};return t.doc??Kr(),t._map.forEach((r,n)=>{r.deleted||(e[n]=r.content.getContent()[r.length-1])}),e},JN=(t,e)=>{t.doc??Kr();const r=t._map.get(e);return r!==void 0&&!r.deleted},QK=(t,e)=>{const r={};return t._map.forEach((n,i)=>{let o=n;for(;o!==null&&(!e.sv.has(o.id.client)||o.id.clock>=(e.sv.get(o.id.client)||0));)o=o.left;o!==null&&Au(o,e)&&(r[i]=o.content.getContent()[o.length-1])}),r},tm=t=>(t.doc??Kr(),AK(t._map.entries(),e=>!e[1].deleted));class eq extends Yy{}class oh extends zr{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(e){const r=new oh;return r.push(e),r}_integrate(e,r){super._integrate(e,r),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new oh}clone(){const e=new oh;return e.insert(0,this.toArray().map(r=>r instanceof zr?r.clone():r)),e}get length(){return this.doc??Kr(),this._length}_callObserver(e,r){super._callObserver(e,r),Zy(this,e,new eq(this,e))}insert(e,r){this.doc!==null?Xt(this.doc,n=>{qN(n,this,e,r)}):this._prelimContent.splice(e,0,...r)}push(e){this.doc!==null?Xt(this.doc,r=>{ZK(r,this,e)}):this._prelimContent.push(...e)}unshift(e){this.insert(0,e)}delete(e,r=1){this.doc!==null?Xt(this.doc,n=>{XN(n,this,e,r)}):this._prelimContent.splice(e,r)}get(e){return GN(this,e)}toArray(){return WN(this)}slice(e=0,r=this.length){return UN(this,e,r)}toJSON(){return this.map(e=>e instanceof zr?e.toJSON():e)}map(e){return VN(this,e)}forEach(e){Ih(this,e)}[Symbol.iterator](){return JK(this)}_write(e){e.writeTypeRef(uq)}}class tq extends Yy{constructor(e,r,n){super(e,r),this.keysChanged=n}}class Fg extends zr{constructor(e){super(),this._prelimContent=null,e===void 0?this._prelimContent=new Map:this._prelimContent=new Map(e)}_integrate(e,r){super._integrate(e,r),this._prelimContent.forEach((n,i)=>{this.set(i,n)}),this._prelimContent=null}_copy(){return new Fg}clone(){const e=new Fg;return this.forEach((r,n)=>{e.set(n,r instanceof zr?r.clone():r)}),e}_callObserver(e,r){Zy(this,e,new tq(this,e,r))}toJSON(){this.doc??Kr();const e={};return this._map.forEach((r,n)=>{if(!r.deleted){const i=r.content.getContent()[r.length-1];e[n]=i instanceof zr?i.toJSON():i}}),e}get size(){return[...tm(this)].length}keys(){return dw(tm(this),e=>e[0])}values(){return dw(tm(this),e=>e[1].content.getContent()[e[1].length-1])}entries(){return dw(tm(this),e=>[e[0],e[1].content.getContent()[e[1].length-1]])}forEach(e){this.doc??Kr(),this._map.forEach((r,n)=>{r.deleted||e(r.content.getContent()[r.length-1],n,this)})}[Symbol.iterator](){return this.entries()}delete(e){this.doc!==null?Xt(this.doc,r=>{Lg(r,this,e)}):this._prelimContent.delete(e)}set(e,r){return this.doc!==null?Xt(this.doc,n=>{OS(n,this,e,r)}):this._prelimContent.set(e,r),r}get(e){return MS(this,e)}has(e){return JN(this,e)}clear(){this.doc!==null?Xt(this.doc,e=>{this.forEach(function(r,n,i){Lg(e,i,n)})}):this._prelimContent.clear()}_write(e){e.writeTypeRef(dq)}}const ma=(t,e)=>t===e||typeof t=="object"&&typeof e=="object"&&t&&e&&uK(t,e);class Hx{constructor(e,r,n,i){this.left=e,this.right=r,this.index=n,this.currentAttributes=i}forward(){switch(this.right===null&&ka(),this.right.content.constructor){case Tr:this.right.deleted||Td(this.currentAttributes,this.right.content);break;default:this.right.deleted||(this.index+=this.right.length);break}this.left=this.right,this.right=this.right.right}}const QE=(t,e,r)=>{for(;e.right!==null&&r>0;){switch(e.right.content.constructor){case Tr:e.right.deleted||Td(e.currentAttributes,e.right.content);break;default:e.right.deleted||(r<e.right.length&&_a(t,Yt(e.right.id.client,e.right.id.clock+r)),e.index+=e.right.length,r-=e.right.length);break}e.left=e.right,e.right=e.right.right}return e},rm=(t,e,r,n)=>{const i=new Map,o=n?Jy(e,r):null;if(o){const s=new Hx(o.p.left,o.p,o.index,i);return QE(t,s,r-o.index)}else{const s=new Hx(null,e._start,0,i);return QE(t,s,r)}},ZN=(t,e,r,n)=>{for(;r.right!==null&&(r.right.deleted===!0||r.right.content.constructor===Tr&&ma(n.get(r.right.content.key),r.right.content.value));)r.right.deleted||n.delete(r.right.content.key),r.forward();const i=t.doc,o=i.clientID;n.forEach((s,a)=>{const l=r.left,c=r.right,d=new Vn(Yt(o,In(i.store,o)),l,l&&l.lastId,c,c&&c.id,e,null,new Tr(a,s));d.integrate(t,0),r.right=d,r.forward()})},Td=(t,e)=>{const{key:r,value:n}=e;n===null?t.delete(r):t.set(r,n)},QN=(t,e)=>{for(;t.right!==null;){if(!(t.right.deleted||t.right.content.constructor===Tr&&ma(e[t.right.content.key]??null,t.right.content.value)))break;t.forward()}},eD=(t,e,r,n)=>{const i=t.doc,o=i.clientID,s=new Map;for(const a in n){const l=n[a],c=r.currentAttributes.get(a)??null;if(!ma(c,l)){s.set(a,c);const{left:d,right:f}=r;r.right=new Vn(Yt(o,In(i.store,o)),d,d&&d.lastId,f,f&&f.id,e,null,new Tr(a,l)),r.right.integrate(t,0),r.forward()}}return s},pw=(t,e,r,n,i)=>{r.currentAttributes.forEach((p,m)=>{i[m]===void 0&&(i[m]=null)});const o=t.doc,s=o.clientID;QN(r,i);const a=eD(t,e,r,i),l=n.constructor===String?new ps(n):n instanceof zr?new La(n):new Ad(n);let{left:c,right:d,index:f}=r;e._searchMarker&&Rh(e._searchMarker,r.index,l.getLength()),d=new Vn(Yt(s,In(o.store,s)),c,c&&c.lastId,d,d&&d.id,e,null,l),d.integrate(t,0),r.right=d,r.index=f,r.forward(),ZN(t,e,r,a)},eT=(t,e,r,n,i)=>{const o=t.doc,s=o.clientID;QN(r,i);const a=eD(t,e,r,i);e:for(;r.right!==null&&(n>0||a.size>0&&(r.right.deleted||r.right.content.constructor===Tr));){if(!r.right.deleted)switch(r.right.content.constructor){case Tr:{const{key:l,value:c}=r.right.content,d=i[l];if(d!==void 0){if(ma(d,c))a.delete(l);else{if(n===0)break e;a.set(l,c)}r.right.delete(t)}else r.currentAttributes.set(l,c);break}default:n<r.right.length&&_a(t,Yt(r.right.id.client,r.right.id.clock+n)),n-=r.right.length;break}r.forward()}if(n>0){let l="";for(;n>0;n--)l+=`
|
|
262
|
+
`;r.right=new Vn(Yt(s,In(o.store,s)),r.left,r.left&&r.left.lastId,r.right,r.right&&r.right.id,e,null,new ps(l)),r.right.integrate(t,0),r.forward()}ZN(t,e,r,a)},tD=(t,e,r,n,i)=>{let o=e;const s=go();for(;o&&(!o.countable||o.deleted);){if(!o.deleted&&o.content.constructor===Tr){const c=o.content;s.set(c.key,c)}o=o.right}let a=0,l=!1;for(;e!==o;){if(r===e&&(l=!0),!e.deleted){const c=e.content;switch(c.constructor){case Tr:{const{key:d,value:f}=c,p=n.get(d)??null;(s.get(d)!==c||p===f)&&(e.delete(t),a++,!l&&(i.get(d)??null)===f&&p!==f&&(p===null?i.delete(d):i.set(d,p))),!l&&!e.deleted&&Td(i,c);break}}}e=e.right}return a},rq=(t,e)=>{for(;e&&e.right&&(e.right.deleted||!e.right.countable);)e=e.right;const r=new Set;for(;e&&(e.deleted||!e.countable);){if(!e.deleted&&e.content.constructor===Tr){const n=e.content.key;r.has(n)?e.delete(t):r.add(n)}e=e.left}},nq=t=>{let e=0;return Xt(t.doc,r=>{let n=t._start,i=t._start,o=go();const s=Px(o);for(;i;){if(i.deleted===!1)switch(i.content.constructor){case Tr:Td(s,i.content);break;default:e+=tD(r,n,i,o,s),o=Px(s),n=i;break}i=i.right}}),e},iq=t=>{const e=new Set,r=t.doc;for(const[n,i]of t.afterState.entries()){const o=t.beforeState.get(n)||0;i!==o&&BN(t,r.store.clients.get(n),o,i,s=>{!s.deleted&&s.content.constructor===Tr&&s.constructor!==la&&e.add(s.parent)})}Xt(r,n=>{MN(t,t.deleteSet,i=>{if(i instanceof la||!i.parent._hasFormatting||e.has(i.parent))return;const o=i.parent;i.content.constructor===Tr?e.add(o):rq(n,i)});for(const i of e)nq(i)})},tT=(t,e,r)=>{const n=r,i=Px(e.currentAttributes),o=e.right;for(;r>0&&e.right!==null;){if(e.right.deleted===!1)switch(e.right.content.constructor){case La:case Ad:case ps:r<e.right.length&&_a(t,Yt(e.right.id.client,e.right.id.clock+r)),r-=e.right.length,e.right.delete(t);break}e.forward()}o&&tD(t,o,e.right,i,e.currentAttributes);const s=(e.left||e.right).parent;return s._searchMarker&&Rh(s._searchMarker,e.index,-n+r),e};class oq extends Yy{constructor(e,r,n){super(e,r),this.childListChanged=!1,this.keysChanged=new Set,n.forEach(i=>{i===null?this.childListChanged=!0:this.keysChanged.add(i)})}get changes(){if(this._changes===null){const e={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set};this._changes=e}return this._changes}get delta(){if(this._delta===null){const e=this.target.doc,r=[];Xt(e,n=>{const i=new Map,o=new Map;let s=this.target._start,a=null;const l={};let c="",d=0,f=0;const p=()=>{if(a!==null){let m=null;switch(a){case"delete":f>0&&(m={delete:f}),f=0;break;case"insert":(typeof c=="object"||c.length>0)&&(m={insert:c},i.size>0&&(m.attributes={},i.forEach((g,b)=>{g!==null&&(m.attributes[b]=g)}))),c="";break;case"retain":d>0&&(m={retain:d},aK(l)||(m.attributes=iK({},l))),d=0;break}m&&r.push(m),a=null}};for(;s!==null;){switch(s.content.constructor){case La:case Ad:this.adds(s)?this.deletes(s)||(p(),a="insert",c=s.content.getContent()[0],p()):this.deletes(s)?(a!=="delete"&&(p(),a="delete"),f+=1):s.deleted||(a!=="retain"&&(p(),a="retain"),d+=1);break;case ps:this.adds(s)?this.deletes(s)||(a!=="insert"&&(p(),a="insert"),c+=s.content.str):this.deletes(s)?(a!=="delete"&&(p(),a="delete"),f+=s.length):s.deleted||(a!=="retain"&&(p(),a="retain"),d+=s.length);break;case Tr:{const{key:m,value:g}=s.content;if(this.adds(s)){if(!this.deletes(s)){const b=i.get(m)??null;ma(b,g)?g!==null&&s.delete(n):(a==="retain"&&p(),ma(g,o.get(m)??null)?delete l[m]:l[m]=g)}}else if(this.deletes(s)){o.set(m,g);const b=i.get(m)??null;ma(b,g)||(a==="retain"&&p(),l[m]=b)}else if(!s.deleted){o.set(m,g);const b=l[m];b!==void 0&&(ma(b,g)?b!==null&&s.delete(n):(a==="retain"&&p(),g===null?delete l[m]:l[m]=g))}s.deleted||(a==="insert"&&p(),Td(i,s.content));break}}s=s.right}for(p();r.length>0;){const m=r[r.length-1];if(m.retain!==void 0&&m.attributes===void 0)r.pop();else break}}),this._delta=r}return this._delta}}class Oh extends zr{constructor(e){super(),this._pending=e!==void 0?[()=>this.insert(0,e)]:[],this._searchMarker=[],this._hasFormatting=!1}get length(){return this.doc??Kr(),this._length}_integrate(e,r){super._integrate(e,r);try{this._pending.forEach(n=>n())}catch(n){console.error(n)}this._pending=null}_copy(){return new Oh}clone(){const e=new Oh;return e.applyDelta(this.toDelta()),e}_callObserver(e,r){super._callObserver(e,r);const n=new oq(this,e,r);Zy(this,e,n),!e.local&&this._hasFormatting&&(e._needFormattingCleanup=!0)}toString(){this.doc??Kr();let e="",r=this._start;for(;r!==null;)!r.deleted&&r.countable&&r.content.constructor===ps&&(e+=r.content.str),r=r.right;return e}toJSON(){return this.toString()}applyDelta(e,{sanitize:r=!0}={}){this.doc!==null?Xt(this.doc,n=>{const i=new Hx(null,this._start,0,new Map);for(let o=0;o<e.length;o++){const s=e[o];if(s.insert!==void 0){const a=!r&&typeof s.insert=="string"&&o===e.length-1&&i.right===null&&s.insert.slice(-1)===`
|
|
263
|
+
`?s.insert.slice(0,-1):s.insert;(typeof a!="string"||a.length>0)&&pw(n,this,i,a,s.attributes||{})}else s.retain!==void 0?eT(n,this,i,s.retain,s.attributes||{}):s.delete!==void 0&&tT(n,i,s.delete)}}):this._pending.push(()=>this.applyDelta(e))}toDelta(e,r,n){this.doc??Kr();const i=[],o=new Map,s=this.doc;let a="",l=this._start;function c(){if(a.length>0){const f={};let p=!1;o.forEach((g,b)=>{p=!0,f[b]=g});const m={insert:a};p&&(m.attributes=f),i.push(m),a=""}}const d=()=>{for(;l!==null;){if(Au(l,e)||r!==void 0&&Au(l,r))switch(l.content.constructor){case ps:{const f=o.get("ychange");e!==void 0&&!Au(l,e)?(f===void 0||f.user!==l.id.client||f.type!=="removed")&&(c(),o.set("ychange",n?n("removed",l.id):{type:"removed"})):r!==void 0&&!Au(l,r)?(f===void 0||f.user!==l.id.client||f.type!=="added")&&(c(),o.set("ychange",n?n("added",l.id):{type:"added"})):f!==void 0&&(c(),o.delete("ychange")),a+=l.content.str;break}case La:case Ad:{c();const f={insert:l.content.getContent()[0]};if(o.size>0){const p={};f.attributes=p,o.forEach((m,g)=>{p[g]=m})}i.push(f);break}case Tr:Au(l,e)&&(c(),Td(o,l.content));break}l=l.right}c()};return e||r?Xt(s,f=>{e&&Bx(f,e),r&&Bx(f,r),d()},"cleanup"):d(),i}insert(e,r,n){if(r.length<=0)return;const i=this.doc;i!==null?Xt(i,o=>{const s=rm(o,this,e,!n);n||(n={},s.currentAttributes.forEach((a,l)=>{n[l]=a})),pw(o,this,s,r,n)}):this._pending.push(()=>this.insert(e,r,n))}insertEmbed(e,r,n){const i=this.doc;i!==null?Xt(i,o=>{const s=rm(o,this,e,!n);pw(o,this,s,r,n||{})}):this._pending.push(()=>this.insertEmbed(e,r,n||{}))}delete(e,r){if(r===0)return;const n=this.doc;n!==null?Xt(n,i=>{tT(i,rm(i,this,e,!0),r)}):this._pending.push(()=>this.delete(e,r))}format(e,r,n){if(r===0)return;const i=this.doc;i!==null?Xt(i,o=>{const s=rm(o,this,e,!1);s.right!==null&&eT(o,this,s,r,n)}):this._pending.push(()=>this.format(e,r,n))}removeAttribute(e){this.doc!==null?Xt(this.doc,r=>{Lg(r,this,e)}):this._pending.push(()=>this.removeAttribute(e))}setAttribute(e,r){this.doc!==null?Xt(this.doc,n=>{OS(n,this,e,r)}):this._pending.push(()=>this.setAttribute(e,r))}getAttribute(e){return MS(this,e)}getAttributes(){return YN(this)}_write(e){e.writeTypeRef(fq)}}class mw{constructor(e,r=()=>!0){this._filter=r,this._root=e,this._currentNode=e._start,this._firstCall=!0,e.doc??Kr()}[Symbol.iterator](){return this}next(){let e=this._currentNode,r=e&&e.content&&e.content.type;if(e!==null&&(!this._firstCall||e.deleted||!this._filter(r)))do if(r=e.content.type,!e.deleted&&(r.constructor===Mh||r.constructor===ld)&&r._start!==null)e=r._start;else for(;e!==null;)if(e.right!==null){e=e.right;break}else e.parent===this._root?e=null:e=e.parent._item;while(e!==null&&(e.deleted||!this._filter(e.content.type)));return this._firstCall=!1,e===null?{value:void 0,done:!0}:(this._currentNode=e,{value:e.content.type,done:!1})}}class ld extends zr{constructor(){super(),this._prelimContent=[]}get firstChild(){const e=this._first;return e?e.content.getContent()[0]:null}_integrate(e,r){super._integrate(e,r),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new ld}clone(){const e=new ld;return e.insert(0,this.toArray().map(r=>r instanceof zr?r.clone():r)),e}get length(){return this.doc??Kr(),this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(e){return new mw(this,e)}querySelector(e){e=e.toUpperCase();const n=new mw(this,i=>i.nodeName&&i.nodeName.toUpperCase()===e).next();return n.done?null:n.value}querySelectorAll(e){return e=e.toUpperCase(),sd(new mw(this,r=>r.nodeName&&r.nodeName.toUpperCase()===e))}_callObserver(e,r){Zy(this,e,new sq(this,r,e))}toString(){return VN(this,e=>e.toString()).join("")}toJSON(){return this.toString()}toDOM(e=document,r={},n){const i=e.createDocumentFragment();return n!==void 0&&n._createAssociation(i,this),Ih(this,o=>{i.insertBefore(o.toDOM(e,r,n),null)}),i}insert(e,r){this.doc!==null?Xt(this.doc,n=>{qN(n,this,e,r)}):this._prelimContent.splice(e,0,...r)}insertAfter(e,r){if(this.doc!==null)Xt(this.doc,n=>{const i=e&&e instanceof zr?e._item:e;Pg(n,this,i,r)});else{const n=this._prelimContent,i=e===null?0:n.findIndex(o=>o===e)+1;if(i===0&&e!==null)throw ad("Reference item not found");n.splice(i,0,...r)}}delete(e,r=1){this.doc!==null?Xt(this.doc,n=>{XN(n,this,e,r)}):this._prelimContent.splice(e,r)}toArray(){return WN(this)}push(e){this.insert(this.length,e)}unshift(e){this.insert(0,e)}get(e){return GN(this,e)}slice(e=0,r=this.length){return UN(this,e,r)}forEach(e){Ih(this,e)}_write(e){e.writeTypeRef(pq)}}class Mh extends ld{constructor(e="UNDEFINED"){super(),this.nodeName=e,this._prelimAttrs=new Map}get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_integrate(e,r){super._integrate(e,r),this._prelimAttrs.forEach((n,i)=>{this.setAttribute(i,n)}),this._prelimAttrs=null}_copy(){return new Mh(this.nodeName)}clone(){const e=new Mh(this.nodeName),r=this.getAttributes();return sK(r,(n,i)=>{typeof n=="string"&&e.setAttribute(i,n)}),e.insert(0,this.toArray().map(n=>n instanceof zr?n.clone():n)),e}toString(){const e=this.getAttributes(),r=[],n=[];for(const a in e)n.push(a);n.sort();const i=n.length;for(let a=0;a<i;a++){const l=n[a];r.push(l+'="'+e[l]+'"')}const o=this.nodeName.toLocaleLowerCase(),s=r.length>0?" "+r.join(" "):"";return`<${o}${s}>${super.toString()}</${o}>`}removeAttribute(e){this.doc!==null?Xt(this.doc,r=>{Lg(r,this,e)}):this._prelimAttrs.delete(e)}setAttribute(e,r){this.doc!==null?Xt(this.doc,n=>{OS(n,this,e,r)}):this._prelimAttrs.set(e,r)}getAttribute(e){return MS(this,e)}hasAttribute(e){return JN(this,e)}getAttributes(e){return e?QK(this,e):YN(this)}toDOM(e=document,r={},n){const i=e.createElement(this.nodeName),o=this.getAttributes();for(const s in o){const a=o[s];typeof a=="string"&&i.setAttribute(s,a)}return Ih(this,s=>{i.appendChild(s.toDOM(e,r,n))}),n!==void 0&&n._createAssociation(i,this),i}_write(e){e.writeTypeRef(hq),e.writeKey(this.nodeName)}}class sq extends Yy{constructor(e,r,n){super(e,n),this.childListChanged=!1,this.attributesChanged=new Set,r.forEach(i=>{i===null?this.childListChanged=!0:this.attributesChanged.add(i)})}}class Nh extends Oh{get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_copy(){return new Nh}clone(){const e=new Nh;return e.applyDelta(this.toDelta()),e}toDOM(e=document,r,n){const i=e.createTextNode(this.toString());return n!==void 0&&n._createAssociation(i,this),i}toString(){return this.toDelta().map(e=>{const r=[];for(const i in e.attributes){const o=[];for(const s in e.attributes[i])o.push({key:s,value:e.attributes[i][s]});o.sort((s,a)=>s.key<a.key?-1:1),r.push({nodeName:i,attrs:o})}r.sort((i,o)=>i.nodeName<o.nodeName?-1:1);let n="";for(let i=0;i<r.length;i++){const o=r[i];n+=`<${o.nodeName}`;for(let s=0;s<o.attrs.length;s++){const a=o.attrs[s];n+=` ${a.key}="${a.value}"`}n+=">"}n+=e.insert;for(let i=r.length-1;i>=0;i--)n+=`</${r[i].nodeName}>`;return n}).join("")}toJSON(){return this.toString()}_write(e){e.writeTypeRef(mq)}}class rD{constructor(e,r){this.id=e,this.length=r}get deleted(){throw yo()}mergeWith(e){return!1}write(e,r,n){throw yo()}integrate(e,r){throw yo()}}const aq=0;class la extends rD{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor!==e.constructor?!1:(this.length+=e.length,!0)}integrate(e,r){r>0&&(this.id.clock+=r,this.length-=r),jN(e.doc.store,this)}write(e,r){e.writeInfo(aq),e.writeLen(this.length-r)}getMissing(e,r){return null}}class Qy{constructor(e){this.content=e}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new Qy(this.content)}splice(e){throw yo()}mergeWith(e){return!1}integrate(e,r){}delete(e){}gc(e){}write(e,r){e.writeBuf(this.content)}getRef(){return 3}}class jg{constructor(e){this.len=e}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new jg(this.len)}splice(e){const r=new jg(this.len-e);return this.len=e,r}mergeWith(e){return this.len+=e.len,!0}integrate(e,r){PN(e.deleteSet,r.id.client,r.id.clock,this.len),r.markDeleted()}delete(e){}gc(e){}write(e,r){e.writeLen(this.len-r)}getRef(){return 1}}const lq=(t,e)=>new Xh({guid:t,...e,shouldLoad:e.shouldLoad||e.autoLoad||!1});class ev{constructor(e){e._item&&console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid."),this.doc=e;const r={};this.opts=r,e.gc||(r.gc=!1),e.autoLoad&&(r.autoLoad=!0),e.meta!==null&&(r.meta=e.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new ev(lq(this.doc.guid,this.opts))}splice(e){throw yo()}mergeWith(e){return!1}integrate(e,r){this.doc._item=r,e.subdocsAdded.add(this.doc),this.doc.shouldLoad&&e.subdocsLoaded.add(this.doc)}delete(e){e.subdocsAdded.has(this.doc)?e.subdocsAdded.delete(this.doc):e.subdocsRemoved.add(this.doc)}gc(e){}write(e,r){e.writeString(this.doc.guid),e.writeAny(this.opts)}getRef(){return 9}}class Ad{constructor(e){this.embed=e}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new Ad(this.embed)}splice(e){throw yo()}mergeWith(e){return!1}integrate(e,r){}delete(e){}gc(e){}write(e,r){e.writeJSON(this.embed)}getRef(){return 5}}class Tr{constructor(e,r){this.key=e,this.value=r}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new Tr(this.key,this.value)}splice(e){throw yo()}mergeWith(e){return!1}integrate(e,r){const n=r.parent;n._searchMarker=null,n._hasFormatting=!0}delete(e){}gc(e){}write(e,r){e.writeKey(this.key),e.writeJSON(this.value)}getRef(){return 6}}const cq=Ng("node_env")==="development";class cd{constructor(e){this.arr=e,cq&&_N(e)}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new cd(this.arr)}splice(e){const r=new cd(this.arr.slice(e));return this.arr=this.arr.slice(0,e),r}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,r){}delete(e){}gc(e){}write(e,r){const n=this.arr.length;e.writeLen(n-r);for(let i=r;i<n;i++){const o=this.arr[i];e.writeAny(o)}}getRef(){return 8}}class ps{constructor(e){this.str=e}getLength(){return this.str.length}getContent(){return this.str.split("")}isCountable(){return!0}copy(){return new ps(this.str)}splice(e){const r=new ps(this.str.slice(e));this.str=this.str.slice(0,e);const n=this.str.charCodeAt(e-1);return n>=55296&&n<=56319&&(this.str=this.str.slice(0,e-1)+"�",r.str="�"+r.str.slice(1)),r}mergeWith(e){return this.str+=e.str,!0}integrate(e,r){}delete(e){}gc(e){}write(e,r){e.writeString(r===0?this.str:this.str.slice(r))}getRef(){return 4}}const uq=0,dq=1,fq=2,hq=3,pq=4,mq=6;class La{constructor(e){this.type=e}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new La(this.type._copy())}splice(e){throw yo()}mergeWith(e){return!1}integrate(e,r){this.type._integrate(e.doc,r)}delete(e){let r=this.type._start;for(;r!==null;)r.deleted?r.id.clock<(e.beforeState.get(r.id.client)||0)&&e._mergeStructs.push(r):r.delete(e),r=r.right;this.type._map.forEach(n=>{n.deleted?n.id.clock<(e.beforeState.get(n.id.client)||0)&&e._mergeStructs.push(n):n.delete(e)}),e.changed.delete(this.type)}gc(e){let r=this.type._start;for(;r!==null;)r.gc(e,!0),r=r.right;this.type._start=null,this.type._map.forEach(n=>{for(;n!==null;)n.gc(e,!0),n=n.left}),this.type._map=new Map}write(e,r){this.type._write(e)}getRef(){return 7}}const nD=(t,e,r)=>{const{client:n,clock:i}=e.id,o=new Vn(Yt(n,i+r),e,Yt(n,i+r-1),e.right,e.rightOrigin,e.parent,e.parentSub,e.content.splice(r));return e.deleted&&o.markDeleted(),e.keep&&(o.keep=!0),e.redone!==null&&(o.redone=Yt(e.redone.client,e.redone.clock+r)),e.right=o,o.right!==null&&(o.right.left=o),t._mergeStructs.push(o),o.parentSub!==null&&o.right===null&&o.parent._map.set(o.parentSub,o),e.length=r,o};let Vn=class $x extends rD{constructor(e,r,n,i,o,s,a,l){super(e,l.getLength()),this.origin=n,this.left=r,this.right=i,this.rightOrigin=o,this.parent=s,this.parentSub=a,this.redone=null,this.content=l,this.info=this.content.isCountable()?LE:0}set marker(e){(this.info&lw)>0!==e&&(this.info^=lw)}get marker(){return(this.info&lw)>0}get keep(){return(this.info&PE)>0}set keep(e){this.keep!==e&&(this.info^=PE)}get countable(){return(this.info&LE)>0}get deleted(){return(this.info&aw)>0}set deleted(e){this.deleted!==e&&(this.info^=aw)}markDeleted(){this.info|=aw}getMissing(e,r){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=In(r,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=In(r,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===$m&&this.id.client!==this.parent.client&&this.parent.clock>=In(r,this.parent.client))return this.parent.client;if(this.origin&&(this.left=XE(e,r,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=_a(e,this.rightOrigin),this.rightOrigin=this.right.id),this.left&&this.left.constructor===la||this.right&&this.right.constructor===la)this.parent=null;else if(!this.parent)this.left&&this.left.constructor===$x&&(this.parent=this.left.parent,this.parentSub=this.left.parentSub),this.right&&this.right.constructor===$x&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);else if(this.parent.constructor===$m){const n=hw(r,this.parent);n.constructor===la?this.parent=null:this.parent=n.content.type}return null}integrate(e,r){if(r>0&&(this.id.clock+=r,this.left=XE(e,e.doc.store,Yt(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(r),this.length-=r),this.parent){if(!this.left&&(!this.right||this.right.left!==null)||this.left&&this.left.right!==this.right){let n=this.left,i;if(n!==null)i=n.right;else if(this.parentSub!==null)for(i=this.parent._map.get(this.parentSub)||null;i!==null&&i.left!==null;)i=i.left;else i=this.parent._start;const o=new Set,s=new Set;for(;i!==null&&i!==this.right;){if(s.add(i),o.add(i),Qp(this.origin,i.origin)){if(i.id.client<this.id.client)n=i,o.clear();else if(Qp(this.rightOrigin,i.rightOrigin))break}else if(i.origin!==null&&s.has(hw(e.doc.store,i.origin)))o.has(hw(e.doc.store,i.origin))||(n=i,o.clear());else break;i=i.right}this.left=n}if(this.left!==null){const n=this.left.right;this.right=n,this.left.right=this}else{let n;if(this.parentSub!==null)for(n=this.parent._map.get(this.parentSub)||null;n!==null&&n.left!==null;)n=n.left;else n=this.parent._start,this.parent._start=this;this.right=n}this.right!==null?this.right.left=this:this.parentSub!==null&&(this.parent._map.set(this.parentSub,this),this.left!==null&&this.left.delete(e)),this.parentSub===null&&this.countable&&!this.deleted&&(this.parent._length+=this.length),jN(e.doc.store,this),this.content.integrate(e,this),JE(e,this.parent,this.parentSub),(this.parent._item!==null&&this.parent._item.deleted||this.parentSub!==null&&this.right!==null)&&this.delete(e)}else new la(this.id,this.length).integrate(e,0)}get next(){let e=this.right;for(;e!==null&&e.deleted;)e=e.right;return e}get prev(){let e=this.left;for(;e!==null&&e.deleted;)e=e.left;return e}get lastId(){return this.length===1?this.id:Yt(this.id.client,this.id.clock+this.length-1)}mergeWith(e){if(this.constructor===e.constructor&&Qp(e.origin,this.lastId)&&this.right===e&&Qp(this.rightOrigin,e.rightOrigin)&&this.id.client===e.id.client&&this.id.clock+this.length===e.id.clock&&this.deleted===e.deleted&&this.redone===null&&e.redone===null&&this.content.constructor===e.content.constructor&&this.content.mergeWith(e.content)){const r=this.parent._searchMarker;return r&&r.forEach(n=>{n.p===e&&(n.p=this,!this.deleted&&this.countable&&(n.index-=this.length))}),e.keep&&(this.keep=!0),this.right=e.right,this.right!==null&&(this.right.left=this),this.length+=e.length,!0}return!1}delete(e){if(!this.deleted){const r=this.parent;this.countable&&this.parentSub===null&&(r._length-=this.length),this.markDeleted(),PN(e.deleteSet,this.id.client,this.id.clock,this.length),JE(e,r,this.parentSub),this.content.delete(e)}}gc(e,r){if(!this.deleted)throw ka();this.content.gc(e),r?UK(e,this,new la(this.id,this.length)):this.content=new jg(this.length)}write(e,r){const n=r>0?Yt(this.id.client,this.id.clock+r-1):this.origin,i=this.rightOrigin,o=this.parentSub,s=this.content.getRef()&MG|(n===null?0:Mg)|(i===null?0:xN)|(o===null?0:OG);if(e.writeInfo(s),n!==null&&e.writeLeftID(n),i!==null&&e.writeRightID(i),n===null&&i===null){const a=this.parent;if(a._item!==void 0){const l=a._item;if(l===null){const c=Ah(a);e.writeParentInfo(!0),e.writeString(c)}else e.writeParentInfo(!1),e.writeLeftID(l.id)}else a.constructor===String?(e.writeParentInfo(!0),e.writeString(a)):a.constructor===$m?(e.writeParentInfo(!1),e.writeLeftID(a)):ka();o!==null&&e.writeString(o)}this.content.write(e,r)}};const iD=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:{},oD="__ $YJS$ __";iD[oD]===!0&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438");iD[oD]=!0;const gq=new St("y-sync");new St("y-undo");new St("yjs-cursor");const yq=(t,e,r)=>{if(t===0)return fw(e,0,-1);let n=e._first===null?null:e._first.content.type;for(;n!==null&&e!==n;){if(n instanceof Nh){if(n._length>=t)return fw(n,t,-1);if(t-=n._length,n._item!==null&&n._item.next!==null)n=n._item.next.content.type;else{do n=n._item===null?null:n._item.parent,t--;while(n!==e&&n!==null&&n._item!==null&&n._item.next===null);n!==null&&n!==e&&(n=n._item===null?null:n._item.next.content.type)}}else{const i=(r.get(n)||{nodeSize:0}).nodeSize;if(n._first!==null&&t<i)n=n._first.content.type,t--;else{if(t===1&&n._length===0&&i>1)return new Dg(n._item===null?null:n._item.id,n._item===null?Ah(n):null,null);if(t-=i,n._item!==null&&n._item.next!==null)n=n._item.next.content.type;else{if(t===0)return n=n._item===null?n:n._item.parent,new Dg(n._item===null?null:n._item.id,n._item===null?Ah(n):null,null);do n=n._item.parent,t--;while(n!==e&&n._item.next===null);n!==e&&(n=n._item.next.content.type)}}}if(n===null)throw ka();if(t===0&&n.constructor!==Nh&&n!==e)return vq(n._item.parent,n._item)}return fw(e,e._length,-1)},vq=(t,e)=>{let r=null,n=null;return t._item===null?n=Ah(t):r=Yt(t._item.id.client,t._item.id.clock),new Dg(r,n,e.id)};function NS(t,e,r){const n=[],i=t.node(0);r=typeof r=="number"&&r>=0?r:t.sameParent(e)?Math.max(0,t.sharedDepth(e.pos)-1):t.sharedDepth(e.pos);const o=new dh(t,e,r),s=o.depth===0?0:i.resolve(o.start).posAtIndex(0);return o.parent.forEach((a,l)=>{const c=s+l,d=c+a.nodeSize;if(c<o.start||c>=o.end)return;const f=new _1(i.resolve(c),i.resolve(d));n.push(f)}),n}class DS{constructor(e,r){Tn(this,"anchor");Tn(this,"head");this.anchor=e,this.head=r}map(e){return new DS(e.map(this.anchor),e.map(this.head))}resolve(e){const r=e.resolve(this.anchor),n=e.resolve(this.head);return new lo(r,n)}}class lo extends ot{constructor(r,n,i,o=1){const{doc:s}=r,a=r===n,l=r.pos===s.content.size&&n.pos===s.content.size,c=a&&!l?s.resolve(n.pos+(o>0?1:-1)):n,d=a&&l?s.resolve(r.pos-(o>0?1:-1)):r,f=NS(d.min(c),d.max(c),i);super(c.pos>=r.pos?f[0].$from:f[f.length-1].$to,c.pos>=r.pos?f[f.length-1].$to:f[0].$from,f);Tn(this,"depth");this.depth=i}get $to(){return this.ranges[this.ranges.length-1].$to}eq(r){return r instanceof lo&&r.$from.pos===this.$from.pos&&r.$to.pos===this.$to.pos}map(r,n){const i=r.resolve(n.map(this.anchor)),o=r.resolve(n.map(this.head));return new lo(i,o)}toJSON(){return{type:"nodeRange",anchor:this.anchor,head:this.head}}get isForwards(){return this.head>=this.anchor}get isBackwards(){return!this.isForwards}extendBackwards(){const{doc:r}=this.$from;if(this.isForwards&&this.ranges.length>1){const o=this.ranges.slice(0,-1),s=o[0].$from,a=o[o.length-1].$to;return new lo(s,a,this.depth)}const n=this.ranges[0],i=r.resolve(Math.max(0,n.$from.pos-1));return new lo(this.$anchor,i,this.depth)}extendForwards(){const{doc:r}=this.$from;if(this.isBackwards&&this.ranges.length>1){const o=this.ranges.slice(1),s=o[0].$from,a=o[o.length-1].$to;return new lo(a,s,this.depth)}const n=this.ranges[this.ranges.length-1],i=r.resolve(Math.min(r.content.size,n.$to.pos+1));return new lo(this.$anchor,i,this.depth)}static fromJSON(r,n){return new lo(r.resolve(n.anchor),r.resolve(n.head))}static create(r,n,i,o,s=1){return new this(r.resolve(n),r.resolve(i),o,s)}getBookmark(){return new DS(this.anchor,this.head)}}function bq(t){const e=t.cloneNode(!0),r=[t,...Array.from(t.getElementsByTagName("*"))],n=[e,...Array.from(e.getElementsByTagName("*"))];return r.forEach((i,o)=>{n[o].style.cssText=function(s){let a="";const l=getComputedStyle(s);for(let c=0;c<l.length;c+=1)a+=`${l[c]}:${l.getPropertyValue(l[c])};`;return a}(i)}),e}function nm(t,e){return window.getComputedStyle(t)[e]}function wq(t=0,e=0,r=0){return Math.min(Math.max(t,e),r)}function rT(t){t.parentNode!==null&&t.parentNode!==void 0&&t.parentNode.removeChild(t)}const sD=t=>{const{x:e,y:r,direction:n,editor:i}=t;let o=null,s=null,a=null,l=e;for(;s===null&&l<window.innerWidth&&l>0;){const c=document.elementsFromPoint(l,r),d=c.findIndex(p=>p.classList.contains("ProseMirror")),f=c.slice(0,d);if(f.length>0){const p=f[0];if(o=p,a=i.view.posAtDOM(p,0),a>=0){s=i.state.doc.nodeAt(Math.max(a-1,0)),(s===null||s.isText)&&(s=i.state.doc.nodeAt(Math.max(a-1,0))),s||(s=i.state.doc.nodeAt(Math.max(a,0)));break}}n==="left"?l-=1:l+=1}return{resultElement:o,resultNode:s,pos:a!==null?a:null}};function xq(t,e){const{doc:r}=e.view.state,n=sD({editor:e,x:t.clientX,y:t.clientY,direction:"right"});if(!n.resultNode||n.pos===null)return[];const i=t.clientX,o=function(d,f,p){const m=parseInt(nm(d.dom,"paddingLeft"),10),g=parseInt(nm(d.dom,"paddingRight"),10),b=parseInt(nm(d.dom,"borderLeftWidth"),10),S=parseInt(nm(d.dom,"borderLeftWidth"),10),w=d.dom.getBoundingClientRect();return{left:wq(f,w.left+m+b,w.right-g-S),top:p}}(e.view,i,t.clientY),s=e.view.posAtCoords(o);if(!s)return[];const{pos:a}=s;if(!r.resolve(a).parent)return[];const l=r.resolve(n.pos),c=r.resolve(n.pos+1);return NS(l,c,0)}const nT=(t,e)=>{const r=t.resolve(e),{depth:n}=r;return n===0?e:r.pos-r.parentOffset-1},iT=(t,e)=>{const r=t.nodeAt(e),n=t.resolve(e);let{depth:i}=n,o=r;for(;i>0;){const s=n.node(i);i-=1,i===0&&(o=s)}return o},gw=(t,e)=>{const r=gq.getState(t);return r?yq(e,r.type,r.binding.mapping):null},oT=(t,e)=>{let r=e;for(;r&&r.parentNode&&r.parentNode!==t.dom;)r=r.parentNode;return r},aD=new St("dragHandle"),Sq=({pluginKey:t=aD,element:e,editor:r,tippyOptions:n,onNodeChange:i})=>{const o=document.createElement("div");let s=null,a=!1,l=null,c=-1;return e.addEventListener("dragstart",d=>{const{view:f}=r;if(!d.dataTransfer)return;const{empty:p,$from:m,$to:g}=f.state.selection,b=xq(d,r),S=NS(m,g,0),w=S.some(P=>b.find(fe=>fe.$from===P.$from&&fe.$to===P.$to)),T=p||!w?b:S;if(!T.length)return;const{tr:M}=f.state,j=document.createElement("div"),$=T[0].$from.pos,W=T[T.length-1].$to.pos,Y=lo.create(f.state.doc,$,W),ee=Y.content();T.forEach(P=>{const fe=bq(f.nodeDOM(P.$from.pos));j.append(fe)}),j.style.position="absolute",j.style.top="-10000px",document.body.append(j),d.dataTransfer.clearData(),d.dataTransfer.setDragImage(j,0,0),f.dragging={slice:ee,move:!0},M.setSelection(Y),f.dispatch(M),document.addEventListener("drop",()=>rT(j),{once:!0}),setTimeout(()=>{e&&(e.style.pointerEvents="none")},0)}),e.addEventListener("dragend",()=>{e&&(e.style.pointerEvents="auto")}),new _t({key:typeof t=="string"?new St(t):t,state:{init:()=>({locked:!1}),apply(d,f,p,m){const g=d.getMeta("lockDragHandle"),b=d.getMeta("hideDragHandle");if(g!==void 0&&(a=g),b&&s)return s.hide(),a=!1,l=null,c=-1,i==null||i({editor:r,node:null,pos:-1}),f;if(d.docChanged&&c!==-1&&e&&s){const S=d.mapping.map(c);S!==c&&(c=S,gw(m,c))}return f}},view:d=>{var f;return e.draggable=!0,e.style.pointerEvents="auto",(f=r.view.dom.parentElement)===null||f===void 0||f.appendChild(o),o.appendChild(e),o.style.pointerEvents="none",o.style.position="absolute",o.style.top="0",o.style.left="0",s=gd(d.dom,{getReferenceClientRect:null,interactive:!0,trigger:"manual",placement:"left-start",hideOnClick:!1,duration:100,zIndex:10,popperOptions:{modifiers:[{name:"flip",enabled:!1},{name:"preventOverflow",options:{rootBoundary:"document",mainAxis:!1}}]},...n,appendTo:o,content:e}),{update(p,m){if(!e||!s||(e.draggable=!a,d.state.doc.eq(m.doc)||c===-1))return;let g=d.nodeDOM(c);if(g=oT(d,g),g===d.dom||(g==null?void 0:g.nodeType)!==1)return;const b=d.posAtDOM(g,0),S=iT(r.state.doc,b);if(S!==l){const w=nT(r.state.doc,b);l=S,c=w,gw(d.state,c),i==null||i({editor:r,node:l,pos:c}),s.setProps({getReferenceClientRect:()=>g.getBoundingClientRect()}),s.show()}},destroy(){s==null||s.destroy(),e&&rT(o)}}},props:{handleDOMEvents:{mouseleave:(d,f)=>(a||f.target&&!o.contains(f.relatedTarget)&&(s==null||s.hide(),l=null,c=-1,i==null||i({editor:r,node:null,pos:-1})),!1),mousemove(d,f){if(!e||!s||a)return!1;const p=sD({x:f.clientX,y:f.clientY,direction:"right",editor:r});if(!p.resultElement)return!1;let m=p.resultElement;if(m=oT(d,m),m===d.dom||(m==null?void 0:m.nodeType)!==1)return!1;const g=d.posAtDOM(m,0),b=iT(r.state.doc,g);if(b!==l){const S=nT(r.state.doc,g);l=b,c=S,gw(d.state,c),i==null||i({editor:r,node:l,pos:c}),s.setProps({getReferenceClientRect:()=>m.getBoundingClientRect()}),s.show()}return!1}}}})};var Ol=(t=>(t[t.max=7]="max",t[t.min=0]="min",t[t.more=1]="more",t[t.less=-1]="less",t))(Ol||{});function kq(t,e,r){return t<e?e:t>r?r:t}function _q(t,e,r,n){const{doc:i,selection:o}=t;if(!i||!o||!(o instanceof et||o instanceof Gn))return t;const{from:s,to:a}=o;return i.nodesBetween(s,a,(l,c)=>{const d=l.type;return r.includes(d.name)?(t=Ux(t,c,e),!1):!G0(l.type.name,n.extensionManager.extensions)}),t}function Ux(t,e,r){if(!t.doc)return t;const n=t.doc.nodeAt(e);if(!n)return t;const s=kq((n.attrs.indent||0)+r,0,7);if(s===n.attrs.indent)return t;const a={...n.attrs,indent:s};return t.setNodeMarkup(e,n.type,a,n.marks)}function sT({delta:t,types:e}){return({state:r,dispatch:n,editor:i})=>{const{selection:o}=r;let{tr:s}=r;return s=s.setSelection(o),s=_q(s,t,e,i),s.docChanged?(n&&n(s),!0):!1}}function Cq(t){var ee,P,fe;const{pluginKey:e=aD}=t,{t:r}=Ct(),[n,i]=J.useState(null),[o,s]=J.useState(-1),a=J.useRef(null),l=J.useRef(null),[c,d]=J.useState(!1),f=t.editor.extensionManager.extensions.some(de=>de.name==="textAlign"),p=t.editor.extensionManager.extensions.some(de=>de.name==="indent"),m=t.editor.extensionManager.extensions.some(de=>de.name==="clear");J.useEffect(()=>{a.current&&!t.editor.isDestroyed&&(l.current=Sq({editor:t.editor,element:a.current,pluginKey:"ContentItemMenu",tippyOptions:{offset:[-2,16],zIndex:99,moveTransition:"transform 0.15s ease-out"},onNodeChange:$}),t.editor.registerPlugin(l.current))},[t.editor,a]);function g(){const de=t.editor.chain();de.setNodeSelection(o).unsetAllMarks(),(n==null?void 0:n.type.name)!=="paragraph"&&de.setParagraph(),de.run()}function b(){t.editor.chain().focus().setNodeSelection(o).run(),document.execCommand("copy")}function S(){t.editor.commands.setNodeSelection(o);const{$anchor:de}=t.editor.state.selection,U=de.node(1)||t.editor.state.selection.node;t.editor.chain().setMeta("hideDragHandle",!0).insertContentAt(o+((n==null?void 0:n.nodeSize)||0),U.toJSON()).run()}function w(de){t.editor.commands.setTextAlign(de)}function T(){const de=Ux(t.editor.state.tr,o,1);de.setMeta("hideDragHandle",!0),t.editor.view.dispatch&&t.editor.view.dispatch(de)}function M(){const de=Ux(t.editor.state.tr,o,-1);t.editor.view.dispatch&&t.editor.view.dispatch(de)}function j(){t.editor.chain().setMeta("hideDragHandle",!0).setNodeSelection(o).deleteSelection().run()}function $(de){de.node&&i(de.node),s(de.pos)}function W(){var de;if(o!==-1){const U=(n==null?void 0:n.nodeSize)||0,ne=o+U,R=(n==null?void 0:n.type.name)==="paragraph"&&((de=n==null?void 0:n.content)==null?void 0:de.size)===0,le=R?o+2:ne+2;t.editor.chain().command(({dispatch:Ee,tr:he,state:Fe})=>Ee?(R?he.insertText("/",o,o+1):he.insert(ne,Fe.schema.nodes.paragraph.create(null,[Fe.schema.text("/")])),Ee(he)):!0).focus(le).run()}}J.useEffect(()=>(c?t.editor.commands.setMeta("lockDragHandle",!0):t.editor.commands.setMeta("lockDragHandle",!1),()=>{t.editor.commands.setMeta("lockDragHandle",!1)}),[c]),J.useEffect(()=>()=>{l.current&&(t.editor.unregisterPlugin(e),l.current=null)},[]),J.useEffect(()=>{var de;(de=t.editor)!=null&&de.isDestroyed&&l.current&&(t.editor.unregisterPlugin(e),l.current=null)},[(ee=t.editor)==null?void 0:ee.isDestroyed]);const Y=de=>{t!=null&&t.disabled||d(de)};return x.jsx("div",{className:`drag-handle [transition-property:top,_left] richtext-ease-in-out richtext-duration-200 ${t==null?void 0:t.className}`,style:{opacity:t!=null&&t.disabled?0:1},ref:a,children:x.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-0.5 [transition-property:top,_left] richtext-ease-in-out richtext-duration-200",children:[x.jsx(Mt,{variant:"ghost",size:"icon",className:"richtext-w-7 richtext-h-7 richtext-cursor-grab",disabled:t==null?void 0:t.disabled,onClick:W,type:"button",children:x.jsx(Rt,{name:"Plus",className:"richtext-text-lg richtext-text-neutral-600 dark:richtext-text-neutral-200"})}),x.jsxs(Oa,{open:c,onOpenChange:Y,children:[x.jsxs("div",{className:"richtext-relative richtext-flex richtext-flex-col",children:[x.jsxs(Sd,{children:[x.jsx(kd,{asChild:!0,disabled:t==null?void 0:t.disabled,children:x.jsx(Mt,{variant:"ghost",size:"icon",className:"richtext-w-7 richtext-h-7 richtext-cursor-grab richtext-relative richtext-z-[1]",disabled:t==null?void 0:t.disabled,onMouseUp:de=>{de.preventDefault(),!(t!=null&&t.disabled)&&d(!0)},type:"button",children:x.jsx(Rt,{name:"Grip",className:"richtext-text-sm dark:richtext-text-neutral-200 richtext-text-neutral-600"})})}),x.jsx(ac,{children:r("editor.draghandle.tooltip")})]}),x.jsx(Ma,{className:"richtext-absolute richtext-top-0 richtext-left-0 richtext-w-[28px] richtext-h-[28px] richtext-z-0"})]}),x.jsxs(ms,{className:"richtext-w-48",align:"start",side:"bottom",sideOffset:0,children:[x.jsxs(Pi,{onClick:j,className:"richtext-flex richtext-gap-3 focus:richtext-text-red-500 focus:richtext-bg-red-400 hover:richtext-bg-red-400 dark:hover:richtext-text-red-500 richtext-bg-opacity-10 hover:richtext-bg-opacity-20 focus:richtext-bg-opacity-30 dark:hover:richtext-bg-opacity-20",children:[x.jsx(Rt,{name:"Trash2"}),x.jsx("span",{children:r("editor.remove")})]}),m?x.jsxs(Pi,{className:"richtext-flex richtext-gap-3",onClick:g,children:[x.jsx(Rt,{name:"PaintRoller"}),x.jsx("span",{children:r("editor.clear.tooltip")})]}):null,x.jsxs(Pi,{className:"richtext-flex richtext-gap-3",onClick:b,children:[x.jsx(Rt,{name:"Clipboard"}),x.jsx("span",{children:r("editor.copyToClipboard")})]}),x.jsxs(Pi,{className:"richtext-flex richtext-gap-3",onClick:S,children:[x.jsx(Rt,{name:"Copy"}),x.jsx("span",{children:r("editor.copy")})]}),f||p?x.jsx($y,{}):null,f?x.jsxs(JC,{children:[x.jsxs(bx,{className:"richtext-flex richtext-gap-3",children:[x.jsx(Rt,{name:"AlignCenter"}),x.jsx("span",{children:r("editor.textalign.tooltip")})]}),x.jsx(YC,{children:x.jsxs(wx,{children:[x.jsxs(Pi,{className:"richtext-flex richtext-gap-3",onClick:()=>w("left"),children:[x.jsx(Rt,{name:"AlignLeft"}),x.jsx("span",{children:r("editor.textalign.left.tooltip")})]}),x.jsxs(Pi,{className:"richtext-flex richtext-gap-3",onClick:()=>w("center"),children:[x.jsx(Rt,{name:"AlignCenter"}),x.jsx("span",{children:r("editor.textalign.center.tooltip")})]}),x.jsxs(Pi,{className:"richtext-flex richtext-gap-3",onClick:()=>w("right"),children:[x.jsx(Rt,{name:"AlignRight"}),x.jsx("span",{children:r("editor.textalign.right.tooltip")})]})]})})]}):null,p?x.jsxs(JC,{children:[x.jsxs(bx,{className:"richtext-flex richtext-gap-3",children:[x.jsx(Rt,{name:"IndentIncrease"}),x.jsx("span",{children:r("editor.indent")})]}),x.jsx(YC,{children:x.jsxs(wx,{children:[x.jsxs(Pi,{className:"richtext-flex richtext-gap-3",onClick:T,disabled:((P=n==null?void 0:n.attrs)==null?void 0:P.indent)>=Ol.max,children:[x.jsx(Rt,{name:"IndentIncrease"}),x.jsx("span",{children:r("editor.indent.tooltip")})]}),x.jsxs(Pi,{className:"richtext-flex richtext-gap-3",onClick:M,disabled:((fe=n==null?void 0:n.attrs)==null?void 0:fe.indent)<=Ol.min,children:[x.jsx(Rt,{name:"IndentDecrease"}),x.jsx("span",{children:r("editor.outdent.tooltip")})]})]})})]}):null]})]})]})})}const Eq={maxWidth:"auto",zIndex:20,appendTo:"parent",moveTransition:"transform 0.1s ease-out"};function Tq({item:t,disabled:e,editor:r}){var i;const n=t.component;return n?x.jsx(n,{...t.componentProps,editor:r,disabled:e||((i=t==null?void 0:t.componentProps)==null?void 0:i.disabled)}):x.jsx(x.Fragment,{})}function Aq(t){const{t:e,lang:r}=Ct(),n=({editor:o})=>{const{selection:s}=o.view.state,{$from:a,to:l}=s;return a.pos===l?!1:s instanceof et},i=J.useMemo(()=>t.disabled||!(t!=null&&t.editor)?[]:CG(t.editor,e),[t.disabled,t.editor,r,e]);return x.jsx(qn,{shouldShow:n,editor:t==null?void 0:t.editor,tippyOptions:Eq,children:i!=null&&i.length?x.jsx("div",{className:"richtext-w-auto richtext-px-3 richtext-py-2 richtext-transition-all !richtext-border richtext-rounded-sm richtext-shadow-sm richtext-pointer-events-auto richtext-select-none richtext-border-neutral-200 dark:richtext-border-neutral-800 richtext-bg-background",children:x.jsx("div",{className:"richtext-flex richtext-items-center richtext-gap-[4px] richtext-flex-nowrap richtext-whitespace-nowrap richtext-h-[26px] richtext-justify-start richtext-relative",children:i==null?void 0:i.map((o,s)=>(o==null?void 0:o.type)==="divider"?x.jsx(Bi,{orientation:"vertical",className:"!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]"},`bubbleMenu-divider-${s}`):x.jsx(Tq,{item:o,disabled:t.disabled,editor:t.editor},`bubbleMenu-text-${s}`))})}):x.jsx(x.Fragment,{})})}function Rq({fill:t}){return x.jsx("svg",{width:"18px",height:"18px",viewBox:"0 0 256 256",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:x.jsx("g",{id:"icon/填充色",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",children:x.jsxs("g",{id:"icon/背景颜色",children:[x.jsx("g",{id:"编组",fill:"currentColor",children:x.jsxs("g",{transform:"translate(119.502295, 137.878331) rotate(-135.000000) translate(-119.502295, -137.878331) translate(48.002295, 31.757731)",id:"矩形",children:[x.jsx("path",{d:"M100.946943,60.8084699 L43.7469427,60.8084699 C37.2852111,60.8084699 32.0469427,66.0467383 32.0469427,72.5084699 L32.0469427,118.70847 C32.0469427,125.170201 37.2852111,130.40847 43.7469427,130.40847 L100.946943,130.40847 C107.408674,130.40847 112.646943,125.170201 112.646943,118.70847 L112.646943,72.5084699 C112.646943,66.0467383 107.408674,60.8084699 100.946943,60.8084699 Z M93.646,79.808 L93.646,111.408 L51.046,111.408 L51.046,79.808 L93.646,79.808 Z",fillRule:"nonzero"}),x.jsx("path",{d:"M87.9366521,16.90916 L87.9194966,68.2000001 C87.9183543,69.4147389 86.9334998,70.399264 85.7187607,70.4 L56.9423078,70.4 C55.7272813,70.4 54.7423078,69.4150264 54.7423078,68.2 L54.7423078,39.4621057 C54.7423078,37.2523513 55.5736632,35.1234748 57.0711706,33.4985176 L76.4832996,12.4342613 C78.9534987,9.75382857 83.1289108,9.5834005 85.8093436,12.0535996 C87.1658473,13.303709 87.9372691,15.0644715 87.9366521,16.90916 Z",fillRule:"evenodd"}),x.jsx("path",{d:"M131.3,111.241199 L11.7,111.241199 C5.23826843,111.241199 0,116.479467 0,122.941199 L0,200.541199 C0,207.002931 5.23826843,212.241199 11.7,212.241199 L131.3,212.241199 C137.761732,212.241199 143,207.002931 143,200.541199 L143,122.941199 C143,116.479467 137.761732,111.241199 131.3,111.241199 Z M124,130.241 L124,193.241 L19,193.241 L19,130.241 L124,130.241 Z",fillRule:"nonzero"})]})}),x.jsx("path",{d:"M51,218 L205,218 C211.075132,218 216,222.924868 216,229 C216,235.075132 211.075132,240 205,240 L51,240 C44.9248678,240 40,235.075132 40,229 C40,222.924868 44.9248678,218 51,218 Z",id:"矩形",fill:t||"#FBDE28"})]})})})}function lD(t){const[e,r]=J.useState(void 0);function n(s){var a;(a=t.action)==null||a.call(t,s)}function i(){var s;(s=t.action)==null||s.call(t,e)}const o=J.useCallback(Xy(s=>{r(s)},350),[]);return x.jsxs("div",{className:"richtext-flex richtext-items-center richtext-h-[32px]",children:[x.jsx(Ve,{tooltip:t==null?void 0:t.tooltip,disabled:t==null?void 0:t.disabled,action:i,tooltipOptions:t==null?void 0:t.tooltipOptions,shortcutKeys:t==null?void 0:t.shortcutKeys,children:x.jsx("span",{className:"richtext-flex richtext-items-center richtext-justify-center richtext-text-sm",children:x.jsx(Rq,{fill:e})})}),x.jsx(MM,{selectedColor:e,setSelectedColor:o,onChange:n,highlight:!0,disabled:t==null?void 0:t.disabled,children:x.jsx(Mt,{variant:"ghost",size:"icon",className:"!richtext-w-3 !richtext-h-[32px]",disabled:t==null?void 0:t.disabled,children:x.jsx(Rt,{className:"!richtext-w-3 !richtext-h-3 richtext-text-zinc-500",name:"MenuDown"})})})]})}function Iq({editor:t,disabled:e}){var b,S,w,T,M,j,$,W,Y,ee,P,fe,de,U,ne,R,le,Ee;const r=({editor:he})=>qI(he.view.state,"table"),{t:n}=Ct();function i(){t.chain().focus().addColumnBefore().run()}function o(){t.chain().focus().addColumnAfter().run()}function s(){t.chain().focus().deleteColumn().run()}function a(){t.chain().focus().addRowBefore().run()}function l(){t.chain().focus().addRowAfter().run()}function c(){t.chain().focus().deleteRow().run()}function d(){t.chain().focus().mergeCells().run()}function f(){t==null||t.chain().focus().splitCell().run()}function p(){t.chain().focus().deleteTable().run()}function m(he){t.chain().focus().setTableCellBackground(he).run()}const g=()=>{var V;const{view:he,state:{selection:{from:Fe}}}=t,ye=he.domAtPos(Fe).node;if(!ye)return new DOMRect(-1e3,-1e3,0,0);const ze=(V=ye==null?void 0:ye.closest)==null?void 0:V.call(ye,".tableWrapper");return ze?ze.getBoundingClientRect():new DOMRect(-1e3,-1e3,0,0)};return x.jsx(qn,{editor:t,pluginKey:"table",shouldShow:r,updateDelay:0,tippyOptions:{offset:[0,8],popperOptions:{modifiers:[{name:"flip",enabled:!1}]},maxWidth:"auto",getReferenceClientRect:g,plugins:[gd.sticky],sticky:"popper"},children:e?x.jsx(x.Fragment,{}):x.jsxs("div",{className:"richtext-min-w-32 richtext-flex richtext-flex-row richtext-h-full richtext-items-center richtext-leading-none richtext-gap-0.5 richtext-p-2 richtext-w-full richtext-bg-background richtext-rounded-lg richtext-shadow-sm !richtext-border richtext-border-border",children:[x.jsx(Ve,{icon:"BetweenHorizonalEnd",tooltip:n("editor.table.menu.insertColumnBefore"),action:i,"tooltip-options":{sideOffset:15},disabled:!((S=(b=t==null?void 0:t.can())==null?void 0:b.addColumnBefore)!=null&&S.call(b))}),x.jsx(Ve,{icon:"BetweenHorizonalStart",tooltip:n("editor.table.menu.insertColumnAfter"),action:o,"tooltip-options":{sideOffset:15},disabled:!((T=(w=t==null?void 0:t.can())==null?void 0:w.addColumnAfter)!=null&&T.call(w))}),x.jsx(Ve,{icon:"DeleteColumn",action:s,tooltip:n("editor.table.menu.deleteColumn"),"tooltip-options":{sideOffset:15},disabled:!((j=t==null?void 0:(M=t.can()).deleteColumn)!=null&&j.call(M))}),x.jsx(Bi,{orientation:"vertical",className:"!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]"}),x.jsx(Ve,{icon:"BetweenVerticalEnd",action:a,tooltip:n("editor.table.menu.insertRowAbove"),"tooltip-options":{sideOffset:15},disabled:!((W=t==null?void 0:($=t.can()).addRowBefore)!=null&&W.call($))}),x.jsx(Ve,{icon:"BetweenVerticalStart",action:l,tooltip:n("editor.table.menu.insertRowBelow"),"tooltip-options":{sideOffset:15},disabled:!((ee=(Y=t==null?void 0:t.can())==null?void 0:Y.addRowAfter)!=null&&ee.call(Y))}),x.jsx(Ve,{icon:"DeleteRow",action:c,tooltip:n("editor.table.menu.deleteRow"),"tooltip-options":{sideOffset:15},disabled:!((fe=(P=t==null?void 0:t.can())==null?void 0:P.deleteRow)!=null&&fe.call(P))}),x.jsx(Bi,{orientation:"vertical",className:"!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]"}),x.jsx(Ve,{icon:"TableCellsMerge",action:d,tooltip:n("editor.table.menu.mergeCells"),"tooltip-options":{sideOffset:15},disabled:!((U=(de=t==null?void 0:t.can())==null?void 0:de.mergeCells)!=null&&U.call(de))}),x.jsx(Ve,{icon:"TableCellsSplit",action:f,tooltip:n("editor.table.menu.splitCells"),"tooltip-options":{sideOffset:15},disabled:!((R=(ne=t==null?void 0:t.can())==null?void 0:ne.splitCell)!=null&&R.call(ne))}),x.jsx(Bi,{orientation:"vertical",className:"!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]"}),x.jsx(lD,{editor:t,tooltip:n("editor.table.menu.setCellsBgColor"),action:m,tooltipOptions:{sideOffset:15}}),x.jsx(Ve,{icon:"Trash2",tooltip:n("editor.table.menu.deleteTable"),action:p,"tooltip-options":{sideOffset:15},disabled:!((Ee=(le=t==null?void 0:t.can())==null?void 0:le.deleteTable)!=null&&Ee.call(le))})]})})}function cD(t){const{t:e}=Ct(),[r,n]=J.useState({text:"",link:""}),[i,o]=J.useState(!1);J.useEffect(()=>{var a;if(t!=null&&t.editor){const{href:l,target:c}=(a=t.editor)==null?void 0:a.getAttributes("link"),{from:d,to:f}=t.editor.state.selection,p=t.editor.state.doc.textBetween(d,f," ");n({link:l,text:p}),o(c==="_blank")}},[t==null?void 0:t.editor]);function s(a){a.preventDefault(),a.stopPropagation(),t==null||t.onSetLink(r.link,r.text,i)}return x.jsx("div",{className:"richtext-p-2 richtext-bg-white !richtext-border richtext-rounded-lg richtext-shadow-sm dark:richtext-bg-black border-neutral-200 dark:richtext-border-neutral-800",children:x.jsxs("form",{className:"richtext-flex richtext-flex-col richtext-gap-2",onSubmit:s,children:[x.jsx(Kn,{className:"mb-[6px]",children:e("editor.link.dialog.text")}),x.jsx("div",{className:"richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5 richtext-mb-[10px]",children:x.jsx("div",{className:"richtext-relative richtext-items-center richtext-w-full richtext-max-w-sm",children:x.jsx(hn,{type:"text",value:r.text,required:!0,className:"richtext-w-80",placeholder:"Text",onChange:a=>n({...r,text:a.target.value})})})}),x.jsx(Kn,{className:"mb-[6px]",children:e("editor.link.dialog.link")}),x.jsx("div",{className:"richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:x.jsxs("div",{className:"richtext-relative richtext-items-center richtext-w-full richtext-max-w-sm",children:[x.jsx(hn,{type:"url",value:r.link,required:!0,className:"richtext-pl-10",onChange:a=>n({...r,link:a.target.value})}),x.jsx("span",{className:"richtext-absolute richtext-inset-y-0 richtext-flex richtext-items-center richtext-justify-center richtext-px-2 richtext-start-0",children:x.jsx(Rt,{className:"richtext-size-5 richtext-text-muted-foreground",name:"Link"})})]})}),x.jsxs("div",{className:"richtext-flex richtext-items-center richtext-space-x-2",children:[x.jsx(Kn,{children:e("editor.link.dialog.openInNewTab")}),x.jsx(cS,{checked:i,onCheckedChange:a=>{o(a)}})]}),x.jsx(Mt,{type:"submit",className:"richtext-self-end richtext-mt-2",children:e("editor.link.dialog.button.apply")})]})})}function Oq(t){const{t:e}=Ct();return x.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-2 richtext-p-2 richtext-bg-white !richtext-border richtext-rounded-lg richtext-shadow-sm dark:richtext-bg-black richtext-border-neutral-200 dark:richtext-border-neutral-800",children:[x.jsx("a",{href:t==null?void 0:t.link,target:"_blank",rel:"noopener noreferrer",className:"richtext-text-sm richtext-underline richtext-break-all",children:LV(t==null?void 0:t.link,{length:50,omission:"…"})}),(t==null?void 0:t.link)&&x.jsx(Bi,{orientation:"vertical",className:"!richtext-h-4"}),x.jsxs("div",{className:"richtext-flex richtext-flex-nowrap",children:[x.jsx(Ve,{icon:"Pencil",tooltip:e("editor.link.edit.tooltip"),action:()=>{t==null||t.onEdit()},tooltipOptions:{sideOffset:15}}),x.jsx(Ve,{icon:"Unlink",tooltip:e("editor.link.unlink.tooltip"),action:()=>{t==null||t.onClear()},tooltipOptions:{sideOffset:15}})]})]})}function Mq({editor:t,disabled:e}){const[r,n]=J.useState(!1),i=J.useMemo(()=>{const{href:l}=t.getAttributes("link");return l},[t]),o=J.useCallback(({editor:l})=>l.isActive("link"),[]),s=(l,c,d)=>{t.chain().extendMarkRange("link").insertContent({type:"text",text:c,marks:[{type:"link",attrs:{href:l,target:d?"_blank":""}}]}).setLink({href:l}).focus().run(),n(!1)},a=J.useCallback(()=>{t.chain().extendMarkRange("link").unsetLink().focus().run(),n(!1)},[t]);return x.jsx(x.Fragment,{children:x.jsx(qn,{editor:t,shouldShow:o,tippyOptions:{popperOptions:{modifiers:[{name:"flip",enabled:!1}]},placement:"bottom-start",offset:[-2,16],zIndex:9999,onHidden:()=>{n(!1)}},children:e?x.jsx(x.Fragment,{}):x.jsx(x.Fragment,{children:r?x.jsx(cD,{onSetLink:s,editor:t}):x.jsx(Oq,{editor:t,onClear:a,onEdit:()=>{n(!0)},link:i})})})})}const PS={maxWidth:"auto",zIndex:20,appendTo:"parent",moveTransition:"transform 0.1s ease-out"};function LS({item:t,disabled:e,editor:r}){var i;const n=t.component;return n?x.jsx(J.Fragment,{children:t.type==="divider"?x.jsx(Bi,{orientation:"vertical",className:"!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]"}):x.jsx(n,{...t.componentProps,editor:r,disabled:e||((i=t==null?void 0:t.componentProps)==null?void 0:i.disabled)})}):x.jsx(x.Fragment,{})}function Nq(t){return t.type.name==="image"}function Dq(t){return t.type.name===pk.name}function Pq(t){return t.type.name==="video"}function Lq(t){const{lang:e}=Ct(),r=({editor:i})=>{const{selection:o}=i.view.state,{$from:s,to:a}=o;let l=!1;return i.view.state.doc.nodesBetween(s.pos,a,c=>{if(Nq(c))return l=!0,!1}),l},n=J.useMemo(()=>t.disabled?[]:xG(t.editor),[t.disabled,t.editor,e]);return x.jsx(x.Fragment,{children:x.jsx(qn,{shouldShow:r,editor:t==null?void 0:t.editor,tippyOptions:PS,children:n!=null&&n.length?x.jsx("div",{className:"richtext-w-auto richtext-px-3 richtext-py-2 richtext-transition-all !richtext-border richtext-rounded-sm richtext-shadow-sm richtext-pointer-events-auto richtext-select-none richtext-border-neutral-200 dark:richtext-border-neutral-800 richtext-bg-background",children:x.jsx("div",{className:"richtext-flex richtext-items-center richtext-flex-nowrap richtext-whitespace-nowrap richtext-h-[26px] richtext-justify-start richtext-relative",children:n==null?void 0:n.map((i,o)=>x.jsx(LS,{item:i,disabled:t.disabled,editor:t.editor},`bubbleMenu-image-${o}`))})}):x.jsx(x.Fragment,{})})})}function Fq(t){const{lang:e}=Ct(),r=({editor:i})=>{const{selection:o}=i.view.state,{$from:s,to:a}=o;let l=!1;return i.view.state.doc.nodesBetween(s.pos,a,c=>{if(Dq(c))return l=!0,!1}),l},n=J.useMemo(()=>t.disabled?[]:SG(t.editor),[t.disabled,t.editor,e]);return x.jsx(x.Fragment,{children:x.jsx(qn,{shouldShow:r,editor:t==null?void 0:t.editor,tippyOptions:PS,children:n!=null&&n.length?x.jsx("div",{className:"richtext-w-auto richtext-px-3 richtext-py-2 richtext-transition-all !richtext-border richtext-rounded-sm richtext-shadow-sm richtext-pointer-events-auto richtext-select-none richtext-border-neutral-200 dark:richtext-border-neutral-800 richtext-bg-background",children:x.jsx("div",{className:"richtext-flex richtext-items-center richtext-flex-nowrap richtext-whitespace-nowrap richtext-h-[26px] richtext-justify-start richtext-relative",children:n==null?void 0:n.map((i,o)=>x.jsx(LS,{item:i,disabled:t.disabled,editor:t.editor},`bubbleMenu-image-gif-${o}`))})}):x.jsx(x.Fragment,{})})})}function jq(t){const{lang:e}=Ct(),r=({editor:i})=>{const{selection:o}=i.view.state,{$from:s,to:a}=o;let l=!1;return i.view.state.doc.nodesBetween(s.pos,a,c=>{if(Pq(c))return l=!0,!1}),l},n=J.useMemo(()=>t.disabled?[]:_G(t.editor),[t.editor,t.disabled,e]);return x.jsx(x.Fragment,{children:x.jsx(qn,{shouldShow:r,editor:t==null?void 0:t.editor,tippyOptions:PS,children:n!=null&&n.length?x.jsx("div",{className:"richtext-w-auto richtext-px-3 richtext-py-2 richtext-transition-all !richtext-border richtext-rounded-sm richtext-shadow-sm richtext-pointer-events-auto richtext-select-none richtext-border-neutral-200 dark:richtext-border-neutral-800 richtext-bg-background",children:x.jsx("div",{className:"richtext-flex richtext-items-center richtext-flex-nowrap richtext-whitespace-nowrap richtext-h-[26px] richtext-justify-start richtext-relative",children:n==null?void 0:n.map((i,o)=>x.jsx(LS,{item:i,disabled:t.disabled,editor:t.editor},`bubbleMenu-video-${o}`))})}):x.jsx(x.Fragment,{})})})}function Bq({editor:t}){const{t:e}=Ct(),r=J.useCallback(()=>t.isActive(dd.name),[t]),n=J.useCallback(()=>bd(dd.name,t),[t]),i=J.useCallback(()=>t.chain().focus().addColBefore().run(),[t]),o=J.useCallback(()=>t.chain().focus().addColAfter().run(),[t]),s=J.useCallback(()=>t.chain().focus().deleteCol().run(),[t]);return x.jsx(qn,{pluginKey:"columns-bubble-menu",editor:t,shouldShow:r,tippyOptions:{popperOptions:{modifiers:[{name:"flip",enabled:!1}]},placement:"bottom-start",offset:[-2,16],zIndex:9999},children:x.jsxs("div",{className:"richtext-w-auto richtext-px-3 richtext-py-2 richtext-transition-all !richtext-border richtext-rounded-sm richtext-shadow-sm richtext-pointer-events-auto richtext-select-none richtext-border-neutral-200 dark:richtext-border-neutral-800 richtext-bg-background",children:[x.jsx(Ve,{action:i,icon:"ColumnAddLeft",tooltip:e("editor.table.menu.insertColumnBefore")}),x.jsx(Ve,{action:o,icon:"ColumnAddRight",tooltip:e("editor.table.menu.insertColumnAfter")}),x.jsx(Ve,{action:s,icon:"DeleteColumn",tooltip:e("editor.table.menu.deleteColumn")}),x.jsx(Ve,{action:n,icon:"Trash2",tooltip:e("editor.table.menu.delete_column")})]})})}const zq=O4.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,t:r})=>({component:Ve,componentProps:{action:()=>e.commands.toggleBold(),isActive:()=>e.isActive("bold")||!1,disabled:!e.can().toggleBold(),icon:"Bold",shortcutKeys:["mod","B"],tooltip:r("editor.bold.tooltip")}})}}}),Hq=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,$q=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,Uq=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,Wq=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,Vq=Mn.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",lt(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[ql({find:Hq,type:this.type}),ql({find:Uq,type:this.type})]},addPasteRules(){return[xa({find:$q,type:this.type}),xa({find:Wq,type:this.type})]}}),Gq=Vq.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button({editor:e,t:r}){return{component:Ve,componentProps:{action:()=>e.commands.toggleItalic(),isActive:()=>e.isActive("italic")||!1,disabled:!e.can().toggleItalic(),shortcutKeys:["mod","I"],icon:"Italic",tooltip:r("editor.italic.tooltip")}}}}}}),Kq=Mn.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",lt(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()}}}),qq=Kq.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button({editor:e,t:r}){return{component:Ve,componentProps:{action:()=>e.commands.toggleUnderline(),isActive:()=>e.isActive("underline")||!1,disabled:!e.can().toggleUnderline(),icon:"Underline",shortcutKeys:["mod","U"],tooltip:r("editor.underline.tooltip")}}}}}}),Xq=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,Yq=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,Jq=Mn.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",lt(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[ql({find:Xq,type:this.type})]},addPasteRules(){return[xa({find:Yq,type:this.type})]}}),Zq=Jq.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,t:r})=>({component:Ve,componentProps:{action:()=>e.commands.toggleStrike(),isActive:()=>e.isActive("strike")||!1,disabled:!e.can().toggleStrike(),icon:"Strikethrough",shortcutKeys:["shift","mod","X"],tooltip:r("editor.strike.tooltip")}})}}}),Qq=new RegExp("(?<!`)`([^`]+)`(?!`)"),eX=new RegExp("(?<!`)`([^`]+)`(?!`)","g"),tX=Mn.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",lt(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[ql({find:Qq,type:this.type})]},addPasteRules(){return[xa({find:eX,type:this.type})]}}),rX=tX.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,t:r})=>({component:Ve,componentProps:{action:()=>e.commands.toggleCode(),isActive:()=>e.isActive("code")||!1,disabled:!e.can().toggleCode(),icon:"Code",shortcutKeys:["mod","E"],tooltip:r("editor.code.tooltip")}})}}}),nX=/^```([a-z]+)?[\s\n]$/,iX=/^~~~([a-z]+)?[\s\n]$/,oX=Nt.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:r}=this.options,o=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(s=>s.startsWith(r)).map(s=>s.replace(r,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",lt(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,r=e.pos===1;return!t||e.parent.type.name!==this.name?!1:r||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:r}=e,{$from:n,empty:i}=r;if(!i||n.parent.type!==this.type)return!1;const o=n.parentOffset===n.parent.nodeSize-2,s=n.parent.textContent.endsWith(`
|
|
264
|
+
|
|
265
|
+
`);return!o||!s?!1:t.chain().command(({tr:a})=>(a.delete(n.pos-2,n.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:r,doc:n}=e,{$from:i,empty:o}=r;if(!o||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const a=i.after();return a===void 0?!1:n.nodeAt(a)?t.commands.command(({tr:c})=>(c.setSelection(ot.near(n.resolve(a))),!0)):t.commands.exitCode()}}},addInputRules(){return[K0({find:nX,type:this.type,getAttributes:t=>({language:t[1]})}),K0({find:iX,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new _t({key:new St("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const r=e.clipboardData.getData("text/plain"),n=e.clipboardData.getData("vscode-editor-data"),i=n?JSON.parse(n):void 0,o=i==null?void 0:i.mode;if(!r||!o)return!1;const{tr:s,schema:a}=t.state,l=a.text(r.replace(/\r\n?/g,`
|
|
266
|
+
`));return s.replaceSelectionWith(this.type.create({language:o},l)),s.selection.$from.parent.type!==this.type&&s.setSelection(et.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}});let vo,Nf;const yw=new Set,vw=new Set;function sX(){return vo}function aX(t){if(!vo&&!Nf){const e=t.themes.filter(n=>!!n&&n in Kf.bundledThemes),r=t.languages.filter(n=>!!n&&n in Kf.bundledLanguages);return Nf=Kf.createHighlighter({themes:e,langs:r}).then(n=>{vo=n}),Nf}if(Nf)return Nf}async function uD(t){return vo&&!vo.getLoadedThemes().includes(t)&&!vw.has(t)&&t in Kf.bundledThemes?(vw.add(t),await vo.loadTheme(t),vw.delete(t),!0):!1}async function dD(t){return vo&&!vo.getLoadedLanguages().includes(t)&&!yw.has(t)&&t in Kf.bundledLanguages?(yw.add(t),await vo.loadLanguage(t),yw.delete(t),!0):!1}async function lX({doc:t,name:e,defaultTheme:r,defaultLanguage:n}){const i=Qf(t,a=>a.type.name===e),o=[...i.map(a=>a.node.attrs.theme),r],s=[...i.map(a=>a.node.attrs.language),n];vo?await Promise.all([...o.flatMap(a=>uD(a)),...s.flatMap(a=>!!a&&dD(a))]):await aX({languages:s,themes:o})}function aT({doc:t,name:e,defaultTheme:r,defaultLanguage:n}){const i=[];return Qf(t,s=>s.type.name===e).forEach(s=>{let a=s.pos+1,l=s.node.attrs.language||n;const c=s.node.attrs.theme||r,d=sX();if(!d)return;d.getLoadedLanguages().includes(l)||(l="plaintext");const f=d.getLoadedThemes().includes(c)?c:d.getLoadedThemes()[0],p=d.codeToTokensBase(s.node.textContent,{lang:l,theme:f});for(const m of p){for(const g of m){const b=a+g.content.length,S=Qt.inline(a,b,{style:`color: ${g.color}`});i.push(S),a=b}a+=1}}),Tt.create(t,i)}function cX({name:t,defaultLanguage:e,defaultTheme:r}){const n=new _t({key:new St("shiki"),view(i){class o{constructor(){this.initDecorations()}update(){this.checkUndecoratedBlocks()}destroy(){}async initDecorations(){const a=i.state.doc;await lX({doc:a,name:t,defaultLanguage:e,defaultTheme:r});const l=i.state.tr.setMeta("shikiPluginForceDecoration",!0);i.dispatch(l)}async checkUndecoratedBlocks(){const a=Qf(i.state.doc,d=>d.type.name===t);if((await Promise.all(a.flatMap(d=>[uD(d.node.attrs.theme),dD(d.node.attrs.language)]))).includes(!0)){const d=i.state.tr.setMeta("shikiPluginForceDecoration",!0);i.dispatch(d)}}}return new o},state:{init:(i,{doc:o})=>aT({doc:o,name:t,defaultLanguage:e,defaultTheme:r}),apply:(i,o,s,a)=>{const l=s.selection.$head.parent.type.name,c=a.selection.$head.parent.type.name,d=Qf(s.doc,m=>m.type.name===t),f=Qf(a.doc,m=>m.type.name===t),p=i.docChanged&&([l,c].includes(t)||f.length!==d.length||i.steps.some(m=>m.from!==void 0&&m.to!==void 0&&d.some(g=>g.pos>=m.from&&g.pos+g.node.nodeSize<=m.to)));return i.getMeta("shikiPluginForceDecoration")||p?aT({doc:i.doc,name:t,defaultLanguage:e,defaultTheme:r}):o.map(i.mapping,i.doc)}},props:{decorations(i){return n.getState(i)}}});return n}function uX({action:t,languages:e,...r}){const n=o=>{t(o)},i=J.useMemo(()=>e==null?void 0:e.map(o=>({title:qH[o]||o,language:o})),[e]);return x.jsxs(Oa,{children:[x.jsx(Ma,{disabled:r==null?void 0:r.disabled,asChild:!0,children:x.jsx(Ve,{tooltip:r==null?void 0:r.tooltip,disabled:r==null?void 0:r.disabled,icon:r==null?void 0:r.icon})}),x.jsx(ms,{className:"richtext-w-full !richtext-max-h-[180px] !richtext-overflow-y-scroll",children:i==null?void 0:i.map(o=>x.jsx(Pi,{onClick:()=>n(o.language),children:x.jsx("div",{className:"richtext-h-full richtext-ml-1",children:o.title})},`codeblock-${o.title}`))})]})}const dX="_wrap_134f4_1",fX="_maxHeight_134f4_10",hX="_btnCopy_134f4_13",pX="_btnDelete_134f4_14",mX="_blockInfo_134f4_18",gX="_blockInfoEditable_134f4_28",yX="_selectLang_134f4_32",vX="_copied_134f4_58",Zs={wrap:dX,maxHeight:fX,btnCopy:hX,btnDelete:pX,blockInfo:mX,blockInfoEditable:gX,selectLang:yX,"richtext-SelectContent":"_richtext-SelectContent_134f4_46",copied:vX};function bX(){const[t,e]=J.useState(!1);return{isCopied:t,copyToClipboard:async n=>{try{await navigator.clipboard.writeText(n),e(!0),setTimeout(()=>e(!1),2e3)}catch(i){console.error("Failed to copy text: ",i),e(!1)}}}}function wX({editor:t,node:{attrs:e},updateAttributes:r,extension:n}){var p,m;const{isCopied:i,copyToClipboard:o}=bX(),s=J.useMemo(()=>{var g;return(g=n.options.languages)!=null&&g.length?n.options.languages:yM},[n.options.languages]),a=Wy(),l=(m=(p=t==null?void 0:t.options)==null?void 0:p.editorProps)==null?void 0:m.print,{language:c}=e,d=J.useRef(),f=J.useCallback(()=>bd(fD.name,t),[t]);return x.jsxs(gi,{className:Gr(Zs.wrap,!l&&Zs.maxHeight,"render-wrapper"),children:[x.jsxs("div",{className:Gr(Zs.blockInfo,{[Zs.blockInfoEditable]:!a}),children:[x.jsx("span",{onClick:()=>o(d.current.innerText),className:Gr(Zs.btnCopy,i&&Zs.copied),children:i?x.jsx(He.CopyCheck,{size:16}):x.jsx(He.Copy,{size:16})}),x.jsx("span",{onClick:f,className:Zs.btnDelete,children:x.jsx(Rt,{name:"Trash2"})}),x.jsx("div",{className:Zs.selectLang,children:x.jsxs(NH,{defaultValue:c||"auto",disabled:!a,onValueChange:g=>r({language:g}),children:[x.jsx(sM,{children:x.jsx(DH,{placeholder:"Language"})}),x.jsxs(cM,{className:"richtext-max-h-60 richtext-overflow-y-auto",children:[x.jsx(xx,{value:"auto",children:"Auto"}),s.map((g,b)=>x.jsx(xx,{value:g,children:g.charAt(0).toUpperCase()+g.slice(1)},`code-lang-${b}`))]})]})})]}),x.jsx("pre",{ref:d,children:x.jsx(MF,{as:"code"})})]})}const fD=oX.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),languages:[],button:({editor:e,t:r,extension:n})=>{var o,s,a;const i=(s=(o=n==null?void 0:n.options)==null?void 0:o.languages)!=null&&s.length?(a=n==null?void 0:n.options)==null?void 0:a.languages:yM;return{component:uX,componentProps:{action:(l="js")=>e.commands.setCodeBlock({language:l}),isActive:()=>e.isActive("codeBlock")||!1,disabled:!e.can().toggleCodeBlock(),icon:"Code2",tooltip:r("editor.codeblock.tooltip"),languages:i}}}}},addNodeView(){return _o(wX)},addProseMirrorPlugins(){var t;return[...((t=this.parent)==null?void 0:t.call(this))||[],cX({name:this.name,defaultLanguage:null,defaultTheme:this.options.defaultTheme})]}}),xX=Mn.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",lt(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const r=z1(t,this.type);return Object.entries(r).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),SX=yt.create({name:"fontFamily",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:t=>t.style.fontFamily,renderHTML:t=>t.fontFamily?{style:`font-family: ${t.fontFamily}`}:{}}}}]},addCommands(){return{setFontFamily:t=>({chain:e})=>e().setMark("textStyle",{fontFamily:t}).run(),unsetFontFamily:()=>({chain:t})=>t().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}}});function kX(t){var i,o,s;const{t:e,lang:r}=Ct(),n=J.useMemo(()=>{var c;const a=(c=t==null?void 0:t.items)==null?void 0:c.find(d=>d.isActive());return a&&!a.default?{...a}:{title:t.tooltip,font:e("editor.fontFamily.default.tooltip"),isActive:()=>!1,disabled:!1,action:()=>t.editor.chain().focus().unsetFontFamily().run()}},[e,r,t]);return x.jsxs(Oa,{children:[x.jsx(Ma,{disabled:t==null?void 0:t.disabled,asChild:!0,children:x.jsx(U1,{title:((i=n==null?void 0:n.font)==null?void 0:i.length)>7?`${(o=n==null?void 0:n.font)==null?void 0:o.slice(0,6)}...`:n==null?void 0:n.font,tooltip:t==null?void 0:t.tooltip,disabled:t==null?void 0:t.disabled,icon:"MenuDown"})}),x.jsx(ms,{className:"richtext-w-full",children:(s=t==null?void 0:t.items)==null?void 0:s.map((a,l)=>{const c=a.font===e("editor.fontFamily.default.tooltip")?{}:{fontFamily:a.font};return x.jsxs(J.Fragment,{children:[x.jsx(sc,{checked:(n==null?void 0:n.font)===a.font,onClick:a.action,children:x.jsx("div",{className:"richtext-h-full richtext-ml-1",style:c,children:a.font})}),a.font===e("editor.fontFamily.default.tooltip")&&x.jsx($y,{})]},`font-family-${l}`)})})]})}const _X=SX.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),fontFamilyList:KH,button({editor:e,extension:r,t:n}){var c;const{extensions:i=[]}=e.extensionManager??[],o=Sx(((c=r==null?void 0:r.options)==null?void 0:c.fontFamilyList)||[]),s=i.find(d=>d.name==="base-kit"),a=o.map(d=>({action:()=>{e.chain().focus().setFontFamily(d.value).run()},isActive:()=>e.isActive("textStyle",{fontFamily:d.value})||!1,disabled:!e.can().setFontFamily(d.value),title:d.name,font:d.value}));s&&s.options.textStyle!==!1&&a.unshift({action:()=>e.chain().focus().unsetFontFamily().run(),isActive:()=>!1,disabled:!1,font:n("editor.fontFamily.default.tooltip"),title:n("editor.fontFamily.tooltip")});const l=a.filter(d=>d.disabled).length===a.length;return{component:kX,componentProps:{tooltip:n("editor.fontFamily.tooltip"),disabled:l,items:a,editor:e}}}}}}),CX=Nt.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,lt(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>K0({find:new RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});function EX(t){var r;const e=J.useMemo(()=>{var o;const n=(o=t==null?void 0:t.items)==null?void 0:o.find(s=>s.isActive());return n&&!n.default?{...n}:{title:t.tooltip,level:0,isActive:()=>!1}},[t]);return x.jsxs(Oa,{children:[x.jsx(Ma,{disabled:t==null?void 0:t.disabled,asChild:!0,children:x.jsx(U1,{title:e==null?void 0:e.title,tooltip:t==null?void 0:t.tooltip,disabled:t==null?void 0:t.disabled,icon:"MenuDown"})}),x.jsx(ms,{className:"richtext-w-full",children:(r=t==null?void 0:t.items)==null?void 0:r.map((n,i)=>{var o,s;return x.jsxs(J.Fragment,{children:[x.jsxs(sc,{checked:(e==null?void 0:e.title)===n.title,onClick:n.action,children:[x.jsx("div",{className:`richtext-ml-1 richtext-h-full heading-${n.level}`,children:n.title}),!!((o=n==null?void 0:n.shortcutKeys)!=null&&o.length)&&x.jsx(oM,{className:"richtext-pl-4",children:(s=n==null?void 0:n.shortcutKeys)==null?void 0:s.map(a=>Ly(a)).join(" ")})]}),n.level===0&&x.jsx($y,{})]},`heading-k-${i}`)})})]})}const TX=CX.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),levels:[1,2,3,4,5,6],button({editor:e,extension:r,t:n}){var c;const{extensions:i=[]}=e.extensionManager??[],o=((c=r.options)==null?void 0:c.levels)||[],s=i.find(d=>d.name==="base-kit"),a=o.map(d=>({action:()=>e.commands.toggleHeading({level:d}),isActive:()=>e.isActive("heading",{level:d})||!1,disabled:!e.can().toggleHeading({level:d}),title:n(`editor.heading.h${d}.tooltip`),level:d,shortcutKeys:["alt","mod",`${d}`]}));s&&s.options.paragraph!==!1&&a.unshift({action:()=>e.commands.setParagraph(),isActive:()=>e.isActive("paragraph")||!1,disabled:!e.can().setParagraph(),level:0,title:n("editor.paragraph.tooltip"),shortcutKeys:["alt","mod","0"]});const l=a.filter(d=>d.disabled).length===a.length;return{component:EX,componentProps:{tooltip:n("editor.heading.tooltip"),disabled:l,items:a,editor:e}}}}}}),AX=yt.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:"left"}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>{const e=t.style.textAlign||this.options.defaultAlignment;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:t=>t.textAlign===this.options.defaultAlignment?{}:{style:`text-align: ${t.textAlign}`}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.map(r=>e.updateAttributes(r,{textAlign:t})).every(r=>r):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.map(e=>t.resetAttributes(e,"textAlign")).every(e=>e)}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}});function RX(t){var r;const e=J.useMemo(()=>{var o;const n=(o=t==null?void 0:t.items)==null?void 0:o.find(s=>s.isActive());return n&&!n.default?{...n,icon:n.icon?n.icon:t.icon}:{title:t==null?void 0:t.tooltip,icon:t.icon,isActive:()=>!1}},[t]);return x.jsxs(xi,{modal:!0,children:[x.jsx(Si,{disabled:t==null?void 0:t.disabled,asChild:!0,children:x.jsx(Ve,{customClass:"!richtext-w-12 richtext-h-12",icon:t==null?void 0:t.icon,tooltip:t==null?void 0:t.tooltip,disabled:t==null?void 0:t.disabled,children:x.jsx(Rt,{className:"richtext-w-3 richtext-h-3 richtext-ml-1 richtext-text-zinc-500",name:"MenuDown"})})}),x.jsx(Xn,{className:"richtext-min-w-4 richtext-w-full !richtext-p-[4px] richtext-flex richtext-flex-row richtext-gap-1",align:"start",side:"bottom",children:(r=t==null?void 0:t.items)==null?void 0:r.map((n,i)=>{var o,s;return x.jsxs(Sd,{children:[x.jsx(kd,{asChild:!0,children:x.jsx(Gh,{size:"sm",onClick:n==null?void 0:n.action,className:"richtext-p-1 richtext-w-7 richtext-h-7",pressed:e.title===n.title,"data-state":e.title===n.title?"on":"off",children:(n==null?void 0:n.icon)&&x.jsx(Rt,{name:n.icon})})}),x.jsxs(ac,{className:"richtext-flex richtext-flex-col richtext-items-center",children:[x.jsx("span",{children:n.title}),!!((o=n.shortcutKeys)!=null&&o.length)&&x.jsx("span",{children:(s=n.shortcutKeys)==null?void 0:s.map(a=>Ly(a)).join(" ")})]})]},`text-align-${i}`)})})]})}const IX=AX.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),types:["heading","paragraph","list_item","title"],button({editor:e,extension:r,t:n}){var c;const i=((c=r.options)==null?void 0:c.alignments)||[],o={left:["mod","Shift","L"],center:["mod","Shift","E"],right:["mod","Shift","R"],justify:["mod","Shift","J"]},s={left:"AlignLeft",center:"AlignCenter",right:"AlignRight",justify:"AlignJustify"},a=i.map(d=>{var f,p,m;return{title:n(`editor.textalign.${d}.tooltip`),icon:s[d],shortcutKeys:o[d],isActive:()=>e.isActive({textAlign:d})||!1,action:()=>{var g,b;return(b=(g=e.commands)==null?void 0:g.setTextAlign)==null?void 0:b.call(g,d)},disabled:!((m=(p=(f=e==null?void 0:e.can)==null?void 0:f.call(e))==null?void 0:p.setTextAlign)!=null&&m.call(p,d))}}),l=a.filter(d=>d.disabled).length===a.length;return{component:RX,componentProps:{icon:"AlignJustify",tooltip:n("editor.textalign.tooltip"),disabled:l,items:a}}}}}});function OX(t){var n;const{t:e}=Ct(),r=J.useMemo(()=>{const i=(t.items||[]).find(s=>s.isActive());return i||{title:e("editor.fontSize.default.tooltip"),isActive:()=>!1}},[t]);return x.jsxs(Oa,{children:[x.jsx(Ma,{disabled:t==null?void 0:t.disabled,asChild:!0,children:x.jsx(U1,{title:r==null?void 0:r.title,tooltip:`${t==null?void 0:t.tooltip}`,disabled:t==null?void 0:t.disabled,icon:"MenuDown"})}),x.jsx(ms,{className:"richtext-w-32 richtext-overflow-y-auto richtext-max-h-96",children:(n=t==null?void 0:t.items)==null?void 0:n.map((i,o)=>x.jsx(sc,{checked:r.title===i.title,onClick:i.action,children:x.jsx("div",{className:"richtext-h-full richtext-ml-1",children:i.title})},`font-size-${o}`))})]})}const MX=yt.create({name:"fontSize",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),types:["textStyle"],fontSizes:[...XH],button({editor:e,extension:r,t:n}){var l;const i=Sx(((l=r.options)==null?void 0:l.fontSizes)||ZC),o=Sx([ZC])[0],s=i.map(c=>({title:c.value===o.value?n("editor.fontSize.default.tooltip"):String(c.name),isActive:()=>{const{fontSize:d}=e.getAttributes("textStyle");return c.value===o.value&&d===void 0?!0:e.isActive({fontSize:String(c.value)})||!1},action:()=>{if(c.value===o.value){e.commands.unsetFontSize();return}e.commands.setFontSize(String(c.value))},disabled:!e.can().setFontSize(String(c.value)),divider:c.value===o.value||!1,default:c.value===o.value||!1})),a=s.filter(c=>c.disabled).length===s.length;return{component:OX,componentProps:{editor:e,tooltip:n("editor.fontSize.tooltip"),disabled:a,items:s,maxHeight:280}}}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:t=>t.style.fontSize.replaceAll(/["']+/g,""),renderHTML:t=>t.fontSize?{style:`font-size: ${t.fontSize}`}:{}}}}]},addCommands(){return{setFontSize:t=>({chain:e})=>e().setMark("textStyle",{fontSize:t}).run(),unsetFontSize:()=>({chain:t})=>t().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}}),NX=yt.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()}}});function DX({fill:t}){return x.jsx("svg",{width:"18px",height:"18px",viewBox:"0 0 240 240",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:x.jsx("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",children:x.jsx("g",{transform:"translate(0.000000, 0.500000)",children:x.jsxs("g",{transform:"translate(39.000000, 17.353553)",children:[x.jsx("path",{d:"M11,201.146447 L167,201.146447 C173.075132,201.146447 178,206.071314 178,212.146447 C178,218.221579 173.075132,223.146447 167,223.146447 L11,223.146447 C4.92486775,223.146447 7.43989126e-16,218.221579 0,212.146447 C-7.43989126e-16,206.071314 4.92486775,201.146447 11,201.146447 Z",id:"矩形",fill:t||"#DF2A3F",fillRule:"evenodd"}),x.jsx("path",{d:"M72.3425855,16.8295583 C75.799482,7.50883712 86.1577877,2.75526801 95.4785089,6.21216449 C100.284516,7.99463061 104.096358,11.7387855 105.968745,16.4968188 L106.112518,16.8745422 L159.385152,161.694068 C161.291848,166.877345 158.635655,172.624903 153.452378,174.531599 C148.358469,176.405421 142.719567,173.872338 140.716873,168.864661 L140.614848,168.598825 L89.211,28.86 L37.3759214,168.623816 C35.4885354,173.712715 29.8981043,176.351047 24.7909589,174.617647 L24.5226307,174.522368 C19.4337312,172.634982 16.7953993,167.044551 18.5287999,161.937406 L18.6240786,161.669077 L72.3425855,16.8295583 Z",id:"路径-21",fill:"currentColor",fillRule:"nonzero"}),x.jsx("path",{d:"M121,103.146447 C126.522847,103.146447 131,107.623599 131,113.146447 C131,118.575687 126.673329,122.994378 121.279905,123.142605 L121,123.146447 L55,123.146447 C49.4771525,123.146447 45,118.669294 45,113.146447 C45,107.717207 49.3266708,103.298515 54.7200952,103.150288 L55,103.146447 L121,103.146447 Z",id:"路径-22",fill:"currentColor",fillRule:"nonzero"})]})})})})}function PX(t){const[e,r]=J.useState(void 0);function n(s){var a;(a=t.action)==null||a.call(t,s)}function i(){var s;(s=t.action)==null||s.call(t,e)}const o=J.useCallback(Xy(s=>{r(s)},350),[]);return x.jsxs("div",{className:"richtext-flex richtext-items-center richtext-h-[32px]",children:[x.jsx(Ve,{tooltip:t==null?void 0:t.tooltip,disabled:t==null?void 0:t.disabled,action:i,children:x.jsx("span",{className:"richtext-flex richtext-items-center richtext-justify-center richtext-text-sm",children:x.jsx(DX,{fill:e})})}),x.jsx(MM,{selectedColor:e,setSelectedColor:o,onChange:n,disabled:t==null?void 0:t.disabled,colors:t==null?void 0:t.colors,defaultColor:t==null?void 0:t.defaultColor,children:x.jsx(Mt,{variant:"ghost",size:"icon",className:"r!ichtext-h-[32px] !richtext-w-3",disabled:t==null?void 0:t.disabled,children:x.jsx(Rt,{className:"!richtext-w-3 !richtext-h-3 richtext-text-zinc-500",name:"MenuDown"})})})]})}const LX=NX.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button({editor:e,t:r,extension:n}){return{component:PX,componentProps:{colors:n.options.colors,defaultColor:n.options.defaultColor,action:i=>{i===void 0&&e.chain().focus().unsetColor().run(),typeof i=="string"&&e.chain().focus().setColor(i).run()},isActive:()=>{const{color:i}=e.getAttributes("textStyle");return i&&e.isActive({color:i})||!1},editor:e,disabled:!e.can().setColor(""),tooltip:r("editor.color.tooltip")}}}}}}),FX=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,jX=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,BX=Mn.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",lt(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[ql({find:FX,type:this.type})]},addPasteRules(){return[xa({find:jX,type:this.type})]}}),zX=BX.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),multicolor:!0,button:({editor:e,t:r})=>({component:lD,componentProps:{action:n=>{typeof n=="string"&&e.chain().focus().setHighlight({color:n}).run(),n===void 0&&e.chain().focus().unsetHighlight().run()},editor:e,isActive:()=>e.isActive("highlight")||!1,disabled:!e.can().setHighlight(),shortcutKeys:["⇧","mod","H"],tooltip:r("editor.highlight.tooltip")}})}}}),HX="listItem",lT="textStyle",cT=/^\s*([-+*])\s$/,$X=Nt.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",lt(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(HX,this.editor.getAttributes(lT)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=Ju({find:cT,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Ju({find:cT,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(lT),editor:this.editor})),[t]}}),UX=$X.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,t:r})=>({component:Ve,componentProps:{action:()=>e.commands.toggleBulletList(),isActive:()=>e.isActive("bulletList")||!1,disabled:!1,shortcutKeys:["shift","mod","8"],icon:"List",tooltip:r("editor.bulletlist.tooltip")}})}}}),WX=Nt.create({name:"clear",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,t:r})=>({component:Ve,componentProps:{action:()=>e.chain().focus().clearNodes().unsetAllMarks().run(),disabled:!e.can().chain().focus().clearNodes().unsetAllMarks().run(),icon:"Eraser",tooltip:r("editor.clear.tooltip")}})}}}),VX="listItem",uT="textStyle",dT=/^(\d+)\.\s$/,GX=Nt.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:void 0,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...r}=t;return e===1?["ol",lt(this.options.HTMLAttributes,r),0]:["ol",lt(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(VX,this.editor.getAttributes(uT)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=Ju({find:dT,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,r)=>r.childCount+r.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Ju({find:dT,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(uT)}),joinPredicate:(e,r)=>r.childCount+r.attrs.start===+e[1],editor:this.editor})),[t]}}),KX=GX.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,t:r})=>({component:Ve,componentProps:{action:()=>e.commands.toggleOrderedList(),isActive:()=>e.isActive("orderedList")||!1,disabled:!1,icon:"ListOrdered",shortcutKeys:["mod","shift","7"],tooltip:r("editor.orderedlist.tooltip")}})}}}),qX=/^\s*(\[([( |x])?\])\s$/,XX=Nt.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=>{const e=t.getAttribute("data-checked");return e===""||e==="true"},renderHTML:t=>({"data-checked":t.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:t,HTMLAttributes:e}){return["li",lt(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:r,editor:n})=>{const i=document.createElement("li"),o=document.createElement("label"),s=document.createElement("span"),a=document.createElement("input"),l=document.createElement("div");return o.contentEditable="false",a.type="checkbox",a.addEventListener("mousedown",c=>c.preventDefault()),a.addEventListener("change",c=>{if(!n.isEditable&&!this.options.onReadOnlyChecked){a.checked=!a.checked;return}const{checked:d}=c.target;n.isEditable&&typeof r=="function"&&n.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:f})=>{const p=r();if(typeof p!="number")return!1;const m=f.doc.nodeAt(p);return f.setNodeMarkup(p,void 0,{...m==null?void 0:m.attrs,checked:d}),!0}).run(),!n.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,d)||(a.checked=!a.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([c,d])=>{i.setAttribute(c,d)}),i.dataset.checked=t.attrs.checked,t.attrs.checked&&a.setAttribute("checked","checked"),o.append(a,s),i.append(o,l),Object.entries(e).forEach(([c,d])=>{i.setAttribute(c,d)}),{dom:i,contentDOM:l,update:c=>c.type!==this.type?!1:(i.dataset.checked=c.attrs.checked,c.attrs.checked?a.setAttribute("checked","checked"):a.removeAttribute("checked"),!0)}}},addInputRules(){return[Ju({find:qX,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),YX=Nt.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",lt(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()}}}),JX=YX.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),HTMLAttributes:{class:"task-list"},taskItem:{HTMLAttributes:{class:"task-list-item"}},button:({editor:e,t:r})=>({component:Ve,componentProps:{action:()=>e.commands.toggleTaskList(),isActive:()=>e.isActive("taskList")||!1,disabled:!1,icon:"ListTodo",shortcutKeys:["shift","mod","9"],tooltip:r("editor.tasklist.tooltip")}})}},addExtensions(){return[XX.configure(this.options.taskItem)]}}),ZX=/^\s*>\s$/,QX=Nt.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",lt(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Ju({find:ZX,type:this.type})]}}),eY=QX.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),HTMLAttributes:{class:"blockquote"},button:({editor:e,t:r})=>({component:Ve,componentProps:{action:()=>e.commands.toggleBlockquote(),isActive:()=>e.isActive("blockquote")||!1,disabled:!e.can().toggleBlockquote(),icon:"TextQuote",shortcutKeys:["shift","mod","B"],tooltip:r("editor.blockquote.tooltip")}})}}}),tY="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",rY="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",ud=(t,e)=>{for(const r in e)t[r]=e[r];return t},Wx="numeric",Vx="ascii",Gx="alpha",Wm="asciinumeric",im="alphanumeric",Kx="domain",hD="emoji",nY="scheme",iY="slashscheme",fT="whitespace";function oY(t,e){return t in e||(e[t]=[]),e[t]}function Ml(t,e,r){e[Wx]&&(e[Wm]=!0,e[im]=!0),e[Vx]&&(e[Wm]=!0,e[Gx]=!0),e[Wm]&&(e[im]=!0),e[Gx]&&(e[im]=!0),e[im]&&(e[Kx]=!0),e[hD]&&(e[Kx]=!0);for(const n in e){const i=oY(n,r);i.indexOf(t)<0&&i.push(t)}}function sY(t,e){const r={};for(const n in e)e[n].indexOf(t)>=0&&(r[n]=!0);return r}function Rn(t){t===void 0&&(t=null),this.j={},this.jr=[],this.jd=null,this.t=t}Rn.groups={};Rn.prototype={accepts(){return!!this.t},go(t){const e=this,r=e.j[t];if(r)return r;for(let n=0;n<e.jr.length;n++){const i=e.jr[n][0],o=e.jr[n][1];if(o&&i.test(t))return o}return e.jd},has(t,e){return e===void 0&&(e=!1),e?t in this.j:!!this.go(t)},ta(t,e,r,n){for(let i=0;i<t.length;i++)this.tt(t[i],e,r,n)},tr(t,e,r,n){n=n||Rn.groups;let i;return e&&e.j?i=e:(i=new Rn(e),r&&n&&Ml(e,r,n)),this.jr.push([t,i]),i},ts(t,e,r,n){let i=this;const o=t.length;if(!o)return i;for(let s=0;s<o-1;s++)i=i.tt(t[s]);return i.tt(t[o-1],e,r,n)},tt(t,e,r,n){n=n||Rn.groups;const i=this;if(e&&e.j)return i.j[t]=e,e;const o=e;let s,a=i.go(t);if(a?(s=new Rn,ud(s.j,a.j),s.jr.push.apply(s.jr,a.jr),s.jd=a.jd,s.t=a.t):s=new Rn,o){if(n)if(s.t&&typeof s.t=="string"){const l=ud(sY(s.t,n),r);Ml(o,l,n)}else r&&Ml(o,r,n);s.t=o}return i.j[t]=s,s}};const ht=(t,e,r,n,i)=>t.ta(e,r,n,i),ui=(t,e,r,n,i)=>t.tr(e,r,n,i),hT=(t,e,r,n,i)=>t.ts(e,r,n,i),Ge=(t,e,r,n,i)=>t.tt(e,r,n,i),Qo="WORD",qx="UWORD",Dh="LOCALHOST",Xx="TLD",Yx="UTLD",Vm="SCHEME",Ru="SLASH_SCHEME",FS="NUM",pD="WS",jS="NL",sh="OPENBRACE",ah="CLOSEBRACE",Bg="OPENBRACKET",zg="CLOSEBRACKET",Hg="OPENPAREN",$g="CLOSEPAREN",Ug="OPENANGLEBRACKET",Wg="CLOSEANGLEBRACKET",Vg="FULLWIDTHLEFTPAREN",Gg="FULLWIDTHRIGHTPAREN",Kg="LEFTCORNERBRACKET",qg="RIGHTCORNERBRACKET",Xg="LEFTWHITECORNERBRACKET",Yg="RIGHTWHITECORNERBRACKET",Jg="FULLWIDTHLESSTHAN",Zg="FULLWIDTHGREATERTHAN",Qg="AMPERSAND",ey="APOSTROPHE",ty="ASTERISK",oa="AT",ry="BACKSLASH",ny="BACKTICK",iy="CARET",ca="COLON",BS="COMMA",oy="DOLLAR",oo="DOT",sy="EQUALS",zS="EXCLAMATION",so="HYPHEN",ay="PERCENT",ly="PIPE",cy="PLUS",uy="POUND",dy="QUERY",HS="QUOTE",$S="SEMI",ao="SLASH",lh="TILDE",fy="UNDERSCORE",mD="EMOJI",hy="SYM";var gD=Object.freeze({__proto__:null,WORD:Qo,UWORD:qx,LOCALHOST:Dh,TLD:Xx,UTLD:Yx,SCHEME:Vm,SLASH_SCHEME:Ru,NUM:FS,WS:pD,NL:jS,OPENBRACE:sh,CLOSEBRACE:ah,OPENBRACKET:Bg,CLOSEBRACKET:zg,OPENPAREN:Hg,CLOSEPAREN:$g,OPENANGLEBRACKET:Ug,CLOSEANGLEBRACKET:Wg,FULLWIDTHLEFTPAREN:Vg,FULLWIDTHRIGHTPAREN:Gg,LEFTCORNERBRACKET:Kg,RIGHTCORNERBRACKET:qg,LEFTWHITECORNERBRACKET:Xg,RIGHTWHITECORNERBRACKET:Yg,FULLWIDTHLESSTHAN:Jg,FULLWIDTHGREATERTHAN:Zg,AMPERSAND:Qg,APOSTROPHE:ey,ASTERISK:ty,AT:oa,BACKSLASH:ry,BACKTICK:ny,CARET:iy,COLON:ca,COMMA:BS,DOLLAR:oy,DOT:oo,EQUALS:sy,EXCLAMATION:zS,HYPHEN:so,PERCENT:ay,PIPE:ly,PLUS:cy,POUND:uy,QUERY:dy,QUOTE:HS,SEMI:$S,SLASH:ao,TILDE:lh,UNDERSCORE:fy,EMOJI:mD,SYM:hy});const vu=/[a-z]/,bw=new RegExp("\\p{L}","u"),ww=new RegExp("\\p{Emoji}","u"),xw=/\d/,pT=/\s/,mT=`
|
|
267
|
+
`,aY="️",lY="";let om=null,sm=null;function cY(t){t===void 0&&(t=[]);const e={};Rn.groups=e;const r=new Rn;om==null&&(om=gT(tY)),sm==null&&(sm=gT(rY)),Ge(r,"'",ey),Ge(r,"{",sh),Ge(r,"}",ah),Ge(r,"[",Bg),Ge(r,"]",zg),Ge(r,"(",Hg),Ge(r,")",$g),Ge(r,"<",Ug),Ge(r,">",Wg),Ge(r,"(",Vg),Ge(r,")",Gg),Ge(r,"「",Kg),Ge(r,"」",qg),Ge(r,"『",Xg),Ge(r,"』",Yg),Ge(r,"<",Jg),Ge(r,">",Zg),Ge(r,"&",Qg),Ge(r,"*",ty),Ge(r,"@",oa),Ge(r,"`",ny),Ge(r,"^",iy),Ge(r,":",ca),Ge(r,",",BS),Ge(r,"$",oy),Ge(r,".",oo),Ge(r,"=",sy),Ge(r,"!",zS),Ge(r,"-",so),Ge(r,"%",ay),Ge(r,"|",ly),Ge(r,"+",cy),Ge(r,"#",uy),Ge(r,"?",dy),Ge(r,'"',HS),Ge(r,"/",ao),Ge(r,";",$S),Ge(r,"~",lh),Ge(r,"_",fy),Ge(r,"\\",ry);const n=ui(r,xw,FS,{[Wx]:!0});ui(n,xw,n);const i=ui(r,vu,Qo,{[Vx]:!0});ui(i,vu,i);const o=ui(r,bw,qx,{[Gx]:!0});ui(o,vu),ui(o,bw,o);const s=ui(r,pT,pD,{[fT]:!0});Ge(r,mT,jS,{[fT]:!0}),Ge(s,mT),ui(s,pT,s);const a=ui(r,ww,mD,{[hD]:!0});ui(a,ww,a),Ge(a,aY,a);const l=Ge(a,lY);ui(l,ww,a);const c=[[vu,i]],d=[[vu,null],[bw,o]];for(let f=0;f<om.length;f++)Qs(r,om[f],Xx,Qo,c);for(let f=0;f<sm.length;f++)Qs(r,sm[f],Yx,qx,d);Ml(Xx,{tld:!0,ascii:!0},e),Ml(Yx,{utld:!0,alpha:!0},e),Qs(r,"file",Vm,Qo,c),Qs(r,"mailto",Vm,Qo,c),Qs(r,"http",Ru,Qo,c),Qs(r,"https",Ru,Qo,c),Qs(r,"ftp",Ru,Qo,c),Qs(r,"ftps",Ru,Qo,c),Ml(Vm,{scheme:!0,ascii:!0},e),Ml(Ru,{slashscheme:!0,ascii:!0},e),t=t.sort((f,p)=>f[0]>p[0]?1:-1);for(let f=0;f<t.length;f++){const p=t[f][0],g=t[f][1]?{[nY]:!0}:{[iY]:!0};p.indexOf("-")>=0?g[Kx]=!0:vu.test(p)?xw.test(p)?g[Wm]=!0:g[Vx]=!0:g[Wx]=!0,hT(r,p,p,g)}return hT(r,"localhost",Dh,{ascii:!0}),r.jd=new Rn(hy),{start:r,tokens:ud({groups:e},gD)}}function uY(t,e){const r=dY(e.replace(/[A-Z]/g,a=>a.toLowerCase())),n=r.length,i=[];let o=0,s=0;for(;s<n;){let a=t,l=null,c=0,d=null,f=-1,p=-1;for(;s<n&&(l=a.go(r[s]));)a=l,a.accepts()?(f=0,p=0,d=a):f>=0&&(f+=r[s].length,p++),c+=r[s].length,o+=r[s].length,s++;o-=f,s-=p,c-=f,i.push({t:d.t,v:e.slice(o-c,o),s:o-c,e:o})}return i}function dY(t){const e=[],r=t.length;let n=0;for(;n<r;){let i=t.charCodeAt(n),o,s=i<55296||i>56319||n+1===r||(o=t.charCodeAt(n+1))<56320||o>57343?t[n]:t.slice(n,n+2);e.push(s),n+=s.length}return e}function Qs(t,e,r,n,i){let o;const s=e.length;for(let a=0;a<s-1;a++){const l=e[a];t.j[l]?o=t.j[l]:(o=new Rn(n),o.jr=i.slice(),t.j[l]=o),t=o}return o=new Rn(r),o.jr=i.slice(),t.j[e[s-1]]=o,o}function gT(t){const e=[],r=[];let n=0,i="0123456789";for(;n<t.length;){let o=0;for(;i.indexOf(t[n+o])>=0;)o++;if(o>0){e.push(r.join(""));for(let s=parseInt(t.substring(n,n+o),10);s>0;s--)r.pop();n+=o}else r.push(t[n]),n++}return e}const Ph={defaultProtocol:"http",events:null,format:yT,formatHref:yT,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function US(t,e){e===void 0&&(e=null);let r=ud({},Ph);t&&(r=ud(r,t instanceof US?t.o:t));const n=r.ignoreTags,i=[];for(let o=0;o<n.length;o++)i.push(n[o].toUpperCase());this.o=r,e&&(this.defaultRender=e),this.ignoreTags=i}US.prototype={o:Ph,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,r){const n=e!=null;let i=this.o[t];return i&&(typeof i=="object"?(i=r.t in i?i[r.t]:Ph[t],typeof i=="function"&&n&&(i=i(e,r))):typeof i=="function"&&n&&(i=i(e,r.t,r)),i)},getObj(t,e,r){let n=this.o[t];return typeof n=="function"&&e!=null&&(n=n(e,r.t,r)),n},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function yT(t){return t}function yD(t,e){this.t="token",this.v=t,this.tk=e}yD.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),r=t.get("truncate",e,this),n=t.get("format",e,this);return r&&n.length>r?n.substring(0,r)+"…":n},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=Ph.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,r=this.toHref(t.get("defaultProtocol")),n=t.get("formatHref",r,this),i=t.get("tagName",r,e),o=this.toFormattedString(t),s={},a=t.get("className",r,e),l=t.get("target",r,e),c=t.get("rel",r,e),d=t.getObj("attributes",r,e),f=t.getObj("events",r,e);return s.href=n,a&&(s.class=a),l&&(s.target=l),c&&(s.rel=c),d&&ud(s,d),{tagName:i,attributes:s,content:o,eventListeners:f}}};function tv(t,e){class r extends yD{constructor(i,o){super(i,o),this.t=t}}for(const n in e)r.prototype[n]=e[n];return r.t=t,r}const vT=tv("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),bT=tv("text"),fY=tv("nl"),am=tv("url",{isLink:!0,toHref(t){return t===void 0&&(t=Ph.defaultProtocol),this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==Dh&&t[1].t===ca}}),di=t=>new Rn(t);function hY(t){let{groups:e}=t;const r=e.domain.concat([Qg,ty,oa,ry,ny,iy,oy,sy,so,FS,ay,ly,cy,uy,ao,hy,lh,fy]),n=[ey,ca,BS,oo,zS,dy,HS,$S,Ug,Wg,sh,ah,zg,Bg,Hg,$g,Vg,Gg,Kg,qg,Xg,Yg,Jg,Zg],i=[Qg,ey,ty,ry,ny,iy,oy,sy,so,sh,ah,ay,ly,cy,uy,dy,ao,hy,lh,fy],o=di(),s=Ge(o,lh);ht(s,i,s),ht(s,e.domain,s);const a=di(),l=di(),c=di();ht(o,e.domain,a),ht(o,e.scheme,l),ht(o,e.slashscheme,c),ht(a,i,s),ht(a,e.domain,a);const d=Ge(a,oa);Ge(s,oa,d),Ge(l,oa,d),Ge(c,oa,d);const f=Ge(s,oo);ht(f,i,s),ht(f,e.domain,s);const p=di();ht(d,e.domain,p),ht(p,e.domain,p);const m=Ge(p,oo);ht(m,e.domain,p);const g=di(vT);ht(m,e.tld,g),ht(m,e.utld,g),Ge(d,Dh,g);const b=Ge(p,so);ht(b,e.domain,p),ht(g,e.domain,p),Ge(g,oo,m),Ge(g,so,b);const S=Ge(g,ca);ht(S,e.numeric,vT);const w=Ge(a,so),T=Ge(a,oo);ht(w,e.domain,a),ht(T,i,s),ht(T,e.domain,a);const M=di(am);ht(T,e.tld,M),ht(T,e.utld,M),ht(M,e.domain,a),ht(M,i,s),Ge(M,oo,T),Ge(M,so,w),Ge(M,oa,d);const j=Ge(M,ca),$=di(am);ht(j,e.numeric,$);const W=di(am),Y=di();ht(W,r,W),ht(W,n,Y),ht(Y,r,W),ht(Y,n,Y),Ge(M,ao,W),Ge($,ao,W);const ee=Ge(l,ca),P=Ge(c,ca),fe=Ge(P,ao),de=Ge(fe,ao);ht(l,e.domain,a),Ge(l,oo,T),Ge(l,so,w),ht(c,e.domain,a),Ge(c,oo,T),Ge(c,so,w),ht(ee,e.domain,W),Ge(ee,ao,W),ht(de,e.domain,W),ht(de,r,W),Ge(de,ao,W);const U=[[sh,ah],[Bg,zg],[Hg,$g],[Ug,Wg],[Vg,Gg],[Kg,qg],[Xg,Yg],[Jg,Zg]];for(let ne=0;ne<U.length;ne++){const[R,le]=U[ne],Ee=Ge(W,R);Ge(Y,R,Ee),Ge(Ee,le,W);const he=di(am);ht(Ee,r,he);const Fe=di();ht(Ee,n),ht(he,r,he),ht(he,n,Fe),ht(Fe,r,he),ht(Fe,n,Fe),Ge(he,le,W),Ge(Fe,le,W)}return Ge(o,Dh,M),Ge(o,jS,fY),{start:o,tokens:gD}}function pY(t,e,r){let n=r.length,i=0,o=[],s=[];for(;i<n;){let a=t,l=null,c=null,d=0,f=null,p=-1;for(;i<n&&!(l=a.go(r[i].t));)s.push(r[i++]);for(;i<n&&(c=l||a.go(r[i].t));)l=null,a=c,a.accepts()?(p=0,f=a):p>=0&&p++,i++,d++;if(p<0)i-=d,i<n&&(s.push(r[i]),i++);else{s.length>0&&(o.push(Sw(bT,e,s)),s=[]),i-=p,d-=p;const m=f.t,g=r.slice(i-d,i);o.push(Sw(m,e,g))}}return s.length>0&&o.push(Sw(bT,e,s)),o}function Sw(t,e,r){const n=r[0].s,i=r[r.length-1].e,o=e.slice(n,i);return new t(o,r)}const mY=typeof console<"u"&&console&&console.warn||(()=>{}),gY="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",er={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function yY(){Rn.groups={},er.scanner=null,er.parser=null,er.tokenQueue=[],er.pluginQueue=[],er.customSchemes=[],er.initialized=!1}function wT(t,e){if(e===void 0&&(e=!1),er.initialized&&mY(`linkifyjs: already initialized - will not register custom scheme "${t}" ${gY}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
|
|
268
|
+
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
269
|
+
2. Cannot start or end with "-"
|
|
270
|
+
3. "-" cannot repeat`);er.customSchemes.push([t,e])}function vY(){er.scanner=cY(er.customSchemes);for(let t=0;t<er.tokenQueue.length;t++)er.tokenQueue[t][1]({scanner:er.scanner});er.parser=hY(er.scanner.tokens);for(let t=0;t<er.pluginQueue.length;t++)er.pluginQueue[t][1]({scanner:er.scanner,parser:er.parser});er.initialized=!0}function vD(t){return er.initialized||vY(),pY(er.parser.start,t,uY(er.scanner.start,t))}function bD(t,e,r){if(e===void 0&&(e=null),r===void 0&&(r=null),e&&typeof e=="object"){if(r)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);r=e,e=null}const n=new US(r),i=vD(t),o=[];for(let s=0;s<i.length;s++){const a=i[s];a.isLink&&(!e||a.t===e)&&n.check(a)&&o.push(a.toFormattedObject(n))}return o}function bY(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function wY(t){return new _t({key:new St("autolink"),appendTransaction:(e,r,n)=>{const i=e.some(c=>c.docChanged)&&!r.doc.eq(n.doc),o=e.some(c=>c.getMeta("preventAutolink"));if(!i||o)return;const{tr:s}=n,a=j6(r.doc,[...e]);if(V6(a).forEach(({newRange:c})=>{const d=z6(n.doc,c,m=>m.isTextblock);let f,p;if(d.length>1?(f=d[0],p=n.doc.textBetween(f.pos,f.pos+f.node.nodeSize,void 0," ")):d.length&&n.doc.textBetween(c.from,c.to," "," ").endsWith(" ")&&(f=d[0],p=n.doc.textBetween(f.pos,c.to,void 0," ")),f&&p){const m=p.split(" ").filter(w=>w!=="");if(m.length<=0)return!1;const g=m[m.length-1],b=f.pos+p.lastIndexOf(g);if(!g)return!1;const S=vD(g).map(w=>w.toObject(t.defaultProtocol));if(!bY(S))return!1;S.filter(w=>w.isLink).map(w=>({...w,from:b+w.start+1,to:b+w.end+1})).filter(w=>n.schema.marks.code?!n.doc.rangeHasMark(w.from,w.to,n.schema.marks.code):!0).filter(w=>t.validate(w.value)).filter(w=>t.shouldAutoLink(w.value)).forEach(w=>{H1(w.from,w.to,n.doc).some(T=>T.mark.type===t.type)||s.addMark(w.from,w.to,t.type.create({href:w.href}))})}}),!!s.steps.length)return s}})}function xY(t){return new _t({key:new St("handleClickLink"),props:{handleClick:(e,r,n)=>{var i,o;if(n.button!==0||!e.editable)return!1;let s=n.target;const a=[];for(;s.nodeName!=="DIV";)a.push(s),s=s.parentNode;if(!a.find(p=>p.nodeName==="A"))return!1;const l=KI(e.state,t.type.name),c=n.target,d=(i=c==null?void 0:c.href)!==null&&i!==void 0?i:l.href,f=(o=c==null?void 0:c.target)!==null&&o!==void 0?o:l.target;return c&&d?(window.open(d,f),!0):!1}}})}function SY(t){return new _t({key:new St("handlePasteLink"),props:{handlePaste:(e,r,n)=>{const{state:i}=e,{selection:o}=i,{empty:s}=o;if(s)return!1;let a="";n.content.forEach(c=>{a+=c.textContent});const l=bD(a,{defaultProtocol:t.defaultProtocol}).find(c=>c.isLink&&c.value===a);return!a||!l?!1:(t.editor.commands.setMark(t.type,{href:l.href}),!0)}}})}const kY=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function Df(t,e){const r=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(n=>{const i=typeof n=="string"?n:n.scheme;i&&r.push(i)}),!t||t.replace(kY,"").match(new RegExp(`^(?:(?:${r.join("|")}):|[^a-z]|[a-z+.-]+(?:[^a-z+.-:]|$))`,"i"))}const _Y=Mn.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){wT(t);return}wT(t.scheme,t.optionalSlashes)})},onDestroy(){yY()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!Df(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>!!t}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:r=>!!Df(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!Df(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",lt(this.options.HTMLAttributes,t),0]:["a",lt(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[xa({find:t=>{const e=[];if(t){const{protocols:r,defaultProtocol:n}=this.options,i=bD(t).filter(o=>o.isLink&&this.options.isAllowedUri(o.value,{defaultValidate:s=>!!Df(s,r),protocols:r,defaultProtocol:n}));i.length&&i.forEach(o=>e.push({text:o.value,data:{href:o.href},index:o.start}))}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:r}=this.options;return this.options.autolink&&t.push(wY({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:n=>this.options.isAllowedUri(n,{defaultValidate:i=>!!Df(i,e),protocols:e,defaultProtocol:r}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&t.push(xY({type:this.type})),this.options.linkOnPaste&&t.push(SY({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}});function CY(t){const[e,r]=J.useState(!1);function n(i,o,s){t.action&&(t.action({link:i,text:o,openInNewTab:s}),r(!1))}return x.jsxs(xi,{modal:!0,open:e,onOpenChange:r,children:[x.jsx(Si,{disabled:t==null?void 0:t.disabled,asChild:!0,children:x.jsx(Ve,{tooltip:t==null?void 0:t.tooltip,isActive:t==null?void 0:t.isActive,disabled:t==null?void 0:t.disabled,children:x.jsx(Rt,{name:t==null?void 0:t.icon})})}),x.jsx(Xn,{hideWhenDetached:!0,className:"richtext-w-full",align:"start",side:"bottom",children:x.jsx(cD,{editor:t.editor,onSetLink:n})})]})}const EY=_Y.extend({inclusive:!1,parseHTML(){return[{tag:'a[href]:not([data-type="button"]):not([href *= "javascript:" i])'}]},renderHTML({HTMLAttributes:t}){return["a",lt(this.options.HTMLAttributes,t,{class:"link"}),0]},addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),openOnClick:!0,button:({editor:e,t:r})=>({component:CY,componentProps:{editor:e,action:n=>{const{link:i,text:o,openInNewTab:s}=n;e.chain().extendMarkRange("link").insertContent({type:"text",text:o,marks:[{type:"link",attrs:{href:i,target:s?"_blank":""}}]}).setLink({href:i}).focus().run()},id:"linkk",isActive:()=>e.isActive("link")||!1,disabled:!e.can().setLink({href:""}),icon:"Link",tooltip:r("editor.link.tooltip")}})}},addProseMirrorPlugins(){return[new _t({props:{handleClick:(t,e)=>{const{schema:r,doc:n,tr:i}=t.state,o=My(n.resolve(e),r.marks.link);if(!o)return!1;const s=n.resolve(o.from),a=n.resolve(o.to),l=i.setSelection(new et(s,a));t.dispatch(l)}}})]}}),TY=Nt.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",lt(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{const{selection:r}=e,{$from:n,$to:i}=r,o=t();return n.parentOffset===0?o.insertContentAt({from:Math.max(n.pos-1,0),to:i.pos},{type:this.name}):XI(r)?o.insertContentAt(i.pos,{type:this.name}):o.insertContent({type:this.name}),o.command(({tr:s,dispatch:a})=>{var l;if(a){const{$to:c}=s.selection,d=c.end();if(c.nodeAfter)c.nodeAfter.isTextblock?s.setSelection(et.create(s.doc,c.pos+1)):c.nodeAfter.isBlock?s.setSelection(rt.create(s.doc,c.pos)):s.setSelection(et.create(s.doc,c.pos));else{const f=(l=c.parent.type.contentMatch.defaultType)===null||l===void 0?void 0:l.create();f&&(s.insert(d,f),s.setSelection(et.create(s.doc,d+1)))}s.scrollIntoView()}return!0}).run()}}},addInputRules(){return[$h({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),AY=TY.extend({renderHTML(){return["div",lt(this.options.HTMLAttributes,{"data-type":this.name}),["hr"]]},addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,t:r})=>({component:Ve,componentProps:{action:()=>e.commands.setHorizontalRule(),disabled:!e.can().setHorizontalRule(),icon:"Minus",shortcutKeys:["mod","alt","S"],tooltip:r("editor.horizontalrule.tooltip")}})}},addKeyboardShortcuts(){return{"Mod-Alt-s":()=>this.editor.commands.setHorizontalRule()}}});var py=200,Cr=function(){};Cr.prototype.append=function(e){return e.length?(e=Cr.from(e),!this.length&&e||e.length<py&&this.leafAppend(e)||this.length<py&&e.leafPrepend(this)||this.appendInner(e)):this};Cr.prototype.prepend=function(e){return e.length?Cr.from(e).append(this):this};Cr.prototype.appendInner=function(e){return new RY(this,e)};Cr.prototype.slice=function(e,r){return e===void 0&&(e=0),r===void 0&&(r=this.length),e>=r?Cr.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,r))};Cr.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};Cr.prototype.forEach=function(e,r,n){r===void 0&&(r=0),n===void 0&&(n=this.length),r<=n?this.forEachInner(e,r,n,0):this.forEachInvertedInner(e,r,n,0)};Cr.prototype.map=function(e,r,n){r===void 0&&(r=0),n===void 0&&(n=this.length);var i=[];return this.forEach(function(o,s){return i.push(e(o,s))},r,n),i};Cr.from=function(e){return e instanceof Cr?e:e&&e.length?new wD(e):Cr.empty};var wD=function(t){function e(n){t.call(this),this.values=n}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,s,a){for(var l=o;l<s;l++)if(i(this.values[l],a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(i,o,s,a){for(var l=o-1;l>=s;l--)if(i(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=py)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=py)return new e(i.flatten().concat(this.values))},r.length.get=function(){return this.values.length},r.depth.get=function(){return 0},Object.defineProperties(e.prototype,r),e}(Cr);Cr.empty=new wD([]);var RY=function(t){function e(r,n){t.call(this),this.left=r,this.right=n,this.length=r.length+n.length,this.depth=Math.max(r.depth,n.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(n){return n<this.left.length?this.left.get(n):this.right.get(n-this.left.length)},e.prototype.forEachInner=function(n,i,o,s){var a=this.left.length;if(i<a&&this.left.forEachInner(n,i,Math.min(o,a),s)===!1||o>a&&this.right.forEachInner(n,Math.max(i-a,0),Math.min(this.length,o)-a,s+a)===!1)return!1},e.prototype.forEachInvertedInner=function(n,i,o,s){var a=this.left.length;if(i>a&&this.right.forEachInvertedInner(n,i-a,Math.max(o,a)-a,s+a)===!1||o<a&&this.left.forEachInvertedInner(n,Math.min(i,a),o,s)===!1)return!1},e.prototype.sliceInner=function(n,i){if(n==0&&i==this.length)return this;var o=this.left.length;return i<=o?this.left.slice(n,i):n>=o?this.right.slice(n-o,i-o):this.left.slice(n,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(n){var i=this.right.leafAppend(n);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(n){var i=this.left.leafPrepend(n);if(i)return new e(i,this.right)},e.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new e(this.left,new e(this.right,n)):new e(this,n)},e}(Cr);const IY=500;class Fi{constructor(e,r){this.items=e,this.eventCount=r}popEvent(e,r){if(this.eventCount==0)return null;let n=this.items.length;for(;;n--)if(this.items.get(n-1).selection){--n;break}let i,o;r&&(i=this.remapping(n,this.items.length),o=i.maps.length);let s=e.tr,a,l,c=[],d=[];return this.items.forEach((f,p)=>{if(!f.step){i||(i=this.remapping(n,p+1),o=i.maps.length),o--,d.push(f);return}if(i){d.push(new ea(f.map));let m=f.step.map(i.slice(o)),g;m&&s.maybeStep(m).doc&&(g=s.mapping.maps[s.mapping.maps.length-1],c.push(new ea(g,void 0,void 0,c.length+d.length))),o--,g&&i.appendMap(g,o)}else s.maybeStep(f.step);if(f.selection)return a=i?f.selection.map(i.slice(o)):f.selection,l=new Fi(this.items.slice(0,n).append(d.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:s,selection:a}}addTransform(e,r,n,i){let o=[],s=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null;for(let d=0;d<e.steps.length;d++){let f=e.steps[d].invert(e.docs[d]),p=new ea(e.mapping.maps[d],f,r),m;(m=l&&l.merge(p))&&(p=m,d?o.pop():a=a.slice(0,a.length-1)),o.push(p),r&&(s++,r=void 0),i||(l=p)}let c=s-n.depth;return c>MY&&(a=OY(a,c),s-=c),new Fi(a.append(o),s)}remapping(e,r){let n=new Du;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?n.maps.length-i.mirrorOffset:void 0;n.appendMap(i.map,s)},e,r),n}addMaps(e){return this.eventCount==0?this:new Fi(this.items.append(e.map(r=>new ea(r))),this.eventCount)}rebased(e,r){if(!this.eventCount)return this;let n=[],i=Math.max(0,this.items.length-r),o=e.mapping,s=e.steps.length,a=this.eventCount;this.items.forEach(p=>{p.selection&&a--},i);let l=r;this.items.forEach(p=>{let m=o.getMirror(--l);if(m==null)return;s=Math.min(s,m);let g=o.maps[m];if(p.step){let b=e.steps[m].invert(e.docs[m]),S=p.selection&&p.selection.map(o.slice(l+1,m));S&&a++,n.push(new ea(g,b,S))}else n.push(new ea(g))},i);let c=[];for(let p=r;p<s;p++)c.push(new ea(o.maps[p]));let d=this.items.slice(0,i).append(c).append(n),f=new Fi(d,a);return f.emptyItemCount()>IY&&(f=f.compress(this.items.length-n.length)),f}emptyItemCount(){let e=0;return this.items.forEach(r=>{r.step||e++}),e}compress(e=this.items.length){let r=this.remapping(0,e),n=r.maps.length,i=[],o=0;return this.items.forEach((s,a)=>{if(a>=e)i.push(s),s.selection&&o++;else if(s.step){let l=s.step.map(r.slice(n)),c=l&&l.getMap();if(n--,c&&r.appendMap(c,n),l){let d=s.selection&&s.selection.map(r.slice(n));d&&o++;let f=new ea(c.invert(),l,d),p,m=i.length-1;(p=i.length&&i[m].merge(f))?i[m]=p:i.push(f)}}else s.map&&n--},this.items.length,0),new Fi(Cr.from(i.reverse()),o)}}Fi.empty=new Fi(Cr.empty,0);function OY(t,e){let r;return t.forEach((n,i)=>{if(n.selection&&e--==0)return r=i,!1}),t.slice(r)}let ea=class xD{constructor(e,r,n,i){this.map=e,this.step=r,this.selection=n,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let r=e.step.merge(this.step);if(r)return new xD(r.getMap().invert(),r,this.selection)}}};class sa{constructor(e,r,n,i,o){this.done=e,this.undone=r,this.prevRanges=n,this.prevTime=i,this.prevComposition=o}}const MY=20;function NY(t,e,r,n){let i=r.getMeta($l),o;if(i)return i.historyState;r.getMeta(LY)&&(t=new sa(t.done,t.undone,null,0,-1));let s=r.getMeta("appendedTransaction");if(r.steps.length==0)return t;if(s&&s.getMeta($l))return s.getMeta($l).redo?new sa(t.done.addTransform(r,void 0,n,Gm(e)),t.undone,xT(r.mapping.maps),t.prevTime,t.prevComposition):new sa(t.done,t.undone.addTransform(r,void 0,n,Gm(e)),null,t.prevTime,t.prevComposition);if(r.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=r.getMeta("composition"),l=t.prevTime==0||!s&&t.prevComposition!=a&&(t.prevTime<(r.time||0)-n.newGroupDelay||!DY(r,t.prevRanges)),c=s?kw(t.prevRanges,r.mapping):xT(r.mapping.maps);return new sa(t.done.addTransform(r,l?e.selection.getBookmark():void 0,n,Gm(e)),Fi.empty,c,r.time,a??t.prevComposition)}else return(o=r.getMeta("rebased"))?new sa(t.done.rebased(r,o),t.undone.rebased(r,o),kw(t.prevRanges,r.mapping),t.prevTime,t.prevComposition):new sa(t.done.addMaps(r.mapping.maps),t.undone.addMaps(r.mapping.maps),kw(t.prevRanges,r.mapping),t.prevTime,t.prevComposition)}function DY(t,e){if(!e)return!1;if(!t.docChanged)return!0;let r=!1;return t.mapping.maps[0].forEach((n,i)=>{for(let o=0;o<e.length;o+=2)n<=e[o+1]&&i>=e[o]&&(r=!0)}),r}function xT(t){let e=[];for(let r=t.length-1;r>=0&&e.length==0;r--)t[r].forEach((n,i,o,s)=>e.push(o,s));return e}function kw(t,e){if(!t)return null;let r=[];for(let n=0;n<t.length;n+=2){let i=e.map(t[n],1),o=e.map(t[n+1],-1);i<=o&&r.push(i,o)}return r}function PY(t,e,r){let n=Gm(e),i=$l.get(e).spec.config,o=(r?t.undone:t.done).popEvent(e,n);if(!o)return null;let s=o.selection.resolve(o.transform.doc),a=(r?t.done:t.undone).addTransform(o.transform,e.selection.getBookmark(),i,n),l=new sa(r?a:o.remaining,r?o.remaining:a,null,0,-1);return o.transform.setSelection(s).setMeta($l,{redo:r,historyState:l})}let _w=!1,ST=null;function Gm(t){let e=t.plugins;if(ST!=e){_w=!1,ST=e;for(let r=0;r<e.length;r++)if(e[r].spec.historyPreserveItems){_w=!0;break}}return _w}const $l=new St("history"),LY=new St("closeHistory");function FY(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new _t({key:$l,state:{init(){return new sa(Fi.empty,Fi.empty,null,0,-1)},apply(e,r,n){return NY(r,n,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,r){let n=r.inputType,i=n=="historyUndo"?kD:n=="historyRedo"?_D:null;return i?(r.preventDefault(),i(e.state,e.dispatch)):!1}}}})}function SD(t,e){return(r,n)=>{let i=$l.getState(r);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(n){let o=PY(i,r,t);o&&n(e?o.scrollIntoView():o)}return!0}}const kD=SD(!1,!0),_D=SD(!0,!0),jY=yt.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>kD(t,e),redo:()=>({state:t,dispatch:e})=>_D(t,e)}},addProseMirrorPlugins(){return[FY(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}});function BY(t){var c;const{icon:e=void 0,tooltip:r=void 0,customClass:n="",tooltipOptions:i={},action:o=void 0,isActive:s=void 0,children:a}=t,l=Kh[e];return x.jsxs(Sd,{children:[x.jsx(kd,{asChild:!0,children:x.jsxs(Gh,{size:"sm",className:`richtext-w-[32px] richtext-h-[32px] ${n}`,disabled:s==null?void 0:s(),onClick:o,children:[l&&x.jsx(l,{className:"richtext-w-4 richtext-h-4"}),a&&x.jsx(x.Fragment,{children:a})]})}),r&&x.jsx(ac,{...i,children:x.jsxs("div",{className:"richtext-flex richtext-flex-col richtext-items-center richtext-text-center richtext-max-w-24",children:[x.jsx("div",{children:r}),!!((c=t==null?void 0:t.shortcutKeys)!=null&&c.length)&&x.jsx("span",{children:Fy(t==null?void 0:t.shortcutKeys)})]})})]})}const zY=["undo","redo"],HY=jY.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),depth:100,newGroupDelay:500,button:({editor:e,t:r})=>zY.map(n=>({component:BY,componentProps:{action:()=>{n==="undo"&&e.chain().focus().undo().run(),n==="redo"&&e.chain().focus().redo().run()},shortcutKeys:n==="undo"?["mod","Z"]:["shift","mod","Z"],disabled:n==="undo"?!e.can().undo():!e.can().redo(),isActive:()=>n==="undo"?!e.can().undo():!e.can().redo(),icon:n==="undo"?"Undo2":"Redo2",tooltip:r(`editor.${n}.tooltip`)}}))}}}),$Y=yt.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc;if(((t==null?void 0:t.mode)||this.options.mode)==="textSize"){const n=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(n)}return e.nodeSize},this.storage.words=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc,r=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(r)}},addProseMirrorPlugins(){let t=!1;return[new _t({key:new St("characterCount"),appendTransaction:(e,r,n)=>{if(t)return;const i=this.options.limit;if(i==null||i===0){t=!0;return}const o=this.storage.characters({node:n.doc});if(o>i){const s=o-i,a=0,l=s;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);const c=n.tr.deleteRange(a,l);return t=!0,c}t=!0},filterTransaction:(e,r)=>{const n=this.options.limit;if(!e.docChanged||n===0||n===null||n===void 0)return!0;const i=this.storage.characters({node:r.doc}),o=this.storage.characters({node:e.doc});if(o<=n||i>n&&o>n&&o<=i)return!0;if(i>n&&o>n&&o>i||!e.getMeta("paste"))return!1;const a=e.selection.$head.pos,l=o-n,c=a-l,d=a;return e.deleteRange(c,d),!(this.storage.characters({node:e.doc})>n)}})]}});function UY(t={}){return new _t({view(e){return new WY(e,t)}})}class WY{constructor(e,r){var n;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(n=r.width)!==null&&n!==void 0?n:1,this.color=r.color===!1?void 0:r.color||"black",this.class=r.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let o=s=>{this[i](s)};return e.dom.addEventListener(i,o),{name:i,handler:o}})}destroy(){this.handlers.forEach(({name:e,handler:r})=>this.editorView.dom.removeEventListener(e,r))}update(e,r){this.cursorPos!=null&&r.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),r=!e.parent.inlineContent,n;if(r){let a=e.nodeBefore,l=e.nodeAfter;if(a||l){let c=this.editorView.nodeDOM(this.cursorPos-(a?a.nodeSize:0));if(c){let d=c.getBoundingClientRect(),f=a?d.bottom:d.top;a&&l&&(f=(f+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),n={left:d.left,right:d.right,top:f-this.width/2,bottom:f+this.width/2}}}}if(!n){let a=this.editorView.coordsAtPos(this.cursorPos);n={left:a.left-this.width/2,right:a.left+this.width/2,top:a.top,bottom:a.bottom}}let i=this.editorView.dom.offsetParent;this.element||(this.element=i.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",r),this.element.classList.toggle("prosemirror-dropcursor-inline",!r);let o,s;if(!i||i==document.body&&getComputedStyle(i).position=="static")o=-pageXOffset,s=-pageYOffset;else{let a=i.getBoundingClientRect();o=a.left-i.scrollLeft,s=a.top-i.scrollTop}this.element.style.left=n.left-o+"px",this.element.style.top=n.top-s+"px",this.element.style.width=n.right-n.left+"px",this.element.style.height=n.bottom-n.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let r=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=r&&r.inside>=0&&this.editorView.state.doc.nodeAt(r.inside),i=n&&n.type.spec.disableDropCursor,o=typeof i=="function"?i(this.editorView,r,e):i;if(r&&!o){let s=r.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=WR(this.editorView.state.doc,s,this.editorView.dragging.slice);a!=null&&(s=a)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}const VY=yt.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[UY(this.options)]}}),GY=yt.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new _t({key:new St("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:r,isFocused:n}=this.editor,{anchor:i}=e,o=[];if(!r||!n)return Tt.create(t,[]);let s=0;this.options.mode==="deepest"&&t.descendants((l,c)=>{if(l.isText)return;if(!(i>=c&&i<=c+l.nodeSize-1))return!1;s+=1});let a=0;return t.descendants((l,c)=>{if(l.isText||!(i>=c&&i<=c+l.nodeSize-1))return!1;if(a+=1,this.options.mode==="deepest"&&s-a>0||this.options.mode==="shallowest"&&a>1)return this.options.mode==="deepest";o.push(Qt.node(c,c+l.nodeSize,{class:this.options.className}))}),Tt.create(t,o)}}})]}});class ir extends ot{constructor(e){super(e,e)}map(e,r){let n=e.resolve(r.map(this.head));return ir.valid(n)?new ir(n):ot.near(n)}content(){return qe.empty}eq(e){return e instanceof ir&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,r){if(typeof r.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new ir(e.resolve(r.pos))}getBookmark(){return new WS(this.anchor)}static valid(e){let r=e.parent;if(r.isTextblock||!KY(e)||!qY(e))return!1;let n=r.type.spec.allowGapCursor;if(n!=null)return n;let i=r.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,r,n=!1){e:for(;;){if(!n&&ir.valid(e))return e;let i=e.pos,o=null;for(let s=e.depth;;s--){let a=e.node(s);if(r>0?e.indexAfter(s)<a.childCount:e.index(s)>0){o=a.child(r>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;i+=r;let l=e.doc.resolve(i);if(ir.valid(l))return l}for(;;){let s=r>0?o.firstChild:o.lastChild;if(!s){if(o.isAtom&&!o.isText&&!rt.isSelectable(o)){e=e.doc.resolve(i+o.nodeSize*r),n=!1;continue e}break}o=s,i+=r;let a=e.doc.resolve(i);if(ir.valid(a))return a}return null}}}ir.prototype.visible=!1;ir.findFrom=ir.findGapCursorFrom;ot.jsonID("gapcursor",ir);class WS{constructor(e){this.pos=e}map(e){return new WS(e.map(this.pos))}resolve(e){let r=e.resolve(this.pos);return ir.valid(r)?new ir(r):ot.near(r)}}function KY(t){for(let e=t.depth;e>=0;e--){let r=t.index(e),n=t.node(e);if(r==0){if(n.type.spec.isolating)return!0;continue}for(let i=n.child(r-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function qY(t){for(let e=t.depth;e>=0;e--){let r=t.indexAfter(e),n=t.node(e);if(r==n.childCount){if(n.type.spec.isolating)return!0;continue}for(let i=n.child(r);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function XY(){return new _t({props:{decorations:QY,createSelectionBetween(t,e,r){return e.pos==r.pos&&ir.valid(r)?new ir(r):null},handleClick:JY,handleKeyDown:YY,handleDOMEvents:{beforeinput:ZY}}})}const YY=D1({ArrowLeft:lm("horiz",-1),ArrowRight:lm("horiz",1),ArrowUp:lm("vert",-1),ArrowDown:lm("vert",1)});function lm(t,e){const r=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(n,i,o){let s=n.selection,a=e>0?s.$to:s.$from,l=s.empty;if(s instanceof et){if(!o.endOfTextblock(r)||a.depth==0)return!1;l=!1,a=n.doc.resolve(e>0?a.after():a.before())}let c=ir.findGapCursorFrom(a,e,l);return c?(i&&i(n.tr.setSelection(new ir(c))),!0):!1}}function JY(t,e,r){if(!t||!t.editable)return!1;let n=t.state.doc.resolve(e);if(!ir.valid(n))return!1;let i=t.posAtCoords({left:r.clientX,top:r.clientY});return i&&i.inside>-1&&rt.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new ir(n))),!0)}function ZY(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof ir))return!1;let{$from:r}=t.state.selection,n=r.parent.contentMatchAt(r.index()).findWrapping(t.state.schema.nodes.text);if(!n)return!1;let i=Le.empty;for(let s=n.length-1;s>=0;s--)i=Le.from(n[s].createAndFill(null,i));let o=t.state.tr.replace(r.pos,r.pos,new qe(i,0,0));return o.setSelection(et.near(o.doc.resolve(r.pos+1))),t.dispatch(o),!1}function QY(t){if(!(t.selection instanceof ir))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Tt.create(t.doc,[Qt.widget(t.selection.head,e,{key:"gapcursor"})])}const eJ=yt.create({name:"gapCursor",addProseMirrorPlugins(){return[XY()]},extendNodeSchema(t){var e;const r={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=dt(Ze(t,"allowGapCursor",r)))!==null&&e!==void 0?e:null}}}),tJ=Nt.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",lt(this.options.HTMLAttributes,t)]},renderText(){return`
|
|
271
|
+
`},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:r,editor:n})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:i,storedMarks:o}=r;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:a}=n.extensionManager,l=o||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:d})=>{if(d&&l&&s){const f=l.filter(p=>a.includes(p.type.name));c.ensureMarks(f)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),rJ=Nt.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",lt(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),nJ=Nt.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",lt(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),iJ=yt.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new _t({key:new St("placeholder"),props:{decorations:({doc:t,selection:e})=>{const r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:n}=e,i=[];if(!r)return null;const o=this.editor.isEmpty;return t.descendants((s,a)=>{const l=n>=a&&n<=a+s.nodeSize,c=!s.isLeaf&&Py(s);if((l||!this.options.showOnlyCurrent)&&c){const d=[this.options.emptyNodeClass];o&&d.push(this.options.emptyEditorClass);const f=Qt.node(a,a+s.nodeSize,{class:d.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:s,pos:a,hasAnchor:l}):this.options.placeholder});i.push(f)}return this.options.includeChildren}),Tt.create(t,i)}}})]}}),oJ=Nt.create({name:"text",group:"inline"}),sJ=Nt.create({name:"doc",topNode:!0,content:"block+"}),aJ=sJ.extend({content:"(block|columns)+"});function lJ(t,e,r=null){return r?t.createChecked({index:e},r):t.createAndFill({index:e})}function cJ(t){if(t.cached.columnsNodeTypes)return t.cached.columnsNodeTypes;const e={columns:t.nodes.columns,column:t.nodes.column};return t.cached.columnsNodeTypes=e,e}function uJ(t,e,r=null){const n=cJ(t),i=[];for(let o=0;o<e;o+=1){const s=lJ(n.column,o,r);s&&i.push(s)}return n.columns.createChecked({cols:e},i)}function Cw({state:t,dispatch:e,type:r}){const n=Kl(o=>o.type.name===dd.name)(t.selection),i=Kl(o=>o.type.name===rv.name)(t.selection);if(e&&n&&i){const o=n.node,s=i.node.attrs.index,a=o.toJSON();let l=s;r==="delete"?(l=s-1,a.content.splice(s,1)):(l=r==="addBefore"?s:s+1,a.content.splice(l,0,{type:"column",attrs:{index:s},content:[{type:"paragraph"}]})),a.attrs.cols=a.content.length,a.content.forEach((p,m)=>{p.attrs.index=m});const c=ls.fromJSON(t.schema,a);let d=n.pos;c.content.forEach((p,m,g)=>{g<l&&(d+=p.nodeSize)});const f=t.tr.setTime(Date.now());f.replaceWith(n.pos,n.pos+n.node.nodeSize,c).setSelection(et.near(f.doc.resolve(d))),e(f)}return!0}function kT({state:t,dispatch:e,type:r}){const n=Kl(o=>o.type.name===dd.name)(t.selection),i=Kl(o=>o.type.name===rv.name)(t.selection);if(e&&n&&i){const o=n.node,s=i.node.attrs.index;let a=0;r==="before"?a=(s-1+o.attrs.cols)%o.attrs.cols:a=(s+1)%o.attrs.cols;let l=n.pos;o.content.forEach((d,f,p)=>{p<a&&(l+=d.nodeSize)});const c=t.tr.setTime(Date.now());return c.setSelection(et.near(c.doc.resolve(l))),e(c),!0}return!1}const dJ=200,dd=Nt.create({name:"columns",group:"block",defining:!0,isolating:!0,allowGapCursor:!1,content:"column{1,}",priority:dJ,addOptions(){return{HTMLAttributes:{class:"columns"}}},addAttributes(){return{cols:{default:2,parseHTML:t=>t.getAttribute("cols")}}},parseHTML(){return[{tag:"div[class=grid]"}]},renderHTML({HTMLAttributes:t}){return["div",lt(this.options.HTMLAttributes,t),0]},addCommands(){return{insertColumns:t=>({tr:e,dispatch:r,editor:n})=>{const i=uJ(n.schema,t&&t.cols||3);if(r){const o=e.selection.anchor+1;e.replaceSelectionWith(i).scrollIntoView().setSelection(et.near(e.doc.resolve(o)))}return!0},addColBefore:()=>({dispatch:t,state:e})=>Cw({dispatch:t,state:e,type:"addBefore"}),addColAfter:()=>({dispatch:t,state:e})=>Cw({dispatch:t,state:e,type:"addAfter"}),deleteCol:()=>({dispatch:t,state:e})=>Cw({dispatch:t,state:e,type:"delete"})}},addKeyboardShortcuts(){return{"Mod-Alt-G":()=>this.editor.commands.insertColumns(),Tab:()=>kT({state:this.editor.state,dispatch:this.editor.view.dispatch,type:"after"}),"Shift-Tab":()=>kT({state:this.editor.state,dispatch:this.editor.view.dispatch,type:"before"})}}}),rv=Nt.create({name:"column",content:"block+",isolating:!0,addOptions(){return{HTMLAttributes:{class:"column"}}},addAttributes(){return{index:{default:0,parseHTML:t=>t.getAttribute("index")}}},parseHTML(){return[{tag:"div[class=column]"}]},renderHTML({HTMLAttributes:t}){return["div",lt(this.options.HTMLAttributes,t),0]}}),fJ=yt.create({name:"columnActionButton",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,t:r})=>({component:Ve,componentProps:{action:()=>{e.chain().focus().insertColumns({cols:2}).run()},icon:"Columns",tooltip:r("editor.columns.tooltip")}})}}}),hJ=yt.create({name:"selection",addProseMirrorPlugins(){const{editor:t}=this;return[new _t({key:new St("selection"),props:{decorations(e){return e.selection.empty||t.isFocused===!0?null:Tt.create(e.doc,[Qt.inline(e.selection.from,e.selection.to,{class:"selection"})])}}})]}});function pJ(t){const{t:e}=Ct(),r=J.useMemo(()=>[{name:"paragraph",label:e("editor.paragraph.tooltip"),iconName:"Heading1",isActive:()=>t.editor.isActive("paragraph")&&!t.editor.isActive("orderedList")&&!t.editor.isActive("bulletList")&&!t.editor.isActive("taskList"),action:()=>t.editor.chain().focus().clearNodes().run()},{name:"heading1",label:e("editor.heading.h1.tooltip"),isActive:()=>t.editor.isActive("heading",{level:1}),iconName:"Heading1",action:()=>t.editor.chain().focus().clearNodes().toggleHeading({level:1}).run()},{name:"heading2",label:e("editor.heading.h2.tooltip"),isActive:()=>t.editor.isActive("heading",{level:2}),iconName:"Heading2",action:()=>t.editor.chain().focus().clearNodes().toggleHeading({level:2}).run()},{name:"heading3",label:e("editor.heading.h3.tooltip"),isActive:()=>t.editor.isActive("heading",{level:3}),iconName:"Heading3",action:()=>t.editor.chain().focus().clearNodes().toggleHeading({level:3}).run()},{name:"bulletList",label:e("editor.bulletlist.tooltip"),isActive:()=>t.editor.isActive("bulletList"),iconName:"List",action:()=>t.editor.chain().focus().clearNodes().toggleBulletList().run()},{name:"numberedList",label:e("editor.orderedlist.tooltip"),isActive:()=>t.editor.isActive("orderedList"),iconName:"ListOrdered",action:()=>t.editor.chain().focus().clearNodes().toggleOrderedList().run()},{name:"taskList",label:e("editor.tasklist.tooltip"),isActive:()=>t.editor.isActive("taskList"),iconName:"ListTodo",action:()=>t.editor.chain().focus().clearNodes().toggleTaskList().run()},{name:"blockquote",label:e("editor.blockquote.tooltip"),isActive:()=>t.editor.isActive("blockquote"),iconName:"TextQuote",action:()=>t.editor.chain().focus().clearNodes().toggleBlockquote().run()},{name:"codeBlock",label:e("editor.codeblock.tooltip"),isActive:()=>t.editor.isActive("codeBlock"),iconName:"Code2",action:()=>t.editor.chain().focus().clearNodes().toggleCodeBlock().run()}],[t.editor,e]),n=J.useMemo(()=>r.filter(i=>i.isActive()).pop()??{label:"Empty"},[r]);return x.jsxs(Oa,{children:[x.jsx(Ma,{asChild:!0,children:x.jsxs(Mt,{variant:"ghost",className:"richtext-h-[32px] richtext-flex richtext-gap-1 richtext-px-1.5",children:[x.jsxs("span",{className:"richtext-text-sm richtext-font-normal richtext-whitespace-nowrap",children:[" ",n==null?void 0:n.label]}),x.jsx(He.ChevronDown,{className:"richtext-w-4 richtext-h-4"})]})}),x.jsx(ms,{hideWhenDetached:!0,className:"richtext-w-full richtext-p-1",align:"start",sideOffset:5,children:r.map((i,o)=>{var a;const s=Kh[i.iconName];return x.jsx(sc,{checked:((a=i.isActive)==null?void 0:a.call(i))||!1,onClick:()=>i.action(),className:"richtext-cursor-pointer",children:x.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-2 richtext-px-2",children:[x.jsx(s,{className:"richtext-w-3 richtext-h3"}),x.jsxs("span",{children:[" ",i.label]})]})},`text-bubble-${o}`)})})]})}const mJ=yt.create({name:"text-bubble",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),toolbar:!1,button:()=>({component:pJ,componentProps:{}})}}});function _T({types:t,node:e}){return Array.isArray(t)&&t.includes(e.type)||e.type===t}const gJ=yt.create({name:"trailingNode",addOptions(){return{node:"paragraph",notAfter:["paragraph"]}},addProseMirrorPlugins(){const t=new St(this.name),e=Object.entries(this.editor.schema.nodes).map(([,r])=>r).filter(r=>this.options.notAfter.includes(r.name));return[new _t({key:t,appendTransaction:(r,n,i)=>{const{doc:o,tr:s,schema:a}=i,l=t.getState(i),c=o.content.size,d=a.nodes[this.options.node];if(l)return s.insert(c,d.create())},state:{init:(r,n)=>{const i=n.tr.doc.lastChild;return!_T({node:i,types:e})},apply:(r,n)=>{if(!r.docChanged)return n;const i=r.doc.lastChild;return!_T({node:i,types:e})}}})]}}),yJ=yt.create({name:"base-kit",addExtensions(){const t=[];return this.options.document!==!1&&t.push(aJ.configure()),this.options.placeholder!==!1&&t.push(iJ.configure({placeholder:({node:e,pos:r,editor:n})=>{var i,o,s,a,l;return((i=e==null?void 0:e.type)==null?void 0:i.name)==="columns"||((o=e==null?void 0:e.content)==null?void 0:o.size)!==0?"":((s=e==null?void 0:e.type)==null?void 0:s.name)==="heading"?`${Ot.t(`editor.heading.h${e.attrs.level}.tooltip`)}`:((a=e==null?void 0:e.type)==null?void 0:a.name)==="codeBlock"||((l=e==null?void 0:e.type)==null?void 0:l.name)==="table"?"":n.extensionManager.extensions.some(c=>c.name==="slashCommand")?Ot.t("editor.slash"):Ot.t("editor.content")},...this.options.placeholder})),this.options.focus!==!1&&t.push(GY.configure({className:"focus",...this.options.focus})),this.options.text!==!1&&t.push(oJ.configure()),this.options.textBubble!==!1&&t.push(mJ.configure()),this.options.gapcursor!==!1&&t.push(eJ.configure()),this.options.dropcursor!==!1&&t.push(VY.configure({...this.options.dropcursor,width:2,class:"ProseMirror-dropcursor border-black"})),this.options.characterCount!==!1&&t.push($Y.configure(this.options.characterCount)),this.options.paragraph!==!1&&t.push(nJ.configure(this.options.paragraph)),this.options.hardBreak!==!1&&t.push(tJ.configure(this.options.hardBreak)),this.options.listItem!==!1&&t.push(rJ.configure(this.options.listItem)),this.options.textStyle!==!1&&t.push(xX.configure(this.options.textStyle)),this.options.trailingNode!==!1&&t.push(gJ.configure(this.options.trailingNode)),this.options.selection!==!1&&t.push(hJ),this.options.multiColumn!==!1&&(t.push(rv),t.push(dd)),t}}),CD=Mn.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(t){return t!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sub",lt(this.options.HTMLAttributes,t),0]},addCommands(){return{setSubscript:()=>({commands:t})=>t.setMark(this.name),toggleSubscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSubscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),ED=Mn.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(t){return t!=="super"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sup",lt(this.options.HTMLAttributes,t),0]},addCommands(){return{setSuperscript:()=>({commands:t})=>t.setMark(this.name),toggleSuperscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSuperscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),vJ=yt.create({name:"subAndSuperScript",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,extension:r,t:n})=>{const i=r.options.subscript,o=r.options.superscript,s={component:Ve,componentProps:{action:()=>e.commands.toggleSubscript(),isActive:()=>e.isActive("subscript")||!1,disabled:!e.can().toggleSubscript(),icon:"Subscript",tooltip:n("editor.subscript.tooltip")}},a={component:Ve,componentProps:{action:()=>e.commands.toggleSuperscript(),isActive:()=>e.isActive("superscript")||!1,disabled:!e.can().toggleSuperscript(),icon:"Superscript",tooltip:n("editor.superscript.tooltip")}},l=[];return i!==!1&&l.push(s),o!==!1&&l.push(a),l}}},addExtensions(){const t=[];return this.options.subscript!==!1&&t.push(CD.configure(this.options.subscript)),this.options.superscript!==!1&&t.push(ED.configure(this.options.superscript)),t}});function bJ(t){var r;const e=J.useMemo(()=>{var o;const n=(o=t==null?void 0:t.items)==null?void 0:o.find(s=>s.isActive());return n&&!n.default?{...n,icon:n!=null&&n.icon?n==null?void 0:n.icon:t==null?void 0:t.icon}:{title:t.tooltip,icon:t.icon,isActive:()=>!1}},[t]);return x.jsxs(Oa,{children:[x.jsx(Ma,{disabled:t==null?void 0:t.disabled,asChild:!0,children:x.jsx(Ve,{customClass:"!richtext-w-12 richtext-h-12",icon:t==null?void 0:t.icon,tooltip:t==null?void 0:t.tooltip,disabled:t==null?void 0:t.disabled,children:x.jsx(yN,{className:"richtext-w-3 richtext-h-3 richtext-text-gray-500"})})}),x.jsx(ms,{className:"w-full",children:(r=t==null?void 0:t.items)==null?void 0:r.map((n,i)=>x.jsxs(sc,{checked:e.title===n.title,onClick:n.action,className:"richtext-flex richtext-items-center richtext-gap-3",children:[x.jsx(Rt,{name:n==null?void 0:n.icon}),x.jsx("span",{className:"richtext-ml-1",children:n.title}),!!(n!=null&&n.shortcutKeys)&&x.jsx("span",{className:"richtext-ml-auto richtext-text-xs richtext-tracking-widest richtext-opacity-60",children:Fy(n.shortcutKeys)})]},`more-mark-${i}`))})]})}const wJ=yt.create({name:"moreMark",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button({editor:e,extension:r,t:n}){const i=r.options.subscript,o=r.options.superscript,s={action:()=>e.commands.toggleSubscript(),isActive:()=>e.isActive("subscript")||!1,disabled:!e.can().toggleSubscript(),icon:"Subscript",title:n("editor.subscript.tooltip"),shortcutKeys:["mod","."]},a={action:()=>e.commands.toggleSuperscript(),isActive:()=>e.isActive("superscript")||!1,disabled:!e.can().toggleSuperscript(),icon:"Superscript",title:n("editor.superscript.tooltip"),shortcutKeys:["mod",","]},l=[];return i!==!1&&l.push(s),o!==!1&&l.push(a),{component:bJ,componentProps:{icon:"Type",tooltip:n("editor.moremark"),disabled:!e.isEditable,items:l}}}}},addExtensions(){const t=[];return this.options.subscript!==!1&&t.push(CD.configure(this.options.subscript)),this.options.superscript!==!1&&t.push(ED.configure(this.options.superscript)),t}}),xJ=yt.create({name:"indent",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),types:["paragraph","heading","blockquote"],minIndent:Ol.min,maxIndent:Ol.max,button({editor:e,t:r}){return[{component:Ve,componentProps:{action:()=>{e.commands.indent()},shortcutKeys:["Tab"],icon:"IndentIncrease",tooltip:r("editor.indent.tooltip")}},{component:Ve,componentProps:{action:()=>{e.commands.outdent()},shortcutKeys:["Shift","Tab"],icon:"IndentDecrease",tooltip:r("editor.outdent.tooltip")}}]}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{indent:{default:0,parseHTML:t=>{const e=t.dataset.indent;return(e?Number.parseInt(e,10):0)||0},renderHTML:t=>t.indent?{"data-indent":t.indent}:{}}}}]},addCommands(){return{indent:()=>sT({delta:Ol.more,types:this.options.types}),outdent:()=>sT({delta:Ol.less,types:this.options.types})}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.indent(),"Shift-Tab":()=>this.editor.commands.outdent()}}});function SJ(t){return Number.parseFloat(t.replace("%",""))/100}function kJ(t){const{t:e}=Ct(),[r,n]=J.useState("default");function i(s){s==="default"?t.editor.commands.unsetLineHeight():t.editor.commands.setLineHeight(s),n(s)}const o=J.useMemo(()=>{const l=t.editor.extensionManager.extensions.find(c=>c.name==="lineHeight").options.lineHeights.map(c=>({label:SJ(c),value:c}));return l.unshift({label:e("editor.default"),value:"default"}),l},[t]);return x.jsxs(Oa,{children:[x.jsx(Ma,{disabled:t==null?void 0:t.disabled,asChild:!0,children:x.jsx(Ve,{customClass:"!richtext-w-12 richtext-h-12",icon:"LineHeight",tooltip:t==null?void 0:t.tooltip,disabled:t==null?void 0:t.disabled,children:x.jsx(Rt,{className:"richtext-w-3 richtext-h-3 richtext-ml-1 richtext-text-zinc-500",name:"MenuDown"})})}),x.jsx(ms,{className:"richtext-min-w-24",children:o==null?void 0:o.map((s,a)=>x.jsx(sc,{checked:s.value===r,onClick:()=>i(s.value),children:s.label},`lineHeight-${a}`))})]})}const _J=["paragraph","heading","list_item","todo_item"];function CJ(t,e){const{selection:r,doc:n}=t;if(!r||!n||!(r instanceof et||r instanceof Gn))return t;const{from:i,to:o}=r,s=[],a=e&&e!==vM?e:null;if(n.nodesBetween(i,o,(l,c)=>{const d=l.type;return _J.includes(d.name)?((l.attrs.lineHeight||null)!==a&&s.push({node:l,pos:c,nodeType:d}),d.name!=="list_item"&&d.name!=="todo_item"):!0}),s.length===0)return t;for(const l of s){const{node:c,pos:d,nodeType:f}=l;let{attrs:p}=c;p={...p,lineHeight:a},t=t.setNodeMarkup(d,f,p,c.marks)}return t}function EJ(t){return({state:e,dispatch:r})=>{const{selection:n}=e;let{tr:i}=e;return i=i.setSelection(n),i=CJ(i,t),i.docChanged?(r&&r(i),!0):!1}}const TJ=yt.create({name:"lineHeight",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),types:["paragraph","heading","list_item","todo_item"],lineHeights:YH,defaultHeight:vM,button({editor:e,t:r}){return{component:kJ,componentProps:{editor:e,tooltip:r("editor.lineheight.tooltip")}}}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:t=>t.style.lineHeight||this.options.defaultHeight,renderHTML:t=>t.lineHeight===this.options.defaultHeight||!t.lineHeight?{}:{style:`line-height: ${t.lineHeight}`}}}}]},addCommands(){return{setLineHeight:t=>EJ(t),unsetLineHeight:()=>({commands:t})=>this.options.types.every(e=>t.resetAttributes(e,"lineHeight"))}}});function AJ(t){var e;const{char:r,allowSpaces:n,allowedPrefixes:i,startOfLine:o,$position:s}=t,a=C4(r),l=new RegExp(`\\s${a}$`),c=o?"^":"",d=n?new RegExp(`${c}${a}.*?(?=\\s${a}|$)`,"gm"):new RegExp(`${c}(?:^)?${a}[^\\s${a}]*`,"gm"),f=((e=s.nodeBefore)===null||e===void 0?void 0:e.isText)&&s.nodeBefore.text;if(!f)return null;const p=s.pos-f.length,m=Array.from(f.matchAll(d)).pop();if(!m||m.input===void 0||m.index===void 0)return null;const g=m.input.slice(Math.max(0,m.index-1),m.index),b=new RegExp(`^[${i==null?void 0:i.join("")}\0]?$`).test(g);if(i!==null&&!b)return null;const S=p+m.index;let w=S+m[0].length;return n&&l.test(f.slice(w-1,w+1))&&(m[0]+=" ",w+=1),S<s.pos&&w>=s.pos?{range:{from:S,to:w},query:m[0].slice(r.length),text:m[0]}:null}const RJ=new St("suggestion");function VS({pluginKey:t=RJ,editor:e,char:r="@",allowSpaces:n=!1,allowedPrefixes:i=[" "],startOfLine:o=!1,decorationTag:s="span",decorationClass:a="suggestion",command:l=()=>null,items:c=()=>[],render:d=()=>({}),allow:f=()=>!0,findSuggestionMatch:p=AJ}){let m;const g=d==null?void 0:d(),b=new _t({key:t,view(){return{update:async(S,w)=>{var T,M,j,$,W,Y,ee;const P=(T=this.key)===null||T===void 0?void 0:T.getState(w),fe=(M=this.key)===null||M===void 0?void 0:M.getState(S.state),de=P.active&&fe.active&&P.range.from!==fe.range.from,U=!P.active&&fe.active,ne=P.active&&!fe.active,R=!U&&!ne&&P.query!==fe.query,le=U||de&&R,Ee=R||de,he=ne||de&&R;if(!le&&!Ee&&!he)return;const Fe=he&&!le?P:fe,ye=S.dom.querySelector(`[data-decoration-id="${Fe.decorationId}"]`);m={editor:e,range:Fe.range,query:Fe.query,text:Fe.text,items:[],command:ze=>l({editor:e,range:Fe.range,props:ze}),decorationNode:ye,clientRect:ye?()=>{var ze;const{decorationId:ue}=(ze=this.key)===null||ze===void 0?void 0:ze.getState(e.state),V=S.dom.querySelector(`[data-decoration-id="${ue}"]`);return(V==null?void 0:V.getBoundingClientRect())||null}:null},le&&((j=g==null?void 0:g.onBeforeStart)===null||j===void 0||j.call(g,m)),Ee&&(($=g==null?void 0:g.onBeforeUpdate)===null||$===void 0||$.call(g,m)),(Ee||le)&&(m.items=await c({editor:e,query:Fe.query})),he&&((W=g==null?void 0:g.onExit)===null||W===void 0||W.call(g,m)),Ee&&((Y=g==null?void 0:g.onUpdate)===null||Y===void 0||Y.call(g,m)),le&&((ee=g==null?void 0:g.onStart)===null||ee===void 0||ee.call(g,m))},destroy:()=>{var S;m&&((S=g==null?void 0:g.onExit)===null||S===void 0||S.call(g,m))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(S,w,T,M){const{isEditable:j}=e,{composing:$}=e.view,{selection:W}=S,{empty:Y,from:ee}=W,P={...w};if(P.composing=$,j&&(Y||e.view.composing)){(ee<w.range.from||ee>w.range.to)&&!$&&!w.composing&&(P.active=!1);const fe=p({char:r,allowSpaces:n,allowedPrefixes:i,startOfLine:o,$position:W.$from}),de=`id_${Math.floor(Math.random()*4294967295)}`;fe&&f({editor:e,state:M,range:fe.range,isActive:w.active})?(P.active=!0,P.decorationId=w.decorationId?w.decorationId:de,P.range=fe.range,P.query=fe.query,P.text=fe.text):P.active=!1}else P.active=!1;return P.active||(P.decorationId=null,P.range={from:0,to:0},P.query=null,P.text=null),P}},props:{handleKeyDown(S,w){var T;const{active:M,range:j}=b.getState(S.state);return M&&((T=g==null?void 0:g.onKeyDown)===null||T===void 0?void 0:T.call(g,{view:S,event:w,range:j}))||!1},decorations(S){const{active:w,range:T,decorationId:M}=b.getState(S);return w?Tt.create(S.doc,[Qt.inline(T.from,T.to,{nodeName:s,class:a,"data-decoration-id":M})]):null}}});return b}const TD=ko.createSignal(!1);function IJ(){return ko.useSignalValue(TD)}const Iu={setOpen:t=>{TD.set(t)}},AD=ko.createSignal(!1);function OJ(){return ko.useSignalValue(AD)}const Uf={setOpen:t=>{AD.set(t)}};function MJ(t){const e=[{name:"format",title:Ot.t("editor.slash.format"),commands:[]},{name:"insert",title:Ot.t("editor.slash.insert"),commands:[]}];return t.forEach(r=>{r.name.toLowerCase()==="heading"&&r.options.levels.forEach(n=>{e[0].commands.push({name:`heading${n}`,label:Ot.t(`editor.heading.h${n}.tooltip`),aliases:[`h${n}`,"bt",`bt${n}`],iconName:`Heading${n}`,action:({editor:i,range:o})=>{i.chain().focus().deleteRange(o).setHeading({level:n}).run()}})}),r.name.toLowerCase()==="bulletlist"&&e[0].commands.push({name:"bulletList",label:Ot.t("editor.bulletlist.tooltip"),aliases:["ul","yxlb"],iconName:"List",action:({editor:n,range:i})=>{n.chain().focus().deleteRange(i).toggleBulletList().run()}}),r.name.toLowerCase()==="orderedlist"&&e[0].commands.push({name:"numberedList",label:Ot.t("editor.orderedlist.tooltip"),aliases:["ol","yxlb"],iconName:"ListOrdered",action:({editor:n,range:i})=>{n.chain().focus().deleteRange(i).toggleOrderedList().run()}}),r.name.toLowerCase()==="tasklist"&&e[0].commands.push({name:"taskList",label:Ot.t("editor.tasklist.tooltip"),iconName:"ListTodo",description:"Task list with todo items",aliases:["todo"],action:({editor:n,range:i})=>{n.chain().focus().deleteRange(i).toggleTaskList().run()}}),r.name.toLowerCase()==="blockquote"&&e[0].commands.push({name:"blockquote",label:Ot.t("editor.blockquote.tooltip"),description:"插入引入格式",aliases:["yr"],iconName:"TextQuote",action:({editor:n,range:i})=>{n.chain().focus().deleteRange(i).setBlockquote().run()}}),r.name.toLowerCase()==="codeblock"&&e[0].commands.push({name:"codeBlock",label:Ot.t("editor.codeblock.tooltip"),iconName:"Code2",description:"Code block with syntax highlighting",shouldBeHidden:n=>n.isActive("columns"),action:({editor:n,range:i})=>{n.chain().focus().deleteRange(i).setCodeBlock().run()}}),r.name.toLowerCase()==="image"&&e[1].commands.push({name:"image",label:Ot.t("editor.image.tooltip"),iconName:"ImageUp",description:"Insert a image",aliases:["image","tp","tupian"],shouldBeHidden:n=>n.isActive("columns"),action:({editor:n,range:i})=>{n.chain().focus().deleteRange(i).run(),Iu.setOpen(!0)}}),r.name.toLowerCase()==="video"&&e[1].commands.push({name:"video",label:Ot.t("editor.video.tooltip"),iconName:"Video",description:"Insert a video",aliases:["video","sp","shipin"],shouldBeHidden:n=>n.isActive("columns"),action:({editor:n,range:i})=>{n.chain().focus().deleteRange(i).run(),Uf.setOpen(!0)}}),r.name.toLowerCase()==="table"&&e[1].commands.push({name:"table",label:Ot.t("editor.table.tooltip"),iconName:"Table",description:"Insert a table",aliases:["table","bg","biaoge","biao"],shouldBeHidden:n=>n.isActive("columns"),action:({editor:n,range:i})=>{n.chain().focus().deleteRange(i).insertTable({rows:3,cols:3,withHeaderRow:!1}).run()}}),r.name.toLowerCase()==="horizontalrule"&&e[1].commands.push({name:"horizontalRule",label:Ot.t("editor.horizontalrule.tooltip"),iconName:"Minus",description:"Insert a horizontal divider",aliases:["hr","fgx","fg"],action:({editor:n,range:i})=>{n.chain().focus().deleteRange(i).setHorizontalRule().run()}}),r.name.toLowerCase()==="columns"&&e[1].commands.push({name:"columns",label:Ot.t("editor.columns.tooltip"),iconName:"Columns2",description:"Add two column content",action:({editor:n})=>{n.chain().focus().insertColumns({cols:2}).run()}})}),e}function NJ(t,e){var S,w;const[r,n]=J.useState(0),[i,o]=J.useState(0),s=J.useRef(null),{t:a}=Ct(),l=J.useRef([]);J.useImperativeHandle(e,()=>({onKeyDown:c})),J.useEffect(()=>{if(!s.current)return;const T=i*1e3+r,M=l.current[T];M&&M.scrollIntoView({behavior:"smooth",block:"nearest"})},[r,i]);function c({event:T}){return T.key==="ArrowUp"?(d(),!0):T.key==="ArrowDown"?(f(),!0):T.key==="Enter"?(p(),!0):!1}function d(){var j;if(t.items.length===0)return!1;let T=r-1,M=i;T<0&&(M=i-1,T=((j=t.items[M])==null?void 0:j.commands.length)-1||0),M<0&&(M=t.items.length-1,T=t.items[M].commands.length-1),n(T),o(M)}function f(){if(t.items.length===0)return!1;const T=t.items[i].commands;let M=r+1,j=i;T.length-1<M&&(M=0,j=i+1),t.items.length-1<j&&(j=0),n(M),o(j)}function p(){if(t.items.length===0||i===-1||r===-1)return!1;m(i,r)}function m(T,M){const j=t.items[T].commands[M];t.command(j)}function g(T,M){m(T,M)}function b(T,M,j){l.current[T*1e3+M]=j}return x.jsx("div",{className:"!richtext-bg-white richtext-rounded-lg dark:!richtext-bg-black richtext-shadow-sm !richtext-border !richtext-border-neutral-200 dark:!richtext-border-neutral-800 !richtext-text-black richtext-max-h-[min(80vh,24rem)] richtext-overflow-auto richtext-flex-wrap richtext-mb-8 richtext-p-1",ref:s,children:(S=t==null?void 0:t.items)!=null&&S.length?x.jsx("div",{className:"richtext-grid richtext-grid-cols-1 richtext-gap-0.5 richtext-min-w-48",children:(w=t==null?void 0:t.items)==null?void 0:w.map((T,M)=>x.jsxs(J.Fragment,{children:[x.jsx("div",{className:"!richtext-text-neutral-500 richtext-text-[0.65rem] richtext-col-[1/-1] richtext-mx-2 richtext-mt-2 richtext-font-semibold richtext-tracking-wider richtext-select-none richtext-uppercase first:richtext-mt-0.5",children:T.title}),T.commands.map((j,$)=>x.jsxs("button",{className:pt("richtext-flex richtext-items-center richtext-gap-3 richtext-px-2 richtext-py-1.5 richtext-text-sm !richtext-text-neutral-800 dark:!richtext-text-neutral-200 richtext-text-left richtext-w-full richtext-rounded-sm richtext-outline-none richtext-transition-colors !richtext-bg-transparent hover:!richtext-bg-accent ",{"slash-command-active":i===M&&r===$}),ref:W=>b(M,$,W),onClick:()=>g(M,$),children:[j.iconUrl&&x.jsx("img",{className:"richtext-w-6 richtext-h-6",src:j.iconUrl,alt:""}),j.iconName&&x.jsx(Rt,{name:j.iconName,className:"!richtext-mr-1 !richtext-text-lg"}),j.label]},`command-${$}`))]},`slash-${T.title}`))}):x.jsx("div",{className:"richtext-p-3",children:x.jsx("span",{className:"richtext-text-xs richtext-text-gray-800 dark:richtext-text-gray-100",children:a("editor.slash.empty")})})})}const DJ=J.forwardRef(NJ),bl="slashCommand";let Ft;const PJ=yt.create({name:bl,priority:200,onCreate(){Ft=gd("body",{interactive:!0,trigger:"manual",placement:"bottom-start",theme:"slash-command",maxWidth:"16rem",offset:[16,8],popperOptions:{strategy:"fixed",modifiers:[{name:"flip",enabled:!1}]}})},addProseMirrorPlugins(){return[VS({editor:this.editor,char:"/",allowSpaces:!0,startOfLine:!0,pluginKey:new St(bl),allow:({state:t,range:e})=>{var c,d,f;const r=t.doc.resolve(e.from),n=r.depth===1,i=r.parent.type.name==="paragraph",o=((c=r.parent.textContent)==null?void 0:c.charAt(0))==="/",s=this.editor.isActive("column"),a=(f=r.parent.textContent)==null?void 0:f.slice(Math.max(0,(d=r.parent.textContent)==null?void 0:d.indexOf("/"))),l=!(a!=null&&a.endsWith(" "));return(n&&i&&o||s&&i&&o)&&l},command:({editor:t,range:e,props:r})=>{const{view:n}=t;r.action({editor:t,range:e}),n.focus()},items:({query:t,editor:e})=>MJ(e.extensionManager.extensions).map(s=>({...s,commands:s.commands.filter(a=>{const l=a.label.toLowerCase().trim(),c=t.toLowerCase().trim();if(a.aliases){const d=a.aliases.map(m=>m.toLowerCase().trim()),f=l.match(c),p=d.some(m=>m.match(c));return f||p}return l.match(c)}).filter(a=>a.shouldBeHidden?!a.shouldBeHidden(this.editor):!0)})).filter(s=>s.commands.length>0).map(s=>({...s,commands:s.commands.map(a=>({...a,isEnabled:!0}))})),render:()=>{let t,e=null;return{onStart:r=>{var o;t=new By(DJ,{props:r,editor:r.editor});const{view:n}=r.editor,i=()=>{if(!r.clientRect)return r.editor.storage[bl].rect;const s=r.clientRect();if(!s)return r.editor.storage[bl].rect;let a=s.y;if(s.top+t.element.offsetHeight+40>window.innerHeight){const l=s.top+t.element.offsetHeight-window.innerHeight+40;a=s.y-l}return new DOMRect(s.x,a,s.width,s.height)};e=()=>{Ft==null||Ft[0].setProps({getReferenceClientRect:i})},(o=n.dom.parentElement)==null||o.addEventListener("scroll",e),Ft==null||Ft[0].setProps({getReferenceClientRect:i,appendTo:()=>document.body,content:t.element}),Ft==null||Ft[0].show()},onUpdate(r){var s;t.updateProps(r);const{view:n}=r.editor,i=()=>{if(!r.clientRect)return r.editor.storage[bl].rect;const a=r.clientRect();return a?new DOMRect(a.x,a.y,a.width,a.height):r.editor.storage[bl].rect},o=()=>{Ft==null||Ft[0].setProps({getReferenceClientRect:i})};(s=n.dom.parentElement)==null||s.addEventListener("scroll",o),r.editor.storage[bl].rect=r.clientRect?i():{width:0,height:0,left:0,top:0,right:0,bottom:0},Ft==null||Ft[0].setProps({getReferenceClientRect:i})},onKeyDown(r){var n;return r.event.key==="Escape"?(Ft==null||Ft[0].hide(),!0):(Ft!=null&&Ft[0].state.isShown||Ft==null||Ft[0].show(),(n=t.ref)==null?void 0:n.onKeyDown(r))},onExit(r){var n;if(Ft==null||Ft[0].hide(),e){const{view:i}=r.editor;(n=i.dom.parentElement)==null||n.removeEventListener("scroll",e)}t.destroy()}}}})]},addStorage(){return{rect:{width:0,height:0,left:0,top:0,right:0,bottom:0}}}}),LJ=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,GS=Nt.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",lt(this.options.HTMLAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[$h({find:LJ,type:this.type,getAttributes:t=>{const[,,e,r,n]=t;return{src:r,alt:e,title:n}}})]}}),cm={TOP_LEFT:"tl",TOP_RIGHT:"tr",BOTTOM_LEFT:"bl",BOTTOM_RIGHT:"br"};function FJ(t){var Y,ee;const[e,r]=J.useState({width:nd,height:nd}),[n,i]=J.useState({width:0,height:0}),[o]=J.useState([cm.TOP_LEFT,cm.TOP_RIGHT,cm.BOTTOM_LEFT,cm.BOTTOM_RIGHT]),[s,a]=J.useState(!1),[l,c]=J.useState({x:0,y:0,w:0,h:0,dir:""}),{align:d,inline:f}=(Y=t==null?void 0:t.node)==null?void 0:Y.attrs,p=J.useMemo(()=>{var ye;const{src:P,alt:fe,width:de,height:U,flipX:ne,flipY:R}=(ye=t==null?void 0:t.node)==null?void 0:ye.attrs,le=Og(de)?`${de}px`:de,Ee=Og(U)?`${U}px`:U,he=[];ne&&he.push("rotateX(180deg)"),R&&he.push("rotateY(180deg)");const Fe=he.join(" ");return{src:P||void 0,alt:fe||void 0,style:{width:le||void 0,height:Ee||void 0,transform:Fe||"none"}}},[(ee=t==null?void 0:t.node)==null?void 0:ee.attrs]),m=J.useMemo(()=>{const{style:{width:P}}=p;return{width:P==="100%"?P:void 0}},[p]);function g(P){i({width:P.target.width,height:P.target.height})}function b(){const{editor:P,getPos:fe}=t;P.commands.setNodeSelection(fe())}const S=J.useCallback(Yl(()=>{const{editor:P}=t,{width:fe}=getComputedStyle(P.view.dom);r(de=>({...de,width:Number.parseInt(fe,10)}))},id),[t==null?void 0:t.editor]);function w(P,fe){P.preventDefault(),P.stopPropagation();const de=n.width,U=n.height,ne=de/U;let R=Number(t.node.attrs.width),le=Number(t.node.attrs.height);const Ee=e.width;R&&!le?(R=R>Ee?Ee:R,le=Math.round(R/ne)):le&&!R?(R=Math.round(le*ne),R=R>Ee?Ee:R):!R&&!le?(R=de>Ee?Ee:de,le=Math.round(R/ne)):R=R>Ee?Ee:R,ds.flushSync(()=>{a(!0),c({x:P.clientX,y:P.clientY,w:R,h:le,dir:fe})})}const T=J.useCallback(Yl(P=>{if(P.preventDefault(),P.stopPropagation(),!s)return;const{x:fe,w:de,dir:U}=l,ne=(P.clientX-fe)*(/l/.test(U)?-1:1),R=eN(de+ne,dS,e.width);t.updateAttributes({width:R,height:null})},id),[s,l,e,t.updateAttributes]),M=J.useCallback(P=>{P.preventDefault(),P.stopPropagation(),s&&(ds.flushSync(()=>{c({x:0,y:0,w:0,h:0,dir:""}),a(!1)}),b())},[s,b]),j=J.useCallback(()=>{document==null||document.addEventListener("mousemove",T,!0),document==null||document.addEventListener("mouseup",M,!0)},[T,M]),$=J.useCallback(()=>{document==null||document.removeEventListener("mousemove",T,!0),document==null||document.removeEventListener("mouseup",M,!0)},[T,M]);J.useEffect(()=>(s?j():$(),()=>{$()}),[s,j,$]);const W=J.useMemo(()=>new ResizeObserver(()=>S()),[S]);return J.useEffect(()=>(W.observe(t.editor.view.dom),()=>{W.disconnect()}),[t.editor.view.dom,W]),x.jsx(gi,{className:"image-view",style:{...m,textAlign:d,display:f?"inline":"block"},as:f?"span":"div",children:x.jsxs("div",{draggable:"true","data-drag-handle":!0,className:`image-view__body ${t!=null&&t.selected?"image-view__body--focused":""} ${s?"image-view__body--resizing":""}`,style:m,children:[x.jsx("img",{src:p.src,alt:p.alt,style:p.style,height:"auto",className:"image-view__body__image block",onLoad:g,onClick:b}),(t==null?void 0:t.editor.view.editable)&&((t==null?void 0:t.selected)||s)&&x.jsx("div",{className:"image-resizer",children:o==null?void 0:o.map(P=>x.jsx("span",{className:`image-resizer__handler image-resizer__handler--${P}`,onMouseDown:fe=>w(fe,P)},`image-dir-${P}`))})]})})}function jJ({editor:t,imageInline:e,onClose:r}){const{t:n}=Ct(),[i,o]=J.useState(!1),s=J.useRef(null),[a,l]=J.useState(),[c,d]=J.useState(""),f=J.useRef(null),[p,m]=J.useState({src:"",file:null});function g(M){if(s.current&&M.width&&M.height){const j=b(s.current,M);d(j)}}function b(M,j){const $=document.createElement("canvas"),W=M.naturalWidth/M.width,Y=M.naturalHeight/M.height;$.width=j.width*W,$.height=j.height*Y;const ee=$.getContext("2d");return ee&&(ee.imageSmoothingEnabled=!1,ee.drawImage(M,j.x*W,j.y*Y,j.width*W,j.height*Y,0,0,j.width*W,j.height*Y)),$.toDataURL("image/png",1)}async function S(){var M,j;try{const $=await hS(c,((M=p==null?void 0:p.file)==null?void 0:M.name)||"image.png"),W=(j=t.extensionManager.extensions.find(ee=>ee.name==="image"))==null?void 0:j.options;let Y="";W.upload?Y=await W.upload($):Y=URL.createObjectURL($),t.chain().focus().setImageInline({src:Y,inline:e}).run(),o(!1),m({src:"",file:null}),r()}catch($){console.log("Error cropping image",$)}}function w(M){var j;M.preventDefault(),(j=f.current)==null||j.click()}const T=async M=>{var Y;const j=(Y=M==null?void 0:M.target)==null?void 0:Y.files;if(!t||t.isDestroyed||j.length===0)return;const $=j[0],W=await H7($);o(!0),m({src:W.src,file:$})};return x.jsxs(x.Fragment,{children:[x.jsx(Mt,{className:"richtext-w-full richtext-mt-1",size:"sm",onClick:w,children:n("editor.image.dialog.tab.uploadCrop")}),x.jsxs(lc,{open:i,children:[x.jsx(cc,{}),x.jsxs(Na,{children:[x.jsx(Da,{children:n("editor.image.dialog.tab.uploadCrop")}),x.jsx("div",{children:p.src&&x.jsx(A2,{crop:a,onChange:M=>l(M),onComplete:M=>g(M),className:"richtext-w-full",children:x.jsx("img",{ref:s,alt:"Crop me",src:p.src})})}),x.jsxs(_d,{children:[x.jsxs(Mt,{onClick:()=>{o(!1),m({src:"",file:null})},children:[n("editor.imageUpload.cancel"),x.jsx(Rt,{name:"Trash2",className:"richtext-ml-[4px]"})]}),x.jsxs(Mt,{className:"richtext-w-fit",onClick:S,children:[n("editor.imageUpload.crop"),x.jsx(Rt,{name:"Crop",className:"richtext-ml-[4px]"})]})]})]})]}),x.jsx("input",{type:"file",accept:"image/*",ref:f,multiple:!0,style:{display:"none"},onChange:T})]})}function BJ(t){const{t:e}=Ct(),r=IJ(),[n,i]=J.useState(""),o=J.useRef(null),[s,a]=J.useState(!1),l=J.useMemo(()=>{var m;return(m=t.editor.extensionManager.extensions.find(g=>g.name===RD.name))==null?void 0:m.options},[t.editor]);async function c(p){var S;const m=(S=p==null?void 0:p.target)==null?void 0:S.files;if(!t.editor||t.editor.isDestroyed||m.length===0)return;const g=m[0];let b="";l.upload?b=await l.upload(g):b=URL.createObjectURL(g),t.editor.chain().focus().setImageInline({src:b,inline:s}).run(),Iu.setOpen(!1),a(!1)}function d(p){p.preventDefault(),p.stopPropagation(),t.editor.chain().focus().setImageInline({src:n,inline:s}).run(),Iu.setOpen(!1),a(!1)}function f(p){var m;p.preventDefault(),(m=o.current)==null||m.click()}return x.jsxs(lc,{open:r,onOpenChange:Iu.setOpen,children:[x.jsx(cc,{asChild:!0,children:x.jsx(Ve,{icon:t.icon,action:()=>Iu.setOpen(!0),tooltip:t.tooltip})}),x.jsxs(Na,{children:[x.jsx(Da,{children:e("editor.image.dialog.title")}),x.jsxs(uS,{defaultValue:l.resourceImage==="both"||l.resourceImage==="upload"?"upload":"link",activationMode:"manual",children:[x.jsxs(Uy,{className:"richtext-grid richtext-w-full richtext-grid-cols-2",children:[l.resourceImage==="both"||l.resourceImage==="upload"?x.jsx(td,{value:"upload",children:e("editor.image.dialog.tab.upload")}):x.jsx(x.Fragment,{}),l.resourceImage==="both"||l.resourceImage==="link"?x.jsx(td,{value:"link",children:e("editor.image.dialog.tab.url")}):x.jsx(x.Fragment,{})]}),x.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-[4px] richtext-my-[10px]",children:[x.jsx(uM,{checked:s,onCheckedChange:p=>{a(p)}}),x.jsx(Kn,{children:e("editor.link.dialog.inline")})]}),x.jsxs(rd,{value:"upload",children:[x.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-[10px]",children:[x.jsx(Mt,{className:"richtext-w-full richtext-mt-1",size:"sm",onClick:f,children:e("editor.image.dialog.tab.upload")}),x.jsx(jJ,{editor:t.editor,imageInline:s,onClose:()=>Iu.setOpen(!1)})]}),x.jsx("input",{type:"file",accept:"image/*",ref:o,multiple:!0,style:{display:"none"},onChange:c})]}),x.jsx(rd,{value:"link",children:x.jsx("form",{onSubmit:d,children:x.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-2",children:[x.jsx(hn,{type:"url",autoFocus:!0,value:n,onChange:p=>i(p.target.value),required:!0,placeholder:e("editor.image.dialog.placeholder")}),x.jsx(Mt,{type:"submit",children:e("editor.image.dialog.button.apply")})]})})})]})]})]})}const $u=new St("upload-image");function zJ(){return new _t({key:$u,state:{init(){return Tt.empty},apply(t,e){e=e.map(t.mapping,t.doc);const r=t.getMeta($u);if(r!=null&&r.add)for(const{id:n,pos:i,src:o}of r.add){const s=HJ(o),a=Qt.widget(i,s,{id:n});e=e.add(t.doc,[a])}else if(r!=null&&r.remove)for(const n of r.remove)e=e.remove(e.find(void 0,void 0,i=>i.id===n));return e}},props:{decorations(t){return this.getState(t)}}})}function HJ(t){const e=document.createElement("div"),r=document.createElement("img");return r.setAttribute("class","opacity-50"),r.src=t,r.addEventListener("load",()=>{e.setAttribute("class","img-placeholder")}),e.append(r),e}function $J(t,e){var i;const n=$u.getState(t).find(void 0,void 0,o=>o.id===e);return n.length>0?(i=n[0])==null?void 0:i.from:null}function UJ({validateFn:t,onUpload:e,postUpload:r}){return(n,i,o)=>{for(const s of n){if(t&&!t(s))continue;const a=Date.now().toString(),l=i.state.tr;l.selection.empty||l.deleteSelection();const c=URL.createObjectURL(s);l.setMeta($u,{add:[{id:a,pos:o,src:c}]}),i.dispatch(l),e(s).then(async d=>{var w;r&&typeof d=="string"&&(d=await r(d));const{schema:f}=i.state;let p=$J(i.state,a);if(p===null)return;const m=typeof d=="object"?c:d,g=(w=f.nodes.image)==null?void 0:w.create({src:m});if(!g)return;const{doc:b}=i.state;p>b.content.size&&(p=b.content.size-1);const S=i.state.tr.replaceWith(p,p,g).setMeta($u,{remove:[a]});i.dispatch(S)},()=>{const d=i.state.tr.delete(o,o).setMeta($u,{remove:[a]});i.dispatch(d)})}}}function WJ(t,e,r){var i;const n=[...((i=e.clipboardData)==null?void 0:i.files)||[]];if(n.length>0){e.preventDefault();const o=t.state.selection.from;return r(n,t,o+1),!0}return!1}function VJ(t,e,r,n){var o;const i=[...((o=e.dataTransfer)==null?void 0:o.files)||[]];if(!r&&i.length>0){e.preventDefault();const s=t.posAtCoords({left:e.clientX,top:e.clientY});if(s)return n(i,t,s.pos+1),!0}return!1}const GJ={acceptMimes:["image/jpeg","image/gif","image/png","image/jpg"],maxSize:1024*1024*5,resourceImage:"both"},RD=GS.extend({group:"inline",inline:!0,defining:!0,draggable:!0,selectable:!0,addOptions(){var t;return{...GJ,...(t=this.parent)==null?void 0:t.call(this),upload:()=>Promise.reject("Image Upload Function"),button:({editor:e,extension:r,t:n})=>{var i,o;return{component:BJ,componentProps:{action:()=>{},upload:r.options.upload,disabled:!((o=(i=e.can()).setImage)!=null&&o.call(i,{})),icon:"ImageUp",tooltip:n("editor.image.tooltip"),editor:e}}}}},addAttributes(){var t;return{...(t=this.parent)==null?void 0:t.call(this),flipX:{default:!1},flipY:{default:!1},width:{default:null,parseHTML:e=>{const r=e.style.width||e.getAttribute("width")||null;return r?Number.parseInt(r,10):null},renderHTML:e=>({width:e.width})},align:{default:"center",parseHTML:e=>e.getAttribute("align"),renderHTML:e=>({align:e.align})},inline:{default:!1,parseHTML:e=>!!e.getAttribute("inline"),renderHTML:e=>({inline:e.inline})}}},addNodeView(){return _o(FJ)},addCommands(){var t;return{...(t=this.parent)==null?void 0:t.call(this),setImageInline:e=>({commands:r})=>r.insertContent({type:this.name,attrs:e}),updateImage:e=>({commands:r})=>r.updateAttributes(this.name,e),setAlignImage:e=>({commands:r})=>r.updateAttributes(this.name,{align:e})}},renderHTML({HTMLAttributes:t}){const{flipX:e,flipY:r,align:n,inline:i}=t,o=e||r?`transform: rotateX(${e?"180":"0"}deg) rotateY(${r?"180":"0"}deg);`:"",s=n?`text-align: ${n};`:"";return[i?"span":"div",{style:s,class:"image"},["img",lt({height:"auto",style:o},this.options.HTMLAttributes,t)]]},parseHTML(){return[{tag:"span.image img",getAttrs:t=>{var o;const e=t==null?void 0:t.parentElement,r=t==null?void 0:t.getAttribute("width"),n=(t==null?void 0:t.getAttribute("flipx"))||!1,i=(t==null?void 0:t.getAttribute("flipy"))||!1;return{src:t==null?void 0:t.getAttribute("src"),alt:t==null?void 0:t.getAttribute("alt"),caption:t==null?void 0:t.getAttribute("caption"),width:r?Number.parseInt(r,10):null,align:(t==null?void 0:t.getAttribute("align"))||((o=e==null?void 0:e.style)==null?void 0:o.textAlign)||null,inline:(t==null?void 0:t.getAttribute("inline"))||!1,flipX:n==="true",flipY:i==="true"}}},{tag:"div[class=image]",getAttrs:t=>{const e=t.querySelector("img"),r=e==null?void 0:e.getAttribute("width"),n=(e==null?void 0:e.getAttribute("flipx"))||!1,i=(e==null?void 0:e.getAttribute("flipy"))||!1;return{src:e==null?void 0:e.getAttribute("src"),alt:e==null?void 0:e.getAttribute("alt"),caption:e==null?void 0:e.getAttribute("caption"),width:r?Number.parseInt(r,10):null,align:(e==null?void 0:e.getAttribute("align"))||t.style.textAlign||null,inline:(e==null?void 0:e.getAttribute("inline"))||!1,flipX:n==="true",flipY:i==="true"}}}]},addProseMirrorPlugins(){const e=UJ({validateFn:r=>!(!this.options.acceptMimes.includes(r.type)||r.size>this.options.maxSize),onUpload:this.options.upload});return[new _t({props:{handlePaste:(r,n)=>!n.clipboardData||[...n.clipboardData.files||[]].some(o=>o.type==="text/html")?!1:WJ(r,n,e),handleDrop:(r,n,i,o)=>(!(n instanceof DragEvent)||!n.dataTransfer||VJ(r,n,o,e),!1)}}),zJ()]}});function KJ(t){return/\.(?:mp4|webm|ogg|mov)$/i.test(t)}function qJ(t){const{t:e}=Ct(),[r,n]=J.useState(""),i=J.useRef(null),o=OJ(),[s,a]=J.useState(""),l=J.useMemo(()=>{var m;return(m=t.editor.extensionManager.extensions.find(g=>g.name===ID.name))==null?void 0:m.options},[t.editor]);async function c(p){var S;const m=(S=p==null?void 0:p.target)==null?void 0:S.files;if(!t.editor||t.editor.isDestroyed||m.length===0)return;const g=m[0];let b="";l.upload?b=await l.upload(g):b=URL.createObjectURL(g),t.editor.chain().setVideo({src:b,width:"100%"}).focus().run(),Uf.setOpen(!1)}function d(p){p.preventDefault(),p.stopPropagation(),r&&(t.editor.chain().setVideo({src:r,width:"100%"}).focus().run(),Uf.setOpen(!1))}function f(p){var m;p.preventDefault(),(m=i.current)==null||m.click()}return x.jsxs(lc,{open:o,onOpenChange:Uf.setOpen,children:[x.jsx(cc,{asChild:!0,children:x.jsx(Ve,{icon:t.icon,action:()=>Uf.setOpen(!0),tooltip:t.tooltip})}),x.jsxs(Na,{children:[x.jsx(Da,{children:e("editor.video.dialog.title")}),x.jsxs(uS,{defaultValue:(l==null?void 0:l.resourceVideo)==="both"||(l==null?void 0:l.resourceVideo)==="upload"?"upload":"link",activationMode:"manual",children:[x.jsxs(Uy,{className:"richtext-grid richtext-w-full richtext-grid-cols-2",children:[((l==null?void 0:l.resourceVideo)==="both"||(l==null?void 0:l.resourceVideo)==="upload")&&x.jsx(td,{value:"upload",children:e("editor.video.dialog.tab.upload")}),((l==null?void 0:l.resourceVideo)==="both"||(l==null?void 0:l.resourceVideo)==="link")&&x.jsx(td,{value:"link",children:e("editor.video.dialog.link")})]}),x.jsxs(rd,{value:"upload",children:[x.jsx("div",{className:"richtext-flex richtext-items-center richtext-gap-[10px]",children:x.jsx(Mt,{className:"richtext-w-full richtext-mt-1",size:"sm",onClick:f,children:e("editor.video.dialog.tab.upload")})}),x.jsx("input",{type:"file",accept:"video/*",ref:i,multiple:!0,style:{display:"none"},onChange:c})]}),x.jsxs(rd,{value:"link",children:[x.jsx("form",{onSubmit:d,children:x.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-2",children:[x.jsx(hn,{type:"url",autoFocus:!0,value:r,onChange:p=>{const m=p.target.value;if(!KJ(m)){a("Invalid video URL"),n("");return}a(""),n(m)},required:!0,placeholder:e("editor.video.dialog.placeholder")}),x.jsx(Mt,{type:"submit",children:e("editor.video.dialog.button.apply")})]})}),s&&x.jsx("div",{className:"richtext-text-red-500 richtext-my-[5px]",children:s})]})]})]})]})}function XJ(t){return t=t.replace("https://youtu.be/","https://www.youtube.com/watch?v=").replace("watch?v=","embed/"),t=t.replace("https://vimeo.com/","https://player.vimeo.com/video/"),/^https?:\/\/www.bilibili.com\/video\/.*/i.test(t)&&(t=t.replace(/\?.*$/,"").replace("https://www.bilibili.com/video/","https://player.bilibili.com/player.html?bvid=")),t.includes("drive.google.com")&&(t=t.replace("/view","/preview")),t}const ID=Nt.create({name:"video",group:"block",atom:!0,draggable:!0,addOptions(){return{divider:!1,spacer:!1,allowFullscreen:!0,upload:void 0,frameborder:!1,resourceVideo:"both",width:Eg["size-medium"],HTMLAttributes:{class:"iframe-wrapper",style:"display: flex;justify-content: center;"},button:({editor:t,t:e})=>{var r,n;return{component:qJ,componentProps:{action:()=>{},isActive:()=>t.isActive("video")||!1,disabled:!((n=(r=t.can()).setVideo)!=null&&n.call(r,{})),icon:"Video",tooltip:e("editor.video.tooltip"),editor:t}}}}},addAttributes(){return{src:{default:null,renderHTML:({src:t})=>({src:t?XJ(t):null})},width:{default:this.options.width,renderHTML:({width:t})=>({width:d7(t)})},frameborder:{default:this.options.frameborder?1:0,parseHTML:()=>this.options.frameborder?1:0},allowfullscreen:{default:this.options.allowFullscreen,parseHTML:()=>this.options.allowFullscreen}}},parseHTML(){return[{tag:"div[data-video] iframe"}]},renderHTML({HTMLAttributes:t}){const{width:e="100%"}=t??{},r={...t,width:"100%",height:"100%"},n=`position: relative;overflow: hidden;display: flex;flex: 1;max-width: ${e};`,i=`flex: 1;padding-bottom: ${9/16*100}%;`,a=["div",{style:n},["div",{style:i}],["iframe",r]];return["div",{...this.options.HTMLAttributes,"data-video":""},a]},addCommands(){return{setVideo:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t}),updateVideo:t=>({commands:e})=>e.updateAttributes(this.name,t)}}}),YJ=Nt.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",lt(this.options.HTMLAttributes,t),0]}});var Jx,Zx;if(typeof WeakMap<"u"){let t=new WeakMap;Jx=e=>t.get(e),Zx=(e,r)=>(t.set(e,r),r)}else{const t=[];let r=0;Jx=n=>{for(let i=0;i<t.length;i+=2)if(t[i]==n)return t[i+1]},Zx=(n,i)=>(r==10&&(r=0),t[r++]=n,t[r++]=i)}var or=class{constructor(t,e,r,n){this.width=t,this.height=e,this.map=r,this.problems=n}findCell(t){for(let e=0;e<this.map.length;e++){const r=this.map[e];if(r!=t)continue;const n=e%this.width,i=e/this.width|0;let o=n+1,s=i+1;for(let a=1;o<this.width&&this.map[e+a]==r;a++)o++;for(let a=1;s<this.height&&this.map[e+this.width*a]==r;a++)s++;return{left:n,top:i,right:o,bottom:s}}throw new RangeError(`No cell with offset ${t} found`)}colCount(t){for(let e=0;e<this.map.length;e++)if(this.map[e]==t)return e%this.width;throw new RangeError(`No cell with offset ${t} found`)}nextCell(t,e,r){const{left:n,right:i,top:o,bottom:s}=this.findCell(t);return e=="horiz"?(r<0?n==0:i==this.width)?null:this.map[o*this.width+(r<0?n-1:i)]:(r<0?o==0:s==this.height)?null:this.map[n+this.width*(r<0?o-1:s)]}rectBetween(t,e){const{left:r,right:n,top:i,bottom:o}=this.findCell(t),{left:s,right:a,top:l,bottom:c}=this.findCell(e);return{left:Math.min(r,s),top:Math.min(i,l),right:Math.max(n,a),bottom:Math.max(o,c)}}cellsInRect(t){const e=[],r={};for(let n=t.top;n<t.bottom;n++)for(let i=t.left;i<t.right;i++){const o=n*this.width+i,s=this.map[o];r[s]||(r[s]=!0,!(i==t.left&&i&&this.map[o-1]==s||n==t.top&&n&&this.map[o-this.width]==s)&&e.push(s))}return e}positionAt(t,e,r){for(let n=0,i=0;;n++){const o=i+r.child(n).nodeSize;if(n==t){let s=e+t*this.width;const a=(t+1)*this.width;for(;s<a&&this.map[s]<i;)s++;return s==a?o-1:this.map[s]}i=o}}static get(t){return Jx(t)||Zx(t,JJ(t))}};function JJ(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);const e=ZJ(t),r=t.childCount,n=[];let i=0,o=null;const s=[];for(let c=0,d=e*r;c<d;c++)n[c]=0;for(let c=0,d=0;c<r;c++){const f=t.child(c);d++;for(let g=0;;g++){for(;i<n.length&&n[i]!=0;)i++;if(g==f.childCount)break;const b=f.child(g),{colspan:S,rowspan:w,colwidth:T}=b.attrs;for(let M=0;M<w;M++){if(M+c>=r){(o||(o=[])).push({type:"overlong_rowspan",pos:d,n:w-M});break}const j=i+M*e;for(let $=0;$<S;$++){n[j+$]==0?n[j+$]=d:(o||(o=[])).push({type:"collision",row:c,pos:d,n:S-$});const W=T&&T[$];if(W){const Y=(j+$)%e*2,ee=s[Y];ee==null||ee!=W&&s[Y+1]==1?(s[Y]=W,s[Y+1]=1):ee==W&&s[Y+1]++}}}i+=S,d+=b.nodeSize}const p=(c+1)*e;let m=0;for(;i<p;)n[i++]==0&&m++;m&&(o||(o=[])).push({type:"missing",row:c,n:m}),d++}const a=new or(e,r,n,o);let l=!1;for(let c=0;!l&&c<s.length;c+=2)s[c]!=null&&s[c+1]<r&&(l=!0);return l&&QJ(a,s,t),a}function ZJ(t){let e=-1,r=!1;for(let n=0;n<t.childCount;n++){const i=t.child(n);let o=0;if(r)for(let s=0;s<n;s++){const a=t.child(s);for(let l=0;l<a.childCount;l++){const c=a.child(l);s+c.attrs.rowspan>n&&(o+=c.attrs.colspan)}}for(let s=0;s<i.childCount;s++){const a=i.child(s);o+=a.attrs.colspan,a.attrs.rowspan>1&&(r=!0)}e==-1?e=o:e!=o&&(e=Math.max(e,o))}return e}function QJ(t,e,r){t.problems||(t.problems=[]);const n={};for(let i=0;i<t.map.length;i++){const o=t.map[i];if(n[o])continue;n[o]=!0;const s=r.nodeAt(o);if(!s)throw new RangeError(`No cell with offset ${o} found`);let a=null;const l=s.attrs;for(let c=0;c<l.colspan;c++){const d=(i+c)%t.width,f=e[d*2];f!=null&&(!l.colwidth||l.colwidth[c]!=f)&&((a||(a=eZ(l)))[c]=f)}a&&t.problems.unshift({type:"colwidth mismatch",pos:o,colwidth:a})}}function eZ(t){if(t.colwidth)return t.colwidth.slice();const e=[];for(let r=0;r<t.colspan;r++)e.push(0);return e}function Jr(t){let e=t.cached.tableNodeTypes;if(!e){e=t.cached.tableNodeTypes={};for(const r in t.nodes){const n=t.nodes[r],i=n.spec.tableRole;i&&(e[i]=n)}}return e}var ua=new St("selectingCells");function Rd(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 tZ(t){for(let e=t.depth;e>0;e--){const r=t.node(e).type.spec.tableRole;if(r==="cell"||r==="header_cell")return t.node(e)}return null}function Hi(t){const e=t.selection.$head;for(let r=e.depth;r>0;r--)if(e.node(r).type.spec.tableRole=="row")return!0;return!1}function nv(t){const e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const r=Rd(e.$head)||rZ(e.$head);if(r)return r;throw new RangeError(`No cell found around position ${e.head}`)}function rZ(t){for(let e=t.nodeAfter,r=t.pos;e;e=e.firstChild,r++){const n=e.type.spec.tableRole;if(n=="cell"||n=="header_cell")return t.doc.resolve(r)}for(let e=t.nodeBefore,r=t.pos;e;e=e.lastChild,r--){const n=e.type.spec.tableRole;if(n=="cell"||n=="header_cell")return t.doc.resolve(r-e.nodeSize)}}function Qx(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function nZ(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function KS(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function OD(t,e,r){const n=t.node(-1),i=or.get(n),o=t.start(-1),s=i.nextCell(t.pos-o,e,r);return s==null?null:t.node(0).resolve(o+s)}function Zl(t,e,r=1){const n={...t,colspan:t.colspan-r};return n.colwidth&&(n.colwidth=n.colwidth.slice(),n.colwidth.splice(e,r),n.colwidth.some(i=>i>0)||(n.colwidth=null)),n}function MD(t,e,r=1){const n={...t,colspan:t.colspan+r};if(n.colwidth){n.colwidth=n.colwidth.slice();for(let i=0;i<r;i++)n.colwidth.splice(e,0,0)}return n}function iZ(t,e,r){const n=Jr(e.type.schema).header_cell;for(let i=0;i<t.height;i++)if(e.nodeAt(t.map[r+i*t.width]).type!=n)return!1;return!0}var Ut=class es extends ot{constructor(e,r=e){const n=e.node(-1),i=or.get(n),o=e.start(-1),s=i.rectBetween(e.pos-o,r.pos-o),a=e.node(0),l=i.cellsInRect(s).filter(d=>d!=r.pos-o);l.unshift(r.pos-o);const c=l.map(d=>{const f=n.nodeAt(d);if(!f)throw RangeError(`No cell with offset ${d} found`);const p=o+d+1;return new _1(a.resolve(p),a.resolve(p+f.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=r}map(e,r){const n=e.resolve(r.map(this.$anchorCell.pos)),i=e.resolve(r.map(this.$headCell.pos));if(Qx(n)&&Qx(i)&&KS(n,i)){const o=this.$anchorCell.node(-1)!=n.node(-1);return o&&this.isRowSelection()?es.rowSelection(n,i):o&&this.isColSelection()?es.colSelection(n,i):new es(n,i)}return et.between(n,i)}content(){const e=this.$anchorCell.node(-1),r=or.get(e),n=this.$anchorCell.start(-1),i=r.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),o={},s=[];for(let l=i.top;l<i.bottom;l++){const c=[];for(let d=l*r.width+i.left,f=i.left;f<i.right;f++,d++){const p=r.map[d];if(o[p])continue;o[p]=!0;const m=r.findCell(p);let g=e.nodeAt(p);if(!g)throw RangeError(`No cell with offset ${p} found`);const b=i.left-m.left,S=m.right-i.right;if(b>0||S>0){let w=g.attrs;if(b>0&&(w=Zl(w,0,b)),S>0&&(w=Zl(w,w.colspan-S,S)),m.left<i.left){if(g=g.type.createAndFill(w),!g)throw RangeError(`Could not create cell with attrs ${JSON.stringify(w)}`)}else g=g.type.create(w,g.content)}if(m.top<i.top||m.bottom>i.bottom){const w={...g.attrs,rowspan:Math.min(m.bottom,i.bottom)-Math.max(m.top,i.top)};m.top<i.top?g=g.type.createAndFill(w):g=g.type.create(w,g.content)}c.push(g)}s.push(e.child(l).copy(Le.from(c)))}const a=this.isColSelection()&&this.isRowSelection()?e:s;return new qe(Le.from(a),1,1)}replace(e,r=qe.empty){const n=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){const{$from:a,$to:l}=i[s],c=e.mapping.slice(n);e.replace(c.map(a.pos),c.map(l.pos),s?qe.empty:r)}const o=ot.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);o&&e.setSelection(o)}replaceWith(e,r){this.replace(e,new qe(Le.from(r),0,0))}forEachCell(e){const r=this.$anchorCell.node(-1),n=or.get(r),i=this.$anchorCell.start(-1),o=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i));for(let s=0;s<o.length;s++)e(r.nodeAt(o[s]),i+o[s])}isColSelection(){const e=this.$anchorCell.index(-1),r=this.$headCell.index(-1);if(Math.min(e,r)>0)return!1;const n=e+this.$anchorCell.nodeAfter.attrs.rowspan,i=r+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,i)==this.$headCell.node(-1).childCount}static colSelection(e,r=e){const n=e.node(-1),i=or.get(n),o=e.start(-1),s=i.findCell(e.pos-o),a=i.findCell(r.pos-o),l=e.node(0);return s.top<=a.top?(s.top>0&&(e=l.resolve(o+i.map[s.left])),a.bottom<i.height&&(r=l.resolve(o+i.map[i.width*(i.height-1)+a.right-1]))):(a.top>0&&(r=l.resolve(o+i.map[a.left])),s.bottom<i.height&&(e=l.resolve(o+i.map[i.width*(i.height-1)+s.right-1]))),new es(e,r)}isRowSelection(){const e=this.$anchorCell.node(-1),r=or.get(e),n=this.$anchorCell.start(-1),i=r.colCount(this.$anchorCell.pos-n),o=r.colCount(this.$headCell.pos-n);if(Math.min(i,o)>0)return!1;const s=i+this.$anchorCell.nodeAfter.attrs.colspan,a=o+this.$headCell.nodeAfter.attrs.colspan;return Math.max(s,a)==r.width}eq(e){return e instanceof es&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,r=e){const n=e.node(-1),i=or.get(n),o=e.start(-1),s=i.findCell(e.pos-o),a=i.findCell(r.pos-o),l=e.node(0);return s.left<=a.left?(s.left>0&&(e=l.resolve(o+i.map[s.top*i.width])),a.right<i.width&&(r=l.resolve(o+i.map[i.width*(a.top+1)-1]))):(a.left>0&&(r=l.resolve(o+i.map[a.top*i.width])),s.right<i.width&&(e=l.resolve(o+i.map[i.width*(s.top+1)-1]))),new es(e,r)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,r){return new es(e.resolve(r.anchor),e.resolve(r.head))}static create(e,r,n=r){return new es(e.resolve(r),e.resolve(n))}getBookmark(){return new oZ(this.$anchorCell.pos,this.$headCell.pos)}};Ut.prototype.visible=!1;ot.jsonID("cell",Ut);var oZ=class ND{constructor(e,r){this.anchor=e,this.head=r}map(e){return new ND(e.map(this.anchor),e.map(this.head))}resolve(e){const r=e.resolve(this.anchor),n=e.resolve(this.head);return r.parent.type.spec.tableRole=="row"&&n.parent.type.spec.tableRole=="row"&&r.index()<r.parent.childCount&&n.index()<n.parent.childCount&&KS(r,n)?new Ut(r,n):ot.near(n,1)}};function sZ(t){if(!(t.selection instanceof Ut))return null;const e=[];return t.selection.forEachCell((r,n)=>{e.push(Qt.node(n,n+r.nodeSize,{class:"selectedCell"}))}),Tt.create(t.doc,e)}function aZ({$from:t,$to:e}){if(t.pos==e.pos||t.pos<e.pos-6)return!1;let r=t.pos,n=e.pos,i=t.depth;for(;i>=0&&!(t.after(i+1)<t.end(i));i--,r++);for(let o=e.depth;o>=0&&!(e.before(o+1)>e.start(o));o--,n--);return r==n&&/row|table/.test(t.node(i).type.spec.tableRole)}function lZ({$from:t,$to:e}){let r,n;for(let i=t.depth;i>0;i--){const o=t.node(i);if(o.type.spec.tableRole==="cell"||o.type.spec.tableRole==="header_cell"){r=o;break}}for(let i=e.depth;i>0;i--){const o=e.node(i);if(o.type.spec.tableRole==="cell"||o.type.spec.tableRole==="header_cell"){n=o;break}}return r!==n&&e.parentOffset===0}function cZ(t,e,r){const n=(e||t).selection,i=(e||t).doc;let o,s;if(n instanceof rt&&(s=n.node.type.spec.tableRole)){if(s=="cell"||s=="header_cell")o=Ut.create(i,n.from);else if(s=="row"){const a=i.resolve(n.from+1);o=Ut.rowSelection(a,a)}else if(!r){const a=or.get(n.node),l=n.from+1,c=l+a.map[a.width*a.height-1];o=Ut.create(i,l+1,c)}}else n instanceof et&&aZ(n)?o=et.create(i,n.from):n instanceof et&&lZ(n)&&(o=et.create(i,n.$from.start(),n.$from.end()));return o&&(e||(e=t.tr)).setSelection(o),e}var uZ=new St("fix-tables");function DD(t,e,r,n){const i=t.childCount,o=e.childCount;e:for(let s=0,a=0;s<o;s++){const l=e.child(s);for(let c=a,d=Math.min(i,s+3);c<d;c++)if(t.child(c)==l){a=c+1,r+=l.nodeSize;continue e}n(l,r),a<i&&t.child(a).sameMarkup(l)?DD(t.child(a),l,r+1,n):l.nodesBetween(0,l.content.size,n,r+1),r+=l.nodeSize}}function PD(t,e){let r;const n=(i,o)=>{i.type.spec.tableRole=="table"&&(r=dZ(t,i,o,r))};return e?e.doc!=t.doc&&DD(e.doc,t.doc,0,n):t.doc.descendants(n),r}function dZ(t,e,r,n){const i=or.get(e);if(!i.problems)return n;n||(n=t.tr);const o=[];for(let l=0;l<i.height;l++)o.push(0);for(let l=0;l<i.problems.length;l++){const c=i.problems[l];if(c.type=="collision"){const d=e.nodeAt(c.pos);if(!d)continue;const f=d.attrs;for(let p=0;p<f.rowspan;p++)o[c.row+p]+=c.n;n.setNodeMarkup(n.mapping.map(r+1+c.pos),null,Zl(f,f.colspan-c.n,c.n))}else if(c.type=="missing")o[c.row]+=c.n;else if(c.type=="overlong_rowspan"){const d=e.nodeAt(c.pos);if(!d)continue;n.setNodeMarkup(n.mapping.map(r+1+c.pos),null,{...d.attrs,rowspan:d.attrs.rowspan-c.n})}else if(c.type=="colwidth mismatch"){const d=e.nodeAt(c.pos);if(!d)continue;n.setNodeMarkup(n.mapping.map(r+1+c.pos),null,{...d.attrs,colwidth:c.colwidth})}}let s,a;for(let l=0;l<o.length;l++)o[l]&&(s==null&&(s=l),a=l);for(let l=0,c=r+1;l<i.height;l++){const d=e.child(l),f=c+d.nodeSize,p=o[l];if(p>0){let m="cell";d.firstChild&&(m=d.firstChild.type.spec.tableRole);const g=[];for(let S=0;S<p;S++){const w=Jr(t.schema)[m].createAndFill();w&&g.push(w)}const b=(l==0||s==l-1)&&a==l?c+1:f-1;n.insert(n.mapping.map(b),g)}c=f}return n.setMeta(uZ,{fixTables:!0})}function Ao(t){const e=t.selection,r=nv(t),n=r.node(-1),i=r.start(-1),o=or.get(n);return{...e instanceof Ut?o.rectBetween(e.$anchorCell.pos-i,e.$headCell.pos-i):o.findCell(r.pos-i),tableStart:i,map:o,table:n}}function LD(t,{map:e,tableStart:r,table:n},i){let o=i>0?-1:0;iZ(e,n,i+o)&&(o=i==0||i==e.width?null:0);for(let s=0;s<e.height;s++){const a=s*e.width+i;if(i>0&&i<e.width&&e.map[a-1]==e.map[a]){const l=e.map[a],c=n.nodeAt(l);t.setNodeMarkup(t.mapping.map(r+l),null,MD(c.attrs,i-e.colCount(l))),s+=c.attrs.rowspan-1}else{const l=o==null?Jr(n.type.schema).cell:n.nodeAt(e.map[a+o]).type,c=e.positionAt(s,i,n);t.insert(t.mapping.map(r+c),l.createAndFill())}}return t}function fZ(t,e){if(!Hi(t))return!1;if(e){const r=Ao(t);e(LD(t.tr,r,r.left))}return!0}function hZ(t,e){if(!Hi(t))return!1;if(e){const r=Ao(t);e(LD(t.tr,r,r.right))}return!0}function pZ(t,{map:e,table:r,tableStart:n},i){const o=t.mapping.maps.length;for(let s=0;s<e.height;){const a=s*e.width+i,l=e.map[a],c=r.nodeAt(l),d=c.attrs;if(i>0&&e.map[a-1]==l||i<e.width-1&&e.map[a+1]==l)t.setNodeMarkup(t.mapping.slice(o).map(n+l),null,Zl(d,i-e.colCount(l)));else{const f=t.mapping.slice(o).map(n+l);t.delete(f,f+c.nodeSize)}s+=d.rowspan}}function mZ(t,e){if(!Hi(t))return!1;if(e){const r=Ao(t),n=t.tr;if(r.left==0&&r.right==r.map.width)return!1;for(let i=r.right-1;pZ(n,r,i),i!=r.left;i--){const o=r.tableStart?n.doc.nodeAt(r.tableStart-1):n.doc;if(!o)throw RangeError("No table found");r.table=o,r.map=or.get(o)}e(n)}return!0}function gZ(t,e,r){var n;const i=Jr(e.type.schema).header_cell;for(let o=0;o<t.width;o++)if(((n=e.nodeAt(t.map[o+r*t.width]))==null?void 0:n.type)!=i)return!1;return!0}function FD(t,{map:e,tableStart:r,table:n},i){var o;let s=r;for(let c=0;c<i;c++)s+=n.child(c).nodeSize;const a=[];let l=i>0?-1:0;gZ(e,n,i+l)&&(l=i==0||i==e.height?null:0);for(let c=0,d=e.width*i;c<e.width;c++,d++)if(i>0&&i<e.height&&e.map[d]==e.map[d-e.width]){const f=e.map[d],p=n.nodeAt(f).attrs;t.setNodeMarkup(r+f,null,{...p,rowspan:p.rowspan+1}),c+=p.colspan-1}else{const f=l==null?Jr(n.type.schema).cell:(o=n.nodeAt(e.map[d+l*e.width]))==null?void 0:o.type,p=f==null?void 0:f.createAndFill();p&&a.push(p)}return t.insert(s,Jr(n.type.schema).row.create(null,a)),t}function yZ(t,e){if(!Hi(t))return!1;if(e){const r=Ao(t);e(FD(t.tr,r,r.top))}return!0}function vZ(t,e){if(!Hi(t))return!1;if(e){const r=Ao(t);e(FD(t.tr,r,r.bottom))}return!0}function bZ(t,{map:e,table:r,tableStart:n},i){let o=0;for(let c=0;c<i;c++)o+=r.child(c).nodeSize;const s=o+r.child(i).nodeSize,a=t.mapping.maps.length;t.delete(o+n,s+n);const l=new Set;for(let c=0,d=i*e.width;c<e.width;c++,d++){const f=e.map[d];if(!l.has(f)){if(l.add(f),i>0&&f==e.map[d-e.width]){const p=r.nodeAt(f).attrs;t.setNodeMarkup(t.mapping.slice(a).map(f+n),null,{...p,rowspan:p.rowspan-1}),c+=p.colspan-1}else if(i<e.height&&f==e.map[d+e.width]){const p=r.nodeAt(f),m=p.attrs,g=p.type.create({...m,rowspan:p.attrs.rowspan-1},p.content),b=e.positionAt(i+1,c,r);t.insert(t.mapping.slice(a).map(n+b),g),c+=m.colspan-1}}}}function wZ(t,e){if(!Hi(t))return!1;if(e){const r=Ao(t),n=t.tr;if(r.top==0&&r.bottom==r.map.height)return!1;for(let i=r.bottom-1;bZ(n,r,i),i!=r.top;i--){const o=r.tableStart?n.doc.nodeAt(r.tableStart-1):n.doc;if(!o)throw RangeError("No table found");r.table=o,r.map=or.get(r.table)}e(n)}return!0}function CT(t){const e=t.content;return e.childCount==1&&e.child(0).isTextblock&&e.child(0).childCount==0}function xZ({width:t,height:e,map:r},n){let i=n.top*t+n.left,o=i,s=(n.bottom-1)*t+n.left,a=i+(n.right-n.left-1);for(let l=n.top;l<n.bottom;l++){if(n.left>0&&r[o]==r[o-1]||n.right<t&&r[a]==r[a+1])return!0;o+=t,a+=t}for(let l=n.left;l<n.right;l++){if(n.top>0&&r[i]==r[i-t]||n.bottom<e&&r[s]==r[s+t])return!0;i++,s++}return!1}function ET(t,e){const r=t.selection;if(!(r instanceof Ut)||r.$anchorCell.pos==r.$headCell.pos)return!1;const n=Ao(t),{map:i}=n;if(xZ(i,n))return!1;if(e){const o=t.tr,s={};let a=Le.empty,l,c;for(let d=n.top;d<n.bottom;d++)for(let f=n.left;f<n.right;f++){const p=i.map[d*i.width+f],m=n.table.nodeAt(p);if(!(s[p]||!m))if(s[p]=!0,l==null)l=p,c=m;else{CT(m)||(a=a.append(m.content));const g=o.mapping.map(p+n.tableStart);o.delete(g,g+m.nodeSize)}}if(l==null||c==null)return!0;if(o.setNodeMarkup(l+n.tableStart,null,{...MD(c.attrs,c.attrs.colspan,n.right-n.left-c.attrs.colspan),rowspan:n.bottom-n.top}),a.size){const d=l+1+c.content.size,f=CT(c)?l+1:d;o.replaceWith(f+n.tableStart,d+n.tableStart,a)}o.setSelection(new Ut(o.doc.resolve(l+n.tableStart))),e(o)}return!0}function TT(t,e){const r=Jr(t.schema);return SZ(({node:n})=>r[n.type.spec.tableRole])(t,e)}function SZ(t){return(e,r)=>{var n;const i=e.selection;let o,s;if(i instanceof Ut){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;o=i.$anchorCell.nodeAfter,s=i.$anchorCell.pos}else{if(o=tZ(i.$from),!o)return!1;s=(n=Rd(i.$from))==null?void 0:n.pos}if(o==null||s==null||o.attrs.colspan==1&&o.attrs.rowspan==1)return!1;if(r){let a=o.attrs;const l=[],c=a.colwidth;a.rowspan>1&&(a={...a,rowspan:1}),a.colspan>1&&(a={...a,colspan:1});const d=Ao(e),f=e.tr;for(let m=0;m<d.right-d.left;m++)l.push(c?{...a,colwidth:c&&c[m]?[c[m]]:null}:a);let p;for(let m=d.top;m<d.bottom;m++){let g=d.map.positionAt(m,d.left,d.table);m==d.top&&(g+=o.nodeSize);for(let b=d.left,S=0;b<d.right;b++,S++)b==d.left&&m==d.top||f.insert(p=f.mapping.map(g+d.tableStart,1),t({node:o,row:m,col:b}).createAndFill(l[S]))}f.setNodeMarkup(s,t({node:o,row:d.top,col:d.left}),l[0]),i instanceof Ut&&f.setSelection(new Ut(f.doc.resolve(i.$anchorCell.pos),p?f.doc.resolve(p):void 0)),r(f)}return!0}}function kZ(t,e){return function(r,n){if(!Hi(r))return!1;const i=nv(r);if(i.nodeAfter.attrs[t]===e)return!1;if(n){const o=r.tr;r.selection instanceof Ut?r.selection.forEachCell((s,a)=>{s.attrs[t]!==e&&o.setNodeMarkup(a,null,{...s.attrs,[t]:e})}):o.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[t]:e}),n(o)}return!0}}function _Z(t){return function(e,r){if(!Hi(e))return!1;if(r){const n=Jr(e.schema),i=Ao(e),o=e.tr,s=i.map.cellsInRect(t=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:t=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),a=s.map(l=>i.table.nodeAt(l));for(let l=0;l<s.length;l++)a[l].type==n.header_cell&&o.setNodeMarkup(i.tableStart+s[l],n.cell,a[l].attrs);if(o.steps.length==0)for(let l=0;l<s.length;l++)o.setNodeMarkup(i.tableStart+s[l],n.header_cell,a[l].attrs);r(o)}return!0}}function AT(t,e,r){const n=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<n.length;i++){const o=e.table.nodeAt(n[i]);if(o&&o.type!==r.header_cell)return!1}return!0}function Lh(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?_Z(t):function(r,n){if(!Hi(r))return!1;if(n){const i=Jr(r.schema),o=Ao(r),s=r.tr,a=AT("row",o,i),l=AT("column",o,i),d=(t==="column"?a:t==="row"?l:!1)?1:0,f=t=="column"?{left:0,top:d,right:1,bottom:o.map.height}:t=="row"?{left:d,top:0,right:o.map.width,bottom:1}:o,p=t=="column"?l?i.cell:i.header_cell:t=="row"?a?i.cell:i.header_cell:i.cell;o.map.cellsInRect(f).forEach(m=>{const g=m+o.tableStart,b=s.doc.nodeAt(g);b&&s.setNodeMarkup(g,p,b.attrs)}),n(s)}return!0}}Lh("row",{useDeprecatedLogic:!0});Lh("column",{useDeprecatedLogic:!0});var CZ=Lh("cell",{useDeprecatedLogic:!0});function EZ(t,e){if(e<0){const r=t.nodeBefore;if(r)return t.pos-r.nodeSize;for(let n=t.index(-1)-1,i=t.before();n>=0;n--){const o=t.node(-1).child(n),s=o.lastChild;if(s)return i-1-s.nodeSize;i-=o.nodeSize}}else{if(t.index()<t.parent.childCount-1)return t.pos+t.nodeAfter.nodeSize;const r=t.node(-1);for(let n=t.indexAfter(-1),i=t.after();n<r.childCount;n++){const o=r.child(n);if(o.childCount)return i+1;i+=o.nodeSize}}return null}function RT(t){return function(e,r){if(!Hi(e))return!1;const n=EZ(nv(e),t);if(n==null)return!1;if(r){const i=e.doc.resolve(n);r(e.tr.setSelection(et.between(i,nZ(i))).scrollIntoView())}return!0}}function TZ(t,e){const r=t.selection.$anchor;for(let n=r.depth;n>0;n--)if(r.node(n).type.spec.tableRole=="table")return e&&e(t.tr.delete(r.before(n),r.after(n)).scrollIntoView()),!0;return!1}function um(t,e){const r=t.selection;if(!(r instanceof Ut))return!1;if(e){const n=t.tr,i=Jr(t.schema).cell.createAndFill().content;r.forEachCell((o,s)=>{o.content.eq(i)||n.replace(n.mapping.map(s+1),n.mapping.map(s+o.nodeSize-1),new qe(i,0,0))}),n.docChanged&&e(n)}return!0}function AZ(t){if(!t.size)return null;let{content:e,openStart:r,openEnd:n}=t;for(;e.childCount==1&&(r>0&&n>0||e.child(0).type.spec.tableRole=="table");)r--,n--,e=e.child(0).content;const i=e.child(0),o=i.type.spec.tableRole,s=i.type.schema,a=[];if(o=="row")for(let l=0;l<e.childCount;l++){let c=e.child(l).content;const d=l?0:Math.max(0,r-1),f=l<e.childCount-1?0:Math.max(0,n-1);(d||f)&&(c=e1(Jr(s).row,new qe(c,d,f)).content),a.push(c)}else if(o=="cell"||o=="header_cell")a.push(r||n?e1(Jr(s).row,new qe(e,r,n)).content:e);else return null;return RZ(s,a)}function RZ(t,e){const r=[];for(let i=0;i<e.length;i++){const o=e[i];for(let s=o.childCount-1;s>=0;s--){const{rowspan:a,colspan:l}=o.child(s).attrs;for(let c=i;c<i+a;c++)r[c]=(r[c]||0)+l}}let n=0;for(let i=0;i<r.length;i++)n=Math.max(n,r[i]);for(let i=0;i<r.length;i++)if(i>=e.length&&e.push(Le.empty),r[i]<n){const o=Jr(t).cell.createAndFill(),s=[];for(let a=r[i];a<n;a++)s.push(o);e[i]=e[i].append(Le.from(s))}return{height:e.length,width:n,rows:e}}function e1(t,e){const r=t.createAndFill();return new k1(r).replace(0,r.content.size,e).doc}function IZ({width:t,height:e,rows:r},n,i){if(t!=n){const o=[],s=[];for(let a=0;a<r.length;a++){const l=r[a],c=[];for(let d=o[a]||0,f=0;d<n;f++){let p=l.child(f%l.childCount);d+p.attrs.colspan>n&&(p=p.type.createChecked(Zl(p.attrs,p.attrs.colspan,d+p.attrs.colspan-n),p.content)),c.push(p),d+=p.attrs.colspan;for(let m=1;m<p.attrs.rowspan;m++)o[a+m]=(o[a+m]||0)+p.attrs.colspan}s.push(Le.from(c))}r=s,t=n}if(e!=i){const o=[];for(let s=0,a=0;s<i;s++,a++){const l=[],c=r[a%e];for(let d=0;d<c.childCount;d++){let f=c.child(d);s+f.attrs.rowspan>i&&(f=f.type.create({...f.attrs,rowspan:Math.max(1,i-f.attrs.rowspan)},f.content)),l.push(f)}o.push(Le.from(l))}r=o,e=i}return{width:t,height:e,rows:r}}function OZ(t,e,r,n,i,o,s){const a=t.doc.type.schema,l=Jr(a);let c,d;if(i>e.width)for(let f=0,p=0;f<e.height;f++){const m=r.child(f);p+=m.nodeSize;const g=[];let b;m.lastChild==null||m.lastChild.type==l.cell?b=c||(c=l.cell.createAndFill()):b=d||(d=l.header_cell.createAndFill());for(let S=e.width;S<i;S++)g.push(b);t.insert(t.mapping.slice(s).map(p-1+n),g)}if(o>e.height){const f=[];for(let g=0,b=(e.height-1)*e.width;g<Math.max(e.width,i);g++){const S=g>=e.width?!1:r.nodeAt(e.map[b+g]).type==l.header_cell;f.push(S?d||(d=l.header_cell.createAndFill()):c||(c=l.cell.createAndFill()))}const p=l.row.create(null,Le.from(f)),m=[];for(let g=e.height;g<o;g++)m.push(p);t.insert(t.mapping.slice(s).map(n+r.nodeSize-2),m)}return!!(c||d)}function IT(t,e,r,n,i,o,s,a){if(s==0||s==e.height)return!1;let l=!1;for(let c=i;c<o;c++){const d=s*e.width+c,f=e.map[d];if(e.map[d-e.width]==f){l=!0;const p=r.nodeAt(f),{top:m,left:g}=e.findCell(f);t.setNodeMarkup(t.mapping.slice(a).map(f+n),null,{...p.attrs,rowspan:s-m}),t.insert(t.mapping.slice(a).map(e.positionAt(s,g,r)),p.type.createAndFill({...p.attrs,rowspan:m+p.attrs.rowspan-s})),c+=p.attrs.colspan-1}}return l}function OT(t,e,r,n,i,o,s,a){if(s==0||s==e.width)return!1;let l=!1;for(let c=i;c<o;c++){const d=c*e.width+s,f=e.map[d];if(e.map[d-1]==f){l=!0;const p=r.nodeAt(f),m=e.colCount(f),g=t.mapping.slice(a).map(f+n);t.setNodeMarkup(g,null,Zl(p.attrs,s-m,p.attrs.colspan-(s-m))),t.insert(g+p.nodeSize,p.type.createAndFill(Zl(p.attrs,0,s-m))),c+=p.attrs.rowspan-1}}return l}function MT(t,e,r,n,i){let o=r?t.doc.nodeAt(r-1):t.doc;if(!o)throw new Error("No table found");let s=or.get(o);const{top:a,left:l}=n,c=l+i.width,d=a+i.height,f=t.tr;let p=0;function m(){if(o=r?f.doc.nodeAt(r-1):f.doc,!o)throw new Error("No table found");s=or.get(o),p=f.mapping.maps.length}OZ(f,s,o,r,c,d,p)&&m(),IT(f,s,o,r,l,c,a,p)&&m(),IT(f,s,o,r,l,c,d,p)&&m(),OT(f,s,o,r,a,d,l,p)&&m(),OT(f,s,o,r,a,d,c,p)&&m();for(let g=a;g<d;g++){const b=s.positionAt(g,l,o),S=s.positionAt(g,c,o);f.replace(f.mapping.slice(p).map(b+r),f.mapping.slice(p).map(S+r),new qe(i.rows[g-a],0,0))}m(),f.setSelection(new Ut(f.doc.resolve(r+s.positionAt(a,l,o)),f.doc.resolve(r+s.positionAt(d-1,c-1,o)))),e(f)}var MZ=D1({ArrowLeft:dm("horiz",-1),ArrowRight:dm("horiz",1),ArrowUp:dm("vert",-1),ArrowDown:dm("vert",1),"Shift-ArrowLeft":fm("horiz",-1),"Shift-ArrowRight":fm("horiz",1),"Shift-ArrowUp":fm("vert",-1),"Shift-ArrowDown":fm("vert",1),Backspace:um,"Mod-Backspace":um,Delete:um,"Mod-Delete":um});function Km(t,e,r){return r.eq(t.selection)?!1:(e&&e(t.tr.setSelection(r).scrollIntoView()),!0)}function dm(t,e){return(r,n,i)=>{if(!i)return!1;const o=r.selection;if(o instanceof Ut)return Km(r,n,ot.near(o.$headCell,e));if(t!="horiz"&&!o.empty)return!1;const s=jD(i,t,e);if(s==null)return!1;if(t=="horiz")return Km(r,n,ot.near(r.doc.resolve(o.head+e),e));{const a=r.doc.resolve(s),l=OD(a,t,e);let c;return l?c=ot.near(l,1):e<0?c=ot.near(r.doc.resolve(a.before(-1)),-1):c=ot.near(r.doc.resolve(a.after(-1)),1),Km(r,n,c)}}}function fm(t,e){return(r,n,i)=>{if(!i)return!1;const o=r.selection;let s;if(o instanceof Ut)s=o;else{const l=jD(i,t,e);if(l==null)return!1;s=new Ut(r.doc.resolve(l))}const a=OD(s.$headCell,t,e);return a?Km(r,n,new Ut(s.$anchorCell,a)):!1}}function NZ(t,e){const r=t.state.doc,n=Rd(r.resolve(e));return n?(t.dispatch(t.state.tr.setSelection(new Ut(n))),!0):!1}function DZ(t,e,r){if(!Hi(t.state))return!1;let n=AZ(r);const i=t.state.selection;if(i instanceof Ut){n||(n={width:1,height:1,rows:[Le.from(e1(Jr(t.state.schema).cell,r))]});const o=i.$anchorCell.node(-1),s=i.$anchorCell.start(-1),a=or.get(o).rectBetween(i.$anchorCell.pos-s,i.$headCell.pos-s);return n=IZ(n,a.right-a.left,a.bottom-a.top),MT(t.state,t.dispatch,s,a,n),!0}else if(n){const o=nv(t.state),s=o.start(-1);return MT(t.state,t.dispatch,s,or.get(o.node(-1)).findCell(o.pos-s),n),!0}else return!1}function PZ(t,e){var r;if(e.ctrlKey||e.metaKey)return;const n=NT(t,e.target);let i;if(e.shiftKey&&t.state.selection instanceof Ut)o(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&n&&(i=Rd(t.state.selection.$anchor))!=null&&((r=Ew(t,e))==null?void 0:r.pos)!=i.pos)o(i,e),e.preventDefault();else if(!n)return;function o(l,c){let d=Ew(t,c);const f=ua.getState(t.state)==null;if(!d||!KS(l,d))if(f)d=l;else return;const p=new Ut(l,d);if(f||!t.state.selection.eq(p)){const m=t.state.tr.setSelection(p);f&&m.setMeta(ua,l.pos),t.dispatch(m)}}function s(){t.root.removeEventListener("mouseup",s),t.root.removeEventListener("dragstart",s),t.root.removeEventListener("mousemove",a),ua.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(ua,-1))}function a(l){const c=l,d=ua.getState(t.state);let f;if(d!=null)f=t.state.doc.resolve(d);else if(NT(t,c.target)!=n&&(f=Ew(t,e),!f))return s();f&&o(f,c)}t.root.addEventListener("mouseup",s),t.root.addEventListener("dragstart",s),t.root.addEventListener("mousemove",a)}function jD(t,e,r){if(!(t.state.selection instanceof et))return null;const{$head:n}=t.state.selection;for(let i=n.depth-1;i>=0;i--){const o=n.node(i);if((r<0?n.index(i):n.indexAfter(i))!=(r<0?0:o.childCount))return null;if(o.type.spec.tableRole=="cell"||o.type.spec.tableRole=="header_cell"){const a=n.before(i),l=e=="vert"?r>0?"down":"up":r>0?"right":"left";return t.endOfTextblock(l)?a:null}}return null}function NT(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function Ew(t,e){const r=t.posAtCoords({left:e.clientX,top:e.clientY});return r&&r?Rd(t.state.doc.resolve(r.pos)):null}var LZ=class{constructor(e,r){this.node=e,this.defaultCellMinWidth=r,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${r}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),t1(e,this.colgroup,this.table,r),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!=this.node.type?!1:(this.node=e,t1(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function t1(t,e,r,n,i,o){var s;let a=0,l=!0,c=e.firstChild;const d=t.firstChild;if(d){for(let f=0,p=0;f<d.childCount;f++){const{colspan:m,colwidth:g}=d.child(f).attrs;for(let b=0;b<m;b++,p++){const S=i==p?o:g&&g[b],w=S?S+"px":"";if(a+=S||n,S||(l=!1),c)c.style.width!=w&&(c.style.width=w),c=c.nextSibling;else{const T=document.createElement("col");T.style.width=w,e.appendChild(T)}}}for(;c;){const f=c.nextSibling;(s=c.parentNode)==null||s.removeChild(c),c=f}l?(r.style.width=a+"px",r.style.minWidth=""):(r.style.width="",r.style.minWidth=a+"px")}}var Wn=new St("tableColumnResizing");function FZ({handleWidth:t=5,cellMinWidth:e=25,defaultCellMinWidth:r=100,View:n=LZ,lastColumnResizable:i=!0}={}){const o=new _t({key:Wn,state:{init(s,a){var l,c;const d=(c=(l=o.spec)==null?void 0:l.props)==null?void 0:c.nodeViews,f=Jr(a.schema).table.name;return n&&d&&(d[f]=(p,m)=>new n(p,r,m)),new jZ(-1,!1)},apply(s,a){return a.apply(s)}},props:{attributes:s=>{const a=Wn.getState(s);return a&&a.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(s,a)=>{BZ(s,a,t,i)},mouseleave:s=>{zZ(s)},mousedown:(s,a)=>{HZ(s,a,e,r)}},decorations:s=>{const a=Wn.getState(s);if(a&&a.activeHandle>-1)return GZ(s,a.activeHandle)},nodeViews:{}}});return o}var jZ=class qm{constructor(e,r){this.activeHandle=e,this.dragging=r}apply(e){const r=this,n=e.getMeta(Wn);if(n&&n.setHandle!=null)return new qm(n.setHandle,!1);if(n&&n.setDragging!==void 0)return new qm(r.activeHandle,n.setDragging);if(r.activeHandle>-1&&e.docChanged){let i=e.mapping.map(r.activeHandle,-1);return Qx(e.doc.resolve(i))||(i=-1),new qm(i,r.dragging)}return r}};function BZ(t,e,r,n){const i=Wn.getState(t.state);if(i&&!i.dragging){const o=UZ(e.target);let s=-1;if(o){const{left:a,right:l}=o.getBoundingClientRect();e.clientX-a<=r?s=DT(t,e,"left",r):l-e.clientX<=r&&(s=DT(t,e,"right",r))}if(s!=i.activeHandle){if(!n&&s!==-1){const a=t.state.doc.resolve(s),l=a.node(-1),c=or.get(l),d=a.start(-1);if(c.colCount(a.pos-d)+a.nodeAfter.attrs.colspan-1==c.width-1)return}BD(t,s)}}}function zZ(t){const e=Wn.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&BD(t,-1)}function HZ(t,e,r,n){var i;const o=(i=t.dom.ownerDocument.defaultView)!=null?i:window,s=Wn.getState(t.state);if(!s||s.activeHandle==-1||s.dragging)return!1;const a=t.state.doc.nodeAt(s.activeHandle),l=$Z(t,s.activeHandle,a.attrs);t.dispatch(t.state.tr.setMeta(Wn,{setDragging:{startX:e.clientX,startWidth:l}}));function c(f){o.removeEventListener("mouseup",c),o.removeEventListener("mousemove",d);const p=Wn.getState(t.state);p!=null&&p.dragging&&(WZ(t,p.activeHandle,PT(p.dragging,f,r)),t.dispatch(t.state.tr.setMeta(Wn,{setDragging:null})))}function d(f){if(!f.which)return c(f);const p=Wn.getState(t.state);if(p&&p.dragging){const m=PT(p.dragging,f,r);LT(t,p.activeHandle,m,n)}}return LT(t,s.activeHandle,l,n),o.addEventListener("mouseup",c),o.addEventListener("mousemove",d),e.preventDefault(),!0}function $Z(t,e,{colspan:r,colwidth:n}){const i=n&&n[n.length-1];if(i)return i;const o=t.domAtPos(e);let a=o.node.childNodes[o.offset].offsetWidth,l=r;if(n)for(let c=0;c<r;c++)n[c]&&(a-=n[c],l--);return a/l}function UZ(t){for(;t&&t.nodeName!="TD"&&t.nodeName!="TH";)t=t.classList&&t.classList.contains("ProseMirror")?null:t.parentNode;return t}function DT(t,e,r,n){const i=r=="right"?-n:n,o=t.posAtCoords({left:e.clientX+i,top:e.clientY});if(!o)return-1;const{pos:s}=o,a=Rd(t.state.doc.resolve(s));if(!a)return-1;if(r=="right")return a.pos;const l=or.get(a.node(-1)),c=a.start(-1),d=l.map.indexOf(a.pos-c);return d%l.width==0?-1:c+l.map[d-1]}function PT(t,e,r){const n=e.clientX-t.startX;return Math.max(r,t.startWidth+n)}function BD(t,e){t.dispatch(t.state.tr.setMeta(Wn,{setHandle:e}))}function WZ(t,e,r){const n=t.state.doc.resolve(e),i=n.node(-1),o=or.get(i),s=n.start(-1),a=o.colCount(n.pos-s)+n.nodeAfter.attrs.colspan-1,l=t.state.tr;for(let c=0;c<o.height;c++){const d=c*o.width+a;if(c&&o.map[d]==o.map[d-o.width])continue;const f=o.map[d],p=i.nodeAt(f).attrs,m=p.colspan==1?0:a-o.colCount(f);if(p.colwidth&&p.colwidth[m]==r)continue;const g=p.colwidth?p.colwidth.slice():VZ(p.colspan);g[m]=r,l.setNodeMarkup(s+f,null,{...p,colwidth:g})}l.docChanged&&t.dispatch(l)}function LT(t,e,r,n){const i=t.state.doc.resolve(e),o=i.node(-1),s=i.start(-1),a=or.get(o).colCount(i.pos-s)+i.nodeAfter.attrs.colspan-1;let l=t.domAtPos(i.start(-1)).node;for(;l&&l.nodeName!="TABLE";)l=l.parentNode;l&&t1(o,l.firstChild,l,n,a,r)}function VZ(t){return Array(t).fill(0)}function GZ(t,e){var r;const n=[],i=t.doc.resolve(e),o=i.node(-1);if(!o)return Tt.empty;const s=or.get(o),a=i.start(-1),l=s.colCount(i.pos-a)+i.nodeAfter.attrs.colspan-1;for(let c=0;c<s.height;c++){const d=l+c*s.width;if((l==s.width-1||s.map[d]!=s.map[d+1])&&(c==0||s.map[d]!=s.map[d-s.width])){const f=s.map[d],p=a+f+o.nodeAt(f).nodeSize-1,m=document.createElement("div");m.className="column-resize-handle",(r=Wn.getState(t))!=null&&r.dragging&&n.push(Qt.node(a+f,a+f+o.nodeAt(f).nodeSize,{class:"column-resize-dragging"})),n.push(Qt.widget(p,m))}}return Tt.create(t.doc,n)}function KZ({allowTableNodeSelection:t=!1}={}){return new _t({key:ua,state:{init(){return null},apply(e,r){const n=e.getMeta(ua);if(n!=null)return n==-1?null:n;if(r==null||!e.docChanged)return r;const{deleted:i,pos:o}=e.mapping.mapResult(r);return i?null:o}},props:{decorations:sZ,handleDOMEvents:{mousedown:PZ},createSelectionBetween(e){return ua.getState(e.state)!=null?e.state.selection:null},handleTripleClick:NZ,handleKeyDown:MZ,handlePaste:DZ},appendTransaction(e,r,n){return cZ(n,PD(n,r),t)}})}function r1(t,e){return e?["width",`${Math.max(e,t)}px`]:["min-width",`${t}px`]}function FT(t,e,r,n,i,o){var s;let a=0,l=!0,c=e.firstChild;const d=t.firstChild;if(d!==null)for(let f=0,p=0;f<d.childCount;f+=1){const{colspan:m,colwidth:g}=d.child(f).attrs;for(let b=0;b<m;b+=1,p+=1){const S=i===p?o:g&&g[b],w=S?`${S}px`:"";if(a+=S||n,S||(l=!1),c){if(c.style.width!==w){const[T,M]=r1(n,S);c.style.setProperty(T,M)}c=c.nextSibling}else{const T=document.createElement("col"),[M,j]=r1(n,S);T.style.setProperty(M,j),e.appendChild(T)}}}for(;c;){const f=c.nextSibling;(s=c.parentNode)===null||s===void 0||s.removeChild(c),c=f}l?(r.style.width=`${a}px`,r.style.minWidth=""):(r.style.width="",r.style.minWidth=`${a}px`)}class qZ{constructor(e,r){this.node=e,this.cellMinWidth=r,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")),FT(e,this.colgroup,this.table,r),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!==this.node.type?!1:(this.node=e,FT(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){return e.type==="attributes"&&(e.target===this.table||this.colgroup.contains(e.target))}}function XZ(t,e,r,n){let i=0,o=!0;const s=[],a=t.firstChild;if(!a)return{};for(let f=0,p=0;f<a.childCount;f+=1){const{colspan:m,colwidth:g}=a.child(f).attrs;for(let b=0;b<m;b+=1,p+=1){const S=r===p?n:g&&g[b];i+=S||e,S||(o=!1);const[w,T]=r1(e,S);s.push(["col",{style:`${w}: ${T}`}])}}const l=o?`${i}px`:"",c=o?"":`${i}px`;return{colgroup:["colgroup",{},...s],tableWidth:l,tableMinWidth:c}}function jT(t,e){return t.createAndFill()}function YZ(t){if(t.cached.tableNodeTypes)return t.cached.tableNodeTypes;const e={};return Object.keys(t.nodes).forEach(r=>{const n=t.nodes[r];n.spec.tableRole&&(e[n.spec.tableRole]=n)}),t.cached.tableNodeTypes=e,e}function JZ(t,e,r,n,i){const o=YZ(t),s=[],a=[];for(let c=0;c<r;c+=1){const d=jT(o.cell);if(d&&a.push(d),n){const f=jT(o.header_cell);f&&s.push(f)}}const l=[];for(let c=0;c<e;c+=1)l.push(o.row.createChecked(null,n&&c===0?s:a));return o.table.createChecked(null,l)}function ZZ(t){return t instanceof Ut}const hm=({editor:t})=>{const{selection:e}=t.state;if(!ZZ(e))return!1;let r=0;const n=GI(e.ranges[0].$from,o=>o.type.name==="table");return n==null||n.node.descendants(o=>{if(o.type.name==="table")return!1;["tableCell","tableHeader"].includes(o.type.name)&&(r+=1)}),r===e.ranges.length?(t.commands.deleteTable(),!0):!1},QZ=Nt.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,View:qZ,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:t,HTMLAttributes:e}){const{colgroup:r,tableWidth:n,tableMinWidth:i}=XZ(t,this.options.cellMinWidth);return["table",lt(this.options.HTMLAttributes,e,{style:n?`width: ${n}`:`min-width: ${i}`}),r,["tbody",0]]},addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:r=!0}={})=>({tr:n,dispatch:i,editor:o})=>{const s=JZ(o.schema,t,e,r);if(i){const a=n.selection.from+1;n.replaceSelectionWith(s).scrollIntoView().setSelection(et.near(n.doc.resolve(a)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>fZ(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>hZ(t,e),deleteColumn:()=>({state:t,dispatch:e})=>mZ(t,e),addRowBefore:()=>({state:t,dispatch:e})=>yZ(t,e),addRowAfter:()=>({state:t,dispatch:e})=>vZ(t,e),deleteRow:()=>({state:t,dispatch:e})=>wZ(t,e),deleteTable:()=>({state:t,dispatch:e})=>TZ(t,e),mergeCells:()=>({state:t,dispatch:e})=>ET(t,e),splitCell:()=>({state:t,dispatch:e})=>TT(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>Lh("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>Lh("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>CZ(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>ET(t,e)?!0:TT(t,e),setCellAttribute:(t,e)=>({state:r,dispatch:n})=>kZ(t,e)(r,n),goToNextCell:()=>({state:t,dispatch:e})=>RT(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>RT(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&PD(t),!0),setCellSelection:t=>({tr:e,dispatch:r})=>{if(r){const n=Ut.create(e.doc,t.anchorCell,t.headCell);e.setSelection(n)}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:hm,"Mod-Backspace":hm,Delete:hm,"Mod-Delete":hm}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[FZ({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],KZ({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(t){const e={name:t.name,options:t.options,storage:t.storage};return{tableRole:dt(Ze(t,"tableRole",e))}}}),eQ=Nt.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?e.split(",").map(n=>parseInt(n,10)):null}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",lt(this.options.HTMLAttributes,t),0]}}),tQ=Nt.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?e.split(",").map(n=>parseInt(n,10)):null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",lt(this.options.HTMLAttributes,t),0]}});function rQ(t,e,r){if(!t.doc)return t;const n=t.doc.nodeAt(e);if(!n||r===n.attrs.backgroundColor)return t;const i={...n.attrs,backgroundColor:r};return t.setNodeMarkup(e,n.type,i,n.marks)}function nQ(t,e,r){const{doc:n,selection:i}=t;return!n||!i||!(i instanceof Ut)||i.forEachCell((o,s)=>{t=rQ(t,s,r)}),t}function BT(t,e){return({tr:r,state:n,dispatch:i})=>{const{selection:o}=n;return r=r.setSelection(o),r=nQ(r,e,t),r.docChanged?(i==null||i(r),!0):!1}}const iQ=yt.create({name:"tableCellBackground",addOptions(){return{types:["tableCell"],HTMLAttributes:{}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{backgroundColor:{parseHTML:t=>t.style.backgroundColor||"",renderHTML:t=>!t.backgroundColor||t.backgroundColor===""?{}:{style:`background-color: ${t.backgroundColor}`}}}}]},addCommands(){return{setTableCellBackground:t=>BT(t,this.options),unsetTableCellBackground:()=>BT("",this.options)}}}),oQ=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,sQ=/CrOS/,aQ=/android|ipad|playbook|silk/i;function zT(t={}){let e=t.ua||typeof navigator<"u"&&navigator.userAgent;return e&&typeof e=="object"&&e.headers&&typeof e.headers["user-agent"]=="string"&&(e=e.headers["user-agent"]),typeof e!="string"?!1:!!(oQ.test(e)&&!sQ.test(e)||t.tablet&&aQ.test(e)||t.tablet&&t.featureDetect&&navigator&&navigator.maxTouchPoints>1&&e.includes("Macintosh")&&e.includes("Safari"))}const HT=t=>Array.from({length:t}).map((e,r)=>r+1);function lQ(t){var d;const[e,r]=J.useState(!0),[n,i]=J.useState({rows:zT()?Xp:qp,cols:zT()?Xp:qp}),[o,s]=J.useState({rows:Yp,cols:Yp});function a(f,p){f===n.rows&&i(m=>({...m,rows:Math.min(f+1,Xp)})),p===n.cols&&i(m=>({...m,cols:Math.min(p+1,Xp)})),s({rows:f,cols:p})}function l(f,p){t==null||t.createTable({rows:f,cols:p,withHeaderRow:e}),c()}function c(){r(!1),i({rows:qp,cols:qp}),s({rows:Yp,cols:Yp})}return x.jsxs(xi,{modal:!0,children:[x.jsx(Si,{asChild:!0,children:t==null?void 0:t.children}),x.jsx(Xn,{className:"richtext-w-full !richtext-p-2",align:"start",side:"bottom",children:x.jsxs("div",{className:"richtext-p-0 table-grid-size-editor",children:[x.jsx("div",{className:"richtext-flex richtext-flex-col richtext-flex-wrap richtext-justify-between richtext-gap-1",children:(d=HT(n==null?void 0:n.rows))==null?void 0:d.map(f=>{var p;return x.jsx("div",{className:"richtext-flex richtext-gap-1",children:(p=HT(n==null?void 0:n.cols))==null?void 0:p.map(m=>x.jsx("div",{className:`richtext-cursor-pointer richtext-border-border ${m<=o.cols&&f<=o.rows&&"!richtext-bg-foreground tableCellActive"}`,onMouseOver:()=>a(f,m),onMouseDown:()=>l(f,m),children:x.jsx("div",{className:"richtext-w-4 richtext-h-4 richtext-p-1 !richtext-border richtext-rounded-[2px] richtext-box-border richtext-border-solid !richtext-border-border"})},`c-${m}`))},`r-${f}`)})}),x.jsxs("div",{className:"richtext-mt-2 richtext-text-sm richtext-text-center richtext-text-zinc-600",children:[o.rows," ","x",o.cols]})]})})]})}function cQ(t){function e(r){t.disabled||t.editor.chain().focus().insertTable({...r,withHeaderRow:!1}).run()}return x.jsx(lQ,{createTable:e,children:x.jsx(Ve,{icon:t==null?void 0:t.icon,tooltip:t==null?void 0:t.tooltip,disabled:t==null?void 0:t.disabled,color:t==null?void 0:t.color,action:t==null?void 0:t.action,isActive:t==null?void 0:t.isActive})})}const uQ=QZ.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),resizable:!0,lastColumnResizable:!0,allowTableNodeSelection:!1,button:({editor:e,t:r})=>({component:cQ,componentProps:{disabled:e.isActive("table")||!1,icon:"Table",tooltip:r("editor.table.tooltip"),editor:e}})}},addExtensions(){return[YJ.configure(this.options.tableRow),tQ.configure(this.options.tableHeader),eQ.configure(this.options.tableCell),iQ.configure(this.options.tableCellBackground)]}}),dQ=yt.create({name:"painter",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,t:r})=>({component:Ve,componentProps:{action:()=>{e.commands.setPainter(e==null?void 0:e.state.selection.$head.marks())},icon:"PaintRoller",tooltip:r("editor.format")}})}},addCommands(){return{setPainter:t=>({view:{dispatch:e,state:{tr:r},dom:n}})=>{const s=`url("data:image/svg+xml;utf8,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="#000" d="M9 22v-6H4V7q0-1.65 1.175-2.825T8 3h12v13h-5v6zM6 10h12V5h-1v4h-2V5h-1v2h-2V5H8q-.825 0-1.412.588T6 7zm0 4h12v-2H6zm0 0v-2z"/></svg>')}"), auto`;return n.style.cursor=s,e(r.setMeta("painterAction",{type:"start",marks:t})),!0}}},addProseMirrorPlugins(){return[new _t({key:new St("format-painter"),state:{init:()=>[],apply:(t,e)=>{const r=t.getMeta("painterAction");return r&&r.type==="start"?e=r.marks:r&&r.type==="end"&&(e=[]),e}},props:{handleDOMEvents:{mousedown(t,e){const r=this.getState(t.state);if(!r||r.length===0)return t.dom.style.cursor="",!1;const n=()=>{document.removeEventListener("mouseup",n);let{dispatch:i,state:{tr:o,selection:s},dom:a}=t;a.style.cursor="",o=o.removeMark(s.from,s.to);for(const l of r)l.type.name!=="link"&&(o=o.addMark(s.from,s.to,l));i(o.setMeta("painterAction",{type:"end"}))};return document.addEventListener("mouseup",n),!0}}}})]}});function fQ({editor:t,...e}){const{t:r}=Ct(),[n,i]=J.useState(-1),[o,s]=J.useState([]),[a,l]=J.useState(""),[c,d]=J.useState(""),[f,p]=J.useState(!1),[m,g]=J.useState(!1);return J.useEffect(()=>{f||(l(""),d(""),i(-1),s([]),t.commands.setSearchTerm(""),t.commands.setReplaceTerm(""))},[t,f]),J.useEffect(()=>{f&&t&&t.commands&&t.commands.setSearchTerm&&t.commands.setSearchTerm(a)},[f,a,t]),J.useEffect(()=>{f&&t&&t.commands&&t.commands.setReplaceTerm&&t.commands.setReplaceTerm(c)},[f,c,t]),J.useEffect(()=>{if(!t)return;const b=t.extensionManager.extensions.find(w=>w.name===zD.name);if(!b)return;const S=()=>{if(!f)return;const w=b?b.storage.currentIndex:-1,T=b?b.storage.results:[];i(M=>M!==w?w:M),s(M=>aS(M,T)?M:T)};return window.addEventListener(n1,S),()=>{b&&window.removeEventListener(n1,S)}},[f,t]),x.jsxs(xi,{open:f,onOpenChange:p,children:[x.jsx(Si,{disabled:e==null?void 0:e.disabled,asChild:!0,children:x.jsx(Ve,{tooltip:e==null?void 0:e.tooltip,isActive:e==null?void 0:e.isActive,disabled:e==null?void 0:e.disabled,children:x.jsx(Rt,{name:e==null?void 0:e.icon})})}),x.jsxs(Xn,{hideWhenDetached:!0,className:"richtext-w-full",align:"start",side:"bottom",children:[x.jsxs("div",{className:"richtext-mb-[6px] richtext-flex richtext-items-center richtext-justify-between",children:[x.jsx(Kn,{children:r("editor.search.dialog.text")}),x.jsx("span",{className:"richtext-font-semibold",children:o.length?`${n+1}/${o.length}`:"0/0"})]}),x.jsxs("div",{className:"richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5 richtext-mb-[10px]",children:[x.jsx(hn,{type:"text",required:!0,className:"richtext-w-full",placeholder:"Text",autoFocus:!0,value:a,onChange:b=>l(b.target.value)}),x.jsx(Mt,{disabled:!o.length,className:"richtext-flex-1",onClick:t.commands.goToPrevSearchResult,children:x.jsx(Rt,{name:"ChevronUp"})}),x.jsx(Mt,{disabled:!o.length,className:"richtext-flex-1",onClick:t.commands.goToNextSearchResult,children:x.jsx(Rt,{name:"ChevronDown"})})]}),x.jsx(Kn,{className:"richtext-mb-[6px]",children:r("editor.replace.dialog.text")}),x.jsx("div",{className:"richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5 richtext-mb-[5px]",children:x.jsx("div",{className:"richtext-relative richtext-items-center richtext-w-full richtext-max-w-sm",children:x.jsx(hn,{type:"text",required:!0,className:"richtext-w-80",placeholder:"Text",value:c,onChange:b=>d(b.target.value)})})}),x.jsxs("div",{className:"richtext-flex richtext-items-center richtext-space-x-2 richtext-mb-[10px]",children:[x.jsx(cS,{checked:m,onCheckedChange:b=>{g(b),t.commands.setCaseSensitive(b)}}),x.jsx(Kn,{children:r("editor.replace.caseSensitive")})]}),x.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-[10px]",children:[x.jsx(Mt,{disabled:!o.length,className:"richtext-flex-1",onClick:t.commands.replace,children:r("editor.replace.dialog.text")}),x.jsx(Mt,{disabled:!o.length,className:"richtext-flex-1",onClick:t.commands.replaceAll,children:r("editor.replaceAll.dialog.text")})]})]})]})}const Pf=(t,e)=>e(t.tr);function hQ(t,e,r){return RegExp(e?t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"):t,r?"gu":"gui")}function pQ(t,e,r){const n=[];let i=[];const o=[];let s=0;if(!e)return{decorationsToReturn:[],results:[]};t==null||t.descendants((a,l)=>{a.isText?i[s]?i[s]={text:i[s].text+a.text,pos:i[s].pos}:i[s]={text:`${a.text}`,pos:l}:s+=1}),i=i.filter(Boolean);for(let a=0;a<i.length;a+=1){const{text:l,pos:c}=i[a],d=[...l.matchAll(e)];for(let f=0;f<d.length;f+=1){const p=d[f];if(p[0]==="")break;p.index!==void 0&&o.push({from:c+p.index,to:c+p.index+p[0].length})}}for(let a=0;a<o.length;a+=1){const l=o[a];n.push(Qt.inline(l.from,l.to,{class:r}))}return{decorationsToReturn:n,results:o}}function $T(t,e,{state:r,dispatch:n}){if(!e[0])return;const{from:o,to:s}=e[0];n&&n(r.tr.insertText(t,o,s))}function mQ(t,e,r,n){const i=e+1;if(!n[i])return null;const{from:o,to:s}=n[e],a=s-o-t.length+r,{from:l,to:c}=n[i];return n[i]={to:c-a,from:l-a},[a,n]}function gQ(t,e,{tr:r,dispatch:n}){let i=0,o=e.slice();if(!o.length)return!1;for(let s=0;s<o.length;s+=1){const{from:a,to:l}=o[s];r.insertText(t,a,l);const c=mQ(t,s,i,o);c&&(i=c[0],o=c[1])}return n(r),!0}function UT({view:t,tr:e,searchResults:r,searchResultCurrentClass:n,gotoIndex:i}){const o=r[i];if(o){const s=e.setMeta("directDecoration",{fromPos:o.from,toPos:o.to,attrs:{class:n}});return t==null||t.dispatch(s),setTimeout(()=>{const a=window.document.querySelector(`.${n}`);a&&b1(a,{behavior:"smooth",scrollMode:"if-needed"})},0),!0}return!1}const n1="ON_SEARCH_RESULTS",bu=new CustomEvent(n1),zD=yt.create({name:"search",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),searchTerm:"",replaceTerm:"",results:[],currentIndex:0,searchResultClass:"search-result",searchResultCurrentClass:"search-result-current",caseSensitive:!1,disableRegex:!1,onChange:()=>{},button:({editor:e,t:r})=>({component:fQ,componentProps:{action:()=>{},icon:"SearchAndReplace",tooltip:r("editor.searchAndReplace.tooltip"),isActive:()=>!1,disabled:!1,editor:e}})}},addStorage(){return{results:[],currentIndex:-1}},addCommands(){return{setSearchTerm:t=>({state:e,dispatch:r})=>(this.options.searchTerm=t,this.storage.results=[],this.storage.currentIndex=0,window.dispatchEvent(bu),Pf(e,r),!1),setReplaceTerm:t=>({state:e,dispatch:r})=>(this.options.replaceTerm=t,Pf(e,r),!1),setCaseSensitive:t=>({state:e,dispatch:r})=>(this.options.caseSensitive=t,Pf(e,r),!1),replace:()=>({state:t,dispatch:e})=>{const{replaceTerm:r}=this.options,{currentIndex:n,results:i}=this.storage,o=i[n];return o?($T(r,[o],{state:t,dispatch:e}),this.storage.results.splice(n,1)):($T(r,i,{state:t,dispatch:e}),this.storage.results.shift()),window.dispatchEvent(bu),Pf(t,e),!1},replaceAll:()=>({state:t,tr:e,dispatch:r})=>{const{replaceTerm:n}=this.options,{results:i}=this.storage;return gQ(n,i,{tr:e,dispatch:r}),this.storage.currentIndex=-1,this.storage.results=[],window.dispatchEvent(bu),Pf(t,r),!1},goToPrevSearchResult:()=>({view:t,tr:e})=>{const{searchResultCurrentClass:r}=this.options,{currentIndex:n,results:i}=this.storage,o=(n+i.length-1)%i.length;return this.storage.currentIndex=o,window.dispatchEvent(bu),UT({view:t,tr:e,searchResults:i,searchResultCurrentClass:r,gotoIndex:o})},goToNextSearchResult:()=>({view:t,tr:e})=>{const{searchResultCurrentClass:r}=this.options,{currentIndex:n,results:i}=this.storage,o=(n+1)%i.length;return this.storage.currentIndex=o,this.options.onChange&&this.options.onChange(),window.dispatchEvent(bu),UT({view:t,tr:e,searchResults:i,searchResultCurrentClass:r,gotoIndex:o})}}},addProseMirrorPlugins(){const t=this;return[new _t({key:new St("search"),state:{init(){return Tt.empty},apply(e){const{doc:r,docChanged:n}=e,{searchTerm:i,searchResultClass:o,searchResultCurrentClass:s,disableRegex:a,caseSensitive:l}=t.options;if(n||i){const{decorationsToReturn:c,results:d}=pQ(r,hQ(i,a,l),o);if(t.storage.results=d,t.storage.currentIndex>d.length-1&&(t.storage.currentIndex=0),window.dispatchEvent(bu),e.getMeta("directDecoration")){const{fromPos:f,toPos:p,attrs:m}=e.getMeta("directDecoration");c.push(Qt.inline(f,p,m))}else d.length&&(c[0]=Qt.inline(d[0].from,d[0].to,{class:s}));return Tt.create(r,c)}return Tt.empty}},props:{decorations(e){return this.getState(e)}}})]}}),fd={100:"💯",1234:"🔢",grinning:"😀",smiley:"😃",smile:"😄",grin:"😁",laughing:"😆",satisfied:"😆",sweat_smile:"😅",rofl:"🤣",joy:"😂",slightly_smiling_face:"🙂",upside_down_face:"🙃",wink:"😉",blush:"😊",innocent:"😇",smiling_face_with_three_hearts:"🥰",heart_eyes:"😍",star_struck:"🤩",kissing_heart:"😘",kissing:"😗",relaxed:"☺️",kissing_closed_eyes:"😚",kissing_smiling_eyes:"😙",smiling_face_with_tear:"🥲",yum:"😋",stuck_out_tongue:"😛",stuck_out_tongue_winking_eye:"😜",zany_face:"🤪",stuck_out_tongue_closed_eyes:"😝",money_mouth_face:"🤑",hugs:"🤗",hand_over_mouth:"🤭",shushing_face:"🤫",thinking:"🤔",zipper_mouth_face:"🤐",raised_eyebrow:"🤨",neutral_face:"😐",expressionless:"😑",no_mouth:"😶",smirk:"😏",unamused:"😒",roll_eyes:"🙄",grimacing:"😬",lying_face:"🤥",relieved:"😌",pensive:"😔",sleepy:"😪",drooling_face:"🤤",sleeping:"😴",mask:"😷",face_with_thermometer:"🤒",face_with_head_bandage:"🤕",nauseated_face:"🤢",vomiting_face:"🤮",sneezing_face:"🤧",hot_face:"🥵",cold_face:"🥶",woozy_face:"🥴",dizzy_face:"😵",exploding_head:"🤯",cowboy_hat_face:"🤠",partying_face:"🥳",disguised_face:"🥸",sunglasses:"😎",nerd_face:"🤓",monocle_face:"🧐",confused:"😕",worried:"😟",slightly_frowning_face:"🙁",frowning_face:"☹️",open_mouth:"😮",hushed:"😯",astonished:"😲",flushed:"😳",pleading_face:"🥺",frowning:"😦",anguished:"😧",fearful:"😨",cold_sweat:"😰",disappointed_relieved:"😥",cry:"😢",sob:"😭",scream:"😱",confounded:"😖",persevere:"😣",disappointed:"😞",sweat:"😓",weary:"😩",tired_face:"😫",yawning_face:"🥱",triumph:"😤",rage:"😡",pout:"😡",angry:"😠",cursing_face:"🤬",smiling_imp:"😈",imp:"👿",skull:"💀",skull_and_crossbones:"☠️",hankey:"💩",poop:"💩",shit:"💩",clown_face:"🤡",japanese_ogre:"👹",japanese_goblin:"👺",ghost:"👻",alien:"👽",space_invader:"👾",robot:"🤖",smiley_cat:"😺",smile_cat:"😸",joy_cat:"😹",heart_eyes_cat:"😻",smirk_cat:"😼",kissing_cat:"😽",scream_cat:"🙀",crying_cat_face:"😿",pouting_cat:"😾",see_no_evil:"🙈",hear_no_evil:"🙉",speak_no_evil:"🙊",kiss:"💋",love_letter:"💌",cupid:"💘",gift_heart:"💝",sparkling_heart:"💖",heartpulse:"💗",heartbeat:"💓",revolving_hearts:"💞",two_hearts:"💕",heart_decoration:"💟",heavy_heart_exclamation:"❣️",broken_heart:"💔",heart:"❤️",orange_heart:"🧡",yellow_heart:"💛",green_heart:"💚",blue_heart:"💙",purple_heart:"💜",brown_heart:"🤎",black_heart:"🖤",white_heart:"🤍",anger:"💢",boom:"💥",collision:"💥",dizzy:"💫",sweat_drops:"💦",dash:"💨",hole:"🕳️",bomb:"💣",speech_balloon:"💬",eye_speech_bubble:"👁️🗨️",left_speech_bubble:"🗨️",right_anger_bubble:"🗯️",thought_balloon:"💭",zzz:"💤",wave:"👋",raised_back_of_hand:"🤚",raised_hand_with_fingers_splayed:"🖐️",hand:"✋",raised_hand:"✋",vulcan_salute:"🖖",ok_hand:"👌",pinched_fingers:"🤌",pinching_hand:"🤏",v:"✌️",crossed_fingers:"🤞",love_you_gesture:"🤟",metal:"🤘",call_me_hand:"🤙",point_left:"👈",point_right:"👉",point_up_2:"👆",middle_finger:"🖕",fu:"🖕",point_down:"👇",point_up:"☝️","+1":"👍",thumbsup:"👍","-1":"👎",thumbsdown:"👎",fist_raised:"✊",fist:"✊",fist_oncoming:"👊",facepunch:"👊",punch:"👊",fist_left:"🤛",fist_right:"🤜",clap:"👏",raised_hands:"🙌",open_hands:"👐",palms_up_together:"🤲",handshake:"🤝",pray:"🙏",writing_hand:"✍️",nail_care:"💅",selfie:"🤳",muscle:"💪",mechanical_arm:"🦾",mechanical_leg:"🦿",leg:"🦵",foot:"🦶",ear:"👂",ear_with_hearing_aid:"🦻",nose:"👃",brain:"🧠",anatomical_heart:"🫀",lungs:"🫁",tooth:"🦷",bone:"🦴",eyes:"👀",eye:"👁️",tongue:"👅",lips:"👄",baby:"👶",child:"🧒",boy:"👦",girl:"👧",adult:"🧑",blond_haired_person:"👱",man:"👨",bearded_person:"🧔",red_haired_man:"👨🦰",curly_haired_man:"👨🦱",white_haired_man:"👨🦳",bald_man:"👨🦲",woman:"👩",red_haired_woman:"👩🦰",person_red_hair:"🧑🦰",curly_haired_woman:"👩🦱",person_curly_hair:"🧑🦱",white_haired_woman:"👩🦳",person_white_hair:"🧑🦳",bald_woman:"👩🦲",person_bald:"🧑🦲",blond_haired_woman:"👱♀️",blonde_woman:"👱♀️",blond_haired_man:"👱♂️",older_adult:"🧓",older_man:"👴",older_woman:"👵",frowning_person:"🙍",frowning_man:"🙍♂️",frowning_woman:"🙍♀️",pouting_face:"🙎",pouting_man:"🙎♂️",pouting_woman:"🙎♀️",no_good:"🙅",no_good_man:"🙅♂️",ng_man:"🙅♂️",no_good_woman:"🙅♀️",ng_woman:"🙅♀️",ok_person:"🙆",ok_man:"🙆♂️",ok_woman:"🙆♀️",tipping_hand_person:"💁",information_desk_person:"💁",tipping_hand_man:"💁♂️",sassy_man:"💁♂️",tipping_hand_woman:"💁♀️",sassy_woman:"💁♀️",raising_hand:"🙋",raising_hand_man:"🙋♂️",raising_hand_woman:"🙋♀️",deaf_person:"🧏",deaf_man:"🧏♂️",deaf_woman:"🧏♀️",bow:"🙇",bowing_man:"🙇♂️",bowing_woman:"🙇♀️",facepalm:"🤦",man_facepalming:"🤦♂️",woman_facepalming:"🤦♀️",shrug:"🤷",man_shrugging:"🤷♂️",woman_shrugging:"🤷♀️",health_worker:"🧑⚕️",man_health_worker:"👨⚕️",woman_health_worker:"👩⚕️",student:"🧑🎓",man_student:"👨🎓",woman_student:"👩🎓",teacher:"🧑🏫",man_teacher:"👨🏫",woman_teacher:"👩🏫",judge:"🧑⚖️",man_judge:"👨⚖️",woman_judge:"👩⚖️",farmer:"🧑🌾",man_farmer:"👨🌾",woman_farmer:"👩🌾",cook:"🧑🍳",man_cook:"👨🍳",woman_cook:"👩🍳",mechanic:"🧑🔧",man_mechanic:"👨🔧",woman_mechanic:"👩🔧",factory_worker:"🧑🏭",man_factory_worker:"👨🏭",woman_factory_worker:"👩🏭",office_worker:"🧑💼",man_office_worker:"👨💼",woman_office_worker:"👩💼",scientist:"🧑🔬",man_scientist:"👨🔬",woman_scientist:"👩🔬",technologist:"🧑💻",man_technologist:"👨💻",woman_technologist:"👩💻",singer:"🧑🎤",man_singer:"👨🎤",woman_singer:"👩🎤",artist:"🧑🎨",man_artist:"👨🎨",woman_artist:"👩🎨",pilot:"🧑✈️",man_pilot:"👨✈️",woman_pilot:"👩✈️",astronaut:"🧑🚀",man_astronaut:"👨🚀",woman_astronaut:"👩🚀",firefighter:"🧑🚒",man_firefighter:"👨🚒",woman_firefighter:"👩🚒",police_officer:"👮",cop:"👮",policeman:"👮♂️",policewoman:"👮♀️",detective:"🕵️",male_detective:"🕵️♂️",female_detective:"🕵️♀️",guard:"💂",guardsman:"💂♂️",guardswoman:"💂♀️",ninja:"🥷",construction_worker:"👷",construction_worker_man:"👷♂️",construction_worker_woman:"👷♀️",prince:"🤴",princess:"👸",person_with_turban:"👳",man_with_turban:"👳♂️",woman_with_turban:"👳♀️",man_with_gua_pi_mao:"👲",woman_with_headscarf:"🧕",person_in_tuxedo:"🤵",man_in_tuxedo:"🤵♂️",woman_in_tuxedo:"🤵♀️",person_with_veil:"👰",man_with_veil:"👰♂️",woman_with_veil:"👰♀️",bride_with_veil:"👰♀️",pregnant_woman:"🤰",breast_feeding:"🤱",woman_feeding_baby:"👩🍼",man_feeding_baby:"👨🍼",person_feeding_baby:"🧑🍼",angel:"👼",santa:"🎅",mrs_claus:"🤶",mx_claus:"🧑🎄",superhero:"🦸",superhero_man:"🦸♂️",superhero_woman:"🦸♀️",supervillain:"🦹",supervillain_man:"🦹♂️",supervillain_woman:"🦹♀️",mage:"🧙",mage_man:"🧙♂️",mage_woman:"🧙♀️",fairy:"🧚",fairy_man:"🧚♂️",fairy_woman:"🧚♀️",vampire:"🧛",vampire_man:"🧛♂️",vampire_woman:"🧛♀️",merperson:"🧜",merman:"🧜♂️",mermaid:"🧜♀️",elf:"🧝",elf_man:"🧝♂️",elf_woman:"🧝♀️",genie:"🧞",genie_man:"🧞♂️",genie_woman:"🧞♀️",zombie:"🧟",zombie_man:"🧟♂️",zombie_woman:"🧟♀️",massage:"💆",massage_man:"💆♂️",massage_woman:"💆♀️",haircut:"💇",haircut_man:"💇♂️",haircut_woman:"💇♀️",walking:"🚶",walking_man:"🚶♂️",walking_woman:"🚶♀️",standing_person:"🧍",standing_man:"🧍♂️",standing_woman:"🧍♀️",kneeling_person:"🧎",kneeling_man:"🧎♂️",kneeling_woman:"🧎♀️",person_with_probing_cane:"🧑🦯",man_with_probing_cane:"👨🦯",woman_with_probing_cane:"👩🦯",person_in_motorized_wheelchair:"🧑🦼",man_in_motorized_wheelchair:"👨🦼",woman_in_motorized_wheelchair:"👩🦼",person_in_manual_wheelchair:"🧑🦽",man_in_manual_wheelchair:"👨🦽",woman_in_manual_wheelchair:"👩🦽",runner:"🏃",running:"🏃",running_man:"🏃♂️",running_woman:"🏃♀️",woman_dancing:"💃",dancer:"💃",man_dancing:"🕺",business_suit_levitating:"🕴️",dancers:"👯",dancing_men:"👯♂️",dancing_women:"👯♀️",sauna_person:"🧖",sauna_man:"🧖♂️",sauna_woman:"🧖♀️",climbing:"🧗",climbing_man:"🧗♂️",climbing_woman:"🧗♀️",person_fencing:"🤺",horse_racing:"🏇",skier:"⛷️",snowboarder:"🏂",golfing:"🏌️",golfing_man:"🏌️♂️",golfing_woman:"🏌️♀️",surfer:"🏄",surfing_man:"🏄♂️",surfing_woman:"🏄♀️",rowboat:"🚣",rowing_man:"🚣♂️",rowing_woman:"🚣♀️",swimmer:"🏊",swimming_man:"🏊♂️",swimming_woman:"🏊♀️",bouncing_ball_person:"⛹️",bouncing_ball_man:"⛹️♂️",basketball_man:"⛹️♂️",bouncing_ball_woman:"⛹️♀️",basketball_woman:"⛹️♀️",weight_lifting:"🏋️",weight_lifting_man:"🏋️♂️",weight_lifting_woman:"🏋️♀️",bicyclist:"🚴",biking_man:"🚴♂️",biking_woman:"🚴♀️",mountain_bicyclist:"🚵",mountain_biking_man:"🚵♂️",mountain_biking_woman:"🚵♀️",cartwheeling:"🤸",man_cartwheeling:"🤸♂️",woman_cartwheeling:"🤸♀️",wrestling:"🤼",men_wrestling:"🤼♂️",women_wrestling:"🤼♀️",water_polo:"🤽",man_playing_water_polo:"🤽♂️",woman_playing_water_polo:"🤽♀️",handball_person:"🤾",man_playing_handball:"🤾♂️",woman_playing_handball:"🤾♀️",juggling_person:"🤹",man_juggling:"🤹♂️",woman_juggling:"🤹♀️",lotus_position:"🧘",lotus_position_man:"🧘♂️",lotus_position_woman:"🧘♀️",bath:"🛀",sleeping_bed:"🛌",people_holding_hands:"🧑🤝🧑",two_women_holding_hands:"👭",couple:"👫",two_men_holding_hands:"👬",couplekiss:"💏",couplekiss_man_woman:"👩❤️💋👨",couplekiss_man_man:"👨❤️💋👨",couplekiss_woman_woman:"👩❤️💋👩",couple_with_heart:"💑",couple_with_heart_woman_man:"👩❤️👨",couple_with_heart_man_man:"👨❤️👨",couple_with_heart_woman_woman:"👩❤️👩",family:"👪",family_man_woman_boy:"👨👩👦",family_man_woman_girl:"👨👩👧",family_man_woman_girl_boy:"👨👩👧👦",family_man_woman_boy_boy:"👨👩👦👦",family_man_woman_girl_girl:"👨👩👧👧",family_man_man_boy:"👨👨👦",family_man_man_girl:"👨👨👧",family_man_man_girl_boy:"👨👨👧👦",family_man_man_boy_boy:"👨👨👦👦",family_man_man_girl_girl:"👨👨👧👧",family_woman_woman_boy:"👩👩👦",family_woman_woman_girl:"👩👩👧",family_woman_woman_girl_boy:"👩👩👧👦",family_woman_woman_boy_boy:"👩👩👦👦",family_woman_woman_girl_girl:"👩👩👧👧",family_man_boy:"👨👦",family_man_boy_boy:"👨👦👦",family_man_girl:"👨👧",family_man_girl_boy:"👨👧👦",family_man_girl_girl:"👨👧👧",family_woman_boy:"👩👦",family_woman_boy_boy:"👩👦👦",family_woman_girl:"👩👧",family_woman_girl_boy:"👩👧👦",family_woman_girl_girl:"👩👧👧",speaking_head:"🗣️",bust_in_silhouette:"👤",busts_in_silhouette:"👥",people_hugging:"🫂",footprints:"👣",monkey_face:"🐵",monkey:"🐒",gorilla:"🦍",orangutan:"🦧",dog:"🐶",dog2:"🐕",guide_dog:"🦮",service_dog:"🐕🦺",poodle:"🐩",wolf:"🐺",fox_face:"🦊",raccoon:"🦝",cat:"🐱",cat2:"🐈",black_cat:"🐈⬛",lion:"🦁",tiger:"🐯",tiger2:"🐅",leopard:"🐆",horse:"🐴",racehorse:"🐎",unicorn:"🦄",zebra:"🦓",deer:"🦌",bison:"🦬",cow:"🐮",ox:"🐂",water_buffalo:"🐃",cow2:"🐄",pig:"🐷",pig2:"🐖",boar:"🐗",pig_nose:"🐽",ram:"🐏",sheep:"🐑",goat:"🐐",dromedary_camel:"🐪",camel:"🐫",llama:"🦙",giraffe:"🦒",elephant:"🐘",mammoth:"🦣",rhinoceros:"🦏",hippopotamus:"🦛",mouse:"🐭",mouse2:"🐁",rat:"🐀",hamster:"🐹",rabbit:"🐰",rabbit2:"🐇",chipmunk:"🐿️",beaver:"🦫",hedgehog:"🦔",bat:"🦇",bear:"🐻",polar_bear:"🐻❄️",koala:"🐨",panda_face:"🐼",sloth:"🦥",otter:"🦦",skunk:"🦨",kangaroo:"🦘",badger:"🦡",feet:"🐾",paw_prints:"🐾",turkey:"🦃",chicken:"🐔",rooster:"🐓",hatching_chick:"🐣",baby_chick:"🐤",hatched_chick:"🐥",bird:"🐦",penguin:"🐧",dove:"🕊️",eagle:"🦅",duck:"🦆",swan:"🦢",owl:"🦉",dodo:"🦤",feather:"🪶",flamingo:"🦩",peacock:"🦚",parrot:"🦜",frog:"🐸",crocodile:"🐊",turtle:"🐢",lizard:"🦎",snake:"🐍",dragon_face:"🐲",dragon:"🐉",sauropod:"🦕","t-rex":"🦖",whale:"🐳",whale2:"🐋",dolphin:"🐬",flipper:"🐬",seal:"🦭",fish:"🐟",tropical_fish:"🐠",blowfish:"🐡",shark:"🦈",octopus:"🐙",shell:"🐚",snail:"🐌",butterfly:"🦋",bug:"🐛",ant:"🐜",bee:"🐝",honeybee:"🐝",beetle:"🪲",lady_beetle:"🐞",cricket:"🦗",cockroach:"🪳",spider:"🕷️",spider_web:"🕸️",scorpion:"🦂",mosquito:"🦟",fly:"🪰",worm:"🪱",microbe:"🦠",bouquet:"💐",cherry_blossom:"🌸",white_flower:"💮",rosette:"🏵️",rose:"🌹",wilted_flower:"🥀",hibiscus:"🌺",sunflower:"🌻",blossom:"🌼",tulip:"🌷",seedling:"🌱",potted_plant:"🪴",evergreen_tree:"🌲",deciduous_tree:"🌳",palm_tree:"🌴",cactus:"🌵",ear_of_rice:"🌾",herb:"🌿",shamrock:"☘️",four_leaf_clover:"🍀",maple_leaf:"🍁",fallen_leaf:"🍂",leaves:"🍃",grapes:"🍇",melon:"🍈",watermelon:"🍉",tangerine:"🍊",orange:"🍊",mandarin:"🍊",lemon:"🍋",banana:"🍌",pineapple:"🍍",mango:"🥭",apple:"🍎",green_apple:"🍏",pear:"🍐",peach:"🍑",cherries:"🍒",strawberry:"🍓",blueberries:"🫐",kiwi_fruit:"🥝",tomato:"🍅",olive:"🫒",coconut:"🥥",avocado:"🥑",eggplant:"🍆",potato:"🥔",carrot:"🥕",corn:"🌽",hot_pepper:"🌶️",bell_pepper:"🫑",cucumber:"🥒",leafy_green:"🥬",broccoli:"🥦",garlic:"🧄",onion:"🧅",mushroom:"🍄",peanuts:"🥜",chestnut:"🌰",bread:"🍞",croissant:"🥐",baguette_bread:"🥖",flatbread:"🫓",pretzel:"🥨",bagel:"🥯",pancakes:"🥞",waffle:"🧇",cheese:"🧀",meat_on_bone:"🍖",poultry_leg:"🍗",cut_of_meat:"🥩",bacon:"🥓",hamburger:"🍔",fries:"🍟",pizza:"🍕",hotdog:"🌭",sandwich:"🥪",taco:"🌮",burrito:"🌯",tamale:"🫔",stuffed_flatbread:"🥙",falafel:"🧆",egg:"🥚",fried_egg:"🍳",shallow_pan_of_food:"🥘",stew:"🍲",fondue:"🫕",bowl_with_spoon:"🥣",green_salad:"🥗",popcorn:"🍿",butter:"🧈",salt:"🧂",canned_food:"🥫",bento:"🍱",rice_cracker:"🍘",rice_ball:"🍙",rice:"🍚",curry:"🍛",ramen:"🍜",spaghetti:"🍝",sweet_potato:"🍠",oden:"🍢",sushi:"🍣",fried_shrimp:"🍤",fish_cake:"🍥",moon_cake:"🥮",dango:"🍡",dumpling:"🥟",fortune_cookie:"🥠",takeout_box:"🥡",crab:"🦀",lobster:"🦞",shrimp:"🦐",squid:"🦑",oyster:"🦪",icecream:"🍦",shaved_ice:"🍧",ice_cream:"🍨",doughnut:"🍩",cookie:"🍪",birthday:"🎂",cake:"🍰",cupcake:"🧁",pie:"🥧",chocolate_bar:"🍫",candy:"🍬",lollipop:"🍭",custard:"🍮",honey_pot:"🍯",baby_bottle:"🍼",milk_glass:"🥛",coffee:"☕",teapot:"🫖",tea:"🍵",sake:"🍶",champagne:"🍾",wine_glass:"🍷",cocktail:"🍸",tropical_drink:"🍹",beer:"🍺",beers:"🍻",clinking_glasses:"🥂",tumbler_glass:"🥃",cup_with_straw:"🥤",bubble_tea:"🧋",beverage_box:"🧃",mate:"🧉",ice_cube:"🧊",chopsticks:"🥢",plate_with_cutlery:"🍽️",fork_and_knife:"🍴",spoon:"🥄",hocho:"🔪",knife:"🔪",amphora:"🏺",earth_africa:"🌍",earth_americas:"🌎",earth_asia:"🌏",globe_with_meridians:"🌐",world_map:"🗺️",japan:"🗾",compass:"🧭",mountain_snow:"🏔️",mountain:"⛰️",volcano:"🌋",mount_fuji:"🗻",camping:"🏕️",beach_umbrella:"🏖️",desert:"🏜️",desert_island:"🏝️",national_park:"🏞️",stadium:"🏟️",classical_building:"🏛️",building_construction:"🏗️",bricks:"🧱",rock:"🪨",wood:"🪵",hut:"🛖",houses:"🏘️",derelict_house:"🏚️",house:"🏠",house_with_garden:"🏡",office:"🏢",post_office:"🏣",european_post_office:"🏤",hospital:"🏥",bank:"🏦",hotel:"🏨",love_hotel:"🏩",convenience_store:"🏪",school:"🏫",department_store:"🏬",factory:"🏭",japanese_castle:"🏯",european_castle:"🏰",wedding:"💒",tokyo_tower:"🗼",statue_of_liberty:"🗽",church:"⛪",mosque:"🕌",hindu_temple:"🛕",synagogue:"🕍",shinto_shrine:"⛩️",kaaba:"🕋",fountain:"⛲",tent:"⛺",foggy:"🌁",night_with_stars:"🌃",cityscape:"🏙️",sunrise_over_mountains:"🌄",sunrise:"🌅",city_sunset:"🌆",city_sunrise:"🌇",bridge_at_night:"🌉",hotsprings:"♨️",carousel_horse:"🎠",ferris_wheel:"🎡",roller_coaster:"🎢",barber:"💈",circus_tent:"🎪",steam_locomotive:"🚂",railway_car:"🚃",bullettrain_side:"🚄",bullettrain_front:"🚅",train2:"🚆",metro:"🚇",light_rail:"🚈",station:"🚉",tram:"🚊",monorail:"🚝",mountain_railway:"🚞",train:"🚋",bus:"🚌",oncoming_bus:"🚍",trolleybus:"🚎",minibus:"🚐",ambulance:"🚑",fire_engine:"🚒",police_car:"🚓",oncoming_police_car:"🚔",taxi:"🚕",oncoming_taxi:"🚖",car:"🚗",red_car:"🚗",oncoming_automobile:"🚘",blue_car:"🚙",pickup_truck:"🛻",truck:"🚚",articulated_lorry:"🚛",tractor:"🚜",racing_car:"🏎️",motorcycle:"🏍️",motor_scooter:"🛵",manual_wheelchair:"🦽",motorized_wheelchair:"🦼",auto_rickshaw:"🛺",bike:"🚲",kick_scooter:"🛴",skateboard:"🛹",roller_skate:"🛼",busstop:"🚏",motorway:"🛣️",railway_track:"🛤️",oil_drum:"🛢️",fuelpump:"⛽",rotating_light:"🚨",traffic_light:"🚥",vertical_traffic_light:"🚦",stop_sign:"🛑",construction:"🚧",anchor:"⚓",boat:"⛵",sailboat:"⛵",canoe:"🛶",speedboat:"🚤",passenger_ship:"🛳️",ferry:"⛴️",motor_boat:"🛥️",ship:"🚢",airplane:"✈️",small_airplane:"🛩️",flight_departure:"🛫",flight_arrival:"🛬",parachute:"🪂",seat:"💺",helicopter:"🚁",suspension_railway:"🚟",mountain_cableway:"🚠",aerial_tramway:"🚡",artificial_satellite:"🛰️",rocket:"🚀",flying_saucer:"🛸",bellhop_bell:"🛎️",luggage:"🧳",hourglass:"⌛",hourglass_flowing_sand:"⏳",watch:"⌚",alarm_clock:"⏰",stopwatch:"⏱️",timer_clock:"⏲️",mantelpiece_clock:"🕰️",clock12:"🕛",clock1230:"🕧",clock1:"🕐",clock130:"🕜",clock2:"🕑",clock230:"🕝",clock3:"🕒",clock330:"🕞",clock4:"🕓",clock430:"🕟",clock5:"🕔",clock530:"🕠",clock6:"🕕",clock630:"🕡",clock7:"🕖",clock730:"🕢",clock8:"🕗",clock830:"🕣",clock9:"🕘",clock930:"🕤",clock10:"🕙",clock1030:"🕥",clock11:"🕚",clock1130:"🕦",new_moon:"🌑",waxing_crescent_moon:"🌒",first_quarter_moon:"🌓",moon:"🌔",waxing_gibbous_moon:"🌔",full_moon:"🌕",waning_gibbous_moon:"🌖",last_quarter_moon:"🌗",waning_crescent_moon:"🌘",crescent_moon:"🌙",new_moon_with_face:"🌚",first_quarter_moon_with_face:"🌛",last_quarter_moon_with_face:"🌜",thermometer:"🌡️",sunny:"☀️",full_moon_with_face:"🌝",sun_with_face:"🌞",ringed_planet:"🪐",star:"⭐",star2:"🌟",stars:"🌠",milky_way:"🌌",cloud:"☁️",partly_sunny:"⛅",cloud_with_lightning_and_rain:"⛈️",sun_behind_small_cloud:"🌤️",sun_behind_large_cloud:"🌥️",sun_behind_rain_cloud:"🌦️",cloud_with_rain:"🌧️",cloud_with_snow:"🌨️",cloud_with_lightning:"🌩️",tornado:"🌪️",fog:"🌫️",wind_face:"🌬️",cyclone:"🌀",rainbow:"🌈",closed_umbrella:"🌂",open_umbrella:"☂️",umbrella:"☔",parasol_on_ground:"⛱️",zap:"⚡",snowflake:"❄️",snowman_with_snow:"☃️",snowman:"⛄",comet:"☄️",fire:"🔥",droplet:"💧",ocean:"🌊",jack_o_lantern:"🎃",christmas_tree:"🎄",fireworks:"🎆",sparkler:"🎇",firecracker:"🧨",sparkles:"✨",balloon:"🎈",tada:"🎉",confetti_ball:"🎊",tanabata_tree:"🎋",bamboo:"🎍",dolls:"🎎",flags:"🎏",wind_chime:"🎐",rice_scene:"🎑",red_envelope:"🧧",ribbon:"🎀",gift:"🎁",reminder_ribbon:"🎗️",tickets:"🎟️",ticket:"🎫",medal_military:"🎖️",trophy:"🏆",medal_sports:"🏅","1st_place_medal":"🥇","2nd_place_medal":"🥈","3rd_place_medal":"🥉",soccer:"⚽",baseball:"⚾",softball:"🥎",basketball:"🏀",volleyball:"🏐",football:"🏈",rugby_football:"🏉",tennis:"🎾",flying_disc:"🥏",bowling:"🎳",cricket_game:"🏏",field_hockey:"🏑",ice_hockey:"🏒",lacrosse:"🥍",ping_pong:"🏓",badminton:"🏸",boxing_glove:"🥊",martial_arts_uniform:"🥋",goal_net:"🥅",golf:"⛳",ice_skate:"⛸️",fishing_pole_and_fish:"🎣",diving_mask:"🤿",running_shirt_with_sash:"🎽",ski:"🎿",sled:"🛷",curling_stone:"🥌",dart:"🎯",yo_yo:"🪀",kite:"🪁","8ball":"🎱",crystal_ball:"🔮",magic_wand:"🪄",nazar_amulet:"🧿",video_game:"🎮",joystick:"🕹️",slot_machine:"🎰",game_die:"🎲",jigsaw:"🧩",teddy_bear:"🧸",pinata:"🪅",nesting_dolls:"🪆",spades:"♠️",hearts:"♥️",diamonds:"♦️",clubs:"♣️",chess_pawn:"♟️",black_joker:"🃏",mahjong:"🀄",flower_playing_cards:"🎴",performing_arts:"🎭",framed_picture:"🖼️",art:"🎨",thread:"🧵",sewing_needle:"🪡",yarn:"🧶",knot:"🪢",eyeglasses:"👓",dark_sunglasses:"🕶️",goggles:"🥽",lab_coat:"🥼",safety_vest:"🦺",necktie:"👔",shirt:"👕",tshirt:"👕",jeans:"👖",scarf:"🧣",gloves:"🧤",coat:"🧥",socks:"🧦",dress:"👗",kimono:"👘",sari:"🥻",one_piece_swimsuit:"🩱",swim_brief:"🩲",shorts:"🩳",bikini:"👙",womans_clothes:"👚",purse:"👛",handbag:"👜",pouch:"👝",shopping:"🛍️",school_satchel:"🎒",thong_sandal:"🩴",mans_shoe:"👞",shoe:"👞",athletic_shoe:"👟",hiking_boot:"🥾",flat_shoe:"🥿",high_heel:"👠",sandal:"👡",ballet_shoes:"🩰",boot:"👢",crown:"👑",womans_hat:"👒",tophat:"🎩",mortar_board:"🎓",billed_cap:"🧢",military_helmet:"🪖",rescue_worker_helmet:"⛑️",prayer_beads:"📿",lipstick:"💄",ring:"💍",gem:"💎",mute:"🔇",speaker:"🔈",sound:"🔉",loud_sound:"🔊",loudspeaker:"📢",mega:"📣",postal_horn:"📯",bell:"🔔",no_bell:"🔕",musical_score:"🎼",musical_note:"🎵",notes:"🎶",studio_microphone:"🎙️",level_slider:"🎚️",control_knobs:"🎛️",microphone:"🎤",headphones:"🎧",radio:"📻",saxophone:"🎷",accordion:"🪗",guitar:"🎸",musical_keyboard:"🎹",trumpet:"🎺",violin:"🎻",banjo:"🪕",drum:"🥁",long_drum:"🪘",iphone:"📱",calling:"📲",phone:"☎️",telephone:"☎️",telephone_receiver:"📞",pager:"📟",fax:"📠",battery:"🔋",electric_plug:"🔌",computer:"💻",desktop_computer:"🖥️",printer:"🖨️",keyboard:"⌨️",computer_mouse:"🖱️",trackball:"🖲️",minidisc:"💽",floppy_disk:"💾",cd:"💿",dvd:"📀",abacus:"🧮",movie_camera:"🎥",film_strip:"🎞️",film_projector:"📽️",clapper:"🎬",tv:"📺",camera:"📷",camera_flash:"📸",video_camera:"📹",vhs:"📼",mag:"🔍",mag_right:"🔎",candle:"🕯️",bulb:"💡",flashlight:"🔦",izakaya_lantern:"🏮",lantern:"🏮",diya_lamp:"🪔",notebook_with_decorative_cover:"📔",closed_book:"📕",book:"📖",open_book:"📖",green_book:"📗",blue_book:"📘",orange_book:"📙",books:"📚",notebook:"📓",ledger:"📒",page_with_curl:"📃",scroll:"📜",page_facing_up:"📄",newspaper:"📰",newspaper_roll:"🗞️",bookmark_tabs:"📑",bookmark:"🔖",label:"🏷️",moneybag:"💰",coin:"🪙",yen:"💴",dollar:"💵",euro:"💶",pound:"💷",money_with_wings:"💸",credit_card:"💳",receipt:"🧾",chart:"💹",envelope:"✉️",email:"📧","e-mail":"📧",incoming_envelope:"📨",envelope_with_arrow:"📩",outbox_tray:"📤",inbox_tray:"📥",package:"📦",mailbox:"📫",mailbox_closed:"📪",mailbox_with_mail:"📬",mailbox_with_no_mail:"📭",postbox:"📮",ballot_box:"🗳️",pencil2:"✏️",black_nib:"✒️",fountain_pen:"🖋️",pen:"🖊️",paintbrush:"🖌️",crayon:"🖍️",memo:"📝",pencil:"📝",briefcase:"💼",file_folder:"📁",open_file_folder:"📂",card_index_dividers:"🗂️",date:"📅",calendar:"📆",spiral_notepad:"🗒️",spiral_calendar:"🗓️",card_index:"📇",chart_with_upwards_trend:"📈",chart_with_downwards_trend:"📉",bar_chart:"📊",clipboard:"📋",pushpin:"📌",round_pushpin:"📍",paperclip:"📎",paperclips:"🖇️",straight_ruler:"📏",triangular_ruler:"📐",scissors:"✂️",card_file_box:"🗃️",file_cabinet:"🗄️",wastebasket:"🗑️",lock:"🔒",unlock:"🔓",lock_with_ink_pen:"🔏",closed_lock_with_key:"🔐",key:"🔑",old_key:"🗝️",hammer:"🔨",axe:"🪓",pick:"⛏️",hammer_and_pick:"⚒️",hammer_and_wrench:"🛠️",dagger:"🗡️",crossed_swords:"⚔️",gun:"🔫",boomerang:"🪃",bow_and_arrow:"🏹",shield:"🛡️",carpentry_saw:"🪚",wrench:"🔧",screwdriver:"🪛",nut_and_bolt:"🔩",gear:"⚙️",clamp:"🗜️",balance_scale:"⚖️",probing_cane:"🦯",link:"🔗",chains:"⛓️",hook:"🪝",toolbox:"🧰",magnet:"🧲",ladder:"🪜",alembic:"⚗️",test_tube:"🧪",petri_dish:"🧫",dna:"🧬",microscope:"🔬",telescope:"🔭",satellite:"📡",syringe:"💉",drop_of_blood:"🩸",pill:"💊",adhesive_bandage:"🩹",stethoscope:"🩺",door:"🚪",elevator:"🛗",mirror:"🪞",window:"🪟",bed:"🛏️",couch_and_lamp:"🛋️",chair:"🪑",toilet:"🚽",plunger:"🪠",shower:"🚿",bathtub:"🛁",mouse_trap:"🪤",razor:"🪒",lotion_bottle:"🧴",safety_pin:"🧷",broom:"🧹",basket:"🧺",roll_of_paper:"🧻",bucket:"🪣",soap:"🧼",toothbrush:"🪥",sponge:"🧽",fire_extinguisher:"🧯",shopping_cart:"🛒",smoking:"🚬",coffin:"⚰️",headstone:"🪦",funeral_urn:"⚱️",moyai:"🗿",placard:"🪧",atm:"🏧",put_litter_in_its_place:"🚮",potable_water:"🚰",wheelchair:"♿",mens:"🚹",womens:"🚺",restroom:"🚻",baby_symbol:"🚼",wc:"🚾",passport_control:"🛂",customs:"🛃",baggage_claim:"🛄",left_luggage:"🛅",warning:"⚠️",children_crossing:"🚸",no_entry:"⛔",no_entry_sign:"🚫",no_bicycles:"🚳",no_smoking:"🚭",do_not_litter:"🚯","non-potable_water":"🚱",no_pedestrians:"🚷",no_mobile_phones:"📵",underage:"🔞",radioactive:"☢️",biohazard:"☣️",arrow_up:"⬆️",arrow_upper_right:"↗️",arrow_right:"➡️",arrow_lower_right:"↘️",arrow_down:"⬇️",arrow_lower_left:"↙️",arrow_left:"⬅️",arrow_upper_left:"↖️",arrow_up_down:"↕️",left_right_arrow:"↔️",leftwards_arrow_with_hook:"↩️",arrow_right_hook:"↪️",arrow_heading_up:"⤴️",arrow_heading_down:"⤵️",arrows_clockwise:"🔃",arrows_counterclockwise:"🔄",back:"🔙",end:"🔚",on:"🔛",soon:"🔜",top:"🔝",place_of_worship:"🛐",atom_symbol:"⚛️",om:"🕉️",star_of_david:"✡️",wheel_of_dharma:"☸️",yin_yang:"☯️",latin_cross:"✝️",orthodox_cross:"☦️",star_and_crescent:"☪️",peace_symbol:"☮️",menorah:"🕎",six_pointed_star:"🔯",aries:"♈",taurus:"♉",gemini:"♊",cancer:"♋",leo:"♌",virgo:"♍",libra:"♎",scorpius:"♏",sagittarius:"♐",capricorn:"♑",aquarius:"♒",pisces:"♓",ophiuchus:"⛎",twisted_rightwards_arrows:"🔀",repeat:"🔁",repeat_one:"🔂",arrow_forward:"▶️",fast_forward:"⏩",next_track_button:"⏭️",play_or_pause_button:"⏯️",arrow_backward:"◀️",rewind:"⏪",previous_track_button:"⏮️",arrow_up_small:"🔼",arrow_double_up:"⏫",arrow_down_small:"🔽",arrow_double_down:"⏬",pause_button:"⏸️",stop_button:"⏹️",record_button:"⏺️",eject_button:"⏏️",cinema:"🎦",low_brightness:"🔅",high_brightness:"🔆",signal_strength:"📶",vibration_mode:"📳",mobile_phone_off:"📴",female_sign:"♀️",male_sign:"♂️",transgender_symbol:"⚧️",heavy_multiplication_x:"✖️",heavy_plus_sign:"➕",heavy_minus_sign:"➖",heavy_division_sign:"➗",infinity:"♾️",bangbang:"‼️",interrobang:"⁉️",question:"❓",grey_question:"❔",grey_exclamation:"❕",exclamation:"❗",heavy_exclamation_mark:"❗",wavy_dash:"〰️",currency_exchange:"💱",heavy_dollar_sign:"💲",medical_symbol:"⚕️",recycle:"♻️",fleur_de_lis:"⚜️",trident:"🔱",name_badge:"📛",beginner:"🔰",o:"⭕",white_check_mark:"✅",ballot_box_with_check:"☑️",heavy_check_mark:"✔️",x:"❌",negative_squared_cross_mark:"❎",curly_loop:"➰",loop:"➿",part_alternation_mark:"〽️",eight_spoked_asterisk:"✳️",eight_pointed_black_star:"✴️",sparkle:"❇️",copyright:"©️",registered:"®️",tm:"™️",hash:"#️⃣",asterisk:"*️⃣",zero:"0️⃣",one:"1️⃣",two:"2️⃣",three:"3️⃣",four:"4️⃣",five:"5️⃣",six:"6️⃣",seven:"7️⃣",eight:"8️⃣",nine:"9️⃣",keycap_ten:"🔟",capital_abcd:"🔠",abcd:"🔡",symbols:"🔣",abc:"🔤",a:"🅰️",ab:"🆎",b:"🅱️",cl:"🆑",cool:"🆒",free:"🆓",information_source:"ℹ️",id:"🆔",m:"Ⓜ️",new:"🆕",ng:"🆖",o2:"🅾️",ok:"🆗",parking:"🅿️",sos:"🆘",up:"🆙",vs:"🆚",koko:"🈁",sa:"🈂️",ideograph_advantage:"🉐",accept:"🉑",congratulations:"㊗️",secret:"㊙️",u6e80:"🈵",red_circle:"🔴",orange_circle:"🟠",yellow_circle:"🟡",green_circle:"🟢",large_blue_circle:"🔵",purple_circle:"🟣",brown_circle:"🟤",black_circle:"⚫",white_circle:"⚪",red_square:"🟥",orange_square:"🟧",yellow_square:"🟨",green_square:"🟩",blue_square:"🟦",purple_square:"🟪",brown_square:"🟫",black_large_square:"⬛",white_large_square:"⬜",black_medium_square:"◼️",white_medium_square:"◻️",black_medium_small_square:"◾",white_medium_small_square:"◽",black_small_square:"▪️",white_small_square:"▫️",large_orange_diamond:"🔶",large_blue_diamond:"🔷",small_orange_diamond:"🔸",small_blue_diamond:"🔹",small_red_triangle:"🔺",small_red_triangle_down:"🔻",diamond_shape_with_a_dot_inside:"💠",radio_button:"🔘",white_square_button:"🔳",black_square_button:"🔲",checkered_flag:"🏁",triangular_flag_on_post:"🚩",crossed_flags:"🎌",black_flag:"🏴",white_flag:"🏳️",rainbow_flag:"🏳️🌈",transgender_flag:"🏳️⚧️",pirate_flag:"🏴☠️",ascension_island:"🇦🇨",andorra:"🇦🇩",united_arab_emirates:"🇦🇪",afghanistan:"🇦🇫",antigua_barbuda:"🇦🇬",anguilla:"🇦🇮",albania:"🇦🇱",armenia:"🇦🇲",angola:"🇦🇴",antarctica:"🇦🇶",argentina:"🇦🇷",american_samoa:"🇦🇸",austria:"🇦🇹",australia:"🇦🇺",aruba:"🇦🇼",aland_islands:"🇦🇽",azerbaijan:"🇦🇿",bosnia_herzegovina:"🇧🇦",barbados:"🇧🇧",bangladesh:"🇧🇩",belgium:"🇧🇪",burkina_faso:"🇧🇫",bulgaria:"🇧🇬",bahrain:"🇧🇭",burundi:"🇧🇮",benin:"🇧🇯",st_barthelemy:"🇧🇱",bermuda:"🇧🇲",brunei:"🇧🇳",bolivia:"🇧🇴",caribbean_netherlands:"🇧🇶",brazil:"🇧🇷",bahamas:"🇧🇸",bhutan:"🇧🇹",bouvet_island:"🇧🇻",botswana:"🇧🇼",belarus:"🇧🇾",belize:"🇧🇿",canada:"🇨🇦",cocos_islands:"🇨🇨",congo_kinshasa:"🇨🇩",central_african_republic:"🇨🇫",congo_brazzaville:"🇨🇬",switzerland:"🇨🇭",cote_divoire:"🇨🇮",cook_islands:"🇨🇰",chile:"🇨🇱",cameroon:"🇨🇲",cn:"🇨🇳",colombia:"🇨🇴",clipperton_island:"🇨🇵",costa_rica:"🇨🇷",cuba:"🇨🇺",cape_verde:"🇨🇻",curacao:"🇨🇼",christmas_island:"🇨🇽",cyprus:"🇨🇾",czech_republic:"🇨🇿",de:"🇩🇪",diego_garcia:"🇩🇬",djibouti:"🇩🇯",denmark:"🇩🇰",dominica:"🇩🇲",dominican_republic:"🇩🇴",algeria:"🇩🇿",ceuta_melilla:"🇪🇦",ecuador:"🇪🇨",estonia:"🇪🇪",egypt:"🇪🇬",western_sahara:"🇪🇭",eritrea:"🇪🇷",es:"🇪🇸",ethiopia:"🇪🇹",eu:"🇪🇺",european_union:"🇪🇺",finland:"🇫🇮",fiji:"🇫🇯",falkland_islands:"🇫🇰",micronesia:"🇫🇲",faroe_islands:"🇫🇴",fr:"🇫🇷",gabon:"🇬🇦",gb:"🇬🇧",uk:"🇬🇧",grenada:"🇬🇩",georgia:"🇬🇪",french_guiana:"🇬🇫",guernsey:"🇬🇬",ghana:"🇬🇭",gibraltar:"🇬🇮",greenland:"🇬🇱",gambia:"🇬🇲",guinea:"🇬🇳",guadeloupe:"🇬🇵",equatorial_guinea:"🇬🇶",greece:"🇬🇷",south_georgia_south_sandwich_islands:"🇬🇸",guatemala:"🇬🇹",guam:"🇬🇺",guinea_bissau:"🇬🇼",guyana:"🇬🇾",hong_kong:"🇭🇰",heard_mcdonald_islands:"🇭🇲",honduras:"🇭🇳",croatia:"🇭🇷",haiti:"🇭🇹",hungary:"🇭🇺",canary_islands:"🇮🇨",indonesia:"🇮🇩",ireland:"🇮🇪",israel:"🇮🇱",isle_of_man:"🇮🇲",india:"🇮🇳",british_indian_ocean_territory:"🇮🇴",iraq:"🇮🇶",iran:"🇮🇷",iceland:"🇮🇸",it:"🇮🇹",jersey:"🇯🇪",jamaica:"🇯🇲",jordan:"🇯🇴",jp:"🇯🇵",kenya:"🇰🇪",kyrgyzstan:"🇰🇬",cambodia:"🇰🇭",kiribati:"🇰🇮",comoros:"🇰🇲",st_kitts_nevis:"🇰🇳",north_korea:"🇰🇵",kr:"🇰🇷",kuwait:"🇰🇼",cayman_islands:"🇰🇾",kazakhstan:"🇰🇿",laos:"🇱🇦",lebanon:"🇱🇧",st_lucia:"🇱🇨",liechtenstein:"🇱🇮",sri_lanka:"🇱🇰",liberia:"🇱🇷",lesotho:"🇱🇸",lithuania:"🇱🇹",luxembourg:"🇱🇺",latvia:"🇱🇻",libya:"🇱🇾",morocco:"🇲🇦",monaco:"🇲🇨",moldova:"🇲🇩",montenegro:"🇲🇪",st_martin:"🇲🇫",madagascar:"🇲🇬",marshall_islands:"🇲🇭",macedonia:"🇲🇰",mali:"🇲🇱",myanmar:"🇲🇲",mongolia:"🇲🇳",macau:"🇲🇴",northern_mariana_islands:"🇲🇵",martinique:"🇲🇶",mauritania:"🇲🇷",montserrat:"🇲🇸",malta:"🇲🇹",mauritius:"🇲🇺",maldives:"🇲🇻",malawi:"🇲🇼",mexico:"🇲🇽",malaysia:"🇲🇾",mozambique:"🇲🇿",namibia:"🇳🇦",new_caledonia:"🇳🇨",niger:"🇳🇪",norfolk_island:"🇳🇫",nigeria:"🇳🇬",nicaragua:"🇳🇮",netherlands:"🇳🇱",norway:"🇳🇴",nepal:"🇳🇵",nauru:"🇳🇷",niue:"🇳🇺",new_zealand:"🇳🇿",oman:"🇴🇲",panama:"🇵🇦",peru:"🇵🇪",french_polynesia:"🇵🇫",papua_new_guinea:"🇵🇬",philippines:"🇵🇭",pakistan:"🇵🇰",poland:"🇵🇱",st_pierre_miquelon:"🇵🇲",pitcairn_islands:"🇵🇳",puerto_rico:"🇵🇷",palestinian_territories:"🇵🇸",portugal:"🇵🇹",palau:"🇵🇼",paraguay:"🇵🇾",qatar:"🇶🇦",reunion:"🇷🇪",romania:"🇷🇴",serbia:"🇷🇸",ru:"🇷🇺",rwanda:"🇷🇼",saudi_arabia:"🇸🇦",solomon_islands:"🇸🇧",seychelles:"🇸🇨",sudan:"🇸🇩",sweden:"🇸🇪",singapore:"🇸🇬",st_helena:"🇸🇭",slovenia:"🇸🇮",svalbard_jan_mayen:"🇸🇯",slovakia:"🇸🇰",sierra_leone:"🇸🇱",san_marino:"🇸🇲",senegal:"🇸🇳",somalia:"🇸🇴",suriname:"🇸🇷",south_sudan:"🇸🇸",sao_tome_principe:"🇸🇹",el_salvador:"🇸🇻",sint_maarten:"🇸🇽",syria:"🇸🇾",swaziland:"🇸🇿",tristan_da_cunha:"🇹🇦",turks_caicos_islands:"🇹🇨",chad:"🇹🇩",french_southern_territories:"🇹🇫",togo:"🇹🇬",thailand:"🇹🇭",tajikistan:"🇹🇯",tokelau:"🇹🇰",timor_leste:"🇹🇱",turkmenistan:"🇹🇲",tunisia:"🇹🇳",tonga:"🇹🇴",tr:"🇹🇷",trinidad_tobago:"🇹🇹",tuvalu:"🇹🇻",taiwan:"🇹🇼",tanzania:"🇹🇿",ukraine:"🇺🇦",uganda:"🇺🇬",us_outlying_islands:"🇺🇲",united_nations:"🇺🇳",us:"🇺🇸",uruguay:"🇺🇾",uzbekistan:"🇺🇿",vatican_city:"🇻🇦",st_vincent_grenadines:"🇻🇨",venezuela:"🇻🇪",british_virgin_islands:"🇻🇬",us_virgin_islands:"🇻🇮",vietnam:"🇻🇳",vanuatu:"🇻🇺",wallis_futuna:"🇼🇫",samoa:"🇼🇸",kosovo:"🇽🇰",yemen:"🇾🇪",mayotte:"🇾🇹",south_africa:"🇿🇦",zambia:"🇿🇲",zimbabwe:"🇿🇼",england:"🏴",scotland:"🏴",wales:"🏴"};Object.keys(fd).reduce((t,e)=>{const r=fd[e];return t[r]=e,t},{});const yQ=Object.keys(fd).map(t=>t);Object.keys(fd).map(t=>fd[t]);function vQ(t){return yQ.filter(e=>e.startsWith(t)).map(e=>({name:e,emoji:fd[e]}))}const HD=J.forwardRef((t,e)=>{const r=J.useRef(),[n,i]=J.useState(0),{t:o}=Ct(),s=d=>{const f=t.items[d];f&&t.command(f)},a=()=>{i((n+t.items.length-1)%t.items.length)},l=()=>{i((n+1)%t.items.length)},c=()=>{s(n)};return J.useEffect(()=>i(0),[t.items]),J.useEffect(()=>{if(Number.isNaN(n+1))return;const d=r.current.querySelector(`span:nth-of-type(${n+1})`);d&&b1(d,{behavior:"smooth",scrollMode:"if-needed"})},[n]),J.useImperativeHandle(e,()=>({onKeyDown:({event:d})=>d.key==="ArrowUp"?(a(),!0):d.key==="ArrowDown"?(l(),!0):d.key==="Enter"?(c(),!0):!1})),x.jsx("div",{className:"richtext-w-[200px] richtext-max-h-[320px] richtext-overflow-x-hidden richtext-overflow-y-auto richtext-rounded-sm !richtext-border richtext-bg-popover richtext-p-1 richtext-text-popover-foreground richtext-shadow-md richtext-outline-none",children:x.jsx("div",{ref:r,children:t.items.length?t.items.map((d,f)=>x.jsxs("span",{className:Gr(" richtext-flex richtext-relative richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-px-2 richtext-py-1.5 richtext-text-sm richtext-outline-none richtext-transition-colors focus:richtext-bg-accent focus:richtext-text-accent-foreground hover:richtext-bg-accent",f===n?"bg-accent":""),onClick:()=>s(f),children:[d.fallbackImage?x.jsx("img",{src:d.fallbackImage,className:"richtext-w-[1em] richtext-h-[1em]"}):d.emoji,":",d.name,":"]},`emoji-list-code-${f}`)):x.jsx("div",{className:"richtext-flex richtext-relative richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-px-2 richtext-py-1.5 richtext-text-sm richtext-outline-none richtext-transition-colors",children:x.jsx("span",{children:o("no_result_found")})})})})});HD.displayName="EmojiList";const bQ=["😀","😃","😄","😁","😆","😅","😂","🤣","🥲","😊","😇","🙂","🙃","😉","😌","😍","🥰","😘","😗","😙","😚","😋","😛","😝","😜","🤪","🤨","🧐","🤓","😎","🥸","🤩","🥳","😏","😒","😞","😔","😟","😕","🙁","😣","😖","😫","😩","🥺","😢","😭","😤","😠","😡","🤬","🤯","😳","🥵","🥶","😱","😨","😰","😥","😓","🤗","🤔","🤭","🤫","🤥","😶","😐","😑","😬","🙄","😯","😦","😧","😮","😲","🥱","😴","🤤","😪","😵","🤐","🥴","🤢","🤮","🤧","😷","🤒","🤕","🤑","🤠","😈","👿","👹","👺","🤡","💩","👻","💀","☠️","👽","👾","🤖","🎃","😺","😸","😹","😻","😼","😽","🙀","😿","😾","👋","🤚","🖐","✋","🖖","👌","🤌","🤏","✌️","🤞","🤟","🤘","🤙","👈","👉","👆","🖕","👇","☝️","👍","👎","✊","👊","🤛","🤜","👏","🙌","👐","🤲","🤝","🙏","✍️","💅","🤳","💪","🦾","🦵","🦿","🦶","👣","👂","🦻","👃","🫀","🫁","🧠","🦷","🦴","👀","👁","👅","👄","💋","🩸","💋","💌","💘","💝","💖","💗","💓","💞","💕","💟","❣️","❣","💔","❤️🔥","❤🔥","❤️🩹","❤🩹","❤️","❤","🧡","💛","💚","💙","💜","🤎","🖤","🤍","💯","💢","💥","💫","💦","💨","🕳️","🕳","💣","💬","👁️🗨️","👁🗨️","👁️🗨","👁🗨","🗨️","🗨","🗯️","🗯","💭","💤"],wQ=["🏧","🚮","🚰","♿","🚹","🚺","🚻","🚼","🚾","🛂","🛃","🛄","🛅","⚠️","⚠","🚸","⛔","🚫","🚳","🚭","🚯","🚱","🚷","📵","🔞","☢️","☢","☣️","☣","⬆️","⬆","↗️","↗","➡️","➡","↘️","↘","⬇️","⬇","↙️","↙","⬅️","⬅","↖️","↖","↕️","↕","↔️","↔","↩️","↩","↪️","↪","⤴️","⤴","⤵️","⤵","🔃","🔄","🔙","🔚","🔛","🔜","🔝","🛐","⚛️","⚛","🕉️","🕉","✡️","✡","☸️","☸","☯️","☯","✝️","✝","☦️","☦","☪️","☪","☮️","☮","🕎","🔯","♈","♉","♊","♋","♌","♍","♎","♏","♐","♑","♒","♓","⛎","🔀","🔁","🔂","▶️","▶","⏩","⏭️","⏭","⏯️","⏯","◀️","◀","⏪","⏮️","⏮","🔼","⏫","🔽","⏬","⏸️","⏸","⏹️","⏹","⏺️","⏺","⏏️","⏏","🎦","🔅","🔆","📶","📳","📴","♀️","♀","♂️","♂","⚧️","⚧","✖️","✖","➕","➖","➗","♾️","♾","‼️","‼","⁉️","⁉","❓","❔","❕","❗","〰️","〰","💱","💲","⚕️","⚕","♻️","♻","⚜️","⚜","🔱","📛","🔰","⭕","✅","☑️","☑","✔️","✔","❌","❎","➰","➿","〽️","〽","✳️","✳","✴️","✴","❇️","❇","©️","©","®️","®","™️","™","#️⃣","#⃣","*️⃣","*⃣","0️⃣","0⃣","1️⃣","1⃣","2️⃣","2⃣","3️⃣","3⃣","4️⃣","4⃣","5️⃣","5⃣","6️⃣","6⃣","7️⃣","7⃣","8️⃣","8⃣","9️⃣","9⃣","🔟","🔠","🔡","🔢","🔣","🔤","🅰️","🅰","🆎","🅱️","🅱","🆑","🆒","🆓","ℹ️","ℹ","🆔","Ⓜ️","Ⓜ","🆕","🆖","🅾️","🅾","🆗","🅿️","🅿","🆘","🆙","🆚","🈁","🈂️","🈂","🈷️","🈷","🈶","🈯","🉐","🈹","🈚","🈲","🉑","🈸","🈴","🈳","㊗️","㊗","㊙️","㊙","🈺","🈵","🔴","🟠","🟡","🟢","🔵","🟣","🟤","⚫","⚪","🟥","🟧","🟨","🟩","🟦","🟪","🟫","⬛","⬜","◼️","◼","◻️","◻","◾","◽","▪️","▪","▫️","▫","🔶","🔷","🔸","🔹","🔺","🔻","💠","🔘","🔳","🔲"],xQ=["👓","🕶️","🕶","🥽","🥼","🦺","👔","👕","👖","🧣","🧤","🧥","🧦","👗","👘","🥻","🩱","🩲","🩳","👙","👚","👛","👜","👝","🛍️","🛍","🎒","🩴","👞","👟","🥾","🥿","👠","👡","🩰","👢","👑","👒","🎩","🎓","🧢","🪖","⛑️","⛑","📿","💄","💍","💎","🔇","🔈","🔉","🔊","📢","📣","📯","🔔","🔕","🎼","🎵","🎶","🎙️","🎙","🎚️","🎚","🎛️","🎛","🎤","🎧","📻","🎷","🪗","🎸","🎹","🎺","🎻","🪕","🥁","🪘","📱","📲","☎️","☎","📞","📟","📠","🔋","🔌","💻","🖥️","🖥","🖨️","🖨","⌨️","⌨","🖱️","🖱","🖲️","🖲","💽","💾","💿","📀","🧮","🎥","🎞️","🎞","📽️","📽","🎬","📺","📷","📸","📹","📼","🔍","🔎","🕯️","🕯","💡","🔦","🏮","🪔","📔","📕","📖","📗","📘","📙","📚","📓","📒","📃","📜","📄","📰","🗞️","🗞","📑","🔖","🏷️","🏷","💰","🪙","💴","💵","💶","💷","💸","💳","🧾","💹","✉️","✉","📧","📨","📩","📤","📥","📦","📫","📪","📬","📭","📮","🗳️","🗳","✏️","✏","✒️","✒","🖋️","🖋","🖊️","🖊","🖌️","🖌","🖍️","🖍","📝","💼","📁","📂","🗂️","🗂","📅","📆","🗒️","🗒","🗓️","🗓","📇","📈","📉","📊","📋","📌","📍","📎","🖇️","🖇","📏","📐","✂️","✂","🗃️","🗃","🗄️","🗄","🗑️","🗑","🔒","🔓","🔏","🔐","🔑","🗝️","🗝","🔨","🪓","⛏️","⛏","⚒️","⚒","🛠️","🛠","🗡️","🗡","⚔️","⚔","🔫","🪃","🏹","🛡️","🛡","🪚","🔧","🪛","🔩","⚙️","⚙","🗜️","🗜","⚖️","⚖","🦯","🔗","⛓️","⛓","🪝","🧰","🧲","🪜","⚗️","⚗","🧪","🧫","🧬","🔬","🔭","📡","💉","🩸","💊","🩹","🩺","🚪","🛗","🪞","🪟","🛏️","🛏","🛋️","🛋","🪑","🚽","🪠","🚿","🛁","🪤","🪒","🧴","🧷","🧹","🧺","🧻","🪣","🧼","🪥","🧽","🧯","🛒","🚬","⚰️","⚰","🪦","⚱️","⚱","🗿","🪧"],SQ=["🎃","🎄","🎆","🎇","🧨","✨","🎈","🎉","🎊","🎋","🎍","🎎","🎏","🎐","🎑","🧧","🎀","🎁","🎗️","🎗","🎟️","🎟","🎫","🎖️","🎖","🏆","🏅","🥇","🥈","🥉","⚽","⚾","🥎","🏀","🏐","🏈","🏉","🎾","🥏","🎳","🏏","🏑","🏒","🥍","🏓","🏸","🥊","🥋","🥅","⛳","⛸️","⛸","🎣","🤿","🎽","🎿","🛷","🥌","🎯","🪀","🪁","🎱","🔮","🪄","🧿","🎮","🕹️","🕹","🎰","🎲","🧩","🧸","🪅","🪆","♠️","♠","♥️","♥","♦️","♦","♣️","♣","♟️","♟","🃏","🀄","🎴","🎭","🖼️","🖼","🎨","🧵","🪡","🧶","🪢"],kQ=["🌍","🌎","🌏","🌐","🗺️","🗺","🗾","🧭","🏔️","🏔","⛰️","⛰","🌋","🗻","🏕️","🏕","🏖️","🏖","🏜️","🏜","🏝️","🏝","🏞️","🏞","🏟️","🏟","🏛️","🏛","🏗️","🏗","🧱","🪨","🪵","🛖","🏘️","🏘","🏚️","🏚","🏠","🏡","🏢","🏣","🏤","🏥","🏦","🏨","🏩","🏪","🏫","🏬","🏭","🏯","🏰","💒","🗼","🗽","⛪","🕌","🛕","🕍","⛩️","⛩","🕋","⛲","⛺","🌁","🌃","🏙️","🏙","🌄","🌅","🌆","🌇","🌉","♨️","♨","🎠","🎡","🎢","💈","🎪","🚂","🚃","🚄","🚅","🚆","🚇","🚈","🚉","🚊","🚝","🚞","🚋","🚌","🚍","🚎","🚐","🚑","🚒","🚓","🚔","🚕","🚖","🚗","🚘","🚙","🛻","🚚","🚛","🚜","🏎️","🏎","🏍️","🏍","🛵","🦽","🦼","🛺","🚲","🛴","🛹","🛼","🚏","🛣️","🛣","🛤️","🛤","🛢️","🛢","⛽","🚨","🚥","🚦","🛑","🚧","⚓","⛵","🛶","🚤","🛳️","🛳","⛴️","⛴","🛥️","🛥","🚢","✈️","✈","🛩️","🛩","🛫","🛬","🪂","💺","🚁","🚟","🚠","🚡","🛰️","🛰","🚀","🛸","🛎️","🛎","🧳","⌛","⏳","⌚","⏰","⏱️","⏱","⏲️","⏲","🕰️","🕰","🕛","🕧","🕐","🕜","🕑","🕝","🕒","🕞","🕓","🕟","🕔","🕠","🕕","🕡","🕖","🕢","🕗","🕣","🕘","🕤","🕙","🕥","🕚","🕦","🌑","🌒","🌓","🌔","🌕","🌖","🌗","🌘","🌙","🌚","🌛","🌜","🌡️","🌡","☀️","☀","🌝","🌞","🪐","⭐","🌟","🌠","🌌","☁️","☁","⛅","⛈️","⛈","🌤️","🌤","🌥️","🌥","🌦️","🌦","🌧️","🌧","🌨️","🌨","🌩️","🌩","🌪️","🌪","🌫️","🌫","🌬️","🌬","🌀","🌈","🌂","☂️","☂","☔","⛱️","⛱","⚡","❄️","❄","☃️","☃","⛄","☄️","☄","🔥","💧","🌊"],_Q=["🏁","🚩","🎌","🏴","🏳️","🏳","🏳️🌈","🏳🌈","🏳️⚧️","🏳⚧️","🏳️⚧","🏳⚧","🏴☠️","🏴☠","🇦🇨","🇦🇩","🇦🇪","🇦🇫","🇦🇬","🇦🇮","🇦🇱","🇦🇲","🇦🇴","🇦🇶","🇦🇷","🇦🇸","🇦🇹","🇦🇺","🇦🇼","🇦🇽","🇦🇿","🇧🇦","🇧🇧","🇧🇩","🇧🇪","🇧🇫","🇧🇬","🇧🇭","🇧🇮","🇧🇯","🇧🇱","🇧🇲","🇧🇳","🇧🇴","🇧🇶","🇧🇷","🇧🇸","🇧🇹","🇧🇻","🇧🇼","🇧🇾","🇧🇿","🇨🇦","🇨🇨","🇨🇩","🇨🇫","🇨🇬","🇨🇭","🇨🇮","🇨🇰","🇨🇱","🇨🇲","🇨🇳","🇨🇴","🇨🇵","🇨🇷","🇨🇺","🇨🇻","🇨🇼","🇨🇽","🇨🇾","🇨🇿","🇩🇪","🇩🇬","🇩🇯","🇩🇰","🇩🇲","🇩🇴","🇩🇿","🇪🇦","🇪🇨","🇪🇪","🇪🇬","🇪🇭","🇪🇷","🇪🇸","🇪🇹","🇪🇺","🇫🇮","🇫🇯","🇫🇰","🇫🇲","🇫🇴","🇫🇷","🇬🇦","🇬🇧","🇬🇩","🇬🇪","🇬🇫","🇬🇬","🇬🇭","🇬🇮","🇬🇱","🇬🇲","🇬🇳","🇬🇵","🇬🇶","🇬🇷","🇬🇸","🇬🇹","🇬🇺","🇬🇼","🇬🇾","🇭🇰","🇭🇲","🇭🇳","🇭🇷","🇭🇹","🇭🇺","🇮🇨","🇮🇩","🇮🇪","🇮🇱","🇮🇲","🇮🇳","🇮🇴","🇮🇶","🇮🇷","🇮🇸","🇮🇹","🇯🇪","🇯🇲","🇯🇴","🇯🇵","🇰🇪","🇰🇬","🇰🇭","🇰🇮","🇰🇲","🇰🇳","🇰🇵","🇰🇷","🇰🇼","🇰🇾","🇰🇿","🇱🇦","🇱🇧","🇱🇨","🇱🇮","🇱🇰","🇱🇷","🇱🇸","🇱🇹","🇱🇺","🇱🇻","🇱🇾","🇲🇦","🇲🇨","🇲🇩","🇲🇪","🇲🇫","🇲🇬","🇲🇭","🇲🇰","🇲🇱","🇲🇲","🇲🇳","🇲🇴","🇲🇵","🇲🇶","🇲🇷","🇲🇸","🇲🇹","🇲🇺","🇲🇻","🇲🇼","🇲🇽","🇲🇾","🇲🇿","🇳🇦","🇳🇨","🇳🇪","🇳🇫","🇳🇬","🇳🇮","🇳🇱","🇳🇴","🇳🇵","🇳🇷","🇳🇺","🇳🇿","🇴🇲","🇵🇦","🇵🇪","🇵🇫","🇵🇬","🇵🇭","🇵🇰","🇵🇱","🇵🇲","🇵🇳","🇵🇷","🇵🇸","🇵🇹","🇵🇼","🇵🇾","🇶🇦","🇷🇪","🇷🇴","🇷🇸","🇷🇺","🇷🇼","🇸🇦","🇸🇧","🇸🇨","🇸🇩","🇸🇪","🇸🇬","🇸🇭","🇸🇮","🇸🇯","🇸🇰","🇸🇱","🇸🇲","🇸🇳","🇸🇴","🇸🇷","🇸🇸","🇸🇹","🇸🇻","🇸🇽","🇸🇾","🇸🇿","🇹🇦","🇹🇨","🇹🇩","🇹🇫","🇹🇬","🇹🇭","🇹🇯","🇹🇰","🇹🇱","🇹🇲","🇹🇳","🇹🇴","🇹🇷","🇹🇹","🇹🇻","🇹🇼","🇹🇿","🇺🇦","🇺🇬","🇺🇲","🇺🇳","🇺🇸","🇺🇾","🇺🇿","🇻🇦","🇻🇨","🇻🇪","🇻🇬","🇻🇮","🇻🇳","🇻🇺","🇼🇫","🇼🇸","🇽🇰","🇾🇪","🇾🇹","🇿🇦","🇿🇲","🇿🇼","🏴","🏴","🏴"],CQ=["🐵","🐒","🦍","🦧","🐶","🐕","🦮","🐕🦺","🐩","🐺","🦊","🦝","🐱","🐈","🐈⬛","🦁","🐯","🐅","🐆","🐴","🐎","🦄","🦓","🦌","🦬","🐮","🐂","🐃","🐄","🐷","🐖","🐗","🐽","🐏","🐑","🐐","🐪","🐫","🦙","🦒","🐘","🦣","🦏","🦛","🐭","🐁","🐀","🐹","🐰","🐇","🐿️","🐿","🦫","🦔","🦇","🐻","🐻❄️","🐻❄","🐨","🐼","🦥","🦦","🦨","🦘","🦡","🐾","🦃","🐔","🐓","🐣","🐤","🐥","🐦","🐧","🕊️","🕊","🦅","🦆","🦢","🦉","🦤","🪶","🦩","🦚","🦜","🐸","🐊","🐢","🦎","🐍","🐲","🐉","🦕","🦖","🐳","🐋","🐬","🦭","🐟","🐠","🐡","🦈","🐙","🐚","🐌","🦋","🐛","🐜","🐝","🪲","🐞","🦗","🪳","🕷️","🕷","🕸️","🕸","🦂","🦟","🪰","🪱","🦠","💐","🌸","💮","🏵️","🏵","🌹","🥀","🌺","🌻","🌼","🌷","🌱","🪴","🌲","🌳","🌴","🌵","🌾","🌿","☘️","☘","🍀","🍁","🍂","🍃"],EQ=["🍇","🍈","🍉","🍊","🍋","🍌","🍍","🥭","🍎","🍏","🍐","🍑","🍒","🍓","🫐","🥝","🍅","🫒","🥥","🥑","🍆","🥔","🥕","🌽","🌶️","🌶","🫑","🥒","🥬","🥦","🧄","🧅","🍄","🥜","🌰","🍞","🥐","🥖","🫓","🥨","🥯","🥞","🧇","🧀","🍖","🍗","🥩","🥓","🍔","🍟","🍕","🌭","🥪","🌮","🌯","🫔","🥙","🧆","🥚","🍳","🥘","🍲","🫕","🥣","🥗","🍿","🧈","🧂","🥫","🍱","🍘","🍙","🍚","🍛","🍜","🍝","🍠","🍢","🍣","🍤","🍥","🥮","🍡","🥟","🥠","🥡","🦀","🦞","🦐","🦑","🦪","🍦","🍧","🍨","🍩","🍪","🎂","🍰","🧁","🥧","🍫","🍬","🍭","🍮","🍯","🍼","🥛","☕","🫖","🍵","🍶","🍾","🍷","🍸","🍹","🍺","🍻","🥂","🥃","🥤","🧋","🧃","🧉","🧊","🥢","🍽️","🍽","🍴","🥄","🔪","🏺"];function TQ(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1em",height:"1em",children:x.jsx("path",{d:"M12 0C5.373 0 0 5.372 0 12c0 6.627 5.373 12 12 12 6.628 0 12-5.373 12-12 0-6.628-5.372-12-12-12m9.949 11H17.05c.224-2.527 1.232-4.773 1.968-6.113A9.966 9.966 0 0 1 21.949 11M13 11V2.051a9.945 9.945 0 0 1 4.432 1.564c-.858 1.491-2.156 4.22-2.392 7.385H13zm-2 0H8.961c-.238-3.165-1.536-5.894-2.393-7.385A9.95 9.95 0 0 1 11 2.051V11zm0 2v8.949a9.937 9.937 0 0 1-4.432-1.564c.857-1.492 2.155-4.221 2.393-7.385H11zm4.04 0c.236 3.164 1.534 5.893 2.392 7.385A9.92 9.92 0 0 1 13 21.949V13h2.04zM4.982 4.887C5.718 6.227 6.726 8.473 6.951 11h-4.9a9.977 9.977 0 0 1 2.931-6.113M2.051 13h4.9c-.226 2.527-1.233 4.771-1.969 6.113A9.972 9.972 0 0 1 2.051 13m16.967 6.113c-.735-1.342-1.744-3.586-1.968-6.113h4.899a9.961 9.961 0 0 1-2.931 6.113",fill:"currentColor"})})}function AQ(){return x.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1em",height:"1em",children:[x.jsx("path",{d:"M15.5 8a1.5 1.5 0 1 0 .001 3.001A1.5 1.5 0 0 0 15.5 8M8.5 8a1.5 1.5 0 1 0 .001 3.001A1.5 1.5 0 0 0 8.5 8",fill:"currentColor"}),x.jsx("path",{d:"M18.933 0h-.027c-.97 0-2.138.787-3.018 1.497-1.274-.374-2.612-.51-3.887-.51-1.285 0-2.616.133-3.874.517C7.245.79 6.069 0 5.093 0h-.027C3.352 0 .07 2.67.002 7.026c-.039 2.479.276 4.238 1.04 5.013.254.258.882.677 1.295.882.191 3.177.922 5.238 2.536 6.38.897.637 2.187.949 3.2 1.102C8.04 20.6 8 20.795 8 21c0 1.773 2.35 3 4 3 1.648 0 4-1.227 4-3 0-.201-.038-.393-.072-.586 2.573-.385 5.435-1.877 5.925-7.587.396-.22.887-.568 1.104-.788.763-.774 1.079-2.534 1.04-5.013C23.929 2.67 20.646 0 18.933 0M3.223 9.135c-.237.281-.837 1.155-.884 1.238-.15-.41-.368-1.349-.337-3.291.051-3.281 2.478-4.972 3.091-5.031.256.015.731.27 1.265.646-1.11 1.171-2.275 2.915-2.352 5.125-.133.546-.398.858-.783 1.313M12 22c-.901 0-1.954-.693-2-1 0-.654.475-1.236 1-1.602V20a1 1 0 1 0 2 0v-.602c.524.365 1 .947 1 1.602-.046.307-1.099 1-2 1m3-3.48v.02a4.752 4.752 0 0 0-1.262-1.02c1.092-.516 2.239-1.334 2.239-2.217 0-1.842-1.781-2.195-3.977-2.195-2.196 0-3.978.354-3.978 2.195 0 .883 1.148 1.701 2.238 2.217A4.8 4.8 0 0 0 9 18.539v-.025c-1-.076-2.182-.281-2.973-.842-1.301-.92-1.838-3.045-1.853-6.478l.023-.041c.496-.826 1.49-1.45 1.804-3.102 0-2.047 1.357-3.631 2.362-4.522C9.37 3.178 10.555 3 11.948 3c1.447 0 2.685.192 3.733.57 1 .9 2.316 2.465 2.316 4.48.313 1.651 1.307 2.275 1.803 3.102.035.058.068.117.102.178-.059 5.967-1.949 7.01-4.902 7.19m6.628-8.202c-.037-.065-.074-.13-.113-.195a7.587 7.587 0 0 0-.739-.987c-.385-.455-.648-.768-.782-1.313-.076-2.209-1.241-3.954-2.353-5.124.531-.376 1.004-.63 1.261-.647.636.071 3.044 1.764 3.096 5.031.027 1.81-.347 3.218-.37 3.235",fill:"currentColor"})]})}function RQ(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1em",height:"1em",children:x.jsx("path",{d:"M0 0l6.084 24H8L1.916 0zM21 5h-4l-1-4H4l3 12h3l1 4h13L21 5zM6.563 3h7.875l2 8H8.563l-2-8zm8.832 10l-2.856 1.904L12.063 13h3.332zM19 13l-1.5-6h1.938l2 8H16l3-2z",fill:"currentColor"})})}function IQ(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1em",height:"1em",children:x.jsx("path",{d:"M17 4.978c-1.838 0-2.876.396-3.68.934.513-1.172 1.768-2.934 4.68-2.934a1 1 0 0 0 0-2c-2.921 0-4.629 1.365-5.547 2.512-.064.078-.119.162-.18.244C11.73 1.838 10.798.023 9.207.023 8.579.022 7.85.306 7 .978 5.027 2.54 5.329 3.902 6.492 4.999 3.609 5.222 0 7.352 0 12.969c0 4.582 4.961 11.009 9 11.009 1.975 0 2.371-.486 3-1 .629.514 1.025 1 3 1 4.039 0 9-6.418 9-11 0-5.953-4.055-8-7-8M8.242 2.546c.641-.508.943-.523.965-.523.426.169.975 1.405 1.357 3.055-1.527-.629-2.741-1.352-2.98-1.846.059-.112.241-.356.658-.686M15 21.978c-1.08 0-1.21-.109-1.559-.402l-.176-.146c-.367-.302-.816-.452-1.266-.452s-.898.15-1.266.452l-.176.146c-.347.292-.477.402-1.557.402-2.813 0-7-5.389-7-9.009 0-5.823 4.488-5.991 5-5.991 1.939 0 2.484.471 3.387 1.251l.323.276a1.995 1.995 0 0 0 2.58 0l.323-.276c.902-.78 1.447-1.251 3.387-1.251.512 0 5 .168 5 6 0 3.617-4.187 9-7 9",fill:"currentColor"})})}function OQ(){return x.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1em",height:"1em",children:[x.jsx("path",{d:"M12 0a9 9 0 0 0-5 16.482V21s2.035 3 5 3 5-3 5-3v-4.518A9 9 0 0 0 12 0zm0 2c3.86 0 7 3.141 7 7s-3.14 7-7 7-7-3.141-7-7 3.14-7 7-7zM9 17.477c.94.332 1.946.523 3 .523s2.06-.19 3-.523v.834c-.91.436-1.925.689-3 .689a6.924 6.924 0 0 1-3-.69v-.833zm.236 3.07A8.854 8.854 0 0 0 12 21c.965 0 1.888-.167 2.758-.451C14.155 21.173 13.153 22 12 22c-1.102 0-2.117-.789-2.764-1.453z",fill:"currentColor"}),x.jsx("path",{d:"M14.745 12.449h-.004c-.852-.024-1.188-.858-1.577-1.824-.421-1.061-.703-1.561-1.182-1.566h-.009c-.481 0-.783.497-1.235 1.537-.436.982-.801 1.811-1.636 1.791l-.276-.043c-.565-.171-.853-.691-1.284-1.794-.125-.313-.202-.632-.27-.913-.051-.213-.127-.53-.195-.634C7.067 9.004 7.039 9 6.99 9A1 1 0 0 1 7 7h.01c1.662.017 2.015 1.373 2.198 2.134.486-.981 1.304-2.058 2.797-2.075 1.531.018 2.28 1.153 2.731 2.141l.002-.008C14.944 8.424 15.327 7 16.979 7h.032A1 1 0 1 1 17 9h-.011c-.149.076-.256.474-.319.709a6.484 6.484 0 0 1-.311.951c-.429.973-.79 1.789-1.614 1.789",fill:"currentColor"})]})}function MQ(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1em",height:"1em",children:x.jsx("path",{d:"M0 0h11v2H0zM4 11h3V6h4V4H0v2h4zM15.5 17c1.381 0 2.5-1.116 2.5-2.493s-1.119-2.493-2.5-2.493S13 13.13 13 14.507 14.119 17 15.5 17m0-2.986c.276 0 .5.222.5.493 0 .272-.224.493-.5.493s-.5-.221-.5-.493.224-.493.5-.493M21.5 19.014c-1.381 0-2.5 1.116-2.5 2.493S20.119 24 21.5 24s2.5-1.116 2.5-2.493-1.119-2.493-2.5-2.493m0 2.986a.497.497 0 0 1-.5-.493c0-.271.224-.493.5-.493s.5.222.5.493a.497.497 0 0 1-.5.493M22 13l-9 9 1.513 1.5 8.99-9.009zM17 11c2.209 0 4-1.119 4-2.5V2s.985-.161 1.498.949C23.01 4.055 23 6 23 6s1-1.119 1-3.135C24-.02 21 0 21 0h-2v6.347A5.853 5.853 0 0 0 17 6c-2.209 0-4 1.119-4 2.5s1.791 2.5 4 2.5M10.297 20.482l-1.475-1.585a47.54 47.54 0 0 1-1.442 1.129c-.307-.288-.989-1.016-2.045-2.183.902-.836 1.479-1.466 1.729-1.892s.376-.871.376-1.336c0-.592-.273-1.178-.818-1.759-.546-.581-1.329-.871-2.349-.871-1.008 0-1.79.293-2.344.879-.556.587-.832 1.181-.832 1.784 0 .813.419 1.748 1.256 2.805-.847.614-1.444 1.208-1.794 1.784a3.465 3.465 0 0 0-.523 1.833c0 .857.308 1.56.924 2.107.616.549 1.423.823 2.42.823 1.173 0 2.444-.379 3.813-1.137L8.235 24h2.819l-2.09-2.383 1.333-1.135zm-6.736-6.389a1.02 1.02 0 0 1 .73-.286c.31 0 .559.085.747.254a.849.849 0 0 1 .283.659c0 .518-.419 1.112-1.257 1.784-.536-.651-.805-1.231-.805-1.742a.901.901 0 0 1 .302-.669M3.74 22c-.427 0-.778-.116-1.057-.349-.279-.232-.418-.487-.418-.766 0-.594.509-1.288 1.527-2.083.968 1.134 1.717 1.946 2.248 2.438-.921.507-1.686.76-2.3.76",fill:"currentColor"})})}function NQ(){return x.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1em",height:"1em",children:[x.jsx("path",{d:"M6.5 12C5.122 12 4 13.121 4 14.5S5.122 17 6.5 17 9 15.879 9 14.5 7.878 12 6.5 12m0 3c-.275 0-.5-.225-.5-.5s.225-.5.5-.5.5.225.5.5-.225.5-.5.5M17.5 12c-1.378 0-2.5 1.121-2.5 2.5s1.122 2.5 2.5 2.5 2.5-1.121 2.5-2.5-1.122-2.5-2.5-2.5m0 3c-.275 0-.5-.225-.5-.5s.225-.5.5-.5.5.225.5.5-.225.5-.5.5",fill:"currentColor"}),x.jsx("path",{d:"M22.482 9.494l-1.039-.346L21.4 9h.6c.552 0 1-.439 1-.992 0-.006-.003-.008-.003-.008H23c0-1-.889-2-1.984-2h-.642l-.731-1.717C19.262 3.012 18.091 2 16.764 2H7.236C5.909 2 4.738 3.012 4.357 4.283L3.626 6h-.642C1.889 6 1 7 1 8h.003S1 8.002 1 8.008C1 8.561 1.448 9 2 9h.6l-.043.148-1.039.346a2.001 2.001 0 0 0-1.359 2.097l.751 7.508a1 1 0 0 0 .994.901H3v1c0 1.103.896 2 2 2h2c1.104 0 2-.897 2-2v-1h6v1c0 1.103.896 2 2 2h2c1.104 0 2-.897 2-2v-1h1.096a.999.999 0 0 0 .994-.901l.751-7.508a2.001 2.001 0 0 0-1.359-2.097M6.273 4.857C6.402 4.43 6.788 4 7.236 4h9.527c.448 0 .834.43.963.857L19.313 9H4.688l1.585-4.143zM7 21H5v-1h2v1zm12 0h-2v-1h2v1zm2.189-3H2.811l-.662-6.607L3 11h18l.852.393L21.189 18z",fill:"currentColor"})]})}function DQ(t,e=null){if(typeof window>"u")throw new Error;const r=localStorage.getItem(t);if(!r)return e;try{return JSON.parse(r)}catch{return r}}function PQ(t,e){window.localStorage.setItem(t,`${e}`)}class Tw{constructor(e,r){Tn(this,"key");Tn(this,"value");Tn(this,"prev");Tn(this,"next");this.key=e,this.value=r,this.prev=null,this.next=null}}class LQ{constructor(e){Tn(this,"capacity");Tn(this,"usedCapacity");Tn(this,"head");Tn(this,"tail");Tn(this,"store");this.capacity=e||20,this.usedCapacity=0,this.store={},this.head=new Tw("fakeHeadNode","fakeHeadNode"),this.tail=new Tw("fakeTailNode","fakeTailNode"),this.head.next=this.tail,this.tail.prev=this.head}removeNode(e){e.prev.next=e.next,e.next.prev=e.prev}addToHead(e){e.prev=this.head,e.next=this.head.next,this.head.next.prev=e,this.head.next=e}moveToHead(e){this.removeNode(e),this.addToHead(e)}removeTail(){const e=this.tail.prev;return this.removeNode(e),e}get(e){if(e in this.store){const r=this.store[e];return this.moveToHead(r),r.value}return-1}put(e,r){if(e in this.store){const n=this.store[e];n.value=r,this.moveToHead(n)}else{const n=new Tw(e,r);if(this.addToHead(n),this.store[e]=n,this.usedCapacity+=1,this.usedCapacity>this.capacity){const i=this.removeTail();delete this.store[i.key],this.usedCapacity-=1}}}keys(){const e=[];let r=this.head;for(;r;)e.push(r.key),r=r.next;return e.slice(1,-1)}values(){const e=[];let r=this.head;for(;r;)e.push(r.value),r=r.next;return e.slice(1,-1)}toJSON(){return this.store}}function FQ(t,e){const r=new LQ(e);return{syncFromStorage(){(DQ(t)||[]).slice().reverse().forEach(o=>{r.put(o,o)})},syncToStorage(){PQ(t,g7(r.keys()))},put(i){r.put(i,i),this.syncToStorage()},get(i){return i?r.get(i):r.keys()}}}const wu=FQ("EMOJI_PICKER",20),WT=[{title:"Smileys & People",data:bQ,icon:He.Laugh},{title:"Animals & Nature",data:CQ,icon:AQ},{title:"Food & Drink",data:EQ,icon:IQ},{title:"Activity",data:SQ,icon:TQ},{title:"Travel & Places",data:kQ,icon:NQ},{title:"Object",data:xQ,icon:OQ},{title:"Symbol",data:wQ,icon:MQ},{title:"Flags",data:_Q,icon:RQ}],jQ=["😀","😃","😄","😁","😆","😅","😂","🤣"];function BQ({onSelectEmoji:t,children:e}){const[r,n]=J.useState([]),{t:i}=Ct(),o=J.useMemo(()=>r.length?[{title:"Frequently used",icon:He.Clock3,data:r},...WT]:WT,[r]),s=J.useCallback(a=>{wu.put(a),n(wu.get()),t&&t(a)},[t]);return J.useEffect(()=>{wu.syncFromStorage();const a=wu.get();a!=null&&a.length||jQ.forEach(c=>{wu.put(c)});const l=wu.get();n(l)},[]),x.jsxs(xi,{modal:!0,children:[x.jsx(Si,{asChild:!0,children:e}),x.jsx(Xn,{hideWhenDetached:!0,className:"richtext-w-full richtext-h-full richtext-p-2",align:"start",side:"bottom",children:x.jsxs(uS,{defaultValue:"Frequently used",children:[x.jsx(Uy,{className:"richtext-flex richtext-items-center richtext-gap-[4px]",children:o.map(a=>x.jsx(td,{value:a.title,className:"!richtext-p-[6px] richtext-bg-accent hover:richtext-text-accent-foreground",children:a.icon&&x.jsx(a.icon,{size:16})},`emoji-picker-title-${a.title}`))}),o.map(a=>x.jsxs(rd,{value:a.title,children:[x.jsx("p",{className:"richtext-mb-[6px] richtext-font-semibold",children:i(a.title)}),x.jsx("div",{className:"richtext-max-h-[280px] richtext-overflow-y-auto",children:x.jsx("div",{className:"richtext-grid richtext-grid-cols-8 richtext-gap-1 ",children:(a.data||[]).map(l=>x.jsx("div",{onClick:()=>s(l),className:"richtext-text-center richtext-cursor-pointer",children:l},`emoji-picker-${l}`))})})]},`emoji-picker-content-${a.title}`))]})})]})}function zQ({editor:t,icon:e,...r}){const n=J.useCallback(i=>{const{selection:o}=t.state,{$anchor:s}=o;return t.chain().insertContentAt(s.pos,i).run()},[t]);return x.jsx(BQ,{onSelectEmoji:n,children:x.jsx(Ve,{tooltip:r==null?void 0:r.tooltip,icon:e})})}const HQ=200,$Q=new St("emoji"),UQ=Nt.create({name:"emoji",content:"text*",priority:HQ,addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),HTMLAttributes:{},suggestion:{char:":",pluginKey:$Q,command:({editor:e,range:r,props:n})=>{e.chain().focus().insertContentAt(r,`${n.emoji} `).run()}},button:({editor:e,t:r})=>({component:zQ,componentProps:{editor:e,action:()=>{},isActive:()=>!1,disabled:!1,icon:"EmojiIcon",tooltip:r("editor.emoji.tooltip")}})}},addCommands(){return{setEmoji:t=>({commands:e})=>e.insertContent(`${t.emoji} `)}},addProseMirrorPlugins(){return[VS({editor:this.editor,...this.options.suggestion})]}}).configure({suggestion:{items:({query:t})=>vQ(t),render:()=>{let t,e,r;return{onStart:n=>{r=n.editor.isEditable,r&&(t=new By(HD,{props:n,editor:n.editor}),e=gd("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:t.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"}))},onUpdate(n){r&&(t.updateProps(n),e[0].setProps({getReferenceClientRect:n.clientRect}))},onKeyDown(n){var i;if(r)return n.event.key==="Escape"?(e[0].hide(),!0):(i=t.ref)==null?void 0:i.onKeyDown(n)},onExit(){r&&(e[0].destroy(),t.destroy())}}}}});function WQ({editor:t,...e}){const{t:r}=Ct(),n=Wh(t,Nl.name,{text:"",defaultShowPicker:!1}),{text:i,defaultShowPicker:o}=n,[s,a]=J.useState(""),l=J.useCallback(()=>{t.chain().focus().setKatex({text:s}).run(),a("")},[t,s]);J.useEffect(()=>{o&&t.chain().updateAttributes(Nl.name,{defaultShowPicker:!1}).focus().run()},[t,o]);const c=J.useMemo(()=>{try{return y1.renderToString(`${s}`)}catch{return s}},[s]),d=J.useMemo(()=>`${s}`.trim()?x.jsx("span",{contentEditable:!1,dangerouslySetInnerHTML:{__html:c||""}}):null,[s,c]);return x.jsxs(xi,{modal:!0,children:[x.jsx(Si,{asChild:!0,children:x.jsx(Ve,{tooltip:e==null?void 0:e.tooltip,icon:e==null?void 0:e.icon})}),x.jsxs(Xn,{hideWhenDetached:!0,className:"richtext-w-full richtext-h-full richtext-p-2",align:"start",side:"bottom",children:[x.jsx(Kn,{className:"richtext-mb-[6px]",children:r("editor.formula.dialog.text")}),x.jsx("div",{className:"richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5 richtext-mb-[16px]",children:x.jsx("div",{className:"richtext-relative richtext-w-full richtext-max-w-sm",children:x.jsx(Vh,{value:s,onChange:f=>a(f.target.value),autoFocus:!0,required:!0,rows:3,defaultValue:i,className:"richtext-w-full",placeholder:"Text"})})}),d&&x.jsx("div",{className:"richtext-my-[10px] richtext-p-[10px] richtext-rounded-[6px] !richtext-border-[1px] richtext-max-w-[286px] richtext-whitespace-nowrap richtext-overflow-auto",children:d}),x.jsxs("div",{className:"richtext-flex richtext-items-center richtext-justify-between richtext-gap-[6px]",children:[x.jsx(Mt,{onClick:l,className:"richtext-flex-1",children:"Submit"}),x.jsx("a",{href:"https://katex.org/docs/supported",target:"_blank",rel:"noreferrer noopener",children:x.jsx(He.HelpCircle,{size:16})})]})]})]})}function VQ(t,e=1){let r=0,n=0,i=0;if(t.startsWith("rgb")){const o=t.replace(/\s/g,"").match(/rgb\((.*)\)$/)[1].split(",");r=+o[0],n=+o[1],i=+o[2]}else if(t.startsWith("#")){let o=t.replace("#","");o.length===3&&(o=`${o[0]}${o[0]}${o[1]}${o[1]}${o[2]}${o[2]}`),r=Number.parseInt(o.substring(0,2),16),n=Number.parseInt(o.substring(2,4),16),i=Number.parseInt(o.substring(4,6),16)}else return t;return e>1&&e<=100&&(e=e/100),`rgba(${r},${n},${i},${e})`}function GQ({node:t}){const e=jV(),{text:r}=t.attrs,n=J.useMemo(()=>{const s="rgb(254, 242, 237)";return e==="dark"?VQ(s,.75):s},[e]),i=J.useMemo(()=>{try{return y1.renderToString(`${r}`)}catch{return r}},[r]),o=J.useMemo(()=>r.trim()?x.jsx("span",{contentEditable:!1,dangerouslySetInnerHTML:{__html:i}}):x.jsx("span",{contentEditable:!1,children:"Not enter a formula"}),[r,i]);return x.jsx(gi,{style:{display:"inline-block",backgroundColor:n},as:"span",children:o})}function KQ(t){return e=>e.getAttribute(t)}const Nl=Nt.create({name:"katex",group:"inline",inline:!0,defining:!0,draggable:!0,selectable:!0,addOptions(){return{HTMLAttributes:{class:"katex"},button:({editor:t,t:e})=>({component:WQ,componentProps:{editor:t,action:()=>{},isActive:()=>!1,disabled:!1,icon:"KatexIcon",tooltip:e("editor.katex.tooltip")}})}},addAttributes(){return{text:{default:"",parseHTML:KQ("text")},defaultShowPicker:{default:!1}}},parseHTML(){return[{tag:"span.katex"}]},renderHTML({HTMLAttributes:t}){return["span",lt(this.options&&this.options.HTMLAttributes||{},t)]},addCommands(){return{setKatex:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[$h({find:/^\$katex\$$/,type:this.type,getAttributes:()=>({defaultShowPicker:!0})})]},addNodeView(){return _o(GQ)}});function qQ(t){const e=document.createElement("iframe");e.setAttribute("style","position: absolute; width: 0; height: 0; top: 0; left: 0;"),document.body.appendChild(e),e.textContent=`
|
|
272
|
+
<!DOCTYPE html>
|
|
273
|
+
<html lang="en">
|
|
274
|
+
<head>
|
|
275
|
+
<title>Echo Editor</title>
|
|
276
|
+
<meta charset="UTF-8">
|
|
277
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
278
|
+
</head>
|
|
279
|
+
<body class="is-print">
|
|
280
|
+
<div class="tiptap ProseMirror" translate="no" aria-expanded="false">
|
|
281
|
+
${t}
|
|
282
|
+
</div>
|
|
283
|
+
</body>
|
|
284
|
+
</html>
|
|
285
|
+
`;const r=e.contentWindow,n=e.contentDocument||e.contentWindow&&e.contentWindow.document,i=document.createElement("link");i.rel="stylesheet",i.href="https://cdn.jsdelivr.net/npm/reactjs-tiptap-editor@latest/lib/style.css",n.head.appendChild(i),n&&(n.open(),n.write(t),n.close()),r&&(e.onload=function(){try{setTimeout(()=>{r.focus();try{r.document.execCommand("print",!1)||r.print()}catch{r.print()}r.close()},10)}catch(o){console.error(o)}setTimeout(()=>{document.body.removeChild(e)},100)})}function XQ(t){const e=t.getHTML();return e?(qQ(e),!0):!1}const YQ=yt.create({name:"exportPdf",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,t:r})=>({component:Ve,componentProps:{action:()=>{XQ(e)},icon:"ExportPdf",tooltip:r("editor.exportPdf.tooltip"),isActive:()=>!1,disabled:!1}})}}});function JQ(t,e){const r=atob(t.split(",")[1]),n=Array.from({length:r.length});for(let o=0;o<r.length;o++)n[o]=r.charCodeAt(o);const i=new Uint8Array(n);return new Blob([i],{type:e})}function ZQ(t,e){return new File([t],e,{type:t.type})}function QQ(t){const[e,r]=J.useState(!1),[n,i]=J.useState(),o=J.useRef();function s(){o.current.click()}function a(f){const p=f.target.files[0];i(p),p&&c()}async function l(f){var S;const m=new DOMParser().parseFromString(f,"text/html"),g=m.querySelectorAll("img");if(!g.length)return m.body.innerHTML;if(kM(t.editor,"image")){const w=(S=t.editor.extensionManager.extensions.find(T=>T.name==="importWord"))==null?void 0:S.options;if(w&&typeof w.upload=="function"){const T=[];for(const j of g){const $=j.getAttribute("src"),W=JQ($,"image/jpeg"),Y=ZQ(W,"image.jpeg");T.push(Y)}const M=await w.upload(T);for(let j=0;j<g.length;j++){const $=g[j];$.setAttribute("src",M[j].src);const W=$.parentElement;(W==null?void 0:W.tagName)==="P"&&(W.insertAdjacentElement("beforebegin",$),!W.hasChildNodes()&&W.textContent===""&&W.remove())}return m.body.innerHTML}else return console.warn("Image Upload method found, skip image conversion"),m.body.innerHTML}else return console.error("Image extension not found, unable to convert image"),m.body.innerHTML}async function c(){if(t.convert){const f=await t.convert(n);d(f)}else{const f=new FormData,p=JSON.stringify({collaboration_features:{comments:!0,user_id:"e3",track_changes:!0},formatting:{resets:"none",defaults:"inline",styles:"inline",comments:"basic"}});f.append("config",p),f.append("file",n),r(!0),fetch("https://docx-converter.cke-cs.com/v2/convert/docx-html",{method:"POST",body:f}).then(m=>m.json()).then(async m=>{d(m.html)}).catch(m=>{console.error("Error:",m),r(!1)})}}async function d(f){const p=await l(f);t.editor.chain().setContent(p,!0).run(),r(!1)}return x.jsxs("div",{children:[x.jsx(Ve,{loading:e,disabled:t==null?void 0:t.disabled,icon:t==null?void 0:t.icon,tooltip:t==null?void 0:t.tooltip,action:s}),x.jsx("input",{type:"file",accept:".docx",ref:o,style:{display:"none"},onChange:a})]})}const eee=yt.create({name:"importWord",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),upload:void 0,convert:void 0,button:({editor:e,extension:r,t:n})=>{const{convert:i}=r.options;return{component:QQ,componentProps:{convert:i,action:()=>e.commands.setHorizontalRule(),disabled:!e.can().setHorizontalRule(),icon:"Word",shortcutKeys:["alt","mod","S"],tooltip:n("editor.importWrod.tooltip")}}}}}});var tee=Object.defineProperty,ree=Object.defineProperties,nee=Object.getOwnPropertyDescriptors,VT=Object.getOwnPropertySymbols,iee=Object.prototype.hasOwnProperty,oee=Object.prototype.propertyIsEnumerable,i1=(t,e,r)=>e in t?tee(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,vt=(t,e)=>{for(var r in e||(e={}))iee.call(e,r)&&i1(t,r,e[r]);if(VT)for(var r of VT(e))oee.call(e,r)&&i1(t,r,e[r]);return t},Ca=(t,e)=>ree(t,nee(e)),Ae=(t,e,r)=>(i1(t,typeof e!="symbol"?e+"":e,r),r),pm=(t,e,r)=>new Promise((n,i)=>{var o=l=>{try{a(r.next(l))}catch(c){i(c)}},s=l=>{try{a(r.throw(l))}catch(c){i(c)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(o,s);a((r=r.apply(t,e)).next())});class my{constructor(e){Ae(this,"rootKey"),this.rootKey=e}}const see=Object.seal({});class Te extends my{constructor(e){super(e),Ae(this,"root"),this.root=new Array}prepForXml(e){var r;e.stack.push(this);const n=this.root.map(i=>i instanceof my?i.prepForXml(e):i).filter(i=>i!==void 0);return e.stack.pop(),{[this.rootKey]:n.length?n.length===1&&((r=n[0])!=null&&r._attr)?n[0]:n:see}}addChildElement(e){return this.root.push(e),this}}class bs extends Te{prepForXml(e){const r=super.prepForXml(e);if(r&&(typeof r[this.rootKey]!="object"||Object.keys(r[this.rootKey]).length))return r}}class Xe extends my{constructor(e){super("_attr"),Ae(this,"xmlKeys"),this.root=e}prepForXml(e){const r={};return Object.keys(this.root).forEach(n=>{const i=this.root[n];if(i!==void 0){const o=this.xmlKeys&&this.xmlKeys[n]||n;r[o]=i}}),{_attr:r}}}class ws extends my{constructor(e){super("_attr"),this.root=e}prepForXml(e){return{_attr:Object.values(this.root).filter(({value:n})=>n!==void 0).reduce((n,{key:i,value:o})=>Ca(vt({},n),{[i]:o}),{})}}}class sr extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{val:"w:val",color:"w:color",fill:"w:fill",space:"w:space",sz:"w:sz",type:"w:type",rsidR:"w:rsidR",rsidRPr:"w:rsidRPr",rsidSect:"w:rsidSect",w:"w:w",h:"w:h",top:"w:top",right:"w:right",bottom:"w:bottom",left:"w:left",header:"w:header",footer:"w:footer",gutter:"w:gutter",linePitch:"w:linePitch",pos:"w:pos"})}}var mo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function $D(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var UD={},qS={exports:{}},Uu=typeof Reflect=="object"?Reflect:null,GT=Uu&&typeof Uu.apply=="function"?Uu.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},Xm;Uu&&typeof Uu.ownKeys=="function"?Xm=Uu.ownKeys:Object.getOwnPropertySymbols?Xm=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Xm=function(e){return Object.getOwnPropertyNames(e)};function aee(t){console&&console.warn&&console.warn(t)}var WD=Number.isNaN||function(e){return e!==e};function Bt(){Bt.init.call(this)}qS.exports=Bt;qS.exports.once=dee;Bt.EventEmitter=Bt;Bt.prototype._events=void 0;Bt.prototype._eventsCount=0;Bt.prototype._maxListeners=void 0;var KT=10;function iv(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(Bt,"defaultMaxListeners",{enumerable:!0,get:function(){return KT},set:function(t){if(typeof t!="number"||t<0||WD(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");KT=t}});Bt.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};Bt.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||WD(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function VD(t){return t._maxListeners===void 0?Bt.defaultMaxListeners:t._maxListeners}Bt.prototype.getMaxListeners=function(){return VD(this)};Bt.prototype.emit=function(e){for(var r=[],n=1;n<arguments.length;n++)r.push(arguments[n]);var i=e==="error",o=this._events;if(o!==void 0)i=i&&o.error===void 0;else if(!i)return!1;if(i){var s;if(r.length>0&&(s=r[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var l=o[e];if(l===void 0)return!1;if(typeof l=="function")GT(l,this,r);else for(var c=l.length,d=YD(l,c),n=0;n<c;++n)GT(d[n],this,r);return!0};function GD(t,e,r,n){var i,o,s;if(iv(r),o=t._events,o===void 0?(o=t._events=Object.create(null),t._eventsCount=0):(o.newListener!==void 0&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),s===void 0)s=o[e]=r,++t._eventsCount;else if(typeof s=="function"?s=o[e]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),i=VD(t),i>0&&s.length>i&&!s.warned){s.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=s.length,aee(a)}return t}Bt.prototype.addListener=function(e,r){return GD(this,e,r,!1)};Bt.prototype.on=Bt.prototype.addListener;Bt.prototype.prependListener=function(e,r){return GD(this,e,r,!0)};function lee(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function KD(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=lee.bind(n);return i.listener=r,n.wrapFn=i,i}Bt.prototype.once=function(e,r){return iv(r),this.on(e,KD(this,e,r)),this};Bt.prototype.prependOnceListener=function(e,r){return iv(r),this.prependListener(e,KD(this,e,r)),this};Bt.prototype.removeListener=function(e,r){var n,i,o,s,a;if(iv(r),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this;if(n===r||n.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||r));else if(typeof n!="function"){for(o=-1,s=n.length-1;s>=0;s--)if(n[s]===r||n[s].listener===r){a=n[s].listener,o=s;break}if(o<0)return this;o===0?n.shift():cee(n,o),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,a||r)}return this};Bt.prototype.off=Bt.prototype.removeListener;Bt.prototype.removeAllListeners=function(e){var r,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var o=Object.keys(n),s;for(i=0;i<o.length;++i)s=o[i],s!=="removeListener"&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=n[e],typeof r=="function")this.removeListener(e,r);else if(r!==void 0)for(i=r.length-1;i>=0;i--)this.removeListener(e,r[i]);return this};function qD(t,e,r){var n=t._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?r?[i.listener||i]:[i]:r?uee(i):YD(i,i.length)}Bt.prototype.listeners=function(e){return qD(this,e,!0)};Bt.prototype.rawListeners=function(e){return qD(this,e,!1)};Bt.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):XD.call(t,e)};Bt.prototype.listenerCount=XD;function XD(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}Bt.prototype.eventNames=function(){return this._eventsCount>0?Xm(this._events):[]};function YD(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function cee(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function uee(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}function dee(t,e){return new Promise(function(r,n){function i(s){t.removeListener(e,o),n(s)}function o(){typeof t.removeListener=="function"&&t.removeListener("error",i),r([].slice.call(arguments))}JD(t,e,o,{once:!0}),e!=="error"&&fee(t,i,{once:!0})})}function fee(t,e,r){typeof t.on=="function"&&JD(t,"error",e,r)}function JD(t,e,r,n){if(typeof t.on=="function")n.once?t.once(e,r):t.on(e,r);else if(typeof t.addEventListener=="function")t.addEventListener(e,function i(o){n.once&&t.removeEventListener(e,i),r(o)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}var XS=qS.exports,o1={exports:{}};typeof Object.create=="function"?o1.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:o1.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}};var fc=o1.exports;function hee(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ZD={exports:{}},ur=ZD.exports={},co,uo;function s1(){throw new Error("setTimeout has not been defined")}function a1(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?co=setTimeout:co=s1}catch{co=s1}try{typeof clearTimeout=="function"?uo=clearTimeout:uo=a1}catch{uo=a1}})();function QD(t){if(co===setTimeout)return setTimeout(t,0);if((co===s1||!co)&&setTimeout)return co=setTimeout,setTimeout(t,0);try{return co(t,0)}catch{try{return co.call(null,t,0)}catch{return co.call(this,t,0)}}}function pee(t){if(uo===clearTimeout)return clearTimeout(t);if((uo===a1||!uo)&&clearTimeout)return uo=clearTimeout,clearTimeout(t);try{return uo(t)}catch{try{return uo.call(null,t)}catch{return uo.call(this,t)}}}var ss=[],Wu=!1,Dl,Ym=-1;function mee(){!Wu||!Dl||(Wu=!1,Dl.length?ss=Dl.concat(ss):Ym=-1,ss.length&&e3())}function e3(){if(!Wu){var t=QD(mee);Wu=!0;for(var e=ss.length;e;){for(Dl=ss,ss=[];++Ym<e;)Dl&&Dl[Ym].run();Ym=-1,e=ss.length}Dl=null,Wu=!1,pee(t)}}ur.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];ss.push(new t3(t,e)),ss.length===1&&!Wu&&QD(e3)};function t3(t,e){this.fun=t,this.array=e}t3.prototype.run=function(){this.fun.apply(null,this.array)};ur.title="browser";ur.browser=!0;ur.env={};ur.argv=[];ur.version="";ur.versions={};function xs(){}ur.on=xs;ur.addListener=xs;ur.once=xs;ur.off=xs;ur.removeListener=xs;ur.removeAllListeners=xs;ur.emit=xs;ur.prependListener=xs;ur.prependOnceListener=xs;ur.listeners=function(t){return[]};ur.binding=function(t){throw new Error("process.binding is not supported")};ur.cwd=function(){return"/"};ur.chdir=function(t){throw new Error("process.chdir is not supported")};ur.umask=function(){return 0};var gee=ZD.exports;const gt=hee(gee);var Aw,qT;function r3(){return qT||(qT=1,Aw=XS.EventEmitter),Aw}var Rw={},Lf={},XT;function yee(){if(XT)return Lf;XT=1,Lf.byteLength=a,Lf.toByteArray=c,Lf.fromByteArray=p;for(var t=[],e=[],r=typeof Uint8Array<"u"?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,o=n.length;i<o;++i)t[i]=n[i],e[n.charCodeAt(i)]=i;e[45]=62,e[95]=63;function s(m){var g=m.length;if(g%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var b=m.indexOf("=");b===-1&&(b=g);var S=b===g?0:4-b%4;return[b,S]}function a(m){var g=s(m),b=g[0],S=g[1];return(b+S)*3/4-S}function l(m,g,b){return(g+b)*3/4-b}function c(m){var g,b=s(m),S=b[0],w=b[1],T=new r(l(m,S,w)),M=0,j=w>0?S-4:S,$;for($=0;$<j;$+=4)g=e[m.charCodeAt($)]<<18|e[m.charCodeAt($+1)]<<12|e[m.charCodeAt($+2)]<<6|e[m.charCodeAt($+3)],T[M++]=g>>16&255,T[M++]=g>>8&255,T[M++]=g&255;return w===2&&(g=e[m.charCodeAt($)]<<2|e[m.charCodeAt($+1)]>>4,T[M++]=g&255),w===1&&(g=e[m.charCodeAt($)]<<10|e[m.charCodeAt($+1)]<<4|e[m.charCodeAt($+2)]>>2,T[M++]=g>>8&255,T[M++]=g&255),T}function d(m){return t[m>>18&63]+t[m>>12&63]+t[m>>6&63]+t[m&63]}function f(m,g,b){for(var S,w=[],T=g;T<b;T+=3)S=(m[T]<<16&16711680)+(m[T+1]<<8&65280)+(m[T+2]&255),w.push(d(S));return w.join("")}function p(m){for(var g,b=m.length,S=b%3,w=[],T=16383,M=0,j=b-S;M<j;M+=T)w.push(f(m,M,M+T>j?j:M+T));return S===1?(g=m[b-1],w.push(t[g>>2]+t[g<<4&63]+"==")):S===2&&(g=(m[b-2]<<8)+m[b-1],w.push(t[g>>10]+t[g>>4&63]+t[g<<2&63]+"=")),w.join("")}return Lf}var mm={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var YT;function vee(){return YT||(YT=1,mm.read=function(t,e,r,n,i){var o,s,a=i*8-n-1,l=(1<<a)-1,c=l>>1,d=-7,f=r?i-1:0,p=r?-1:1,m=t[e+f];for(f+=p,o=m&(1<<-d)-1,m>>=-d,d+=a;d>0;o=o*256+t[e+f],f+=p,d-=8);for(s=o&(1<<-d)-1,o>>=-d,d+=n;d>0;s=s*256+t[e+f],f+=p,d-=8);if(o===0)o=1-c;else{if(o===l)return s?NaN:(m?-1:1)*(1/0);s=s+Math.pow(2,n),o=o-c}return(m?-1:1)*s*Math.pow(2,o-n)},mm.write=function(t,e,r,n,i,o){var s,a,l,c=o*8-i-1,d=(1<<c)-1,f=d>>1,p=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=n?0:o-1,g=n?1:-1,b=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=d):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),s+f>=1?e+=p/l:e+=p*Math.pow(2,1-f),e*l>=2&&(s++,l/=2),s+f>=d?(a=0,s=d):s+f>=1?(a=(e*l-1)*Math.pow(2,i),s=s+f):(a=e*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;t[r+m]=a&255,m+=g,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;t[r+m]=s&255,m+=g,s/=256,c-=8);t[r+m-g]|=b*128}),mm}/*!
|
|
286
|
+
* The buffer module from node.js, for the browser.
|
|
287
|
+
*
|
|
288
|
+
* @author Feross Aboukhadijeh <https://feross.org>
|
|
289
|
+
* @license MIT
|
|
290
|
+
*/var JT;function ov(){return JT||(JT=1,function(t){var e=yee(),r=vee(),n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=a,t.SlowBuffer=T,t.INSPECT_MAX_BYTES=50;var i=2147483647;t.kMaxLength=i,a.TYPED_ARRAY_SUPPORT=o(),!a.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function o(){try{var F=new Uint8Array(1),k={foo:function(){return 42}};return Object.setPrototypeOf(k,Uint8Array.prototype),Object.setPrototypeOf(F,k),F.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function s(F){if(F>i)throw new RangeError('The value "'+F+'" is invalid for option "size"');var k=new Uint8Array(F);return Object.setPrototypeOf(k,a.prototype),k}function a(F,k,_){if(typeof F=="number"){if(typeof k=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return f(F)}return l(F,k,_)}a.poolSize=8192;function l(F,k,_){if(typeof F=="string")return p(F,k);if(ArrayBuffer.isView(F))return g(F);if(F==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof F);if(we(F,ArrayBuffer)||F&&we(F.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(we(F,SharedArrayBuffer)||F&&we(F.buffer,SharedArrayBuffer)))return b(F,k,_);if(typeof F=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var N=F.valueOf&&F.valueOf();if(N!=null&&N!==F)return a.from(N,k,_);var Q=S(F);if(Q)return Q;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof F[Symbol.toPrimitive]=="function")return a.from(F[Symbol.toPrimitive]("string"),k,_);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof F)}a.from=function(F,k,_){return l(F,k,_)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function c(F){if(typeof F!="number")throw new TypeError('"size" argument must be of type number');if(F<0)throw new RangeError('The value "'+F+'" is invalid for option "size"')}function d(F,k,_){return c(F),F<=0?s(F):k!==void 0?typeof _=="string"?s(F).fill(k,_):s(F).fill(k):s(F)}a.alloc=function(F,k,_){return d(F,k,_)};function f(F){return c(F),s(F<0?0:w(F)|0)}a.allocUnsafe=function(F){return f(F)},a.allocUnsafeSlow=function(F){return f(F)};function p(F,k){if((typeof k!="string"||k==="")&&(k="utf8"),!a.isEncoding(k))throw new TypeError("Unknown encoding: "+k);var _=M(F,k)|0,N=s(_),Q=N.write(F,k);return Q!==_&&(N=N.slice(0,Q)),N}function m(F){for(var k=F.length<0?0:w(F.length)|0,_=s(k),N=0;N<k;N+=1)_[N]=F[N]&255;return _}function g(F){if(we(F,Uint8Array)){var k=new Uint8Array(F);return b(k.buffer,k.byteOffset,k.byteLength)}return m(F)}function b(F,k,_){if(k<0||F.byteLength<k)throw new RangeError('"offset" is outside of buffer bounds');if(F.byteLength<k+(_||0))throw new RangeError('"length" is outside of buffer bounds');var N;return k===void 0&&_===void 0?N=new Uint8Array(F):_===void 0?N=new Uint8Array(F,k):N=new Uint8Array(F,k,_),Object.setPrototypeOf(N,a.prototype),N}function S(F){if(a.isBuffer(F)){var k=w(F.length)|0,_=s(k);return _.length===0||F.copy(_,0,0,k),_}if(F.length!==void 0)return typeof F.length!="number"||O(F.length)?s(0):m(F);if(F.type==="Buffer"&&Array.isArray(F.data))return m(F.data)}function w(F){if(F>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return F|0}function T(F){return+F!=F&&(F=0),a.alloc(+F)}a.isBuffer=function(k){return k!=null&&k._isBuffer===!0&&k!==a.prototype},a.compare=function(k,_){if(we(k,Uint8Array)&&(k=a.from(k,k.offset,k.byteLength)),we(_,Uint8Array)&&(_=a.from(_,_.offset,_.byteLength)),!a.isBuffer(k)||!a.isBuffer(_))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(k===_)return 0;for(var N=k.length,Q=_.length,pe=0,oe=Math.min(N,Q);pe<oe;++pe)if(k[pe]!==_[pe]){N=k[pe],Q=_[pe];break}return N<Q?-1:Q<N?1:0},a.isEncoding=function(k){switch(String(k).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(k,_){if(!Array.isArray(k))throw new TypeError('"list" argument must be an Array of Buffers');if(k.length===0)return a.alloc(0);var N;if(_===void 0)for(_=0,N=0;N<k.length;++N)_+=k[N].length;var Q=a.allocUnsafe(_),pe=0;for(N=0;N<k.length;++N){var oe=k[N];if(we(oe,Uint8Array))pe+oe.length>Q.length?a.from(oe).copy(Q,pe):Uint8Array.prototype.set.call(Q,oe,pe);else if(a.isBuffer(oe))oe.copy(Q,pe);else throw new TypeError('"list" argument must be an Array of Buffers');pe+=oe.length}return Q};function M(F,k){if(a.isBuffer(F))return F.length;if(ArrayBuffer.isView(F)||we(F,ArrayBuffer))return F.byteLength;if(typeof F!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof F);var _=F.length,N=arguments.length>2&&arguments[2]===!0;if(!N&&_===0)return 0;for(var Q=!1;;)switch(k){case"ascii":case"latin1":case"binary":return _;case"utf8":case"utf-8":return D(F).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _*2;case"hex":return _>>>1;case"base64":return q(F).length;default:if(Q)return N?-1:D(F).length;k=(""+k).toLowerCase(),Q=!0}}a.byteLength=M;function j(F,k,_){var N=!1;if((k===void 0||k<0)&&(k=0),k>this.length||((_===void 0||_>this.length)&&(_=this.length),_<=0)||(_>>>=0,k>>>=0,_<=k))return"";for(F||(F="utf8");;)switch(F){case"hex":return ye(this,k,_);case"utf8":case"utf-8":return R(this,k,_);case"ascii":return he(this,k,_);case"latin1":case"binary":return Fe(this,k,_);case"base64":return ne(this,k,_);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ze(this,k,_);default:if(N)throw new TypeError("Unknown encoding: "+F);F=(F+"").toLowerCase(),N=!0}}a.prototype._isBuffer=!0;function $(F,k,_){var N=F[k];F[k]=F[_],F[_]=N}a.prototype.swap16=function(){var k=this.length;if(k%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var _=0;_<k;_+=2)$(this,_,_+1);return this},a.prototype.swap32=function(){var k=this.length;if(k%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var _=0;_<k;_+=4)$(this,_,_+3),$(this,_+1,_+2);return this},a.prototype.swap64=function(){var k=this.length;if(k%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var _=0;_<k;_+=8)$(this,_,_+7),$(this,_+1,_+6),$(this,_+2,_+5),$(this,_+3,_+4);return this},a.prototype.toString=function(){var k=this.length;return k===0?"":arguments.length===0?R(this,0,k):j.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(k){if(!a.isBuffer(k))throw new TypeError("Argument must be a Buffer");return this===k?!0:a.compare(this,k)===0},a.prototype.inspect=function(){var k="",_=t.INSPECT_MAX_BYTES;return k=this.toString("hex",0,_).replace(/(.{2})/g,"$1 ").trim(),this.length>_&&(k+=" ... "),"<Buffer "+k+">"},n&&(a.prototype[n]=a.prototype.inspect),a.prototype.compare=function(k,_,N,Q,pe){if(we(k,Uint8Array)&&(k=a.from(k,k.offset,k.byteLength)),!a.isBuffer(k))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof k);if(_===void 0&&(_=0),N===void 0&&(N=k?k.length:0),Q===void 0&&(Q=0),pe===void 0&&(pe=this.length),_<0||N>k.length||Q<0||pe>this.length)throw new RangeError("out of range index");if(Q>=pe&&_>=N)return 0;if(Q>=pe)return-1;if(_>=N)return 1;if(_>>>=0,N>>>=0,Q>>>=0,pe>>>=0,this===k)return 0;for(var oe=pe-Q,Re=N-_,Ne=Math.min(oe,Re),De=this.slice(Q,pe),We=k.slice(_,N),Je=0;Je<Ne;++Je)if(De[Je]!==We[Je]){oe=De[Je],Re=We[Je];break}return oe<Re?-1:Re<oe?1:0};function W(F,k,_,N,Q){if(F.length===0)return-1;if(typeof _=="string"?(N=_,_=0):_>2147483647?_=2147483647:_<-2147483648&&(_=-2147483648),_=+_,O(_)&&(_=Q?0:F.length-1),_<0&&(_=F.length+_),_>=F.length){if(Q)return-1;_=F.length-1}else if(_<0)if(Q)_=0;else return-1;if(typeof k=="string"&&(k=a.from(k,N)),a.isBuffer(k))return k.length===0?-1:Y(F,k,_,N,Q);if(typeof k=="number")return k=k&255,typeof Uint8Array.prototype.indexOf=="function"?Q?Uint8Array.prototype.indexOf.call(F,k,_):Uint8Array.prototype.lastIndexOf.call(F,k,_):Y(F,[k],_,N,Q);throw new TypeError("val must be string, number or Buffer")}function Y(F,k,_,N,Q){var pe=1,oe=F.length,Re=k.length;if(N!==void 0&&(N=String(N).toLowerCase(),N==="ucs2"||N==="ucs-2"||N==="utf16le"||N==="utf-16le")){if(F.length<2||k.length<2)return-1;pe=2,oe/=2,Re/=2,_/=2}function Ne(Gt,Ar){return pe===1?Gt[Ar]:Gt.readUInt16BE(Ar*pe)}var De;if(Q){var We=-1;for(De=_;De<oe;De++)if(Ne(F,De)===Ne(k,We===-1?0:De-We)){if(We===-1&&(We=De),De-We+1===Re)return We*pe}else We!==-1&&(De-=De-We),We=-1}else for(_+Re>oe&&(_=oe-Re),De=_;De>=0;De--){for(var Je=!0,Ye=0;Ye<Re;Ye++)if(Ne(F,De+Ye)!==Ne(k,Ye)){Je=!1;break}if(Je)return De}return-1}a.prototype.includes=function(k,_,N){return this.indexOf(k,_,N)!==-1},a.prototype.indexOf=function(k,_,N){return W(this,k,_,N,!0)},a.prototype.lastIndexOf=function(k,_,N){return W(this,k,_,N,!1)};function ee(F,k,_,N){_=Number(_)||0;var Q=F.length-_;N?(N=Number(N),N>Q&&(N=Q)):N=Q;var pe=k.length;N>pe/2&&(N=pe/2);for(var oe=0;oe<N;++oe){var Re=parseInt(k.substr(oe*2,2),16);if(O(Re))return oe;F[_+oe]=Re}return oe}function P(F,k,_,N){return Z(D(k,F.length-_),F,_,N)}function fe(F,k,_,N){return Z(ae(k),F,_,N)}function de(F,k,_,N){return Z(q(k),F,_,N)}function U(F,k,_,N){return Z(ie(k,F.length-_),F,_,N)}a.prototype.write=function(k,_,N,Q){if(_===void 0)Q="utf8",N=this.length,_=0;else if(N===void 0&&typeof _=="string")Q=_,N=this.length,_=0;else if(isFinite(_))_=_>>>0,isFinite(N)?(N=N>>>0,Q===void 0&&(Q="utf8")):(Q=N,N=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var pe=this.length-_;if((N===void 0||N>pe)&&(N=pe),k.length>0&&(N<0||_<0)||_>this.length)throw new RangeError("Attempt to write outside buffer bounds");Q||(Q="utf8");for(var oe=!1;;)switch(Q){case"hex":return ee(this,k,_,N);case"utf8":case"utf-8":return P(this,k,_,N);case"ascii":case"latin1":case"binary":return fe(this,k,_,N);case"base64":return de(this,k,_,N);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,k,_,N);default:if(oe)throw new TypeError("Unknown encoding: "+Q);Q=(""+Q).toLowerCase(),oe=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ne(F,k,_){return k===0&&_===F.length?e.fromByteArray(F):e.fromByteArray(F.slice(k,_))}function R(F,k,_){_=Math.min(F.length,_);for(var N=[],Q=k;Q<_;){var pe=F[Q],oe=null,Re=pe>239?4:pe>223?3:pe>191?2:1;if(Q+Re<=_){var Ne,De,We,Je;switch(Re){case 1:pe<128&&(oe=pe);break;case 2:Ne=F[Q+1],(Ne&192)===128&&(Je=(pe&31)<<6|Ne&63,Je>127&&(oe=Je));break;case 3:Ne=F[Q+1],De=F[Q+2],(Ne&192)===128&&(De&192)===128&&(Je=(pe&15)<<12|(Ne&63)<<6|De&63,Je>2047&&(Je<55296||Je>57343)&&(oe=Je));break;case 4:Ne=F[Q+1],De=F[Q+2],We=F[Q+3],(Ne&192)===128&&(De&192)===128&&(We&192)===128&&(Je=(pe&15)<<18|(Ne&63)<<12|(De&63)<<6|We&63,Je>65535&&Je<1114112&&(oe=Je))}}oe===null?(oe=65533,Re=1):oe>65535&&(oe-=65536,N.push(oe>>>10&1023|55296),oe=56320|oe&1023),N.push(oe),Q+=Re}return Ee(N)}var le=4096;function Ee(F){var k=F.length;if(k<=le)return String.fromCharCode.apply(String,F);for(var _="",N=0;N<k;)_+=String.fromCharCode.apply(String,F.slice(N,N+=le));return _}function he(F,k,_){var N="";_=Math.min(F.length,_);for(var Q=k;Q<_;++Q)N+=String.fromCharCode(F[Q]&127);return N}function Fe(F,k,_){var N="";_=Math.min(F.length,_);for(var Q=k;Q<_;++Q)N+=String.fromCharCode(F[Q]);return N}function ye(F,k,_){var N=F.length;(!k||k<0)&&(k=0),(!_||_<0||_>N)&&(_=N);for(var Q="",pe=k;pe<_;++pe)Q+=xe[F[pe]];return Q}function ze(F,k,_){for(var N=F.slice(k,_),Q="",pe=0;pe<N.length-1;pe+=2)Q+=String.fromCharCode(N[pe]+N[pe+1]*256);return Q}a.prototype.slice=function(k,_){var N=this.length;k=~~k,_=_===void 0?N:~~_,k<0?(k+=N,k<0&&(k=0)):k>N&&(k=N),_<0?(_+=N,_<0&&(_=0)):_>N&&(_=N),_<k&&(_=k);var Q=this.subarray(k,_);return Object.setPrototypeOf(Q,a.prototype),Q};function ue(F,k,_){if(F%1!==0||F<0)throw new RangeError("offset is not uint");if(F+k>_)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(k,_,N){k=k>>>0,_=_>>>0,N||ue(k,_,this.length);for(var Q=this[k],pe=1,oe=0;++oe<_&&(pe*=256);)Q+=this[k+oe]*pe;return Q},a.prototype.readUintBE=a.prototype.readUIntBE=function(k,_,N){k=k>>>0,_=_>>>0,N||ue(k,_,this.length);for(var Q=this[k+--_],pe=1;_>0&&(pe*=256);)Q+=this[k+--_]*pe;return Q},a.prototype.readUint8=a.prototype.readUInt8=function(k,_){return k=k>>>0,_||ue(k,1,this.length),this[k]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(k,_){return k=k>>>0,_||ue(k,2,this.length),this[k]|this[k+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(k,_){return k=k>>>0,_||ue(k,2,this.length),this[k]<<8|this[k+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(k,_){return k=k>>>0,_||ue(k,4,this.length),(this[k]|this[k+1]<<8|this[k+2]<<16)+this[k+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(k,_){return k=k>>>0,_||ue(k,4,this.length),this[k]*16777216+(this[k+1]<<16|this[k+2]<<8|this[k+3])},a.prototype.readIntLE=function(k,_,N){k=k>>>0,_=_>>>0,N||ue(k,_,this.length);for(var Q=this[k],pe=1,oe=0;++oe<_&&(pe*=256);)Q+=this[k+oe]*pe;return pe*=128,Q>=pe&&(Q-=Math.pow(2,8*_)),Q},a.prototype.readIntBE=function(k,_,N){k=k>>>0,_=_>>>0,N||ue(k,_,this.length);for(var Q=_,pe=1,oe=this[k+--Q];Q>0&&(pe*=256);)oe+=this[k+--Q]*pe;return pe*=128,oe>=pe&&(oe-=Math.pow(2,8*_)),oe},a.prototype.readInt8=function(k,_){return k=k>>>0,_||ue(k,1,this.length),this[k]&128?(255-this[k]+1)*-1:this[k]},a.prototype.readInt16LE=function(k,_){k=k>>>0,_||ue(k,2,this.length);var N=this[k]|this[k+1]<<8;return N&32768?N|4294901760:N},a.prototype.readInt16BE=function(k,_){k=k>>>0,_||ue(k,2,this.length);var N=this[k+1]|this[k]<<8;return N&32768?N|4294901760:N},a.prototype.readInt32LE=function(k,_){return k=k>>>0,_||ue(k,4,this.length),this[k]|this[k+1]<<8|this[k+2]<<16|this[k+3]<<24},a.prototype.readInt32BE=function(k,_){return k=k>>>0,_||ue(k,4,this.length),this[k]<<24|this[k+1]<<16|this[k+2]<<8|this[k+3]},a.prototype.readFloatLE=function(k,_){return k=k>>>0,_||ue(k,4,this.length),r.read(this,k,!0,23,4)},a.prototype.readFloatBE=function(k,_){return k=k>>>0,_||ue(k,4,this.length),r.read(this,k,!1,23,4)},a.prototype.readDoubleLE=function(k,_){return k=k>>>0,_||ue(k,8,this.length),r.read(this,k,!0,52,8)},a.prototype.readDoubleBE=function(k,_){return k=k>>>0,_||ue(k,8,this.length),r.read(this,k,!1,52,8)};function V(F,k,_,N,Q,pe){if(!a.isBuffer(F))throw new TypeError('"buffer" argument must be a Buffer instance');if(k>Q||k<pe)throw new RangeError('"value" argument is out of bounds');if(_+N>F.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(k,_,N,Q){if(k=+k,_=_>>>0,N=N>>>0,!Q){var pe=Math.pow(2,8*N)-1;V(this,k,_,N,pe,0)}var oe=1,Re=0;for(this[_]=k&255;++Re<N&&(oe*=256);)this[_+Re]=k/oe&255;return _+N},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(k,_,N,Q){if(k=+k,_=_>>>0,N=N>>>0,!Q){var pe=Math.pow(2,8*N)-1;V(this,k,_,N,pe,0)}var oe=N-1,Re=1;for(this[_+oe]=k&255;--oe>=0&&(Re*=256);)this[_+oe]=k/Re&255;return _+N},a.prototype.writeUint8=a.prototype.writeUInt8=function(k,_,N){return k=+k,_=_>>>0,N||V(this,k,_,1,255,0),this[_]=k&255,_+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(k,_,N){return k=+k,_=_>>>0,N||V(this,k,_,2,65535,0),this[_]=k&255,this[_+1]=k>>>8,_+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(k,_,N){return k=+k,_=_>>>0,N||V(this,k,_,2,65535,0),this[_]=k>>>8,this[_+1]=k&255,_+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(k,_,N){return k=+k,_=_>>>0,N||V(this,k,_,4,4294967295,0),this[_+3]=k>>>24,this[_+2]=k>>>16,this[_+1]=k>>>8,this[_]=k&255,_+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(k,_,N){return k=+k,_=_>>>0,N||V(this,k,_,4,4294967295,0),this[_]=k>>>24,this[_+1]=k>>>16,this[_+2]=k>>>8,this[_+3]=k&255,_+4},a.prototype.writeIntLE=function(k,_,N,Q){if(k=+k,_=_>>>0,!Q){var pe=Math.pow(2,8*N-1);V(this,k,_,N,pe-1,-pe)}var oe=0,Re=1,Ne=0;for(this[_]=k&255;++oe<N&&(Re*=256);)k<0&&Ne===0&&this[_+oe-1]!==0&&(Ne=1),this[_+oe]=(k/Re>>0)-Ne&255;return _+N},a.prototype.writeIntBE=function(k,_,N,Q){if(k=+k,_=_>>>0,!Q){var pe=Math.pow(2,8*N-1);V(this,k,_,N,pe-1,-pe)}var oe=N-1,Re=1,Ne=0;for(this[_+oe]=k&255;--oe>=0&&(Re*=256);)k<0&&Ne===0&&this[_+oe+1]!==0&&(Ne=1),this[_+oe]=(k/Re>>0)-Ne&255;return _+N},a.prototype.writeInt8=function(k,_,N){return k=+k,_=_>>>0,N||V(this,k,_,1,127,-128),k<0&&(k=255+k+1),this[_]=k&255,_+1},a.prototype.writeInt16LE=function(k,_,N){return k=+k,_=_>>>0,N||V(this,k,_,2,32767,-32768),this[_]=k&255,this[_+1]=k>>>8,_+2},a.prototype.writeInt16BE=function(k,_,N){return k=+k,_=_>>>0,N||V(this,k,_,2,32767,-32768),this[_]=k>>>8,this[_+1]=k&255,_+2},a.prototype.writeInt32LE=function(k,_,N){return k=+k,_=_>>>0,N||V(this,k,_,4,2147483647,-2147483648),this[_]=k&255,this[_+1]=k>>>8,this[_+2]=k>>>16,this[_+3]=k>>>24,_+4},a.prototype.writeInt32BE=function(k,_,N){return k=+k,_=_>>>0,N||V(this,k,_,4,2147483647,-2147483648),k<0&&(k=4294967295+k+1),this[_]=k>>>24,this[_+1]=k>>>16,this[_+2]=k>>>8,this[_+3]=k&255,_+4};function me(F,k,_,N,Q,pe){if(_+N>F.length)throw new RangeError("Index out of range");if(_<0)throw new RangeError("Index out of range")}function ge(F,k,_,N,Q){return k=+k,_=_>>>0,Q||me(F,k,_,4),r.write(F,k,_,N,23,4),_+4}a.prototype.writeFloatLE=function(k,_,N){return ge(this,k,_,!0,N)},a.prototype.writeFloatBE=function(k,_,N){return ge(this,k,_,!1,N)};function ke(F,k,_,N,Q){return k=+k,_=_>>>0,Q||me(F,k,_,8),r.write(F,k,_,N,52,8),_+8}a.prototype.writeDoubleLE=function(k,_,N){return ke(this,k,_,!0,N)},a.prototype.writeDoubleBE=function(k,_,N){return ke(this,k,_,!1,N)},a.prototype.copy=function(k,_,N,Q){if(!a.isBuffer(k))throw new TypeError("argument should be a Buffer");if(N||(N=0),!Q&&Q!==0&&(Q=this.length),_>=k.length&&(_=k.length),_||(_=0),Q>0&&Q<N&&(Q=N),Q===N||k.length===0||this.length===0)return 0;if(_<0)throw new RangeError("targetStart out of bounds");if(N<0||N>=this.length)throw new RangeError("Index out of range");if(Q<0)throw new RangeError("sourceEnd out of bounds");Q>this.length&&(Q=this.length),k.length-_<Q-N&&(Q=k.length-_+N);var pe=Q-N;return this===k&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(_,N,Q):Uint8Array.prototype.set.call(k,this.subarray(N,Q),_),pe},a.prototype.fill=function(k,_,N,Q){if(typeof k=="string"){if(typeof _=="string"?(Q=_,_=0,N=this.length):typeof N=="string"&&(Q=N,N=this.length),Q!==void 0&&typeof Q!="string")throw new TypeError("encoding must be a string");if(typeof Q=="string"&&!a.isEncoding(Q))throw new TypeError("Unknown encoding: "+Q);if(k.length===1){var pe=k.charCodeAt(0);(Q==="utf8"&&pe<128||Q==="latin1")&&(k=pe)}}else typeof k=="number"?k=k&255:typeof k=="boolean"&&(k=Number(k));if(_<0||this.length<_||this.length<N)throw new RangeError("Out of range index");if(N<=_)return this;_=_>>>0,N=N===void 0?this.length:N>>>0,k||(k=0);var oe;if(typeof k=="number")for(oe=_;oe<N;++oe)this[oe]=k;else{var Re=a.isBuffer(k)?k:a.from(k,Q),Ne=Re.length;if(Ne===0)throw new TypeError('The value "'+k+'" is invalid for argument "value"');for(oe=0;oe<N-_;++oe)this[oe+_]=Re[oe%Ne]}return this};var ce=/[^+/0-9A-Za-z-_]/g;function L(F){if(F=F.split("=")[0],F=F.trim().replace(ce,""),F.length<2)return"";for(;F.length%4!==0;)F=F+"=";return F}function D(F,k){k=k||1/0;for(var _,N=F.length,Q=null,pe=[],oe=0;oe<N;++oe){if(_=F.charCodeAt(oe),_>55295&&_<57344){if(!Q){if(_>56319){(k-=3)>-1&&pe.push(239,191,189);continue}else if(oe+1===N){(k-=3)>-1&&pe.push(239,191,189);continue}Q=_;continue}if(_<56320){(k-=3)>-1&&pe.push(239,191,189),Q=_;continue}_=(Q-55296<<10|_-56320)+65536}else Q&&(k-=3)>-1&&pe.push(239,191,189);if(Q=null,_<128){if((k-=1)<0)break;pe.push(_)}else if(_<2048){if((k-=2)<0)break;pe.push(_>>6|192,_&63|128)}else if(_<65536){if((k-=3)<0)break;pe.push(_>>12|224,_>>6&63|128,_&63|128)}else if(_<1114112){if((k-=4)<0)break;pe.push(_>>18|240,_>>12&63|128,_>>6&63|128,_&63|128)}else throw new Error("Invalid code point")}return pe}function ae(F){for(var k=[],_=0;_<F.length;++_)k.push(F.charCodeAt(_)&255);return k}function ie(F,k){for(var _,N,Q,pe=[],oe=0;oe<F.length&&!((k-=2)<0);++oe)_=F.charCodeAt(oe),N=_>>8,Q=_%256,pe.push(Q),pe.push(N);return pe}function q(F){return e.toByteArray(L(F))}function Z(F,k,_,N){for(var Q=0;Q<N&&!(Q+_>=k.length||Q>=F.length);++Q)k[Q+_]=F[Q];return Q}function we(F,k){return F instanceof k||F!=null&&F.constructor!=null&&F.constructor.name!=null&&F.constructor.name===k.name}function O(F){return F!==F}var xe=function(){for(var F="0123456789abcdef",k=new Array(256),_=0;_<16;++_)for(var N=_*16,Q=0;Q<16;++Q)k[N+Q]=F[_]+F[Q];return k}()}(Rw)),Rw}var Iw={},Ow={},Mw,ZT;function n3(){return ZT||(ZT=1,Mw=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[r]=i;for(r in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var o=Object.getOwnPropertySymbols(e);if(o.length!==1||o[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(e,r);if(s.value!==i||s.enumerable!==!0)return!1}return!0}),Mw}var Nw,QT;function YS(){if(QT)return Nw;QT=1;var t=n3();return Nw=function(){return t()&&!!Symbol.toStringTag},Nw}var Dw,eA;function bee(){if(eA)return Dw;eA=1;var t=typeof Symbol<"u"&&Symbol,e=n3();return Dw=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},Dw}var Pw,tA;function wee(){if(tA)return Pw;tA=1;var t={foo:{}},e=Object;return Pw=function(){return{__proto__:t}.foo===t.foo&&!({__proto__:null}instanceof e)},Pw}var Lw,rA;function xee(){if(rA)return Lw;rA=1;var t="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,r=Math.max,n="[object Function]",i=function(l,c){for(var d=[],f=0;f<l.length;f+=1)d[f]=l[f];for(var p=0;p<c.length;p+=1)d[p+l.length]=c[p];return d},o=function(l,c){for(var d=[],f=c,p=0;f<l.length;f+=1,p+=1)d[p]=l[f];return d},s=function(a,l){for(var c="",d=0;d<a.length;d+=1)c+=a[d],d+1<a.length&&(c+=l);return c};return Lw=function(l){var c=this;if(typeof c!="function"||e.apply(c)!==n)throw new TypeError(t+c);for(var d=o(arguments,1),f,p=function(){if(this instanceof f){var w=c.apply(this,i(d,arguments));return Object(w)===w?w:this}return c.apply(l,i(d,arguments))},m=r(0,c.length-d.length),g=[],b=0;b<m;b++)g[b]="$"+b;if(f=Function("binder","return function ("+s(g,",")+"){ return binder.apply(this,arguments); }")(p),c.prototype){var S=function(){};S.prototype=c.prototype,f.prototype=new S,S.prototype=null}return f},Lw}var Fw,nA;function JS(){if(nA)return Fw;nA=1;var t=xee();return Fw=Function.prototype.bind||t,Fw}var jw,iA;function See(){if(iA)return jw;iA=1;var t=Function.prototype.call,e=Object.prototype.hasOwnProperty,r=JS();return jw=r.call(t,e),jw}var Bw,oA;function Id(){if(oA)return Bw;oA=1;var t,e=SyntaxError,r=Function,n=TypeError,i=function(U){try{return r('"use strict"; return ('+U+").constructor;")()}catch{}},o=Object.getOwnPropertyDescriptor;if(o)try{o({},"")}catch{o=null}var s=function(){throw new n},a=o?function(){try{return arguments.callee,s}catch{try{return o(arguments,"callee").get}catch{return s}}}():s,l=bee()(),c=wee()(),d=Object.getPrototypeOf||(c?function(U){return U.__proto__}:null),f={},p=typeof Uint8Array>"u"||!d?t:d(Uint8Array),m={"%AggregateError%":typeof AggregateError>"u"?t:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?t:ArrayBuffer,"%ArrayIteratorPrototype%":l&&d?d([][Symbol.iterator]()):t,"%AsyncFromSyncIteratorPrototype%":t,"%AsyncFunction%":f,"%AsyncGenerator%":f,"%AsyncGeneratorFunction%":f,"%AsyncIteratorPrototype%":f,"%Atomics%":typeof Atomics>"u"?t:Atomics,"%BigInt%":typeof BigInt>"u"?t:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?t:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?t:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?t:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?t:Float32Array,"%Float64Array%":typeof Float64Array>"u"?t:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?t:FinalizationRegistry,"%Function%":r,"%GeneratorFunction%":f,"%Int8Array%":typeof Int8Array>"u"?t:Int8Array,"%Int16Array%":typeof Int16Array>"u"?t:Int16Array,"%Int32Array%":typeof Int32Array>"u"?t:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":l&&d?d(d([][Symbol.iterator]())):t,"%JSON%":typeof JSON=="object"?JSON:t,"%Map%":typeof Map>"u"?t:Map,"%MapIteratorPrototype%":typeof Map>"u"||!l||!d?t:d(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?t:Promise,"%Proxy%":typeof Proxy>"u"?t:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?t:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?t:Set,"%SetIteratorPrototype%":typeof Set>"u"||!l||!d?t:d(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?t:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":l&&d?d(""[Symbol.iterator]()):t,"%Symbol%":l?Symbol:t,"%SyntaxError%":e,"%ThrowTypeError%":a,"%TypedArray%":p,"%TypeError%":n,"%Uint8Array%":typeof Uint8Array>"u"?t:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?t:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?t:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?t:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?t:WeakMap,"%WeakRef%":typeof WeakRef>"u"?t:WeakRef,"%WeakSet%":typeof WeakSet>"u"?t:WeakSet};if(d)try{null.error}catch(U){var g=d(d(U));m["%Error.prototype%"]=g}var b=function U(ne){var R;if(ne==="%AsyncFunction%")R=i("async function () {}");else if(ne==="%GeneratorFunction%")R=i("function* () {}");else if(ne==="%AsyncGeneratorFunction%")R=i("async function* () {}");else if(ne==="%AsyncGenerator%"){var le=U("%AsyncGeneratorFunction%");le&&(R=le.prototype)}else if(ne==="%AsyncIteratorPrototype%"){var Ee=U("%AsyncGenerator%");Ee&&d&&(R=d(Ee.prototype))}return m[ne]=R,R},S={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},w=JS(),T=See(),M=w.call(Function.call,Array.prototype.concat),j=w.call(Function.apply,Array.prototype.splice),$=w.call(Function.call,String.prototype.replace),W=w.call(Function.call,String.prototype.slice),Y=w.call(Function.call,RegExp.prototype.exec),ee=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,P=/\\(\\)?/g,fe=function(ne){var R=W(ne,0,1),le=W(ne,-1);if(R==="%"&&le!=="%")throw new e("invalid intrinsic syntax, expected closing `%`");if(le==="%"&&R!=="%")throw new e("invalid intrinsic syntax, expected opening `%`");var Ee=[];return $(ne,ee,function(he,Fe,ye,ze){Ee[Ee.length]=ye?$(ze,P,"$1"):Fe||he}),Ee},de=function(ne,R){var le=ne,Ee;if(T(S,le)&&(Ee=S[le],le="%"+Ee[0]+"%"),T(m,le)){var he=m[le];if(he===f&&(he=b(le)),typeof he>"u"&&!R)throw new n("intrinsic "+ne+" exists, but is not available. Please file an issue!");return{alias:Ee,name:le,value:he}}throw new e("intrinsic "+ne+" does not exist!")};return Bw=function(ne,R){if(typeof ne!="string"||ne.length===0)throw new n("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof R!="boolean")throw new n('"allowMissing" argument must be a boolean');if(Y(/^%?[^%]*%?$/,ne)===null)throw new e("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var le=fe(ne),Ee=le.length>0?le[0]:"",he=de("%"+Ee+"%",R),Fe=he.name,ye=he.value,ze=!1,ue=he.alias;ue&&(Ee=ue[0],j(le,M([0,1],ue)));for(var V=1,me=!0;V<le.length;V+=1){var ge=le[V],ke=W(ge,0,1),ce=W(ge,-1);if((ke==='"'||ke==="'"||ke==="`"||ce==='"'||ce==="'"||ce==="`")&&ke!==ce)throw new e("property names with quotes must have matching quotes");if((ge==="constructor"||!me)&&(ze=!0),Ee+="."+ge,Fe="%"+Ee+"%",T(m,Fe))ye=m[Fe];else if(ye!=null){if(!(ge in ye)){if(!R)throw new n("base intrinsic for "+ne+" exists, but the property is not available.");return}if(o&&V+1>=le.length){var L=o(ye,ge);me=!!L,me&&"get"in L&&!("originalValue"in L.get)?ye=L.get:ye=ye[ge]}else me=T(ye,ge),ye=ye[ge];me&&!ze&&(m[Fe]=ye)}}return ye},Bw}var zw={exports:{}},Hw,sA;function i3(){if(sA)return Hw;sA=1;var t=Id(),e=t("%Object.defineProperty%",!0),r=function(){if(e)try{return e({},"a",{value:1}),!0}catch{return!1}return!1};return r.hasArrayLengthDefineBug=function(){if(!r())return null;try{return e([],"length",{value:1}).length!==1}catch{return!0}},Hw=r,Hw}var $w,aA;function ZS(){if(aA)return $w;aA=1;var t=Id(),e=t("%Object.getOwnPropertyDescriptor%",!0);if(e)try{e([],"length")}catch{e=null}return $w=e,$w}var Uw,lA;function kee(){if(lA)return Uw;lA=1;var t=i3()(),e=Id(),r=t&&e("%Object.defineProperty%",!0);if(r)try{r({},"a",{value:1})}catch{r=!1}var n=e("%SyntaxError%"),i=e("%TypeError%"),o=ZS();return Uw=function(a,l,c){if(!a||typeof a!="object"&&typeof a!="function")throw new i("`obj` must be an object or a function`");if(typeof l!="string"&&typeof l!="symbol")throw new i("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new i("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new i("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new i("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new i("`loose`, if provided, must be a boolean");var d=arguments.length>3?arguments[3]:null,f=arguments.length>4?arguments[4]:null,p=arguments.length>5?arguments[5]:null,m=arguments.length>6?arguments[6]:!1,g=!!o&&o(a,l);if(r)r(a,l,{configurable:p===null&&g?g.configurable:!p,enumerable:d===null&&g?g.enumerable:!d,value:c,writable:f===null&&g?g.writable:!f});else if(m||!d&&!f&&!p)a[l]=c;else throw new n("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Uw}var Ww,cA;function _ee(){if(cA)return Ww;cA=1;var t=Id(),e=kee(),r=i3()(),n=ZS(),i=t("%TypeError%"),o=t("%Math.floor%");return Ww=function(a,l){if(typeof a!="function")throw new i("`fn` is not a function");if(typeof l!="number"||l<0||l>4294967295||o(l)!==l)throw new i("`length` must be a positive 32-bit integer");var c=arguments.length>2&&!!arguments[2],d=!0,f=!0;if("length"in a&&n){var p=n(a,"length");p&&!p.configurable&&(d=!1),p&&!p.writable&&(f=!1)}return(d||f||!c)&&(r?e(a,"length",l,!0,!0):e(a,"length",l)),a},Ww}var uA;function o3(){return uA||(uA=1,function(t){var e=JS(),r=Id(),n=_ee(),i=r("%TypeError%"),o=r("%Function.prototype.apply%"),s=r("%Function.prototype.call%"),a=r("%Reflect.apply%",!0)||e.call(s,o),l=r("%Object.defineProperty%",!0),c=r("%Math.max%");if(l)try{l({},"a",{value:1})}catch{l=null}t.exports=function(p){if(typeof p!="function")throw new i("a function is required");var m=a(e,s,arguments);return n(m,1+c(0,p.length-(arguments.length-1)),!0)};var d=function(){return a(e,o,arguments)};l?l(t.exports,"apply",{value:d}):t.exports.apply=d}(zw)),zw.exports}var Vw,dA;function s3(){if(dA)return Vw;dA=1;var t=Id(),e=o3(),r=e(t("String.prototype.indexOf"));return Vw=function(i,o){var s=t(i,!!o);return typeof s=="function"&&r(i,".prototype.")>-1?e(s):s},Vw}var Gw,fA;function Cee(){if(fA)return Gw;fA=1;var t=YS()(),e=s3(),r=e("Object.prototype.toString"),n=function(a){return t&&a&&typeof a=="object"&&Symbol.toStringTag in a?!1:r(a)==="[object Arguments]"},i=function(a){return n(a)?!0:a!==null&&typeof a=="object"&&typeof a.length=="number"&&a.length>=0&&r(a)!=="[object Array]"&&r(a.callee)==="[object Function]"},o=function(){return n(arguments)}();return n.isLegacyArguments=i,Gw=o?n:i,Gw}var Kw,hA;function Eee(){if(hA)return Kw;hA=1;var t=Object.prototype.toString,e=Function.prototype.toString,r=/^\s*(?:function)?\*/,n=YS()(),i=Object.getPrototypeOf,o=function(){if(!n)return!1;try{return Function("return function*() {}")()}catch{}},s;return Kw=function(l){if(typeof l!="function")return!1;if(r.test(e.call(l)))return!0;if(!n){var c=t.call(l);return c==="[object GeneratorFunction]"}if(!i)return!1;if(typeof s>"u"){var d=o();s=d?i(d):!1}return i(l)===s},Kw}var qw,pA;function Tee(){if(pA)return qw;pA=1;var t=Function.prototype.toString,e=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,r,n;if(typeof e=="function"&&typeof Object.defineProperty=="function")try{r=Object.defineProperty({},"length",{get:function(){throw n}}),n={},e(function(){throw 42},null,r)}catch(T){T!==n&&(e=null)}else e=null;var i=/^\s*class\b/,o=function(M){try{var j=t.call(M);return i.test(j)}catch{return!1}},s=function(M){try{return o(M)?!1:(t.call(M),!0)}catch{return!1}},a=Object.prototype.toString,l="[object Object]",c="[object Function]",d="[object GeneratorFunction]",f="[object HTMLAllCollection]",p="[object HTML document.all class]",m="[object HTMLCollection]",g=typeof Symbol=="function"&&!!Symbol.toStringTag,b=!(0 in[,]),S=function(){return!1};if(typeof document=="object"){var w=document.all;a.call(w)===a.call(document.all)&&(S=function(M){if((b||!M)&&(typeof M>"u"||typeof M=="object"))try{var j=a.call(M);return(j===f||j===p||j===m||j===l)&&M("")==null}catch{}return!1})}return qw=e?function(M){if(S(M))return!0;if(!M||typeof M!="function"&&typeof M!="object")return!1;try{e(M,null,r)}catch(j){if(j!==n)return!1}return!o(M)&&s(M)}:function(M){if(S(M))return!0;if(!M||typeof M!="function"&&typeof M!="object")return!1;if(g)return s(M);if(o(M))return!1;var j=a.call(M);return j!==c&&j!==d&&!/^\[object HTML/.test(j)?!1:s(M)},qw}var Xw,mA;function Aee(){if(mA)return Xw;mA=1;var t=Tee(),e=Object.prototype.toString,r=Object.prototype.hasOwnProperty,n=function(l,c,d){for(var f=0,p=l.length;f<p;f++)r.call(l,f)&&(d==null?c(l[f],f,l):c.call(d,l[f],f,l))},i=function(l,c,d){for(var f=0,p=l.length;f<p;f++)d==null?c(l.charAt(f),f,l):c.call(d,l.charAt(f),f,l)},o=function(l,c,d){for(var f in l)r.call(l,f)&&(d==null?c(l[f],f,l):c.call(d,l[f],f,l))},s=function(l,c,d){if(!t(c))throw new TypeError("iterator must be a function");var f;arguments.length>=3&&(f=d),e.call(l)==="[object Array]"?n(l,c,f):typeof l=="string"?i(l,c,f):o(l,c,f)};return Xw=s,Xw}var Yw,gA;function Ree(){if(gA)return Yw;gA=1;var t=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],e=typeof globalThis>"u"?mo:globalThis;return Yw=function(){for(var n=[],i=0;i<t.length;i++)typeof e[t[i]]=="function"&&(n[n.length]=t[i]);return n},Yw}var Jw,yA;function a3(){if(yA)return Jw;yA=1;var t=Aee(),e=Ree(),r=o3(),n=s3(),i=ZS(),o=n("Object.prototype.toString"),s=YS()(),a=typeof globalThis>"u"?mo:globalThis,l=e(),c=n("String.prototype.slice"),d=Object.getPrototypeOf,f=n("Array.prototype.indexOf",!0)||function(S,w){for(var T=0;T<S.length;T+=1)if(S[T]===w)return T;return-1},p={__proto__:null};s&&i&&d?t(l,function(b){var S=new a[b];if(Symbol.toStringTag in S){var w=d(S),T=i(w,Symbol.toStringTag);if(!T){var M=d(w);T=i(M,Symbol.toStringTag)}p["$"+b]=r(T.get)}}):t(l,function(b){var S=new a[b],w=S.slice||S.set;w&&(p["$"+b]=r(w))});var m=function(S){var w=!1;return t(p,function(T,M){if(!w)try{"$"+T(S)===M&&(w=c(M,1))}catch{}}),w},g=function(S){var w=!1;return t(p,function(T,M){if(!w)try{T(S),w=c(M,1)}catch{}}),w};return Jw=function(S){if(!S||typeof S!="object")return!1;if(!s){var w=c(o(S),8,-1);return f(l,w)>-1?w:w!=="Object"?!1:g(S)}return i?m(S):null},Jw}var Zw,vA;function Iee(){if(vA)return Zw;vA=1;var t=a3();return Zw=function(r){return!!t(r)},Zw}var bA;function Oee(){return bA||(bA=1,function(t){var e=Cee(),r=Eee(),n=a3(),i=Iee();function o(N){return N.call.bind(N)}var s=typeof BigInt<"u",a=typeof Symbol<"u",l=o(Object.prototype.toString),c=o(Number.prototype.valueOf),d=o(String.prototype.valueOf),f=o(Boolean.prototype.valueOf);if(s)var p=o(BigInt.prototype.valueOf);if(a)var m=o(Symbol.prototype.valueOf);function g(N,Q){if(typeof N!="object")return!1;try{return Q(N),!0}catch{return!1}}t.isArgumentsObject=e,t.isGeneratorFunction=r,t.isTypedArray=i;function b(N){return typeof Promise<"u"&&N instanceof Promise||N!==null&&typeof N=="object"&&typeof N.then=="function"&&typeof N.catch=="function"}t.isPromise=b;function S(N){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(N):i(N)||me(N)}t.isArrayBufferView=S;function w(N){return n(N)==="Uint8Array"}t.isUint8Array=w;function T(N){return n(N)==="Uint8ClampedArray"}t.isUint8ClampedArray=T;function M(N){return n(N)==="Uint16Array"}t.isUint16Array=M;function j(N){return n(N)==="Uint32Array"}t.isUint32Array=j;function $(N){return n(N)==="Int8Array"}t.isInt8Array=$;function W(N){return n(N)==="Int16Array"}t.isInt16Array=W;function Y(N){return n(N)==="Int32Array"}t.isInt32Array=Y;function ee(N){return n(N)==="Float32Array"}t.isFloat32Array=ee;function P(N){return n(N)==="Float64Array"}t.isFloat64Array=P;function fe(N){return n(N)==="BigInt64Array"}t.isBigInt64Array=fe;function de(N){return n(N)==="BigUint64Array"}t.isBigUint64Array=de;function U(N){return l(N)==="[object Map]"}U.working=typeof Map<"u"&&U(new Map);function ne(N){return typeof Map>"u"?!1:U.working?U(N):N instanceof Map}t.isMap=ne;function R(N){return l(N)==="[object Set]"}R.working=typeof Set<"u"&&R(new Set);function le(N){return typeof Set>"u"?!1:R.working?R(N):N instanceof Set}t.isSet=le;function Ee(N){return l(N)==="[object WeakMap]"}Ee.working=typeof WeakMap<"u"&&Ee(new WeakMap);function he(N){return typeof WeakMap>"u"?!1:Ee.working?Ee(N):N instanceof WeakMap}t.isWeakMap=he;function Fe(N){return l(N)==="[object WeakSet]"}Fe.working=typeof WeakSet<"u"&&Fe(new WeakSet);function ye(N){return Fe(N)}t.isWeakSet=ye;function ze(N){return l(N)==="[object ArrayBuffer]"}ze.working=typeof ArrayBuffer<"u"&&ze(new ArrayBuffer);function ue(N){return typeof ArrayBuffer>"u"?!1:ze.working?ze(N):N instanceof ArrayBuffer}t.isArrayBuffer=ue;function V(N){return l(N)==="[object DataView]"}V.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&V(new DataView(new ArrayBuffer(1),0,1));function me(N){return typeof DataView>"u"?!1:V.working?V(N):N instanceof DataView}t.isDataView=me;var ge=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function ke(N){return l(N)==="[object SharedArrayBuffer]"}function ce(N){return typeof ge>"u"?!1:(typeof ke.working>"u"&&(ke.working=ke(new ge)),ke.working?ke(N):N instanceof ge)}t.isSharedArrayBuffer=ce;function L(N){return l(N)==="[object AsyncFunction]"}t.isAsyncFunction=L;function D(N){return l(N)==="[object Map Iterator]"}t.isMapIterator=D;function ae(N){return l(N)==="[object Set Iterator]"}t.isSetIterator=ae;function ie(N){return l(N)==="[object Generator]"}t.isGeneratorObject=ie;function q(N){return l(N)==="[object WebAssembly.Module]"}t.isWebAssemblyCompiledModule=q;function Z(N){return g(N,c)}t.isNumberObject=Z;function we(N){return g(N,d)}t.isStringObject=we;function O(N){return g(N,f)}t.isBooleanObject=O;function xe(N){return s&&g(N,p)}t.isBigIntObject=xe;function F(N){return a&&g(N,m)}t.isSymbolObject=F;function k(N){return Z(N)||we(N)||O(N)||xe(N)||F(N)}t.isBoxedPrimitive=k;function _(N){return typeof Uint8Array<"u"&&(ue(N)||ce(N))}t.isAnyArrayBuffer=_,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(N){Object.defineProperty(t,N,{enumerable:!1,value:function(){throw new Error(N+" is not supported in userland")}})})}(Ow)),Ow}var Qw,wA;function Mee(){return wA||(wA=1,Qw=function(e){return e&&typeof e=="object"&&typeof e.copy=="function"&&typeof e.fill=="function"&&typeof e.readUInt8=="function"}),Qw}var xA;function l3(){return xA||(xA=1,function(t){var e=Object.getOwnPropertyDescriptors||function(me){for(var ge=Object.keys(me),ke={},ce=0;ce<ge.length;ce++)ke[ge[ce]]=Object.getOwnPropertyDescriptor(me,ge[ce]);return ke},r=/%[sdj%]/g;t.format=function(V){if(!$(V)){for(var me=[],ge=0;ge<arguments.length;ge++)me.push(s(arguments[ge]));return me.join(" ")}for(var ge=1,ke=arguments,ce=ke.length,L=String(V).replace(r,function(ae){if(ae==="%%")return"%";if(ge>=ce)return ae;switch(ae){case"%s":return String(ke[ge++]);case"%d":return Number(ke[ge++]);case"%j":try{return JSON.stringify(ke[ge++])}catch{return"[Circular]"}default:return ae}}),D=ke[ge];ge<ce;D=ke[++ge])T(D)||!P(D)?L+=" "+D:L+=" "+s(D);return L},t.deprecate=function(V,me){if(typeof gt<"u"&>.noDeprecation===!0)return V;if(typeof gt>"u")return function(){return t.deprecate(V,me).apply(this,arguments)};var ge=!1;function ke(){if(!ge){if(gt.throwDeprecation)throw new Error(me);gt.traceDeprecation?console.trace(me):console.error(me),ge=!0}return V.apply(this,arguments)}return ke};var n={},i=/^$/;if(gt.env.NODE_DEBUG){var o=gt.env.NODE_DEBUG;o=o.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),i=new RegExp("^"+o+"$","i")}t.debuglog=function(V){if(V=V.toUpperCase(),!n[V])if(i.test(V)){var me=gt.pid;n[V]=function(){var ge=t.format.apply(t,arguments);console.error("%s %d: %s",V,me,ge)}}else n[V]=function(){};return n[V]};function s(V,me){var ge={seen:[],stylize:l};return arguments.length>=3&&(ge.depth=arguments[2]),arguments.length>=4&&(ge.colors=arguments[3]),w(me)?ge.showHidden=me:me&&t._extend(ge,me),Y(ge.showHidden)&&(ge.showHidden=!1),Y(ge.depth)&&(ge.depth=2),Y(ge.colors)&&(ge.colors=!1),Y(ge.customInspect)&&(ge.customInspect=!0),ge.colors&&(ge.stylize=a),d(ge,V,ge.depth)}t.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function a(V,me){var ge=s.styles[me];return ge?"\x1B["+s.colors[ge][0]+"m"+V+"\x1B["+s.colors[ge][1]+"m":V}function l(V,me){return V}function c(V){var me={};return V.forEach(function(ge,ke){me[ge]=!0}),me}function d(V,me,ge){if(V.customInspect&&me&&U(me.inspect)&&me.inspect!==t.inspect&&!(me.constructor&&me.constructor.prototype===me)){var ke=me.inspect(ge,V);return $(ke)||(ke=d(V,ke,ge)),ke}var ce=f(V,me);if(ce)return ce;var L=Object.keys(me),D=c(L);if(V.showHidden&&(L=Object.getOwnPropertyNames(me)),de(me)&&(L.indexOf("message")>=0||L.indexOf("description")>=0))return p(me);if(L.length===0){if(U(me)){var ae=me.name?": "+me.name:"";return V.stylize("[Function"+ae+"]","special")}if(ee(me))return V.stylize(RegExp.prototype.toString.call(me),"regexp");if(fe(me))return V.stylize(Date.prototype.toString.call(me),"date");if(de(me))return p(me)}var ie="",q=!1,Z=["{","}"];if(S(me)&&(q=!0,Z=["[","]"]),U(me)){var we=me.name?": "+me.name:"";ie=" [Function"+we+"]"}if(ee(me)&&(ie=" "+RegExp.prototype.toString.call(me)),fe(me)&&(ie=" "+Date.prototype.toUTCString.call(me)),de(me)&&(ie=" "+p(me)),L.length===0&&(!q||me.length==0))return Z[0]+ie+Z[1];if(ge<0)return ee(me)?V.stylize(RegExp.prototype.toString.call(me),"regexp"):V.stylize("[Object]","special");V.seen.push(me);var O;return q?O=m(V,me,ge,D,L):O=L.map(function(xe){return g(V,me,ge,D,xe,q)}),V.seen.pop(),b(O,ie,Z)}function f(V,me){if(Y(me))return V.stylize("undefined","undefined");if($(me)){var ge="'"+JSON.stringify(me).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return V.stylize(ge,"string")}if(j(me))return V.stylize(""+me,"number");if(w(me))return V.stylize(""+me,"boolean");if(T(me))return V.stylize("null","null")}function p(V){return"["+Error.prototype.toString.call(V)+"]"}function m(V,me,ge,ke,ce){for(var L=[],D=0,ae=me.length;D<ae;++D)Fe(me,String(D))?L.push(g(V,me,ge,ke,String(D),!0)):L.push("");return ce.forEach(function(ie){ie.match(/^\d+$/)||L.push(g(V,me,ge,ke,ie,!0))}),L}function g(V,me,ge,ke,ce,L){var D,ae,ie;if(ie=Object.getOwnPropertyDescriptor(me,ce)||{value:me[ce]},ie.get?ie.set?ae=V.stylize("[Getter/Setter]","special"):ae=V.stylize("[Getter]","special"):ie.set&&(ae=V.stylize("[Setter]","special")),Fe(ke,ce)||(D="["+ce+"]"),ae||(V.seen.indexOf(ie.value)<0?(T(ge)?ae=d(V,ie.value,null):ae=d(V,ie.value,ge-1),ae.indexOf(`
|
|
291
|
+
`)>-1&&(L?ae=ae.split(`
|
|
292
|
+
`).map(function(q){return" "+q}).join(`
|
|
293
|
+
`).slice(2):ae=`
|
|
294
|
+
`+ae.split(`
|
|
295
|
+
`).map(function(q){return" "+q}).join(`
|
|
296
|
+
`))):ae=V.stylize("[Circular]","special")),Y(D)){if(L&&ce.match(/^\d+$/))return ae;D=JSON.stringify(""+ce),D.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(D=D.slice(1,-1),D=V.stylize(D,"name")):(D=D.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),D=V.stylize(D,"string"))}return D+": "+ae}function b(V,me,ge){var ke=V.reduce(function(ce,L){return L.indexOf(`
|
|
297
|
+
`)>=0,ce+L.replace(/\u001b\[\d\d?m/g,"").length+1},0);return ke>60?ge[0]+(me===""?"":me+`
|
|
298
|
+
`)+" "+V.join(`,
|
|
299
|
+
`)+" "+ge[1]:ge[0]+me+" "+V.join(", ")+" "+ge[1]}t.types=Oee();function S(V){return Array.isArray(V)}t.isArray=S;function w(V){return typeof V=="boolean"}t.isBoolean=w;function T(V){return V===null}t.isNull=T;function M(V){return V==null}t.isNullOrUndefined=M;function j(V){return typeof V=="number"}t.isNumber=j;function $(V){return typeof V=="string"}t.isString=$;function W(V){return typeof V=="symbol"}t.isSymbol=W;function Y(V){return V===void 0}t.isUndefined=Y;function ee(V){return P(V)&&R(V)==="[object RegExp]"}t.isRegExp=ee,t.types.isRegExp=ee;function P(V){return typeof V=="object"&&V!==null}t.isObject=P;function fe(V){return P(V)&&R(V)==="[object Date]"}t.isDate=fe,t.types.isDate=fe;function de(V){return P(V)&&(R(V)==="[object Error]"||V instanceof Error)}t.isError=de,t.types.isNativeError=de;function U(V){return typeof V=="function"}t.isFunction=U;function ne(V){return V===null||typeof V=="boolean"||typeof V=="number"||typeof V=="string"||typeof V=="symbol"||typeof V>"u"}t.isPrimitive=ne,t.isBuffer=Mee();function R(V){return Object.prototype.toString.call(V)}function le(V){return V<10?"0"+V.toString(10):V.toString(10)}var Ee=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function he(){var V=new Date,me=[le(V.getHours()),le(V.getMinutes()),le(V.getSeconds())].join(":");return[V.getDate(),Ee[V.getMonth()],me].join(" ")}t.log=function(){console.log("%s - %s",he(),t.format.apply(t,arguments))},t.inherits=fc,t._extend=function(V,me){if(!me||!P(me))return V;for(var ge=Object.keys(me),ke=ge.length;ke--;)V[ge[ke]]=me[ge[ke]];return V};function Fe(V,me){return Object.prototype.hasOwnProperty.call(V,me)}var ye=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;t.promisify=function(me){if(typeof me!="function")throw new TypeError('The "original" argument must be of type Function');if(ye&&me[ye]){var ge=me[ye];if(typeof ge!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(ge,ye,{value:ge,enumerable:!1,writable:!1,configurable:!0}),ge}function ge(){for(var ke,ce,L=new Promise(function(ie,q){ke=ie,ce=q}),D=[],ae=0;ae<arguments.length;ae++)D.push(arguments[ae]);D.push(function(ie,q){ie?ce(ie):ke(q)});try{me.apply(this,D)}catch(ie){ce(ie)}return L}return Object.setPrototypeOf(ge,Object.getPrototypeOf(me)),ye&&Object.defineProperty(ge,ye,{value:ge,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(ge,e(me))},t.promisify.custom=ye;function ze(V,me){if(!V){var ge=new Error("Promise was rejected with a falsy value");ge.reason=V,V=ge}return me(V)}function ue(V){if(typeof V!="function")throw new TypeError('The "original" argument must be of type Function');function me(){for(var ge=[],ke=0;ke<arguments.length;ke++)ge.push(arguments[ke]);var ce=ge.pop();if(typeof ce!="function")throw new TypeError("The last argument must be of type Function");var L=this,D=function(){return ce.apply(L,arguments)};V.apply(this,ge).then(function(ae){gt.nextTick(D.bind(null,null,ae))},function(ae){gt.nextTick(ze.bind(null,ae,D))})}return Object.setPrototypeOf(me,Object.getPrototypeOf(V)),Object.defineProperties(me,e(V)),me}t.callbackify=ue}(Iw)),Iw}var e0,SA;function Nee(){if(SA)return e0;SA=1;function t(p,m){var g=Object.keys(p);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(p);m&&(b=b.filter(function(S){return Object.getOwnPropertyDescriptor(p,S).enumerable})),g.push.apply(g,b)}return g}function e(p){for(var m=1;m<arguments.length;m++){var g=arguments[m]!=null?arguments[m]:{};m%2?t(Object(g),!0).forEach(function(b){r(p,b,g[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(g)):t(Object(g)).forEach(function(b){Object.defineProperty(p,b,Object.getOwnPropertyDescriptor(g,b))})}return p}function r(p,m,g){return m in p?Object.defineProperty(p,m,{value:g,enumerable:!0,configurable:!0,writable:!0}):p[m]=g,p}function n(p,m){if(!(p instanceof m))throw new TypeError("Cannot call a class as a function")}function i(p,m){for(var g=0;g<m.length;g++){var b=m[g];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(p,b.key,b)}}function o(p,m,g){return m&&i(p.prototype,m),p}var s=ov(),a=s.Buffer,l=l3(),c=l.inspect,d=c&&c.custom||"inspect";function f(p,m,g){a.prototype.copy.call(p,m,g)}return e0=function(){function p(){n(this,p),this.head=null,this.tail=null,this.length=0}return o(p,[{key:"push",value:function(g){var b={data:g,next:null};this.length>0?this.tail.next=b:this.head=b,this.tail=b,++this.length}},{key:"unshift",value:function(g){var b={data:g,next:this.head};this.length===0&&(this.tail=b),this.head=b,++this.length}},{key:"shift",value:function(){if(this.length!==0){var g=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,g}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(g){if(this.length===0)return"";for(var b=this.head,S=""+b.data;b=b.next;)S+=g+b.data;return S}},{key:"concat",value:function(g){if(this.length===0)return a.alloc(0);for(var b=a.allocUnsafe(g>>>0),S=this.head,w=0;S;)f(S.data,b,w),w+=S.data.length,S=S.next;return b}},{key:"consume",value:function(g,b){var S;return g<this.head.data.length?(S=this.head.data.slice(0,g),this.head.data=this.head.data.slice(g)):g===this.head.data.length?S=this.shift():S=b?this._getString(g):this._getBuffer(g),S}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(g){var b=this.head,S=1,w=b.data;for(g-=w.length;b=b.next;){var T=b.data,M=g>T.length?T.length:g;if(M===T.length?w+=T:w+=T.slice(0,g),g-=M,g===0){M===T.length?(++S,b.next?this.head=b.next:this.head=this.tail=null):(this.head=b,b.data=T.slice(M));break}++S}return this.length-=S,w}},{key:"_getBuffer",value:function(g){var b=a.allocUnsafe(g),S=this.head,w=1;for(S.data.copy(b),g-=S.data.length;S=S.next;){var T=S.data,M=g>T.length?T.length:g;if(T.copy(b,b.length-g,0,M),g-=M,g===0){M===T.length?(++w,S.next?this.head=S.next:this.head=this.tail=null):(this.head=S,S.data=T.slice(M));break}++w}return this.length-=w,b}},{key:d,value:function(g,b){return c(this,e({},b,{depth:0,customInspect:!1}))}}]),p}(),e0}var t0,kA;function c3(){if(kA)return t0;kA=1;function t(s,a){var l=this,c=this._readableState&&this._readableState.destroyed,d=this._writableState&&this._writableState.destroyed;return c||d?(a?a(s):s&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,gt.nextTick(i,this,s)):gt.nextTick(i,this,s)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(s||null,function(f){!a&&f?l._writableState?l._writableState.errorEmitted?gt.nextTick(r,l):(l._writableState.errorEmitted=!0,gt.nextTick(e,l,f)):gt.nextTick(e,l,f):a?(gt.nextTick(r,l),a(f)):gt.nextTick(r,l)}),this)}function e(s,a){i(s,a),r(s)}function r(s){s._writableState&&!s._writableState.emitClose||s._readableState&&!s._readableState.emitClose||s.emit("close")}function n(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function i(s,a){s.emit("error",a)}function o(s,a){var l=s._readableState,c=s._writableState;l&&l.autoDestroy||c&&c.autoDestroy?s.destroy(a):s.emit("error",a)}return t0={destroy:t,undestroy:n,errorOrDestroy:o},t0}var r0={},_A;function Od(){if(_A)return r0;_A=1;function t(a,l){a.prototype=Object.create(l.prototype),a.prototype.constructor=a,a.__proto__=l}var e={};function r(a,l,c){c||(c=Error);function d(p,m,g){return typeof l=="string"?l:l(p,m,g)}var f=function(p){t(m,p);function m(g,b,S){return p.call(this,d(g,b,S))||this}return m}(c);f.prototype.name=c.name,f.prototype.code=a,e[a]=f}function n(a,l){if(Array.isArray(a)){var c=a.length;return a=a.map(function(d){return String(d)}),c>2?"one of ".concat(l," ").concat(a.slice(0,c-1).join(", "),", or ")+a[c-1]:c===2?"one of ".concat(l," ").concat(a[0]," or ").concat(a[1]):"of ".concat(l," ").concat(a[0])}else return"of ".concat(l," ").concat(String(a))}function i(a,l,c){return a.substr(0,l.length)===l}function o(a,l,c){return(c===void 0||c>a.length)&&(c=a.length),a.substring(c-l.length,c)===l}function s(a,l,c){return typeof c!="number"&&(c=0),c+l.length>a.length?!1:a.indexOf(l,c)!==-1}return r("ERR_INVALID_OPT_VALUE",function(a,l){return'The value "'+l+'" is invalid for option "'+a+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(a,l,c){var d;typeof l=="string"&&i(l,"not ")?(d="must not be",l=l.replace(/^not /,"")):d="must be";var f;if(o(a," argument"))f="The ".concat(a," ").concat(d," ").concat(n(l,"type"));else{var p=s(a,".")?"property":"argument";f='The "'.concat(a,'" ').concat(p," ").concat(d," ").concat(n(l,"type"))}return f+=". Received type ".concat(typeof c),f},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(a){return"The "+a+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(a){return"Cannot call "+a+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(a){return"Unknown encoding: "+a},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),r0.codes=e,r0}var n0,CA;function u3(){if(CA)return n0;CA=1;var t=Od().codes.ERR_INVALID_OPT_VALUE;function e(n,i,o){return n.highWaterMark!=null?n.highWaterMark:i?n[o]:null}function r(n,i,o,s){var a=e(i,s,o);if(a!=null){if(!(isFinite(a)&&Math.floor(a)===a)||a<0){var l=s?o:"highWaterMark";throw new t(l,a)}return Math.floor(a)}return n.objectMode?16:16*1024}return n0={getHighWaterMark:r},n0}var i0,EA;function Dee(){if(EA)return i0;EA=1,i0=t;function t(r,n){if(e("noDeprecation"))return r;var i=!1;function o(){if(!i){if(e("throwDeprecation"))throw new Error(n);e("traceDeprecation")?console.trace(n):console.warn(n),i=!0}return r.apply(this,arguments)}return o}function e(r){try{if(!mo.localStorage)return!1}catch{return!1}var n=mo.localStorage[r];return n==null?!1:String(n).toLowerCase()==="true"}return i0}var o0,TA;function d3(){if(TA)return o0;TA=1,o0=ee;function t(ce){var L=this;this.next=null,this.entry=null,this.finish=function(){ke(L,ce)}}var e;ee.WritableState=W;var r={deprecate:Dee()},n=r3(),i=ov().Buffer,o=mo.Uint8Array||function(){};function s(ce){return i.from(ce)}function a(ce){return i.isBuffer(ce)||ce instanceof o}var l=c3(),c=u3(),d=c.getHighWaterMark,f=Od().codes,p=f.ERR_INVALID_ARG_TYPE,m=f.ERR_METHOD_NOT_IMPLEMENTED,g=f.ERR_MULTIPLE_CALLBACK,b=f.ERR_STREAM_CANNOT_PIPE,S=f.ERR_STREAM_DESTROYED,w=f.ERR_STREAM_NULL_VALUES,T=f.ERR_STREAM_WRITE_AFTER_END,M=f.ERR_UNKNOWN_ENCODING,j=l.errorOrDestroy;fc(ee,n);function $(){}function W(ce,L,D){e=e||hd(),ce=ce||{},typeof D!="boolean"&&(D=L instanceof e),this.objectMode=!!ce.objectMode,D&&(this.objectMode=this.objectMode||!!ce.writableObjectMode),this.highWaterMark=d(this,ce,"writableHighWaterMark",D),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var ae=ce.decodeStrings===!1;this.decodeStrings=!ae,this.defaultEncoding=ce.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(ie){Ee(L,ie)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=ce.emitClose!==!1,this.autoDestroy=!!ce.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new t(this)}W.prototype.getBuffer=function(){for(var L=this.bufferedRequest,D=[];L;)D.push(L),L=L.next;return D},function(){try{Object.defineProperty(W.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var Y;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(Y=Function.prototype[Symbol.hasInstance],Object.defineProperty(ee,Symbol.hasInstance,{value:function(L){return Y.call(this,L)?!0:this!==ee?!1:L&&L._writableState instanceof W}})):Y=function(L){return L instanceof this};function ee(ce){e=e||hd();var L=this instanceof e;if(!L&&!Y.call(ee,this))return new ee(ce);this._writableState=new W(ce,this,L),this.writable=!0,ce&&(typeof ce.write=="function"&&(this._write=ce.write),typeof ce.writev=="function"&&(this._writev=ce.writev),typeof ce.destroy=="function"&&(this._destroy=ce.destroy),typeof ce.final=="function"&&(this._final=ce.final)),n.call(this)}ee.prototype.pipe=function(){j(this,new b)};function P(ce,L){var D=new T;j(ce,D),gt.nextTick(L,D)}function fe(ce,L,D,ae){var ie;return D===null?ie=new w:typeof D!="string"&&!L.objectMode&&(ie=new p("chunk",["string","Buffer"],D)),ie?(j(ce,ie),gt.nextTick(ae,ie),!1):!0}ee.prototype.write=function(ce,L,D){var ae=this._writableState,ie=!1,q=!ae.objectMode&&a(ce);return q&&!i.isBuffer(ce)&&(ce=s(ce)),typeof L=="function"&&(D=L,L=null),q?L="buffer":L||(L=ae.defaultEncoding),typeof D!="function"&&(D=$),ae.ending?P(this,D):(q||fe(this,ae,ce,D))&&(ae.pendingcb++,ie=U(this,ae,q,ce,L,D)),ie},ee.prototype.cork=function(){this._writableState.corked++},ee.prototype.uncork=function(){var ce=this._writableState;ce.corked&&(ce.corked--,!ce.writing&&!ce.corked&&!ce.bufferProcessing&&ce.bufferedRequest&&ye(this,ce))},ee.prototype.setDefaultEncoding=function(L){if(typeof L=="string"&&(L=L.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((L+"").toLowerCase())>-1))throw new M(L);return this._writableState.defaultEncoding=L,this},Object.defineProperty(ee.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function de(ce,L,D){return!ce.objectMode&&ce.decodeStrings!==!1&&typeof L=="string"&&(L=i.from(L,D)),L}Object.defineProperty(ee.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function U(ce,L,D,ae,ie,q){if(!D){var Z=de(L,ae,ie);ae!==Z&&(D=!0,ie="buffer",ae=Z)}var we=L.objectMode?1:ae.length;L.length+=we;var O=L.length<L.highWaterMark;if(O||(L.needDrain=!0),L.writing||L.corked){var xe=L.lastBufferedRequest;L.lastBufferedRequest={chunk:ae,encoding:ie,isBuf:D,callback:q,next:null},xe?xe.next=L.lastBufferedRequest:L.bufferedRequest=L.lastBufferedRequest,L.bufferedRequestCount+=1}else ne(ce,L,!1,we,ae,ie,q);return O}function ne(ce,L,D,ae,ie,q,Z){L.writelen=ae,L.writecb=Z,L.writing=!0,L.sync=!0,L.destroyed?L.onwrite(new S("write")):D?ce._writev(ie,L.onwrite):ce._write(ie,q,L.onwrite),L.sync=!1}function R(ce,L,D,ae,ie){--L.pendingcb,D?(gt.nextTick(ie,ae),gt.nextTick(me,ce,L),ce._writableState.errorEmitted=!0,j(ce,ae)):(ie(ae),ce._writableState.errorEmitted=!0,j(ce,ae),me(ce,L))}function le(ce){ce.writing=!1,ce.writecb=null,ce.length-=ce.writelen,ce.writelen=0}function Ee(ce,L){var D=ce._writableState,ae=D.sync,ie=D.writecb;if(typeof ie!="function")throw new g;if(le(D),L)R(ce,D,ae,L,ie);else{var q=ze(D)||ce.destroyed;!q&&!D.corked&&!D.bufferProcessing&&D.bufferedRequest&&ye(ce,D),ae?gt.nextTick(he,ce,D,q,ie):he(ce,D,q,ie)}}function he(ce,L,D,ae){D||Fe(ce,L),L.pendingcb--,ae(),me(ce,L)}function Fe(ce,L){L.length===0&&L.needDrain&&(L.needDrain=!1,ce.emit("drain"))}function ye(ce,L){L.bufferProcessing=!0;var D=L.bufferedRequest;if(ce._writev&&D&&D.next){var ae=L.bufferedRequestCount,ie=new Array(ae),q=L.corkedRequestsFree;q.entry=D;for(var Z=0,we=!0;D;)ie[Z]=D,D.isBuf||(we=!1),D=D.next,Z+=1;ie.allBuffers=we,ne(ce,L,!0,L.length,ie,"",q.finish),L.pendingcb++,L.lastBufferedRequest=null,q.next?(L.corkedRequestsFree=q.next,q.next=null):L.corkedRequestsFree=new t(L),L.bufferedRequestCount=0}else{for(;D;){var O=D.chunk,xe=D.encoding,F=D.callback,k=L.objectMode?1:O.length;if(ne(ce,L,!1,k,O,xe,F),D=D.next,L.bufferedRequestCount--,L.writing)break}D===null&&(L.lastBufferedRequest=null)}L.bufferedRequest=D,L.bufferProcessing=!1}ee.prototype._write=function(ce,L,D){D(new m("_write()"))},ee.prototype._writev=null,ee.prototype.end=function(ce,L,D){var ae=this._writableState;return typeof ce=="function"?(D=ce,ce=null,L=null):typeof L=="function"&&(D=L,L=null),ce!=null&&this.write(ce,L),ae.corked&&(ae.corked=1,this.uncork()),ae.ending||ge(this,ae,D),this},Object.defineProperty(ee.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function ze(ce){return ce.ending&&ce.length===0&&ce.bufferedRequest===null&&!ce.finished&&!ce.writing}function ue(ce,L){ce._final(function(D){L.pendingcb--,D&&j(ce,D),L.prefinished=!0,ce.emit("prefinish"),me(ce,L)})}function V(ce,L){!L.prefinished&&!L.finalCalled&&(typeof ce._final=="function"&&!L.destroyed?(L.pendingcb++,L.finalCalled=!0,gt.nextTick(ue,ce,L)):(L.prefinished=!0,ce.emit("prefinish")))}function me(ce,L){var D=ze(L);if(D&&(V(ce,L),L.pendingcb===0&&(L.finished=!0,ce.emit("finish"),L.autoDestroy))){var ae=ce._readableState;(!ae||ae.autoDestroy&&ae.endEmitted)&&ce.destroy()}return D}function ge(ce,L,D){L.ending=!0,me(ce,L),D&&(L.finished?gt.nextTick(D):ce.once("finish",D)),L.ended=!0,ce.writable=!1}function ke(ce,L,D){var ae=ce.entry;for(ce.entry=null;ae;){var ie=ae.callback;L.pendingcb--,ie(D),ae=ae.next}L.corkedRequestsFree.next=ce}return Object.defineProperty(ee.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(L){this._writableState&&(this._writableState.destroyed=L)}}),ee.prototype.destroy=l.destroy,ee.prototype._undestroy=l.undestroy,ee.prototype._destroy=function(ce,L){L(ce)},o0}var s0,AA;function hd(){if(AA)return s0;AA=1;var t=Object.keys||function(c){var d=[];for(var f in c)d.push(f);return d};s0=s;var e=f3(),r=d3();fc(s,e);for(var n=t(r.prototype),i=0;i<n.length;i++){var o=n[i];s.prototype[o]||(s.prototype[o]=r.prototype[o])}function s(c){if(!(this instanceof s))return new s(c);e.call(this,c),r.call(this,c),this.allowHalfOpen=!0,c&&(c.readable===!1&&(this.readable=!1),c.writable===!1&&(this.writable=!1),c.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",a)))}Object.defineProperty(s.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(s.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(s.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function a(){this._writableState.ended||gt.nextTick(l,this)}function l(c){c.end()}return Object.defineProperty(s.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(d){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=d,this._writableState.destroyed=d)}}),s0}var a0={},gm={exports:{}},RA;function Pee(){return RA||(RA=1,function(t,e){var r=ov(),n=r.Buffer;function i(s,a){for(var l in s)a[l]=s[l]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=r:(i(r,e),e.Buffer=o);function o(s,a,l){return n(s,a,l)}i(n,o),o.from=function(s,a,l){if(typeof s=="number")throw new TypeError("Argument must not be a number");return n(s,a,l)},o.alloc=function(s,a,l){if(typeof s!="number")throw new TypeError("Argument must be a number");var c=n(s);return a!==void 0?typeof l=="string"?c.fill(a,l):c.fill(a):c.fill(0),c},o.allocUnsafe=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return n(s)},o.allocUnsafeSlow=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(s)}}(gm,gm.exports)),gm.exports}var IA;function l1(){if(IA)return a0;IA=1;var t=Pee().Buffer,e=t.isEncoding||function(w){switch(w=""+w,w&&w.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function r(w){if(!w)return"utf8";for(var T;;)switch(w){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return w;default:if(T)return;w=(""+w).toLowerCase(),T=!0}}function n(w){var T=r(w);if(typeof T!="string"&&(t.isEncoding===e||!e(w)))throw new Error("Unknown encoding: "+w);return T||w}a0.StringDecoder=i;function i(w){this.encoding=n(w);var T;switch(this.encoding){case"utf16le":this.text=f,this.end=p,T=4;break;case"utf8":this.fillLast=l,T=4;break;case"base64":this.text=m,this.end=g,T=3;break;default:this.write=b,this.end=S;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(T)}i.prototype.write=function(w){if(w.length===0)return"";var T,M;if(this.lastNeed){if(T=this.fillLast(w),T===void 0)return"";M=this.lastNeed,this.lastNeed=0}else M=0;return M<w.length?T?T+this.text(w,M):this.text(w,M):T||""},i.prototype.end=d,i.prototype.text=c,i.prototype.fillLast=function(w){if(this.lastNeed<=w.length)return w.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);w.copy(this.lastChar,this.lastTotal-this.lastNeed,0,w.length),this.lastNeed-=w.length};function o(w){return w<=127?0:w>>5===6?2:w>>4===14?3:w>>3===30?4:w>>6===2?-1:-2}function s(w,T,M){var j=T.length-1;if(j<M)return 0;var $=o(T[j]);return $>=0?($>0&&(w.lastNeed=$-1),$):--j<M||$===-2?0:($=o(T[j]),$>=0?($>0&&(w.lastNeed=$-2),$):--j<M||$===-2?0:($=o(T[j]),$>=0?($>0&&($===2?$=0:w.lastNeed=$-3),$):0))}function a(w,T,M){if((T[0]&192)!==128)return w.lastNeed=0,"�";if(w.lastNeed>1&&T.length>1){if((T[1]&192)!==128)return w.lastNeed=1,"�";if(w.lastNeed>2&&T.length>2&&(T[2]&192)!==128)return w.lastNeed=2,"�"}}function l(w){var T=this.lastTotal-this.lastNeed,M=a(this,w);if(M!==void 0)return M;if(this.lastNeed<=w.length)return w.copy(this.lastChar,T,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);w.copy(this.lastChar,T,0,w.length),this.lastNeed-=w.length}function c(w,T){var M=s(this,w,T);if(!this.lastNeed)return w.toString("utf8",T);this.lastTotal=M;var j=w.length-(M-this.lastNeed);return w.copy(this.lastChar,0,j),w.toString("utf8",T,j)}function d(w){var T=w&&w.length?this.write(w):"";return this.lastNeed?T+"�":T}function f(w,T){if((w.length-T)%2===0){var M=w.toString("utf16le",T);if(M){var j=M.charCodeAt(M.length-1);if(j>=55296&&j<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=w[w.length-2],this.lastChar[1]=w[w.length-1],M.slice(0,-1)}return M}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=w[w.length-1],w.toString("utf16le",T,w.length-1)}function p(w){var T=w&&w.length?this.write(w):"";if(this.lastNeed){var M=this.lastTotal-this.lastNeed;return T+this.lastChar.toString("utf16le",0,M)}return T}function m(w,T){var M=(w.length-T)%3;return M===0?w.toString("base64",T):(this.lastNeed=3-M,this.lastTotal=3,M===1?this.lastChar[0]=w[w.length-1]:(this.lastChar[0]=w[w.length-2],this.lastChar[1]=w[w.length-1]),w.toString("base64",T,w.length-M))}function g(w){var T=w&&w.length?this.write(w):"";return this.lastNeed?T+this.lastChar.toString("base64",0,3-this.lastNeed):T}function b(w){return w.toString(this.encoding)}function S(w){return w&&w.length?this.write(w):""}return a0}var l0,OA;function QS(){if(OA)return l0;OA=1;var t=Od().codes.ERR_STREAM_PREMATURE_CLOSE;function e(o){var s=!1;return function(){if(!s){s=!0;for(var a=arguments.length,l=new Array(a),c=0;c<a;c++)l[c]=arguments[c];o.apply(this,l)}}}function r(){}function n(o){return o.setHeader&&typeof o.abort=="function"}function i(o,s,a){if(typeof s=="function")return i(o,null,s);s||(s={}),a=e(a||r);var l=s.readable||s.readable!==!1&&o.readable,c=s.writable||s.writable!==!1&&o.writable,d=function(){o.writable||p()},f=o._writableState&&o._writableState.finished,p=function(){c=!1,f=!0,l||a.call(o)},m=o._readableState&&o._readableState.endEmitted,g=function(){l=!1,m=!0,c||a.call(o)},b=function(M){a.call(o,M)},S=function(){var M;if(l&&!m)return(!o._readableState||!o._readableState.ended)&&(M=new t),a.call(o,M);if(c&&!f)return(!o._writableState||!o._writableState.ended)&&(M=new t),a.call(o,M)},w=function(){o.req.on("finish",p)};return n(o)?(o.on("complete",p),o.on("abort",S),o.req?w():o.on("request",w)):c&&!o._writableState&&(o.on("end",d),o.on("close",d)),o.on("end",g),o.on("finish",p),s.error!==!1&&o.on("error",b),o.on("close",S),function(){o.removeListener("complete",p),o.removeListener("abort",S),o.removeListener("request",w),o.req&&o.req.removeListener("finish",p),o.removeListener("end",d),o.removeListener("close",d),o.removeListener("finish",p),o.removeListener("end",g),o.removeListener("error",b),o.removeListener("close",S)}}return l0=i,l0}var c0,MA;function Lee(){if(MA)return c0;MA=1;var t;function e(w,T,M){return T in w?Object.defineProperty(w,T,{value:M,enumerable:!0,configurable:!0,writable:!0}):w[T]=M,w}var r=QS(),n=Symbol("lastResolve"),i=Symbol("lastReject"),o=Symbol("error"),s=Symbol("ended"),a=Symbol("lastPromise"),l=Symbol("handlePromise"),c=Symbol("stream");function d(w,T){return{value:w,done:T}}function f(w){var T=w[n];if(T!==null){var M=w[c].read();M!==null&&(w[a]=null,w[n]=null,w[i]=null,T(d(M,!1)))}}function p(w){gt.nextTick(f,w)}function m(w,T){return function(M,j){w.then(function(){if(T[s]){M(d(void 0,!0));return}T[l](M,j)},j)}}var g=Object.getPrototypeOf(function(){}),b=Object.setPrototypeOf((t={get stream(){return this[c]},next:function(){var T=this,M=this[o];if(M!==null)return Promise.reject(M);if(this[s])return Promise.resolve(d(void 0,!0));if(this[c].destroyed)return new Promise(function(Y,ee){gt.nextTick(function(){T[o]?ee(T[o]):Y(d(void 0,!0))})});var j=this[a],$;if(j)$=new Promise(m(j,this));else{var W=this[c].read();if(W!==null)return Promise.resolve(d(W,!1));$=new Promise(this[l])}return this[a]=$,$}},e(t,Symbol.asyncIterator,function(){return this}),e(t,"return",function(){var T=this;return new Promise(function(M,j){T[c].destroy(null,function($){if($){j($);return}M(d(void 0,!0))})})}),t),g),S=function(T){var M,j=Object.create(b,(M={},e(M,c,{value:T,writable:!0}),e(M,n,{value:null,writable:!0}),e(M,i,{value:null,writable:!0}),e(M,o,{value:null,writable:!0}),e(M,s,{value:T._readableState.endEmitted,writable:!0}),e(M,l,{value:function(W,Y){var ee=j[c].read();ee?(j[a]=null,j[n]=null,j[i]=null,W(d(ee,!1))):(j[n]=W,j[i]=Y)},writable:!0}),M));return j[a]=null,r(T,function($){if($&&$.code!=="ERR_STREAM_PREMATURE_CLOSE"){var W=j[i];W!==null&&(j[a]=null,j[n]=null,j[i]=null,W($)),j[o]=$;return}var Y=j[n];Y!==null&&(j[a]=null,j[n]=null,j[i]=null,Y(d(void 0,!0))),j[s]=!0}),T.on("readable",p.bind(null,j)),j};return c0=S,c0}var u0,NA;function Fee(){return NA||(NA=1,u0=function(){throw new Error("Readable.from is not available in the browser")}),u0}var d0,DA;function f3(){if(DA)return d0;DA=1,d0=P;var t;P.ReadableState=ee,XS.EventEmitter;var e=function(Z,we){return Z.listeners(we).length},r=r3(),n=ov().Buffer,i=mo.Uint8Array||function(){};function o(q){return n.from(q)}function s(q){return n.isBuffer(q)||q instanceof i}var a=l3(),l;a&&a.debuglog?l=a.debuglog("stream"):l=function(){};var c=Nee(),d=c3(),f=u3(),p=f.getHighWaterMark,m=Od().codes,g=m.ERR_INVALID_ARG_TYPE,b=m.ERR_STREAM_PUSH_AFTER_EOF,S=m.ERR_METHOD_NOT_IMPLEMENTED,w=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,T,M,j;fc(P,r);var $=d.errorOrDestroy,W=["error","close","destroy","pause","resume"];function Y(q,Z,we){if(typeof q.prependListener=="function")return q.prependListener(Z,we);!q._events||!q._events[Z]?q.on(Z,we):Array.isArray(q._events[Z])?q._events[Z].unshift(we):q._events[Z]=[we,q._events[Z]]}function ee(q,Z,we){t=t||hd(),q=q||{},typeof we!="boolean"&&(we=Z instanceof t),this.objectMode=!!q.objectMode,we&&(this.objectMode=this.objectMode||!!q.readableObjectMode),this.highWaterMark=p(this,q,"readableHighWaterMark",we),this.buffer=new c,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=q.emitClose!==!1,this.autoDestroy=!!q.autoDestroy,this.destroyed=!1,this.defaultEncoding=q.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,q.encoding&&(T||(T=l1().StringDecoder),this.decoder=new T(q.encoding),this.encoding=q.encoding)}function P(q){if(t=t||hd(),!(this instanceof P))return new P(q);var Z=this instanceof t;this._readableState=new ee(q,this,Z),this.readable=!0,q&&(typeof q.read=="function"&&(this._read=q.read),typeof q.destroy=="function"&&(this._destroy=q.destroy)),r.call(this)}Object.defineProperty(P.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(Z){this._readableState&&(this._readableState.destroyed=Z)}}),P.prototype.destroy=d.destroy,P.prototype._undestroy=d.undestroy,P.prototype._destroy=function(q,Z){Z(q)},P.prototype.push=function(q,Z){var we=this._readableState,O;return we.objectMode?O=!0:typeof q=="string"&&(Z=Z||we.defaultEncoding,Z!==we.encoding&&(q=n.from(q,Z),Z=""),O=!0),fe(this,q,Z,!1,O)},P.prototype.unshift=function(q){return fe(this,q,null,!0,!1)};function fe(q,Z,we,O,xe){l("readableAddChunk",Z);var F=q._readableState;if(Z===null)F.reading=!1,Ee(q,F);else{var k;if(xe||(k=U(F,Z)),k)$(q,k);else if(F.objectMode||Z&&Z.length>0)if(typeof Z!="string"&&!F.objectMode&&Object.getPrototypeOf(Z)!==n.prototype&&(Z=o(Z)),O)F.endEmitted?$(q,new w):de(q,F,Z,!0);else if(F.ended)$(q,new b);else{if(F.destroyed)return!1;F.reading=!1,F.decoder&&!we?(Z=F.decoder.write(Z),F.objectMode||Z.length!==0?de(q,F,Z,!1):ye(q,F)):de(q,F,Z,!1)}else O||(F.reading=!1,ye(q,F))}return!F.ended&&(F.length<F.highWaterMark||F.length===0)}function de(q,Z,we,O){Z.flowing&&Z.length===0&&!Z.sync?(Z.awaitDrain=0,q.emit("data",we)):(Z.length+=Z.objectMode?1:we.length,O?Z.buffer.unshift(we):Z.buffer.push(we),Z.needReadable&&he(q)),ye(q,Z)}function U(q,Z){var we;return!s(Z)&&typeof Z!="string"&&Z!==void 0&&!q.objectMode&&(we=new g("chunk",["string","Buffer","Uint8Array"],Z)),we}P.prototype.isPaused=function(){return this._readableState.flowing===!1},P.prototype.setEncoding=function(q){T||(T=l1().StringDecoder);var Z=new T(q);this._readableState.decoder=Z,this._readableState.encoding=this._readableState.decoder.encoding;for(var we=this._readableState.buffer.head,O="";we!==null;)O+=Z.write(we.data),we=we.next;return this._readableState.buffer.clear(),O!==""&&this._readableState.buffer.push(O),this._readableState.length=O.length,this};var ne=1073741824;function R(q){return q>=ne?q=ne:(q--,q|=q>>>1,q|=q>>>2,q|=q>>>4,q|=q>>>8,q|=q>>>16,q++),q}function le(q,Z){return q<=0||Z.length===0&&Z.ended?0:Z.objectMode?1:q!==q?Z.flowing&&Z.length?Z.buffer.head.data.length:Z.length:(q>Z.highWaterMark&&(Z.highWaterMark=R(q)),q<=Z.length?q:Z.ended?Z.length:(Z.needReadable=!0,0))}P.prototype.read=function(q){l("read",q),q=parseInt(q,10);var Z=this._readableState,we=q;if(q!==0&&(Z.emittedReadable=!1),q===0&&Z.needReadable&&((Z.highWaterMark!==0?Z.length>=Z.highWaterMark:Z.length>0)||Z.ended))return l("read: emitReadable",Z.length,Z.ended),Z.length===0&&Z.ended?D(this):he(this),null;if(q=le(q,Z),q===0&&Z.ended)return Z.length===0&&D(this),null;var O=Z.needReadable;l("need readable",O),(Z.length===0||Z.length-q<Z.highWaterMark)&&(O=!0,l("length less than watermark",O)),Z.ended||Z.reading?(O=!1,l("reading or ended",O)):O&&(l("do read"),Z.reading=!0,Z.sync=!0,Z.length===0&&(Z.needReadable=!0),this._read(Z.highWaterMark),Z.sync=!1,Z.reading||(q=le(we,Z)));var xe;return q>0?xe=L(q,Z):xe=null,xe===null?(Z.needReadable=Z.length<=Z.highWaterMark,q=0):(Z.length-=q,Z.awaitDrain=0),Z.length===0&&(Z.ended||(Z.needReadable=!0),we!==q&&Z.ended&&D(this)),xe!==null&&this.emit("data",xe),xe};function Ee(q,Z){if(l("onEofChunk"),!Z.ended){if(Z.decoder){var we=Z.decoder.end();we&&we.length&&(Z.buffer.push(we),Z.length+=Z.objectMode?1:we.length)}Z.ended=!0,Z.sync?he(q):(Z.needReadable=!1,Z.emittedReadable||(Z.emittedReadable=!0,Fe(q)))}}function he(q){var Z=q._readableState;l("emitReadable",Z.needReadable,Z.emittedReadable),Z.needReadable=!1,Z.emittedReadable||(l("emitReadable",Z.flowing),Z.emittedReadable=!0,gt.nextTick(Fe,q))}function Fe(q){var Z=q._readableState;l("emitReadable_",Z.destroyed,Z.length,Z.ended),!Z.destroyed&&(Z.length||Z.ended)&&(q.emit("readable"),Z.emittedReadable=!1),Z.needReadable=!Z.flowing&&!Z.ended&&Z.length<=Z.highWaterMark,ce(q)}function ye(q,Z){Z.readingMore||(Z.readingMore=!0,gt.nextTick(ze,q,Z))}function ze(q,Z){for(;!Z.reading&&!Z.ended&&(Z.length<Z.highWaterMark||Z.flowing&&Z.length===0);){var we=Z.length;if(l("maybeReadMore read 0"),q.read(0),we===Z.length)break}Z.readingMore=!1}P.prototype._read=function(q){$(this,new S("_read()"))},P.prototype.pipe=function(q,Z){var we=this,O=this._readableState;switch(O.pipesCount){case 0:O.pipes=q;break;case 1:O.pipes=[O.pipes,q];break;default:O.pipes.push(q);break}O.pipesCount+=1,l("pipe count=%d opts=%j",O.pipesCount,Z);var xe=(!Z||Z.end!==!1)&&q!==gt.stdout&&q!==gt.stderr,F=xe?_:We;O.endEmitted?gt.nextTick(F):we.once("end",F),q.on("unpipe",k);function k(Je,Ye){l("onunpipe"),Je===we&&Ye&&Ye.hasUnpiped===!1&&(Ye.hasUnpiped=!0,pe())}function _(){l("onend"),q.end()}var N=ue(we);q.on("drain",N);var Q=!1;function pe(){l("cleanup"),q.removeListener("close",Ne),q.removeListener("finish",De),q.removeListener("drain",N),q.removeListener("error",Re),q.removeListener("unpipe",k),we.removeListener("end",_),we.removeListener("end",We),we.removeListener("data",oe),Q=!0,O.awaitDrain&&(!q._writableState||q._writableState.needDrain)&&N()}we.on("data",oe);function oe(Je){l("ondata");var Ye=q.write(Je);l("dest.write",Ye),Ye===!1&&((O.pipesCount===1&&O.pipes===q||O.pipesCount>1&&ie(O.pipes,q)!==-1)&&!Q&&(l("false write response, pause",O.awaitDrain),O.awaitDrain++),we.pause())}function Re(Je){l("onerror",Je),We(),q.removeListener("error",Re),e(q,"error")===0&&$(q,Je)}Y(q,"error",Re);function Ne(){q.removeListener("finish",De),We()}q.once("close",Ne);function De(){l("onfinish"),q.removeListener("close",Ne),We()}q.once("finish",De);function We(){l("unpipe"),we.unpipe(q)}return q.emit("pipe",we),O.flowing||(l("pipe resume"),we.resume()),q};function ue(q){return function(){var we=q._readableState;l("pipeOnDrain",we.awaitDrain),we.awaitDrain&&we.awaitDrain--,we.awaitDrain===0&&e(q,"data")&&(we.flowing=!0,ce(q))}}P.prototype.unpipe=function(q){var Z=this._readableState,we={hasUnpiped:!1};if(Z.pipesCount===0)return this;if(Z.pipesCount===1)return q&&q!==Z.pipes?this:(q||(q=Z.pipes),Z.pipes=null,Z.pipesCount=0,Z.flowing=!1,q&&q.emit("unpipe",this,we),this);if(!q){var O=Z.pipes,xe=Z.pipesCount;Z.pipes=null,Z.pipesCount=0,Z.flowing=!1;for(var F=0;F<xe;F++)O[F].emit("unpipe",this,{hasUnpiped:!1});return this}var k=ie(Z.pipes,q);return k===-1?this:(Z.pipes.splice(k,1),Z.pipesCount-=1,Z.pipesCount===1&&(Z.pipes=Z.pipes[0]),q.emit("unpipe",this,we),this)},P.prototype.on=function(q,Z){var we=r.prototype.on.call(this,q,Z),O=this._readableState;return q==="data"?(O.readableListening=this.listenerCount("readable")>0,O.flowing!==!1&&this.resume()):q==="readable"&&!O.endEmitted&&!O.readableListening&&(O.readableListening=O.needReadable=!0,O.flowing=!1,O.emittedReadable=!1,l("on readable",O.length,O.reading),O.length?he(this):O.reading||gt.nextTick(me,this)),we},P.prototype.addListener=P.prototype.on,P.prototype.removeListener=function(q,Z){var we=r.prototype.removeListener.call(this,q,Z);return q==="readable"&>.nextTick(V,this),we},P.prototype.removeAllListeners=function(q){var Z=r.prototype.removeAllListeners.apply(this,arguments);return(q==="readable"||q===void 0)&>.nextTick(V,this),Z};function V(q){var Z=q._readableState;Z.readableListening=q.listenerCount("readable")>0,Z.resumeScheduled&&!Z.paused?Z.flowing=!0:q.listenerCount("data")>0&&q.resume()}function me(q){l("readable nexttick read 0"),q.read(0)}P.prototype.resume=function(){var q=this._readableState;return q.flowing||(l("resume"),q.flowing=!q.readableListening,ge(this,q)),q.paused=!1,this};function ge(q,Z){Z.resumeScheduled||(Z.resumeScheduled=!0,gt.nextTick(ke,q,Z))}function ke(q,Z){l("resume",Z.reading),Z.reading||q.read(0),Z.resumeScheduled=!1,q.emit("resume"),ce(q),Z.flowing&&!Z.reading&&q.read(0)}P.prototype.pause=function(){return l("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(l("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function ce(q){var Z=q._readableState;for(l("flow",Z.flowing);Z.flowing&&q.read()!==null;);}P.prototype.wrap=function(q){var Z=this,we=this._readableState,O=!1;q.on("end",function(){if(l("wrapped end"),we.decoder&&!we.ended){var k=we.decoder.end();k&&k.length&&Z.push(k)}Z.push(null)}),q.on("data",function(k){if(l("wrapped data"),we.decoder&&(k=we.decoder.write(k)),!(we.objectMode&&k==null)&&!(!we.objectMode&&(!k||!k.length))){var _=Z.push(k);_||(O=!0,q.pause())}});for(var xe in q)this[xe]===void 0&&typeof q[xe]=="function"&&(this[xe]=function(_){return function(){return q[_].apply(q,arguments)}}(xe));for(var F=0;F<W.length;F++)q.on(W[F],this.emit.bind(this,W[F]));return this._read=function(k){l("wrapped _read",k),O&&(O=!1,q.resume())},this},typeof Symbol=="function"&&(P.prototype[Symbol.asyncIterator]=function(){return M===void 0&&(M=Lee()),M(this)}),Object.defineProperty(P.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(P.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(P.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(Z){this._readableState&&(this._readableState.flowing=Z)}}),P._fromList=L,Object.defineProperty(P.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function L(q,Z){if(Z.length===0)return null;var we;return Z.objectMode?we=Z.buffer.shift():!q||q>=Z.length?(Z.decoder?we=Z.buffer.join(""):Z.buffer.length===1?we=Z.buffer.first():we=Z.buffer.concat(Z.length),Z.buffer.clear()):we=Z.buffer.consume(q,Z.decoder),we}function D(q){var Z=q._readableState;l("endReadable",Z.endEmitted),Z.endEmitted||(Z.ended=!0,gt.nextTick(ae,Z,q))}function ae(q,Z){if(l("endReadableNT",q.endEmitted,q.length),!q.endEmitted&&q.length===0&&(q.endEmitted=!0,Z.readable=!1,Z.emit("end"),q.autoDestroy)){var we=Z._writableState;(!we||we.autoDestroy&&we.finished)&&Z.destroy()}}typeof Symbol=="function"&&(P.from=function(q,Z){return j===void 0&&(j=Fee()),j(P,q,Z)});function ie(q,Z){for(var we=0,O=q.length;we<O;we++)if(q[we]===Z)return we;return-1}return d0}var f0,PA;function h3(){if(PA)return f0;PA=1,f0=a;var t=Od().codes,e=t.ERR_METHOD_NOT_IMPLEMENTED,r=t.ERR_MULTIPLE_CALLBACK,n=t.ERR_TRANSFORM_ALREADY_TRANSFORMING,i=t.ERR_TRANSFORM_WITH_LENGTH_0,o=hd();fc(a,o);function s(d,f){var p=this._transformState;p.transforming=!1;var m=p.writecb;if(m===null)return this.emit("error",new r);p.writechunk=null,p.writecb=null,f!=null&&this.push(f),m(d);var g=this._readableState;g.reading=!1,(g.needReadable||g.length<g.highWaterMark)&&this._read(g.highWaterMark)}function a(d){if(!(this instanceof a))return new a(d);o.call(this,d),this._transformState={afterTransform:s.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,d&&(typeof d.transform=="function"&&(this._transform=d.transform),typeof d.flush=="function"&&(this._flush=d.flush)),this.on("prefinish",l)}function l(){var d=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(f,p){c(d,f,p)}):c(this,null,null)}a.prototype.push=function(d,f){return this._transformState.needTransform=!1,o.prototype.push.call(this,d,f)},a.prototype._transform=function(d,f,p){p(new e("_transform()"))},a.prototype._write=function(d,f,p){var m=this._transformState;if(m.writecb=p,m.writechunk=d,m.writeencoding=f,!m.transforming){var g=this._readableState;(m.needTransform||g.needReadable||g.length<g.highWaterMark)&&this._read(g.highWaterMark)}},a.prototype._read=function(d){var f=this._transformState;f.writechunk!==null&&!f.transforming?(f.transforming=!0,this._transform(f.writechunk,f.writeencoding,f.afterTransform)):f.needTransform=!0},a.prototype._destroy=function(d,f){o.prototype._destroy.call(this,d,function(p){f(p)})};function c(d,f,p){if(f)return d.emit("error",f);if(p!=null&&d.push(p),d._writableState.length)throw new i;if(d._transformState.transforming)throw new n;return d.push(null)}return f0}var h0,LA;function jee(){if(LA)return h0;LA=1,h0=e;var t=h3();fc(e,t);function e(r){if(!(this instanceof e))return new e(r);t.call(this,r)}return e.prototype._transform=function(r,n,i){i(null,r)},h0}var p0,FA;function Bee(){if(FA)return p0;FA=1;var t;function e(p){var m=!1;return function(){m||(m=!0,p.apply(void 0,arguments))}}var r=Od().codes,n=r.ERR_MISSING_ARGS,i=r.ERR_STREAM_DESTROYED;function o(p){if(p)throw p}function s(p){return p.setHeader&&typeof p.abort=="function"}function a(p,m,g,b){b=e(b);var S=!1;p.on("close",function(){S=!0}),t===void 0&&(t=QS()),t(p,{readable:m,writable:g},function(T){if(T)return b(T);S=!0,b()});var w=!1;return function(T){if(!S&&!w){if(w=!0,s(p))return p.abort();if(typeof p.destroy=="function")return p.destroy();b(T||new i("pipe"))}}}function l(p){p()}function c(p,m){return p.pipe(m)}function d(p){return!p.length||typeof p[p.length-1]!="function"?o:p.pop()}function f(){for(var p=arguments.length,m=new Array(p),g=0;g<p;g++)m[g]=arguments[g];var b=d(m);if(Array.isArray(m[0])&&(m=m[0]),m.length<2)throw new n("streams");var S,w=m.map(function(T,M){var j=M<m.length-1,$=M>0;return a(T,j,$,function(W){S||(S=W),W&&w.forEach(l),!j&&(w.forEach(l),b(S))})});return m.reduce(c)}return p0=f,p0}var ek=vi,tk=XS.EventEmitter,zee=fc;zee(vi,tk);vi.Readable=f3();vi.Writable=d3();vi.Duplex=hd();vi.Transform=h3();vi.PassThrough=jee();vi.finished=QS();vi.pipeline=Bee();vi.Stream=vi;function vi(){tk.call(this)}vi.prototype.pipe=function(t,e){var r=this;function n(d){t.writable&&t.write(d)===!1&&r.pause&&r.pause()}r.on("data",n);function i(){r.readable&&r.resume&&r.resume()}t.on("drain",i),!t._isStdio&&(!e||e.end!==!1)&&(r.on("end",s),r.on("close",a));var o=!1;function s(){o||(o=!0,t.end())}function a(){o||(o=!0,typeof t.destroy=="function"&&t.destroy())}function l(d){if(c(),tk.listenerCount(this,"error")===0)throw d}r.on("error",l),t.on("error",l);function c(){r.removeListener("data",n),t.removeListener("drain",i),r.removeListener("end",s),r.removeListener("close",a),r.removeListener("error",l),t.removeListener("error",l),r.removeListener("end",c),r.removeListener("close",c),t.removeListener("close",c)}return r.on("end",c),r.on("close",c),t.on("close",c),t.emit("pipe",r),t};(function(t){(function(e){e.parser=function(L,D){return new n(L,D)},e.SAXParser=n,e.SAXStream=d,e.createStream=c,e.MAX_BUFFER_LENGTH=64*1024;var r=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];e.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function n(L,D){if(!(this instanceof n))return new n(L,D);var ae=this;o(ae),ae.q=ae.c="",ae.bufferCheckPosition=e.MAX_BUFFER_LENGTH,ae.opt=D||{},ae.opt.lowercase=ae.opt.lowercase||ae.opt.lowercasetags,ae.looseCase=ae.opt.lowercase?"toLowerCase":"toUpperCase",ae.tags=[],ae.closed=ae.closedRoot=ae.sawRoot=!1,ae.tag=ae.error=null,ae.strict=!!L,ae.noscript=!!(L||ae.opt.noscript),ae.state=P.BEGIN,ae.strictEntities=ae.opt.strictEntities,ae.ENTITIES=ae.strictEntities?Object.create(e.XML_ENTITIES):Object.create(e.ENTITIES),ae.attribList=[],ae.opt.xmlns&&(ae.ns=Object.create(b)),ae.trackPosition=ae.opt.position!==!1,ae.trackPosition&&(ae.position=ae.line=ae.column=0),de(ae,"onready")}Object.create||(Object.create=function(L){function D(){}D.prototype=L;var ae=new D;return ae}),Object.keys||(Object.keys=function(L){var D=[];for(var ae in L)L.hasOwnProperty(ae)&&D.push(ae);return D});function i(L){for(var D=Math.max(e.MAX_BUFFER_LENGTH,10),ae=0,ie=0,q=r.length;ie<q;ie++){var Z=L[r[ie]].length;if(Z>D)switch(r[ie]){case"textNode":ne(L);break;case"cdata":U(L,"oncdata",L.cdata),L.cdata="";break;case"script":U(L,"onscript",L.script),L.script="";break;default:le(L,"Max buffer length exceeded: "+r[ie])}ae=Math.max(ae,Z)}var we=e.MAX_BUFFER_LENGTH-ae;L.bufferCheckPosition=we+L.position}function o(L){for(var D=0,ae=r.length;D<ae;D++)L[r[D]]=""}function s(L){ne(L),L.cdata!==""&&(U(L,"oncdata",L.cdata),L.cdata=""),L.script!==""&&(U(L,"onscript",L.script),L.script="")}n.prototype={end:function(){Ee(this)},write:ce,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){s(this)}};var a;try{a=ek.Stream}catch{a=function(){}}var l=e.EVENTS.filter(function(L){return L!=="error"&&L!=="end"});function c(L,D){return new d(L,D)}function d(L,D){if(!(this instanceof d))return new d(L,D);a.apply(this),this._parser=new n(L,D),this.writable=!0,this.readable=!0;var ae=this;this._parser.onend=function(){ae.emit("end")},this._parser.onerror=function(ie){ae.emit("error",ie),ae._parser.error=null},this._decoder=null,l.forEach(function(ie){Object.defineProperty(ae,"on"+ie,{get:function(){return ae._parser["on"+ie]},set:function(q){if(!q)return ae.removeAllListeners(ie),ae._parser["on"+ie]=q,q;ae.on(ie,q)},enumerable:!0,configurable:!1})})}d.prototype=Object.create(a.prototype,{constructor:{value:d}}),d.prototype.write=function(L){if(typeof Buffer=="function"&&typeof Buffer.isBuffer=="function"&&Buffer.isBuffer(L)){if(!this._decoder){var D=l1().StringDecoder;this._decoder=new D("utf8")}L=this._decoder.write(L)}return this._parser.write(L.toString()),this.emit("data",L),!0},d.prototype.end=function(L){return L&&L.length&&this.write(L),this._parser.end(),!0},d.prototype.on=function(L,D){var ae=this;return!ae._parser["on"+L]&&l.indexOf(L)!==-1&&(ae._parser["on"+L]=function(){var ie=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);ie.splice(0,0,L),ae.emit.apply(ae,ie)}),a.prototype.on.call(ae,L,D)};var f="[CDATA[",p="DOCTYPE",m="http://www.w3.org/XML/1998/namespace",g="http://www.w3.org/2000/xmlns/",b={xml:m,xmlns:g},S=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,w=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,T=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,M=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function j(L){return L===" "||L===`
|
|
300
|
+
`||L==="\r"||L===" "}function $(L){return L==='"'||L==="'"}function W(L){return L===">"||j(L)}function Y(L,D){return L.test(D)}function ee(L,D){return!Y(L,D)}var P=0;e.STATE={BEGIN:P++,BEGIN_WHITESPACE:P++,TEXT:P++,TEXT_ENTITY:P++,OPEN_WAKA:P++,SGML_DECL:P++,SGML_DECL_QUOTED:P++,DOCTYPE:P++,DOCTYPE_QUOTED:P++,DOCTYPE_DTD:P++,DOCTYPE_DTD_QUOTED:P++,COMMENT_STARTING:P++,COMMENT:P++,COMMENT_ENDING:P++,COMMENT_ENDED:P++,CDATA:P++,CDATA_ENDING:P++,CDATA_ENDING_2:P++,PROC_INST:P++,PROC_INST_BODY:P++,PROC_INST_ENDING:P++,OPEN_TAG:P++,OPEN_TAG_SLASH:P++,ATTRIB:P++,ATTRIB_NAME:P++,ATTRIB_NAME_SAW_WHITE:P++,ATTRIB_VALUE:P++,ATTRIB_VALUE_QUOTED:P++,ATTRIB_VALUE_CLOSED:P++,ATTRIB_VALUE_UNQUOTED:P++,ATTRIB_VALUE_ENTITY_Q:P++,ATTRIB_VALUE_ENTITY_U:P++,CLOSE_TAG:P++,CLOSE_TAG_SAW_WHITE:P++,SCRIPT:P++,SCRIPT_ENDING:P++},e.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},e.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(e.ENTITIES).forEach(function(L){var D=e.ENTITIES[L],ae=typeof D=="number"?String.fromCharCode(D):D;e.ENTITIES[L]=ae});for(var fe in e.STATE)e.STATE[e.STATE[fe]]=fe;P=e.STATE;function de(L,D,ae){L[D]&&L[D](ae)}function U(L,D,ae){L.textNode&&ne(L),de(L,D,ae)}function ne(L){L.textNode=R(L.opt,L.textNode),L.textNode&&de(L,"ontext",L.textNode),L.textNode=""}function R(L,D){return L.trim&&(D=D.trim()),L.normalize&&(D=D.replace(/\s+/g," ")),D}function le(L,D){return ne(L),L.trackPosition&&(D+=`
|
|
301
|
+
Line: `+L.line+`
|
|
302
|
+
Column: `+L.column+`
|
|
303
|
+
Char: `+L.c),D=new Error(D),L.error=D,de(L,"onerror",D),L}function Ee(L){return L.sawRoot&&!L.closedRoot&&he(L,"Unclosed root tag"),L.state!==P.BEGIN&&L.state!==P.BEGIN_WHITESPACE&&L.state!==P.TEXT&&le(L,"Unexpected end"),ne(L),L.c="",L.closed=!0,de(L,"onend"),n.call(L,L.strict,L.opt),L}function he(L,D){if(typeof L!="object"||!(L instanceof n))throw new Error("bad call to strictFail");L.strict&&le(L,D)}function Fe(L){L.strict||(L.tagName=L.tagName[L.looseCase]());var D=L.tags[L.tags.length-1]||L,ae=L.tag={name:L.tagName,attributes:{}};L.opt.xmlns&&(ae.ns=D.ns),L.attribList.length=0,U(L,"onopentagstart",ae)}function ye(L,D){var ae=L.indexOf(":"),ie=ae<0?["",L]:L.split(":"),q=ie[0],Z=ie[1];return D&&L==="xmlns"&&(q="xmlns",Z=""),{prefix:q,local:Z}}function ze(L){if(L.strict||(L.attribName=L.attribName[L.looseCase]()),L.attribList.indexOf(L.attribName)!==-1||L.tag.attributes.hasOwnProperty(L.attribName)){L.attribName=L.attribValue="";return}if(L.opt.xmlns){var D=ye(L.attribName,!0),ae=D.prefix,ie=D.local;if(ae==="xmlns")if(ie==="xml"&&L.attribValue!==m)he(L,"xml: prefix must be bound to "+m+`
|
|
304
|
+
Actual: `+L.attribValue);else if(ie==="xmlns"&&L.attribValue!==g)he(L,"xmlns: prefix must be bound to "+g+`
|
|
305
|
+
Actual: `+L.attribValue);else{var q=L.tag,Z=L.tags[L.tags.length-1]||L;q.ns===Z.ns&&(q.ns=Object.create(Z.ns)),q.ns[ie]=L.attribValue}L.attribList.push([L.attribName,L.attribValue])}else L.tag.attributes[L.attribName]=L.attribValue,U(L,"onattribute",{name:L.attribName,value:L.attribValue});L.attribName=L.attribValue=""}function ue(L,D){if(L.opt.xmlns){var ae=L.tag,ie=ye(L.tagName);ae.prefix=ie.prefix,ae.local=ie.local,ae.uri=ae.ns[ie.prefix]||"",ae.prefix&&!ae.uri&&(he(L,"Unbound namespace prefix: "+JSON.stringify(L.tagName)),ae.uri=ie.prefix);var q=L.tags[L.tags.length-1]||L;ae.ns&&q.ns!==ae.ns&&Object.keys(ae.ns).forEach(function(oe){U(L,"onopennamespace",{prefix:oe,uri:ae.ns[oe]})});for(var Z=0,we=L.attribList.length;Z<we;Z++){var O=L.attribList[Z],xe=O[0],F=O[1],k=ye(xe,!0),_=k.prefix,N=k.local,Q=_===""?"":ae.ns[_]||"",pe={name:xe,value:F,prefix:_,local:N,uri:Q};_&&_!=="xmlns"&&!Q&&(he(L,"Unbound namespace prefix: "+JSON.stringify(_)),pe.uri=_),L.tag.attributes[xe]=pe,U(L,"onattribute",pe)}L.attribList.length=0}L.tag.isSelfClosing=!!D,L.sawRoot=!0,L.tags.push(L.tag),U(L,"onopentag",L.tag),D||(!L.noscript&&L.tagName.toLowerCase()==="script"?L.state=P.SCRIPT:L.state=P.TEXT,L.tag=null,L.tagName=""),L.attribName=L.attribValue="",L.attribList.length=0}function V(L){if(!L.tagName){he(L,"Weird empty close tag."),L.textNode+="</>",L.state=P.TEXT;return}if(L.script){if(L.tagName!=="script"){L.script+="</"+L.tagName+">",L.tagName="",L.state=P.SCRIPT;return}U(L,"onscript",L.script),L.script=""}var D=L.tags.length,ae=L.tagName;L.strict||(ae=ae[L.looseCase]());for(var ie=ae;D--;){var q=L.tags[D];if(q.name!==ie)he(L,"Unexpected close tag");else break}if(D<0){he(L,"Unmatched closing tag: "+L.tagName),L.textNode+="</"+L.tagName+">",L.state=P.TEXT;return}L.tagName=ae;for(var Z=L.tags.length;Z-- >D;){var we=L.tag=L.tags.pop();L.tagName=L.tag.name,U(L,"onclosetag",L.tagName);var O={};for(var xe in we.ns)O[xe]=we.ns[xe];var F=L.tags[L.tags.length-1]||L;L.opt.xmlns&&we.ns!==F.ns&&Object.keys(we.ns).forEach(function(k){var _=we.ns[k];U(L,"onclosenamespace",{prefix:k,uri:_})})}D===0&&(L.closedRoot=!0),L.tagName=L.attribValue=L.attribName="",L.attribList.length=0,L.state=P.TEXT}function me(L){var D=L.entity,ae=D.toLowerCase(),ie,q="";return L.ENTITIES[D]?L.ENTITIES[D]:L.ENTITIES[ae]?L.ENTITIES[ae]:(D=ae,D.charAt(0)==="#"&&(D.charAt(1)==="x"?(D=D.slice(2),ie=parseInt(D,16),q=ie.toString(16)):(D=D.slice(1),ie=parseInt(D,10),q=ie.toString(10))),D=D.replace(/^0+/,""),isNaN(ie)||q.toLowerCase()!==D?(he(L,"Invalid character entity"),"&"+L.entity+";"):String.fromCodePoint(ie))}function ge(L,D){D==="<"?(L.state=P.OPEN_WAKA,L.startTagPosition=L.position):j(D)||(he(L,"Non-whitespace before first tag."),L.textNode=D,L.state=P.TEXT)}function ke(L,D){var ae="";return D<L.length&&(ae=L.charAt(D)),ae}function ce(L){var D=this;if(this.error)throw this.error;if(D.closed)return le(D,"Cannot write after close. Assign an onready handler.");if(L===null)return Ee(D);typeof L=="object"&&(L=L.toString());for(var ae=0,ie="";ie=ke(L,ae++),D.c=ie,!!ie;)switch(D.trackPosition&&(D.position++,ie===`
|
|
306
|
+
`?(D.line++,D.column=0):D.column++),D.state){case P.BEGIN:if(D.state=P.BEGIN_WHITESPACE,ie==="\uFEFF")continue;ge(D,ie);continue;case P.BEGIN_WHITESPACE:ge(D,ie);continue;case P.TEXT:if(D.sawRoot&&!D.closedRoot){for(var q=ae-1;ie&&ie!=="<"&&ie!=="&";)ie=ke(L,ae++),ie&&D.trackPosition&&(D.position++,ie===`
|
|
307
|
+
`?(D.line++,D.column=0):D.column++);D.textNode+=L.substring(q,ae-1)}ie==="<"&&!(D.sawRoot&&D.closedRoot&&!D.strict)?(D.state=P.OPEN_WAKA,D.startTagPosition=D.position):(!j(ie)&&(!D.sawRoot||D.closedRoot)&&he(D,"Text data outside of root node."),ie==="&"?D.state=P.TEXT_ENTITY:D.textNode+=ie);continue;case P.SCRIPT:ie==="<"?D.state=P.SCRIPT_ENDING:D.script+=ie;continue;case P.SCRIPT_ENDING:ie==="/"?D.state=P.CLOSE_TAG:(D.script+="<"+ie,D.state=P.SCRIPT);continue;case P.OPEN_WAKA:if(ie==="!")D.state=P.SGML_DECL,D.sgmlDecl="";else if(!j(ie))if(Y(S,ie))D.state=P.OPEN_TAG,D.tagName=ie;else if(ie==="/")D.state=P.CLOSE_TAG,D.tagName="";else if(ie==="?")D.state=P.PROC_INST,D.procInstName=D.procInstBody="";else{if(he(D,"Unencoded <"),D.startTagPosition+1<D.position){var Z=D.position-D.startTagPosition;ie=new Array(Z).join(" ")+ie}D.textNode+="<"+ie,D.state=P.TEXT}continue;case P.SGML_DECL:(D.sgmlDecl+ie).toUpperCase()===f?(U(D,"onopencdata"),D.state=P.CDATA,D.sgmlDecl="",D.cdata=""):D.sgmlDecl+ie==="--"?(D.state=P.COMMENT,D.comment="",D.sgmlDecl=""):(D.sgmlDecl+ie).toUpperCase()===p?(D.state=P.DOCTYPE,(D.doctype||D.sawRoot)&&he(D,"Inappropriately located doctype declaration"),D.doctype="",D.sgmlDecl=""):ie===">"?(U(D,"onsgmldeclaration",D.sgmlDecl),D.sgmlDecl="",D.state=P.TEXT):($(ie)&&(D.state=P.SGML_DECL_QUOTED),D.sgmlDecl+=ie);continue;case P.SGML_DECL_QUOTED:ie===D.q&&(D.state=P.SGML_DECL,D.q=""),D.sgmlDecl+=ie;continue;case P.DOCTYPE:ie===">"?(D.state=P.TEXT,U(D,"ondoctype",D.doctype),D.doctype=!0):(D.doctype+=ie,ie==="["?D.state=P.DOCTYPE_DTD:$(ie)&&(D.state=P.DOCTYPE_QUOTED,D.q=ie));continue;case P.DOCTYPE_QUOTED:D.doctype+=ie,ie===D.q&&(D.q="",D.state=P.DOCTYPE);continue;case P.DOCTYPE_DTD:D.doctype+=ie,ie==="]"?D.state=P.DOCTYPE:$(ie)&&(D.state=P.DOCTYPE_DTD_QUOTED,D.q=ie);continue;case P.DOCTYPE_DTD_QUOTED:D.doctype+=ie,ie===D.q&&(D.state=P.DOCTYPE_DTD,D.q="");continue;case P.COMMENT:ie==="-"?D.state=P.COMMENT_ENDING:D.comment+=ie;continue;case P.COMMENT_ENDING:ie==="-"?(D.state=P.COMMENT_ENDED,D.comment=R(D.opt,D.comment),D.comment&&U(D,"oncomment",D.comment),D.comment=""):(D.comment+="-"+ie,D.state=P.COMMENT);continue;case P.COMMENT_ENDED:ie!==">"?(he(D,"Malformed comment"),D.comment+="--"+ie,D.state=P.COMMENT):D.state=P.TEXT;continue;case P.CDATA:ie==="]"?D.state=P.CDATA_ENDING:D.cdata+=ie;continue;case P.CDATA_ENDING:ie==="]"?D.state=P.CDATA_ENDING_2:(D.cdata+="]"+ie,D.state=P.CDATA);continue;case P.CDATA_ENDING_2:ie===">"?(D.cdata&&U(D,"oncdata",D.cdata),U(D,"onclosecdata"),D.cdata="",D.state=P.TEXT):ie==="]"?D.cdata+="]":(D.cdata+="]]"+ie,D.state=P.CDATA);continue;case P.PROC_INST:ie==="?"?D.state=P.PROC_INST_ENDING:j(ie)?D.state=P.PROC_INST_BODY:D.procInstName+=ie;continue;case P.PROC_INST_BODY:if(!D.procInstBody&&j(ie))continue;ie==="?"?D.state=P.PROC_INST_ENDING:D.procInstBody+=ie;continue;case P.PROC_INST_ENDING:ie===">"?(U(D,"onprocessinginstruction",{name:D.procInstName,body:D.procInstBody}),D.procInstName=D.procInstBody="",D.state=P.TEXT):(D.procInstBody+="?"+ie,D.state=P.PROC_INST_BODY);continue;case P.OPEN_TAG:Y(w,ie)?D.tagName+=ie:(Fe(D),ie===">"?ue(D):ie==="/"?D.state=P.OPEN_TAG_SLASH:(j(ie)||he(D,"Invalid character in tag name"),D.state=P.ATTRIB));continue;case P.OPEN_TAG_SLASH:ie===">"?(ue(D,!0),V(D)):(he(D,"Forward-slash in opening tag not followed by >"),D.state=P.ATTRIB);continue;case P.ATTRIB:if(j(ie))continue;ie===">"?ue(D):ie==="/"?D.state=P.OPEN_TAG_SLASH:Y(S,ie)?(D.attribName=ie,D.attribValue="",D.state=P.ATTRIB_NAME):he(D,"Invalid attribute name");continue;case P.ATTRIB_NAME:ie==="="?D.state=P.ATTRIB_VALUE:ie===">"?(he(D,"Attribute without value"),D.attribValue=D.attribName,ze(D),ue(D)):j(ie)?D.state=P.ATTRIB_NAME_SAW_WHITE:Y(w,ie)?D.attribName+=ie:he(D,"Invalid attribute name");continue;case P.ATTRIB_NAME_SAW_WHITE:if(ie==="=")D.state=P.ATTRIB_VALUE;else{if(j(ie))continue;he(D,"Attribute without value"),D.tag.attributes[D.attribName]="",D.attribValue="",U(D,"onattribute",{name:D.attribName,value:""}),D.attribName="",ie===">"?ue(D):Y(S,ie)?(D.attribName=ie,D.state=P.ATTRIB_NAME):(he(D,"Invalid attribute name"),D.state=P.ATTRIB)}continue;case P.ATTRIB_VALUE:if(j(ie))continue;$(ie)?(D.q=ie,D.state=P.ATTRIB_VALUE_QUOTED):(he(D,"Unquoted attribute value"),D.state=P.ATTRIB_VALUE_UNQUOTED,D.attribValue=ie);continue;case P.ATTRIB_VALUE_QUOTED:if(ie!==D.q){ie==="&"?D.state=P.ATTRIB_VALUE_ENTITY_Q:D.attribValue+=ie;continue}ze(D),D.q="",D.state=P.ATTRIB_VALUE_CLOSED;continue;case P.ATTRIB_VALUE_CLOSED:j(ie)?D.state=P.ATTRIB:ie===">"?ue(D):ie==="/"?D.state=P.OPEN_TAG_SLASH:Y(S,ie)?(he(D,"No whitespace between attributes"),D.attribName=ie,D.attribValue="",D.state=P.ATTRIB_NAME):he(D,"Invalid attribute name");continue;case P.ATTRIB_VALUE_UNQUOTED:if(!W(ie)){ie==="&"?D.state=P.ATTRIB_VALUE_ENTITY_U:D.attribValue+=ie;continue}ze(D),ie===">"?ue(D):D.state=P.ATTRIB;continue;case P.CLOSE_TAG:if(D.tagName)ie===">"?V(D):Y(w,ie)?D.tagName+=ie:D.script?(D.script+="</"+D.tagName,D.tagName="",D.state=P.SCRIPT):(j(ie)||he(D,"Invalid tagname in closing tag"),D.state=P.CLOSE_TAG_SAW_WHITE);else{if(j(ie))continue;ee(S,ie)?D.script?(D.script+="</"+ie,D.state=P.SCRIPT):he(D,"Invalid tagname in closing tag."):D.tagName=ie}continue;case P.CLOSE_TAG_SAW_WHITE:if(j(ie))continue;ie===">"?V(D):he(D,"Invalid characters in closing tag");continue;case P.TEXT_ENTITY:case P.ATTRIB_VALUE_ENTITY_Q:case P.ATTRIB_VALUE_ENTITY_U:var we,O;switch(D.state){case P.TEXT_ENTITY:we=P.TEXT,O="textNode";break;case P.ATTRIB_VALUE_ENTITY_Q:we=P.ATTRIB_VALUE_QUOTED,O="attribValue";break;case P.ATTRIB_VALUE_ENTITY_U:we=P.ATTRIB_VALUE_UNQUOTED,O="attribValue";break}ie===";"?(D[O]+=me(D),D.entity="",D.state=we):Y(D.entity.length?M:T,ie)?D.entity+=ie:(he(D,"Invalid character in entity name"),D[O]+="&"+D.entity+ie,D.entity="",D.state=we);continue;default:throw new Error(D,"Unknown state: "+D.state)}return D.position>=D.bufferCheckPosition&&i(D),D}/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */String.fromCodePoint||function(){var L=String.fromCharCode,D=Math.floor,ae=function(){var ie=16384,q=[],Z,we,O=-1,xe=arguments.length;if(!xe)return"";for(var F="";++O<xe;){var k=Number(arguments[O]);if(!isFinite(k)||k<0||k>1114111||D(k)!==k)throw RangeError("Invalid code point: "+k);k<=65535?q.push(k):(k-=65536,Z=(k>>10)+55296,we=k%1024+56320,q.push(Z,we)),(O+1===xe||q.length>ie)&&(F+=L.apply(null,q),q.length=0)}return F};Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:ae,configurable:!0,writable:!0}):String.fromCodePoint=ae}()})(t)})(UD);var rk={isArray:function(t){return Array.isArray?Array.isArray(t):Object.prototype.toString.call(t)==="[object Array]"}},Hee=rk.isArray,nk={copyOptions:function(t){var e,r={};for(e in t)t.hasOwnProperty(e)&&(r[e]=t[e]);return r},ensureFlagExists:function(t,e){(!(t in e)||typeof e[t]!="boolean")&&(e[t]=!1)},ensureSpacesExists:function(t){(!("spaces"in t)||typeof t.spaces!="number"&&typeof t.spaces!="string")&&(t.spaces=0)},ensureAlwaysArrayExists:function(t){(!("alwaysArray"in t)||typeof t.alwaysArray!="boolean"&&!Hee(t.alwaysArray))&&(t.alwaysArray=!1)},ensureKeyExists:function(t,e){(!(t+"Key"in e)||typeof e[t+"Key"]!="string")&&(e[t+"Key"]=e.compact?"_"+t:t)},checkFnExists:function(t,e){return t+"Fn"in e}},$ee=UD,Pt=nk,Vu=rk.isArray,Ie,at;function Uee(t){return Ie=Pt.copyOptions(t),Pt.ensureFlagExists("ignoreDeclaration",Ie),Pt.ensureFlagExists("ignoreInstruction",Ie),Pt.ensureFlagExists("ignoreAttributes",Ie),Pt.ensureFlagExists("ignoreText",Ie),Pt.ensureFlagExists("ignoreComment",Ie),Pt.ensureFlagExists("ignoreCdata",Ie),Pt.ensureFlagExists("ignoreDoctype",Ie),Pt.ensureFlagExists("compact",Ie),Pt.ensureFlagExists("alwaysChildren",Ie),Pt.ensureFlagExists("addParent",Ie),Pt.ensureFlagExists("trim",Ie),Pt.ensureFlagExists("nativeType",Ie),Pt.ensureFlagExists("nativeTypeAttributes",Ie),Pt.ensureFlagExists("sanitize",Ie),Pt.ensureFlagExists("instructionHasAttributes",Ie),Pt.ensureFlagExists("captureSpacesBetweenElements",Ie),Pt.ensureAlwaysArrayExists(Ie),Pt.ensureKeyExists("declaration",Ie),Pt.ensureKeyExists("instruction",Ie),Pt.ensureKeyExists("attributes",Ie),Pt.ensureKeyExists("text",Ie),Pt.ensureKeyExists("comment",Ie),Pt.ensureKeyExists("cdata",Ie),Pt.ensureKeyExists("doctype",Ie),Pt.ensureKeyExists("type",Ie),Pt.ensureKeyExists("name",Ie),Pt.ensureKeyExists("elements",Ie),Pt.ensureKeyExists("parent",Ie),Ie}function p3(t){var e=Number(t);if(!isNaN(e))return e;var r=t.toLowerCase();return r==="true"?!0:r==="false"?!1:t}function Yh(t,e){var r;if(Ie.compact){if(!at[Ie[t+"Key"]]&&(Vu(Ie.alwaysArray)?Ie.alwaysArray.indexOf(Ie[t+"Key"])!==-1:Ie.alwaysArray)&&(at[Ie[t+"Key"]]=[]),at[Ie[t+"Key"]]&&!Vu(at[Ie[t+"Key"]])&&(at[Ie[t+"Key"]]=[at[Ie[t+"Key"]]]),t+"Fn"in Ie&&typeof e=="string"&&(e=Ie[t+"Fn"](e,at)),t==="instruction"&&("instructionFn"in Ie||"instructionNameFn"in Ie)){for(r in e)if(e.hasOwnProperty(r))if("instructionFn"in Ie)e[r]=Ie.instructionFn(e[r],r,at);else{var n=e[r];delete e[r],e[Ie.instructionNameFn(r,n,at)]=n}}Vu(at[Ie[t+"Key"]])?at[Ie[t+"Key"]].push(e):at[Ie[t+"Key"]]=e}else{at[Ie.elementsKey]||(at[Ie.elementsKey]=[]);var i={};if(i[Ie.typeKey]=t,t==="instruction"){for(r in e)if(e.hasOwnProperty(r))break;i[Ie.nameKey]="instructionNameFn"in Ie?Ie.instructionNameFn(r,e,at):r,Ie.instructionHasAttributes?(i[Ie.attributesKey]=e[r][Ie.attributesKey],"instructionFn"in Ie&&(i[Ie.attributesKey]=Ie.instructionFn(i[Ie.attributesKey],r,at))):("instructionFn"in Ie&&(e[r]=Ie.instructionFn(e[r],r,at)),i[Ie.instructionKey]=e[r])}else t+"Fn"in Ie&&(e=Ie[t+"Fn"](e,at)),i[Ie[t+"Key"]]=e;Ie.addParent&&(i[Ie.parentKey]=at),at[Ie.elementsKey].push(i)}}function m3(t){if("attributesFn"in Ie&&t&&(t=Ie.attributesFn(t,at)),(Ie.trim||"attributeValueFn"in Ie||"attributeNameFn"in Ie||Ie.nativeTypeAttributes)&&t){var e;for(e in t)if(t.hasOwnProperty(e)&&(Ie.trim&&(t[e]=t[e].trim()),Ie.nativeTypeAttributes&&(t[e]=p3(t[e])),"attributeValueFn"in Ie&&(t[e]=Ie.attributeValueFn(t[e],e,at)),"attributeNameFn"in Ie)){var r=t[e];delete t[e],t[Ie.attributeNameFn(e,t[e],at)]=r}}return t}function Wee(t){var e={};if(t.body&&(t.name.toLowerCase()==="xml"||Ie.instructionHasAttributes)){for(var r=/([\w:-]+)\s*=\s*(?:"([^"]*)"|'([^']*)'|(\w+))\s*/g,n;(n=r.exec(t.body))!==null;)e[n[1]]=n[2]||n[3]||n[4];e=m3(e)}if(t.name.toLowerCase()==="xml"){if(Ie.ignoreDeclaration)return;at[Ie.declarationKey]={},Object.keys(e).length&&(at[Ie.declarationKey][Ie.attributesKey]=e),Ie.addParent&&(at[Ie.declarationKey][Ie.parentKey]=at)}else{if(Ie.ignoreInstruction)return;Ie.trim&&(t.body=t.body.trim());var i={};Ie.instructionHasAttributes&&Object.keys(e).length?(i[t.name]={},i[t.name][Ie.attributesKey]=e):i[t.name]=t.body,Yh("instruction",i)}}function Vee(t,e){var r;if(typeof t=="object"&&(e=t.attributes,t=t.name),e=m3(e),"elementNameFn"in Ie&&(t=Ie.elementNameFn(t,at)),Ie.compact){if(r={},!Ie.ignoreAttributes&&e&&Object.keys(e).length){r[Ie.attributesKey]={};var n;for(n in e)e.hasOwnProperty(n)&&(r[Ie.attributesKey][n]=e[n])}!(t in at)&&(Vu(Ie.alwaysArray)?Ie.alwaysArray.indexOf(t)!==-1:Ie.alwaysArray)&&(at[t]=[]),at[t]&&!Vu(at[t])&&(at[t]=[at[t]]),Vu(at[t])?at[t].push(r):at[t]=r}else at[Ie.elementsKey]||(at[Ie.elementsKey]=[]),r={},r[Ie.typeKey]="element",r[Ie.nameKey]=t,!Ie.ignoreAttributes&&e&&Object.keys(e).length&&(r[Ie.attributesKey]=e),Ie.alwaysChildren&&(r[Ie.elementsKey]=[]),at[Ie.elementsKey].push(r);r[Ie.parentKey]=at,at=r}function Gee(t){Ie.ignoreText||!t.trim()&&!Ie.captureSpacesBetweenElements||(Ie.trim&&(t=t.trim()),Ie.nativeType&&(t=p3(t)),Ie.sanitize&&(t=t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")),Yh("text",t))}function Kee(t){Ie.ignoreComment||(Ie.trim&&(t=t.trim()),Yh("comment",t))}function qee(t){var e=at[Ie.parentKey];Ie.addParent||delete at[Ie.parentKey],at=e}function Xee(t){Ie.ignoreCdata||(Ie.trim&&(t=t.trim()),Yh("cdata",t))}function Yee(t){Ie.ignoreDoctype||(t=t.replace(/^ /,""),Ie.trim&&(t=t.trim()),Yh("doctype",t))}function Jee(t){t.note=t}var g3=function(t,e){var r=$ee.parser(!0,{}),n={};if(at=n,Ie=Uee(e),r.opt={strictEntities:!0},r.onopentag=Vee,r.ontext=Gee,r.oncomment=Kee,r.onclosetag=qee,r.onerror=Jee,r.oncdata=Xee,r.ondoctype=Yee,r.onprocessinginstruction=Wee,r.write(t).close(),n[Ie.elementsKey]){var i=n[Ie.elementsKey];delete n[Ie.elementsKey],n[Ie.elementsKey]=i,delete n.text}return n},jA=nk,Zee=g3;function Qee(t){var e=jA.copyOptions(t);return jA.ensureSpacesExists(e),e}var ete=function(t,e){var r,n,i,o;return r=Qee(e),n=Zee(t,r),o="compact"in r&&r.compact?"_parent":"parent","addParent"in r&&r.addParent?i=JSON.stringify(n,function(s,a){return s===o?"_":a},r.spaces):i=JSON.stringify(n,null,r.spaces),i.replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")},Vt=nk,tte=rk.isArray,qr,Xr;function rte(t){var e=Vt.copyOptions(t);return Vt.ensureFlagExists("ignoreDeclaration",e),Vt.ensureFlagExists("ignoreInstruction",e),Vt.ensureFlagExists("ignoreAttributes",e),Vt.ensureFlagExists("ignoreText",e),Vt.ensureFlagExists("ignoreComment",e),Vt.ensureFlagExists("ignoreCdata",e),Vt.ensureFlagExists("ignoreDoctype",e),Vt.ensureFlagExists("compact",e),Vt.ensureFlagExists("indentText",e),Vt.ensureFlagExists("indentCdata",e),Vt.ensureFlagExists("indentAttributes",e),Vt.ensureFlagExists("indentInstruction",e),Vt.ensureFlagExists("fullTagEmptyElement",e),Vt.ensureFlagExists("noQuotesForNativeAttributes",e),Vt.ensureSpacesExists(e),typeof e.spaces=="number"&&(e.spaces=Array(e.spaces+1).join(" ")),Vt.ensureKeyExists("declaration",e),Vt.ensureKeyExists("instruction",e),Vt.ensureKeyExists("attributes",e),Vt.ensureKeyExists("text",e),Vt.ensureKeyExists("comment",e),Vt.ensureKeyExists("cdata",e),Vt.ensureKeyExists("doctype",e),Vt.ensureKeyExists("type",e),Vt.ensureKeyExists("name",e),Vt.ensureKeyExists("elements",e),e}function ho(t,e,r){return(!r&&t.spaces?`
|
|
308
|
+
`:"")+Array(e+1).join(t.spaces)}function sv(t,e,r){if(e.ignoreAttributes)return"";"attributesFn"in e&&(t=e.attributesFn(t,Xr,qr));var n,i,o,s,a=[];for(n in t)t.hasOwnProperty(n)&&t[n]!==null&&t[n]!==void 0&&(s=e.noQuotesForNativeAttributes&&typeof t[n]!="string"?"":'"',i=""+t[n],i=i.replace(/"/g,"""),o="attributeNameFn"in e?e.attributeNameFn(n,i,Xr,qr):n,a.push(e.spaces&&e.indentAttributes?ho(e,r+1,!1):" "),a.push(o+"="+s+("attributeValueFn"in e?e.attributeValueFn(i,n,Xr,qr):i)+s));return t&&Object.keys(t).length&&e.spaces&&e.indentAttributes&&a.push(ho(e,r,!1)),a.join("")}function y3(t,e,r){return qr=t,Xr="xml",e.ignoreDeclaration?"":"<?xml"+sv(t[e.attributesKey],e,r)+"?>"}function v3(t,e,r){if(e.ignoreInstruction)return"";var n;for(n in t)if(t.hasOwnProperty(n))break;var i="instructionNameFn"in e?e.instructionNameFn(n,t[n],Xr,qr):n;if(typeof t[n]=="object")return qr=t,Xr=i,"<?"+i+sv(t[n][e.attributesKey],e,r)+"?>";var o=t[n]?t[n]:"";return"instructionFn"in e&&(o=e.instructionFn(o,n,Xr,qr)),"<?"+i+(o?" "+o:"")+"?>"}function b3(t,e){return e.ignoreComment?"":"<!--"+("commentFn"in e?e.commentFn(t,Xr,qr):t)+"-->"}function w3(t,e){return e.ignoreCdata?"":"<![CDATA["+("cdataFn"in e?e.cdataFn(t,Xr,qr):t.replace("]]>","]]]]><![CDATA[>"))+"]]>"}function x3(t,e){return e.ignoreDoctype?"":"<!DOCTYPE "+("doctypeFn"in e?e.doctypeFn(t,Xr,qr):t)+">"}function ik(t,e){return e.ignoreText?"":(t=""+t,t=t.replace(/&/g,"&"),t=t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),"textFn"in e?e.textFn(t,Xr,qr):t)}function nte(t,e){var r;if(t.elements&&t.elements.length)for(r=0;r<t.elements.length;++r)switch(t.elements[r][e.typeKey]){case"text":if(e.indentText)return!0;break;case"cdata":if(e.indentCdata)return!0;break;case"instruction":if(e.indentInstruction)return!0;break;case"doctype":case"comment":case"element":return!0;default:return!0}return!1}function ite(t,e,r){qr=t,Xr=t.name;var n=[],i="elementNameFn"in e?e.elementNameFn(t.name,t):t.name;n.push("<"+i),t[e.attributesKey]&&n.push(sv(t[e.attributesKey],e,r));var o=t[e.elementsKey]&&t[e.elementsKey].length||t[e.attributesKey]&&t[e.attributesKey]["xml:space"]==="preserve";return o||("fullTagEmptyElementFn"in e?o=e.fullTagEmptyElementFn(t.name,t):o=e.fullTagEmptyElement),o?(n.push(">"),t[e.elementsKey]&&t[e.elementsKey].length&&(n.push(S3(t[e.elementsKey],e,r+1)),qr=t,Xr=t.name),n.push(e.spaces&&nte(t,e)?`
|
|
309
|
+
`+Array(r+1).join(e.spaces):""),n.push("</"+i+">")):n.push("/>"),n.join("")}function S3(t,e,r,n){return t.reduce(function(i,o){var s=ho(e,r,n&&!i);switch(o.type){case"element":return i+s+ite(o,e,r);case"comment":return i+s+b3(o[e.commentKey],e);case"doctype":return i+s+x3(o[e.doctypeKey],e);case"cdata":return i+(e.indentCdata?s:"")+w3(o[e.cdataKey],e);case"text":return i+(e.indentText?s:"")+ik(o[e.textKey],e);case"instruction":var a={};return a[o[e.nameKey]]=o[e.attributesKey]?o:o[e.instructionKey],i+(e.indentInstruction?s:"")+v3(a,e,r)}},"")}function k3(t,e,r){var n;for(n in t)if(t.hasOwnProperty(n))switch(n){case e.parentKey:case e.attributesKey:break;case e.textKey:if(e.indentText||r)return!0;break;case e.cdataKey:if(e.indentCdata||r)return!0;break;case e.instructionKey:if(e.indentInstruction||r)return!0;break;case e.doctypeKey:case e.commentKey:return!0;default:return!0}return!1}function ote(t,e,r,n,i){qr=t,Xr=e;var o="elementNameFn"in r?r.elementNameFn(e,t):e;if(typeof t>"u"||t===null||t==="")return"fullTagEmptyElementFn"in r&&r.fullTagEmptyElementFn(e,t)||r.fullTagEmptyElement?"<"+o+"></"+o+">":"<"+o+"/>";var s=[];if(e){if(s.push("<"+o),typeof t!="object")return s.push(">"+ik(t,r)+"</"+o+">"),s.join("");t[r.attributesKey]&&s.push(sv(t[r.attributesKey],r,n));var a=k3(t,r,!0)||t[r.attributesKey]&&t[r.attributesKey]["xml:space"]==="preserve";if(a||("fullTagEmptyElementFn"in r?a=r.fullTagEmptyElementFn(e,t):a=r.fullTagEmptyElement),a)s.push(">");else return s.push("/>"),s.join("")}return s.push(_3(t,r,n+1,!1)),qr=t,Xr=e,e&&s.push((i?ho(r,n,!1):"")+"</"+o+">"),s.join("")}function _3(t,e,r,n){var i,o,s,a=[];for(o in t)if(t.hasOwnProperty(o))for(s=tte(t[o])?t[o]:[t[o]],i=0;i<s.length;++i){switch(o){case e.declarationKey:a.push(y3(s[i],e,r));break;case e.instructionKey:a.push((e.indentInstruction?ho(e,r,n):"")+v3(s[i],e,r));break;case e.attributesKey:case e.parentKey:break;case e.textKey:a.push((e.indentText?ho(e,r,n):"")+ik(s[i],e));break;case e.cdataKey:a.push((e.indentCdata?ho(e,r,n):"")+w3(s[i],e));break;case e.doctypeKey:a.push(ho(e,r,n)+x3(s[i],e));break;case e.commentKey:a.push(ho(e,r,n)+b3(s[i],e));break;default:a.push(ho(e,r,n)+ote(s[i],o,e,r,k3(s[i],e)))}n=n&&!a.length}return a.join("")}var C3=function(t,e){e=rte(e);var r=[];return qr=t,Xr="_root_",e.compact?r.push(_3(t,e,0,!0)):(t[e.declarationKey]&&r.push(y3(t[e.declarationKey],e,0)),t[e.elementsKey]&&t[e.elementsKey].length&&r.push(S3(t[e.elementsKey],e,0,!r.length))),r.join("")},ste=C3,ate=function(t,e){t instanceof Buffer&&(t=t.toString());var r=null;if(typeof t=="string")try{r=JSON.parse(t)}catch{throw new Error("The JSON structure is invalid")}else r=t;return ste(r,e)},lte=g3,cte=ete,ute=C3,dte=ate,E3={xml2js:lte,xml2json:cte,js2xml:ute,json2xml:dte};const ok=t=>{switch(t.type){case void 0:case"element":const e=new hte(t.name,t.attributes),r=t.elements||[];for(const n of r){const i=ok(n);i!==void 0&&e.push(i)}return e;case"text":return t.text;default:return}};class fte extends Xe{}class hte extends Te{static fromXmlString(e){const r=E3.xml2js(e,{compact:!1});return ok(r)}constructor(e,r){super(e),r&&this.root.push(new fte(r))}push(e){this.root.push(e)}}class pte extends Te{constructor(e){super(""),this._attr=e}prepForXml(e){return{_attr:this._attr}}}class T3 extends Te{constructor(e,r){super(e),r&&(this.root=r.root)}}const Zr=t=>{if(isNaN(t))throw new Error(`Invalid value '${t}' specified. Must be an integer.`);return Math.floor(t)},av=t=>{const e=Zr(t);if(e<0)throw new Error(`Invalid value '${t}' specified. Must be a positive integer.`);return e},A3=(t,e)=>{const r=e*2;if(t.length!==r||isNaN(+`0x${t}`))throw new Error(`Invalid hex value '${t}'. Expected ${r} digit hex value`);return t},BA=t=>A3(t,1),sk=t=>{const e=t.slice(-2),r=t.substring(0,t.length-2);return`${Number(r)}${e}`},R3=t=>{const e=sk(t);if(parseFloat(e)<0)throw new Error(`Invalid value '${e}' specified. Expected a positive number.`);return e},pd=t=>{if(t==="auto")return t;const e=t.charAt(0)==="#"?t.substring(1):t;return A3(e,3)},as=t=>typeof t=="string"?sk(t):Zr(t),mte=t=>typeof t=="string"?R3(t):av(t),Br=t=>typeof t=="string"?R3(t):av(t),gte=t=>{const e=t.substring(0,t.length-1);return`${Number(e)}%`},yte=t=>typeof t=="number"?Zr(t):t.slice(-1)==="%"?gte(t):sk(t),vte=av,bte=av,wte=t=>t.toISOString();class Be extends Te{constructor(e,r=!0){super(e),r!==!0&&this.root.push(new sr({val:r}))}}class m0 extends Te{constructor(e,r){super(e),this.root.push(new sr({val:mte(r)}))}}class Ul extends Te{constructor(e,r){super(e),this.root.push(new sr({val:r}))}}const Ff=(t,e)=>new hr({name:t,attributes:{value:{key:"w:val",value:e}}});class ak extends Te{constructor(e,r){super(e),this.root.push(new sr({val:r}))}}class xte extends Te{constructor(e,r){super(e),this.root.push(new sr({val:r}))}}class wl extends Te{constructor(e,r){super(e),this.root.push(r)}}class hr extends Te{constructor({name:e,attributes:r,children:n}){super(e),r&&this.root.push(new ws(r)),n&&this.root.push(...n)}}const An={START:"start",CENTER:"center",END:"end",BOTH:"both",MEDIUM_KASHIDA:"mediumKashida",DISTRIBUTE:"distribute",NUM_TAB:"numTab",HIGH_KASHIDA:"highKashida",LOW_KASHIDA:"lowKashida",THAI_DISTRIBUTE:"thaiDistribute",LEFT:"left",RIGHT:"right",JUSTIFIED:"both"};class Ste extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{val:"w:val"})}}class I3 extends Te{constructor(e){super("w:jc"),this.root.push(new Ste({val:e}))}}class jt extends Te{constructor(e,{color:r,size:n,space:i,style:o}){super(e),this.root.push(new kte({style:o,color:r===void 0?void 0:pd(r),size:n===void 0?void 0:vte(n),space:i===void 0?void 0:bte(i)}))}}class kte extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{style:"w:val",color:"w:color",size:"w:sz",space:"w:space"})}}const lk={SINGLE:"single",DASH_DOT_STROKED:"dashDotStroked",DASHED:"dashed",DASH_SMALL_GAP:"dashSmallGap",DOT_DASH:"dotDash",DOT_DOT_DASH:"dotDotDash",DOTTED:"dotted",DOUBLE:"double",DOUBLE_WAVE:"doubleWave",INSET:"inset",NIL:"nil",NONE:"none",OUTSET:"outset",THICK:"thick",THICK_THIN_LARGE_GAP:"thickThinLargeGap",THICK_THIN_MEDIUM_GAP:"thickThinMediumGap",THICK_THIN_SMALL_GAP:"thickThinSmallGap",THIN_THICK_LARGE_GAP:"thinThickLargeGap",THIN_THICK_MEDIUM_GAP:"thinThickMediumGap",THIN_THICK_SMALL_GAP:"thinThickSmallGap",THIN_THICK_THIN_LARGE_GAP:"thinThickThinLargeGap",THIN_THICK_THIN_MEDIUM_GAP:"thinThickThinMediumGap",THIN_THICK_THIN_SMALL_GAP:"thinThickThinSmallGap",THREE_D_EMBOSS:"threeDEmboss",THREE_D_ENGRAVE:"threeDEngrave",TRIPLE:"triple",WAVE:"wave"};class _te extends bs{constructor(e){super("w:pBdr"),e.top&&this.root.push(new jt("w:top",e.top)),e.bottom&&this.root.push(new jt("w:bottom",e.bottom)),e.left&&this.root.push(new jt("w:left",e.left)),e.right&&this.root.push(new jt("w:right",e.right))}}class Cte extends Te{constructor(){super("w:pBdr");const e=new jt("w:bottom",{color:"auto",space:1,style:lk.SINGLE,size:6});this.root.push(e)}}class Ete extends Te{constructor({start:e,end:r,left:n,right:i,hanging:o,firstLine:s}){super("w:ind"),this.root.push(new ws({start:{key:"w:start",value:e===void 0?void 0:as(e)},end:{key:"w:end",value:r===void 0?void 0:as(r)},left:{key:"w:left",value:n===void 0?void 0:as(n)},right:{key:"w:right",value:i===void 0?void 0:as(i)},hanging:{key:"w:hanging",value:o===void 0?void 0:Br(o)},firstLine:{key:"w:firstLine",value:s===void 0?void 0:Br(s)}}))}}let Tte=class extends Te{constructor(){super("w:br")}};const ck={BEGIN:"begin",END:"end",SEPARATE:"separate"};class uk extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{type:"w:fldCharType",dirty:"w:dirty"})}}class Wf extends Te{constructor(e){super("w:fldChar"),this.root.push(new uk({type:ck.BEGIN,dirty:e}))}}class Vf extends Te{constructor(e){super("w:fldChar"),this.root.push(new uk({type:ck.SEPARATE,dirty:e}))}}class Gf extends Te{constructor(e){super("w:fldChar"),this.root.push(new uk({type:ck.END,dirty:e}))}}const Ql={DEFAULT:"default",PRESERVE:"preserve"};class ec extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{space:"xml:space"})}}class Ate extends Te{constructor(){super("w:instrText"),this.root.push(new ec({space:Ql.PRESERVE})),this.root.push("PAGE")}}class Rte extends Te{constructor(){super("w:instrText"),this.root.push(new ec({space:Ql.PRESERVE})),this.root.push("NUMPAGES")}}class Ite extends Te{constructor(){super("w:instrText"),this.root.push(new ec({space:Ql.PRESERVE})),this.root.push("SECTIONPAGES")}}class Ote extends Te{constructor(){super("w:instrText"),this.root.push(new ec({space:Ql.PRESERVE})),this.root.push("SECTION")}}class Mte extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{fill:"w:fill",color:"w:color",type:"w:val"})}}class lv extends Te{constructor({fill:e,color:r,type:n}){super("w:shd"),this.root.push(new Mte({fill:e===void 0?void 0:pd(e),color:r===void 0?void 0:pd(r),type:n}))}}const Nte={CLEAR:"clear",DIAGONAL_CROSS:"diagCross",DIAGONAL_STRIPE:"diagStripe",HORIZONTAL_CROSS:"horzCross",HORIZONTAL_STRIPE:"horzStripe",NIL:"nil",PERCENT_5:"pct5",PERCENT_10:"pct10",PERCENT_12:"pct12",PERCENT_15:"pct15",PERCENT_20:"pct20",PERCENT_25:"pct25",PERCENT_30:"pct30",PERCENT_35:"pct35",PERCENT_37:"pct37",PERCENT_40:"pct40",PERCENT_45:"pct45",PERCENT_50:"pct50",PERCENT_55:"pct55",PERCENT_60:"pct60",PERCENT_62:"pct62",PERCENT_65:"pct65",PERCENT_70:"pct70",PERCENT_75:"pct75",PERCENT_80:"pct80",PERCENT_85:"pct85",PERCENT_87:"pct87",PERCENT_90:"pct90",PERCENT_95:"pct95",REVERSE_DIAGONAL_STRIPE:"reverseDiagStripe",SOLID:"solid",THIN_DIAGONAL_CROSS:"thinDiagCross",THIN_DIAGONAL_STRIPE:"thinDiagStripe",THIN_HORIZONTAL_CROSS:"thinHorzCross",THIN_REVERSE_DIAGONAL_STRIPE:"thinReverseDiagStripe",THIN_VERTICAL_STRIPE:"thinVertStripe",VERTICAL_STRIPE:"vertStripe"};class Dte extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{id:"w:id",author:"w:author",date:"w:date"})}}const Pte={DOT:"dot"};class Lte extends Te{constructor(e){super("w:em"),this.root.push(new sr({val:e}))}}class Fte extends Lte{constructor(e=Pte.DOT){super(e)}}class jte extends Te{constructor(e){super("w:spacing"),this.root.push(new sr({val:as(e)}))}}class Bte extends Te{constructor(e){super("w:color"),this.root.push(new sr({val:pd(e)}))}}class zte extends Te{constructor(e){super("w:highlight"),this.root.push(new sr({val:e}))}}class Hte extends Te{constructor(e){super("w:highlightCs"),this.root.push(new sr({val:e}))}}const $te=t=>new hr({name:"w:lang",attributes:{value:{key:"w:val",value:t.value},eastAsia:{key:"w:eastAsia",value:t.eastAsia},bidirectional:{key:"w:bidi",value:t.bidirectional}}});class zA extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{ascii:"w:ascii",cs:"w:cs",eastAsia:"w:eastAsia",hAnsi:"w:hAnsi",hint:"w:hint"})}}class g0 extends Te{constructor(e,r){if(super("w:rFonts"),typeof e=="string"){const n=e;this.root.push(new zA({ascii:n,cs:n,eastAsia:n,hAnsi:n,hint:r}))}else{const n=e;this.root.push(new zA(n))}}}let O3=class extends Te{constructor(e){super("w:vertAlign"),this.root.push(new sr({val:e}))}};class Ute extends O3{constructor(){super("superscript")}}class Wte extends O3{constructor(){super("subscript")}}const M3={SINGLE:"single",WORDS:"words",DOUBLE:"double",THICK:"thick",DOTTED:"dotted",DOTTEDHEAVY:"dottedHeavy",DASH:"dash",DASHEDHEAVY:"dashedHeavy",DASHLONG:"dashLong",DASHLONGHEAVY:"dashLongHeavy",DOTDASH:"dotDash",DASHDOTHEAVY:"dashDotHeavy",DOTDOTDASH:"dotDotDash",DASHDOTDOTHEAVY:"dashDotDotHeavy",WAVE:"wave",WAVYHEAVY:"wavyHeavy",WAVYDOUBLE:"wavyDouble",NONE:"none"};class Vte extends Te{constructor(e=M3.SINGLE,r){super("w:u"),this.root.push(new sr({val:e,color:r===void 0?void 0:pd(r)}))}}class hc extends bs{constructor(e){var r,n;if(super("w:rPr"),!e)return;e.noProof!==void 0&&this.push(new Be("w:noProof",e.noProof)),e.bold!==void 0&&this.push(new Be("w:b",e.bold)),(e.boldComplexScript===void 0&&e.bold!==void 0||e.boldComplexScript)&&this.push(new Be("w:bCs",(r=e.boldComplexScript)!=null?r:e.bold)),e.italics!==void 0&&this.push(new Be("w:i",e.italics)),(e.italicsComplexScript===void 0&&e.italics!==void 0||e.italicsComplexScript)&&this.push(new Be("w:iCs",(n=e.italicsComplexScript)!=null?n:e.italics)),e.underline&&this.push(new Vte(e.underline.type,e.underline.color)),e.effect&&this.push(new Ul("w:effect",e.effect)),e.emphasisMark&&this.push(new Fte(e.emphasisMark.type)),e.color&&this.push(new Bte(e.color)),e.kern&&this.push(new m0("w:kern",e.kern)),e.position&&this.push(new Ul("w:position",e.position)),e.size!==void 0&&this.push(new m0("w:sz",e.size));const i=e.sizeComplexScript===void 0||e.sizeComplexScript===!0?e.size:e.sizeComplexScript;i&&this.push(new m0("w:szCs",i)),e.rightToLeft!==void 0&&this.push(new Be("w:rtl",e.rightToLeft)),e.smallCaps!==void 0?this.push(new Be("w:smallCaps",e.smallCaps)):e.allCaps!==void 0&&this.push(new Be("w:caps",e.allCaps)),e.strike!==void 0&&this.push(new Be("w:strike",e.strike)),e.doubleStrike!==void 0&&this.push(new Be("w:dstrike",e.doubleStrike)),e.subScript&&this.push(new Wte),e.superScript&&this.push(new Ute),e.style&&this.push(new Ul("w:rStyle",e.style)),e.font&&(typeof e.font=="string"?this.push(new g0(e.font)):"name"in e.font?this.push(new g0(e.font.name,e.font.hint)):this.push(new g0(e.font))),e.highlight&&this.push(new zte(e.highlight));const o=e.highlightComplexScript===void 0||e.highlightComplexScript===!0?e.highlight:e.highlightComplexScript;o&&this.push(new Hte(o)),e.characterSpacing&&this.push(new jte(e.characterSpacing)),e.emboss!==void 0&&this.push(new Be("w:emboss",e.emboss)),e.imprint!==void 0&&this.push(new Be("w:imprint",e.imprint)),e.shading&&this.push(new lv(e.shading)),e.revision&&this.push(new Gte(e.revision)),e.border&&this.push(new jt("w:bdr",e.border)),e.snapToGrid!==void 0&&this.push(new Be("w:snapToGrid",e.snapToGrid)),e.vanish&&this.push(new Be("w:vanish",e.vanish)),e.specVanish&&this.push(new Be("w:specVanish",e.vanish)),e.scale!==void 0&&this.push(new ak("w:w",e.scale)),e.language&&this.push($te(e.language)),e.math&&this.push(new Be("w:oMath",e.math))}push(e){this.root.push(e)}}class Gte extends Te{constructor(e){super("w:rPrChange"),this.root.push(new Dte({id:e.id,author:e.author,date:e.date})),this.addChildElement(new hc(e))}}class c1 extends Te{constructor(e){var r;super("w:t"),typeof e=="string"?(this.root.push(new ec({space:Ql.PRESERVE})),this.root.push(e)):(this.root.push(new ec({space:(r=e.space)!=null?r:Ql.DEFAULT})),this.root.push(e.text))}}const ym={CURRENT:"CURRENT",TOTAL_PAGES:"TOTAL_PAGES",TOTAL_PAGES_IN_SECTION:"TOTAL_PAGES_IN_SECTION",CURRENT_SECTION:"SECTION"};class pc extends Te{constructor(e){if(super("w:r"),Ae(this,"properties"),this.properties=new hc(e),this.root.push(this.properties),e.break)for(let r=0;r<e.break;r++)this.root.push(new Tte);if(e.children)for(const r of e.children){if(typeof r=="string"){switch(r){case ym.CURRENT:this.root.push(new Wf),this.root.push(new Ate),this.root.push(new Vf),this.root.push(new Gf);break;case ym.TOTAL_PAGES:this.root.push(new Wf),this.root.push(new Rte),this.root.push(new Vf),this.root.push(new Gf);break;case ym.TOTAL_PAGES_IN_SECTION:this.root.push(new Wf),this.root.push(new Ite),this.root.push(new Vf),this.root.push(new Gf);break;case ym.CURRENT_SECTION:this.root.push(new Wf),this.root.push(new Ote),this.root.push(new Vf),this.root.push(new Gf);break;default:this.root.push(new c1(r));break}continue}this.root.push(r)}else e.text&&this.root.push(new c1(e.text))}}class Li extends pc{constructor(e){if(typeof e=="string")return super({}),this.root.push(new c1(e)),this;super(e)}}let Kte="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",qte=(t,e=21)=>(r=e)=>{let n="",i=r;for(;i--;)n+=t[Math.random()*t.length|0];return n},Xte=(t=21)=>{let e="",r=t;for(;r--;)e+=Kte[Math.random()*64|0];return e};const zn=t=>Math.floor(t*72*20),cv=(t=0)=>{let e=t;return()=>++e},Yte=()=>cv(),Jte=()=>cv(1),Zte=()=>cv(),Qte=()=>cv(),gy=()=>Xte().toLowerCase(),jf=t=>qte("1234567890abcdef",t)(),ere=()=>`${jf(8)}-${jf(4)}-${jf(4)}-${jf(4)}-${jf(12)}`,tre={CHARACTER:"character",COLUMN:"column",INSIDE_MARGIN:"insideMargin",LEFT_MARGIN:"leftMargin",MARGIN:"margin",OUTSIDE_MARGIN:"outsideMargin",PAGE:"page",RIGHT_MARGIN:"rightMargin"},rre={BOTTOM_MARGIN:"bottomMargin",INSIDE_MARGIN:"insideMargin",LINE:"line",MARGIN:"margin",OUTSIDE_MARGIN:"outsideMargin",PAGE:"page",PARAGRAPH:"paragraph",TOP_MARGIN:"topMargin"};class nre extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{x:"x",y:"y"})}}class ire extends Te{constructor(){super("wp:simplePos"),this.root.push(new nre({x:0,y:0}))}}class N3 extends Te{constructor(e){super("wp:align"),this.root.push(e)}}class D3 extends Te{constructor(e){super("wp:posOffset"),this.root.push(e.toString())}}class ore extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{relativeFrom:"relativeFrom"})}}class sre extends Te{constructor(e){if(super("wp:positionH"),this.root.push(new ore({relativeFrom:e.relative||tre.PAGE})),e.align)this.root.push(new N3(e.align));else if(e.offset!==void 0)this.root.push(new D3(e.offset));else throw new Error("There is no configuration provided for floating position (Align or offset)")}}class are extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{relativeFrom:"relativeFrom"})}}class lre extends Te{constructor(e){if(super("wp:positionV"),this.root.push(new are({relativeFrom:e.relative||rre.PAGE})),e.align)this.root.push(new N3(e.align));else if(e.offset!==void 0)this.root.push(new D3(e.offset));else throw new Error("There is no configuration provided for floating position (Align or offset)")}}class cre extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{uri:"uri"})}}const ure=t=>new hr({name:"asvg:svgBlip",attributes:{asvg:{key:"xmlns:asvg",value:"http://schemas.microsoft.com/office/drawing/2016/SVG/main"},embed:{key:"r:embed",value:`rId{${t.fileName}}`}}}),dre=t=>new hr({name:"a:ext",attributes:{uri:{key:"uri",value:"{96DAC541-7B7A-43D3-8B79-37D633B846F1}"}},children:[ure(t)]}),fre=t=>new hr({name:"a:extLst",children:[dre(t)]}),hre=t=>new hr({name:"a:blip",attributes:{embed:{key:"r:embed",value:`rId{${t.type==="svg"?t.fallback.fileName:t.fileName}}`},cstate:{key:"cstate",value:"none"}},children:t.type==="svg"?[fre(t)]:[]});class pre extends Te{constructor(){super("a:srcRect")}}class mre extends Te{constructor(){super("a:fillRect")}}class gre extends Te{constructor(){super("a:stretch"),this.root.push(new mre)}}class yre extends Te{constructor(e){super("pic:blipFill"),this.root.push(hre(e)),this.root.push(new pre),this.root.push(new gre)}}class vre extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{noChangeAspect:"noChangeAspect",noChangeArrowheads:"noChangeArrowheads"})}}class bre extends Te{constructor(){super("a:picLocks"),this.root.push(new vre({noChangeAspect:1,noChangeArrowheads:1}))}}class wre extends Te{constructor(){super("pic:cNvPicPr"),this.root.push(new bre)}}const P3=(t,e)=>new hr({name:"a:hlinkClick",attributes:Ca(vt({},e?{xmlns:{key:"xmlns:a",value:"http://schemas.openxmlformats.org/drawingml/2006/main"}}:{}),{id:{key:"r:id",value:`rId${t}`}})});class xre extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{id:"id",name:"name",descr:"descr"})}}class Sre extends Te{constructor(){super("pic:cNvPr"),this.root.push(new xre({id:0,name:"",descr:""}))}prepForXml(e){for(let r=e.stack.length-1;r>=0;r--){const n=e.stack[r];if(n instanceof uv){this.root.push(P3(n.linkId,!1));break}}return super.prepForXml(e)}}class kre extends Te{constructor(){super("pic:nvPicPr"),this.root.push(new Sre),this.root.push(new wre)}}class _re extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{xmlns:"xmlns:pic"})}}class Cre extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{cx:"cx",cy:"cy"})}}class Ere extends Te{constructor(e,r){super("a:ext"),Ae(this,"attributes"),this.attributes=new Cre({cx:e,cy:r}),this.root.push(this.attributes)}}class Tre extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{x:"x",y:"y"})}}class Are extends Te{constructor(){super("a:off"),this.root.push(new Tre({x:0,y:0}))}}class Rre extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{flipVertical:"flipV",flipHorizontal:"flipH",rotation:"rot"})}}class Ire extends Te{constructor(e){var r,n;super("a:xfrm"),Ae(this,"extents"),this.root.push(new Rre({flipVertical:(r=e.flip)==null?void 0:r.vertical,flipHorizontal:(n=e.flip)==null?void 0:n.horizontal,rotation:e.rotation})),this.extents=new Ere(e.emus.x,e.emus.y),this.root.push(new Are),this.root.push(this.extents)}}const L3=()=>new hr({name:"a:noFill"}),Ore=t=>new hr({name:"a:schemeClr",attributes:{value:{key:"val",value:t.value}}}),Mre=t=>new hr({name:"a:srgbClr",attributes:{value:{key:"val",value:t.value}}}),HA=t=>new hr({name:"a:solidFill",children:[t.type==="rgb"?Mre(t):Ore(t)]}),Nre=t=>new hr({name:"a:ln",attributes:{width:{key:"w",value:t.width},cap:{key:"cap",value:t.cap},compoundLine:{key:"cmpd",value:t.compoundLine},align:{key:"algn",value:t.align}},children:[t.type==="noFill"?L3():t.solidFillType==="rgb"?HA({type:"rgb",value:t.value}):HA({type:"scheme",value:t.value})]});class Dre extends Te{constructor(){super("a:avLst")}}class Pre extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{prst:"prst"})}}class Lre extends Te{constructor(){super("a:prstGeom"),this.root.push(new Pre({prst:"rect"})),this.root.push(new Dre)}}class Fre extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{bwMode:"bwMode"})}}class jre extends Te{constructor({outline:e,transform:r}){super("pic:spPr"),Ae(this,"form"),this.root.push(new Fre({bwMode:"auto"})),this.form=new Ire(r),this.root.push(this.form),this.root.push(new Lre),e&&(this.root.push(L3()),this.root.push(Nre(e)))}}class Bre extends Te{constructor({mediaData:e,transform:r,outline:n}){super("pic:pic"),this.root.push(new _re({xmlns:"http://schemas.openxmlformats.org/drawingml/2006/picture"})),this.root.push(new kre),this.root.push(new yre(e)),this.root.push(new jre({transform:r,outline:n}))}}class zre extends Te{constructor({mediaData:e,transform:r,outline:n}){super("a:graphicData"),Ae(this,"pic"),this.root.push(new cre({uri:"http://schemas.openxmlformats.org/drawingml/2006/picture"})),this.pic=new Bre({mediaData:e,transform:r,outline:n}),this.root.push(this.pic)}}class Hre extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{a:"xmlns:a"})}}class F3 extends Te{constructor({mediaData:e,transform:r,outline:n}){super("a:graphic"),Ae(this,"data"),this.root.push(new Hre({a:"http://schemas.openxmlformats.org/drawingml/2006/main"})),this.data=new zre({mediaData:e,transform:r,outline:n}),this.root.push(this.data)}}const vm={NONE:0,SQUARE:1,TIGHT:2,TOP_AND_BOTTOM:3},$re={BOTH_SIDES:"bothSides",LEFT:"left",RIGHT:"right",LARGEST:"largest"};class $A extends Te{constructor(){super("wp:wrapNone")}}class Ure extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{distT:"distT",distB:"distB",distL:"distL",distR:"distR",wrapText:"wrapText"})}}class Wre extends Te{constructor(e,r={top:0,bottom:0,left:0,right:0}){super("wp:wrapSquare"),this.root.push(new Ure({wrapText:e.side||$re.BOTH_SIDES,distT:r.top,distB:r.bottom,distL:r.left,distR:r.right}))}}class Vre extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{distT:"distT",distB:"distB"})}}class Gre extends Te{constructor(e={top:0,bottom:0}){super("wp:wrapTight"),this.root.push(new Vre({distT:e.top,distB:e.bottom}))}}class Kre extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{distT:"distT",distB:"distB"})}}class qre extends Te{constructor(e={top:0,bottom:0}){super("wp:wrapTopAndBottom"),this.root.push(new Kre({distT:e.top,distB:e.bottom}))}}class j3 extends Te{constructor({name:e,description:r,title:n}={name:"",description:"",title:""}){super("wp:docPr"),Ae(this,"docPropertiesUniqueNumericId",Zte()),this.root.push(new ws({id:{key:"id",value:this.docPropertiesUniqueNumericId()},name:{key:"name",value:e},description:{key:"descr",value:r},title:{key:"title",value:n}}))}prepForXml(e){for(let r=e.stack.length-1;r>=0;r--){const n=e.stack[r];if(n instanceof uv){this.root.push(P3(n.linkId,!0));break}}return super.prepForXml(e)}}const B3=({top:t,right:e,bottom:r,left:n})=>new hr({name:"wp:effectExtent",attributes:{top:{key:"t",value:t},right:{key:"r",value:e},bottom:{key:"b",value:r},left:{key:"l",value:n}}});class Xre extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{cx:"cx",cy:"cy"})}}class z3 extends Te{constructor(e,r){super("wp:extent"),Ae(this,"attributes"),this.attributes=new Xre({cx:e,cy:r}),this.root.push(this.attributes)}}class Yre extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{xmlns:"xmlns:a",noChangeAspect:"noChangeAspect"})}}class Jre extends Te{constructor(){super("a:graphicFrameLocks"),this.root.push(new Yre({xmlns:"http://schemas.openxmlformats.org/drawingml/2006/main",noChangeAspect:1}))}}class H3 extends Te{constructor(){super("wp:cNvGraphicFramePr"),this.root.push(new Jre)}}class Zre extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{distT:"distT",distB:"distB",distL:"distL",distR:"distR",allowOverlap:"allowOverlap",behindDoc:"behindDoc",layoutInCell:"layoutInCell",locked:"locked",relativeHeight:"relativeHeight",simplePos:"simplePos"})}}class Qre extends Te{constructor({mediaData:e,transform:r,drawingOptions:n}){super("wp:anchor");const i=vt({allowOverlap:!0,behindDocument:!1,lockAnchor:!1,layoutInCell:!0,verticalPosition:{},horizontalPosition:{}},n.floating);if(this.root.push(new Zre({distT:i.margins&&i.margins.top||0,distB:i.margins&&i.margins.bottom||0,distL:i.margins&&i.margins.left||0,distR:i.margins&&i.margins.right||0,simplePos:"0",allowOverlap:i.allowOverlap===!0?"1":"0",behindDoc:i.behindDocument===!0?"1":"0",locked:i.lockAnchor===!0?"1":"0",layoutInCell:i.layoutInCell===!0?"1":"0",relativeHeight:i.zIndex?i.zIndex:r.emus.y})),this.root.push(new ire),this.root.push(new sre(i.horizontalPosition)),this.root.push(new lre(i.verticalPosition)),this.root.push(new z3(r.emus.x,r.emus.y)),this.root.push(B3({top:0,right:0,bottom:0,left:0})),n.floating!==void 0&&n.floating.wrap!==void 0)switch(n.floating.wrap.type){case vm.SQUARE:this.root.push(new Wre(n.floating.wrap,n.floating.margins));break;case vm.TIGHT:this.root.push(new Gre(n.floating.margins));break;case vm.TOP_AND_BOTTOM:this.root.push(new qre(n.floating.margins));break;case vm.NONE:default:this.root.push(new $A)}else this.root.push(new $A);this.root.push(new j3(n.docProperties)),this.root.push(new H3),this.root.push(new F3({mediaData:e,transform:r,outline:n.outline}))}}const ene=({mediaData:t,transform:e,docProperties:r,outline:n})=>{var i,o,s,a;return new hr({name:"wp:inline",attributes:{distanceTop:{key:"distT",value:0},distanceBottom:{key:"distB",value:0},distanceLeft:{key:"distL",value:0},distanceRight:{key:"distR",value:0}},children:[new z3(e.emus.x,e.emus.y),B3(n?{top:((i=n.width)!=null?i:9525)*2,right:((o=n.width)!=null?o:9525)*2,bottom:((s=n.width)!=null?s:9525)*2,left:((a=n.width)!=null?a:9525)*2}:{top:0,right:0,bottom:0,left:0}),new j3(r),new H3,new F3({mediaData:t,transform:e,outline:n})]})};class tne extends Te{constructor(e,r={}){super("w:drawing"),r.floating?this.root.push(new Qre({mediaData:e,transform:e.transformation,drawingOptions:r})):this.root.push(ene({mediaData:e,transform:e.transformation,docProperties:r.docProperties,outline:r.outline}))}}const rne=t=>{if(typeof atob=="function"){const e=";base64,",r=t.indexOf(e),n=r===-1?0:r+e.length;return new Uint8Array(atob(t.substring(n)).split("").map(i=>i.charCodeAt(0)))}else{const e=require("buffer");return new e.Buffer(t,"base64")}},nne=t=>typeof t=="string"?rne(t):t,y0=(t,e)=>({data:nne(t.data),fileName:e,transformation:{pixels:{x:Math.round(t.transformation.width),y:Math.round(t.transformation.height)},emus:{x:Math.round(t.transformation.width*9525),y:Math.round(t.transformation.height*9525)},flip:t.transformation.flip,rotation:t.transformation.rotation?t.transformation.rotation*6e4:void 0}});class ine extends pc{constructor(e){super({}),Ae(this,"key"),Ae(this,"fallbackKey",`${gy()}.png`),Ae(this,"imageData"),this.key=`${gy()}.${e.type}`,this.imageData=e.type==="svg"?Ca(vt({type:e.type},y0(e,this.key)),{fallback:vt({type:e.fallback.type},y0(Ca(vt({},e.fallback),{transformation:e.transformation}),this.fallbackKey))}):vt({type:e.type},y0(e,this.key));const r=new tne(this.imageData,{floating:e.floating,docProperties:e.altText,outline:e.outline});this.root.push(r)}prepForXml(e){return e.file.Media.addImage(this.key,this.imageData),this.imageData.type==="svg"&&e.file.Media.addImage(this.fallbackKey,this.imageData.fallback),super.prepForXml(e)}}class one extends Te{constructor(e){super("w:instrText"),this.root.push(new ec({space:Ql.PRESERVE})),this.root.push(`SEQ ${e}`)}}class sne extends pc{constructor(e){super({}),this.root.push(new Wf(!0)),this.root.push(new one(e)),this.root.push(new Vf),this.root.push(new Gf)}}class ane extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{instr:"w:instr"})}}class lne extends Te{constructor(e,r){super("w:fldSimple"),this.root.push(new ane({instr:e})),r!==void 0&&this.root.push(new Li(r))}}class cne extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{id:"w:id",initials:"w:initials",author:"w:author",date:"w:date"})}}class une extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{"xmlns:cx":"xmlns:cx","xmlns:cx1":"xmlns:cx1","xmlns:cx2":"xmlns:cx2","xmlns:cx3":"xmlns:cx3","xmlns:cx4":"xmlns:cx4","xmlns:cx5":"xmlns:cx5","xmlns:cx6":"xmlns:cx6","xmlns:cx7":"xmlns:cx7","xmlns:cx8":"xmlns:cx8","xmlns:mc":"xmlns:mc","xmlns:aink":"xmlns:aink","xmlns:am3d":"xmlns:am3d","xmlns:o":"xmlns:o","xmlns:r":"xmlns:r","xmlns:m":"xmlns:m","xmlns:v":"xmlns:v","xmlns:wp14":"xmlns:wp14","xmlns:wp":"xmlns:wp","xmlns:w10":"xmlns:w10","xmlns:w":"xmlns:w","xmlns:w14":"xmlns:w14","xmlns:w15":"xmlns:w15","xmlns:w16cex":"xmlns:w16cex","xmlns:w16cid":"xmlns:w16cid","xmlns:w16":"xmlns:w16","xmlns:w16sdtdh":"xmlns:w16sdtdh","xmlns:w16se":"xmlns:w16se","xmlns:wpg":"xmlns:wpg","xmlns:wpi":"xmlns:wpi","xmlns:wne":"xmlns:wne","xmlns:wps":"xmlns:wps"})}}class dne extends Te{constructor({id:e,initials:r,author:n,date:i=new Date,children:o}){super("w:comment"),this.root.push(new cne({id:e,initials:r,author:n,date:i.toISOString()}));for(const s of o)this.root.push(s)}}class fne extends Te{constructor({children:e}){super("w:comments"),this.root.push(new une({"xmlns:cx":"http://schemas.microsoft.com/office/drawing/2014/chartex","xmlns:cx1":"http://schemas.microsoft.com/office/drawing/2015/9/8/chartex","xmlns:cx2":"http://schemas.microsoft.com/office/drawing/2015/10/21/chartex","xmlns:cx3":"http://schemas.microsoft.com/office/drawing/2016/5/9/chartex","xmlns:cx4":"http://schemas.microsoft.com/office/drawing/2016/5/10/chartex","xmlns:cx5":"http://schemas.microsoft.com/office/drawing/2016/5/11/chartex","xmlns:cx6":"http://schemas.microsoft.com/office/drawing/2016/5/12/chartex","xmlns:cx7":"http://schemas.microsoft.com/office/drawing/2016/5/13/chartex","xmlns:cx8":"http://schemas.microsoft.com/office/drawing/2016/5/14/chartex","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","xmlns:aink":"http://schemas.microsoft.com/office/drawing/2016/ink","xmlns:am3d":"http://schemas.microsoft.com/office/drawing/2017/model3d","xmlns:o":"urn:schemas-microsoft-com:office:office","xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","xmlns:m":"http://schemas.openxmlformats.org/officeDocument/2006/math","xmlns:v":"urn:schemas-microsoft-com:vml","xmlns:wp14":"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing","xmlns:wp":"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing","xmlns:w10":"urn:schemas-microsoft-com:office:word","xmlns:w":"http://schemas.openxmlformats.org/wordprocessingml/2006/main","xmlns:w14":"http://schemas.microsoft.com/office/word/2010/wordml","xmlns:w15":"http://schemas.microsoft.com/office/word/2012/wordml","xmlns:w16cex":"http://schemas.microsoft.com/office/word/2018/wordml/cex","xmlns:w16cid":"http://schemas.microsoft.com/office/word/2016/wordml/cid","xmlns:w16":"http://schemas.microsoft.com/office/word/2018/wordml","xmlns:w16sdtdh":"http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash","xmlns:w16se":"http://schemas.microsoft.com/office/word/2015/wordml/symex","xmlns:wpg":"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup","xmlns:wpi":"http://schemas.microsoft.com/office/word/2010/wordprocessingInk","xmlns:wne":"http://schemas.microsoft.com/office/word/2006/wordml","xmlns:wps":"http://schemas.microsoft.com/office/word/2010/wordprocessingShape"}));for(const r of e)this.root.push(new dne(r))}}class hne extends Te{constructor(){super("w:pageBreakBefore")}}const u1={AT_LEAST:"atLeast",EXACTLY:"exactly",EXACT:"exact",AUTO:"auto"};class pne extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{after:"w:after",before:"w:before",line:"w:line",lineRule:"w:lineRule"})}}class mne extends Te{constructor(e){super("w:spacing"),this.root.push(new pne(e))}}const xu={HEADING_1:"Heading1",HEADING_2:"Heading2",HEADING_3:"Heading3",HEADING_4:"Heading4",HEADING_5:"Heading5",HEADING_6:"Heading6",TITLE:"Title"};let bm=class extends Te{constructor(e){super("w:pStyle"),this.root.push(new sr({val:e}))}};class gne extends Te{constructor(e){super("w:tabs");for(const r of e)this.root.push(new vne(r))}}const yy={LEFT:"left",RIGHT:"right",CENTER:"center",BAR:"bar",CLEAR:"clear",DECIMAL:"decimal",END:"end",NUM:"num",START:"start"},UA={MAX:9026};class yne extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{val:"w:val",pos:"w:pos",leader:"w:leader"})}}class vne extends Te{constructor({type:e,position:r,leader:n}){super("w:tab"),this.root.push(new yne({val:e,pos:r,leader:n}))}}class v0 extends Te{constructor(e,r){super("w:numPr"),this.root.push(new bne(r)),this.root.push(new wne(e))}}class bne extends Te{constructor(e){if(super("w:ilvl"),e>9)throw new Error("Level cannot be greater than 9. Read more here: https://answers.microsoft.com/en-us/msoffice/forum/all/does-word-support-more-than-9-list-levels/d130fdcd-1781-446d-8c84-c6c79124e4d7");this.root.push(new sr({val:e}))}}class wne extends Te{constructor(e){super("w:numId"),this.root.push(new sr({val:typeof e=="string"?`{${e}}`:e}))}}class $3 extends Te{constructor(){super(...arguments),Ae(this,"fileChild",Symbol())}}class xne extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{id:"Id",type:"Type",target:"Target",targetMode:"TargetMode"})}}const Sne={EXTERNAL:"External"};class kne extends Te{constructor(e,r,n,i){super("Relationship"),this.root.push(new xne({id:e,type:r,target:n,targetMode:i}))}}class _ne extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{id:"r:id",history:"w:history",anchor:"w:anchor"})}}class uv extends Te{constructor(e,r,n){super("w:hyperlink"),Ae(this,"linkId"),this.linkId=r;const i={history:1,anchor:n||void 0,id:n?void 0:`rId${this.linkId}`},o=new _ne(i);this.root.push(o),e.forEach(s=>{this.root.push(s)})}}class Cne extends uv{constructor(e){super(e.children,gy(),e.anchor)}}class U3 extends Te{constructor(e){super("w:externalHyperlink"),this.options=e}}class Ene extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{id:"w:id",name:"w:name"})}}class Tne extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{id:"w:id"})}}class W3{constructor(e){Ae(this,"bookmarkUniqueNumericId",Qte()),Ae(this,"start"),Ae(this,"children"),Ae(this,"end");const r=this.bookmarkUniqueNumericId();this.start=new Ane(e.id,r),this.children=e.children,this.end=new Rne(r)}}class Ane extends Te{constructor(e,r){super("w:bookmarkStart");const n=new Ene({name:e,id:r});this.root.push(n)}}class Rne extends Te{constructor(e){super("w:bookmarkEnd");const r=new Tne({id:e});this.root.push(r)}}class Ine extends Te{constructor(e){super("w:outlineLvl"),this.level=e,this.root.push(new sr({val:e}))}}class One extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{verticalAlign:"w:val"})}}class V3 extends Te{constructor(e){super("w:vAlign"),this.root.push(new One({verticalAlign:e}))}}const Gu={DEFAULT:"default",FIRST:"first",EVEN:"even"};class Mne extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{type:"w:type",id:"r:id"})}}const WA={HEADER:"w:headerReference",FOOTER:"w:footerReference"};class b0 extends Te{constructor(e,r){super(e),this.root.push(new Mne({type:r.type||Gu.DEFAULT,id:`rId${r.id}`}))}}class Nne extends Te{constructor({space:e,count:r,separate:n,equalWidth:i,children:o}){super("w:cols"),this.root.push(new ws({space:{key:"w:space",value:e===void 0?void 0:Br(e)},count:{key:"w:num",value:r===void 0?void 0:Zr(r)},separate:{key:"w:sep",value:n},equalWidth:{key:"w:equalWidth",value:i}})),!i&&o&&o.forEach(s=>this.addChildElement(s))}}class Dne extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{type:"w:type",linePitch:"w:linePitch",charSpace:"w:charSpace"})}}class Pne extends Te{constructor(e,r,n){super("w:docGrid"),this.root.push(new Dne({type:n,linePitch:Zr(e),charSpace:r?Zr(r):void 0}))}}const Lne=({countBy:t,start:e,restart:r,distance:n})=>new hr({name:"w:lnNumType",attributes:{countBy:{key:"w:countBy",value:t===void 0?void 0:Zr(t)},start:{key:"w:start",value:e===void 0?void 0:Zr(e)},restart:{key:"w:restart",value:r},distance:{key:"w:distance",value:n===void 0?void 0:Br(n)}}});class VA extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{display:"w:display",offsetFrom:"w:offsetFrom",zOrder:"w:zOrder"})}}class Fne extends bs{constructor(e){if(super("w:pgBorders"),!e)return this;e.pageBorders?this.root.push(new VA({display:e.pageBorders.display,offsetFrom:e.pageBorders.offsetFrom,zOrder:e.pageBorders.zOrder})):this.root.push(new VA({})),e.pageBorderTop&&this.root.push(new jt("w:top",e.pageBorderTop)),e.pageBorderLeft&&this.root.push(new jt("w:left",e.pageBorderLeft)),e.pageBorderBottom&&this.root.push(new jt("w:bottom",e.pageBorderBottom)),e.pageBorderRight&&this.root.push(new jt("w:right",e.pageBorderRight))}}class jne extends Te{constructor(e,r,n,i,o,s,a){super("w:pgMar"),this.root.push(new ws({top:{key:"w:top",value:as(e)},right:{key:"w:right",value:Br(r)},bottom:{key:"w:bottom",value:as(n)},left:{key:"w:left",value:Br(i)},header:{key:"w:header",value:Br(o)},footer:{key:"w:footer",value:Br(s)},gutter:{key:"w:gutter",value:Br(a)}}))}}class Bne extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{start:"w:start",formatType:"w:fmt",separator:"w:chapSep"})}}class zne extends Te{constructor({start:e,formatType:r,separator:n}){super("w:pgNumType"),this.root.push(new Bne({start:e===void 0?void 0:Zr(e),formatType:r,separator:n}))}}const G3={PORTRAIT:"portrait",LANDSCAPE:"landscape"};class Hne extends Te{constructor(e,r,n){super("w:pgSz");const i=n===G3.LANDSCAPE,o=Br(e),s=Br(r);this.root.push(new ws({width:{key:"w:w",value:i?s:o},height:{key:"w:h",value:i?o:s},orientation:{key:"w:orient",value:n}}))}}class $ne extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{val:"w:val"})}}class Une extends Te{constructor(e){super("w:textDirection"),this.root.push(new $ne({val:e}))}}const Wne={NEXT_PAGE:"nextPage",NEXT_COLUMN:"nextColumn",CONTINUOUS:"continuous",EVEN_PAGE:"evenPage",ODD_PAGE:"oddPage"};class Vne extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{val:"w:val"})}}class Gne extends Te{constructor(e){super("w:type"),this.root.push(new Vne({val:e}))}}const xl={TOP:1440,RIGHT:1440,BOTTOM:1440,LEFT:1440,HEADER:708,FOOTER:708,GUTTER:0},w0={WIDTH:11906,HEIGHT:16838,ORIENTATION:G3.PORTRAIT};class Kne extends Te{constructor({page:{size:{width:e=w0.WIDTH,height:r=w0.HEIGHT,orientation:n=w0.ORIENTATION}={},margin:{top:i=xl.TOP,right:o=xl.RIGHT,bottom:s=xl.BOTTOM,left:a=xl.LEFT,header:l=xl.HEADER,footer:c=xl.FOOTER,gutter:d=xl.GUTTER}={},pageNumbers:f={},borders:p,textDirection:m}={},grid:{linePitch:g=360,charSpace:b,type:S}={},headerWrapperGroup:w={},footerWrapperGroup:T={},lineNumbers:M,titlePage:j,verticalAlign:$,column:W,type:Y}={}){super("w:sectPr"),this.addHeaderFooterGroup(WA.HEADER,w),this.addHeaderFooterGroup(WA.FOOTER,T),Y&&this.root.push(new Gne(Y)),this.root.push(new Hne(e,r,n)),this.root.push(new jne(i,o,s,a,l,c,d)),p&&this.root.push(new Fne(p)),M&&this.root.push(Lne(M)),this.root.push(new zne(f)),W&&this.root.push(new Nne(W)),$&&this.root.push(new V3($)),j!==void 0&&this.root.push(new Be("w:titlePg",j)),m&&this.root.push(new Une(m)),this.root.push(new Pne(g,b,S))}addHeaderFooterGroup(e,r){r.default&&this.root.push(new b0(e,{type:Gu.DEFAULT,id:r.default.View.ReferenceId})),r.first&&this.root.push(new b0(e,{type:Gu.FIRST,id:r.first.View.ReferenceId})),r.even&&this.root.push(new b0(e,{type:Gu.EVEN,id:r.even.View.ReferenceId}))}}class qne extends Te{constructor(){super("w:body"),Ae(this,"sections",[])}addSection(e){const r=this.sections.pop();this.root.push(this.createSectionParagraph(r)),this.sections.push(new Kne(e))}prepForXml(e){return this.sections.length===1&&(this.root.splice(0,1),this.root.push(this.sections.pop())),super.prepForXml(e)}push(e){this.root.push(e)}createSectionParagraph(e){const r=new ba({}),n=new md({});return n.push(e),r.addChildElement(n),r}}class Jh extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{wpc:"xmlns:wpc",mc:"xmlns:mc",o:"xmlns:o",r:"xmlns:r",m:"xmlns:m",v:"xmlns:v",wp14:"xmlns:wp14",wp:"xmlns:wp",w10:"xmlns:w10",w:"xmlns:w",w14:"xmlns:w14",w15:"xmlns:w15",wpg:"xmlns:wpg",wpi:"xmlns:wpi",wne:"xmlns:wne",wps:"xmlns:wps",Ignorable:"mc:Ignorable",cp:"xmlns:cp",dc:"xmlns:dc",dcterms:"xmlns:dcterms",dcmitype:"xmlns:dcmitype",xsi:"xmlns:xsi",type:"xsi:type",cx:"xmlns:cx",cx1:"xmlns:cx1",cx2:"xmlns:cx2",cx3:"xmlns:cx3",cx4:"xmlns:cx4",cx5:"xmlns:cx5",cx6:"xmlns:cx6",cx7:"xmlns:cx7",cx8:"xmlns:cx8",aink:"xmlns:aink",am3d:"xmlns:am3d",w16cex:"xmlns:w16cex",w16cid:"xmlns:w16cid",w16:"xmlns:w16",w16sdtdh:"xmlns:w16sdtdh",w16se:"xmlns:w16se"})}}class Xne extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{color:"w:color",themeColor:"w:themeColor",themeShade:"w:themeShade",themeTint:"w:themeTint"})}}class Yne extends Te{constructor(e){super("w:background"),this.root.push(new Xne({color:e.color===void 0?void 0:pd(e.color),themeColor:e.themeColor,themeShade:e.themeShade===void 0?void 0:BA(e.themeShade),themeTint:e.themeTint===void 0?void 0:BA(e.themeTint)}))}}class Jne extends Te{constructor(e){super("w:document"),Ae(this,"body"),this.root.push(new Jh({wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape",cx:"http://schemas.microsoft.com/office/drawing/2014/chartex",cx1:"http://schemas.microsoft.com/office/drawing/2015/9/8/chartex",cx2:"http://schemas.microsoft.com/office/drawing/2015/10/21/chartex",cx3:"http://schemas.microsoft.com/office/drawing/2016/5/9/chartex",cx4:"http://schemas.microsoft.com/office/drawing/2016/5/10/chartex",cx5:"http://schemas.microsoft.com/office/drawing/2016/5/11/chartex",cx6:"http://schemas.microsoft.com/office/drawing/2016/5/12/chartex",cx7:"http://schemas.microsoft.com/office/drawing/2016/5/13/chartex",cx8:"http://schemas.microsoft.com/office/drawing/2016/5/14/chartex",aink:"http://schemas.microsoft.com/office/drawing/2016/ink",am3d:"http://schemas.microsoft.com/office/drawing/2017/model3d",w16cex:"http://schemas.microsoft.com/office/word/2018/wordml/cex",w16cid:"http://schemas.microsoft.com/office/word/2016/wordml/cid",w16:"http://schemas.microsoft.com/office/word/2018/wordml",w16sdtdh:"http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash",w16se:"http://schemas.microsoft.com/office/word/2015/wordml/symex",Ignorable:"w14 w15 wp14"})),this.body=new qne,e.background&&this.root.push(new Yne(e.background)),this.root.push(this.body)}add(e){return this.body.push(e),this}get Body(){return this.body}}class Zne extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{xmlns:"xmlns"})}}class Md extends Te{constructor(){super("Relationships"),this.root.push(new Zne({xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"}))}createRelationship(e,r,n,i){const o=new kne(`rId${e}`,r,n,i);return this.root.push(o),o}get RelationshipCount(){return this.root.length-1}}class K3{constructor(e){Ae(this,"document"),Ae(this,"relationships"),this.document=new Jne(e),this.relationships=new Md}get View(){return this.document}get Relationships(){return this.relationships}}class Qne extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{val:"w:val"})}}class eie extends Te{constructor(){super("w:wordWrap"),this.root.push(new Qne({val:0}))}}const tie=t=>{var e,r;return new hr({name:"w:framePr",attributes:{anchorLock:{key:"w:anchorLock",value:t.anchorLock},dropCap:{key:"w:dropCap",value:t.dropCap},width:{key:"w:w",value:t.width},height:{key:"w:h",value:t.height},x:{key:"w:x",value:t.position?t.position.x:void 0},y:{key:"w:y",value:t.position?t.position.y:void 0},anchorHorizontal:{key:"w:hAnchor",value:t.anchor.horizontal},anchorVertical:{key:"w:vAnchor",value:t.anchor.vertical},spaceHorizontal:{key:"w:hSpace",value:(e=t.space)==null?void 0:e.horizontal},spaceVertical:{key:"w:vSpace",value:(r=t.space)==null?void 0:r.vertical},rule:{key:"w:hRule",value:t.rule},alignmentX:{key:"w:xAlign",value:t.alignment?t.alignment.x:void 0},alignmentY:{key:"w:yAlign",value:t.alignment?t.alignment.y:void 0},lines:{key:"w:lines",value:t.lines},wrap:{key:"w:wrap",value:t.wrap}}})};class md extends bs{constructor(e){var r,n;if(super("w:pPr"),Ae(this,"numberingReferences",[]),!e)return this;e.heading&&this.push(new bm(e.heading)),e.bullet&&this.push(new bm("ListParagraph")),e.numbering&&!e.style&&!e.heading&&(e.numbering.custom||this.push(new bm("ListParagraph"))),e.style&&this.push(new bm(e.style)),e.keepNext!==void 0&&this.push(new Be("w:keepNext",e.keepNext)),e.keepLines!==void 0&&this.push(new Be("w:keepLines",e.keepLines)),e.pageBreakBefore&&this.push(new hne),e.frame&&this.push(tie(e.frame)),e.widowControl!==void 0&&this.push(new Be("w:widowControl",e.widowControl)),e.bullet&&this.push(new v0(1,e.bullet.level)),e.numbering?(this.numberingReferences.push({reference:e.numbering.reference,instance:(r=e.numbering.instance)!=null?r:0}),this.push(new v0(`${e.numbering.reference}-${(n=e.numbering.instance)!=null?n:0}`,e.numbering.level))):e.numbering===!1&&this.push(new v0(0,0)),e.border&&this.push(new _te(e.border)),e.thematicBreak&&this.push(new Cte),e.shading&&this.push(new lv(e.shading)),e.wordWrap&&this.push(new eie),e.overflowPunctuation&&this.push(new Be("w:overflowPunct",e.overflowPunctuation));const i=[...e.rightTabStop!==void 0?[{type:yy.RIGHT,position:e.rightTabStop}]:[],...e.tabStops?e.tabStops:[],...e.leftTabStop!==void 0?[{type:yy.LEFT,position:e.leftTabStop}]:[]];i.length>0&&this.push(new gne(i)),e.bidirectional!==void 0&&this.push(new Be("w:bidi",e.bidirectional)),e.spacing&&this.push(new mne(e.spacing)),e.indent&&this.push(new Ete(e.indent)),e.contextualSpacing!==void 0&&this.push(new Be("w:contextualSpacing",e.contextualSpacing)),e.alignment&&this.push(new I3(e.alignment)),e.outlineLevel!==void 0&&this.push(new Ine(e.outlineLevel)),e.suppressLineNumbers!==void 0&&this.push(new Be("w:suppressLineNumbers",e.suppressLineNumbers)),e.autoSpaceEastAsianText!==void 0&&this.push(new Be("w:autoSpaceDN",e.autoSpaceEastAsianText)),e.run&&this.push(new hc(e.run))}push(e){this.root.push(e)}prepForXml(e){if(e.viewWrapper instanceof K3)for(const r of this.numberingReferences)e.file.Numbering.createConcreteNumberingInstance(r.reference,r.instance);return super.prepForXml(e)}}class ba extends $3{constructor(e){if(super("w:p"),Ae(this,"properties"),typeof e=="string")return this.properties=new md({}),this.root.push(this.properties),this.root.push(new Li(e)),this;if(this.properties=new md(e),this.root.push(this.properties),e.text&&this.root.push(new Li(e.text)),e.children)for(const r of e.children){if(r instanceof W3){this.root.push(r.start);for(const n of r.children)this.root.push(n);this.root.push(r.end);continue}this.root.push(r)}}prepForXml(e){for(const r of this.root)if(r instanceof U3){const n=this.root.indexOf(r),i=new uv(r.options.children,gy());e.viewWrapper.Relationships.createRelationship(i.linkId,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",r.options.link,Sne.EXTERNAL),this.root[n]=i}return super.prepForXml(e)}addRunToFront(e){return this.root.splice(1,0,e),this}}let GA=class extends Te{constructor(e){super("m:oMath");for(const r of e.children)this.root.push(r)}};class rie extends Te{constructor(e){super("m:t"),this.root.push(e)}}class KA extends Te{constructor(e){super("m:r"),this.root.push(new rie(e))}}class nie extends Te{constructor(e){super("w:tblGrid");for(const r of e)this.root.push(new iie(r))}}class iie extends Te{constructor(e){super("w:gridCol"),e!==void 0&&this.root.push(new ws({width:{key:"w:w",value:Br(e)}}))}}const q3={TABLE:"w:tblCellMar",TABLE_CELL:"w:tcMar"};class X3 extends bs{constructor(e,{marginUnitType:r=d1.DXA,top:n,left:i,bottom:o,right:s}){super(e),n!==void 0&&this.root.push(new Pl("w:top",{type:r,size:n})),i!==void 0&&this.root.push(new Pl("w:left",{type:r,size:i})),o!==void 0&&this.root.push(new Pl("w:bottom",{type:r,size:o})),s!==void 0&&this.root.push(new Pl("w:right",{type:r,size:s}))}}const d1={AUTO:"auto",DXA:"dxa",NIL:"nil",PERCENTAGE:"pct"};class Pl extends Te{constructor(e,{type:r=d1.AUTO,size:n}){super(e);let i=n;r===d1.PERCENTAGE&&typeof n=="number"&&(i=`${n}%`),this.root.push(new ws({type:{key:"w:type",value:r},size:{key:"w:w",value:yte(i)}}))}}class oie extends bs{constructor(e){super("w:tcBorders"),e.top&&this.root.push(new jt("w:top",e.top)),e.start&&this.root.push(new jt("w:start",e.start)),e.left&&this.root.push(new jt("w:left",e.left)),e.bottom&&this.root.push(new jt("w:bottom",e.bottom)),e.end&&this.root.push(new jt("w:end",e.end)),e.right&&this.root.push(new jt("w:right",e.right))}}class sie extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{val:"w:val"})}}class aie extends Te{constructor(e){super("w:gridSpan"),this.root.push(new sie({val:Zr(e)}))}}const Y3={CONTINUE:"continue",RESTART:"restart"};class lie extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{val:"w:val"})}}class qA extends Te{constructor(e){super("w:vMerge"),this.root.push(new lie({val:e}))}}class cie extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{val:"w:val"})}}class uie extends Te{constructor(e){super("w:textDirection"),this.root.push(new cie({val:e}))}}class die extends bs{constructor(e){super("w:tcPr"),e.width&&this.root.push(new Pl("w:tcW",e.width)),e.columnSpan&&this.root.push(new aie(e.columnSpan)),e.verticalMerge?this.root.push(new qA(e.verticalMerge)):e.rowSpan&&e.rowSpan>1&&this.root.push(new qA(Y3.RESTART)),e.borders&&this.root.push(new oie(e.borders)),e.shading&&this.root.push(new lv(e.shading)),e.margins&&this.root.push(new X3(q3.TABLE_CELL,e.margins)),e.textDirection&&this.root.push(new uie(e.textDirection)),e.verticalAlign&&this.root.push(new V3(e.verticalAlign))}}class dk extends Te{constructor(e){super("w:tc"),this.options=e,this.root.push(new die(e));for(const r of e.children)this.root.push(r)}prepForXml(e){return this.root[this.root.length-1]instanceof ba||this.root.push(new ba({})),super.prepForXml(e)}}const Su={style:lk.NONE,size:0,color:"auto"},ku={style:lk.SINGLE,size:4,color:"auto"};class J3 extends Te{constructor(e){super("w:tblBorders"),e.top?this.root.push(new jt("w:top",e.top)):this.root.push(new jt("w:top",ku)),e.left?this.root.push(new jt("w:left",e.left)):this.root.push(new jt("w:left",ku)),e.bottom?this.root.push(new jt("w:bottom",e.bottom)):this.root.push(new jt("w:bottom",ku)),e.right?this.root.push(new jt("w:right",e.right)):this.root.push(new jt("w:right",ku)),e.insideHorizontal?this.root.push(new jt("w:insideH",e.insideHorizontal)):this.root.push(new jt("w:insideH",ku)),e.insideVertical?this.root.push(new jt("w:insideV",e.insideVertical)):this.root.push(new jt("w:insideV",ku))}}Ae(J3,"NONE",{top:Su,bottom:Su,left:Su,right:Su,insideHorizontal:Su,insideVertical:Su});class fie extends Te{constructor({horizontalAnchor:e,verticalAnchor:r,absoluteHorizontalPosition:n,relativeHorizontalPosition:i,absoluteVerticalPosition:o,relativeVerticalPosition:s,bottomFromText:a,topFromText:l,leftFromText:c,rightFromText:d,overlap:f}){super("w:tblpPr"),this.root.push(new ws({leftFromText:{key:"w:leftFromText",value:c===void 0?void 0:Br(c)},rightFromText:{key:"w:rightFromText",value:d===void 0?void 0:Br(d)},topFromText:{key:"w:topFromText",value:l===void 0?void 0:Br(l)},bottomFromText:{key:"w:bottomFromText",value:a===void 0?void 0:Br(a)},absoluteHorizontalPosition:{key:"w:tblpX",value:n===void 0?void 0:as(n)},absoluteVerticalPosition:{key:"w:tblpY",value:o===void 0?void 0:as(o)},horizontalAnchor:{key:"w:horzAnchor",value:e===void 0?void 0:e},relativeHorizontalPosition:{key:"w:tblpXSpec",value:i},relativeVerticalPosition:{key:"w:tblpYSpec",value:s},verticalAnchor:{key:"w:vertAnchor",value:r}})),f&&this.root.push(new xte("w:tblOverlap",f))}}class hie extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{type:"w:type"})}}class pie extends Te{constructor(e){super("w:tblLayout"),this.root.push(new hie({type:e}))}}class mie extends bs{constructor(e){super("w:tblPr"),e.style&&this.root.push(new Ul("w:tblStyle",e.style)),e.float&&this.root.push(new fie(e.float)),e.visuallyRightToLeft!==void 0&&this.root.push(new Be("w:bidiVisual",e.visuallyRightToLeft)),e.width&&this.root.push(new Pl("w:tblW",e.width)),e.alignment&&this.root.push(new I3(e.alignment)),e.indent&&this.root.push(new Pl("w:tblInd",e.indent)),e.borders&&this.root.push(new J3(e.borders)),e.shading&&this.root.push(new lv(e.shading)),e.layout&&this.root.push(new pie(e.layout)),e.cellMargin&&this.root.push(new X3(q3.TABLE,e.cellMargin))}}class gie extends $3{constructor({rows:e,width:r,columnWidths:n=Array(Math.max(...e.map(p=>p.CellCount))).fill(100),margins:i,indent:o,float:s,layout:a,style:l,borders:c,alignment:d,visuallyRightToLeft:f}){super("w:tbl"),this.root.push(new mie({borders:c??{},width:r??{size:100},indent:o,float:s,layout:a,style:l,alignment:d,cellMargin:i,visuallyRightToLeft:f})),this.root.push(new nie(n));for(const p of e)this.root.push(p);e.forEach((p,m)=>{if(m===e.length-1)return;let g=0;p.cells.forEach(b=>{if(b.options.rowSpan&&b.options.rowSpan>1){const S=new dk({rowSpan:b.options.rowSpan-1,columnSpan:b.options.columnSpan,borders:b.options.borders,children:[],verticalMerge:Y3.CONTINUE});e[m+1].addCellToColumnIndex(S,g)}g+=b.options.columnSpan||1})})}}class yie extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{value:"w:val",rule:"w:hRule"})}}class vie extends Te{constructor(e,r){super("w:trHeight"),this.root.push(new yie({value:Br(e),rule:r}))}}class bie extends bs{constructor(e){super("w:trPr"),e.cantSplit!==void 0&&this.root.push(new Be("w:cantSplit",e.cantSplit)),e.tableHeader!==void 0&&this.root.push(new Be("w:tblHeader",e.tableHeader)),e.height&&this.root.push(new vie(e.height.value,e.height.rule))}}class wie extends Te{constructor(e){super("w:tr"),this.options=e,this.root.push(new bie(e));for(const r of e.children)this.root.push(r)}get CellCount(){return this.options.children.length}get cells(){return this.root.filter(e=>e instanceof dk)}addCellToIndex(e,r){this.root.splice(r+1,0,e)}addCellToColumnIndex(e,r){const n=this.columnIndexToRootIndex(r,!0);this.addCellToIndex(e,n-1)}rootIndexToColumnIndex(e){if(e<1||e>=this.root.length)throw new Error(`cell 'rootIndex' should between 1 to ${this.root.length-1}`);let r=0;for(let n=1;n<e;n++){const i=this.root[n];r+=i.options.columnSpan||1}return r}columnIndexToRootIndex(e,r=!1){if(e<0)throw new Error("cell 'columnIndex' should not less than zero");let n=0,i=1;for(;n<=e;){if(i>=this.root.length){if(r)return this.root.length;throw new Error(`cell 'columnIndex' should not great than ${n-1}`)}const o=this.root[i];i+=1,n+=o&&o.options.columnSpan||1}return i-1}}class xie extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{xmlns:"xmlns",vt:"xmlns:vt"})}}class Sie extends Te{constructor(){super("Properties"),this.root.push(new xie({xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties",vt:"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"}))}}class kie extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{xmlns:"xmlns"})}}class _ie extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{contentType:"ContentType",extension:"Extension"})}}class Zo extends Te{constructor(e,r){super("Default"),this.root.push(new _ie({contentType:e,extension:r}))}}class Cie extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{contentType:"ContentType",partName:"PartName"})}}class fi extends Te{constructor(e,r){super("Override"),this.root.push(new Cie({contentType:e,partName:r}))}}class Eie extends Te{constructor(){super("Types"),this.root.push(new kie({xmlns:"http://schemas.openxmlformats.org/package/2006/content-types"})),this.root.push(new Zo("image/png","png")),this.root.push(new Zo("image/jpeg","jpeg")),this.root.push(new Zo("image/jpeg","jpg")),this.root.push(new Zo("image/bmp","bmp")),this.root.push(new Zo("image/gif","gif")),this.root.push(new Zo("image/svg+xml","svg")),this.root.push(new Zo("application/vnd.openxmlformats-package.relationships+xml","rels")),this.root.push(new Zo("application/xml","xml")),this.root.push(new Zo("application/vnd.openxmlformats-officedocument.obfuscatedFont","odttf")),this.root.push(new fi("application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml","/word/document.xml")),this.root.push(new fi("application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml","/word/styles.xml")),this.root.push(new fi("application/vnd.openxmlformats-package.core-properties+xml","/docProps/core.xml")),this.root.push(new fi("application/vnd.openxmlformats-officedocument.custom-properties+xml","/docProps/custom.xml")),this.root.push(new fi("application/vnd.openxmlformats-officedocument.extended-properties+xml","/docProps/app.xml")),this.root.push(new fi("application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml","/word/numbering.xml")),this.root.push(new fi("application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml","/word/footnotes.xml")),this.root.push(new fi("application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml","/word/settings.xml")),this.root.push(new fi("application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml","/word/comments.xml")),this.root.push(new fi("application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml","/word/fontTable.xml"))}addFooter(e){this.root.push(new fi("application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml",`/word/footer${e}.xml`))}addHeader(e){this.root.push(new fi("application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml",`/word/header${e}.xml`))}}class Tie extends Te{constructor(e){super("cp:coreProperties"),this.root.push(new Jh({cp:"http://schemas.openxmlformats.org/package/2006/metadata/core-properties",dc:"http://purl.org/dc/elements/1.1/",dcterms:"http://purl.org/dc/terms/",dcmitype:"http://purl.org/dc/dcmitype/",xsi:"http://www.w3.org/2001/XMLSchema-instance"})),e.title&&this.root.push(new wl("dc:title",e.title)),e.subject&&this.root.push(new wl("dc:subject",e.subject)),e.creator&&this.root.push(new wl("dc:creator",e.creator)),e.keywords&&this.root.push(new wl("cp:keywords",e.keywords)),e.description&&this.root.push(new wl("dc:description",e.description)),e.lastModifiedBy&&this.root.push(new wl("cp:lastModifiedBy",e.lastModifiedBy)),e.revision&&this.root.push(new wl("cp:revision",String(e.revision))),this.root.push(new XA("dcterms:created")),this.root.push(new XA("dcterms:modified"))}}class XA extends Te{constructor(e){super(e),this.root.push(new Jh({type:"dcterms:W3CDTF"})),this.root.push(wte(new Date))}}class Aie extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{xmlns:"xmlns",vt:"xmlns:vt"})}}class Rie extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{fmtid:"fmtid",pid:"pid",name:"name"})}}class Iie extends Te{constructor(e,r){super("property"),this.root.push(new Rie({fmtid:"{D5CDD505-2E9C-101B-9397-08002B2CF9AE}",pid:e.toString(),name:r.name})),this.root.push(new Oie(r.value))}}class Oie extends Te{constructor(e){super("vt:lpwstr"),this.root.push(e)}}class Mie extends Te{constructor(e){super("Properties"),Ae(this,"nextId"),Ae(this,"properties",[]),this.root.push(new Aie({xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/custom-properties",vt:"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"})),this.nextId=2;for(const r of e)this.addCustomProperty(r)}prepForXml(e){return this.properties.forEach(r=>this.root.push(r)),super.prepForXml(e)}addCustomProperty(e){this.properties.push(new Iie(this.nextId++,e))}}class Nie extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{wpc:"xmlns:wpc",mc:"xmlns:mc",o:"xmlns:o",r:"xmlns:r",m:"xmlns:m",v:"xmlns:v",wp14:"xmlns:wp14",wp:"xmlns:wp",w10:"xmlns:w10",w:"xmlns:w",w14:"xmlns:w14",w15:"xmlns:w15",wpg:"xmlns:wpg",wpi:"xmlns:wpi",wne:"xmlns:wne",wps:"xmlns:wps",cp:"xmlns:cp",dc:"xmlns:dc",dcterms:"xmlns:dcterms",dcmitype:"xmlns:dcmitype",xsi:"xmlns:xsi",type:"xsi:type"})}}let Die=class extends T3{constructor(e,r){super("w:ftr",r),Ae(this,"refId"),this.refId=e,r||this.root.push(new Nie({wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape"}))}get ReferenceId(){return this.refId}add(e){this.root.push(e)}};class Pie{constructor(e,r,n){Ae(this,"footer"),Ae(this,"relationships"),this.media=e,this.footer=new Die(r,n),this.relationships=new Md}add(e){this.footer.add(e)}addChildElement(e){this.footer.addChildElement(e)}get View(){return this.footer}get Relationships(){return this.relationships}get Media(){return this.media}}class Lie extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{type:"w:type",id:"w:id"})}}class Fie extends Te{constructor(){super("w:footnoteRef")}}class jie extends pc{constructor(){super({style:"FootnoteReference"}),this.root.push(new Fie)}}const YA={SEPERATOR:"separator",CONTINUATION_SEPERATOR:"continuationSeparator"};class x0 extends Te{constructor(e){super("w:footnote"),this.root.push(new Lie({type:e.type,id:e.id}));for(let r=0;r<e.children.length;r++){const n=e.children[r];r===0&&n.addRunToFront(new jie),this.root.push(n)}}}class Bie extends Te{constructor(){super("w:continuationSeparator")}}class zie extends pc{constructor(){super({}),this.root.push(new Bie)}}class Hie extends Te{constructor(){super("w:separator")}}class $ie extends pc{constructor(){super({}),this.root.push(new Hie)}}class Uie extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{wpc:"xmlns:wpc",mc:"xmlns:mc",o:"xmlns:o",r:"xmlns:r",m:"xmlns:m",v:"xmlns:v",wp14:"xmlns:wp14",wp:"xmlns:wp",w10:"xmlns:w10",w:"xmlns:w",w14:"xmlns:w14",w15:"xmlns:w15",wpg:"xmlns:wpg",wpi:"xmlns:wpi",wne:"xmlns:wne",wps:"xmlns:wps",Ignorable:"mc:Ignorable"})}}class Wie extends Te{constructor(){super("w:footnotes"),this.root.push(new Uie({wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape",Ignorable:"w14 w15 wp14"}));const e=new x0({id:-1,type:YA.SEPERATOR,children:[new ba({spacing:{after:0,line:240,lineRule:u1.AUTO},children:[new $ie]})]});this.root.push(e);const r=new x0({id:0,type:YA.CONTINUATION_SEPERATOR,children:[new ba({spacing:{after:0,line:240,lineRule:u1.AUTO},children:[new zie]})]});this.root.push(r)}createFootNote(e,r){const n=new x0({id:e,children:r});this.root.push(n)}}class Vie{constructor(){Ae(this,"footnotess"),Ae(this,"relationships"),this.footnotess=new Wie,this.relationships=new Md}get View(){return this.footnotess}get Relationships(){return this.relationships}}class Gie extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{wpc:"xmlns:wpc",mc:"xmlns:mc",o:"xmlns:o",r:"xmlns:r",m:"xmlns:m",v:"xmlns:v",wp14:"xmlns:wp14",wp:"xmlns:wp",w10:"xmlns:w10",w:"xmlns:w",w14:"xmlns:w14",w15:"xmlns:w15",wpg:"xmlns:wpg",wpi:"xmlns:wpi",wne:"xmlns:wne",wps:"xmlns:wps",cp:"xmlns:cp",dc:"xmlns:dc",dcterms:"xmlns:dcterms",dcmitype:"xmlns:dcmitype",xsi:"xmlns:xsi",type:"xsi:type",cx:"xmlns:cx",cx1:"xmlns:cx1",cx2:"xmlns:cx2",cx3:"xmlns:cx3",cx4:"xmlns:cx4",cx5:"xmlns:cx5",cx6:"xmlns:cx6",cx7:"xmlns:cx7",cx8:"xmlns:cx8",w16cid:"xmlns:w16cid",w16se:"xmlns:w16se"})}}let Kie=class extends T3{constructor(e,r){super("w:hdr",r),Ae(this,"refId"),this.refId=e,r||this.root.push(new Gie({wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape",cx:"http://schemas.microsoft.com/office/drawing/2014/chartex",cx1:"http://schemas.microsoft.com/office/drawing/2015/9/8/chartex",cx2:"http://schemas.microsoft.com/office/drawing/2015/10/21/chartex",cx3:"http://schemas.microsoft.com/office/drawing/2016/5/9/chartex",cx4:"http://schemas.microsoft.com/office/drawing/2016/5/10/chartex",cx5:"http://schemas.microsoft.com/office/drawing/2016/5/11/chartex",cx6:"http://schemas.microsoft.com/office/drawing/2016/5/12/chartex",cx7:"http://schemas.microsoft.com/office/drawing/2016/5/13/chartex",cx8:"http://schemas.microsoft.com/office/drawing/2016/5/14/chartex",w16cid:"http://schemas.microsoft.com/office/word/2016/wordml/cid",w16se:"http://schemas.microsoft.com/office/word/2015/wordml/symex"}))}get ReferenceId(){return this.refId}add(e){this.root.push(e)}};class qie{constructor(e,r,n){Ae(this,"header"),Ae(this,"relationships"),this.media=e,this.header=new Kie(r,n),this.relationships=new Md}add(e){return this.header.add(e),this}addChildElement(e){this.header.addChildElement(e)}get View(){return this.header}get Relationships(){return this.relationships}get Media(){return this.media}}class Xie{constructor(){Ae(this,"map"),this.map=new Map}addImage(e,r){this.map.set(e,r)}get Array(){return Array.from(this.map.values())}}const $n={DECIMAL:"decimal",UPPER_ROMAN:"upperRoman",LOWER_ROMAN:"lowerRoman",UPPER_LETTER:"upperLetter",LOWER_LETTER:"lowerLetter",ORDINAL:"ordinal",CARDINAL_TEXT:"cardinalText",ORDINAL_TEXT:"ordinalText",HEX:"hex",CHICAGO:"chicago",IDEOGRAPH__DIGITAL:"ideographDigital",JAPANESE_COUNTING:"japaneseCounting",AIUEO:"aiueo",IROHA:"iroha",DECIMAL_FULL_WIDTH:"decimalFullWidth",DECIMAL_HALF_WIDTH:"decimalHalfWidth",JAPANESE_LEGAL:"japaneseLegal",JAPANESE_DIGITAL_TEN_THOUSAND:"japaneseDigitalTenThousand",DECIMAL_ENCLOSED_CIRCLE:"decimalEnclosedCircle",DECIMAL_FULL_WIDTH2:"decimalFullWidth2",AIUEO_FULL_WIDTH:"aiueoFullWidth",IROHA_FULL_WIDTH:"irohaFullWidth",DECIMAL_ZERO:"decimalZero",BULLET:"bullet",GANADA:"ganada",CHOSUNG:"chosung",DECIMAL_ENCLOSED_FULLSTOP:"decimalEnclosedFullstop",DECIMAL_ENCLOSED_PARENTHESES:"decimalEnclosedParen",DECIMAL_ENCLOSED_CIRCLE_CHINESE:"decimalEnclosedCircleChinese",IDEOGRAPH_ENCLOSED_CIRCLE:"ideographEnclosedCircle",IDEOGRAPH_TRADITIONAL:"ideographTraditional",IDEOGRAPH_ZODIAC:"ideographZodiac",IDEOGRAPH_ZODIAC_TRADITIONAL:"ideographZodiacTraditional",TAIWANESE_COUNTING:"taiwaneseCounting",IDEOGRAPH_LEGAL_TRADITIONAL:"ideographLegalTraditional",TAIWANESE_COUNTING_THOUSAND:"taiwaneseCountingThousand",TAIWANESE_DIGITAL:"taiwaneseDigital",CHINESE_COUNTING:"chineseCounting",CHINESE_LEGAL_SIMPLIFIED:"chineseLegalSimplified",CHINESE_COUNTING_THOUSAND:"chineseCountingThousand",KOREAN_DIGITAL:"koreanDigital",KOREAN_COUNTING:"koreanCounting",KOREAN_LEGAL:"koreanLegal",KOREAN_DIGITAL2:"koreanDigital2",VIETNAMESE_COUNTING:"vietnameseCounting",RUSSIAN_LOWER:"russianLower",RUSSIAN_UPPER:"russianUpper",NONE:"none",NUMBER_IN_DASH:"numberInDash",HEBREW1:"hebrew1",HEBREW2:"hebrew2",ARABIC_ALPHA:"arabicAlpha",ARABIC_ABJAD:"arabicAbjad",HINDI_VOWELS:"hindiVowels",HINDI_CONSONANTS:"hindiConsonants",HINDI_NUMBERS:"hindiNumbers",HINDI_COUNTING:"hindiCounting",THAI_LETTERS:"thaiLetters",THAI_NUMBERS:"thaiNumbers",THAI_COUNTING:"thaiCounting",BAHT_TEXT:"bahtText",DOLLAR_TEXT:"dollarText",CUSTOM:"custom"};class Yie extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{ilvl:"w:ilvl",tentative:"w15:tentative"})}}class Jie extends Te{constructor(e){super("w:numFmt"),this.root.push(new sr({val:e}))}}class Zie extends Te{constructor(e){super("w:lvlText"),this.root.push(new sr({val:e}))}}class Qie extends Te{constructor(e){super("w:lvlJc"),this.root.push(new sr({val:e}))}}class eoe extends Te{constructor(e){super("w:suff"),this.root.push(new sr({val:e}))}}class toe extends Te{constructor(){super("w:isLgl")}}class roe extends Te{constructor({level:e,format:r,text:n,alignment:i=An.START,start:o=1,style:s,suffix:a,isLegalNumberingStyle:l}){if(super("w:lvl"),Ae(this,"paragraphProperties"),Ae(this,"runProperties"),this.root.push(new ak("w:start",Zr(o))),r&&this.root.push(new Jie(r)),a&&this.root.push(new eoe(a)),l&&this.root.push(new toe),n&&this.root.push(new Zie(n)),this.root.push(new Qie(i)),this.paragraphProperties=new md(s&&s.paragraph),this.runProperties=new hc(s&&s.run),this.root.push(this.paragraphProperties),this.root.push(this.runProperties),e>9)throw new Error("Level cannot be greater than 9. Read more here: https://answers.microsoft.com/en-us/msoffice/forum/all/does-word-support-more-than-9-list-levels/d130fdcd-1781-446d-8c84-c6c79124e4d7");this.root.push(new Yie({ilvl:Zr(e),tentative:1}))}}class noe extends roe{}class ioe extends Te{constructor(e){super("w:multiLevelType"),this.root.push(new sr({val:e}))}}class ooe extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{abstractNumId:"w:abstractNumId",restartNumberingAfterBreak:"w15:restartNumberingAfterBreak"})}}class JA extends Te{constructor(e,r){super("w:abstractNum"),Ae(this,"id"),this.root.push(new ooe({abstractNumId:Zr(e),restartNumberingAfterBreak:0})),this.root.push(new ioe("hybridMultilevel")),this.id=e;for(const n of r)this.root.push(new noe(n))}}class soe extends Te{constructor(e){super("w:abstractNumId"),this.root.push(new sr({val:e}))}}class aoe extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{numId:"w:numId"})}}class ZA extends Te{constructor(e){if(super("w:num"),Ae(this,"numId"),Ae(this,"reference"),Ae(this,"instance"),this.numId=e.numId,this.reference=e.reference,this.instance=e.instance,this.root.push(new aoe({numId:Zr(e.numId)})),this.root.push(new soe(Zr(e.abstractNumId))),e.overrideLevels&&e.overrideLevels.length)for(const r of e.overrideLevels)this.root.push(new coe(r.num,r.start))}}class loe extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{ilvl:"w:ilvl"})}}class coe extends Te{constructor(e,r){super("w:lvlOverride"),this.root.push(new loe({ilvl:e})),r!==void 0&&this.root.push(new doe(r))}}class uoe extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{val:"w:val"})}}class doe extends Te{constructor(e){super("w:startOverride"),this.root.push(new uoe({val:e}))}}class foe extends Te{constructor(e){super("w:numbering"),Ae(this,"abstractNumberingMap",new Map),Ae(this,"concreteNumberingMap",new Map),Ae(this,"referenceConfigMap",new Map),Ae(this,"abstractNumUniqueNumericId",Yte()),Ae(this,"concreteNumUniqueNumericId",Jte()),this.root.push(new Jh({wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape",Ignorable:"w14 w15 wp14"}));const r=new JA(this.abstractNumUniqueNumericId(),[{level:0,format:$n.BULLET,text:"●",alignment:An.LEFT,style:{paragraph:{indent:{left:zn(.5),hanging:zn(.25)}}}},{level:1,format:$n.BULLET,text:"○",alignment:An.LEFT,style:{paragraph:{indent:{left:zn(1),hanging:zn(.25)}}}},{level:2,format:$n.BULLET,text:"■",alignment:An.LEFT,style:{paragraph:{indent:{left:2160,hanging:zn(.25)}}}},{level:3,format:$n.BULLET,text:"●",alignment:An.LEFT,style:{paragraph:{indent:{left:2880,hanging:zn(.25)}}}},{level:4,format:$n.BULLET,text:"○",alignment:An.LEFT,style:{paragraph:{indent:{left:3600,hanging:zn(.25)}}}},{level:5,format:$n.BULLET,text:"■",alignment:An.LEFT,style:{paragraph:{indent:{left:4320,hanging:zn(.25)}}}},{level:6,format:$n.BULLET,text:"●",alignment:An.LEFT,style:{paragraph:{indent:{left:5040,hanging:zn(.25)}}}},{level:7,format:$n.BULLET,text:"●",alignment:An.LEFT,style:{paragraph:{indent:{left:5760,hanging:zn(.25)}}}},{level:8,format:$n.BULLET,text:"●",alignment:An.LEFT,style:{paragraph:{indent:{left:6480,hanging:zn(.25)}}}}]);this.concreteNumberingMap.set("default-bullet-numbering",new ZA({numId:1,abstractNumId:r.id,reference:"default-bullet-numbering",instance:0,overrideLevels:[{num:0,start:1}]})),this.abstractNumberingMap.set("default-bullet-numbering",r);for(const n of e.config)this.abstractNumberingMap.set(n.reference,new JA(this.abstractNumUniqueNumericId(),n.levels)),this.referenceConfigMap.set(n.reference,n.levels)}prepForXml(e){for(const r of this.abstractNumberingMap.values())this.root.push(r);for(const r of this.concreteNumberingMap.values())this.root.push(r);return super.prepForXml(e)}createConcreteNumberingInstance(e,r){const n=this.abstractNumberingMap.get(e);if(!n)return;const i=`${e}-${r}`;if(this.concreteNumberingMap.has(i))return;const o=this.referenceConfigMap.get(e),s=o&&o[0].start,a={numId:this.concreteNumUniqueNumericId(),abstractNumId:n.id,reference:e,instance:r,overrideLevels:[s&&Number.isInteger(s)?{num:0,start:s}:{num:0,start:1}]};this.concreteNumberingMap.set(i,new ZA(a))}get ConcreteNumbering(){return Array.from(this.concreteNumberingMap.values())}get ReferenceConfig(){return Array.from(this.referenceConfigMap.values())}}class hoe extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{version:"w:val",name:"w:name",uri:"w:uri"})}}class poe extends Te{constructor(e){super("w:compatSetting"),this.root.push(new hoe({version:e,uri:"http://schemas.microsoft.com/office/word",name:"compatibilityMode"}))}}class moe extends Te{constructor(e){super("w:compat"),e.version&&this.root.push(new poe(e.version)),e.useSingleBorderforContiguousCells&&this.root.push(new Be("w:useSingleBorderforContiguousCells",e.useSingleBorderforContiguousCells)),e.wordPerfectJustification&&this.root.push(new Be("w:wpJustification",e.wordPerfectJustification)),e.noTabStopForHangingIndent&&this.root.push(new Be("w:noTabHangInd",e.noTabStopForHangingIndent)),e.noLeading&&this.root.push(new Be("w:noLeading",e.noLeading)),e.spaceForUnderline&&this.root.push(new Be("w:spaceForUL",e.spaceForUnderline)),e.noColumnBalance&&this.root.push(new Be("w:noColumnBalance",e.noColumnBalance)),e.balanceSingleByteDoubleByteWidth&&this.root.push(new Be("w:balanceSingleByteDoubleByteWidth",e.balanceSingleByteDoubleByteWidth)),e.noExtraLineSpacing&&this.root.push(new Be("w:noExtraLineSpacing",e.noExtraLineSpacing)),e.doNotLeaveBackslashAlone&&this.root.push(new Be("w:doNotLeaveBackslashAlone",e.doNotLeaveBackslashAlone)),e.underlineTrailingSpaces&&this.root.push(new Be("w:ulTrailSpace",e.underlineTrailingSpaces)),e.doNotExpandShiftReturn&&this.root.push(new Be("w:doNotExpandShiftReturn",e.doNotExpandShiftReturn)),e.spacingInWholePoints&&this.root.push(new Be("w:spacingInWholePoints",e.spacingInWholePoints)),e.lineWrapLikeWord6&&this.root.push(new Be("w:lineWrapLikeWord6",e.lineWrapLikeWord6)),e.printBodyTextBeforeHeader&&this.root.push(new Be("w:printBodyTextBeforeHeader",e.printBodyTextBeforeHeader)),e.printColorsBlack&&this.root.push(new Be("w:printColBlack",e.printColorsBlack)),e.spaceWidth&&this.root.push(new Be("w:wpSpaceWidth",e.spaceWidth)),e.showBreaksInFrames&&this.root.push(new Be("w:showBreaksInFrames",e.showBreaksInFrames)),e.subFontBySize&&this.root.push(new Be("w:subFontBySize",e.subFontBySize)),e.suppressBottomSpacing&&this.root.push(new Be("w:suppressBottomSpacing",e.suppressBottomSpacing)),e.suppressTopSpacing&&this.root.push(new Be("w:suppressTopSpacing",e.suppressTopSpacing)),e.suppressSpacingAtTopOfPage&&this.root.push(new Be("w:suppressSpacingAtTopOfPage",e.suppressSpacingAtTopOfPage)),e.suppressTopSpacingWP&&this.root.push(new Be("w:suppressTopSpacingWP",e.suppressTopSpacingWP)),e.suppressSpBfAfterPgBrk&&this.root.push(new Be("w:suppressSpBfAfterPgBrk",e.suppressSpBfAfterPgBrk)),e.swapBordersFacingPages&&this.root.push(new Be("w:swapBordersFacingPages",e.swapBordersFacingPages)),e.convertMailMergeEsc&&this.root.push(new Be("w:convMailMergeEsc",e.convertMailMergeEsc)),e.truncateFontHeightsLikeWP6&&this.root.push(new Be("w:truncateFontHeightsLikeWP6",e.truncateFontHeightsLikeWP6)),e.macWordSmallCaps&&this.root.push(new Be("w:mwSmallCaps",e.macWordSmallCaps)),e.usePrinterMetrics&&this.root.push(new Be("w:usePrinterMetrics",e.usePrinterMetrics)),e.doNotSuppressParagraphBorders&&this.root.push(new Be("w:doNotSuppressParagraphBorders",e.doNotSuppressParagraphBorders)),e.wrapTrailSpaces&&this.root.push(new Be("w:wrapTrailSpaces",e.wrapTrailSpaces)),e.footnoteLayoutLikeWW8&&this.root.push(new Be("w:footnoteLayoutLikeWW8",e.footnoteLayoutLikeWW8)),e.shapeLayoutLikeWW8&&this.root.push(new Be("w:shapeLayoutLikeWW8",e.shapeLayoutLikeWW8)),e.alignTablesRowByRow&&this.root.push(new Be("w:alignTablesRowByRow",e.alignTablesRowByRow)),e.forgetLastTabAlignment&&this.root.push(new Be("w:forgetLastTabAlignment",e.forgetLastTabAlignment)),e.adjustLineHeightInTable&&this.root.push(new Be("w:adjustLineHeightInTable",e.adjustLineHeightInTable)),e.autoSpaceLikeWord95&&this.root.push(new Be("w:autoSpaceLikeWord95",e.autoSpaceLikeWord95)),e.noSpaceRaiseLower&&this.root.push(new Be("w:noSpaceRaiseLower",e.noSpaceRaiseLower)),e.doNotUseHTMLParagraphAutoSpacing&&this.root.push(new Be("w:doNotUseHTMLParagraphAutoSpacing",e.doNotUseHTMLParagraphAutoSpacing)),e.layoutRawTableWidth&&this.root.push(new Be("w:layoutRawTableWidth",e.layoutRawTableWidth)),e.layoutTableRowsApart&&this.root.push(new Be("w:layoutTableRowsApart",e.layoutTableRowsApart)),e.useWord97LineBreakRules&&this.root.push(new Be("w:useWord97LineBreakRules",e.useWord97LineBreakRules)),e.doNotBreakWrappedTables&&this.root.push(new Be("w:doNotBreakWrappedTables",e.doNotBreakWrappedTables)),e.doNotSnapToGridInCell&&this.root.push(new Be("w:doNotSnapToGridInCell",e.doNotSnapToGridInCell)),e.selectFieldWithFirstOrLastCharacter&&this.root.push(new Be("w:selectFldWithFirstOrLastChar",e.selectFieldWithFirstOrLastCharacter)),e.applyBreakingRules&&this.root.push(new Be("w:applyBreakingRules",e.applyBreakingRules)),e.doNotWrapTextWithPunctuation&&this.root.push(new Be("w:doNotWrapTextWithPunct",e.doNotWrapTextWithPunctuation)),e.doNotUseEastAsianBreakRules&&this.root.push(new Be("w:doNotUseEastAsianBreakRules",e.doNotUseEastAsianBreakRules)),e.useWord2002TableStyleRules&&this.root.push(new Be("w:useWord2002TableStyleRules",e.useWord2002TableStyleRules)),e.growAutofit&&this.root.push(new Be("w:growAutofit",e.growAutofit)),e.useFELayout&&this.root.push(new Be("w:useFELayout",e.useFELayout)),e.useNormalStyleForList&&this.root.push(new Be("w:useNormalStyleForList",e.useNormalStyleForList)),e.doNotUseIndentAsNumberingTabStop&&this.root.push(new Be("w:doNotUseIndentAsNumberingTabStop",e.doNotUseIndentAsNumberingTabStop)),e.useAlternateEastAsianLineBreakRules&&this.root.push(new Be("w:useAltKinsokuLineBreakRules",e.useAlternateEastAsianLineBreakRules)),e.allowSpaceOfSameStyleInTable&&this.root.push(new Be("w:allowSpaceOfSameStyleInTable",e.allowSpaceOfSameStyleInTable)),e.doNotSuppressIndentation&&this.root.push(new Be("w:doNotSuppressIndentation",e.doNotSuppressIndentation)),e.doNotAutofitConstrainedTables&&this.root.push(new Be("w:doNotAutofitConstrainedTables",e.doNotAutofitConstrainedTables)),e.autofitToFirstFixedWidthCell&&this.root.push(new Be("w:autofitToFirstFixedWidthCell",e.autofitToFirstFixedWidthCell)),e.underlineTabInNumberingList&&this.root.push(new Be("w:underlineTabInNumList",e.underlineTabInNumberingList)),e.displayHangulFixedWidth&&this.root.push(new Be("w:displayHangulFixedWidth",e.displayHangulFixedWidth)),e.splitPgBreakAndParaMark&&this.root.push(new Be("w:splitPgBreakAndParaMark",e.splitPgBreakAndParaMark)),e.doNotVerticallyAlignCellWithSp&&this.root.push(new Be("w:doNotVertAlignCellWithSp",e.doNotVerticallyAlignCellWithSp)),e.doNotBreakConstrainedForcedTable&&this.root.push(new Be("w:doNotBreakConstrainedForcedTable",e.doNotBreakConstrainedForcedTable)),e.ignoreVerticalAlignmentInTextboxes&&this.root.push(new Be("w:doNotVertAlignInTxbx",e.ignoreVerticalAlignmentInTextboxes)),e.useAnsiKerningPairs&&this.root.push(new Be("w:useAnsiKerningPairs",e.useAnsiKerningPairs)),e.cachedColumnBalance&&this.root.push(new Be("w:cachedColBalance",e.cachedColumnBalance))}}class goe extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{wpc:"xmlns:wpc",mc:"xmlns:mc",o:"xmlns:o",r:"xmlns:r",m:"xmlns:m",v:"xmlns:v",wp14:"xmlns:wp14",wp:"xmlns:wp",w10:"xmlns:w10",w:"xmlns:w",w14:"xmlns:w14",w15:"xmlns:w15",wpg:"xmlns:wpg",wpi:"xmlns:wpi",wne:"xmlns:wne",wps:"xmlns:wps",Ignorable:"mc:Ignorable"})}}class yoe extends Te{constructor(e){var r,n,i,o;super("w:settings"),this.root.push(new goe({wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape",Ignorable:"w14 w15 wp14"})),this.root.push(new Be("w:displayBackgroundShape",!0)),e.trackRevisions!==void 0&&this.root.push(new Be("w:trackRevisions",e.trackRevisions)),e.evenAndOddHeaders!==void 0&&this.root.push(new Be("w:evenAndOddHeaders",e.evenAndOddHeaders)),e.updateFields!==void 0&&this.root.push(new Be("w:updateFields",e.updateFields)),e.defaultTabStop!==void 0&&this.root.push(new ak("w:defaultTabStop",e.defaultTabStop)),this.root.push(new moe(Ca(vt({},(r=e.compatibility)!=null?r:{}),{version:(o=(i=(n=e.compatibility)==null?void 0:n.version)!=null?i:e.compatibilityModeVersion)!=null?o:15})))}}class Z3 extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{val:"w:val"})}}class voe extends Te{constructor(e){super("w:name"),this.root.push(new Z3({val:e}))}}class boe extends Te{constructor(e){super("w:uiPriority"),this.root.push(new Z3({val:Zr(e)}))}}class woe extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{type:"w:type",styleId:"w:styleId",default:"w:default",customStyle:"w:customStyle"})}}class Q3 extends Te{constructor(e,r){super("w:style"),this.root.push(new woe(e)),r.name&&this.root.push(new voe(r.name)),r.basedOn&&this.root.push(new Ul("w:basedOn",r.basedOn)),r.next&&this.root.push(new Ul("w:next",r.next)),r.link&&this.root.push(new Ul("w:link",r.link)),r.uiPriority!==void 0&&this.root.push(new boe(r.uiPriority)),r.semiHidden!==void 0&&this.root.push(new Be("w:semiHidden",r.semiHidden)),r.unhideWhenUsed!==void 0&&this.root.push(new Be("w:unhideWhenUsed",r.unhideWhenUsed)),r.quickFormat!==void 0&&this.root.push(new Be("w:qFormat",r.quickFormat))}}class dv extends Q3{constructor(e){super({type:"paragraph",styleId:e.id},e),Ae(this,"paragraphProperties"),Ae(this,"runProperties"),this.paragraphProperties=new md(e.paragraph),this.runProperties=new hc(e.run),this.root.push(this.paragraphProperties),this.root.push(this.runProperties)}}class fv extends Q3{constructor(e){super({type:"character",styleId:e.id},vt({uiPriority:99,unhideWhenUsed:!0},e)),Ae(this,"runProperties"),this.runProperties=new hc(e.run),this.root.push(this.runProperties)}}class Fa extends dv{constructor(e){super(vt({basedOn:"Normal",next:"Normal",quickFormat:!0},e))}}class xoe extends Fa{constructor(e){super(vt({id:"Title",name:"Title"},e))}}class Soe extends Fa{constructor(e){super(vt({id:"Heading1",name:"Heading 1"},e))}}class koe extends Fa{constructor(e){super(vt({id:"Heading2",name:"Heading 2"},e))}}class _oe extends Fa{constructor(e){super(vt({id:"Heading3",name:"Heading 3"},e))}}class Coe extends Fa{constructor(e){super(vt({id:"Heading4",name:"Heading 4"},e))}}class Eoe extends Fa{constructor(e){super(vt({id:"Heading5",name:"Heading 5"},e))}}class Toe extends Fa{constructor(e){super(vt({id:"Heading6",name:"Heading 6"},e))}}class Aoe extends Fa{constructor(e){super(vt({id:"Strong",name:"Strong"},e))}}class Roe extends dv{constructor(e){super(vt({id:"ListParagraph",name:"List Paragraph",basedOn:"Normal",quickFormat:!0},e))}}class Ioe extends dv{constructor(e){super(vt({id:"FootnoteText",name:"footnote text",link:"FootnoteTextChar",basedOn:"Normal",uiPriority:99,semiHidden:!0,unhideWhenUsed:!0,paragraph:{spacing:{after:0,line:240,lineRule:u1.AUTO}},run:{size:20}},e))}}class Ooe extends fv{constructor(e){super(vt({id:"FootnoteReference",name:"footnote reference",basedOn:"DefaultParagraphFont",semiHidden:!0,run:{superScript:!0}},e))}}class Moe extends fv{constructor(e){super(vt({id:"FootnoteTextChar",name:"Footnote Text Char",basedOn:"DefaultParagraphFont",link:"FootnoteText",semiHidden:!0,run:{size:20}},e))}}class Noe extends fv{constructor(e){super(vt({id:"Hyperlink",name:"Hyperlink",basedOn:"DefaultParagraphFont",run:{color:"0563C1",underline:{type:M3.SINGLE}}},e))}}class f1 extends Te{constructor(e){if(super("w:styles"),e.initialStyles&&this.root.push(e.initialStyles),e.importedStyles)for(const r of e.importedStyles)this.root.push(r);if(e.paragraphStyles)for(const r of e.paragraphStyles)this.root.push(new dv(r));if(e.characterStyles)for(const r of e.characterStyles)this.root.push(new fv(r))}}class Doe extends Te{constructor(e){super("w:pPrDefault"),this.root.push(new md(e))}}class Poe extends Te{constructor(e){super("w:rPrDefault"),this.root.push(new hc(e))}}class Loe extends Te{constructor(e){super("w:docDefaults"),Ae(this,"runPropertiesDefaults"),Ae(this,"paragraphPropertiesDefaults"),this.runPropertiesDefaults=new Poe(e.run),this.paragraphPropertiesDefaults=new Doe(e.paragraph),this.root.push(this.runPropertiesDefaults),this.root.push(this.paragraphPropertiesDefaults)}}class Foe{newInstance(e){const r=E3.xml2js(e,{compact:!1});let n;for(const s of r.elements||[])s.name==="w:styles"&&(n=s);if(n===void 0)throw new Error("can not find styles element");const i=n.elements||[];return new f1({initialStyles:new pte(n.attributes),importedStyles:i.map(s=>ok(s))})}}class QA{newInstance(e={}){var r;return{initialStyles:new Jh({mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",Ignorable:"w14 w15"}),importedStyles:[new Loe((r=e.document)!=null?r:{}),new xoe(vt({run:{size:56}},e.title)),new Soe(vt({run:{color:"2E74B5",size:32}},e.heading1)),new koe(vt({run:{color:"2E74B5",size:26}},e.heading2)),new _oe(vt({run:{color:"1F4D78",size:24}},e.heading3)),new Coe(vt({run:{color:"2E74B5",italics:!0}},e.heading4)),new Eoe(vt({run:{color:"2E74B5"}},e.heading5)),new Toe(vt({run:{color:"1F4D78"}},e.heading6)),new Aoe(vt({run:{bold:!0}},e.strong)),new Roe(e.listParagraph||{}),new Noe(e.hyperlink||{}),new Ooe(e.footnoteReference||{}),new Ioe(e.footnoteText||{}),new Moe(e.footnoteTextChar||{})]}}}const wm=({id:t,fontKey:e,subsetted:r},n)=>new hr({name:n,attributes:vt({id:{key:"r:id",value:t}},e?{fontKey:{key:"w:fontKey",value:`{${e}}`}}:{}),children:[...r?[new Be("w:subsetted",r)]:[]]}),joe=({name:t,altName:e,panose1:r,charset:n,family:i,notTrueType:o,pitch:s,sig:a,embedRegular:l,embedBold:c,embedItalic:d,embedBoldItalic:f})=>new hr({name:"w:font",attributes:{name:{key:"w:name",value:t}},children:[...e?[Ff("w:altName",e)]:[],...r?[Ff("w:panose1",r)]:[],...n?[Ff("w:charset",n)]:[],...i?[Ff("w:family",i)]:[],...o?[new Be("w:notTrueType",o)]:[],...s?[Ff("w:pitch",s)]:[],...a?[new hr({name:"w:sig",attributes:{usb0:{key:"w:usb0",value:a.usb0},usb1:{key:"w:usb1",value:a.usb1},usb2:{key:"w:usb2",value:a.usb2},usb3:{key:"w:usb3",value:a.usb3},csb0:{key:"w:csb0",value:a.csb0},csb1:{key:"w:csb1",value:a.csb1}}})]:[],...l?[wm(l,"w:embedRegular")]:[],...c?[wm(c,"w:embedBold")]:[],...d?[wm(d,"w:embedItalic")]:[],...f?[wm(f,"w:embedBoldItalic")]:[]]}),Boe=({name:t,index:e,fontKey:r,characterSet:n})=>joe({name:t,sig:{usb0:"E0002AFF",usb1:"C000247B",usb2:"00000009",usb3:"00000000",csb0:"000001FF",csb1:"00000000"},charset:n,family:"auto",pitch:"variable",embedRegular:{fontKey:r,id:`rId${e}`}}),zoe=t=>new hr({name:"w:fonts",attributes:{mc:{key:"xmlns:mc",value:"http://schemas.openxmlformats.org/markup-compatibility/2006"},r:{key:"xmlns:r",value:"http://schemas.openxmlformats.org/officeDocument/2006/relationships"},w:{key:"xmlns:w",value:"http://schemas.openxmlformats.org/wordprocessingml/2006/main"},w14:{key:"xmlns:w14",value:"http://schemas.microsoft.com/office/word/2010/wordml"},w15:{key:"xmlns:w15",value:"http://schemas.microsoft.com/office/word/2012/wordml"},w16cex:{key:"xmlns:w16cex",value:"http://schemas.microsoft.com/office/word/2018/wordml/cex"},w16cid:{key:"xmlns:w16cid",value:"http://schemas.microsoft.com/office/word/2016/wordml/cid"},w16:{key:"xmlns:w16",value:"http://schemas.microsoft.com/office/word/2018/wordml"},w16sdtdh:{key:"xmlns:w16sdtdh",value:"http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash"},w16se:{key:"xmlns:w16se",value:"http://schemas.microsoft.com/office/word/2015/wordml/symex"},Ignorable:{key:"mc:Ignorable",value:"w14 w15 w16se w16cid w16 w16cex w16sdtdh"}},children:t.map((e,r)=>Boe({name:e.name,index:r+1,fontKey:e.fontKey}))});class Hoe{constructor(e){Ae(this,"fontTable"),Ae(this,"relationships"),Ae(this,"fontOptionsWithKey",[]),this.options=e,this.fontOptionsWithKey=e.map(r=>Ca(vt({},r),{fontKey:ere()})),this.fontTable=zoe(this.fontOptionsWithKey),this.relationships=new Md;for(let r=0;r<e.length;r++)this.relationships.createRelationship(r+1,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/font",`fonts/${e[r].name}.odttf`)}get View(){return this.fontTable}get Relationships(){return this.relationships}}let $oe=class{constructor(e){Ae(this,"currentRelationshipId",1),Ae(this,"documentWrapper"),Ae(this,"headers",[]),Ae(this,"footers",[]),Ae(this,"coreProperties"),Ae(this,"numbering"),Ae(this,"media"),Ae(this,"fileRelationships"),Ae(this,"footnotesWrapper"),Ae(this,"settings"),Ae(this,"contentTypes"),Ae(this,"customProperties"),Ae(this,"appProperties"),Ae(this,"styles"),Ae(this,"comments"),Ae(this,"fontWrapper");var r,n,i,o,s,a,l,c;if(this.coreProperties=new Tie(Ca(vt({},e),{creator:(r=e.creator)!=null?r:"Un-named",revision:(n=e.revision)!=null?n:1,lastModifiedBy:(i=e.lastModifiedBy)!=null?i:"Un-named"})),this.numbering=new foe(e.numbering?e.numbering:{config:[]}),this.comments=new fne((o=e.comments)!=null?o:{children:[]}),this.fileRelationships=new Md,this.customProperties=new Mie((s=e.customProperties)!=null?s:[]),this.appProperties=new Sie,this.footnotesWrapper=new Vie,this.contentTypes=new Eie,this.documentWrapper=new K3({background:e.background}),this.settings=new yoe({compatibilityModeVersion:e.compatabilityModeVersion,compatibility:e.compatibility,evenAndOddHeaders:!!e.evenAndOddHeaderAndFooters,trackRevisions:(a=e.features)==null?void 0:a.trackRevisions,updateFields:(l=e.features)==null?void 0:l.updateFields,defaultTabStop:e.defaultTabStop}),this.media=new Xie,e.externalStyles!==void 0){const d=new Foe;this.styles=d.newInstance(e.externalStyles)}else if(e.styles){const f=new QA().newInstance(e.styles.default);this.styles=new f1(vt(vt({},f),e.styles))}else{const d=new QA;this.styles=new f1(d.newInstance())}this.addDefaultRelationships();for(const d of e.sections)this.addSection(d);if(e.footnotes)for(const d in e.footnotes)this.footnotesWrapper.View.createFootNote(parseFloat(d),e.footnotes[d].children);this.fontWrapper=new Hoe((c=e.fonts)!=null?c:[])}addSection({headers:e={},footers:r={},children:n,properties:i}){this.documentWrapper.View.Body.addSection(Ca(vt({},i),{headerWrapperGroup:{default:e.default?this.createHeader(e.default):void 0,first:e.first?this.createHeader(e.first):void 0,even:e.even?this.createHeader(e.even):void 0},footerWrapperGroup:{default:r.default?this.createFooter(r.default):void 0,first:r.first?this.createFooter(r.first):void 0,even:r.even?this.createFooter(r.even):void 0}}));for(const o of n)this.documentWrapper.View.add(o)}createHeader(e){const r=new qie(this.media,this.currentRelationshipId++);for(const n of e.options.children)r.add(n);return this.addHeaderToDocument(r),r}createFooter(e){const r=new Pie(this.media,this.currentRelationshipId++);for(const n of e.options.children)r.add(n);return this.addFooterToDocument(r),r}addHeaderToDocument(e,r=Gu.DEFAULT){this.headers.push({header:e,type:r}),this.documentWrapper.Relationships.createRelationship(e.View.ReferenceId,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/header",`header${this.headers.length}.xml`),this.contentTypes.addHeader(this.headers.length)}addFooterToDocument(e,r=Gu.DEFAULT){this.footers.push({footer:e,type:r}),this.documentWrapper.Relationships.createRelationship(e.View.ReferenceId,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer",`footer${this.footers.length}.xml`),this.contentTypes.addFooter(this.footers.length)}addDefaultRelationships(){this.fileRelationships.createRelationship(1,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument","word/document.xml"),this.fileRelationships.createRelationship(2,"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties","docProps/core.xml"),this.fileRelationships.createRelationship(3,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties","docProps/app.xml"),this.fileRelationships.createRelationship(4,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties","docProps/custom.xml"),this.documentWrapper.Relationships.createRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles","styles.xml"),this.documentWrapper.Relationships.createRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering","numbering.xml"),this.documentWrapper.Relationships.createRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes","footnotes.xml"),this.documentWrapper.Relationships.createRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings","settings.xml"),this.documentWrapper.Relationships.createRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments","comments.xml")}get Document(){return this.documentWrapper}get Styles(){return this.styles}get CoreProperties(){return this.coreProperties}get Numbering(){return this.numbering}get Media(){return this.media}get FileRelationships(){return this.fileRelationships}get Headers(){return this.headers.map(e=>e.header)}get Footers(){return this.footers.map(e=>e.footer)}get ContentTypes(){return this.contentTypes}get CustomProperties(){return this.customProperties}get AppProperties(){return this.appProperties}get FootNotes(){return this.footnotesWrapper}get Settings(){return this.settings}get Comments(){return this.comments}get FontTable(){return this.fontWrapper}};class Uoe extends Xe{constructor(){super(...arguments),Ae(this,"xmlKeys",{id:"w:id"})}}class Woe extends Te{constructor(e){super("w:footnoteReference"),this.root.push(new Uoe({id:e}))}}class Voe extends pc{constructor(e){super({style:"FootnoteReference"}),this.root.push(new Woe(e))}}function xm(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var e2={exports:{}};(function(t,e){(function(r){t.exports=r()})(function(){return function r(n,i,o){function s(c,d){if(!i[c]){if(!n[c]){var f=typeof xm=="function"&&xm;if(!d&&f)return f(c,!0);if(a)return a(c,!0);var p=new Error("Cannot find module '"+c+"'");throw p.code="MODULE_NOT_FOUND",p}var m=i[c]={exports:{}};n[c][0].call(m.exports,function(g){var b=n[c][1][g];return s(b||g)},m,m.exports,r,n,i,o)}return i[c].exports}for(var a=typeof xm=="function"&&xm,l=0;l<o.length;l++)s(o[l]);return s}({1:[function(r,n,i){var o=r("./utils"),s=r("./support"),a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";i.encode=function(l){for(var c,d,f,p,m,g,b,S=[],w=0,T=l.length,M=T,j=o.getTypeOf(l)!=="string";w<l.length;)M=T-w,f=j?(c=l[w++],d=w<T?l[w++]:0,w<T?l[w++]:0):(c=l.charCodeAt(w++),d=w<T?l.charCodeAt(w++):0,w<T?l.charCodeAt(w++):0),p=c>>2,m=(3&c)<<4|d>>4,g=1<M?(15&d)<<2|f>>6:64,b=2<M?63&f:64,S.push(a.charAt(p)+a.charAt(m)+a.charAt(g)+a.charAt(b));return S.join("")},i.decode=function(l){var c,d,f,p,m,g,b=0,S=0,w="data:";if(l.substr(0,w.length)===w)throw new Error("Invalid base64 input, it looks like a data url.");var T,M=3*(l=l.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(l.charAt(l.length-1)===a.charAt(64)&&M--,l.charAt(l.length-2)===a.charAt(64)&&M--,M%1!=0)throw new Error("Invalid base64 input, bad content length.");for(T=s.uint8array?new Uint8Array(0|M):new Array(0|M);b<l.length;)c=a.indexOf(l.charAt(b++))<<2|(p=a.indexOf(l.charAt(b++)))>>4,d=(15&p)<<4|(m=a.indexOf(l.charAt(b++)))>>2,f=(3&m)<<6|(g=a.indexOf(l.charAt(b++))),T[S++]=c,m!==64&&(T[S++]=d),g!==64&&(T[S++]=f);return T}},{"./support":30,"./utils":32}],2:[function(r,n,i){var o=r("./external"),s=r("./stream/DataWorker"),a=r("./stream/Crc32Probe"),l=r("./stream/DataLengthProbe");function c(d,f,p,m,g){this.compressedSize=d,this.uncompressedSize=f,this.crc32=p,this.compression=m,this.compressedContent=g}c.prototype={getContentWorker:function(){var d=new s(o.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),f=this;return d.on("end",function(){if(this.streamInfo.data_length!==f.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),d},getCompressedWorker:function(){return new s(o.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},c.createWorkerFrom=function(d,f,p){return d.pipe(new a).pipe(new l("uncompressedSize")).pipe(f.compressWorker(p)).pipe(new l("compressedSize")).withStreamInfo("compression",f)},n.exports=c},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(r,n,i){var o=r("./stream/GenericWorker");i.STORE={magic:"\0\0",compressWorker:function(){return new o("STORE compression")},uncompressWorker:function(){return new o("STORE decompression")}},i.DEFLATE=r("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(r,n,i){var o=r("./utils"),s=function(){for(var a,l=[],c=0;c<256;c++){a=c;for(var d=0;d<8;d++)a=1&a?3988292384^a>>>1:a>>>1;l[c]=a}return l}();n.exports=function(a,l){return a!==void 0&&a.length?o.getTypeOf(a)!=="string"?function(c,d,f,p){var m=s,g=p+f;c^=-1;for(var b=p;b<g;b++)c=c>>>8^m[255&(c^d[b])];return-1^c}(0|l,a,a.length,0):function(c,d,f,p){var m=s,g=p+f;c^=-1;for(var b=p;b<g;b++)c=c>>>8^m[255&(c^d.charCodeAt(b))];return-1^c}(0|l,a,a.length,0):0}},{"./utils":32}],5:[function(r,n,i){i.base64=!1,i.binary=!1,i.dir=!1,i.createFolders=!0,i.date=null,i.compression=null,i.compressionOptions=null,i.comment=null,i.unixPermissions=null,i.dosPermissions=null},{}],6:[function(r,n,i){var o=null;o=typeof Promise<"u"?Promise:r("lie"),n.exports={Promise:o}},{lie:37}],7:[function(r,n,i){var o=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",s=r("pako"),a=r("./utils"),l=r("./stream/GenericWorker"),c=o?"uint8array":"array";function d(f,p){l.call(this,"FlateWorker/"+f),this._pako=null,this._pakoAction=f,this._pakoOptions=p,this.meta={}}i.magic="\b\0",a.inherits(d,l),d.prototype.processChunk=function(f){this.meta=f.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(c,f.data),!1)},d.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},d.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},d.prototype._createPako=function(){this._pako=new s[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var f=this;this._pako.onData=function(p){f.push({data:p,meta:f.meta})}},i.compressWorker=function(f){return new d("Deflate",f)},i.uncompressWorker=function(){return new d("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(r,n,i){function o(m,g){var b,S="";for(b=0;b<g;b++)S+=String.fromCharCode(255&m),m>>>=8;return S}function s(m,g,b,S,w,T){var M,j,$=m.file,W=m.compression,Y=T!==c.utf8encode,ee=a.transformTo("string",T($.name)),P=a.transformTo("string",c.utf8encode($.name)),fe=$.comment,de=a.transformTo("string",T(fe)),U=a.transformTo("string",c.utf8encode(fe)),ne=P.length!==$.name.length,R=U.length!==fe.length,le="",Ee="",he="",Fe=$.dir,ye=$.date,ze={crc32:0,compressedSize:0,uncompressedSize:0};g&&!b||(ze.crc32=m.crc32,ze.compressedSize=m.compressedSize,ze.uncompressedSize=m.uncompressedSize);var ue=0;g&&(ue|=8),Y||!ne&&!R||(ue|=2048);var V=0,me=0;Fe&&(V|=16),w==="UNIX"?(me=798,V|=function(ke,ce){var L=ke;return ke||(L=ce?16893:33204),(65535&L)<<16}($.unixPermissions,Fe)):(me=20,V|=function(ke){return 63&(ke||0)}($.dosPermissions)),M=ye.getUTCHours(),M<<=6,M|=ye.getUTCMinutes(),M<<=5,M|=ye.getUTCSeconds()/2,j=ye.getUTCFullYear()-1980,j<<=4,j|=ye.getUTCMonth()+1,j<<=5,j|=ye.getUTCDate(),ne&&(Ee=o(1,1)+o(d(ee),4)+P,le+="up"+o(Ee.length,2)+Ee),R&&(he=o(1,1)+o(d(de),4)+U,le+="uc"+o(he.length,2)+he);var ge="";return ge+=`
|
|
310
|
+
\0`,ge+=o(ue,2),ge+=W.magic,ge+=o(M,2),ge+=o(j,2),ge+=o(ze.crc32,4),ge+=o(ze.compressedSize,4),ge+=o(ze.uncompressedSize,4),ge+=o(ee.length,2),ge+=o(le.length,2),{fileRecord:f.LOCAL_FILE_HEADER+ge+ee+le,dirRecord:f.CENTRAL_FILE_HEADER+o(me,2)+ge+o(de.length,2)+"\0\0\0\0"+o(V,4)+o(S,4)+ee+le+de}}var a=r("../utils"),l=r("../stream/GenericWorker"),c=r("../utf8"),d=r("../crc32"),f=r("../signature");function p(m,g,b,S){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=g,this.zipPlatform=b,this.encodeFileName=S,this.streamFiles=m,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(p,l),p.prototype.push=function(m){var g=m.meta.percent||0,b=this.entriesCount,S=this._sources.length;this.accumulate?this.contentBuffer.push(m):(this.bytesWritten+=m.data.length,l.prototype.push.call(this,{data:m.data,meta:{currentFile:this.currentFile,percent:b?(g+100*(b-S-1))/b:100}}))},p.prototype.openedSource=function(m){this.currentSourceOffset=this.bytesWritten,this.currentFile=m.file.name;var g=this.streamFiles&&!m.file.dir;if(g){var b=s(m,g,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:b.fileRecord,meta:{percent:0}})}else this.accumulate=!0},p.prototype.closedSource=function(m){this.accumulate=!1;var g=this.streamFiles&&!m.file.dir,b=s(m,g,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(b.dirRecord),g)this.push({data:function(S){return f.DATA_DESCRIPTOR+o(S.crc32,4)+o(S.compressedSize,4)+o(S.uncompressedSize,4)}(m),meta:{percent:100}});else for(this.push({data:b.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},p.prototype.flush=function(){for(var m=this.bytesWritten,g=0;g<this.dirRecords.length;g++)this.push({data:this.dirRecords[g],meta:{percent:100}});var b=this.bytesWritten-m,S=function(w,T,M,j,$){var W=a.transformTo("string",$(j));return f.CENTRAL_DIRECTORY_END+"\0\0\0\0"+o(w,2)+o(w,2)+o(T,4)+o(M,4)+o(W.length,2)+W}(this.dirRecords.length,b,m,this.zipComment,this.encodeFileName);this.push({data:S,meta:{percent:100}})},p.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},p.prototype.registerPrevious=function(m){this._sources.push(m);var g=this;return m.on("data",function(b){g.processChunk(b)}),m.on("end",function(){g.closedSource(g.previous.streamInfo),g._sources.length?g.prepareNextSource():g.end()}),m.on("error",function(b){g.error(b)}),this},p.prototype.resume=function(){return!!l.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},p.prototype.error=function(m){var g=this._sources;if(!l.prototype.error.call(this,m))return!1;for(var b=0;b<g.length;b++)try{g[b].error(m)}catch{}return!0},p.prototype.lock=function(){l.prototype.lock.call(this);for(var m=this._sources,g=0;g<m.length;g++)m[g].lock()},n.exports=p},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(r,n,i){var o=r("../compressions"),s=r("./ZipFileWorker");i.generateWorker=function(a,l,c){var d=new s(l.streamFiles,c,l.platform,l.encodeFileName),f=0;try{a.forEach(function(p,m){f++;var g=function(T,M){var j=T||M,$=o[j];if(!$)throw new Error(j+" is not a valid compression method !");return $}(m.options.compression,l.compression),b=m.options.compressionOptions||l.compressionOptions||{},S=m.dir,w=m.date;m._compressWorker(g,b).withStreamInfo("file",{name:p,dir:S,date:w,comment:m.comment||"",unixPermissions:m.unixPermissions,dosPermissions:m.dosPermissions}).pipe(d)}),d.entriesCount=f}catch(p){d.error(p)}return d}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(r,n,i){function o(){if(!(this instanceof o))return new o;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var s=new o;for(var a in this)typeof this[a]!="function"&&(s[a]=this[a]);return s}}(o.prototype=r("./object")).loadAsync=r("./load"),o.support=r("./support"),o.defaults=r("./defaults"),o.version="3.10.1",o.loadAsync=function(s,a){return new o().loadAsync(s,a)},o.external=r("./external"),n.exports=o},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(r,n,i){var o=r("./utils"),s=r("./external"),a=r("./utf8"),l=r("./zipEntries"),c=r("./stream/Crc32Probe"),d=r("./nodejsUtils");function f(p){return new s.Promise(function(m,g){var b=p.decompressed.getContentWorker().pipe(new c);b.on("error",function(S){g(S)}).on("end",function(){b.streamInfo.crc32!==p.decompressed.crc32?g(new Error("Corrupted zip : CRC32 mismatch")):m()}).resume()})}n.exports=function(p,m){var g=this;return m=o.extend(m||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:a.utf8decode}),d.isNode&&d.isStream(p)?s.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):o.prepareContent("the loaded zip file",p,!0,m.optimizedBinaryString,m.base64).then(function(b){var S=new l(m);return S.load(b),S}).then(function(b){var S=[s.Promise.resolve(b)],w=b.files;if(m.checkCRC32)for(var T=0;T<w.length;T++)S.push(f(w[T]));return s.Promise.all(S)}).then(function(b){for(var S=b.shift(),w=S.files,T=0;T<w.length;T++){var M=w[T],j=M.fileNameStr,$=o.resolve(M.fileNameStr);g.file($,M.decompressed,{binary:!0,optimizedBinaryString:!0,date:M.date,dir:M.dir,comment:M.fileCommentStr.length?M.fileCommentStr:null,unixPermissions:M.unixPermissions,dosPermissions:M.dosPermissions,createFolders:m.createFolders}),M.dir||(g.file($).unsafeOriginalName=j)}return S.zipComment.length&&(g.comment=S.zipComment),g})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(r,n,i){var o=r("../utils"),s=r("../stream/GenericWorker");function a(l,c){s.call(this,"Nodejs stream input adapter for "+l),this._upstreamEnded=!1,this._bindStream(c)}o.inherits(a,s),a.prototype._bindStream=function(l){var c=this;(this._stream=l).pause(),l.on("data",function(d){c.push({data:d,meta:{percent:0}})}).on("error",function(d){c.isPaused?this.generatedError=d:c.error(d)}).on("end",function(){c.isPaused?c._upstreamEnded=!0:c.end()})},a.prototype.pause=function(){return!!s.prototype.pause.call(this)&&(this._stream.pause(),!0)},a.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},n.exports=a},{"../stream/GenericWorker":28,"../utils":32}],13:[function(r,n,i){var o=r("readable-stream").Readable;function s(a,l,c){o.call(this,l),this._helper=a;var d=this;a.on("data",function(f,p){d.push(f)||d._helper.pause(),c&&c(p)}).on("error",function(f){d.emit("error",f)}).on("end",function(){d.push(null)})}r("../utils").inherits(s,o),s.prototype._read=function(){this._helper.resume()},n.exports=s},{"../utils":32,"readable-stream":16}],14:[function(r,n,i){n.exports={isNode:typeof Buffer<"u",newBufferFrom:function(o,s){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(o,s);if(typeof o=="number")throw new Error('The "data" argument must not be a number');return new Buffer(o,s)},allocBuffer:function(o){if(Buffer.alloc)return Buffer.alloc(o);var s=new Buffer(o);return s.fill(0),s},isBuffer:function(o){return Buffer.isBuffer(o)},isStream:function(o){return o&&typeof o.on=="function"&&typeof o.pause=="function"&&typeof o.resume=="function"}}},{}],15:[function(r,n,i){function o($,W,Y){var ee,P=a.getTypeOf(W),fe=a.extend(Y||{},d);fe.date=fe.date||new Date,fe.compression!==null&&(fe.compression=fe.compression.toUpperCase()),typeof fe.unixPermissions=="string"&&(fe.unixPermissions=parseInt(fe.unixPermissions,8)),fe.unixPermissions&&16384&fe.unixPermissions&&(fe.dir=!0),fe.dosPermissions&&16&fe.dosPermissions&&(fe.dir=!0),fe.dir&&($=w($)),fe.createFolders&&(ee=S($))&&T.call(this,ee,!0);var de=P==="string"&&fe.binary===!1&&fe.base64===!1;Y&&Y.binary!==void 0||(fe.binary=!de),(W instanceof f&&W.uncompressedSize===0||fe.dir||!W||W.length===0)&&(fe.base64=!1,fe.binary=!0,W="",fe.compression="STORE",P="string");var U=null;U=W instanceof f||W instanceof l?W:g.isNode&&g.isStream(W)?new b($,W):a.prepareContent($,W,fe.binary,fe.optimizedBinaryString,fe.base64);var ne=new p($,U,fe);this.files[$]=ne}var s=r("./utf8"),a=r("./utils"),l=r("./stream/GenericWorker"),c=r("./stream/StreamHelper"),d=r("./defaults"),f=r("./compressedObject"),p=r("./zipObject"),m=r("./generate"),g=r("./nodejsUtils"),b=r("./nodejs/NodejsStreamInputAdapter"),S=function($){$.slice(-1)==="/"&&($=$.substring(0,$.length-1));var W=$.lastIndexOf("/");return 0<W?$.substring(0,W):""},w=function($){return $.slice(-1)!=="/"&&($+="/"),$},T=function($,W){return W=W!==void 0?W:d.createFolders,$=w($),this.files[$]||o.call(this,$,null,{dir:!0,createFolders:W}),this.files[$]};function M($){return Object.prototype.toString.call($)==="[object RegExp]"}var j={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function($){var W,Y,ee;for(W in this.files)ee=this.files[W],(Y=W.slice(this.root.length,W.length))&&W.slice(0,this.root.length)===this.root&&$(Y,ee)},filter:function($){var W=[];return this.forEach(function(Y,ee){$(Y,ee)&&W.push(ee)}),W},file:function($,W,Y){if(arguments.length!==1)return $=this.root+$,o.call(this,$,W,Y),this;if(M($)){var ee=$;return this.filter(function(fe,de){return!de.dir&&ee.test(fe)})}var P=this.files[this.root+$];return P&&!P.dir?P:null},folder:function($){if(!$)return this;if(M($))return this.filter(function(P,fe){return fe.dir&&$.test(P)});var W=this.root+$,Y=T.call(this,W),ee=this.clone();return ee.root=Y.name,ee},remove:function($){$=this.root+$;var W=this.files[$];if(W||($.slice(-1)!=="/"&&($+="/"),W=this.files[$]),W&&!W.dir)delete this.files[$];else for(var Y=this.filter(function(P,fe){return fe.name.slice(0,$.length)===$}),ee=0;ee<Y.length;ee++)delete this.files[Y[ee].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function($){var W,Y={};try{if((Y=a.extend($||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:s.utf8encode})).type=Y.type.toLowerCase(),Y.compression=Y.compression.toUpperCase(),Y.type==="binarystring"&&(Y.type="string"),!Y.type)throw new Error("No output type specified.");a.checkSupport(Y.type),Y.platform!=="darwin"&&Y.platform!=="freebsd"&&Y.platform!=="linux"&&Y.platform!=="sunos"||(Y.platform="UNIX"),Y.platform==="win32"&&(Y.platform="DOS");var ee=Y.comment||this.comment||"";W=m.generateWorker(this,Y,ee)}catch(P){(W=new l("error")).error(P)}return new c(W,Y.type||"string",Y.mimeType)},generateAsync:function($,W){return this.generateInternalStream($).accumulate(W)},generateNodeStream:function($,W){return($=$||{}).type||($.type="nodebuffer"),this.generateInternalStream($).toNodejsStream(W)}};n.exports=j},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(r,n,i){n.exports=r("stream")},{stream:void 0}],17:[function(r,n,i){var o=r("./DataReader");function s(a){o.call(this,a);for(var l=0;l<this.data.length;l++)a[l]=255&a[l]}r("../utils").inherits(s,o),s.prototype.byteAt=function(a){return this.data[this.zero+a]},s.prototype.lastIndexOfSignature=function(a){for(var l=a.charCodeAt(0),c=a.charCodeAt(1),d=a.charCodeAt(2),f=a.charCodeAt(3),p=this.length-4;0<=p;--p)if(this.data[p]===l&&this.data[p+1]===c&&this.data[p+2]===d&&this.data[p+3]===f)return p-this.zero;return-1},s.prototype.readAndCheckSignature=function(a){var l=a.charCodeAt(0),c=a.charCodeAt(1),d=a.charCodeAt(2),f=a.charCodeAt(3),p=this.readData(4);return l===p[0]&&c===p[1]&&d===p[2]&&f===p[3]},s.prototype.readData=function(a){if(this.checkOffset(a),a===0)return[];var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=s},{"../utils":32,"./DataReader":18}],18:[function(r,n,i){var o=r("../utils");function s(a){this.data=a,this.length=a.length,this.index=0,this.zero=0}s.prototype={checkOffset:function(a){this.checkIndex(this.index+a)},checkIndex:function(a){if(this.length<this.zero+a||a<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+a+"). Corrupted zip ?")},setIndex:function(a){this.checkIndex(a),this.index=a},skip:function(a){this.setIndex(this.index+a)},byteAt:function(){},readInt:function(a){var l,c=0;for(this.checkOffset(a),l=this.index+a-1;l>=this.index;l--)c=(c<<8)+this.byteAt(l);return this.index+=a,c},readString:function(a){return o.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC(1980+(a>>25&127),(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1))}},n.exports=s},{"../utils":32}],19:[function(r,n,i){var o=r("./Uint8ArrayReader");function s(a){o.call(this,a)}r("../utils").inherits(s,o),s.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=s},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(r,n,i){var o=r("./DataReader");function s(a){o.call(this,a)}r("../utils").inherits(s,o),s.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},s.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},s.prototype.readAndCheckSignature=function(a){return a===this.readData(4)},s.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=s},{"../utils":32,"./DataReader":18}],21:[function(r,n,i){var o=r("./ArrayReader");function s(a){o.call(this,a)}r("../utils").inherits(s,o),s.prototype.readData=function(a){if(this.checkOffset(a),a===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=s},{"../utils":32,"./ArrayReader":17}],22:[function(r,n,i){var o=r("../utils"),s=r("../support"),a=r("./ArrayReader"),l=r("./StringReader"),c=r("./NodeBufferReader"),d=r("./Uint8ArrayReader");n.exports=function(f){var p=o.getTypeOf(f);return o.checkSupport(p),p!=="string"||s.uint8array?p==="nodebuffer"?new c(f):s.uint8array?new d(o.transformTo("uint8array",f)):new a(o.transformTo("array",f)):new l(f)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(r,n,i){i.LOCAL_FILE_HEADER="PK",i.CENTRAL_FILE_HEADER="PK",i.CENTRAL_DIRECTORY_END="PK",i.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",i.ZIP64_CENTRAL_DIRECTORY_END="PK",i.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(r,n,i){var o=r("./GenericWorker"),s=r("../utils");function a(l){o.call(this,"ConvertWorker to "+l),this.destType=l}s.inherits(a,o),a.prototype.processChunk=function(l){this.push({data:s.transformTo(this.destType,l.data),meta:l.meta})},n.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(r,n,i){var o=r("./GenericWorker"),s=r("../crc32");function a(){o.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}r("../utils").inherits(a,o),a.prototype.processChunk=function(l){this.streamInfo.crc32=s(l.data,this.streamInfo.crc32||0),this.push(l)},n.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(r,n,i){var o=r("../utils"),s=r("./GenericWorker");function a(l){s.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}o.inherits(a,s),a.prototype.processChunk=function(l){if(l){var c=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=c+l.data.length}s.prototype.processChunk.call(this,l)},n.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(r,n,i){var o=r("../utils"),s=r("./GenericWorker");function a(l){s.call(this,"DataWorker");var c=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(d){c.dataIsReady=!0,c.data=d,c.max=d&&d.length||0,c.type=o.getTypeOf(d),c.isPaused||c._tickAndRepeat()},function(d){c.error(d)})}o.inherits(a,s),a.prototype.cleanUp=function(){s.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,o.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(o.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,c=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,c);break;case"uint8array":l=this.data.subarray(this.index,c);break;case"array":case"nodebuffer":l=this.data.slice(this.index,c)}return this.index=c,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},n.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(r,n,i){function o(s){this.name=s||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}o.prototype={push:function(s){this.emit("data",s)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(s){this.emit("error",s)}return!0},error:function(s){return!this.isFinished&&(this.isPaused?this.generatedError=s:(this.isFinished=!0,this.emit("error",s),this.previous&&this.previous.error(s),this.cleanUp()),!0)},on:function(s,a){return this._listeners[s].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(s,a){if(this._listeners[s])for(var l=0;l<this._listeners[s].length;l++)this._listeners[s][l].call(this,a)},pipe:function(s){return s.registerPrevious(this)},registerPrevious:function(s){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=s.streamInfo,this.mergeStreamInfo(),this.previous=s;var a=this;return s.on("data",function(l){a.processChunk(l)}),s.on("end",function(){a.end()}),s.on("error",function(l){a.error(l)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var s=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),s=!0),this.previous&&this.previous.resume(),!s},flush:function(){},processChunk:function(s){this.push(s)},withStreamInfo:function(s,a){return this.extraStreamInfo[s]=a,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var s in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,s)&&(this.streamInfo[s]=this.extraStreamInfo[s])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var s="Worker "+this.name;return this.previous?this.previous+" -> "+s:s}},n.exports=o},{}],29:[function(r,n,i){var o=r("../utils"),s=r("./ConvertWorker"),a=r("./GenericWorker"),l=r("../base64"),c=r("../support"),d=r("../external"),f=null;if(c.nodestream)try{f=r("../nodejs/NodejsStreamOutputAdapter")}catch{}function p(g,b){return new d.Promise(function(S,w){var T=[],M=g._internalType,j=g._outputType,$=g._mimeType;g.on("data",function(W,Y){T.push(W),b&&b(Y)}).on("error",function(W){T=[],w(W)}).on("end",function(){try{var W=function(Y,ee,P){switch(Y){case"blob":return o.newBlob(o.transformTo("arraybuffer",ee),P);case"base64":return l.encode(ee);default:return o.transformTo(Y,ee)}}(j,function(Y,ee){var P,fe=0,de=null,U=0;for(P=0;P<ee.length;P++)U+=ee[P].length;switch(Y){case"string":return ee.join("");case"array":return Array.prototype.concat.apply([],ee);case"uint8array":for(de=new Uint8Array(U),P=0;P<ee.length;P++)de.set(ee[P],fe),fe+=ee[P].length;return de;case"nodebuffer":return Buffer.concat(ee);default:throw new Error("concat : unsupported type '"+Y+"'")}}(M,T),$);S(W)}catch(Y){w(Y)}T=[]}).resume()})}function m(g,b,S){var w=b;switch(b){case"blob":case"arraybuffer":w="uint8array";break;case"base64":w="string"}try{this._internalType=w,this._outputType=b,this._mimeType=S,o.checkSupport(w),this._worker=g.pipe(new s(w)),g.lock()}catch(T){this._worker=new a("error"),this._worker.error(T)}}m.prototype={accumulate:function(g){return p(this,g)},on:function(g,b){var S=this;return g==="data"?this._worker.on(g,function(w){b.call(S,w.data,w.meta)}):this._worker.on(g,function(){o.delay(b,arguments,S)}),this},resume:function(){return o.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(g){if(o.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new f(this,{objectMode:this._outputType!=="nodebuffer"},g)}},n.exports=m},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(r,n,i){if(i.base64=!0,i.array=!0,i.string=!0,i.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",i.nodebuffer=typeof Buffer<"u",i.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")i.blob=!1;else{var o=new ArrayBuffer(0);try{i.blob=new Blob([o],{type:"application/zip"}).size===0}catch{try{var s=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);s.append(o),i.blob=s.getBlob("application/zip").size===0}catch{i.blob=!1}}}try{i.nodestream=!!r("readable-stream").Readable}catch{i.nodestream=!1}},{"readable-stream":16}],31:[function(r,n,i){for(var o=r("./utils"),s=r("./support"),a=r("./nodejsUtils"),l=r("./stream/GenericWorker"),c=new Array(256),d=0;d<256;d++)c[d]=252<=d?6:248<=d?5:240<=d?4:224<=d?3:192<=d?2:1;c[254]=c[254]=1;function f(){l.call(this,"utf-8 decode"),this.leftOver=null}function p(){l.call(this,"utf-8 encode")}i.utf8encode=function(m){return s.nodebuffer?a.newBufferFrom(m,"utf-8"):function(g){var b,S,w,T,M,j=g.length,$=0;for(T=0;T<j;T++)(64512&(S=g.charCodeAt(T)))==55296&&T+1<j&&(64512&(w=g.charCodeAt(T+1)))==56320&&(S=65536+(S-55296<<10)+(w-56320),T++),$+=S<128?1:S<2048?2:S<65536?3:4;for(b=s.uint8array?new Uint8Array($):new Array($),T=M=0;M<$;T++)(64512&(S=g.charCodeAt(T)))==55296&&T+1<j&&(64512&(w=g.charCodeAt(T+1)))==56320&&(S=65536+(S-55296<<10)+(w-56320),T++),S<128?b[M++]=S:(S<2048?b[M++]=192|S>>>6:(S<65536?b[M++]=224|S>>>12:(b[M++]=240|S>>>18,b[M++]=128|S>>>12&63),b[M++]=128|S>>>6&63),b[M++]=128|63&S);return b}(m)},i.utf8decode=function(m){return s.nodebuffer?o.transformTo("nodebuffer",m).toString("utf-8"):function(g){var b,S,w,T,M=g.length,j=new Array(2*M);for(b=S=0;b<M;)if((w=g[b++])<128)j[S++]=w;else if(4<(T=c[w]))j[S++]=65533,b+=T-1;else{for(w&=T===2?31:T===3?15:7;1<T&&b<M;)w=w<<6|63&g[b++],T--;1<T?j[S++]=65533:w<65536?j[S++]=w:(w-=65536,j[S++]=55296|w>>10&1023,j[S++]=56320|1023&w)}return j.length!==S&&(j.subarray?j=j.subarray(0,S):j.length=S),o.applyFromCharCode(j)}(m=o.transformTo(s.uint8array?"uint8array":"array",m))},o.inherits(f,l),f.prototype.processChunk=function(m){var g=o.transformTo(s.uint8array?"uint8array":"array",m.data);if(this.leftOver&&this.leftOver.length){if(s.uint8array){var b=g;(g=new Uint8Array(b.length+this.leftOver.length)).set(this.leftOver,0),g.set(b,this.leftOver.length)}else g=this.leftOver.concat(g);this.leftOver=null}var S=function(T,M){var j;for((M=M||T.length)>T.length&&(M=T.length),j=M-1;0<=j&&(192&T[j])==128;)j--;return j<0||j===0?M:j+c[T[j]]>M?j:M}(g),w=g;S!==g.length&&(s.uint8array?(w=g.subarray(0,S),this.leftOver=g.subarray(S,g.length)):(w=g.slice(0,S),this.leftOver=g.slice(S,g.length))),this.push({data:i.utf8decode(w),meta:m.meta})},f.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:i.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},i.Utf8DecodeWorker=f,o.inherits(p,l),p.prototype.processChunk=function(m){this.push({data:i.utf8encode(m.data),meta:m.meta})},i.Utf8EncodeWorker=p},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(r,n,i){var o=r("./support"),s=r("./base64"),a=r("./nodejsUtils"),l=r("./external");function c(b){return b}function d(b,S){for(var w=0;w<b.length;++w)S[w]=255&b.charCodeAt(w);return S}r("setimmediate"),i.newBlob=function(b,S){i.checkSupport("blob");try{return new Blob([b],{type:S})}catch{try{var w=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return w.append(b),w.getBlob(S)}catch{throw new Error("Bug : can't construct the Blob.")}}};var f={stringifyByChunk:function(b,S,w){var T=[],M=0,j=b.length;if(j<=w)return String.fromCharCode.apply(null,b);for(;M<j;)S==="array"||S==="nodebuffer"?T.push(String.fromCharCode.apply(null,b.slice(M,Math.min(M+w,j)))):T.push(String.fromCharCode.apply(null,b.subarray(M,Math.min(M+w,j)))),M+=w;return T.join("")},stringifyByChar:function(b){for(var S="",w=0;w<b.length;w++)S+=String.fromCharCode(b[w]);return S},applyCanBeUsed:{uint8array:function(){try{return o.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}}(),nodebuffer:function(){try{return o.nodebuffer&&String.fromCharCode.apply(null,a.allocBuffer(1)).length===1}catch{return!1}}()}};function p(b){var S=65536,w=i.getTypeOf(b),T=!0;if(w==="uint8array"?T=f.applyCanBeUsed.uint8array:w==="nodebuffer"&&(T=f.applyCanBeUsed.nodebuffer),T)for(;1<S;)try{return f.stringifyByChunk(b,w,S)}catch{S=Math.floor(S/2)}return f.stringifyByChar(b)}function m(b,S){for(var w=0;w<b.length;w++)S[w]=b[w];return S}i.applyFromCharCode=p;var g={};g.string={string:c,array:function(b){return d(b,new Array(b.length))},arraybuffer:function(b){return g.string.uint8array(b).buffer},uint8array:function(b){return d(b,new Uint8Array(b.length))},nodebuffer:function(b){return d(b,a.allocBuffer(b.length))}},g.array={string:p,array:c,arraybuffer:function(b){return new Uint8Array(b).buffer},uint8array:function(b){return new Uint8Array(b)},nodebuffer:function(b){return a.newBufferFrom(b)}},g.arraybuffer={string:function(b){return p(new Uint8Array(b))},array:function(b){return m(new Uint8Array(b),new Array(b.byteLength))},arraybuffer:c,uint8array:function(b){return new Uint8Array(b)},nodebuffer:function(b){return a.newBufferFrom(new Uint8Array(b))}},g.uint8array={string:p,array:function(b){return m(b,new Array(b.length))},arraybuffer:function(b){return b.buffer},uint8array:c,nodebuffer:function(b){return a.newBufferFrom(b)}},g.nodebuffer={string:p,array:function(b){return m(b,new Array(b.length))},arraybuffer:function(b){return g.nodebuffer.uint8array(b).buffer},uint8array:function(b){return m(b,new Uint8Array(b.length))},nodebuffer:c},i.transformTo=function(b,S){if(S=S||"",!b)return S;i.checkSupport(b);var w=i.getTypeOf(S);return g[w][b](S)},i.resolve=function(b){for(var S=b.split("/"),w=[],T=0;T<S.length;T++){var M=S[T];M==="."||M===""&&T!==0&&T!==S.length-1||(M===".."?w.pop():w.push(M))}return w.join("/")},i.getTypeOf=function(b){return typeof b=="string"?"string":Object.prototype.toString.call(b)==="[object Array]"?"array":o.nodebuffer&&a.isBuffer(b)?"nodebuffer":o.uint8array&&b instanceof Uint8Array?"uint8array":o.arraybuffer&&b instanceof ArrayBuffer?"arraybuffer":void 0},i.checkSupport=function(b){if(!o[b.toLowerCase()])throw new Error(b+" is not supported by this platform")},i.MAX_VALUE_16BITS=65535,i.MAX_VALUE_32BITS=-1,i.pretty=function(b){var S,w,T="";for(w=0;w<(b||"").length;w++)T+="\\x"+((S=b.charCodeAt(w))<16?"0":"")+S.toString(16).toUpperCase();return T},i.delay=function(b,S,w){setImmediate(function(){b.apply(w||null,S||[])})},i.inherits=function(b,S){function w(){}w.prototype=S.prototype,b.prototype=new w},i.extend=function(){var b,S,w={};for(b=0;b<arguments.length;b++)for(S in arguments[b])Object.prototype.hasOwnProperty.call(arguments[b],S)&&w[S]===void 0&&(w[S]=arguments[b][S]);return w},i.prepareContent=function(b,S,w,T,M){return l.Promise.resolve(S).then(function(j){return o.blob&&(j instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(j))!==-1)&&typeof FileReader<"u"?new l.Promise(function($,W){var Y=new FileReader;Y.onload=function(ee){$(ee.target.result)},Y.onerror=function(ee){W(ee.target.error)},Y.readAsArrayBuffer(j)}):j}).then(function(j){var $=i.getTypeOf(j);return $?($==="arraybuffer"?j=i.transformTo("uint8array",j):$==="string"&&(M?j=s.decode(j):w&&T!==!0&&(j=function(W){return d(W,o.uint8array?new Uint8Array(W.length):new Array(W.length))}(j))),j):l.Promise.reject(new Error("Can't read the data of '"+b+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(r,n,i){var o=r("./reader/readerFor"),s=r("./utils"),a=r("./signature"),l=r("./zipEntry"),c=r("./support");function d(f){this.files=[],this.loadOptions=f}d.prototype={checkSignature:function(f){if(!this.reader.readAndCheckSignature(f)){this.reader.index-=4;var p=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+s.pretty(p)+", expected "+s.pretty(f)+")")}},isSignature:function(f,p){var m=this.reader.index;this.reader.setIndex(f);var g=this.reader.readString(4)===p;return this.reader.setIndex(m),g},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var f=this.reader.readData(this.zipCommentLength),p=c.uint8array?"uint8array":"array",m=s.transformTo(p,f);this.zipComment=this.loadOptions.decodeFileName(m)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var f,p,m,g=this.zip64EndOfCentralSize-44;0<g;)f=this.reader.readInt(2),p=this.reader.readInt(4),m=this.reader.readData(p),this.zip64ExtensibleData[f]={id:f,length:p,value:m}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var f,p;for(f=0;f<this.files.length;f++)p=this.files[f],this.reader.setIndex(p.localHeaderOffset),this.checkSignature(a.LOCAL_FILE_HEADER),p.readLocalPart(this.reader),p.handleUTF8(),p.processAttributes()},readCentralDir:function(){var f;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(a.CENTRAL_FILE_HEADER);)(f=new l({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(f);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var f=this.reader.lastIndexOfSignature(a.CENTRAL_DIRECTORY_END);if(f<0)throw this.isSignature(0,a.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(f);var p=f;if(this.checkSignature(a.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===s.MAX_VALUE_16BITS||this.diskWithCentralDirStart===s.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===s.MAX_VALUE_16BITS||this.centralDirRecords===s.MAX_VALUE_16BITS||this.centralDirSize===s.MAX_VALUE_32BITS||this.centralDirOffset===s.MAX_VALUE_32BITS){if(this.zip64=!0,(f=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(f),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,a.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var m=this.centralDirOffset+this.centralDirSize;this.zip64&&(m+=20,m+=12+this.zip64EndOfCentralSize);var g=p-m;if(0<g)this.isSignature(p,a.CENTRAL_FILE_HEADER)||(this.reader.zero=g);else if(g<0)throw new Error("Corrupted zip: missing "+Math.abs(g)+" bytes.")},prepareReader:function(f){this.reader=o(f)},load:function(f){this.prepareReader(f),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},n.exports=d},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(r,n,i){var o=r("./reader/readerFor"),s=r("./utils"),a=r("./compressedObject"),l=r("./crc32"),c=r("./utf8"),d=r("./compressions"),f=r("./support");function p(m,g){this.options=m,this.loadOptions=g}p.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(m){var g,b;if(m.skip(22),this.fileNameLength=m.readInt(2),b=m.readInt(2),this.fileName=m.readData(this.fileNameLength),m.skip(b),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((g=function(S){for(var w in d)if(Object.prototype.hasOwnProperty.call(d,w)&&d[w].magic===S)return d[w];return null}(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+s.pretty(this.compressionMethod)+" unknown (inner file : "+s.transformTo("string",this.fileName)+")");this.decompressed=new a(this.compressedSize,this.uncompressedSize,this.crc32,g,m.readData(this.compressedSize))},readCentralPart:function(m){this.versionMadeBy=m.readInt(2),m.skip(2),this.bitFlag=m.readInt(2),this.compressionMethod=m.readString(2),this.date=m.readDate(),this.crc32=m.readInt(4),this.compressedSize=m.readInt(4),this.uncompressedSize=m.readInt(4);var g=m.readInt(2);if(this.extraFieldsLength=m.readInt(2),this.fileCommentLength=m.readInt(2),this.diskNumberStart=m.readInt(2),this.internalFileAttributes=m.readInt(2),this.externalFileAttributes=m.readInt(4),this.localHeaderOffset=m.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");m.skip(g),this.readExtraFields(m),this.parseZIP64ExtraField(m),this.fileComment=m.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var m=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),m==0&&(this.dosPermissions=63&this.externalFileAttributes),m==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var m=o(this.extraFields[1].value);this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=m.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=m.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=m.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=m.readInt(4))}},readExtraFields:function(m){var g,b,S,w=m.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});m.index+4<w;)g=m.readInt(2),b=m.readInt(2),S=m.readData(b),this.extraFields[g]={id:g,length:b,value:S};m.setIndex(w)},handleUTF8:function(){var m=f.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=c.utf8decode(this.fileName),this.fileCommentStr=c.utf8decode(this.fileComment);else{var g=this.findExtraFieldUnicodePath();if(g!==null)this.fileNameStr=g;else{var b=s.transformTo(m,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(b)}var S=this.findExtraFieldUnicodeComment();if(S!==null)this.fileCommentStr=S;else{var w=s.transformTo(m,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(w)}}},findExtraFieldUnicodePath:function(){var m=this.extraFields[28789];if(m){var g=o(m.value);return g.readInt(1)!==1||l(this.fileName)!==g.readInt(4)?null:c.utf8decode(g.readData(m.length-5))}return null},findExtraFieldUnicodeComment:function(){var m=this.extraFields[25461];if(m){var g=o(m.value);return g.readInt(1)!==1||l(this.fileComment)!==g.readInt(4)?null:c.utf8decode(g.readData(m.length-5))}return null}},n.exports=p},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(r,n,i){function o(g,b,S){this.name=g,this.dir=S.dir,this.date=S.date,this.comment=S.comment,this.unixPermissions=S.unixPermissions,this.dosPermissions=S.dosPermissions,this._data=b,this._dataBinary=S.binary,this.options={compression:S.compression,compressionOptions:S.compressionOptions}}var s=r("./stream/StreamHelper"),a=r("./stream/DataWorker"),l=r("./utf8"),c=r("./compressedObject"),d=r("./stream/GenericWorker");o.prototype={internalStream:function(g){var b=null,S="string";try{if(!g)throw new Error("No output type specified.");var w=(S=g.toLowerCase())==="string"||S==="text";S!=="binarystring"&&S!=="text"||(S="string"),b=this._decompressWorker();var T=!this._dataBinary;T&&!w&&(b=b.pipe(new l.Utf8EncodeWorker)),!T&&w&&(b=b.pipe(new l.Utf8DecodeWorker))}catch(M){(b=new d("error")).error(M)}return new s(b,S,"")},async:function(g,b){return this.internalStream(g).accumulate(b)},nodeStream:function(g,b){return this.internalStream(g||"nodebuffer").toNodejsStream(b)},_compressWorker:function(g,b){if(this._data instanceof c&&this._data.compression.magic===g.magic)return this._data.getCompressedWorker();var S=this._decompressWorker();return this._dataBinary||(S=S.pipe(new l.Utf8EncodeWorker)),c.createWorkerFrom(S,g,b)},_decompressWorker:function(){return this._data instanceof c?this._data.getContentWorker():this._data instanceof d?this._data:new a(this._data)}};for(var f=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],p=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},m=0;m<f.length;m++)o.prototype[f[m]]=p;n.exports=o},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(r,n,i){(function(o){var s,a,l=o.MutationObserver||o.WebKitMutationObserver;if(l){var c=0,d=new l(g),f=o.document.createTextNode("");d.observe(f,{characterData:!0}),s=function(){f.data=c=++c%2}}else if(o.setImmediate||o.MessageChannel===void 0)s="document"in o&&"onreadystatechange"in o.document.createElement("script")?function(){var b=o.document.createElement("script");b.onreadystatechange=function(){g(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},o.document.documentElement.appendChild(b)}:function(){setTimeout(g,0)};else{var p=new o.MessageChannel;p.port1.onmessage=g,s=function(){p.port2.postMessage(0)}}var m=[];function g(){var b,S;a=!0;for(var w=m.length;w;){for(S=m,m=[],b=-1;++b<w;)S[b]();w=m.length}a=!1}n.exports=function(b){m.push(b)!==1||a||s()}}).call(this,typeof mo<"u"?mo:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(r,n,i){var o=r("immediate");function s(){}var a={},l=["REJECTED"],c=["FULFILLED"],d=["PENDING"];function f(w){if(typeof w!="function")throw new TypeError("resolver must be a function");this.state=d,this.queue=[],this.outcome=void 0,w!==s&&b(this,w)}function p(w,T,M){this.promise=w,typeof T=="function"&&(this.onFulfilled=T,this.callFulfilled=this.otherCallFulfilled),typeof M=="function"&&(this.onRejected=M,this.callRejected=this.otherCallRejected)}function m(w,T,M){o(function(){var j;try{j=T(M)}catch($){return a.reject(w,$)}j===w?a.reject(w,new TypeError("Cannot resolve promise with itself")):a.resolve(w,j)})}function g(w){var T=w&&w.then;if(w&&(typeof w=="object"||typeof w=="function")&&typeof T=="function")return function(){T.apply(w,arguments)}}function b(w,T){var M=!1;function j(Y){M||(M=!0,a.reject(w,Y))}function $(Y){M||(M=!0,a.resolve(w,Y))}var W=S(function(){T($,j)});W.status==="error"&&j(W.value)}function S(w,T){var M={};try{M.value=w(T),M.status="success"}catch(j){M.status="error",M.value=j}return M}(n.exports=f).prototype.finally=function(w){if(typeof w!="function")return this;var T=this.constructor;return this.then(function(M){return T.resolve(w()).then(function(){return M})},function(M){return T.resolve(w()).then(function(){throw M})})},f.prototype.catch=function(w){return this.then(null,w)},f.prototype.then=function(w,T){if(typeof w!="function"&&this.state===c||typeof T!="function"&&this.state===l)return this;var M=new this.constructor(s);return this.state!==d?m(M,this.state===c?w:T,this.outcome):this.queue.push(new p(M,w,T)),M},p.prototype.callFulfilled=function(w){a.resolve(this.promise,w)},p.prototype.otherCallFulfilled=function(w){m(this.promise,this.onFulfilled,w)},p.prototype.callRejected=function(w){a.reject(this.promise,w)},p.prototype.otherCallRejected=function(w){m(this.promise,this.onRejected,w)},a.resolve=function(w,T){var M=S(g,T);if(M.status==="error")return a.reject(w,M.value);var j=M.value;if(j)b(w,j);else{w.state=c,w.outcome=T;for(var $=-1,W=w.queue.length;++$<W;)w.queue[$].callFulfilled(T)}return w},a.reject=function(w,T){w.state=l,w.outcome=T;for(var M=-1,j=w.queue.length;++M<j;)w.queue[M].callRejected(T);return w},f.resolve=function(w){return w instanceof this?w:a.resolve(new this(s),w)},f.reject=function(w){var T=new this(s);return a.reject(T,w)},f.all=function(w){var T=this;if(Object.prototype.toString.call(w)!=="[object Array]")return this.reject(new TypeError("must be an array"));var M=w.length,j=!1;if(!M)return this.resolve([]);for(var $=new Array(M),W=0,Y=-1,ee=new this(s);++Y<M;)P(w[Y],Y);return ee;function P(fe,de){T.resolve(fe).then(function(U){$[de]=U,++W!==M||j||(j=!0,a.resolve(ee,$))},function(U){j||(j=!0,a.reject(ee,U))})}},f.race=function(w){var T=this;if(Object.prototype.toString.call(w)!=="[object Array]")return this.reject(new TypeError("must be an array"));var M=w.length,j=!1;if(!M)return this.resolve([]);for(var $=-1,W=new this(s);++$<M;)Y=w[$],T.resolve(Y).then(function(ee){j||(j=!0,a.resolve(W,ee))},function(ee){j||(j=!0,a.reject(W,ee))});var Y;return W}},{immediate:36}],38:[function(r,n,i){var o={};(0,r("./lib/utils/common").assign)(o,r("./lib/deflate"),r("./lib/inflate"),r("./lib/zlib/constants")),n.exports=o},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(r,n,i){var o=r("./zlib/deflate"),s=r("./utils/common"),a=r("./utils/strings"),l=r("./zlib/messages"),c=r("./zlib/zstream"),d=Object.prototype.toString,f=0,p=-1,m=0,g=8;function b(w){if(!(this instanceof b))return new b(w);this.options=s.assign({level:p,method:g,chunkSize:16384,windowBits:15,memLevel:8,strategy:m,to:""},w||{});var T=this.options;T.raw&&0<T.windowBits?T.windowBits=-T.windowBits:T.gzip&&0<T.windowBits&&T.windowBits<16&&(T.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var M=o.deflateInit2(this.strm,T.level,T.method,T.windowBits,T.memLevel,T.strategy);if(M!==f)throw new Error(l[M]);if(T.header&&o.deflateSetHeader(this.strm,T.header),T.dictionary){var j;if(j=typeof T.dictionary=="string"?a.string2buf(T.dictionary):d.call(T.dictionary)==="[object ArrayBuffer]"?new Uint8Array(T.dictionary):T.dictionary,(M=o.deflateSetDictionary(this.strm,j))!==f)throw new Error(l[M]);this._dict_set=!0}}function S(w,T){var M=new b(T);if(M.push(w,!0),M.err)throw M.msg||l[M.err];return M.result}b.prototype.push=function(w,T){var M,j,$=this.strm,W=this.options.chunkSize;if(this.ended)return!1;j=T===~~T?T:T===!0?4:0,typeof w=="string"?$.input=a.string2buf(w):d.call(w)==="[object ArrayBuffer]"?$.input=new Uint8Array(w):$.input=w,$.next_in=0,$.avail_in=$.input.length;do{if($.avail_out===0&&($.output=new s.Buf8(W),$.next_out=0,$.avail_out=W),(M=o.deflate($,j))!==1&&M!==f)return this.onEnd(M),!(this.ended=!0);$.avail_out!==0&&($.avail_in!==0||j!==4&&j!==2)||(this.options.to==="string"?this.onData(a.buf2binstring(s.shrinkBuf($.output,$.next_out))):this.onData(s.shrinkBuf($.output,$.next_out)))}while((0<$.avail_in||$.avail_out===0)&&M!==1);return j===4?(M=o.deflateEnd(this.strm),this.onEnd(M),this.ended=!0,M===f):j!==2||(this.onEnd(f),!($.avail_out=0))},b.prototype.onData=function(w){this.chunks.push(w)},b.prototype.onEnd=function(w){w===f&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=w,this.msg=this.strm.msg},i.Deflate=b,i.deflate=S,i.deflateRaw=function(w,T){return(T=T||{}).raw=!0,S(w,T)},i.gzip=function(w,T){return(T=T||{}).gzip=!0,S(w,T)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(r,n,i){var o=r("./zlib/inflate"),s=r("./utils/common"),a=r("./utils/strings"),l=r("./zlib/constants"),c=r("./zlib/messages"),d=r("./zlib/zstream"),f=r("./zlib/gzheader"),p=Object.prototype.toString;function m(b){if(!(this instanceof m))return new m(b);this.options=s.assign({chunkSize:16384,windowBits:0,to:""},b||{});var S=this.options;S.raw&&0<=S.windowBits&&S.windowBits<16&&(S.windowBits=-S.windowBits,S.windowBits===0&&(S.windowBits=-15)),!(0<=S.windowBits&&S.windowBits<16)||b&&b.windowBits||(S.windowBits+=32),15<S.windowBits&&S.windowBits<48&&!(15&S.windowBits)&&(S.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new d,this.strm.avail_out=0;var w=o.inflateInit2(this.strm,S.windowBits);if(w!==l.Z_OK)throw new Error(c[w]);this.header=new f,o.inflateGetHeader(this.strm,this.header)}function g(b,S){var w=new m(S);if(w.push(b,!0),w.err)throw w.msg||c[w.err];return w.result}m.prototype.push=function(b,S){var w,T,M,j,$,W,Y=this.strm,ee=this.options.chunkSize,P=this.options.dictionary,fe=!1;if(this.ended)return!1;T=S===~~S?S:S===!0?l.Z_FINISH:l.Z_NO_FLUSH,typeof b=="string"?Y.input=a.binstring2buf(b):p.call(b)==="[object ArrayBuffer]"?Y.input=new Uint8Array(b):Y.input=b,Y.next_in=0,Y.avail_in=Y.input.length;do{if(Y.avail_out===0&&(Y.output=new s.Buf8(ee),Y.next_out=0,Y.avail_out=ee),(w=o.inflate(Y,l.Z_NO_FLUSH))===l.Z_NEED_DICT&&P&&(W=typeof P=="string"?a.string2buf(P):p.call(P)==="[object ArrayBuffer]"?new Uint8Array(P):P,w=o.inflateSetDictionary(this.strm,W)),w===l.Z_BUF_ERROR&&fe===!0&&(w=l.Z_OK,fe=!1),w!==l.Z_STREAM_END&&w!==l.Z_OK)return this.onEnd(w),!(this.ended=!0);Y.next_out&&(Y.avail_out!==0&&w!==l.Z_STREAM_END&&(Y.avail_in!==0||T!==l.Z_FINISH&&T!==l.Z_SYNC_FLUSH)||(this.options.to==="string"?(M=a.utf8border(Y.output,Y.next_out),j=Y.next_out-M,$=a.buf2string(Y.output,M),Y.next_out=j,Y.avail_out=ee-j,j&&s.arraySet(Y.output,Y.output,M,j,0),this.onData($)):this.onData(s.shrinkBuf(Y.output,Y.next_out)))),Y.avail_in===0&&Y.avail_out===0&&(fe=!0)}while((0<Y.avail_in||Y.avail_out===0)&&w!==l.Z_STREAM_END);return w===l.Z_STREAM_END&&(T=l.Z_FINISH),T===l.Z_FINISH?(w=o.inflateEnd(this.strm),this.onEnd(w),this.ended=!0,w===l.Z_OK):T!==l.Z_SYNC_FLUSH||(this.onEnd(l.Z_OK),!(Y.avail_out=0))},m.prototype.onData=function(b){this.chunks.push(b)},m.prototype.onEnd=function(b){b===l.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=b,this.msg=this.strm.msg},i.Inflate=m,i.inflate=g,i.inflateRaw=function(b,S){return(S=S||{}).raw=!0,g(b,S)},i.ungzip=g},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(r,n,i){var o=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";i.assign=function(l){for(var c=Array.prototype.slice.call(arguments,1);c.length;){var d=c.shift();if(d){if(typeof d!="object")throw new TypeError(d+"must be non-object");for(var f in d)d.hasOwnProperty(f)&&(l[f]=d[f])}}return l},i.shrinkBuf=function(l,c){return l.length===c?l:l.subarray?l.subarray(0,c):(l.length=c,l)};var s={arraySet:function(l,c,d,f,p){if(c.subarray&&l.subarray)l.set(c.subarray(d,d+f),p);else for(var m=0;m<f;m++)l[p+m]=c[d+m]},flattenChunks:function(l){var c,d,f,p,m,g;for(c=f=0,d=l.length;c<d;c++)f+=l[c].length;for(g=new Uint8Array(f),c=p=0,d=l.length;c<d;c++)m=l[c],g.set(m,p),p+=m.length;return g}},a={arraySet:function(l,c,d,f,p){for(var m=0;m<f;m++)l[p+m]=c[d+m]},flattenChunks:function(l){return[].concat.apply([],l)}};i.setTyped=function(l){l?(i.Buf8=Uint8Array,i.Buf16=Uint16Array,i.Buf32=Int32Array,i.assign(i,s)):(i.Buf8=Array,i.Buf16=Array,i.Buf32=Array,i.assign(i,a))},i.setTyped(o)},{}],42:[function(r,n,i){var o=r("./common"),s=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch{s=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{a=!1}for(var l=new o.Buf8(256),c=0;c<256;c++)l[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;function d(f,p){if(p<65537&&(f.subarray&&a||!f.subarray&&s))return String.fromCharCode.apply(null,o.shrinkBuf(f,p));for(var m="",g=0;g<p;g++)m+=String.fromCharCode(f[g]);return m}l[254]=l[254]=1,i.string2buf=function(f){var p,m,g,b,S,w=f.length,T=0;for(b=0;b<w;b++)(64512&(m=f.charCodeAt(b)))==55296&&b+1<w&&(64512&(g=f.charCodeAt(b+1)))==56320&&(m=65536+(m-55296<<10)+(g-56320),b++),T+=m<128?1:m<2048?2:m<65536?3:4;for(p=new o.Buf8(T),b=S=0;S<T;b++)(64512&(m=f.charCodeAt(b)))==55296&&b+1<w&&(64512&(g=f.charCodeAt(b+1)))==56320&&(m=65536+(m-55296<<10)+(g-56320),b++),m<128?p[S++]=m:(m<2048?p[S++]=192|m>>>6:(m<65536?p[S++]=224|m>>>12:(p[S++]=240|m>>>18,p[S++]=128|m>>>12&63),p[S++]=128|m>>>6&63),p[S++]=128|63&m);return p},i.buf2binstring=function(f){return d(f,f.length)},i.binstring2buf=function(f){for(var p=new o.Buf8(f.length),m=0,g=p.length;m<g;m++)p[m]=f.charCodeAt(m);return p},i.buf2string=function(f,p){var m,g,b,S,w=p||f.length,T=new Array(2*w);for(m=g=0;m<w;)if((b=f[m++])<128)T[g++]=b;else if(4<(S=l[b]))T[g++]=65533,m+=S-1;else{for(b&=S===2?31:S===3?15:7;1<S&&m<w;)b=b<<6|63&f[m++],S--;1<S?T[g++]=65533:b<65536?T[g++]=b:(b-=65536,T[g++]=55296|b>>10&1023,T[g++]=56320|1023&b)}return d(T,g)},i.utf8border=function(f,p){var m;for((p=p||f.length)>f.length&&(p=f.length),m=p-1;0<=m&&(192&f[m])==128;)m--;return m<0||m===0?p:m+l[f[m]]>p?m:p}},{"./common":41}],43:[function(r,n,i){n.exports=function(o,s,a,l){for(var c=65535&o|0,d=o>>>16&65535|0,f=0;a!==0;){for(a-=f=2e3<a?2e3:a;d=d+(c=c+s[l++]|0)|0,--f;);c%=65521,d%=65521}return c|d<<16|0}},{}],44:[function(r,n,i){n.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(r,n,i){var o=function(){for(var s,a=[],l=0;l<256;l++){s=l;for(var c=0;c<8;c++)s=1&s?3988292384^s>>>1:s>>>1;a[l]=s}return a}();n.exports=function(s,a,l,c){var d=o,f=c+l;s^=-1;for(var p=c;p<f;p++)s=s>>>8^d[255&(s^a[p])];return-1^s}},{}],46:[function(r,n,i){var o,s=r("../utils/common"),a=r("./trees"),l=r("./adler32"),c=r("./crc32"),d=r("./messages"),f=0,p=4,m=0,g=-2,b=-1,S=4,w=2,T=8,M=9,j=286,$=30,W=19,Y=2*j+1,ee=15,P=3,fe=258,de=fe+P+1,U=42,ne=113,R=1,le=2,Ee=3,he=4;function Fe(O,xe){return O.msg=d[xe],xe}function ye(O){return(O<<1)-(4<O?9:0)}function ze(O){for(var xe=O.length;0<=--xe;)O[xe]=0}function ue(O){var xe=O.state,F=xe.pending;F>O.avail_out&&(F=O.avail_out),F!==0&&(s.arraySet(O.output,xe.pending_buf,xe.pending_out,F,O.next_out),O.next_out+=F,xe.pending_out+=F,O.total_out+=F,O.avail_out-=F,xe.pending-=F,xe.pending===0&&(xe.pending_out=0))}function V(O,xe){a._tr_flush_block(O,0<=O.block_start?O.block_start:-1,O.strstart-O.block_start,xe),O.block_start=O.strstart,ue(O.strm)}function me(O,xe){O.pending_buf[O.pending++]=xe}function ge(O,xe){O.pending_buf[O.pending++]=xe>>>8&255,O.pending_buf[O.pending++]=255&xe}function ke(O,xe){var F,k,_=O.max_chain_length,N=O.strstart,Q=O.prev_length,pe=O.nice_match,oe=O.strstart>O.w_size-de?O.strstart-(O.w_size-de):0,Re=O.window,Ne=O.w_mask,De=O.prev,We=O.strstart+fe,Je=Re[N+Q-1],Ye=Re[N+Q];O.prev_length>=O.good_match&&(_>>=2),pe>O.lookahead&&(pe=O.lookahead);do if(Re[(F=xe)+Q]===Ye&&Re[F+Q-1]===Je&&Re[F]===Re[N]&&Re[++F]===Re[N+1]){N+=2,F++;do;while(Re[++N]===Re[++F]&&Re[++N]===Re[++F]&&Re[++N]===Re[++F]&&Re[++N]===Re[++F]&&Re[++N]===Re[++F]&&Re[++N]===Re[++F]&&Re[++N]===Re[++F]&&Re[++N]===Re[++F]&&N<We);if(k=fe-(We-N),N=We-fe,Q<k){if(O.match_start=xe,pe<=(Q=k))break;Je=Re[N+Q-1],Ye=Re[N+Q]}}while((xe=De[xe&Ne])>oe&&--_!=0);return Q<=O.lookahead?Q:O.lookahead}function ce(O){var xe,F,k,_,N,Q,pe,oe,Re,Ne,De=O.w_size;do{if(_=O.window_size-O.lookahead-O.strstart,O.strstart>=De+(De-de)){for(s.arraySet(O.window,O.window,De,De,0),O.match_start-=De,O.strstart-=De,O.block_start-=De,xe=F=O.hash_size;k=O.head[--xe],O.head[xe]=De<=k?k-De:0,--F;);for(xe=F=De;k=O.prev[--xe],O.prev[xe]=De<=k?k-De:0,--F;);_+=De}if(O.strm.avail_in===0)break;if(Q=O.strm,pe=O.window,oe=O.strstart+O.lookahead,Re=_,Ne=void 0,Ne=Q.avail_in,Re<Ne&&(Ne=Re),F=Ne===0?0:(Q.avail_in-=Ne,s.arraySet(pe,Q.input,Q.next_in,Ne,oe),Q.state.wrap===1?Q.adler=l(Q.adler,pe,Ne,oe):Q.state.wrap===2&&(Q.adler=c(Q.adler,pe,Ne,oe)),Q.next_in+=Ne,Q.total_in+=Ne,Ne),O.lookahead+=F,O.lookahead+O.insert>=P)for(N=O.strstart-O.insert,O.ins_h=O.window[N],O.ins_h=(O.ins_h<<O.hash_shift^O.window[N+1])&O.hash_mask;O.insert&&(O.ins_h=(O.ins_h<<O.hash_shift^O.window[N+P-1])&O.hash_mask,O.prev[N&O.w_mask]=O.head[O.ins_h],O.head[O.ins_h]=N,N++,O.insert--,!(O.lookahead+O.insert<P)););}while(O.lookahead<de&&O.strm.avail_in!==0)}function L(O,xe){for(var F,k;;){if(O.lookahead<de){if(ce(O),O.lookahead<de&&xe===f)return R;if(O.lookahead===0)break}if(F=0,O.lookahead>=P&&(O.ins_h=(O.ins_h<<O.hash_shift^O.window[O.strstart+P-1])&O.hash_mask,F=O.prev[O.strstart&O.w_mask]=O.head[O.ins_h],O.head[O.ins_h]=O.strstart),F!==0&&O.strstart-F<=O.w_size-de&&(O.match_length=ke(O,F)),O.match_length>=P)if(k=a._tr_tally(O,O.strstart-O.match_start,O.match_length-P),O.lookahead-=O.match_length,O.match_length<=O.max_lazy_match&&O.lookahead>=P){for(O.match_length--;O.strstart++,O.ins_h=(O.ins_h<<O.hash_shift^O.window[O.strstart+P-1])&O.hash_mask,F=O.prev[O.strstart&O.w_mask]=O.head[O.ins_h],O.head[O.ins_h]=O.strstart,--O.match_length!=0;);O.strstart++}else O.strstart+=O.match_length,O.match_length=0,O.ins_h=O.window[O.strstart],O.ins_h=(O.ins_h<<O.hash_shift^O.window[O.strstart+1])&O.hash_mask;else k=a._tr_tally(O,0,O.window[O.strstart]),O.lookahead--,O.strstart++;if(k&&(V(O,!1),O.strm.avail_out===0))return R}return O.insert=O.strstart<P-1?O.strstart:P-1,xe===p?(V(O,!0),O.strm.avail_out===0?Ee:he):O.last_lit&&(V(O,!1),O.strm.avail_out===0)?R:le}function D(O,xe){for(var F,k,_;;){if(O.lookahead<de){if(ce(O),O.lookahead<de&&xe===f)return R;if(O.lookahead===0)break}if(F=0,O.lookahead>=P&&(O.ins_h=(O.ins_h<<O.hash_shift^O.window[O.strstart+P-1])&O.hash_mask,F=O.prev[O.strstart&O.w_mask]=O.head[O.ins_h],O.head[O.ins_h]=O.strstart),O.prev_length=O.match_length,O.prev_match=O.match_start,O.match_length=P-1,F!==0&&O.prev_length<O.max_lazy_match&&O.strstart-F<=O.w_size-de&&(O.match_length=ke(O,F),O.match_length<=5&&(O.strategy===1||O.match_length===P&&4096<O.strstart-O.match_start)&&(O.match_length=P-1)),O.prev_length>=P&&O.match_length<=O.prev_length){for(_=O.strstart+O.lookahead-P,k=a._tr_tally(O,O.strstart-1-O.prev_match,O.prev_length-P),O.lookahead-=O.prev_length-1,O.prev_length-=2;++O.strstart<=_&&(O.ins_h=(O.ins_h<<O.hash_shift^O.window[O.strstart+P-1])&O.hash_mask,F=O.prev[O.strstart&O.w_mask]=O.head[O.ins_h],O.head[O.ins_h]=O.strstart),--O.prev_length!=0;);if(O.match_available=0,O.match_length=P-1,O.strstart++,k&&(V(O,!1),O.strm.avail_out===0))return R}else if(O.match_available){if((k=a._tr_tally(O,0,O.window[O.strstart-1]))&&V(O,!1),O.strstart++,O.lookahead--,O.strm.avail_out===0)return R}else O.match_available=1,O.strstart++,O.lookahead--}return O.match_available&&(k=a._tr_tally(O,0,O.window[O.strstart-1]),O.match_available=0),O.insert=O.strstart<P-1?O.strstart:P-1,xe===p?(V(O,!0),O.strm.avail_out===0?Ee:he):O.last_lit&&(V(O,!1),O.strm.avail_out===0)?R:le}function ae(O,xe,F,k,_){this.good_length=O,this.max_lazy=xe,this.nice_length=F,this.max_chain=k,this.func=_}function ie(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=T,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new s.Buf16(2*Y),this.dyn_dtree=new s.Buf16(2*(2*$+1)),this.bl_tree=new s.Buf16(2*(2*W+1)),ze(this.dyn_ltree),ze(this.dyn_dtree),ze(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new s.Buf16(ee+1),this.heap=new s.Buf16(2*j+1),ze(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new s.Buf16(2*j+1),ze(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function q(O){var xe;return O&&O.state?(O.total_in=O.total_out=0,O.data_type=w,(xe=O.state).pending=0,xe.pending_out=0,xe.wrap<0&&(xe.wrap=-xe.wrap),xe.status=xe.wrap?U:ne,O.adler=xe.wrap===2?0:1,xe.last_flush=f,a._tr_init(xe),m):Fe(O,g)}function Z(O){var xe=q(O);return xe===m&&function(F){F.window_size=2*F.w_size,ze(F.head),F.max_lazy_match=o[F.level].max_lazy,F.good_match=o[F.level].good_length,F.nice_match=o[F.level].nice_length,F.max_chain_length=o[F.level].max_chain,F.strstart=0,F.block_start=0,F.lookahead=0,F.insert=0,F.match_length=F.prev_length=P-1,F.match_available=0,F.ins_h=0}(O.state),xe}function we(O,xe,F,k,_,N){if(!O)return g;var Q=1;if(xe===b&&(xe=6),k<0?(Q=0,k=-k):15<k&&(Q=2,k-=16),_<1||M<_||F!==T||k<8||15<k||xe<0||9<xe||N<0||S<N)return Fe(O,g);k===8&&(k=9);var pe=new ie;return(O.state=pe).strm=O,pe.wrap=Q,pe.gzhead=null,pe.w_bits=k,pe.w_size=1<<pe.w_bits,pe.w_mask=pe.w_size-1,pe.hash_bits=_+7,pe.hash_size=1<<pe.hash_bits,pe.hash_mask=pe.hash_size-1,pe.hash_shift=~~((pe.hash_bits+P-1)/P),pe.window=new s.Buf8(2*pe.w_size),pe.head=new s.Buf16(pe.hash_size),pe.prev=new s.Buf16(pe.w_size),pe.lit_bufsize=1<<_+6,pe.pending_buf_size=4*pe.lit_bufsize,pe.pending_buf=new s.Buf8(pe.pending_buf_size),pe.d_buf=1*pe.lit_bufsize,pe.l_buf=3*pe.lit_bufsize,pe.level=xe,pe.strategy=N,pe.method=F,Z(O)}o=[new ae(0,0,0,0,function(O,xe){var F=65535;for(F>O.pending_buf_size-5&&(F=O.pending_buf_size-5);;){if(O.lookahead<=1){if(ce(O),O.lookahead===0&&xe===f)return R;if(O.lookahead===0)break}O.strstart+=O.lookahead,O.lookahead=0;var k=O.block_start+F;if((O.strstart===0||O.strstart>=k)&&(O.lookahead=O.strstart-k,O.strstart=k,V(O,!1),O.strm.avail_out===0)||O.strstart-O.block_start>=O.w_size-de&&(V(O,!1),O.strm.avail_out===0))return R}return O.insert=0,xe===p?(V(O,!0),O.strm.avail_out===0?Ee:he):(O.strstart>O.block_start&&(V(O,!1),O.strm.avail_out),R)}),new ae(4,4,8,4,L),new ae(4,5,16,8,L),new ae(4,6,32,32,L),new ae(4,4,16,16,D),new ae(8,16,32,32,D),new ae(8,16,128,128,D),new ae(8,32,128,256,D),new ae(32,128,258,1024,D),new ae(32,258,258,4096,D)],i.deflateInit=function(O,xe){return we(O,xe,T,15,8,0)},i.deflateInit2=we,i.deflateReset=Z,i.deflateResetKeep=q,i.deflateSetHeader=function(O,xe){return O&&O.state?O.state.wrap!==2?g:(O.state.gzhead=xe,m):g},i.deflate=function(O,xe){var F,k,_,N;if(!O||!O.state||5<xe||xe<0)return O?Fe(O,g):g;if(k=O.state,!O.output||!O.input&&O.avail_in!==0||k.status===666&&xe!==p)return Fe(O,O.avail_out===0?-5:g);if(k.strm=O,F=k.last_flush,k.last_flush=xe,k.status===U)if(k.wrap===2)O.adler=0,me(k,31),me(k,139),me(k,8),k.gzhead?(me(k,(k.gzhead.text?1:0)+(k.gzhead.hcrc?2:0)+(k.gzhead.extra?4:0)+(k.gzhead.name?8:0)+(k.gzhead.comment?16:0)),me(k,255&k.gzhead.time),me(k,k.gzhead.time>>8&255),me(k,k.gzhead.time>>16&255),me(k,k.gzhead.time>>24&255),me(k,k.level===9?2:2<=k.strategy||k.level<2?4:0),me(k,255&k.gzhead.os),k.gzhead.extra&&k.gzhead.extra.length&&(me(k,255&k.gzhead.extra.length),me(k,k.gzhead.extra.length>>8&255)),k.gzhead.hcrc&&(O.adler=c(O.adler,k.pending_buf,k.pending,0)),k.gzindex=0,k.status=69):(me(k,0),me(k,0),me(k,0),me(k,0),me(k,0),me(k,k.level===9?2:2<=k.strategy||k.level<2?4:0),me(k,3),k.status=ne);else{var Q=T+(k.w_bits-8<<4)<<8;Q|=(2<=k.strategy||k.level<2?0:k.level<6?1:k.level===6?2:3)<<6,k.strstart!==0&&(Q|=32),Q+=31-Q%31,k.status=ne,ge(k,Q),k.strstart!==0&&(ge(k,O.adler>>>16),ge(k,65535&O.adler)),O.adler=1}if(k.status===69)if(k.gzhead.extra){for(_=k.pending;k.gzindex<(65535&k.gzhead.extra.length)&&(k.pending!==k.pending_buf_size||(k.gzhead.hcrc&&k.pending>_&&(O.adler=c(O.adler,k.pending_buf,k.pending-_,_)),ue(O),_=k.pending,k.pending!==k.pending_buf_size));)me(k,255&k.gzhead.extra[k.gzindex]),k.gzindex++;k.gzhead.hcrc&&k.pending>_&&(O.adler=c(O.adler,k.pending_buf,k.pending-_,_)),k.gzindex===k.gzhead.extra.length&&(k.gzindex=0,k.status=73)}else k.status=73;if(k.status===73)if(k.gzhead.name){_=k.pending;do{if(k.pending===k.pending_buf_size&&(k.gzhead.hcrc&&k.pending>_&&(O.adler=c(O.adler,k.pending_buf,k.pending-_,_)),ue(O),_=k.pending,k.pending===k.pending_buf_size)){N=1;break}N=k.gzindex<k.gzhead.name.length?255&k.gzhead.name.charCodeAt(k.gzindex++):0,me(k,N)}while(N!==0);k.gzhead.hcrc&&k.pending>_&&(O.adler=c(O.adler,k.pending_buf,k.pending-_,_)),N===0&&(k.gzindex=0,k.status=91)}else k.status=91;if(k.status===91)if(k.gzhead.comment){_=k.pending;do{if(k.pending===k.pending_buf_size&&(k.gzhead.hcrc&&k.pending>_&&(O.adler=c(O.adler,k.pending_buf,k.pending-_,_)),ue(O),_=k.pending,k.pending===k.pending_buf_size)){N=1;break}N=k.gzindex<k.gzhead.comment.length?255&k.gzhead.comment.charCodeAt(k.gzindex++):0,me(k,N)}while(N!==0);k.gzhead.hcrc&&k.pending>_&&(O.adler=c(O.adler,k.pending_buf,k.pending-_,_)),N===0&&(k.status=103)}else k.status=103;if(k.status===103&&(k.gzhead.hcrc?(k.pending+2>k.pending_buf_size&&ue(O),k.pending+2<=k.pending_buf_size&&(me(k,255&O.adler),me(k,O.adler>>8&255),O.adler=0,k.status=ne)):k.status=ne),k.pending!==0){if(ue(O),O.avail_out===0)return k.last_flush=-1,m}else if(O.avail_in===0&&ye(xe)<=ye(F)&&xe!==p)return Fe(O,-5);if(k.status===666&&O.avail_in!==0)return Fe(O,-5);if(O.avail_in!==0||k.lookahead!==0||xe!==f&&k.status!==666){var pe=k.strategy===2?function(oe,Re){for(var Ne;;){if(oe.lookahead===0&&(ce(oe),oe.lookahead===0)){if(Re===f)return R;break}if(oe.match_length=0,Ne=a._tr_tally(oe,0,oe.window[oe.strstart]),oe.lookahead--,oe.strstart++,Ne&&(V(oe,!1),oe.strm.avail_out===0))return R}return oe.insert=0,Re===p?(V(oe,!0),oe.strm.avail_out===0?Ee:he):oe.last_lit&&(V(oe,!1),oe.strm.avail_out===0)?R:le}(k,xe):k.strategy===3?function(oe,Re){for(var Ne,De,We,Je,Ye=oe.window;;){if(oe.lookahead<=fe){if(ce(oe),oe.lookahead<=fe&&Re===f)return R;if(oe.lookahead===0)break}if(oe.match_length=0,oe.lookahead>=P&&0<oe.strstart&&(De=Ye[We=oe.strstart-1])===Ye[++We]&&De===Ye[++We]&&De===Ye[++We]){Je=oe.strstart+fe;do;while(De===Ye[++We]&&De===Ye[++We]&&De===Ye[++We]&&De===Ye[++We]&&De===Ye[++We]&&De===Ye[++We]&&De===Ye[++We]&&De===Ye[++We]&&We<Je);oe.match_length=fe-(Je-We),oe.match_length>oe.lookahead&&(oe.match_length=oe.lookahead)}if(oe.match_length>=P?(Ne=a._tr_tally(oe,1,oe.match_length-P),oe.lookahead-=oe.match_length,oe.strstart+=oe.match_length,oe.match_length=0):(Ne=a._tr_tally(oe,0,oe.window[oe.strstart]),oe.lookahead--,oe.strstart++),Ne&&(V(oe,!1),oe.strm.avail_out===0))return R}return oe.insert=0,Re===p?(V(oe,!0),oe.strm.avail_out===0?Ee:he):oe.last_lit&&(V(oe,!1),oe.strm.avail_out===0)?R:le}(k,xe):o[k.level].func(k,xe);if(pe!==Ee&&pe!==he||(k.status=666),pe===R||pe===Ee)return O.avail_out===0&&(k.last_flush=-1),m;if(pe===le&&(xe===1?a._tr_align(k):xe!==5&&(a._tr_stored_block(k,0,0,!1),xe===3&&(ze(k.head),k.lookahead===0&&(k.strstart=0,k.block_start=0,k.insert=0))),ue(O),O.avail_out===0))return k.last_flush=-1,m}return xe!==p?m:k.wrap<=0?1:(k.wrap===2?(me(k,255&O.adler),me(k,O.adler>>8&255),me(k,O.adler>>16&255),me(k,O.adler>>24&255),me(k,255&O.total_in),me(k,O.total_in>>8&255),me(k,O.total_in>>16&255),me(k,O.total_in>>24&255)):(ge(k,O.adler>>>16),ge(k,65535&O.adler)),ue(O),0<k.wrap&&(k.wrap=-k.wrap),k.pending!==0?m:1)},i.deflateEnd=function(O){var xe;return O&&O.state?(xe=O.state.status)!==U&&xe!==69&&xe!==73&&xe!==91&&xe!==103&&xe!==ne&&xe!==666?Fe(O,g):(O.state=null,xe===ne?Fe(O,-3):m):g},i.deflateSetDictionary=function(O,xe){var F,k,_,N,Q,pe,oe,Re,Ne=xe.length;if(!O||!O.state||(N=(F=O.state).wrap)===2||N===1&&F.status!==U||F.lookahead)return g;for(N===1&&(O.adler=l(O.adler,xe,Ne,0)),F.wrap=0,Ne>=F.w_size&&(N===0&&(ze(F.head),F.strstart=0,F.block_start=0,F.insert=0),Re=new s.Buf8(F.w_size),s.arraySet(Re,xe,Ne-F.w_size,F.w_size,0),xe=Re,Ne=F.w_size),Q=O.avail_in,pe=O.next_in,oe=O.input,O.avail_in=Ne,O.next_in=0,O.input=xe,ce(F);F.lookahead>=P;){for(k=F.strstart,_=F.lookahead-(P-1);F.ins_h=(F.ins_h<<F.hash_shift^F.window[k+P-1])&F.hash_mask,F.prev[k&F.w_mask]=F.head[F.ins_h],F.head[F.ins_h]=k,k++,--_;);F.strstart=k,F.lookahead=P-1,ce(F)}return F.strstart+=F.lookahead,F.block_start=F.strstart,F.insert=F.lookahead,F.lookahead=0,F.match_length=F.prev_length=P-1,F.match_available=0,O.next_in=pe,O.input=oe,O.avail_in=Q,F.wrap=N,m},i.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(r,n,i){n.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(r,n,i){n.exports=function(o,s){var a,l,c,d,f,p,m,g,b,S,w,T,M,j,$,W,Y,ee,P,fe,de,U,ne,R,le;a=o.state,l=o.next_in,R=o.input,c=l+(o.avail_in-5),d=o.next_out,le=o.output,f=d-(s-o.avail_out),p=d+(o.avail_out-257),m=a.dmax,g=a.wsize,b=a.whave,S=a.wnext,w=a.window,T=a.hold,M=a.bits,j=a.lencode,$=a.distcode,W=(1<<a.lenbits)-1,Y=(1<<a.distbits)-1;e:do{M<15&&(T+=R[l++]<<M,M+=8,T+=R[l++]<<M,M+=8),ee=j[T&W];t:for(;;){if(T>>>=P=ee>>>24,M-=P,(P=ee>>>16&255)===0)le[d++]=65535ⅇelse{if(!(16&P)){if(!(64&P)){ee=j[(65535&ee)+(T&(1<<P)-1)];continue t}if(32&P){a.mode=12;break e}o.msg="invalid literal/length code",a.mode=30;break e}fe=65535&ee,(P&=15)&&(M<P&&(T+=R[l++]<<M,M+=8),fe+=T&(1<<P)-1,T>>>=P,M-=P),M<15&&(T+=R[l++]<<M,M+=8,T+=R[l++]<<M,M+=8),ee=$[T&Y];r:for(;;){if(T>>>=P=ee>>>24,M-=P,!(16&(P=ee>>>16&255))){if(!(64&P)){ee=$[(65535&ee)+(T&(1<<P)-1)];continue r}o.msg="invalid distance code",a.mode=30;break e}if(de=65535&ee,M<(P&=15)&&(T+=R[l++]<<M,(M+=8)<P&&(T+=R[l++]<<M,M+=8)),m<(de+=T&(1<<P)-1)){o.msg="invalid distance too far back",a.mode=30;break e}if(T>>>=P,M-=P,(P=d-f)<de){if(b<(P=de-P)&&a.sane){o.msg="invalid distance too far back",a.mode=30;break e}if(ne=w,(U=0)===S){if(U+=g-P,P<fe){for(fe-=P;le[d++]=w[U++],--P;);U=d-de,ne=le}}else if(S<P){if(U+=g+S-P,(P-=S)<fe){for(fe-=P;le[d++]=w[U++],--P;);if(U=0,S<fe){for(fe-=P=S;le[d++]=w[U++],--P;);U=d-de,ne=le}}}else if(U+=S-P,P<fe){for(fe-=P;le[d++]=w[U++],--P;);U=d-de,ne=le}for(;2<fe;)le[d++]=ne[U++],le[d++]=ne[U++],le[d++]=ne[U++],fe-=3;fe&&(le[d++]=ne[U++],1<fe&&(le[d++]=ne[U++]))}else{for(U=d-de;le[d++]=le[U++],le[d++]=le[U++],le[d++]=le[U++],2<(fe-=3););fe&&(le[d++]=le[U++],1<fe&&(le[d++]=le[U++]))}break}}break}}while(l<c&&d<p);l-=fe=M>>3,T&=(1<<(M-=fe<<3))-1,o.next_in=l,o.next_out=d,o.avail_in=l<c?c-l+5:5-(l-c),o.avail_out=d<p?p-d+257:257-(d-p),a.hold=T,a.bits=M}},{}],49:[function(r,n,i){var o=r("../utils/common"),s=r("./adler32"),a=r("./crc32"),l=r("./inffast"),c=r("./inftrees"),d=1,f=2,p=0,m=-2,g=1,b=852,S=592;function w(U){return(U>>>24&255)+(U>>>8&65280)+((65280&U)<<8)+((255&U)<<24)}function T(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new o.Buf16(320),this.work=new o.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function M(U){var ne;return U&&U.state?(ne=U.state,U.total_in=U.total_out=ne.total=0,U.msg="",ne.wrap&&(U.adler=1&ne.wrap),ne.mode=g,ne.last=0,ne.havedict=0,ne.dmax=32768,ne.head=null,ne.hold=0,ne.bits=0,ne.lencode=ne.lendyn=new o.Buf32(b),ne.distcode=ne.distdyn=new o.Buf32(S),ne.sane=1,ne.back=-1,p):m}function j(U){var ne;return U&&U.state?((ne=U.state).wsize=0,ne.whave=0,ne.wnext=0,M(U)):m}function $(U,ne){var R,le;return U&&U.state?(le=U.state,ne<0?(R=0,ne=-ne):(R=1+(ne>>4),ne<48&&(ne&=15)),ne&&(ne<8||15<ne)?m:(le.window!==null&&le.wbits!==ne&&(le.window=null),le.wrap=R,le.wbits=ne,j(U))):m}function W(U,ne){var R,le;return U?(le=new T,(U.state=le).window=null,(R=$(U,ne))!==p&&(U.state=null),R):m}var Y,ee,P=!0;function fe(U){if(P){var ne;for(Y=new o.Buf32(512),ee=new o.Buf32(32),ne=0;ne<144;)U.lens[ne++]=8;for(;ne<256;)U.lens[ne++]=9;for(;ne<280;)U.lens[ne++]=7;for(;ne<288;)U.lens[ne++]=8;for(c(d,U.lens,0,288,Y,0,U.work,{bits:9}),ne=0;ne<32;)U.lens[ne++]=5;c(f,U.lens,0,32,ee,0,U.work,{bits:5}),P=!1}U.lencode=Y,U.lenbits=9,U.distcode=ee,U.distbits=5}function de(U,ne,R,le){var Ee,he=U.state;return he.window===null&&(he.wsize=1<<he.wbits,he.wnext=0,he.whave=0,he.window=new o.Buf8(he.wsize)),le>=he.wsize?(o.arraySet(he.window,ne,R-he.wsize,he.wsize,0),he.wnext=0,he.whave=he.wsize):(le<(Ee=he.wsize-he.wnext)&&(Ee=le),o.arraySet(he.window,ne,R-le,Ee,he.wnext),(le-=Ee)?(o.arraySet(he.window,ne,R-le,le,0),he.wnext=le,he.whave=he.wsize):(he.wnext+=Ee,he.wnext===he.wsize&&(he.wnext=0),he.whave<he.wsize&&(he.whave+=Ee))),0}i.inflateReset=j,i.inflateReset2=$,i.inflateResetKeep=M,i.inflateInit=function(U){return W(U,15)},i.inflateInit2=W,i.inflate=function(U,ne){var R,le,Ee,he,Fe,ye,ze,ue,V,me,ge,ke,ce,L,D,ae,ie,q,Z,we,O,xe,F,k,_=0,N=new o.Buf8(4),Q=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!U||!U.state||!U.output||!U.input&&U.avail_in!==0)return m;(R=U.state).mode===12&&(R.mode=13),Fe=U.next_out,Ee=U.output,ze=U.avail_out,he=U.next_in,le=U.input,ye=U.avail_in,ue=R.hold,V=R.bits,me=ye,ge=ze,xe=p;e:for(;;)switch(R.mode){case g:if(R.wrap===0){R.mode=13;break}for(;V<16;){if(ye===0)break e;ye--,ue+=le[he++]<<V,V+=8}if(2&R.wrap&&ue===35615){N[R.check=0]=255&ue,N[1]=ue>>>8&255,R.check=a(R.check,N,2,0),V=ue=0,R.mode=2;break}if(R.flags=0,R.head&&(R.head.done=!1),!(1&R.wrap)||(((255&ue)<<8)+(ue>>8))%31){U.msg="incorrect header check",R.mode=30;break}if((15&ue)!=8){U.msg="unknown compression method",R.mode=30;break}if(V-=4,O=8+(15&(ue>>>=4)),R.wbits===0)R.wbits=O;else if(O>R.wbits){U.msg="invalid window size",R.mode=30;break}R.dmax=1<<O,U.adler=R.check=1,R.mode=512&ue?10:12,V=ue=0;break;case 2:for(;V<16;){if(ye===0)break e;ye--,ue+=le[he++]<<V,V+=8}if(R.flags=ue,(255&R.flags)!=8){U.msg="unknown compression method",R.mode=30;break}if(57344&R.flags){U.msg="unknown header flags set",R.mode=30;break}R.head&&(R.head.text=ue>>8&1),512&R.flags&&(N[0]=255&ue,N[1]=ue>>>8&255,R.check=a(R.check,N,2,0)),V=ue=0,R.mode=3;case 3:for(;V<32;){if(ye===0)break e;ye--,ue+=le[he++]<<V,V+=8}R.head&&(R.head.time=ue),512&R.flags&&(N[0]=255&ue,N[1]=ue>>>8&255,N[2]=ue>>>16&255,N[3]=ue>>>24&255,R.check=a(R.check,N,4,0)),V=ue=0,R.mode=4;case 4:for(;V<16;){if(ye===0)break e;ye--,ue+=le[he++]<<V,V+=8}R.head&&(R.head.xflags=255&ue,R.head.os=ue>>8),512&R.flags&&(N[0]=255&ue,N[1]=ue>>>8&255,R.check=a(R.check,N,2,0)),V=ue=0,R.mode=5;case 5:if(1024&R.flags){for(;V<16;){if(ye===0)break e;ye--,ue+=le[he++]<<V,V+=8}R.length=ue,R.head&&(R.head.extra_len=ue),512&R.flags&&(N[0]=255&ue,N[1]=ue>>>8&255,R.check=a(R.check,N,2,0)),V=ue=0}else R.head&&(R.head.extra=null);R.mode=6;case 6:if(1024&R.flags&&(ye<(ke=R.length)&&(ke=ye),ke&&(R.head&&(O=R.head.extra_len-R.length,R.head.extra||(R.head.extra=new Array(R.head.extra_len)),o.arraySet(R.head.extra,le,he,ke,O)),512&R.flags&&(R.check=a(R.check,le,ke,he)),ye-=ke,he+=ke,R.length-=ke),R.length))break e;R.length=0,R.mode=7;case 7:if(2048&R.flags){if(ye===0)break e;for(ke=0;O=le[he+ke++],R.head&&O&&R.length<65536&&(R.head.name+=String.fromCharCode(O)),O&&ke<ye;);if(512&R.flags&&(R.check=a(R.check,le,ke,he)),ye-=ke,he+=ke,O)break e}else R.head&&(R.head.name=null);R.length=0,R.mode=8;case 8:if(4096&R.flags){if(ye===0)break e;for(ke=0;O=le[he+ke++],R.head&&O&&R.length<65536&&(R.head.comment+=String.fromCharCode(O)),O&&ke<ye;);if(512&R.flags&&(R.check=a(R.check,le,ke,he)),ye-=ke,he+=ke,O)break e}else R.head&&(R.head.comment=null);R.mode=9;case 9:if(512&R.flags){for(;V<16;){if(ye===0)break e;ye--,ue+=le[he++]<<V,V+=8}if(ue!==(65535&R.check)){U.msg="header crc mismatch",R.mode=30;break}V=ue=0}R.head&&(R.head.hcrc=R.flags>>9&1,R.head.done=!0),U.adler=R.check=0,R.mode=12;break;case 10:for(;V<32;){if(ye===0)break e;ye--,ue+=le[he++]<<V,V+=8}U.adler=R.check=w(ue),V=ue=0,R.mode=11;case 11:if(R.havedict===0)return U.next_out=Fe,U.avail_out=ze,U.next_in=he,U.avail_in=ye,R.hold=ue,R.bits=V,2;U.adler=R.check=1,R.mode=12;case 12:if(ne===5||ne===6)break e;case 13:if(R.last){ue>>>=7&V,V-=7&V,R.mode=27;break}for(;V<3;){if(ye===0)break e;ye--,ue+=le[he++]<<V,V+=8}switch(R.last=1&ue,V-=1,3&(ue>>>=1)){case 0:R.mode=14;break;case 1:if(fe(R),R.mode=20,ne!==6)break;ue>>>=2,V-=2;break e;case 2:R.mode=17;break;case 3:U.msg="invalid block type",R.mode=30}ue>>>=2,V-=2;break;case 14:for(ue>>>=7&V,V-=7&V;V<32;){if(ye===0)break e;ye--,ue+=le[he++]<<V,V+=8}if((65535&ue)!=(ue>>>16^65535)){U.msg="invalid stored block lengths",R.mode=30;break}if(R.length=65535&ue,V=ue=0,R.mode=15,ne===6)break e;case 15:R.mode=16;case 16:if(ke=R.length){if(ye<ke&&(ke=ye),ze<ke&&(ke=ze),ke===0)break e;o.arraySet(Ee,le,he,ke,Fe),ye-=ke,he+=ke,ze-=ke,Fe+=ke,R.length-=ke;break}R.mode=12;break;case 17:for(;V<14;){if(ye===0)break e;ye--,ue+=le[he++]<<V,V+=8}if(R.nlen=257+(31&ue),ue>>>=5,V-=5,R.ndist=1+(31&ue),ue>>>=5,V-=5,R.ncode=4+(15&ue),ue>>>=4,V-=4,286<R.nlen||30<R.ndist){U.msg="too many length or distance symbols",R.mode=30;break}R.have=0,R.mode=18;case 18:for(;R.have<R.ncode;){for(;V<3;){if(ye===0)break e;ye--,ue+=le[he++]<<V,V+=8}R.lens[Q[R.have++]]=7&ue,ue>>>=3,V-=3}for(;R.have<19;)R.lens[Q[R.have++]]=0;if(R.lencode=R.lendyn,R.lenbits=7,F={bits:R.lenbits},xe=c(0,R.lens,0,19,R.lencode,0,R.work,F),R.lenbits=F.bits,xe){U.msg="invalid code lengths set",R.mode=30;break}R.have=0,R.mode=19;case 19:for(;R.have<R.nlen+R.ndist;){for(;ae=(_=R.lencode[ue&(1<<R.lenbits)-1])>>>16&255,ie=65535&_,!((D=_>>>24)<=V);){if(ye===0)break e;ye--,ue+=le[he++]<<V,V+=8}if(ie<16)ue>>>=D,V-=D,R.lens[R.have++]=ie;else{if(ie===16){for(k=D+2;V<k;){if(ye===0)break e;ye--,ue+=le[he++]<<V,V+=8}if(ue>>>=D,V-=D,R.have===0){U.msg="invalid bit length repeat",R.mode=30;break}O=R.lens[R.have-1],ke=3+(3&ue),ue>>>=2,V-=2}else if(ie===17){for(k=D+3;V<k;){if(ye===0)break e;ye--,ue+=le[he++]<<V,V+=8}V-=D,O=0,ke=3+(7&(ue>>>=D)),ue>>>=3,V-=3}else{for(k=D+7;V<k;){if(ye===0)break e;ye--,ue+=le[he++]<<V,V+=8}V-=D,O=0,ke=11+(127&(ue>>>=D)),ue>>>=7,V-=7}if(R.have+ke>R.nlen+R.ndist){U.msg="invalid bit length repeat",R.mode=30;break}for(;ke--;)R.lens[R.have++]=O}}if(R.mode===30)break;if(R.lens[256]===0){U.msg="invalid code -- missing end-of-block",R.mode=30;break}if(R.lenbits=9,F={bits:R.lenbits},xe=c(d,R.lens,0,R.nlen,R.lencode,0,R.work,F),R.lenbits=F.bits,xe){U.msg="invalid literal/lengths set",R.mode=30;break}if(R.distbits=6,R.distcode=R.distdyn,F={bits:R.distbits},xe=c(f,R.lens,R.nlen,R.ndist,R.distcode,0,R.work,F),R.distbits=F.bits,xe){U.msg="invalid distances set",R.mode=30;break}if(R.mode=20,ne===6)break e;case 20:R.mode=21;case 21:if(6<=ye&&258<=ze){U.next_out=Fe,U.avail_out=ze,U.next_in=he,U.avail_in=ye,R.hold=ue,R.bits=V,l(U,ge),Fe=U.next_out,Ee=U.output,ze=U.avail_out,he=U.next_in,le=U.input,ye=U.avail_in,ue=R.hold,V=R.bits,R.mode===12&&(R.back=-1);break}for(R.back=0;ae=(_=R.lencode[ue&(1<<R.lenbits)-1])>>>16&255,ie=65535&_,!((D=_>>>24)<=V);){if(ye===0)break e;ye--,ue+=le[he++]<<V,V+=8}if(ae&&!(240&ae)){for(q=D,Z=ae,we=ie;ae=(_=R.lencode[we+((ue&(1<<q+Z)-1)>>q)])>>>16&255,ie=65535&_,!(q+(D=_>>>24)<=V);){if(ye===0)break e;ye--,ue+=le[he++]<<V,V+=8}ue>>>=q,V-=q,R.back+=q}if(ue>>>=D,V-=D,R.back+=D,R.length=ie,ae===0){R.mode=26;break}if(32&ae){R.back=-1,R.mode=12;break}if(64&ae){U.msg="invalid literal/length code",R.mode=30;break}R.extra=15&ae,R.mode=22;case 22:if(R.extra){for(k=R.extra;V<k;){if(ye===0)break e;ye--,ue+=le[he++]<<V,V+=8}R.length+=ue&(1<<R.extra)-1,ue>>>=R.extra,V-=R.extra,R.back+=R.extra}R.was=R.length,R.mode=23;case 23:for(;ae=(_=R.distcode[ue&(1<<R.distbits)-1])>>>16&255,ie=65535&_,!((D=_>>>24)<=V);){if(ye===0)break e;ye--,ue+=le[he++]<<V,V+=8}if(!(240&ae)){for(q=D,Z=ae,we=ie;ae=(_=R.distcode[we+((ue&(1<<q+Z)-1)>>q)])>>>16&255,ie=65535&_,!(q+(D=_>>>24)<=V);){if(ye===0)break e;ye--,ue+=le[he++]<<V,V+=8}ue>>>=q,V-=q,R.back+=q}if(ue>>>=D,V-=D,R.back+=D,64&ae){U.msg="invalid distance code",R.mode=30;break}R.offset=ie,R.extra=15&ae,R.mode=24;case 24:if(R.extra){for(k=R.extra;V<k;){if(ye===0)break e;ye--,ue+=le[he++]<<V,V+=8}R.offset+=ue&(1<<R.extra)-1,ue>>>=R.extra,V-=R.extra,R.back+=R.extra}if(R.offset>R.dmax){U.msg="invalid distance too far back",R.mode=30;break}R.mode=25;case 25:if(ze===0)break e;if(ke=ge-ze,R.offset>ke){if((ke=R.offset-ke)>R.whave&&R.sane){U.msg="invalid distance too far back",R.mode=30;break}ce=ke>R.wnext?(ke-=R.wnext,R.wsize-ke):R.wnext-ke,ke>R.length&&(ke=R.length),L=R.window}else L=Ee,ce=Fe-R.offset,ke=R.length;for(ze<ke&&(ke=ze),ze-=ke,R.length-=ke;Ee[Fe++]=L[ce++],--ke;);R.length===0&&(R.mode=21);break;case 26:if(ze===0)break e;Ee[Fe++]=R.length,ze--,R.mode=21;break;case 27:if(R.wrap){for(;V<32;){if(ye===0)break e;ye--,ue|=le[he++]<<V,V+=8}if(ge-=ze,U.total_out+=ge,R.total+=ge,ge&&(U.adler=R.check=R.flags?a(R.check,Ee,ge,Fe-ge):s(R.check,Ee,ge,Fe-ge)),ge=ze,(R.flags?ue:w(ue))!==R.check){U.msg="incorrect data check",R.mode=30;break}V=ue=0}R.mode=28;case 28:if(R.wrap&&R.flags){for(;V<32;){if(ye===0)break e;ye--,ue+=le[he++]<<V,V+=8}if(ue!==(4294967295&R.total)){U.msg="incorrect length check",R.mode=30;break}V=ue=0}R.mode=29;case 29:xe=1;break e;case 30:xe=-3;break e;case 31:return-4;case 32:default:return m}return U.next_out=Fe,U.avail_out=ze,U.next_in=he,U.avail_in=ye,R.hold=ue,R.bits=V,(R.wsize||ge!==U.avail_out&&R.mode<30&&(R.mode<27||ne!==4))&&de(U,U.output,U.next_out,ge-U.avail_out)?(R.mode=31,-4):(me-=U.avail_in,ge-=U.avail_out,U.total_in+=me,U.total_out+=ge,R.total+=ge,R.wrap&&ge&&(U.adler=R.check=R.flags?a(R.check,Ee,ge,U.next_out-ge):s(R.check,Ee,ge,U.next_out-ge)),U.data_type=R.bits+(R.last?64:0)+(R.mode===12?128:0)+(R.mode===20||R.mode===15?256:0),(me==0&&ge===0||ne===4)&&xe===p&&(xe=-5),xe)},i.inflateEnd=function(U){if(!U||!U.state)return m;var ne=U.state;return ne.window&&(ne.window=null),U.state=null,p},i.inflateGetHeader=function(U,ne){var R;return U&&U.state&&2&(R=U.state).wrap?((R.head=ne).done=!1,p):m},i.inflateSetDictionary=function(U,ne){var R,le=ne.length;return U&&U.state?(R=U.state).wrap!==0&&R.mode!==11?m:R.mode===11&&s(1,ne,le,0)!==R.check?-3:de(U,ne,le,le)?(R.mode=31,-4):(R.havedict=1,p):m},i.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(r,n,i){var o=r("../utils/common"),s=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],a=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],l=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],c=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];n.exports=function(d,f,p,m,g,b,S,w){var T,M,j,$,W,Y,ee,P,fe,de=w.bits,U=0,ne=0,R=0,le=0,Ee=0,he=0,Fe=0,ye=0,ze=0,ue=0,V=null,me=0,ge=new o.Buf16(16),ke=new o.Buf16(16),ce=null,L=0;for(U=0;U<=15;U++)ge[U]=0;for(ne=0;ne<m;ne++)ge[f[p+ne]]++;for(Ee=de,le=15;1<=le&&ge[le]===0;le--);if(le<Ee&&(Ee=le),le===0)return g[b++]=20971520,g[b++]=20971520,w.bits=1,0;for(R=1;R<le&&ge[R]===0;R++);for(Ee<R&&(Ee=R),U=ye=1;U<=15;U++)if(ye<<=1,(ye-=ge[U])<0)return-1;if(0<ye&&(d===0||le!==1))return-1;for(ke[1]=0,U=1;U<15;U++)ke[U+1]=ke[U]+ge[U];for(ne=0;ne<m;ne++)f[p+ne]!==0&&(S[ke[f[p+ne]]++]=ne);if(Y=d===0?(V=ce=S,19):d===1?(V=s,me-=257,ce=a,L-=257,256):(V=l,ce=c,-1),U=R,W=b,Fe=ne=ue=0,j=-1,$=(ze=1<<(he=Ee))-1,d===1&&852<ze||d===2&&592<ze)return 1;for(;;){for(ee=U-Fe,fe=S[ne]<Y?(P=0,S[ne]):S[ne]>Y?(P=ce[L+S[ne]],V[me+S[ne]]):(P=96,0),T=1<<U-Fe,R=M=1<<he;g[W+(ue>>Fe)+(M-=T)]=ee<<24|P<<16|fe|0,M!==0;);for(T=1<<U-1;ue&T;)T>>=1;if(T!==0?(ue&=T-1,ue+=T):ue=0,ne++,--ge[U]==0){if(U===le)break;U=f[p+S[ne]]}if(Ee<U&&(ue&$)!==j){for(Fe===0&&(Fe=Ee),W+=R,ye=1<<(he=U-Fe);he+Fe<le&&!((ye-=ge[he+Fe])<=0);)he++,ye<<=1;if(ze+=1<<he,d===1&&852<ze||d===2&&592<ze)return 1;g[j=ue&$]=Ee<<24|he<<16|W-b|0}}return ue!==0&&(g[W+ue]=U-Fe<<24|64<<16|0),w.bits=Ee,0}},{"../utils/common":41}],51:[function(r,n,i){n.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(r,n,i){var o=r("../utils/common"),s=0,a=1;function l(_){for(var N=_.length;0<=--N;)_[N]=0}var c=0,d=29,f=256,p=f+1+d,m=30,g=19,b=2*p+1,S=15,w=16,T=7,M=256,j=16,$=17,W=18,Y=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],ee=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],P=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],fe=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],de=new Array(2*(p+2));l(de);var U=new Array(2*m);l(U);var ne=new Array(512);l(ne);var R=new Array(256);l(R);var le=new Array(d);l(le);var Ee,he,Fe,ye=new Array(m);function ze(_,N,Q,pe,oe){this.static_tree=_,this.extra_bits=N,this.extra_base=Q,this.elems=pe,this.max_length=oe,this.has_stree=_&&_.length}function ue(_,N){this.dyn_tree=_,this.max_code=0,this.stat_desc=N}function V(_){return _<256?ne[_]:ne[256+(_>>>7)]}function me(_,N){_.pending_buf[_.pending++]=255&N,_.pending_buf[_.pending++]=N>>>8&255}function ge(_,N,Q){_.bi_valid>w-Q?(_.bi_buf|=N<<_.bi_valid&65535,me(_,_.bi_buf),_.bi_buf=N>>w-_.bi_valid,_.bi_valid+=Q-w):(_.bi_buf|=N<<_.bi_valid&65535,_.bi_valid+=Q)}function ke(_,N,Q){ge(_,Q[2*N],Q[2*N+1])}function ce(_,N){for(var Q=0;Q|=1&_,_>>>=1,Q<<=1,0<--N;);return Q>>>1}function L(_,N,Q){var pe,oe,Re=new Array(S+1),Ne=0;for(pe=1;pe<=S;pe++)Re[pe]=Ne=Ne+Q[pe-1]<<1;for(oe=0;oe<=N;oe++){var De=_[2*oe+1];De!==0&&(_[2*oe]=ce(Re[De]++,De))}}function D(_){var N;for(N=0;N<p;N++)_.dyn_ltree[2*N]=0;for(N=0;N<m;N++)_.dyn_dtree[2*N]=0;for(N=0;N<g;N++)_.bl_tree[2*N]=0;_.dyn_ltree[2*M]=1,_.opt_len=_.static_len=0,_.last_lit=_.matches=0}function ae(_){8<_.bi_valid?me(_,_.bi_buf):0<_.bi_valid&&(_.pending_buf[_.pending++]=_.bi_buf),_.bi_buf=0,_.bi_valid=0}function ie(_,N,Q,pe){var oe=2*N,Re=2*Q;return _[oe]<_[Re]||_[oe]===_[Re]&&pe[N]<=pe[Q]}function q(_,N,Q){for(var pe=_.heap[Q],oe=Q<<1;oe<=_.heap_len&&(oe<_.heap_len&&ie(N,_.heap[oe+1],_.heap[oe],_.depth)&&oe++,!ie(N,pe,_.heap[oe],_.depth));)_.heap[Q]=_.heap[oe],Q=oe,oe<<=1;_.heap[Q]=pe}function Z(_,N,Q){var pe,oe,Re,Ne,De=0;if(_.last_lit!==0)for(;pe=_.pending_buf[_.d_buf+2*De]<<8|_.pending_buf[_.d_buf+2*De+1],oe=_.pending_buf[_.l_buf+De],De++,pe===0?ke(_,oe,N):(ke(_,(Re=R[oe])+f+1,N),(Ne=Y[Re])!==0&&ge(_,oe-=le[Re],Ne),ke(_,Re=V(--pe),Q),(Ne=ee[Re])!==0&&ge(_,pe-=ye[Re],Ne)),De<_.last_lit;);ke(_,M,N)}function we(_,N){var Q,pe,oe,Re=N.dyn_tree,Ne=N.stat_desc.static_tree,De=N.stat_desc.has_stree,We=N.stat_desc.elems,Je=-1;for(_.heap_len=0,_.heap_max=b,Q=0;Q<We;Q++)Re[2*Q]!==0?(_.heap[++_.heap_len]=Je=Q,_.depth[Q]=0):Re[2*Q+1]=0;for(;_.heap_len<2;)Re[2*(oe=_.heap[++_.heap_len]=Je<2?++Je:0)]=1,_.depth[oe]=0,_.opt_len--,De&&(_.static_len-=Ne[2*oe+1]);for(N.max_code=Je,Q=_.heap_len>>1;1<=Q;Q--)q(_,Re,Q);for(oe=We;Q=_.heap[1],_.heap[1]=_.heap[_.heap_len--],q(_,Re,1),pe=_.heap[1],_.heap[--_.heap_max]=Q,_.heap[--_.heap_max]=pe,Re[2*oe]=Re[2*Q]+Re[2*pe],_.depth[oe]=(_.depth[Q]>=_.depth[pe]?_.depth[Q]:_.depth[pe])+1,Re[2*Q+1]=Re[2*pe+1]=oe,_.heap[1]=oe++,q(_,Re,1),2<=_.heap_len;);_.heap[--_.heap_max]=_.heap[1],function(Ye,Gt){var Ar,pr,en,Et,Yn,Nn,rr=Gt.dyn_tree,Jn=Gt.max_code,$i=Gt.stat_desc.static_tree,dr=Gt.stat_desc.has_stree,Hr=Gt.stat_desc.extra_bits,tn=Gt.stat_desc.extra_base,mt=Gt.stat_desc.max_length,Rr=0;for(Et=0;Et<=S;Et++)Ye.bl_count[Et]=0;for(rr[2*Ye.heap[Ye.heap_max]+1]=0,Ar=Ye.heap_max+1;Ar<b;Ar++)mt<(Et=rr[2*rr[2*(pr=Ye.heap[Ar])+1]+1]+1)&&(Et=mt,Rr++),rr[2*pr+1]=Et,Jn<pr||(Ye.bl_count[Et]++,Yn=0,tn<=pr&&(Yn=Hr[pr-tn]),Nn=rr[2*pr],Ye.opt_len+=Nn*(Et+Yn),dr&&(Ye.static_len+=Nn*($i[2*pr+1]+Yn)));if(Rr!==0){do{for(Et=mt-1;Ye.bl_count[Et]===0;)Et--;Ye.bl_count[Et]--,Ye.bl_count[Et+1]+=2,Ye.bl_count[mt]--,Rr-=2}while(0<Rr);for(Et=mt;Et!==0;Et--)for(pr=Ye.bl_count[Et];pr!==0;)Jn<(en=Ye.heap[--Ar])||(rr[2*en+1]!==Et&&(Ye.opt_len+=(Et-rr[2*en+1])*rr[2*en],rr[2*en+1]=Et),pr--)}}(_,N),L(Re,Je,_.bl_count)}function O(_,N,Q){var pe,oe,Re=-1,Ne=N[1],De=0,We=7,Je=4;for(Ne===0&&(We=138,Je=3),N[2*(Q+1)+1]=65535,pe=0;pe<=Q;pe++)oe=Ne,Ne=N[2*(pe+1)+1],++De<We&&oe===Ne||(De<Je?_.bl_tree[2*oe]+=De:oe!==0?(oe!==Re&&_.bl_tree[2*oe]++,_.bl_tree[2*j]++):De<=10?_.bl_tree[2*$]++:_.bl_tree[2*W]++,Re=oe,Je=(De=0)===Ne?(We=138,3):oe===Ne?(We=6,3):(We=7,4))}function xe(_,N,Q){var pe,oe,Re=-1,Ne=N[1],De=0,We=7,Je=4;for(Ne===0&&(We=138,Je=3),pe=0;pe<=Q;pe++)if(oe=Ne,Ne=N[2*(pe+1)+1],!(++De<We&&oe===Ne)){if(De<Je)for(;ke(_,oe,_.bl_tree),--De!=0;);else oe!==0?(oe!==Re&&(ke(_,oe,_.bl_tree),De--),ke(_,j,_.bl_tree),ge(_,De-3,2)):De<=10?(ke(_,$,_.bl_tree),ge(_,De-3,3)):(ke(_,W,_.bl_tree),ge(_,De-11,7));Re=oe,Je=(De=0)===Ne?(We=138,3):oe===Ne?(We=6,3):(We=7,4)}}l(ye);var F=!1;function k(_,N,Q,pe){ge(_,(c<<1)+(pe?1:0),3),function(oe,Re,Ne,De){ae(oe),me(oe,Ne),me(oe,~Ne),o.arraySet(oe.pending_buf,oe.window,Re,Ne,oe.pending),oe.pending+=Ne}(_,N,Q)}i._tr_init=function(_){F||(function(){var N,Q,pe,oe,Re,Ne=new Array(S+1);for(oe=pe=0;oe<d-1;oe++)for(le[oe]=pe,N=0;N<1<<Y[oe];N++)R[pe++]=oe;for(R[pe-1]=oe,oe=Re=0;oe<16;oe++)for(ye[oe]=Re,N=0;N<1<<ee[oe];N++)ne[Re++]=oe;for(Re>>=7;oe<m;oe++)for(ye[oe]=Re<<7,N=0;N<1<<ee[oe]-7;N++)ne[256+Re++]=oe;for(Q=0;Q<=S;Q++)Ne[Q]=0;for(N=0;N<=143;)de[2*N+1]=8,N++,Ne[8]++;for(;N<=255;)de[2*N+1]=9,N++,Ne[9]++;for(;N<=279;)de[2*N+1]=7,N++,Ne[7]++;for(;N<=287;)de[2*N+1]=8,N++,Ne[8]++;for(L(de,p+1,Ne),N=0;N<m;N++)U[2*N+1]=5,U[2*N]=ce(N,5);Ee=new ze(de,Y,f+1,p,S),he=new ze(U,ee,0,m,S),Fe=new ze(new Array(0),P,0,g,T)}(),F=!0),_.l_desc=new ue(_.dyn_ltree,Ee),_.d_desc=new ue(_.dyn_dtree,he),_.bl_desc=new ue(_.bl_tree,Fe),_.bi_buf=0,_.bi_valid=0,D(_)},i._tr_stored_block=k,i._tr_flush_block=function(_,N,Q,pe){var oe,Re,Ne=0;0<_.level?(_.strm.data_type===2&&(_.strm.data_type=function(De){var We,Je=4093624447;for(We=0;We<=31;We++,Je>>>=1)if(1&Je&&De.dyn_ltree[2*We]!==0)return s;if(De.dyn_ltree[18]!==0||De.dyn_ltree[20]!==0||De.dyn_ltree[26]!==0)return a;for(We=32;We<f;We++)if(De.dyn_ltree[2*We]!==0)return a;return s}(_)),we(_,_.l_desc),we(_,_.d_desc),Ne=function(De){var We;for(O(De,De.dyn_ltree,De.l_desc.max_code),O(De,De.dyn_dtree,De.d_desc.max_code),we(De,De.bl_desc),We=g-1;3<=We&&De.bl_tree[2*fe[We]+1]===0;We--);return De.opt_len+=3*(We+1)+5+5+4,We}(_),oe=_.opt_len+3+7>>>3,(Re=_.static_len+3+7>>>3)<=oe&&(oe=Re)):oe=Re=Q+5,Q+4<=oe&&N!==-1?k(_,N,Q,pe):_.strategy===4||Re===oe?(ge(_,2+(pe?1:0),3),Z(_,de,U)):(ge(_,4+(pe?1:0),3),function(De,We,Je,Ye){var Gt;for(ge(De,We-257,5),ge(De,Je-1,5),ge(De,Ye-4,4),Gt=0;Gt<Ye;Gt++)ge(De,De.bl_tree[2*fe[Gt]+1],3);xe(De,De.dyn_ltree,We-1),xe(De,De.dyn_dtree,Je-1)}(_,_.l_desc.max_code+1,_.d_desc.max_code+1,Ne+1),Z(_,_.dyn_ltree,_.dyn_dtree)),D(_),pe&&ae(_)},i._tr_tally=function(_,N,Q){return _.pending_buf[_.d_buf+2*_.last_lit]=N>>>8&255,_.pending_buf[_.d_buf+2*_.last_lit+1]=255&N,_.pending_buf[_.l_buf+_.last_lit]=255&Q,_.last_lit++,N===0?_.dyn_ltree[2*Q]++:(_.matches++,N--,_.dyn_ltree[2*(R[Q]+f+1)]++,_.dyn_dtree[2*V(N)]++),_.last_lit===_.lit_bufsize-1},i._tr_align=function(_){ge(_,2,3),ke(_,M,de),function(N){N.bi_valid===16?(me(N,N.bi_buf),N.bi_buf=0,N.bi_valid=0):8<=N.bi_valid&&(N.pending_buf[N.pending++]=255&N.bi_buf,N.bi_buf>>=8,N.bi_valid-=8)}(_)}},{"../utils/common":41}],53:[function(r,n,i){n.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(r,n,i){(function(o){(function(s,a){if(!s.setImmediate){var l,c,d,f,p=1,m={},g=!1,b=s.document,S=Object.getPrototypeOf&&Object.getPrototypeOf(s);S=S&&S.setTimeout?S:s,l={}.toString.call(s.process)==="[object process]"?function(j){gt.nextTick(function(){T(j)})}:function(){if(s.postMessage&&!s.importScripts){var j=!0,$=s.onmessage;return s.onmessage=function(){j=!1},s.postMessage("","*"),s.onmessage=$,j}}()?(f="setImmediate$"+Math.random()+"$",s.addEventListener?s.addEventListener("message",M,!1):s.attachEvent("onmessage",M),function(j){s.postMessage(f+j,"*")}):s.MessageChannel?((d=new MessageChannel).port1.onmessage=function(j){T(j.data)},function(j){d.port2.postMessage(j)}):b&&"onreadystatechange"in b.createElement("script")?(c=b.documentElement,function(j){var $=b.createElement("script");$.onreadystatechange=function(){T(j),$.onreadystatechange=null,c.removeChild($),$=null},c.appendChild($)}):function(j){setTimeout(T,0,j)},S.setImmediate=function(j){typeof j!="function"&&(j=new Function(""+j));for(var $=new Array(arguments.length-1),W=0;W<$.length;W++)$[W]=arguments[W+1];var Y={callback:j,args:$};return m[p]=Y,l(p),p++},S.clearImmediate=w}function w(j){delete m[j]}function T(j){if(g)setTimeout(T,0,j);else{var $=m[j];if($){g=!0;try{(function(W){var Y=W.callback,ee=W.args;switch(ee.length){case 0:Y();break;case 1:Y(ee[0]);break;case 2:Y(ee[0],ee[1]);break;case 3:Y(ee[0],ee[1],ee[2]);break;default:Y.apply(a,ee)}})($)}finally{w(j),g=!1}}}}function M(j){j.source===s&&typeof j.data=="string"&&j.data.indexOf(f)===0&&T(+j.data.slice(f.length))}})(typeof self>"u"?o===void 0?this:o:self)}).call(this,typeof mo<"u"?mo:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(e2);var Goe=e2.exports;const Koe=$D(Goe);var vy={exports:{}},qoe={"&":"&",'"':""","'":"'","<":"<",">":">"};function Xoe(t){return t&&t.replace?t.replace(/([&"<>'])/g,function(e,r){return qoe[r]}):t}var Yoe=Xoe,h1=Yoe,eR=ek.Stream,Joe=" ";function Zoe(t,e){typeof e!="object"&&(e={indent:e});var r=e.stream?new eR:null,n="",i=!1,o=e.indent?e.indent===!0?Joe:e.indent:"",s=!0;function a(p){s?gt.nextTick(p):p()}function l(p,m){if(m!==void 0&&(n+=m),p&&!i&&(r=r||new eR,i=!0),p&&i){var g=n;a(function(){r.emit("data",g)}),n=""}}function c(p,m){fk(l,by(p,o,o?1:0),m)}function d(){if(r){var p=n;a(function(){r.emit("data",p),r.emit("end"),r.readable=!1,r.emit("close")})}}function f(p){var m=p.encoding||"UTF-8",g={version:"1.0",encoding:m};p.standalone&&(g.standalone=p.standalone),c({"?xml":{_attr:g}}),n=n.replace("/>","?>")}return a(function(){s=!1}),e.declaration&&f(e.declaration),t&&t.forEach?t.forEach(function(p,m){var g;m+1===t.length&&(g=d),c(p,g)}):c(t,d),r?(r.readable=!0,r):n}function Qoe(){var t=Array.prototype.slice.call(arguments),e={_elem:by(t)};return e.push=function(r){if(!this.append)throw new Error("not assigned to a parent!");var n=this,i=this._elem.indent;fk(this.append,by(r,i,this._elem.icount+(i?1:0)),function(){n.append(!0)})},e.close=function(r){r!==void 0&&this.push(r),this.end&&this.end()},e}function ese(t,e){return new Array(e||0).join(t||"")}function by(t,e,r){r=r||0;var n=ese(e,r),i,o=t,s=!1;if(typeof t=="object"){var a=Object.keys(t);if(i=a[0],o=t[i],o&&o._elem)return o._elem.name=i,o._elem.icount=r,o._elem.indent=e,o._elem.indents=n,o._elem.interrupt=o,o._elem}var l=[],c=[],d;function f(p){var m=Object.keys(p);m.forEach(function(g){l.push(tse(g,p[g]))})}switch(typeof o){case"object":if(o===null)break;o._attr&&f(o._attr),o._cdata&&c.push(("<![CDATA["+o._cdata).replace(/\]\]>/g,"]]]]><![CDATA[>")+"]]>"),o.forEach&&(d=!1,c.push(""),o.forEach(function(p){if(typeof p=="object"){var m=Object.keys(p)[0];m=="_attr"?f(p._attr):c.push(by(p,e,r+1))}else c.pop(),d=!0,c.push(h1(p))}),d||c.push(""));break;default:c.push(h1(o))}return{name:i,interrupt:s,attributes:l,content:c,icount:r,indents:n,indent:e}}function fk(t,e,r){if(typeof e!="object")return t(!1,e);var n=e.interrupt?1:e.content.length;function i(){for(;e.content.length;){var s=e.content.shift();if(s!==void 0){if(o(s))return;fk(t,s)}}t(!1,(n>1?e.indents:"")+(e.name?"</"+e.name+">":"")+(e.indent&&!r?`
|
|
311
|
+
`:"")),r&&r()}function o(s){return s.interrupt?(s.interrupt.append=t,s.interrupt.end=i,s.interrupt=!1,t(!0),!0):!1}if(t(!1,e.indents+(e.name?"<"+e.name:"")+(e.attributes.length?" "+e.attributes.join(" "):"")+(n?e.name?">":"":e.name?"/>":"")+(e.indent&&n>1?`
|
|
312
|
+
`:"")),!n)return t(!1,e.indent?`
|
|
313
|
+
`:"");o(e)||i()}function tse(t,e){return t+'="'+h1(e)+'"'}vy.exports=Zoe;vy.exports.element=vy.exports.Element=Qoe;var rse=vy.exports;const lr=$D(rse),tR=0,rR=32,nse=32,ise=(t,e)=>{const r=e.replace(/-/g,"");if(r.length!==nse)throw new Error(`Error: Cannot extract GUID from font filename: ${e}`);const i=r.replace(/(..)/g,"$1 ").trim().split(" ").map(l=>parseInt(l,16));i.reverse();const s=t.slice(tR,rR).map((l,c)=>l^i[c%i.length]);return Buffer.concat([t.slice(0,tR),s,t.slice(rR)])};class ose{format(e,r={stack:[]}){const n=e.prepForXml(r);if(n)return n;throw Error("XMLComponent did not format correctly")}}class sse{replace(e,r,n){let i=e;return r.forEach((o,s)=>{i=i.replace(new RegExp(`{${o.fileName}}`,"g"),(n+s).toString())}),i}getMediaData(e,r){return r.Array.filter(n=>e.search(`{${n.fileName}}`)>0)}}class ase{replace(e,r){let n=e;for(const i of r)n=n.replace(new RegExp(`{${i.reference}-${i.instance}}`,"g"),i.numId.toString());return n}}class lse{constructor(){Ae(this,"formatter"),Ae(this,"imageReplacer"),Ae(this,"numberingReplacer"),this.formatter=new ose,this.imageReplacer=new sse,this.numberingReplacer=new ase}compile(e,r){const n=new Koe,i=this.xmlifyFile(e,r),o=new Map(Object.entries(i));for(const[,s]of o)if(Array.isArray(s))for(const a of s)n.file(a.path,a.data);else n.file(s.path,s.data);for(const s of e.Media.Array)s.type!=="svg"?n.file(`word/media/${s.fileName}`,s.data):(n.file(`word/media/${s.fileName}`,s.data),n.file(`word/media/${s.fallback.fileName}`,s.fallback.data));for(const{data:s,name:a,fontKey:l}of e.FontTable.fontOptionsWithKey){const[c]=a.split(".");n.file(`word/fonts/${c}.odttf`,ise(s,l))}return n}xmlifyFile(e,r){const n=e.Document.Relationships.RelationshipCount+1,i=lr(this.formatter.format(e.Document.View,{viewWrapper:e.Document,file:e,stack:[]}),{indent:r,declaration:{standalone:"yes",encoding:"UTF-8"}}),o=this.imageReplacer.getMediaData(i,e.Media);return{Relationships:{data:(o.forEach((s,a)=>{e.Document.Relationships.createRelationship(n+a,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${s.fileName}`)}),lr(this.formatter.format(e.Document.Relationships,{viewWrapper:e.Document,file:e,stack:[]}),{indent:r,declaration:{encoding:"UTF-8"}})),path:"word/_rels/document.xml.rels"},Document:{data:(()=>{const s=this.imageReplacer.replace(i,o,n);return this.numberingReplacer.replace(s,e.Numbering.ConcreteNumbering)})(),path:"word/document.xml"},Styles:{data:(()=>{const s=lr(this.formatter.format(e.Styles,{viewWrapper:e.Document,file:e,stack:[]}),{indent:r,declaration:{standalone:"yes",encoding:"UTF-8"}});return this.numberingReplacer.replace(s,e.Numbering.ConcreteNumbering)})(),path:"word/styles.xml"},Properties:{data:lr(this.formatter.format(e.CoreProperties,{viewWrapper:e.Document,file:e,stack:[]}),{indent:r,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"docProps/core.xml"},Numbering:{data:lr(this.formatter.format(e.Numbering,{viewWrapper:e.Document,file:e,stack:[]}),{indent:r,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/numbering.xml"},FileRelationships:{data:lr(this.formatter.format(e.FileRelationships,{viewWrapper:e.Document,file:e,stack:[]}),{indent:r,declaration:{encoding:"UTF-8"}}),path:"_rels/.rels"},HeaderRelationships:e.Headers.map((s,a)=>{const l=lr(this.formatter.format(s.View,{viewWrapper:s,file:e,stack:[]}),{indent:r,declaration:{encoding:"UTF-8"}});return this.imageReplacer.getMediaData(l,e.Media).forEach((d,f)=>{s.Relationships.createRelationship(f,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${d.fileName}`)}),{data:lr(this.formatter.format(s.Relationships,{viewWrapper:s,file:e,stack:[]}),{indent:r,declaration:{encoding:"UTF-8"}}),path:`word/_rels/header${a+1}.xml.rels`}}),FooterRelationships:e.Footers.map((s,a)=>{const l=lr(this.formatter.format(s.View,{viewWrapper:s,file:e,stack:[]}),{indent:r,declaration:{encoding:"UTF-8"}});return this.imageReplacer.getMediaData(l,e.Media).forEach((d,f)=>{s.Relationships.createRelationship(f,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${d.fileName}`)}),{data:lr(this.formatter.format(s.Relationships,{viewWrapper:s,file:e,stack:[]}),{indent:r,declaration:{encoding:"UTF-8"}}),path:`word/_rels/footer${a+1}.xml.rels`}}),Headers:e.Headers.map((s,a)=>{const l=lr(this.formatter.format(s.View,{viewWrapper:s,file:e,stack:[]}),{indent:r,declaration:{encoding:"UTF-8"}}),c=this.imageReplacer.getMediaData(l,e.Media),d=this.imageReplacer.replace(l,c,0);return{data:this.numberingReplacer.replace(d,e.Numbering.ConcreteNumbering),path:`word/header${a+1}.xml`}}),Footers:e.Footers.map((s,a)=>{const l=lr(this.formatter.format(s.View,{viewWrapper:s,file:e,stack:[]}),{indent:r,declaration:{encoding:"UTF-8"}}),c=this.imageReplacer.getMediaData(l,e.Media),d=this.imageReplacer.replace(l,c,0);return{data:this.numberingReplacer.replace(d,e.Numbering.ConcreteNumbering),path:`word/footer${a+1}.xml`}}),ContentTypes:{data:lr(this.formatter.format(e.ContentTypes,{viewWrapper:e.Document,file:e,stack:[]}),{indent:r,declaration:{encoding:"UTF-8"}}),path:"[Content_Types].xml"},CustomProperties:{data:lr(this.formatter.format(e.CustomProperties,{viewWrapper:e.Document,file:e,stack:[]}),{indent:r,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"docProps/custom.xml"},AppProperties:{data:lr(this.formatter.format(e.AppProperties,{viewWrapper:e.Document,file:e,stack:[]}),{indent:r,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"docProps/app.xml"},FootNotes:{data:lr(this.formatter.format(e.FootNotes.View,{viewWrapper:e.FootNotes,file:e,stack:[]}),{indent:r,declaration:{encoding:"UTF-8"}}),path:"word/footnotes.xml"},FootNotesRelationships:{data:lr(this.formatter.format(e.FootNotes.Relationships,{viewWrapper:e.FootNotes,file:e,stack:[]}),{indent:r,declaration:{encoding:"UTF-8"}}),path:"word/_rels/footnotes.xml.rels"},Settings:{data:lr(this.formatter.format(e.Settings,{viewWrapper:e.Document,file:e,stack:[]}),{indent:r,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/settings.xml"},Comments:{data:lr(this.formatter.format(e.Comments,{viewWrapper:e.Document,file:e,stack:[]}),{indent:r,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/comments.xml"},FontTable:{data:lr(this.formatter.format(e.FontTable.View,{viewWrapper:e.Document,file:e,stack:[]}),{indent:r,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/fontTable.xml"},FontTableRelationships:{data:lr(this.formatter.format(e.FontTable.Relationships,{viewWrapper:e.Document,file:e,stack:[]}),{indent:r,declaration:{encoding:"UTF-8"}}),path:"word/_rels/fontTable.xml.rels"}}}}const cse={NONE:"",WITH_2_BLANKS:" ",WITH_4_BLANKS:" ",WITH_TAB:" "},Bf=t=>t===!0?cse.WITH_2_BLANKS:t===!1?void 0:t;class t2{static toString(e,r){return pm(this,null,function*(){return yield this.compiler.compile(e,Bf(r)).generateAsync({type:"string",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",compression:"DEFLATE"})})}static toBuffer(e,r){return pm(this,null,function*(){return yield this.compiler.compile(e,Bf(r)).generateAsync({type:"nodebuffer",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",compression:"DEFLATE"})})}static toBase64String(e,r){return pm(this,null,function*(){return yield this.compiler.compile(e,Bf(r)).generateAsync({type:"base64",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",compression:"DEFLATE"})})}static toBlob(e,r){return pm(this,null,function*(){return yield this.compiler.compile(e,Bf(r)).generateAsync({type:"blob",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",compression:"DEFLATE"})})}static toStream(e,r){const n=new ek.Stream;return this.compiler.compile(e,Bf(r)).generateAsync({type:"nodebuffer",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",compression:"DEFLATE"}).then(o=>{n.emit("data",o),n.emit("end")}),n}}Ae(t2,"compiler",new lse);var hk={exports:{}};function use(t){return t.toString("ascii",0,2)==="BM"}function dse(t){return{width:t.readUInt32LE(18),height:Math.abs(t.readInt32LE(22))}}var fse={detect:use,calculate:dse},hse=1,pse=6,mse=16;function gse(t){var e;return t.readUInt16LE(0)!==0?!1:(e=t.readUInt16LE(2),e===hse)}function nR(t,e){var r=t.readUInt8(e);return r===0?256:r}function iR(t,e){var r=pse+e*mse;return{width:nR(t,r),height:nR(t,r+1)}}function yse(t){var e=t.readUInt16LE(4),r=iR(t,0),n;if(e===1)return r;for(r.images=[{width:r.width,height:r.height}],n=1;n<e;n+=1)r.images.push(iR(t,n));return r}var r2={detect:gse,calculate:yse},vse=2;function bse(t){var e;return t.readUInt16LE(0)!==0?!1:(e=t.readUInt16LE(2),e===vse)}var wse={detect:bse,calculate:r2.calculate};function xse(t){return t.readUInt32LE(0)===542327876}function Sse(t){return{height:t.readUInt32LE(12),width:t.readUInt32LE(16)}}var kse={detect:xse,calculate:Sse},_se=/^GIF8[79]a/;function Cse(t){var e=t.toString("ascii",0,6);return _se.test(e)}function Ese(t){return{width:t.readUInt16LE(6),height:t.readUInt16LE(8)}}var Tse={detect:Cse,calculate:Ese};function Ase(t){var e=t.toString("hex",0,2);return e==="ffd8"}function Rse(t,e){return{height:t.readUInt16BE(e),width:t.readUInt16BE(e+2)}}function Ise(t,e){if(e>t.length)throw new TypeError("Corrupt JPG, exceeded buffer limits");if(t[e]!==255)throw new TypeError("Invalid JPG, marker table corrupted")}function Ose(t){t=t.slice(4);for(var e,r;t.length;){if(e=t.readUInt16BE(0),Ise(t,e),r=t[e+1],r===192||r===193||r===194)return Rse(t,e+5);t=t.slice(e+2)}throw new TypeError("Invalid JPG, no size found")}var Mse={detect:Ase,calculate:Ose},Nse=`PNG\r
|
|
314
|
+
|
|
315
|
+
`,Dse="IHDR",n2="CgBI";function Pse(t){if(Nse===t.toString("ascii",1,8)){var e=t.toString("ascii",12,16);if(e===n2&&(e=t.toString("ascii",28,32)),e!==Dse)throw new TypeError("invalid png");return!0}}function Lse(t){return t.toString("ascii",12,16)===n2?{width:t.readUInt32BE(32),height:t.readUInt32BE(36)}:{width:t.readUInt32BE(16),height:t.readUInt32BE(20)}}var Fse={detect:Pse,calculate:Lse};function jse(t){return t.toString("ascii",0,4)==="8BPS"}function Bse(t){return{width:t.readUInt32BE(18),height:t.readUInt32BE(14)}}var zse={detect:jse,calculate:Bse},Hse=/<svg[^>]+[^>]*>/;function $se(t){return Hse.test(t)}var Jm={root:/<svg\s[^>]+>/,width:/\bwidth=(['"])([^%]+?)\1/,height:/\bheight=(['"])([^%]+?)\1/,viewbox:/\bviewBox=(['"])(.+?)\1/};function Use(t){var e=t.split(" ");return{width:parseInt(e[2],10),height:parseInt(e[3],10)}}function Wse(t){var e=t.match(Jm.width),r=t.match(Jm.height),n=t.match(Jm.viewbox);return{width:e&&parseInt(e[2],10),height:r&&parseInt(r[2],10),viewbox:n&&Use(n[2])}}function Vse(t){return{width:t.width,height:t.height}}function Gse(t){var e=t.viewbox.width/t.viewbox.height;return t.width?{width:t.width,height:Math.floor(t.width/e)}:t.height?{width:Math.floor(t.height*e),height:t.height}:{width:t.viewbox.width,height:t.viewbox.height}}function Kse(t){var e=t.toString("utf8").match(Jm.root);if(e){var r=Wse(e[0]);if(r.width&&r.height)return Vse(r);if(r.viewbox)return Gse(r)}throw new TypeError("invalid svg")}var qse={detect:$se,calculate:Kse};function Xse(t){var e=t.toString("ascii",0,4)==="RIFF",r=t.toString("ascii",8,12)==="WEBP",n=t.toString("ascii",12,15)==="VP8";return e&&r&&n}function Yse(t){var e=t.toString("ascii",12,16);if(t=t.slice(20,30),e==="VP8X"){var r=t[0],n=(r&192)===0,i=(r&1)===0;return n&&i?Jse(t):!1}if(e==="VP8 "&&t[0]!==47)return Qse(t);var o=t.toString("hex",3,6);return e==="VP8L"&&o!=="9d012a"?Zse(t):!1}function Jse(t){return{width:1+t.readUIntLE(4,3),height:1+t.readUIntLE(7,3)}}function Zse(t){return{width:1+((t[2]&63)<<8|t[1]),height:1+((t[4]&15)<<10|t[3]<<2|(t[2]&192)>>6)}}function Qse(t){return{width:t.readInt16LE(6)&16383,height:t.readInt16LE(8)&16383}}var eae={detect:Xse,calculate:Yse},tae={bmp:fse,cur:wse,dds:kse,gif:Tse,ico:r2,jpg:Mse,png:Fse,psd:zse,svg:qse,webp:eae},i2=tae,oR=i2,rae=function(t){var e,r;for(e in oR)if(r=oR[e].detect(t),r)return e},p1=i2,nae=rae;function iae(t){var e=nae(t);if(e in p1){var r=p1[e].calculate(t);if(r!==!1)return r.type=e,r}throw new TypeError("unsupported file type: "+e)}hk.exports=function(t){if(Buffer.isBuffer(t))return iae(t);throw new TypeError("expecting only a buffer as input")};hk.exports.types=Object.keys(p1);var oae=hk.exports;const sae=W1(oae);function o2(t){return{alignment:An.START,style:{paragraph:{indent:{left:zn(t),hanging:zn(.18)}}}}}const aae=Array(3).fill([$n.DECIMAL,$n.LOWER_LETTER,$n.LOWER_ROMAN]).flat().map((t,e)=>Object.assign({level:e,format:t,text:`%${e+1}.`},o2((e+1)/2))),lae=Array(3).fill(["●","○","■"]).flat().map((t,e)=>Object.assign({level:e,format:$n.BULLET,text:t},o2((e+1)/2))),cae={numbered:aae,bullets:lae};function uae(t,e){return{reference:t,levels:cae[e]}}function sR(){return Math.random().toString(36).substr(2,9)}function dae(t){return new $oe({footnotes:t.footnotes,numbering:{config:t.numbering},sections:[{properties:{type:Wne.CONTINUOUS},children:t.children}]})}function aR(t){let e="";return t.forEach(r=>{r.isText&&(e+=r.text)}),e}const S0=600;function lR(t,e,r,n){const i=r?[new Li(r)]:[],o=[];return new W3({id:t,children:[...i,new sne(e),...o]})}class fae{constructor(e,r,n){this.footnotes={},this.current=[],this.maxImageWidth=S0,this.$footnoteCounter=0,this.nodes=e,this.marks=r,this.options=n??{},this.children=[],this.numbering=[]}renderContent(e,r){e.forEach((n,i,o)=>{r&&this.addParagraphOptions(r),this.render(n,e,o)})}render(e,r,n){if(typeof r=="number")throw new Error("!");if(!this.nodes[e.type.name])throw new Error(`Token type \`${e.type.name}\` not supported by Word renderer`);this.nodes[e.type.name](this,e,r,n)}renderMarks(e,r){return r.map(n=>{var i,o;return(o=(i=this.marks)[n.type.name])===null||o===void 0?void 0:o.call(i,this,e,n)}).reduce((n,i)=>Object.assign(Object.assign({},n),i),{})}renderInline(e){let r;const n=()=>{if(!r)return;const s=new U3({link:r.link,children:this.current});this.current=[...r.stack,s],r=void 0},i=s=>{const a=s===(r==null?void 0:r.link);this.addRunOptions({style:"Hyperlink"});{if(r&&a)return;r&&!a&&n()}r={link:s,stack:this.current},this.current=[]},o=(s,a,l)=>{const c=s.marks.filter(f=>f.type.name==="link"),d=c.length>0;d?i(c[0].attrs.href):!d&&r&&n(),s.isText?this.text(s.text,this.renderMarks(s,[...s.marks])):this.render(s,e,l)};e.forEach(o),n()}renderList(e,r){if(this.currentNumbering){const{reference:n,level:i}=this.currentNumbering;this.currentNumbering={reference:n,level:i+1}}else{const n=sR();this.numbering.push(uae(n,r)),this.currentNumbering={reference:n,level:0}}if(this.renderContent(e),this.currentNumbering.level===0)delete this.currentNumbering;else{const{reference:n,level:i}=this.currentNumbering;this.currentNumbering={reference:n,level:i-1}}}renderListItem(e){if(!this.currentNumbering)throw new Error("Trying to create a list item without a list?");this.addParagraphOptions({numbering:this.currentNumbering}),this.renderContent(e)}addParagraphOptions(e){this.nextParentParagraphOpts=Object.assign(Object.assign({},this.nextParentParagraphOpts),e)}addRunOptions(e){this.nextRunOpts=Object.assign(Object.assign({},this.nextRunOpts),e)}text(e,r){e&&(this.current.push(new Li(Object.assign(Object.assign({text:e},this.nextRunOpts),r))),delete this.nextRunOpts)}math(e,r={inline:!0}){var n;if(r.inline||!r.numbered){this.current.push(new GA({children:[new KA(e)]}));return}const i=(n=r.id)!==null&&n!==void 0?n:sR();this.current=[new Li(" "),new GA({children:[new KA(e)]}),new Li(" ("),lR(i,"Equation"),new Li(")")],this.addParagraphOptions({tabStops:[{type:yy.CENTER,position:UA.MAX/2},{type:yy.RIGHT,position:UA.MAX}]})}image(e,r=70,n="center",i){const o=this.options.getImageBuffer(e),s=sae(o),a=s.height/s.width,l=this.maxImageWidth*(r/100);this.current.push(new ine(Object.assign(Object.assign({},i),{data:o,transformation:Object.assign(Object.assign({},(i==null?void 0:i.transformation)||{}),{width:l,height:l*a})})));let c;switch(n){case"right":c=An.RIGHT;break;case"left":c=An.LEFT;break;default:c=An.CENTER}this.addParagraphOptions({alignment:c})}table(e,r={}){const{getCellOptions:n,getRowOptions:i,tableOptions:o}=r,s=this.children,a=[];e.content.forEach(c=>{const d=[];let f=!0;c.content.forEach(p=>{p.type.name!=="table_header"&&(f=!1)}),this.maxImageWidth=S0/c.content.childCount,c.content.forEach(p=>{var m,g;this.children=[],this.renderContent(p);const b={children:this.children},S=(m=p.attrs.colspan)!==null&&m!==void 0?m:1,w=(g=p.attrs.rowspan)!==null&&g!==void 0?g:1;S>1&&(b.columnSpan=S),w>1&&(b.rowSpan=w),d.push(new dk(Object.assign(Object.assign({},b),(n==null?void 0:n(p))||{})))}),a.push(new wie(Object.assign(Object.assign({},(i==null?void 0:i(c))||{}),{children:d,tableHeader:f})))}),this.maxImageWidth=S0;const l=new gie(Object.assign(Object.assign({},o),{rows:a}));s.push(l),s.push(new ba("")),this.children=s}captionLabel(e,r,{suffix:n}={suffix:": "}){this.current.push(lR(e,r,`${r} `),new Li(n))}footnote(e){const{current:r,nextRunOpts:n}=this;this.current=[],delete this.nextRunOpts,this.$footnoteCounter+=1,this.renderInline(e),this.footnotes[this.$footnoteCounter]={children:[new ba({children:this.current})]},this.current=r,this.nextRunOpts=n,this.current.push(new Voe(this.$footnoteCounter))}closeBlock(e,r){const n=new ba(Object.assign(Object.assign({children:this.current},this.nextParentParagraphOpts),r));this.current=[],delete this.nextParentParagraphOpts,this.children.push(n)}createReference(e,r,n){const i=[];r&&i.push(new Li(r)),i.push(new lne(`REF ${e} \\h`)),n&&i.push(new Li(n));const o=new Cne({anchor:e,children:i});this.current.push(o)}}class hae{constructor(e,r){this.nodes=e,this.marks=r}serialize(e,r){const n=new fae(this.nodes,this.marks,r);return n.renderContent(e),dae(n)}}const Sl={text(t,e){var r;t.text((r=e.text)!==null&&r!==void 0?r:"")},paragraph(t,e){t.renderInline(e),t.closeBlock(e)},heading(t,e){t.renderInline(e);const r=[xu.HEADING_1,xu.HEADING_2,xu.HEADING_3,xu.HEADING_4,xu.HEADING_5,xu.HEADING_6][e.attrs.level-1];t.closeBlock(e,{heading:r})},blockquote(t,e){t.renderContent(e,{style:"IntenseQuote"})},code_block(t,e){t.renderContent(e),t.closeBlock(e)},horizontal_rule(t,e){t.closeBlock(e,{thematicBreak:!0}),t.closeBlock(e)},hard_break(t){t.addRunOptions({break:1})},ordered_list(t,e){t.renderList(e,"numbered")},bullet_list(t,e){t.renderList(e,"bullets")},list_item(t,e){t.renderListItem(e)},image(t,e){const{src:r}=e.attrs;t.image(r),t.closeBlock(e)},math(t,e){t.math(aR(e),{inline:!0})},equation(t,e){const{id:r,numbered:n}=e.attrs;t.math(aR(e),{inline:!1,numbered:n,id:r}),t.closeBlock(e)},table(t,e){t.table(e)}},pae={em(){return{italics:!0}},strong(){return{bold:!0}},italic(){return{italics:!0}},bold(){return{bold:!0}},link(){return{}},code(){return{font:{name:"Monospace"},color:"000000",shading:{type:Nte.SOLID,color:"D2D3D2",fill:"D2D3D2"}}},abbr(){return{}},subscript(){return{subScript:!0}},superscript(){return{superScript:!0}},strikethrough(){return{strike:!0}},underline(){return{underline:{}}},smallcaps(){return{smallCaps:!0}},allcaps(){return{allCaps:!0}}},mae=typeof window<"u";function gae(t,e){if(mae){const r=window.URL.createObjectURL(t),n=document.createElement("a");return n.href=r,n.download=e,n.click(),window.URL.revokeObjectURL(r),Promise.resolve()}return console.error("Download is not supported in Node.js"),Promise.resolve()}const yae={...Sl,hardBreak:Sl.hard_break,codeBlock:Sl.code_block,orderedList:Sl.ordered_list,listItem:Sl.list_item,bulletList:Sl.bullet_list,horizontalRule:Sl.horizontal_rule,image(t,e){t.renderInline(e),t.closeBlock(e)}},vae=new hae(yae,pae),bae=yt.create({name:"exportWord",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,t:r})=>({component:Ve,componentProps:{icon:"ExportWord",action:()=>{e==null||e.commands.exportToWord()},tooltip:r("editor.exportWord.tooltip"),isActive:()=>!1,disabled:!1}})}},addCommands(){return{exportToWord:()=>async({editor:t})=>{const e={getImageBuffer:async n=>{const o=await(await fetch(n)).arrayBuffer();return new Uint8Array(o)}},r=vae.serialize(t.state.doc,e);return t2.toBlob(r).then(n=>gae(new Blob([n]),"export-document.docx")),!0}}}}),wae="_toc_aag8a_1",xae="_visible_aag8a_7",Sae="_list_aag8a_11",kae="_item_aag8a_16",Sm={toc:wae,visible:xae,list:Sae,item:kae,"item--3":"_item--3_aag8a_19","item--4":"_item--4_aag8a_22","item--5":"_item--5_aag8a_25","item--6":"_item--6_aag8a_28"};function _ae(t){const e=[],r=[e];return t.forEach(n=>{let i=-1,o=r[n.level+i];for(;!o;)i-=1,o=r[n.level+i];o.push({...n,children:r[n.level]=[]})}),e}function Cae({editor:t}){const e=Wy(),[r,n]=J.useState([]),{t:i}=Ct(),o=J.useCallback(()=>{const s=[],a=t.state.tr;t.state.doc.descendants((l,c)=>{if(l.type.name==="heading"){const d=`heading-${s.length+1}`;l.attrs.id!==d&&a.setNodeMarkup(c,void 0,{...l.attrs,id:d}),s.push({level:l.attrs.level,text:l.textContent,id:d})}}),a.setMeta("addToHistory",!1),a.setMeta("preventUpdate",!0),t.view.dispatch(a),n(s),t.eventEmitter&&t.eventEmitter.emit("TableOfContents",_ae(s))},[t]);return J.useEffect(()=>{if(t){if(!t.options.editable){o();return}return t.on("update",o),()=>{t.off("update",o)}}},[t,o]),J.useEffect(()=>{o()},[]),x.jsx(gi,{className:Gr("tableOfContent",Sm.toc,e&&Sm.visible),children:e?x.jsxs("div",{style:{position:"relative"},children:[x.jsx("p",{className:"richtext-mb-[8px] text-[20px] richtext-font-semibold",children:i("editor.table_of_content")}),x.jsx("ul",{className:Sm.list,children:r.map((s,a)=>x.jsx("li",{className:Sm.item,style:{paddingLeft:`${s.level-1}rem`},children:x.jsx("a",{href:`#${s.id}`,children:s.text})},`table-of-content-${a}`))})]}):null})}function Eae(t){return t&&t.type.name==="title"}function Tae(t,e){const n=[t.getJSON()],i=[];for(;n.length;){const o=n.shift();o.type===e&&i.push(o),o.content&&o.content.length&&n.push(...o.content)}return i}function Aae(t,...e){const[r,n]=J.useState(!1);return J.useEffect(()=>{const i=()=>{n(t.isActive.apply(t,e))};return t.on("selectionUpdate",i),t.on("transaction",i),()=>{t.off("selectionUpdate",i),t.off("transaction",i)}},[t,e,n]),r}function Rae({editor:t,icon:e,tooltip:r}){const n=Aae(t,s2.name),i=J.useCallback(()=>{if(n){t.chain().focus().removeTableOfContents().run();return}t.chain().focus().setTableOfContents().run()},[t,n]);return x.jsx(Ve,{action:i,isActive:()=>n||!1,icon:e,tooltip:r})}const s2=Nt.create({name:"tableOfContents",group:"block",atom:!0,addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),onHasOneBeforeInsert:()=>{},resizable:!0,lastColumnResizable:!0,allowTableNodeSelection:!1,button:({editor:e,t:r})=>({component:Rae,componentProps:{disabled:!1,icon:"BookMarked",tooltip:r("editor.table.tooltip"),editor:e}})}},parseHTML(){return[{tag:"toc"}]},renderHTML({HTMLAttributes:t}){return["toc",lt(t)]},addNodeView(){return _o(Cae)},addCommands(){return{setTableOfContents:()=>({commands:t,editor:e,view:r})=>{if(Tae(e,this.name).length){this.options.onHasOneBeforeInsert();return}const i=r.props.state.doc.content.firstChild;if(Eae(i)){const o=(i.firstChild&&i.firstChild.nodeSize||0)+1;return t.insertContentAt(o,{type:this.name})}return t.insertContent({type:this.name})},removeTableOfContents:()=>({state:t,dispatch:e})=>{const{tr:r}=t,n=t.schema.nodes.tableOfContents;return t.doc.descendants((i,o)=>{if(i.type===n){const s=o,a=o+i.nodeSize;r.delete(s,a)}}),r.docChanged?(e(r),!0):!1}}},addGlobalAttributes(){return[{types:["heading"],attributes:{id:{default:null}}}]}});function Iae(t){var r;const e=J.useMemo(()=>{var o;const n=(o=t==null?void 0:t.items)==null?void 0:o.find(s=>s.isActive());return n&&!n.default?{...n,icon:n.icon?n.icon:t.icon}:{title:t==null?void 0:t.tooltip,icon:t.icon,isActive:()=>!1}},[t]);return x.jsxs(xi,{modal:!0,children:[x.jsx(Si,{disabled:t==null?void 0:t.disabled,asChild:!0,children:x.jsx(Ve,{customClass:"!richtext-w-12 richtext-h-12",icon:t==null?void 0:t.icon,tooltip:t==null?void 0:t.tooltip,disabled:t==null?void 0:t.disabled,children:x.jsx(Rt,{className:"richtext-w-3 richtext-h-3 richtext-ml-1 richtext-text-zinc-500",name:"MenuDown"})})}),x.jsx(Xn,{className:"richtext-min-w-4 richtext-w-full !richtext-p-[4px] richtext-flex richtext-flex-row richtext-gap-1",align:"start",side:"bottom",children:(r=t==null?void 0:t.items)==null?void 0:r.map((n,i)=>{var o,s;return x.jsxs(Sd,{children:[x.jsx(kd,{asChild:!0,children:x.jsx(Gh,{size:"sm",onClick:n==null?void 0:n.action,className:"richtext-p-1 richtext-w-7 richtext-h-7",pressed:e.title===n.title,"data-state":e.title===n.title?"on":"off",children:(n==null?void 0:n.icon)&&x.jsx(Rt,{name:n.icon})})}),x.jsxs(ac,{className:"richtext-flex richtext-flex-col richtext-items-center",children:[x.jsx("span",{children:n.title}),!!((o=n.shortcutKeys)!=null&&o.length)&&x.jsx("span",{children:(s=n.shortcutKeys)==null?void 0:s.map(a=>Ly(a)).join(" ")})]})]},`text-align-${i}`)})})]})}const Oae=yt.create({name:"text-direction",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),types:["heading","paragraph"],directions:["auto","ltr","rtl"],defaultDirection:"auto",button({editor:e,extension:r,t:n}){var l;const i=((l=r.options)==null?void 0:l.directions)||[],o={auto:"TextDirection",ltr:"LeftToRight",rtl:"RightToLeft"},s=i.map(c=>({title:n(`editor.textDirection.${c}.tooltip`),icon:o[c],isActive:()=>!1,action:()=>{var d,f,p,m;if(c==="auto"){(f=(d=e.commands)==null?void 0:d.unsetTextDirection)==null||f.call(d);return}(m=(p=e.commands)==null?void 0:p.setTextDirection)==null||m.call(p,c)},disabled:!1})),a=s.filter(c=>c.disabled).length===s.length;return{component:Iae,componentProps:{icon:"TextDirection",tooltip:n("editor.textDirection.tooltip"),disabled:a,items:s}}}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{dir:{default:this.options.defaultDirection,parseHTML:t=>t.attributes.dir&&this.options.directions.includes(t.attributes.dir)?t.attributes.dir.value:this.options.defaultDirection,renderHTML:t=>({dir:t.dir})}}}]},addCommands(){return{setTextDirection:t=>({commands:e})=>this.options.directions.includes(t)?this.options.types.every(r=>e.updateAttributes(r,{dir:t})):!1,unsetTextDirection:()=>({commands:t})=>this.options.types.every(e=>t.resetAttributes(e,"dir"))}}}),Mae=new St("mention"),Nae=Nt.create({name:"mention",priority:101,addOptions(){return{HTMLAttributes:{},renderText({options:t,node:e}){var r;return`${t.suggestion.char}${(r=e.attrs.label)!==null&&r!==void 0?r:e.attrs.id}`},deleteTriggerWithBackspace:!1,renderHTML({options:t,node:e}){var r;return["span",lt(this.HTMLAttributes,t.HTMLAttributes),`${t.suggestion.char}${(r=e.attrs.label)!==null&&r!==void 0?r:e.attrs.id}`]},suggestion:{char:"@",pluginKey:Mae,command:({editor:t,range:e,props:r})=>{var n,i,o;const s=t.view.state.selection.$to.nodeAfter;((n=s==null?void 0:s.text)===null||n===void 0?void 0:n.startsWith(" "))&&(e.to+=1),t.chain().focus().insertContentAt(e,[{type:this.name,attrs:r},{type:"text",text:" "}]).run(),(o=(i=t.view.dom.ownerDocument.defaultView)===null||i===void 0?void 0:i.getSelection())===null||o===void 0||o.collapseToEnd()},allow:({state:t,range:e})=>{const r=t.doc.resolve(e.from),n=t.schema.nodes[this.name];return!!r.parent.type.contentMatch.matchType(n)}}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:t=>t.getAttribute("data-id"),renderHTML:t=>t.id?{"data-id":t.id}:{}},label:{default:null,parseHTML:t=>t.getAttribute("data-label"),renderHTML:t=>t.label?{"data-label":t.label}:{}}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:t,HTMLAttributes:e}){if(this.options.renderLabel!==void 0)return console.warn("renderLabel is deprecated use renderText and renderHTML instead"),["span",lt({"data-type":this.name},this.options.HTMLAttributes,e),this.options.renderLabel({options:this.options,node:t})];const r={...this.options};r.HTMLAttributes=lt({"data-type":this.name},this.options.HTMLAttributes,e);const n=this.options.renderHTML({options:r,node:t});return typeof n=="string"?["span",lt({"data-type":this.name},this.options.HTMLAttributes,e),n]:n},renderText({node:t}){return this.options.renderLabel!==void 0?(console.warn("renderLabel is deprecated use renderText and renderHTML instead"),this.options.renderLabel({options:this.options,node:t})):this.options.renderText({options:this.options,node:t})},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:t,state:e})=>{let r=!1;const{selection:n}=e,{empty:i,anchor:o}=n;return i?(e.doc.nodesBetween(o-1,o,(s,a)=>{if(s.type.name===this.name)return r=!0,t.insertText(this.options.deleteTriggerWithBackspace?"":this.options.suggestion.char||"",a,a+s.nodeSize),!1}),r):!1})}},addProseMirrorPlugins(){return[VS({editor:this.editor,...this.options.suggestion})]}}),Dae="_listUsers_en3pm_1",Pae="_itemUser_en3pm_10",Lae="_selectedUser_en3pm_31",km={listUsers:Dae,itemUser:Pae,selectedUser:Lae},Fae=J.forwardRef((t,e)=>{const r=J.useRef(),[n,i]=J.useState(0),o=c=>{const d=t.items[c];d&&t.command({id:d,label:d})},s=()=>{i((n+t.items.length-1)%t.items.length)},a=()=>{i((n+1)%t.items.length)},l=()=>{o(n)};return J.useEffect(()=>i(0),[t.items]),J.useEffect(()=>{if(Number.isNaN(n+1))return;const c=r.current.querySelector(`span:nth-of-type(${n+1})`);c&&b1(c,{behavior:"smooth",scrollMode:"if-needed"})},[n]),J.useImperativeHandle(e,()=>({onKeyDown:({event:c})=>c.key==="ArrowUp"?(s(),!0):c.key==="ArrowDown"?(a(),!0):c.key==="Enter"?(l(),!0):!1})),x.jsx("div",{className:Gr("listUsers",km.listUsers),children:x.jsx("div",{ref:r,children:t.items.length?t.items.map((c,d)=>x.jsx("span",{className:Gr("itemUser",km.itemUser,d===n?km.selectedUser:""),onClick:()=>o(d),children:c},d)):x.jsx("div",{className:Gr("itemUserEmpty",km.itemUser),children:"Empty"})})})}),jae=[{id:"1",name:"John Doe"},{id:"2",name:"Jane Doe"},{id:"3",name:"Alice"},{id:"4",name:"Bob"}],Bae={items:async({query:t})=>jae.map(r=>r.name).filter(r=>r.toLowerCase().startsWith(t.toLowerCase())),render:()=>{let t,e;return{onStart:r=>{t=new By(Fae,{props:r,editor:r.editor}),e=gd("body",{getReferenceClientRect:r.clientRect,appendTo:()=>document.body,content:t.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"})},onUpdate(r){t.updateProps(r),e[0].setProps({getReferenceClientRect:r.clientRect})},onKeyDown(r){var n;return r.event.key==="Escape"?(e[0].hide(),!0):(n=t.ref)==null?void 0:n.onKeyDown(r)},onExit(){e[0].destroy(),t.destroy()}}}},zae=Nae.extend({addAttributes(){return{id:{default:"",parseHTML:fn("id")},label:{default:"",parseHTML:fn("label")}}}}).configure({HTMLAttributes:{class:"mention"},suggestion:Bae});var mc={},kl={};/**
|
|
316
|
+
* @license React
|
|
317
|
+
* react-dom-server-legacy.browser.production.min.js
|
|
318
|
+
*
|
|
319
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
320
|
+
*
|
|
321
|
+
* This source code is licensed under the MIT license found in the
|
|
322
|
+
* LICENSE file in the root directory of this source tree.
|
|
323
|
+
*/var cR;function Hae(){if(cR)return kl;cR=1;var t=J;function e(E){for(var z="https://reactjs.org/docs/error-decoder.html?invariant="+E,X=1;X<arguments.length;X++)z+="&args[]="+encodeURIComponent(arguments[X]);return"Minified React error #"+E+"; visit "+z+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=Object.prototype.hasOwnProperty,n=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,i={},o={};function s(E){return r.call(o,E)?!0:r.call(i,E)?!1:n.test(E)?o[E]=!0:(i[E]=!0,!1)}function a(E,z,X,re,_e,ve,Oe){this.acceptsBooleans=z===2||z===3||z===4,this.attributeName=re,this.attributeNamespace=_e,this.mustUseProperty=X,this.propertyName=E,this.type=z,this.sanitizeURL=ve,this.removeEmptyString=Oe}var l={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(E){l[E]=new a(E,0,!1,E,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(E){var z=E[0];l[z]=new a(z,1,!1,E[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(E){l[E]=new a(E,2,!1,E.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(E){l[E]=new a(E,2,!1,E,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(E){l[E]=new a(E,3,!1,E.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(E){l[E]=new a(E,3,!0,E,null,!1,!1)}),["capture","download"].forEach(function(E){l[E]=new a(E,4,!1,E,null,!1,!1)}),["cols","rows","size","span"].forEach(function(E){l[E]=new a(E,6,!1,E,null,!1,!1)}),["rowSpan","start"].forEach(function(E){l[E]=new a(E,5,!1,E.toLowerCase(),null,!1,!1)});var c=/[\-:]([a-z])/g;function d(E){return E[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(E){var z=E.replace(c,d);l[z]=new a(z,1,!1,E,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(E){var z=E.replace(c,d);l[z]=new a(z,1,!1,E,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(E){var z=E.replace(c,d);l[z]=new a(z,1,!1,E,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(E){l[E]=new a(E,1,!1,E.toLowerCase(),null,!1,!1)}),l.xlinkHref=new a("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(E){l[E]=new a(E,1,!1,E.toLowerCase(),null,!0,!0)});var f={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},p=["Webkit","ms","Moz","O"];Object.keys(f).forEach(function(E){p.forEach(function(z){z=z+E.charAt(0).toUpperCase()+E.substring(1),f[z]=f[E]})});var m=/["'&<>]/;function g(E){if(typeof E=="boolean"||typeof E=="number")return""+E;E=""+E;var z=m.exec(E);if(z){var X="",re,_e=0;for(re=z.index;re<E.length;re++){switch(E.charCodeAt(re)){case 34:z=""";break;case 38:z="&";break;case 39:z="'";break;case 60:z="<";break;case 62:z=">";break;default:continue}_e!==re&&(X+=E.substring(_e,re)),_e=re+1,X+=z}E=_e!==re?X+E.substring(_e,re):X}return E}var b=/([A-Z])/g,S=/^ms-/,w=Array.isArray;function T(E,z){return{insertionMode:E,selectedValue:z}}function M(E,z,X){switch(z){case"select":return T(1,X.value!=null?X.value:X.defaultValue);case"svg":return T(2,null);case"math":return T(3,null);case"foreignObject":return T(1,null);case"table":return T(4,null);case"thead":case"tbody":case"tfoot":return T(5,null);case"colgroup":return T(7,null);case"tr":return T(6,null)}return 4<=E.insertionMode||E.insertionMode===0?T(1,null):E}var j=new Map;function $(E,z,X){if(typeof X!="object")throw Error(e(62));z=!0;for(var re in X)if(r.call(X,re)){var _e=X[re];if(_e!=null&&typeof _e!="boolean"&&_e!==""){if(re.indexOf("--")===0){var ve=g(re);_e=g((""+_e).trim())}else{ve=re;var Oe=j.get(ve);Oe!==void 0||(Oe=g(ve.replace(b,"-$1").toLowerCase().replace(S,"-ms-")),j.set(ve,Oe)),ve=Oe,_e=typeof _e=="number"?_e===0||r.call(f,re)?""+_e:_e+"px":g((""+_e).trim())}z?(z=!1,E.push(' style="',ve,":",_e)):E.push(";",ve,":",_e)}}z||E.push('"')}function W(E,z,X,re){switch(X){case"style":$(E,z,re);return;case"defaultValue":case"defaultChecked":case"innerHTML":case"suppressContentEditableWarning":case"suppressHydrationWarning":return}if(!(2<X.length)||X[0]!=="o"&&X[0]!=="O"||X[1]!=="n"&&X[1]!=="N"){if(z=l.hasOwnProperty(X)?l[X]:null,z!==null){switch(typeof re){case"function":case"symbol":return;case"boolean":if(!z.acceptsBooleans)return}switch(X=z.attributeName,z.type){case 3:re&&E.push(" ",X,'=""');break;case 4:re===!0?E.push(" ",X,'=""'):re!==!1&&E.push(" ",X,'="',g(re),'"');break;case 5:isNaN(re)||E.push(" ",X,'="',g(re),'"');break;case 6:!isNaN(re)&&1<=re&&E.push(" ",X,'="',g(re),'"');break;default:z.sanitizeURL&&(re=""+re),E.push(" ",X,'="',g(re),'"')}}else if(s(X)){switch(typeof re){case"function":case"symbol":return;case"boolean":if(z=X.toLowerCase().slice(0,5),z!=="data-"&&z!=="aria-")return}E.push(" ",X,'="',g(re),'"')}}}function Y(E,z,X){if(z!=null){if(X!=null)throw Error(e(60));if(typeof z!="object"||!("__html"in z))throw Error(e(61));z=z.__html,z!=null&&E.push(""+z)}}function ee(E){var z="";return t.Children.forEach(E,function(X){X!=null&&(z+=X)}),z}function P(E,z,X,re){E.push(U(X));var _e=X=null,ve;for(ve in z)if(r.call(z,ve)){var Oe=z[ve];if(Oe!=null)switch(ve){case"children":X=Oe;break;case"dangerouslySetInnerHTML":_e=Oe;break;default:W(E,re,ve,Oe)}}return E.push(">"),Y(E,_e,X),typeof X=="string"?(E.push(g(X)),null):X}var fe=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,de=new Map;function U(E){var z=de.get(E);if(z===void 0){if(!fe.test(E))throw Error(e(65,E));z="<"+E,de.set(E,z)}return z}function ne(E,z,X,re,_e){switch(z){case"select":E.push(U("select"));var ve=null,Oe=null;for(tt in X)if(r.call(X,tt)){var $e=X[tt];if($e!=null)switch(tt){case"children":ve=$e;break;case"dangerouslySetInnerHTML":Oe=$e;break;case"defaultValue":case"value":break;default:W(E,re,tt,$e)}}return E.push(">"),Y(E,Oe,ve),ve;case"option":Oe=_e.selectedValue,E.push(U("option"));var Qe=$e=null,nt=null,tt=null;for(ve in X)if(r.call(X,ve)){var wt=X[ve];if(wt!=null)switch(ve){case"children":$e=wt;break;case"selected":nt=wt;break;case"dangerouslySetInnerHTML":tt=wt;break;case"value":Qe=wt;default:W(E,re,ve,wt)}}if(Oe!=null)if(X=Qe!==null?""+Qe:ee($e),w(Oe)){for(re=0;re<Oe.length;re++)if(""+Oe[re]===X){E.push(' selected=""');break}}else""+Oe===X&&E.push(' selected=""');else nt&&E.push(' selected=""');return E.push(">"),Y(E,tt,$e),$e;case"textarea":E.push(U("textarea")),tt=Oe=ve=null;for($e in X)if(r.call(X,$e)&&(Qe=X[$e],Qe!=null))switch($e){case"children":tt=Qe;break;case"value":ve=Qe;break;case"defaultValue":Oe=Qe;break;case"dangerouslySetInnerHTML":throw Error(e(91));default:W(E,re,$e,Qe)}if(ve===null&&Oe!==null&&(ve=Oe),E.push(">"),tt!=null){if(ve!=null)throw Error(e(92));if(w(tt)&&1<tt.length)throw Error(e(93));ve=""+tt}return typeof ve=="string"&&ve[0]===`
|
|
324
|
+
`&&E.push(`
|
|
325
|
+
`),ve!==null&&E.push(g(""+ve)),null;case"input":E.push(U("input")),Qe=tt=$e=ve=null;for(Oe in X)if(r.call(X,Oe)&&(nt=X[Oe],nt!=null))switch(Oe){case"children":case"dangerouslySetInnerHTML":throw Error(e(399,"input"));case"defaultChecked":Qe=nt;break;case"defaultValue":$e=nt;break;case"checked":tt=nt;break;case"value":ve=nt;break;default:W(E,re,Oe,nt)}return tt!==null?W(E,re,"checked",tt):Qe!==null&&W(E,re,"checked",Qe),ve!==null?W(E,re,"value",ve):$e!==null&&W(E,re,"value",$e),E.push("/>"),null;case"menuitem":E.push(U("menuitem"));for(var vr in X)if(r.call(X,vr)&&(ve=X[vr],ve!=null))switch(vr){case"children":case"dangerouslySetInnerHTML":throw Error(e(400));default:W(E,re,vr,ve)}return E.push(">"),null;case"title":E.push(U("title")),ve=null;for(wt in X)if(r.call(X,wt)&&(Oe=X[wt],Oe!=null))switch(wt){case"children":ve=Oe;break;case"dangerouslySetInnerHTML":throw Error(e(434));default:W(E,re,wt,Oe)}return E.push(">"),ve;case"listing":case"pre":E.push(U(z)),Oe=ve=null;for(Qe in X)if(r.call(X,Qe)&&($e=X[Qe],$e!=null))switch(Qe){case"children":ve=$e;break;case"dangerouslySetInnerHTML":Oe=$e;break;default:W(E,re,Qe,$e)}if(E.push(">"),Oe!=null){if(ve!=null)throw Error(e(60));if(typeof Oe!="object"||!("__html"in Oe))throw Error(e(61));X=Oe.__html,X!=null&&(typeof X=="string"&&0<X.length&&X[0]===`
|
|
326
|
+
`?E.push(`
|
|
327
|
+
`,X):E.push(""+X))}return typeof ve=="string"&&ve[0]===`
|
|
328
|
+
`&&E.push(`
|
|
329
|
+
`),ve;case"area":case"base":case"br":case"col":case"embed":case"hr":case"img":case"keygen":case"link":case"meta":case"param":case"source":case"track":case"wbr":E.push(U(z));for(var br in X)if(r.call(X,br)&&(ve=X[br],ve!=null))switch(br){case"children":case"dangerouslySetInnerHTML":throw Error(e(399,z));default:W(E,re,br,ve)}return E.push("/>"),null;case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return P(E,X,z,re);case"html":return _e.insertionMode===0&&E.push("<!DOCTYPE html>"),P(E,X,z,re);default:if(z.indexOf("-")===-1&&typeof X.is!="string")return P(E,X,z,re);E.push(U(z)),Oe=ve=null;for(nt in X)if(r.call(X,nt)&&($e=X[nt],$e!=null))switch(nt){case"children":ve=$e;break;case"dangerouslySetInnerHTML":Oe=$e;break;case"style":$(E,re,$e);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":break;default:s(nt)&&typeof $e!="function"&&typeof $e!="symbol"&&E.push(" ",nt,'="',g($e),'"')}return E.push(">"),Y(E,Oe,ve),ve}}function R(E,z,X){if(E.push('<!--$?--><template id="'),X===null)throw Error(e(395));return E.push(X),E.push('"></template>')}function le(E,z,X,re){switch(X.insertionMode){case 0:case 1:return E.push('<div hidden id="'),E.push(z.segmentPrefix),z=re.toString(16),E.push(z),E.push('">');case 2:return E.push('<svg aria-hidden="true" style="display:none" id="'),E.push(z.segmentPrefix),z=re.toString(16),E.push(z),E.push('">');case 3:return E.push('<math aria-hidden="true" style="display:none" id="'),E.push(z.segmentPrefix),z=re.toString(16),E.push(z),E.push('">');case 4:return E.push('<table hidden id="'),E.push(z.segmentPrefix),z=re.toString(16),E.push(z),E.push('">');case 5:return E.push('<table hidden><tbody id="'),E.push(z.segmentPrefix),z=re.toString(16),E.push(z),E.push('">');case 6:return E.push('<table hidden><tr id="'),E.push(z.segmentPrefix),z=re.toString(16),E.push(z),E.push('">');case 7:return E.push('<table hidden><colgroup id="'),E.push(z.segmentPrefix),z=re.toString(16),E.push(z),E.push('">');default:throw Error(e(397))}}function Ee(E,z){switch(z.insertionMode){case 0:case 1:return E.push("</div>");case 2:return E.push("</svg>");case 3:return E.push("</math>");case 4:return E.push("</table>");case 5:return E.push("</tbody></table>");case 6:return E.push("</tr></table>");case 7:return E.push("</colgroup></table>");default:throw Error(e(397))}}var he=/[<\u2028\u2029]/g;function Fe(E){return JSON.stringify(E).replace(he,function(z){switch(z){case"<":return"\\u003c";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw Error("escapeJSStringsForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React")}})}function ye(E,z){return z=z===void 0?"":z,{bootstrapChunks:[],startInlineScript:"<script>",placeholderPrefix:z+"P:",segmentPrefix:z+"S:",boundaryPrefix:z+"B:",idPrefix:z,nextSuspenseID:0,sentCompleteSegmentFunction:!1,sentCompleteBoundaryFunction:!1,sentClientRenderFunction:!1,generateStaticMarkup:E}}function ze(E,z,X,re){return X.generateStaticMarkup?(E.push(g(z)),!1):(z===""?E=re:(re&&E.push("<!-- -->"),E.push(g(z)),E=!0),E)}var ue=Object.assign,V=Symbol.for("react.element"),me=Symbol.for("react.portal"),ge=Symbol.for("react.fragment"),ke=Symbol.for("react.strict_mode"),ce=Symbol.for("react.profiler"),L=Symbol.for("react.provider"),D=Symbol.for("react.context"),ae=Symbol.for("react.forward_ref"),ie=Symbol.for("react.suspense"),q=Symbol.for("react.suspense_list"),Z=Symbol.for("react.memo"),we=Symbol.for("react.lazy"),O=Symbol.for("react.scope"),xe=Symbol.for("react.debug_trace_mode"),F=Symbol.for("react.legacy_hidden"),k=Symbol.for("react.default_value"),_=Symbol.iterator;function N(E){if(E==null)return null;if(typeof E=="function")return E.displayName||E.name||null;if(typeof E=="string")return E;switch(E){case ge:return"Fragment";case me:return"Portal";case ce:return"Profiler";case ke:return"StrictMode";case ie:return"Suspense";case q:return"SuspenseList"}if(typeof E=="object")switch(E.$$typeof){case D:return(E.displayName||"Context")+".Consumer";case L:return(E._context.displayName||"Context")+".Provider";case ae:var z=E.render;return E=E.displayName,E||(E=z.displayName||z.name||"",E=E!==""?"ForwardRef("+E+")":"ForwardRef"),E;case Z:return z=E.displayName||null,z!==null?z:N(E.type)||"Memo";case we:z=E._payload,E=E._init;try{return N(E(z))}catch{}}return null}var Q={};function pe(E,z){if(E=E.contextTypes,!E)return Q;var X={},re;for(re in E)X[re]=z[re];return X}var oe=null;function Re(E,z){if(E!==z){E.context._currentValue2=E.parentValue,E=E.parent;var X=z.parent;if(E===null){if(X!==null)throw Error(e(401))}else{if(X===null)throw Error(e(401));Re(E,X)}z.context._currentValue2=z.value}}function Ne(E){E.context._currentValue2=E.parentValue,E=E.parent,E!==null&&Ne(E)}function De(E){var z=E.parent;z!==null&&De(z),E.context._currentValue2=E.value}function We(E,z){if(E.context._currentValue2=E.parentValue,E=E.parent,E===null)throw Error(e(402));E.depth===z.depth?Re(E,z):We(E,z)}function Je(E,z){var X=z.parent;if(X===null)throw Error(e(402));E.depth===X.depth?Re(E,X):Je(E,X),z.context._currentValue2=z.value}function Ye(E){var z=oe;z!==E&&(z===null?De(E):E===null?Ne(z):z.depth===E.depth?Re(z,E):z.depth>E.depth?We(z,E):Je(z,E),oe=E)}var Gt={isMounted:function(){return!1},enqueueSetState:function(E,z){E=E._reactInternals,E.queue!==null&&E.queue.push(z)},enqueueReplaceState:function(E,z){E=E._reactInternals,E.replace=!0,E.queue=[z]},enqueueForceUpdate:function(){}};function Ar(E,z,X,re){var _e=E.state!==void 0?E.state:null;E.updater=Gt,E.props=X,E.state=_e;var ve={queue:[],replace:!1};E._reactInternals=ve;var Oe=z.contextType;if(E.context=typeof Oe=="object"&&Oe!==null?Oe._currentValue2:re,Oe=z.getDerivedStateFromProps,typeof Oe=="function"&&(Oe=Oe(X,_e),_e=Oe==null?_e:ue({},_e,Oe),E.state=_e),typeof z.getDerivedStateFromProps!="function"&&typeof E.getSnapshotBeforeUpdate!="function"&&(typeof E.UNSAFE_componentWillMount=="function"||typeof E.componentWillMount=="function"))if(z=E.state,typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount(),z!==E.state&&Gt.enqueueReplaceState(E,E.state,null),ve.queue!==null&&0<ve.queue.length)if(z=ve.queue,Oe=ve.replace,ve.queue=null,ve.replace=!1,Oe&&z.length===1)E.state=z[0];else{for(ve=Oe?z[0]:E.state,_e=!0,Oe=Oe?1:0;Oe<z.length;Oe++){var $e=z[Oe];$e=typeof $e=="function"?$e.call(E,ve,X,re):$e,$e!=null&&(_e?(_e=!1,ve=ue({},ve,$e)):ue(ve,$e))}E.state=ve}else ve.queue=null}var pr={id:1,overflow:""};function en(E,z,X){var re=E.id;E=E.overflow;var _e=32-Et(re)-1;re&=~(1<<_e),X+=1;var ve=32-Et(z)+_e;if(30<ve){var Oe=_e-_e%5;return ve=(re&(1<<Oe)-1).toString(32),re>>=Oe,_e-=Oe,{id:1<<32-Et(z)+_e|X<<_e|re,overflow:ve+E}}return{id:1<<ve|X<<_e|re,overflow:E}}var Et=Math.clz32?Math.clz32:rr,Yn=Math.log,Nn=Math.LN2;function rr(E){return E>>>=0,E===0?32:31-(Yn(E)/Nn|0)|0}function Jn(E,z){return E===z&&(E!==0||1/E===1/z)||E!==E&&z!==z}var $i=typeof Object.is=="function"?Object.is:Jn,dr=null,Hr=null,tn=null,mt=null,Rr=!1,Ui=!1,ki=0,yn=null,Wi=0;function Dn(){if(dr===null)throw Error(e(321));return dr}function nr(){if(0<Wi)throw Error(e(312));return{memoizedState:null,queue:null,next:null}}function Ro(){return mt===null?tn===null?(Rr=!1,tn=mt=nr()):(Rr=!0,mt=tn):mt.next===null?(Rr=!1,mt=mt.next=nr()):(Rr=!0,mt=mt.next),mt}function Io(){Hr=dr=null,Ui=!1,tn=null,Wi=0,mt=yn=null}function Ss(E,z){return typeof z=="function"?z(E):z}function Jt(E,z,X){if(dr=Dn(),mt=Ro(),Rr){var re=mt.queue;if(z=re.dispatch,yn!==null&&(X=yn.get(re),X!==void 0)){yn.delete(re),re=mt.memoizedState;do re=E(re,X.action),X=X.next;while(X!==null);return mt.memoizedState=re,[re,z]}return[mt.memoizedState,z]}return E=E===Ss?typeof z=="function"?z():z:X!==void 0?X(z):z,mt.memoizedState=E,E=mt.queue={last:null,dispatch:null},E=E.dispatch=ja.bind(null,dr,E),[mt.memoizedState,E]}function Oo(E,z){if(dr=Dn(),mt=Ro(),z=z===void 0?null:z,mt!==null){var X=mt.memoizedState;if(X!==null&&z!==null){var re=X[1];e:if(re===null)re=!1;else{for(var _e=0;_e<re.length&&_e<z.length;_e++)if(!$i(z[_e],re[_e])){re=!1;break e}re=!0}if(re)return X[0]}}return E=E(),mt.memoizedState=[E,z],E}function ja(E,z,X){if(25<=Wi)throw Error(e(301));if(E===dr)if(Ui=!0,E={action:X,next:null},yn===null&&(yn=new Map),X=yn.get(z),X===void 0)yn.set(z,E);else{for(z=X;z.next!==null;)z=z.next;z.next=E}}function Ba(){throw Error(e(394))}function vn(){}var Mo={readContext:function(E){return E._currentValue2},useContext:function(E){return Dn(),E._currentValue2},useMemo:Oo,useReducer:Jt,useRef:function(E){dr=Dn(),mt=Ro();var z=mt.memoizedState;return z===null?(E={current:E},mt.memoizedState=E):z},useState:function(E){return Jt(Ss,E)},useInsertionEffect:vn,useLayoutEffect:function(){},useCallback:function(E,z){return Oo(function(){return E},z)},useImperativeHandle:vn,useEffect:vn,useDebugValue:vn,useDeferredValue:function(E){return Dn(),E},useTransition:function(){return Dn(),[!1,Ba]},useId:function(){var E=Hr.treeContext,z=E.overflow;E=E.id,E=(E&~(1<<32-Et(E)-1)).toString(32)+z;var X=Vi;if(X===null)throw Error(e(404));return z=ki++,E=":"+X.idPrefix+"R"+E,0<z&&(E+="H"+z.toString(32)),E+":"},useMutableSource:function(E,z){return Dn(),z(E._source)},useSyncExternalStore:function(E,z,X){if(X===void 0)throw Error(e(407));return X()}},Vi=null,Zn=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentDispatcher;function Ir(E){return console.error(E),null}function bn(){}function Gi(E,z,X,re,_e,ve,Oe,$e,Qe){var nt=[],tt=new Set;return z={destination:null,responseState:z,progressiveChunkSize:re===void 0?12800:re,status:0,fatalError:null,nextSegmentId:0,allPendingTasks:0,pendingRootTasks:0,completedRootSegment:null,abortableTasks:tt,pingedTasks:nt,clientRenderedBoundaries:[],completedBoundaries:[],partialBoundaries:[],onError:_e===void 0?Ir:_e,onAllReady:bn,onShellReady:Oe===void 0?bn:Oe,onShellError:bn,onFatalError:bn},X=ei(z,0,null,X,!1,!1),X.parentFlushed=!0,E=Qn(z,E,null,X,tt,Q,null,pr),nt.push(E),z}function Qn(E,z,X,re,_e,ve,Oe,$e){E.allPendingTasks++,X===null?E.pendingRootTasks++:X.pendingTasks++;var Qe={node:z,ping:function(){var nt=E.pingedTasks;nt.push(Qe),nt.length===1&&gr(E)},blockedBoundary:X,blockedSegment:re,abortSet:_e,legacyContext:ve,context:Oe,treeContext:$e};return _e.add(Qe),Qe}function ei(E,z,X,re,_e,ve){return{status:0,id:-1,index:z,parentFlushed:!1,chunks:[],children:[],formatContext:re,boundary:X,lastPushedText:_e,textEmbedded:ve}}function wn(E,z){if(E=E.onError(z),E!=null&&typeof E!="string")throw Error('onError returned something with a type other than "string". onError should return a string and may return null or undefined but must not return anything else. It received something of type "'+typeof E+'" instead');return E}function ti(E,z){var X=E.onShellError;X(z),X=E.onFatalError,X(z),E.destination!==null?(E.status=2,E.destination.destroy(z)):(E.status=1,E.fatalError=z)}function Or(E,z,X,re,_e){for(dr={},Hr=z,ki=0,E=X(re,_e);Ui;)Ui=!1,ki=0,Wi+=1,mt=null,E=X(re,_e);return Io(),E}function ks(E,z,X,re){var _e=X.render(),ve=re.childContextTypes;if(ve!=null){var Oe=z.legacyContext;if(typeof X.getChildContext!="function")re=Oe;else{X=X.getChildContext();for(var $e in X)if(!($e in ve))throw Error(e(108,N(re)||"Unknown",$e));re=ue({},Oe,X)}z.legacyContext=re,Zt(E,z,_e),z.legacyContext=Oe}else Zt(E,z,_e)}function _s(E,z){if(E&&E.defaultProps){z=ue({},z),E=E.defaultProps;for(var X in E)z[X]===void 0&&(z[X]=E[X]);return z}return z}function Pn(E,z,X,re,_e){if(typeof X=="function")if(X.prototype&&X.prototype.isReactComponent){_e=pe(X,z.legacyContext);var ve=X.contextType;ve=new X(re,typeof ve=="object"&&ve!==null?ve._currentValue2:_e),Ar(ve,X,re,_e),ks(E,z,ve,X)}else{ve=pe(X,z.legacyContext),_e=Or(E,z,X,re,ve);var Oe=ki!==0;if(typeof _e=="object"&&_e!==null&&typeof _e.render=="function"&&_e.$$typeof===void 0)Ar(_e,X,re,ve),ks(E,z,_e,X);else if(Oe){re=z.treeContext,z.treeContext=en(re,1,0);try{Zt(E,z,_e)}finally{z.treeContext=re}}else Zt(E,z,_e)}else if(typeof X=="string"){switch(_e=z.blockedSegment,ve=ne(_e.chunks,X,re,E.responseState,_e.formatContext),_e.lastPushedText=!1,Oe=_e.formatContext,_e.formatContext=M(Oe,X,re),Sn(E,z,ve),_e.formatContext=Oe,X){case"area":case"base":case"br":case"col":case"embed":case"hr":case"img":case"input":case"keygen":case"link":case"meta":case"param":case"source":case"track":case"wbr":break;default:_e.chunks.push("</",X,">")}_e.lastPushedText=!1}else{switch(X){case F:case xe:case ke:case ce:case ge:Zt(E,z,re.children);return;case q:Zt(E,z,re.children);return;case O:throw Error(e(343));case ie:e:{X=z.blockedBoundary,_e=z.blockedSegment,ve=re.fallback,re=re.children,Oe=new Set;var $e={id:null,rootSegmentID:-1,parentFlushed:!1,pendingTasks:0,forceClientRender:!1,completedSegments:[],byteSize:0,fallbackAbortableTasks:Oe,errorDigest:null},Qe=ei(E,_e.chunks.length,$e,_e.formatContext,!1,!1);_e.children.push(Qe),_e.lastPushedText=!1;var nt=ei(E,0,null,_e.formatContext,!1,!1);nt.parentFlushed=!0,z.blockedBoundary=$e,z.blockedSegment=nt;try{if(Sn(E,z,re),E.responseState.generateStaticMarkup||nt.lastPushedText&&nt.textEmbedded&&nt.chunks.push("<!-- -->"),nt.status=1,rn($e,nt),$e.pendingTasks===0)break e}catch(tt){nt.status=4,$e.forceClientRender=!0,$e.errorDigest=wn(E,tt)}finally{z.blockedBoundary=X,z.blockedSegment=_e}z=Qn(E,ve,X,Qe,Oe,z.legacyContext,z.context,z.treeContext),E.pingedTasks.push(z)}return}if(typeof X=="object"&&X!==null)switch(X.$$typeof){case ae:if(re=Or(E,z,X.render,re,_e),ki!==0){X=z.treeContext,z.treeContext=en(X,1,0);try{Zt(E,z,re)}finally{z.treeContext=X}}else Zt(E,z,re);return;case Z:X=X.type,re=_s(X,re),Pn(E,z,X,re,_e);return;case L:if(_e=re.children,X=X._context,re=re.value,ve=X._currentValue2,X._currentValue2=re,Oe=oe,oe=re={parent:Oe,depth:Oe===null?0:Oe.depth+1,context:X,parentValue:ve,value:re},z.context=re,Zt(E,z,_e),E=oe,E===null)throw Error(e(403));re=E.parentValue,E.context._currentValue2=re===k?E.context._defaultValue:re,E=oe=E.parent,z.context=E;return;case D:re=re.children,re=re(X._currentValue2),Zt(E,z,re);return;case we:_e=X._init,X=_e(X._payload),re=_s(X,re),Pn(E,z,X,re,void 0);return}throw Error(e(130,X==null?X:typeof X,""))}}function Zt(E,z,X){if(z.node=X,typeof X=="object"&&X!==null){switch(X.$$typeof){case V:Pn(E,z,X.type,X.props,X.ref);return;case me:throw Error(e(257));case we:var re=X._init;X=re(X._payload),Zt(E,z,X);return}if(w(X)){xn(E,z,X);return}if(X===null||typeof X!="object"?re=null:(re=_&&X[_]||X["@@iterator"],re=typeof re=="function"?re:null),re&&(re=re.call(X))){if(X=re.next(),!X.done){var _e=[];do _e.push(X.value),X=re.next();while(!X.done);xn(E,z,_e)}return}throw E=Object.prototype.toString.call(X),Error(e(31,E==="[object Object]"?"object with keys {"+Object.keys(X).join(", ")+"}":E))}typeof X=="string"?(re=z.blockedSegment,re.lastPushedText=ze(z.blockedSegment.chunks,X,E.responseState,re.lastPushedText)):typeof X=="number"&&(re=z.blockedSegment,re.lastPushedText=ze(z.blockedSegment.chunks,""+X,E.responseState,re.lastPushedText))}function xn(E,z,X){for(var re=X.length,_e=0;_e<re;_e++){var ve=z.treeContext;z.treeContext=en(ve,re,_e);try{Sn(E,z,X[_e])}finally{z.treeContext=ve}}}function Sn(E,z,X){var re=z.blockedSegment.formatContext,_e=z.legacyContext,ve=z.context;try{return Zt(E,z,X)}catch(Qe){if(Io(),typeof Qe=="object"&&Qe!==null&&typeof Qe.then=="function"){X=Qe;var Oe=z.blockedSegment,$e=ei(E,Oe.chunks.length,null,Oe.formatContext,Oe.lastPushedText,!0);Oe.children.push($e),Oe.lastPushedText=!1,E=Qn(E,z.node,z.blockedBoundary,$e,z.abortSet,z.legacyContext,z.context,z.treeContext).ping,X.then(E,E),z.blockedSegment.formatContext=re,z.legacyContext=_e,z.context=ve,Ye(ve)}else throw z.blockedSegment.formatContext=re,z.legacyContext=_e,z.context=ve,Ye(ve),Qe}}function ri(E){var z=E.blockedBoundary;E=E.blockedSegment,E.status=3,kn(this,z,E)}function Ki(E,z,X){var re=E.blockedBoundary;E.blockedSegment.status=3,re===null?(z.allPendingTasks--,z.status!==2&&(z.status=2,z.destination!==null&&z.destination.push(null))):(re.pendingTasks--,re.forceClientRender||(re.forceClientRender=!0,E=X===void 0?Error(e(432)):X,re.errorDigest=z.onError(E),re.parentFlushed&&z.clientRenderedBoundaries.push(re)),re.fallbackAbortableTasks.forEach(function(_e){return Ki(_e,z,X)}),re.fallbackAbortableTasks.clear(),z.allPendingTasks--,z.allPendingTasks===0&&(re=z.onAllReady,re()))}function rn(E,z){if(z.chunks.length===0&&z.children.length===1&&z.children[0].boundary===null){var X=z.children[0];X.id=z.id,X.parentFlushed=!0,X.status===1&&rn(E,X)}else E.completedSegments.push(z)}function kn(E,z,X){if(z===null){if(X.parentFlushed){if(E.completedRootSegment!==null)throw Error(e(389));E.completedRootSegment=X}E.pendingRootTasks--,E.pendingRootTasks===0&&(E.onShellError=bn,z=E.onShellReady,z())}else z.pendingTasks--,z.forceClientRender||(z.pendingTasks===0?(X.parentFlushed&&X.status===1&&rn(z,X),z.parentFlushed&&E.completedBoundaries.push(z),z.fallbackAbortableTasks.forEach(ri,E),z.fallbackAbortableTasks.clear()):X.parentFlushed&&X.status===1&&(rn(z,X),z.completedSegments.length===1&&z.parentFlushed&&E.partialBoundaries.push(z)));E.allPendingTasks--,E.allPendingTasks===0&&(E=E.onAllReady,E())}function gr(E){if(E.status!==2){var z=oe,X=Zn.current;Zn.current=Mo;var re=Vi;Vi=E.responseState;try{var _e=E.pingedTasks,ve;for(ve=0;ve<_e.length;ve++){var Oe=_e[ve],$e=E,Qe=Oe.blockedSegment;if(Qe.status===0){Ye(Oe.context);try{Zt($e,Oe,Oe.node),$e.responseState.generateStaticMarkup||Qe.lastPushedText&&Qe.textEmbedded&&Qe.chunks.push("<!-- -->"),Oe.abortSet.delete(Oe),Qe.status=1,kn($e,Oe.blockedBoundary,Qe)}catch(wr){if(Io(),typeof wr=="object"&&wr!==null&&typeof wr.then=="function"){var nt=Oe.ping;wr.then(nt,nt)}else{Oe.abortSet.delete(Oe),Qe.status=4;var tt=Oe.blockedBoundary,wt=wr,vr=wn($e,wt);if(tt===null?ti($e,wt):(tt.pendingTasks--,tt.forceClientRender||(tt.forceClientRender=!0,tt.errorDigest=vr,tt.parentFlushed&&$e.clientRenderedBoundaries.push(tt))),$e.allPendingTasks--,$e.allPendingTasks===0){var br=$e.onAllReady;br()}}}finally{}}}_e.splice(0,ve),E.destination!==null&&yr(E,E.destination)}catch(wr){wn(E,wr),ti(E,wr)}finally{Vi=re,Zn.current=X,X===Mo&&Ye(z)}}}function ni(E,z,X){switch(X.parentFlushed=!0,X.status){case 0:var re=X.id=E.nextSegmentId++;return X.lastPushedText=!1,X.textEmbedded=!1,E=E.responseState,z.push('<template id="'),z.push(E.placeholderPrefix),E=re.toString(16),z.push(E),z.push('"></template>');case 1:X.status=2;var _e=!0;re=X.chunks;var ve=0;X=X.children;for(var Oe=0;Oe<X.length;Oe++){for(_e=X[Oe];ve<_e.index;ve++)z.push(re[ve]);_e=_i(E,z,_e)}for(;ve<re.length-1;ve++)z.push(re[ve]);return ve<re.length&&(_e=z.push(re[ve])),_e;default:throw Error(e(390))}}function _i(E,z,X){var re=X.boundary;if(re===null)return ni(E,z,X);if(re.parentFlushed=!0,re.forceClientRender)return E.responseState.generateStaticMarkup||(re=re.errorDigest,z.push("<!--$!-->"),z.push("<template"),re&&(z.push(' data-dgst="'),re=g(re),z.push(re),z.push('"')),z.push("></template>")),ni(E,z,X),E=E.responseState.generateStaticMarkup?!0:z.push("<!--/$-->"),E;if(0<re.pendingTasks){re.rootSegmentID=E.nextSegmentId++,0<re.completedSegments.length&&E.partialBoundaries.push(re);var _e=E.responseState,ve=_e.nextSuspenseID++;return _e=_e.boundaryPrefix+ve.toString(16),re=re.id=_e,R(z,E.responseState,re),ni(E,z,X),z.push("<!--/$-->")}if(re.byteSize>E.progressiveChunkSize)return re.rootSegmentID=E.nextSegmentId++,E.completedBoundaries.push(re),R(z,E.responseState,re.id),ni(E,z,X),z.push("<!--/$-->");if(E.responseState.generateStaticMarkup||z.push("<!--$-->"),X=re.completedSegments,X.length!==1)throw Error(e(391));return _i(E,z,X[0]),E=E.responseState.generateStaticMarkup?!0:z.push("<!--/$-->"),E}function qi(E,z,X){return le(z,E.responseState,X.formatContext,X.id),_i(E,z,X),Ee(z,X.formatContext)}function $r(E,z,X){for(var re=X.completedSegments,_e=0;_e<re.length;_e++)_n(E,z,X,re[_e]);if(re.length=0,E=E.responseState,re=X.id,X=X.rootSegmentID,z.push(E.startInlineScript),E.sentCompleteBoundaryFunction?z.push('$RC("'):(E.sentCompleteBoundaryFunction=!0,z.push('function $RC(a,b){a=document.getElementById(a);b=document.getElementById(b);b.parentNode.removeChild(b);if(a){a=a.previousSibling;var f=a.parentNode,c=a.nextSibling,e=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d)if(0===e)break;else e--;else"$"!==d&&"$?"!==d&&"$!"!==d||e++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;b.firstChild;)f.insertBefore(b.firstChild,c);a.data="$";a._reactRetry&&a._reactRetry()}};$RC("')),re===null)throw Error(e(395));return X=X.toString(16),z.push(re),z.push('","'),z.push(E.segmentPrefix),z.push(X),z.push('")<\/script>')}function _n(E,z,X,re){if(re.status===2)return!0;var _e=re.id;if(_e===-1){if((re.id=X.rootSegmentID)===-1)throw Error(e(392));return qi(E,z,re)}return qi(E,z,re),E=E.responseState,z.push(E.startInlineScript),E.sentCompleteSegmentFunction?z.push('$RS("'):(E.sentCompleteSegmentFunction=!0,z.push('function $RS(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};$RS("')),z.push(E.segmentPrefix),_e=_e.toString(16),z.push(_e),z.push('","'),z.push(E.placeholderPrefix),z.push(_e),z.push('")<\/script>')}function yr(E,z){try{var X=E.completedRootSegment;if(X!==null&&E.pendingRootTasks===0){_i(E,z,X),E.completedRootSegment=null;var re=E.responseState.bootstrapChunks;for(X=0;X<re.length-1;X++)z.push(re[X]);X<re.length&&z.push(re[X])}var _e=E.clientRenderedBoundaries,ve;for(ve=0;ve<_e.length;ve++){var Oe=_e[ve];re=z;var $e=E.responseState,Qe=Oe.id,nt=Oe.errorDigest,tt=Oe.errorMessage,wt=Oe.errorComponentStack;if(re.push($e.startInlineScript),$e.sentClientRenderFunction?re.push('$RX("'):($e.sentClientRenderFunction=!0,re.push('function $RX(b,c,d,e){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),b._reactRetry&&b._reactRetry())};$RX("')),Qe===null)throw Error(e(395));if(re.push(Qe),re.push('"'),nt||tt||wt){re.push(",");var vr=Fe(nt||"");re.push(vr)}if(tt||wt){re.push(",");var br=Fe(tt||"");re.push(br)}if(wt){re.push(",");var wr=Fe(wt);re.push(wr)}if(!re.push(")<\/script>")){E.destination=null,ve++,_e.splice(0,ve);return}}_e.splice(0,ve);var ii=E.completedBoundaries;for(ve=0;ve<ii.length;ve++)if(!$r(E,z,ii[ve])){E.destination=null,ve++,ii.splice(0,ve);return}ii.splice(0,ve);var Cn=E.partialBoundaries;for(ve=0;ve<Cn.length;ve++){var Yi=Cn[ve];e:{_e=E,Oe=z;var oi=Yi.completedSegments;for($e=0;$e<oi.length;$e++)if(!_n(_e,Oe,Yi,oi[$e])){$e++,oi.splice(0,$e);var Ci=!1;break e}oi.splice(0,$e),Ci=!0}if(!Ci){E.destination=null,ve++,Cn.splice(0,ve);return}}Cn.splice(0,ve);var Ln=E.completedBoundaries;for(ve=0;ve<Ln.length;ve++)if(!$r(E,z,Ln[ve])){E.destination=null,ve++,Ln.splice(0,ve);return}Ln.splice(0,ve)}finally{E.allPendingTasks===0&&E.pingedTasks.length===0&&E.clientRenderedBoundaries.length===0&&E.completedBoundaries.length===0&&z.push(null)}}function Xi(E,z){try{var X=E.abortableTasks;X.forEach(function(re){return Ki(re,E,z)}),X.clear(),E.destination!==null&&yr(E,E.destination)}catch(re){wn(E,re),ti(E,re)}}function ar(){}function Mr(E,z,X,re){var _e=!1,ve=null,Oe="",$e={push:function(nt){return nt!==null&&(Oe+=nt),!0},destroy:function(nt){_e=!0,ve=nt}},Qe=!1;if(E=Gi(E,ye(X,z?z.identifierPrefix:void 0),{insertionMode:1,selectedValue:null},1/0,ar,void 0,function(){Qe=!0}),gr(E),Xi(E,re),E.status===1)E.status=2,$e.destroy(E.fatalError);else if(E.status!==2&&E.destination===null){E.destination=$e;try{yr(E,$e)}catch(nt){wn(E,nt),ti(E,nt)}}if(_e)throw ve;if(!Qe)throw Error(e(426));return Oe}return kl.renderToNodeStream=function(){throw Error(e(207))},kl.renderToStaticMarkup=function(E,z){return Mr(E,z,!0,'The server used "renderToStaticMarkup" which does not support Suspense. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server')},kl.renderToStaticNodeStream=function(){throw Error(e(208))},kl.renderToString=function(E,z){return Mr(E,z,!1,'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server')},kl.version="18.3.1",kl}var _m={};/**
|
|
330
|
+
* @license React
|
|
331
|
+
* react-dom-server.browser.production.min.js
|
|
332
|
+
*
|
|
333
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
334
|
+
*
|
|
335
|
+
* This source code is licensed under the MIT license found in the
|
|
336
|
+
* LICENSE file in the root directory of this source tree.
|
|
337
|
+
*/var uR;function $ae(){if(uR)return _m;uR=1;var t=J;function e(A){for(var B="https://reactjs.org/docs/error-decoder.html?invariant="+A,G=1;G<arguments.length;G++)B+="&args[]="+encodeURIComponent(arguments[G]);return"Minified React error #"+A+"; visit "+B+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=null,n=0;function i(A,B){if(B.length!==0)if(512<B.length)0<n&&(A.enqueue(new Uint8Array(r.buffer,0,n)),r=new Uint8Array(512),n=0),A.enqueue(B);else{var G=r.length-n;G<B.length&&(G===0?A.enqueue(r):(r.set(B.subarray(0,G),n),A.enqueue(r),B=B.subarray(G)),r=new Uint8Array(512),n=0),r.set(B,n),n+=B.length}}function o(A,B){return i(A,B),!0}function s(A){r&&0<n&&(A.enqueue(new Uint8Array(r.buffer,0,n)),r=null,n=0)}var a=new TextEncoder;function l(A){return a.encode(A)}function c(A){return a.encode(A)}function d(A,B){typeof A.error=="function"?A.error(B):A.close()}var f=Object.prototype.hasOwnProperty,p=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,m={},g={};function b(A){return f.call(g,A)?!0:f.call(m,A)?!1:p.test(A)?g[A]=!0:(m[A]=!0,!1)}function S(A,B,G,te,Ce,Se,Me){this.acceptsBooleans=B===2||B===3||B===4,this.attributeName=te,this.attributeNamespace=Ce,this.mustUseProperty=G,this.propertyName=A,this.type=B,this.sanitizeURL=Se,this.removeEmptyString=Me}var w={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(A){w[A]=new S(A,0,!1,A,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(A){var B=A[0];w[B]=new S(B,1,!1,A[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(A){w[A]=new S(A,2,!1,A.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(A){w[A]=new S(A,2,!1,A,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(A){w[A]=new S(A,3,!1,A.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(A){w[A]=new S(A,3,!0,A,null,!1,!1)}),["capture","download"].forEach(function(A){w[A]=new S(A,4,!1,A,null,!1,!1)}),["cols","rows","size","span"].forEach(function(A){w[A]=new S(A,6,!1,A,null,!1,!1)}),["rowSpan","start"].forEach(function(A){w[A]=new S(A,5,!1,A.toLowerCase(),null,!1,!1)});var T=/[\-:]([a-z])/g;function M(A){return A[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(A){var B=A.replace(T,M);w[B]=new S(B,1,!1,A,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(A){var B=A.replace(T,M);w[B]=new S(B,1,!1,A,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(A){var B=A.replace(T,M);w[B]=new S(B,1,!1,A,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(A){w[A]=new S(A,1,!1,A.toLowerCase(),null,!1,!1)}),w.xlinkHref=new S("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(A){w[A]=new S(A,1,!1,A.toLowerCase(),null,!0,!0)});var j={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},$=["Webkit","ms","Moz","O"];Object.keys(j).forEach(function(A){$.forEach(function(B){B=B+A.charAt(0).toUpperCase()+A.substring(1),j[B]=j[A]})});var W=/["'&<>]/;function Y(A){if(typeof A=="boolean"||typeof A=="number")return""+A;A=""+A;var B=W.exec(A);if(B){var G="",te,Ce=0;for(te=B.index;te<A.length;te++){switch(A.charCodeAt(te)){case 34:B=""";break;case 38:B="&";break;case 39:B="'";break;case 60:B="<";break;case 62:B=">";break;default:continue}Ce!==te&&(G+=A.substring(Ce,te)),Ce=te+1,G+=B}A=Ce!==te?G+A.substring(Ce,te):G}return A}var ee=/([A-Z])/g,P=/^ms-/,fe=Array.isArray,de=c("<script>"),U=c("<\/script>"),ne=c('<script src="'),R=c('<script type="module" src="'),le=c('" async=""><\/script>'),Ee=/(<\/|<)(s)(cript)/gi;function he(A,B,G,te){return""+B+(G==="s"?"\\u0073":"\\u0053")+te}function Fe(A,B,G,te,Ce){A=A===void 0?"":A,B=B===void 0?de:c('<script nonce="'+Y(B)+'">');var Se=[];if(G!==void 0&&Se.push(B,l((""+G).replace(Ee,he)),U),te!==void 0)for(G=0;G<te.length;G++)Se.push(ne,l(Y(te[G])),le);if(Ce!==void 0)for(te=0;te<Ce.length;te++)Se.push(R,l(Y(Ce[te])),le);return{bootstrapChunks:Se,startInlineScript:B,placeholderPrefix:c(A+"P:"),segmentPrefix:c(A+"S:"),boundaryPrefix:A+"B:",idPrefix:A,nextSuspenseID:0,sentCompleteSegmentFunction:!1,sentCompleteBoundaryFunction:!1,sentClientRenderFunction:!1}}function ye(A,B){return{insertionMode:A,selectedValue:B}}function ze(A){return ye(A==="http://www.w3.org/2000/svg"?2:A==="http://www.w3.org/1998/Math/MathML"?3:0,null)}function ue(A,B,G){switch(B){case"select":return ye(1,G.value!=null?G.value:G.defaultValue);case"svg":return ye(2,null);case"math":return ye(3,null);case"foreignObject":return ye(1,null);case"table":return ye(4,null);case"thead":case"tbody":case"tfoot":return ye(5,null);case"colgroup":return ye(7,null);case"tr":return ye(6,null)}return 4<=A.insertionMode||A.insertionMode===0?ye(1,null):A}var V=c("<!-- -->");function me(A,B,G,te){return B===""?te:(te&&A.push(V),A.push(l(Y(B))),!0)}var ge=new Map,ke=c(' style="'),ce=c(":"),L=c(";");function D(A,B,G){if(typeof G!="object")throw Error(e(62));B=!0;for(var te in G)if(f.call(G,te)){var Ce=G[te];if(Ce!=null&&typeof Ce!="boolean"&&Ce!==""){if(te.indexOf("--")===0){var Se=l(Y(te));Ce=l(Y((""+Ce).trim()))}else{Se=te;var Me=ge.get(Se);Me!==void 0||(Me=c(Y(Se.replace(ee,"-$1").toLowerCase().replace(P,"-ms-"))),ge.set(Se,Me)),Se=Me,Ce=typeof Ce=="number"?Ce===0||f.call(j,te)?l(""+Ce):l(Ce+"px"):l(Y((""+Ce).trim()))}B?(B=!1,A.push(ke,Se,ce,Ce)):A.push(L,Se,ce,Ce)}}B||A.push(q)}var ae=c(" "),ie=c('="'),q=c('"'),Z=c('=""');function we(A,B,G,te){switch(G){case"style":D(A,B,te);return;case"defaultValue":case"defaultChecked":case"innerHTML":case"suppressContentEditableWarning":case"suppressHydrationWarning":return}if(!(2<G.length)||G[0]!=="o"&&G[0]!=="O"||G[1]!=="n"&&G[1]!=="N"){if(B=w.hasOwnProperty(G)?w[G]:null,B!==null){switch(typeof te){case"function":case"symbol":return;case"boolean":if(!B.acceptsBooleans)return}switch(G=l(B.attributeName),B.type){case 3:te&&A.push(ae,G,Z);break;case 4:te===!0?A.push(ae,G,Z):te!==!1&&A.push(ae,G,ie,l(Y(te)),q);break;case 5:isNaN(te)||A.push(ae,G,ie,l(Y(te)),q);break;case 6:!isNaN(te)&&1<=te&&A.push(ae,G,ie,l(Y(te)),q);break;default:B.sanitizeURL&&(te=""+te),A.push(ae,G,ie,l(Y(te)),q)}}else if(b(G)){switch(typeof te){case"function":case"symbol":return;case"boolean":if(B=G.toLowerCase().slice(0,5),B!=="data-"&&B!=="aria-")return}A.push(ae,l(G),ie,l(Y(te)),q)}}}var O=c(">"),xe=c("/>");function F(A,B,G){if(B!=null){if(G!=null)throw Error(e(60));if(typeof B!="object"||!("__html"in B))throw Error(e(61));B=B.__html,B!=null&&A.push(l(""+B))}}function k(A){var B="";return t.Children.forEach(A,function(G){G!=null&&(B+=G)}),B}var _=c(' selected=""');function N(A,B,G,te){A.push(Re(G));var Ce=G=null,Se;for(Se in B)if(f.call(B,Se)){var Me=B[Se];if(Me!=null)switch(Se){case"children":G=Me;break;case"dangerouslySetInnerHTML":Ce=Me;break;default:we(A,te,Se,Me)}}return A.push(O),F(A,Ce,G),typeof G=="string"?(A.push(l(Y(G))),null):G}var Q=c(`
|
|
338
|
+
`),pe=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,oe=new Map;function Re(A){var B=oe.get(A);if(B===void 0){if(!pe.test(A))throw Error(e(65,A));B=c("<"+A),oe.set(A,B)}return B}var Ne=c("<!DOCTYPE html>");function De(A,B,G,te,Ce){switch(B){case"select":A.push(Re("select"));var Se=null,Me=null;for(ct in G)if(f.call(G,ct)){var Ue=G[ct];if(Ue!=null)switch(ct){case"children":Se=Ue;break;case"dangerouslySetInnerHTML":Me=Ue;break;case"defaultValue":case"value":break;default:we(A,te,ct,Ue)}}return A.push(O),F(A,Me,Se),Se;case"option":Me=Ce.selectedValue,A.push(Re("option"));var it=Ue=null,ut=null,ct=null;for(Se in G)if(f.call(G,Se)){var Dt=G[Se];if(Dt!=null)switch(Se){case"children":Ue=Dt;break;case"selected":ut=Dt;break;case"dangerouslySetInnerHTML":ct=Dt;break;case"value":it=Dt;default:we(A,te,Se,Dt)}}if(Me!=null)if(G=it!==null?""+it:k(Ue),fe(Me)){for(te=0;te<Me.length;te++)if(""+Me[te]===G){A.push(_);break}}else""+Me===G&&A.push(_);else ut&&A.push(_);return A.push(O),F(A,ct,Ue),Ue;case"textarea":A.push(Re("textarea")),ct=Me=Se=null;for(Ue in G)if(f.call(G,Ue)&&(it=G[Ue],it!=null))switch(Ue){case"children":ct=it;break;case"value":Se=it;break;case"defaultValue":Me=it;break;case"dangerouslySetInnerHTML":throw Error(e(91));default:we(A,te,Ue,it)}if(Se===null&&Me!==null&&(Se=Me),A.push(O),ct!=null){if(Se!=null)throw Error(e(92));if(fe(ct)&&1<ct.length)throw Error(e(93));Se=""+ct}return typeof Se=="string"&&Se[0]===`
|
|
339
|
+
`&&A.push(Q),Se!==null&&A.push(l(Y(""+Se))),null;case"input":A.push(Re("input")),it=ct=Ue=Se=null;for(Me in G)if(f.call(G,Me)&&(ut=G[Me],ut!=null))switch(Me){case"children":case"dangerouslySetInnerHTML":throw Error(e(399,"input"));case"defaultChecked":it=ut;break;case"defaultValue":Ue=ut;break;case"checked":ct=ut;break;case"value":Se=ut;break;default:we(A,te,Me,ut)}return ct!==null?we(A,te,"checked",ct):it!==null&&we(A,te,"checked",it),Se!==null?we(A,te,"value",Se):Ue!==null&&we(A,te,"value",Ue),A.push(xe),null;case"menuitem":A.push(Re("menuitem"));for(var Dr in G)if(f.call(G,Dr)&&(Se=G[Dr],Se!=null))switch(Dr){case"children":case"dangerouslySetInnerHTML":throw Error(e(400));default:we(A,te,Dr,Se)}return A.push(O),null;case"title":A.push(Re("title")),Se=null;for(Dt in G)if(f.call(G,Dt)&&(Me=G[Dt],Me!=null))switch(Dt){case"children":Se=Me;break;case"dangerouslySetInnerHTML":throw Error(e(434));default:we(A,te,Dt,Me)}return A.push(O),Se;case"listing":case"pre":A.push(Re(B)),Me=Se=null;for(it in G)if(f.call(G,it)&&(Ue=G[it],Ue!=null))switch(it){case"children":Se=Ue;break;case"dangerouslySetInnerHTML":Me=Ue;break;default:we(A,te,it,Ue)}if(A.push(O),Me!=null){if(Se!=null)throw Error(e(60));if(typeof Me!="object"||!("__html"in Me))throw Error(e(61));G=Me.__html,G!=null&&(typeof G=="string"&&0<G.length&&G[0]===`
|
|
340
|
+
`?A.push(Q,l(G)):A.push(l(""+G)))}return typeof Se=="string"&&Se[0]===`
|
|
341
|
+
`&&A.push(Q),Se;case"area":case"base":case"br":case"col":case"embed":case"hr":case"img":case"keygen":case"link":case"meta":case"param":case"source":case"track":case"wbr":A.push(Re(B));for(var on in G)if(f.call(G,on)&&(Se=G[on],Se!=null))switch(on){case"children":case"dangerouslySetInnerHTML":throw Error(e(399,B));default:we(A,te,on,Se)}return A.push(xe),null;case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return N(A,G,B,te);case"html":return Ce.insertionMode===0&&A.push(Ne),N(A,G,B,te);default:if(B.indexOf("-")===-1&&typeof G.is!="string")return N(A,G,B,te);A.push(Re(B)),Me=Se=null;for(ut in G)if(f.call(G,ut)&&(Ue=G[ut],Ue!=null))switch(ut){case"children":Se=Ue;break;case"dangerouslySetInnerHTML":Me=Ue;break;case"style":D(A,te,Ue);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":break;default:b(ut)&&typeof Ue!="function"&&typeof Ue!="symbol"&&A.push(ae,l(ut),ie,l(Y(Ue)),q)}return A.push(O),F(A,Me,Se),Se}}var We=c("</"),Je=c(">"),Ye=c('<template id="'),Gt=c('"></template>'),Ar=c("<!--$-->"),pr=c('<!--$?--><template id="'),en=c('"></template>'),Et=c("<!--$!-->"),Yn=c("<!--/$-->"),Nn=c("<template"),rr=c('"'),Jn=c(' data-dgst="');c(' data-msg="'),c(' data-stck="');var $i=c("></template>");function dr(A,B,G){if(i(A,pr),G===null)throw Error(e(395));return i(A,G),o(A,en)}var Hr=c('<div hidden id="'),tn=c('">'),mt=c("</div>"),Rr=c('<svg aria-hidden="true" style="display:none" id="'),Ui=c('">'),ki=c("</svg>"),yn=c('<math aria-hidden="true" style="display:none" id="'),Wi=c('">'),Dn=c("</math>"),nr=c('<table hidden id="'),Ro=c('">'),Io=c("</table>"),Ss=c('<table hidden><tbody id="'),Jt=c('">'),Oo=c("</tbody></table>"),ja=c('<table hidden><tr id="'),Ba=c('">'),vn=c("</tr></table>"),Mo=c('<table hidden><colgroup id="'),Vi=c('">'),Zn=c("</colgroup></table>");function Ir(A,B,G,te){switch(G.insertionMode){case 0:case 1:return i(A,Hr),i(A,B.segmentPrefix),i(A,l(te.toString(16))),o(A,tn);case 2:return i(A,Rr),i(A,B.segmentPrefix),i(A,l(te.toString(16))),o(A,Ui);case 3:return i(A,yn),i(A,B.segmentPrefix),i(A,l(te.toString(16))),o(A,Wi);case 4:return i(A,nr),i(A,B.segmentPrefix),i(A,l(te.toString(16))),o(A,Ro);case 5:return i(A,Ss),i(A,B.segmentPrefix),i(A,l(te.toString(16))),o(A,Jt);case 6:return i(A,ja),i(A,B.segmentPrefix),i(A,l(te.toString(16))),o(A,Ba);case 7:return i(A,Mo),i(A,B.segmentPrefix),i(A,l(te.toString(16))),o(A,Vi);default:throw Error(e(397))}}function bn(A,B){switch(B.insertionMode){case 0:case 1:return o(A,mt);case 2:return o(A,ki);case 3:return o(A,Dn);case 4:return o(A,Io);case 5:return o(A,Oo);case 6:return o(A,vn);case 7:return o(A,Zn);default:throw Error(e(397))}}var Gi=c('function $RS(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};$RS("'),Qn=c('$RS("'),ei=c('","'),wn=c('")<\/script>'),ti=c('function $RC(a,b){a=document.getElementById(a);b=document.getElementById(b);b.parentNode.removeChild(b);if(a){a=a.previousSibling;var f=a.parentNode,c=a.nextSibling,e=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d)if(0===e)break;else e--;else"$"!==d&&"$?"!==d&&"$!"!==d||e++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;b.firstChild;)f.insertBefore(b.firstChild,c);a.data="$";a._reactRetry&&a._reactRetry()}};$RC("'),Or=c('$RC("'),ks=c('","'),_s=c('")<\/script>'),Pn=c('function $RX(b,c,d,e){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),b._reactRetry&&b._reactRetry())};$RX("'),Zt=c('$RX("'),xn=c('"'),Sn=c(")<\/script>"),ri=c(","),Ki=/[<\u2028\u2029]/g;function rn(A){return JSON.stringify(A).replace(Ki,function(B){switch(B){case"<":return"\\u003c";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw Error("escapeJSStringsForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React")}})}var kn=Object.assign,gr=Symbol.for("react.element"),ni=Symbol.for("react.portal"),_i=Symbol.for("react.fragment"),qi=Symbol.for("react.strict_mode"),$r=Symbol.for("react.profiler"),_n=Symbol.for("react.provider"),yr=Symbol.for("react.context"),Xi=Symbol.for("react.forward_ref"),ar=Symbol.for("react.suspense"),Mr=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),X=Symbol.for("react.scope"),re=Symbol.for("react.debug_trace_mode"),_e=Symbol.for("react.legacy_hidden"),ve=Symbol.for("react.default_value"),Oe=Symbol.iterator;function $e(A){if(A==null)return null;if(typeof A=="function")return A.displayName||A.name||null;if(typeof A=="string")return A;switch(A){case _i:return"Fragment";case ni:return"Portal";case $r:return"Profiler";case qi:return"StrictMode";case ar:return"Suspense";case Mr:return"SuspenseList"}if(typeof A=="object")switch(A.$$typeof){case yr:return(A.displayName||"Context")+".Consumer";case _n:return(A._context.displayName||"Context")+".Provider";case Xi:var B=A.render;return A=A.displayName,A||(A=B.displayName||B.name||"",A=A!==""?"ForwardRef("+A+")":"ForwardRef"),A;case E:return B=A.displayName||null,B!==null?B:$e(A.type)||"Memo";case z:B=A._payload,A=A._init;try{return $e(A(B))}catch{}}return null}var Qe={};function nt(A,B){if(A=A.contextTypes,!A)return Qe;var G={},te;for(te in A)G[te]=B[te];return G}var tt=null;function wt(A,B){if(A!==B){A.context._currentValue=A.parentValue,A=A.parent;var G=B.parent;if(A===null){if(G!==null)throw Error(e(401))}else{if(G===null)throw Error(e(401));wt(A,G)}B.context._currentValue=B.value}}function vr(A){A.context._currentValue=A.parentValue,A=A.parent,A!==null&&vr(A)}function br(A){var B=A.parent;B!==null&&br(B),A.context._currentValue=A.value}function wr(A,B){if(A.context._currentValue=A.parentValue,A=A.parent,A===null)throw Error(e(402));A.depth===B.depth?wt(A,B):wr(A,B)}function ii(A,B){var G=B.parent;if(G===null)throw Error(e(402));A.depth===G.depth?wt(A,G):ii(A,G),B.context._currentValue=B.value}function Cn(A){var B=tt;B!==A&&(B===null?br(A):A===null?vr(B):B.depth===A.depth?wt(B,A):B.depth>A.depth?wr(B,A):ii(B,A),tt=A)}var Yi={isMounted:function(){return!1},enqueueSetState:function(A,B){A=A._reactInternals,A.queue!==null&&A.queue.push(B)},enqueueReplaceState:function(A,B){A=A._reactInternals,A.replace=!0,A.queue=[B]},enqueueForceUpdate:function(){}};function oi(A,B,G,te){var Ce=A.state!==void 0?A.state:null;A.updater=Yi,A.props=G,A.state=Ce;var Se={queue:[],replace:!1};A._reactInternals=Se;var Me=B.contextType;if(A.context=typeof Me=="object"&&Me!==null?Me._currentValue:te,Me=B.getDerivedStateFromProps,typeof Me=="function"&&(Me=Me(G,Ce),Ce=Me==null?Ce:kn({},Ce,Me),A.state=Ce),typeof B.getDerivedStateFromProps!="function"&&typeof A.getSnapshotBeforeUpdate!="function"&&(typeof A.UNSAFE_componentWillMount=="function"||typeof A.componentWillMount=="function"))if(B=A.state,typeof A.componentWillMount=="function"&&A.componentWillMount(),typeof A.UNSAFE_componentWillMount=="function"&&A.UNSAFE_componentWillMount(),B!==A.state&&Yi.enqueueReplaceState(A,A.state,null),Se.queue!==null&&0<Se.queue.length)if(B=Se.queue,Me=Se.replace,Se.queue=null,Se.replace=!1,Me&&B.length===1)A.state=B[0];else{for(Se=Me?B[0]:A.state,Ce=!0,Me=Me?1:0;Me<B.length;Me++){var Ue=B[Me];Ue=typeof Ue=="function"?Ue.call(A,Se,G,te):Ue,Ue!=null&&(Ce?(Ce=!1,Se=kn({},Se,Ue)):kn(Se,Ue))}A.state=Se}else Se.queue=null}var Ci={id:1,overflow:""};function Ln(A,B,G){var te=A.id;A=A.overflow;var Ce=32-Ei(te)-1;te&=~(1<<Ce),G+=1;var Se=32-Ei(B)+Ce;if(30<Se){var Me=Ce-Ce%5;return Se=(te&(1<<Me)-1).toString(32),te>>=Me,Ce-=Me,{id:1<<32-Ei(B)+Ce|G<<Ce|te,overflow:Se+A}}return{id:1<<Se|G<<Ce|te,overflow:A}}var Ei=Math.clz32?Math.clz32:Cs,Nd=Math.log,Dd=Math.LN2;function Cs(A){return A>>>=0,A===0?32:31-(Nd(A)/Dd|0)|0}function En(A,B){return A===B&&(A!==0||1/A===1/B)||A!==A&&B!==B}var Pd=typeof Object.is=="function"?Object.is:En,Fn=null,za=null,Es=null,It=null,Ti=!1,Ts=!1,Ai=0,si=null,As=0;function ai(){if(Fn===null)throw Error(e(321));return Fn}function nn(){if(0<As)throw Error(e(312));return{memoizedState:null,queue:null,next:null}}function Ha(){return It===null?Es===null?(Ti=!1,Es=It=nn()):(Ti=!0,It=Es):It.next===null?(Ti=!1,It=It.next=nn()):(Ti=!0,It=It.next),It}function No(){za=Fn=null,Ts=!1,Es=null,As=0,It=si=null}function gc(A,B){return typeof B=="function"?B(A):B}function Rs(A,B,G){if(Fn=ai(),It=Ha(),Ti){var te=It.queue;if(B=te.dispatch,si!==null&&(G=si.get(te),G!==void 0)){si.delete(te),te=It.memoizedState;do te=A(te,G.action),G=G.next;while(G!==null);return It.memoizedState=te,[te,B]}return[It.memoizedState,B]}return A=A===gc?typeof B=="function"?B():B:G!==void 0?G(B):B,It.memoizedState=A,A=It.queue={last:null,dispatch:null},A=A.dispatch=Ld.bind(null,Fn,A),[It.memoizedState,A]}function yc(A,B){if(Fn=ai(),It=Ha(),B=B===void 0?null:B,It!==null){var G=It.memoizedState;if(G!==null&&B!==null){var te=G[1];e:if(te===null)te=!1;else{for(var Ce=0;Ce<te.length&&Ce<B.length;Ce++)if(!Pd(B[Ce],te[Ce])){te=!1;break e}te=!0}if(te)return G[0]}}return A=A(),It.memoizedState=[A,B],A}function Ld(A,B,G){if(25<=As)throw Error(e(301));if(A===Fn)if(Ts=!0,A={action:G,next:null},si===null&&(si=new Map),G=si.get(B),G===void 0)si.set(B,A);else{for(B=G;B.next!==null;)B=B.next;B.next=A}}function Fd(){throw Error(e(394))}function Is(){}var vc={readContext:function(A){return A._currentValue},useContext:function(A){return ai(),A._currentValue},useMemo:yc,useReducer:Rs,useRef:function(A){Fn=ai(),It=Ha();var B=It.memoizedState;return B===null?(A={current:A},It.memoizedState=A):B},useState:function(A){return Rs(gc,A)},useInsertionEffect:Is,useLayoutEffect:function(){},useCallback:function(A,B){return yc(function(){return A},B)},useImperativeHandle:Is,useEffect:Is,useDebugValue:Is,useDeferredValue:function(A){return ai(),A},useTransition:function(){return ai(),[!1,Fd]},useId:function(){var A=za.treeContext,B=A.overflow;A=A.id,A=(A&~(1<<32-Ei(A)-1)).toString(32)+B;var G=Do;if(G===null)throw Error(e(404));return B=Ai++,A=":"+G.idPrefix+"R"+A,0<B&&(A+="H"+B.toString(32)),A+":"},useMutableSource:function(A,B){return ai(),B(A._source)},useSyncExternalStore:function(A,B,G){if(G===void 0)throw Error(e(407));return G()}},Do=null,$a=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentDispatcher;function jd(A){return console.error(A),null}function Ji(){}function Ua(A,B,G,te,Ce,Se,Me,Ue,it){var ut=[],ct=new Set;return B={destination:null,responseState:B,progressiveChunkSize:te===void 0?12800:te,status:0,fatalError:null,nextSegmentId:0,allPendingTasks:0,pendingRootTasks:0,completedRootSegment:null,abortableTasks:ct,pingedTasks:ut,clientRenderedBoundaries:[],completedBoundaries:[],partialBoundaries:[],onError:Ce===void 0?jd:Ce,onAllReady:Se===void 0?Ji:Se,onShellReady:Me===void 0?Ji:Me,onShellError:Ue===void 0?Ji:Ue,onFatalError:it===void 0?Ji:it},G=Zi(B,0,null,G,!1,!1),G.parentFlushed=!0,A=Wa(B,A,null,G,ct,Qe,null,Ci),ut.push(A),B}function Wa(A,B,G,te,Ce,Se,Me,Ue){A.allPendingTasks++,G===null?A.pendingRootTasks++:G.pendingTasks++;var it={node:B,ping:function(){var ut=A.pingedTasks;ut.push(it),ut.length===1&&Cc(A)},blockedBoundary:G,blockedSegment:te,abortSet:Ce,legacyContext:Se,context:Me,treeContext:Ue};return Ce.add(it),it}function Zi(A,B,G,te,Ce,Se){return{status:0,id:-1,index:B,parentFlushed:!1,chunks:[],children:[],formatContext:te,boundary:G,lastPushedText:Ce,textEmbedded:Se}}function Po(A,B){if(A=A.onError(B),A!=null&&typeof A!="string")throw Error('onError returned something with a type other than "string". onError should return a string and may return null or undefined but must not return anything else. It received something of type "'+typeof A+'" instead');return A}function Os(A,B){var G=A.onShellError;G(B),G=A.onFatalError,G(B),A.destination!==null?(A.status=2,d(A.destination,B)):(A.status=1,A.fatalError=B)}function bc(A,B,G,te,Ce){for(Fn={},za=B,Ai=0,A=G(te,Ce);Ts;)Ts=!1,Ai=0,As+=1,It=null,A=G(te,Ce);return No(),A}function wc(A,B,G,te){var Ce=G.render(),Se=te.childContextTypes;if(Se!=null){var Me=B.legacyContext;if(typeof G.getChildContext!="function")te=Me;else{G=G.getChildContext();for(var Ue in G)if(!(Ue in Se))throw Error(e(108,$e(te)||"Unknown",Ue));te=kn({},Me,G)}B.legacyContext=te,Nr(A,B,Ce),B.legacyContext=Me}else Nr(A,B,Ce)}function xc(A,B){if(A&&A.defaultProps){B=kn({},B),A=A.defaultProps;for(var G in A)B[G]===void 0&&(B[G]=A[G]);return B}return B}function Ms(A,B,G,te,Ce){if(typeof G=="function")if(G.prototype&&G.prototype.isReactComponent){Ce=nt(G,B.legacyContext);var Se=G.contextType;Se=new G(te,typeof Se=="object"&&Se!==null?Se._currentValue:Ce),oi(Se,G,te,Ce),wc(A,B,Se,G)}else{Se=nt(G,B.legacyContext),Ce=bc(A,B,G,te,Se);var Me=Ai!==0;if(typeof Ce=="object"&&Ce!==null&&typeof Ce.render=="function"&&Ce.$$typeof===void 0)oi(Ce,G,te,Se),wc(A,B,Ce,G);else if(Me){te=B.treeContext,B.treeContext=Ln(te,1,0);try{Nr(A,B,Ce)}finally{B.treeContext=te}}else Nr(A,B,Ce)}else if(typeof G=="string"){switch(Ce=B.blockedSegment,Se=De(Ce.chunks,G,te,A.responseState,Ce.formatContext),Ce.lastPushedText=!1,Me=Ce.formatContext,Ce.formatContext=ue(Me,G,te),Ns(A,B,Se),Ce.formatContext=Me,G){case"area":case"base":case"br":case"col":case"embed":case"hr":case"img":case"input":case"keygen":case"link":case"meta":case"param":case"source":case"track":case"wbr":break;default:Ce.chunks.push(We,l(G),Je)}Ce.lastPushedText=!1}else{switch(G){case _e:case re:case qi:case $r:case _i:Nr(A,B,te.children);return;case Mr:Nr(A,B,te.children);return;case X:throw Error(e(343));case ar:e:{G=B.blockedBoundary,Ce=B.blockedSegment,Se=te.fallback,te=te.children,Me=new Set;var Ue={id:null,rootSegmentID:-1,parentFlushed:!1,pendingTasks:0,forceClientRender:!1,completedSegments:[],byteSize:0,fallbackAbortableTasks:Me,errorDigest:null},it=Zi(A,Ce.chunks.length,Ue,Ce.formatContext,!1,!1);Ce.children.push(it),Ce.lastPushedText=!1;var ut=Zi(A,0,null,Ce.formatContext,!1,!1);ut.parentFlushed=!0,B.blockedBoundary=Ue,B.blockedSegment=ut;try{if(Ns(A,B,te),ut.lastPushedText&&ut.textEmbedded&&ut.chunks.push(V),ut.status=1,Ds(Ue,ut),Ue.pendingTasks===0)break e}catch(ct){ut.status=4,Ue.forceClientRender=!0,Ue.errorDigest=Po(A,ct)}finally{B.blockedBoundary=G,B.blockedSegment=Ce}B=Wa(A,Se,G,it,Me,B.legacyContext,B.context,B.treeContext),A.pingedTasks.push(B)}return}if(typeof G=="object"&&G!==null)switch(G.$$typeof){case Xi:if(te=bc(A,B,G.render,te,Ce),Ai!==0){G=B.treeContext,B.treeContext=Ln(G,1,0);try{Nr(A,B,te)}finally{B.treeContext=G}}else Nr(A,B,te);return;case E:G=G.type,te=xc(G,te),Ms(A,B,G,te,Ce);return;case _n:if(Ce=te.children,G=G._context,te=te.value,Se=G._currentValue,G._currentValue=te,Me=tt,tt=te={parent:Me,depth:Me===null?0:Me.depth+1,context:G,parentValue:Se,value:te},B.context=te,Nr(A,B,Ce),A=tt,A===null)throw Error(e(403));te=A.parentValue,A.context._currentValue=te===ve?A.context._defaultValue:te,A=tt=A.parent,B.context=A;return;case yr:te=te.children,te=te(G._currentValue),Nr(A,B,te);return;case z:Ce=G._init,G=Ce(G._payload),te=xc(G,te),Ms(A,B,G,te,void 0);return}throw Error(e(130,G==null?G:typeof G,""))}}function Nr(A,B,G){if(B.node=G,typeof G=="object"&&G!==null){switch(G.$$typeof){case gr:Ms(A,B,G.type,G.props,G.ref);return;case ni:throw Error(e(257));case z:var te=G._init;G=te(G._payload),Nr(A,B,G);return}if(fe(G)){Sc(A,B,G);return}if(G===null||typeof G!="object"?te=null:(te=Oe&&G[Oe]||G["@@iterator"],te=typeof te=="function"?te:null),te&&(te=te.call(G))){if(G=te.next(),!G.done){var Ce=[];do Ce.push(G.value),G=te.next();while(!G.done);Sc(A,B,Ce)}return}throw A=Object.prototype.toString.call(G),Error(e(31,A==="[object Object]"?"object with keys {"+Object.keys(G).join(", ")+"}":A))}typeof G=="string"?(te=B.blockedSegment,te.lastPushedText=me(B.blockedSegment.chunks,G,A.responseState,te.lastPushedText)):typeof G=="number"&&(te=B.blockedSegment,te.lastPushedText=me(B.blockedSegment.chunks,""+G,A.responseState,te.lastPushedText))}function Sc(A,B,G){for(var te=G.length,Ce=0;Ce<te;Ce++){var Se=B.treeContext;B.treeContext=Ln(Se,te,Ce);try{Ns(A,B,G[Ce])}finally{B.treeContext=Se}}}function Ns(A,B,G){var te=B.blockedSegment.formatContext,Ce=B.legacyContext,Se=B.context;try{return Nr(A,B,G)}catch(it){if(No(),typeof it=="object"&&it!==null&&typeof it.then=="function"){G=it;var Me=B.blockedSegment,Ue=Zi(A,Me.chunks.length,null,Me.formatContext,Me.lastPushedText,!0);Me.children.push(Ue),Me.lastPushedText=!1,A=Wa(A,B.node,B.blockedBoundary,Ue,B.abortSet,B.legacyContext,B.context,B.treeContext).ping,G.then(A,A),B.blockedSegment.formatContext=te,B.legacyContext=Ce,B.context=Se,Cn(Se)}else throw B.blockedSegment.formatContext=te,B.legacyContext=Ce,B.context=Se,Cn(Se),it}}function Bd(A){var B=A.blockedBoundary;A=A.blockedSegment,A.status=3,_c(this,B,A)}function kc(A,B,G){var te=A.blockedBoundary;A.blockedSegment.status=3,te===null?(B.allPendingTasks--,B.status!==2&&(B.status=2,B.destination!==null&&B.destination.close())):(te.pendingTasks--,te.forceClientRender||(te.forceClientRender=!0,A=G===void 0?Error(e(432)):G,te.errorDigest=B.onError(A),te.parentFlushed&&B.clientRenderedBoundaries.push(te)),te.fallbackAbortableTasks.forEach(function(Ce){return kc(Ce,B,G)}),te.fallbackAbortableTasks.clear(),B.allPendingTasks--,B.allPendingTasks===0&&(te=B.onAllReady,te()))}function Ds(A,B){if(B.chunks.length===0&&B.children.length===1&&B.children[0].boundary===null){var G=B.children[0];G.id=B.id,G.parentFlushed=!0,G.status===1&&Ds(A,G)}else A.completedSegments.push(B)}function _c(A,B,G){if(B===null){if(G.parentFlushed){if(A.completedRootSegment!==null)throw Error(e(389));A.completedRootSegment=G}A.pendingRootTasks--,A.pendingRootTasks===0&&(A.onShellError=Ji,B=A.onShellReady,B())}else B.pendingTasks--,B.forceClientRender||(B.pendingTasks===0?(G.parentFlushed&&G.status===1&&Ds(B,G),B.parentFlushed&&A.completedBoundaries.push(B),B.fallbackAbortableTasks.forEach(Bd,A),B.fallbackAbortableTasks.clear()):G.parentFlushed&&G.status===1&&(Ds(B,G),B.completedSegments.length===1&&B.parentFlushed&&A.partialBoundaries.push(B)));A.allPendingTasks--,A.allPendingTasks===0&&(A=A.onAllReady,A())}function Cc(A){if(A.status!==2){var B=tt,G=$a.current;$a.current=vc;var te=Do;Do=A.responseState;try{var Ce=A.pingedTasks,Se;for(Se=0;Se<Ce.length;Se++){var Me=Ce[Se],Ue=A,it=Me.blockedSegment;if(it.status===0){Cn(Me.context);try{Nr(Ue,Me,Me.node),it.lastPushedText&&it.textEmbedded&&it.chunks.push(V),Me.abortSet.delete(Me),it.status=1,_c(Ue,Me.blockedBoundary,it)}catch(sn){if(No(),typeof sn=="object"&&sn!==null&&typeof sn.then=="function"){var ut=Me.ping;sn.then(ut,ut)}else{Me.abortSet.delete(Me),it.status=4;var ct=Me.blockedBoundary,Dt=sn,Dr=Po(Ue,Dt);if(ct===null?Os(Ue,Dt):(ct.pendingTasks--,ct.forceClientRender||(ct.forceClientRender=!0,ct.errorDigest=Dr,ct.parentFlushed&&Ue.clientRenderedBoundaries.push(ct))),Ue.allPendingTasks--,Ue.allPendingTasks===0){var on=Ue.onAllReady;on()}}}finally{}}}Ce.splice(0,Se),A.destination!==null&&Va(A,A.destination)}catch(sn){Po(A,sn),Os(A,sn)}finally{Do=te,$a.current=G,G===vc&&Cn(B)}}}function Ps(A,B,G){switch(G.parentFlushed=!0,G.status){case 0:var te=G.id=A.nextSegmentId++;return G.lastPushedText=!1,G.textEmbedded=!1,A=A.responseState,i(B,Ye),i(B,A.placeholderPrefix),A=l(te.toString(16)),i(B,A),o(B,Gt);case 1:G.status=2;var Ce=!0;te=G.chunks;var Se=0;G=G.children;for(var Me=0;Me<G.length;Me++){for(Ce=G[Me];Se<Ce.index;Se++)i(B,te[Se]);Ce=Ls(A,B,Ce)}for(;Se<te.length-1;Se++)i(B,te[Se]);return Se<te.length&&(Ce=o(B,te[Se])),Ce;default:throw Error(e(390))}}function Ls(A,B,G){var te=G.boundary;if(te===null)return Ps(A,B,G);if(te.parentFlushed=!0,te.forceClientRender)te=te.errorDigest,o(B,Et),i(B,Nn),te&&(i(B,Jn),i(B,l(Y(te))),i(B,rr)),o(B,$i),Ps(A,B,G);else if(0<te.pendingTasks){te.rootSegmentID=A.nextSegmentId++,0<te.completedSegments.length&&A.partialBoundaries.push(te);var Ce=A.responseState,Se=Ce.nextSuspenseID++;Ce=c(Ce.boundaryPrefix+Se.toString(16)),te=te.id=Ce,dr(B,A.responseState,te),Ps(A,B,G)}else if(te.byteSize>A.progressiveChunkSize)te.rootSegmentID=A.nextSegmentId++,A.completedBoundaries.push(te),dr(B,A.responseState,te.id),Ps(A,B,G);else{if(o(B,Ar),G=te.completedSegments,G.length!==1)throw Error(e(391));Ls(A,B,G[0])}return o(B,Yn)}function Ec(A,B,G){return Ir(B,A.responseState,G.formatContext,G.id),Ls(A,B,G),bn(B,G.formatContext)}function Tc(A,B,G){for(var te=G.completedSegments,Ce=0;Ce<te.length;Ce++)Ac(A,B,G,te[Ce]);if(te.length=0,A=A.responseState,te=G.id,G=G.rootSegmentID,i(B,A.startInlineScript),A.sentCompleteBoundaryFunction?i(B,Or):(A.sentCompleteBoundaryFunction=!0,i(B,ti)),te===null)throw Error(e(395));return G=l(G.toString(16)),i(B,te),i(B,ks),i(B,A.segmentPrefix),i(B,G),o(B,_s)}function Ac(A,B,G,te){if(te.status===2)return!0;var Ce=te.id;if(Ce===-1){if((te.id=G.rootSegmentID)===-1)throw Error(e(392));return Ec(A,B,te)}return Ec(A,B,te),A=A.responseState,i(B,A.startInlineScript),A.sentCompleteSegmentFunction?i(B,Qn):(A.sentCompleteSegmentFunction=!0,i(B,Gi)),i(B,A.segmentPrefix),Ce=l(Ce.toString(16)),i(B,Ce),i(B,ei),i(B,A.placeholderPrefix),i(B,Ce),o(B,wn)}function Va(A,B){r=new Uint8Array(512),n=0;try{var G=A.completedRootSegment;if(G!==null&&A.pendingRootTasks===0){Ls(A,B,G),A.completedRootSegment=null;var te=A.responseState.bootstrapChunks;for(G=0;G<te.length-1;G++)i(B,te[G]);G<te.length&&o(B,te[G])}var Ce=A.clientRenderedBoundaries,Se;for(Se=0;Se<Ce.length;Se++){var Me=Ce[Se];te=B;var Ue=A.responseState,it=Me.id,ut=Me.errorDigest,ct=Me.errorMessage,Dt=Me.errorComponentStack;if(i(te,Ue.startInlineScript),Ue.sentClientRenderFunction?i(te,Zt):(Ue.sentClientRenderFunction=!0,i(te,Pn)),it===null)throw Error(e(395));i(te,it),i(te,xn),(ut||ct||Dt)&&(i(te,ri),i(te,l(rn(ut||"")))),(ct||Dt)&&(i(te,ri),i(te,l(rn(ct||"")))),Dt&&(i(te,ri),i(te,l(rn(Dt)))),o(te,Sn)}Ce.splice(0,Se);var Dr=A.completedBoundaries;for(Se=0;Se<Dr.length;Se++)Tc(A,B,Dr[Se]);Dr.splice(0,Se),s(B),r=new Uint8Array(512),n=0;var on=A.partialBoundaries;for(Se=0;Se<on.length;Se++){var sn=on[Se];e:{Ce=A,Me=B;var Fs=sn.completedSegments;for(Ue=0;Ue<Fs.length;Ue++)if(!Ac(Ce,Me,sn,Fs[Ue])){Ue++,Fs.splice(0,Ue);var Ic=!1;break e}Fs.splice(0,Ue),Ic=!0}if(!Ic){A.destination=null,Se++,on.splice(0,Se);return}}on.splice(0,Se);var Lo=A.completedBoundaries;for(Se=0;Se<Lo.length;Se++)Tc(A,B,Lo[Se]);Lo.splice(0,Se)}finally{s(B),A.allPendingTasks===0&&A.pingedTasks.length===0&&A.clientRenderedBoundaries.length===0&&A.completedBoundaries.length===0&&B.close()}}function Rc(A,B){try{var G=A.abortableTasks;G.forEach(function(te){return kc(te,A,B)}),G.clear(),A.destination!==null&&Va(A,A.destination)}catch(te){Po(A,te),Os(A,te)}}return _m.renderToReadableStream=function(A,B){return new Promise(function(G,te){var Ce,Se,Me=new Promise(function(ct,Dt){Se=ct,Ce=Dt}),Ue=Ua(A,Fe(B?B.identifierPrefix:void 0,B?B.nonce:void 0,B?B.bootstrapScriptContent:void 0,B?B.bootstrapScripts:void 0,B?B.bootstrapModules:void 0),ze(B?B.namespaceURI:void 0),B?B.progressiveChunkSize:void 0,B?B.onError:void 0,Se,function(){var ct=new ReadableStream({type:"bytes",pull:function(Dt){if(Ue.status===1)Ue.status=2,d(Dt,Ue.fatalError);else if(Ue.status!==2&&Ue.destination===null){Ue.destination=Dt;try{Va(Ue,Dt)}catch(Dr){Po(Ue,Dr),Os(Ue,Dr)}}},cancel:function(){Rc(Ue)}},{highWaterMark:0});ct.allReady=Me,G(ct)},function(ct){Me.catch(function(){}),te(ct)},Ce);if(B&&B.signal){var it=B.signal,ut=function(){Rc(Ue,it.reason),it.removeEventListener("abort",ut)};it.addEventListener("abort",ut)}Cc(Ue)})},_m.version="18.3.1",_m}var _l={};/**
|
|
342
|
+
* @license React
|
|
343
|
+
* react-dom-server-legacy.browser.development.js
|
|
344
|
+
*
|
|
345
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
346
|
+
*
|
|
347
|
+
* This source code is licensed under the MIT license found in the
|
|
348
|
+
* LICENSE file in the root directory of this source tree.
|
|
349
|
+
*/var dR;function Uae(){return dR||(dR=1,process.env.NODE_ENV!=="production"&&function(){var t=J,e="18.3.1",r=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(u){{for(var h=arguments.length,y=new Array(h>1?h-1:0),C=1;C<h;C++)y[C-1]=arguments[C];o("warn",u,y)}}function i(u){{for(var h=arguments.length,y=new Array(h>1?h-1:0),C=1;C<h;C++)y[C-1]=arguments[C];o("error",u,y)}}function o(u,h,y){{var C=r.ReactDebugCurrentFrame,I=C.getStackAddendum();I!==""&&(h+="%s",y=y.concat([I]));var H=y.map(function(K){return String(K)});H.unshift("Warning: "+h),Function.prototype.apply.call(console[u],console,H)}}function s(u){u()}function a(u){}function l(u,h){c(u,h)}function c(u,h){return u.push(h)}function d(u){}function f(u){u.push(null)}function p(u){return u}function m(u){return u}function g(u,h){u.destroy(h)}function b(u){{var h=typeof Symbol=="function"&&Symbol.toStringTag,y=h&&u[Symbol.toStringTag]||u.constructor.name||"Object";return y}}function S(u){try{return w(u),!1}catch{return!0}}function w(u){return""+u}function T(u,h){if(S(u))return i("The provided `%s` attribute is an unsupported type %s. This value must be coerced to a string before before using it here.",h,b(u)),w(u)}function M(u,h){if(S(u))return i("The provided `%s` CSS property is an unsupported type %s. This value must be coerced to a string before before using it here.",h,b(u)),w(u)}function j(u){if(S(u))return i("The provided HTML markup uses a value of unsupported type %s. This value must be coerced to a string before before using it here.",b(u)),w(u)}var $=Object.prototype.hasOwnProperty,W=0,Y=1,ee=2,P=3,fe=4,de=5,U=6,ne=":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",R=ne+"\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",le=new RegExp("^["+ne+"]["+R+"]*$"),Ee={},he={};function Fe(u){return $.call(he,u)?!0:$.call(Ee,u)?!1:le.test(u)?(he[u]=!0,!0):(Ee[u]=!0,i("Invalid attribute name: `%s`",u),!1)}function ye(u,h,y,C){if(y!==null&&y.type===W)return!1;switch(typeof h){case"function":case"symbol":return!0;case"boolean":{if(y!==null)return!y.acceptsBooleans;var I=u.toLowerCase().slice(0,5);return I!=="data-"&&I!=="aria-"}default:return!1}}function ze(u){return V.hasOwnProperty(u)?V[u]:null}function ue(u,h,y,C,I,H,K){this.acceptsBooleans=h===ee||h===P||h===fe,this.attributeName=C,this.attributeNamespace=I,this.mustUseProperty=y,this.propertyName=u,this.type=h,this.sanitizeURL=H,this.removeEmptyString=K}var V={},me=["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"];me.forEach(function(u){V[u]=new ue(u,W,!1,u,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(u){var h=u[0],y=u[1];V[h]=new ue(h,Y,!1,y,null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(u){V[u]=new ue(u,ee,!1,u.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(u){V[u]=new ue(u,ee,!1,u,null,!1,!1)}),["allowFullScreen","async","autoFocus","autoPlay","controls","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"].forEach(function(u){V[u]=new ue(u,P,!1,u.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(u){V[u]=new ue(u,P,!0,u,null,!1,!1)}),["capture","download"].forEach(function(u){V[u]=new ue(u,fe,!1,u,null,!1,!1)}),["cols","rows","size","span"].forEach(function(u){V[u]=new ue(u,U,!1,u,null,!1,!1)}),["rowSpan","start"].forEach(function(u){V[u]=new ue(u,de,!1,u.toLowerCase(),null,!1,!1)});var ge=/[\-\:]([a-z])/g,ke=function(u){return u[1].toUpperCase()};["accent-height","alignment-baseline","arabic-form","baseline-shift","cap-height","clip-path","clip-rule","color-interpolation","color-interpolation-filters","color-profile","color-rendering","dominant-baseline","enable-background","fill-opacity","fill-rule","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","glyph-name","glyph-orientation-horizontal","glyph-orientation-vertical","horiz-adv-x","horiz-origin-x","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","overline-position","overline-thickness","paint-order","panose-1","pointer-events","rendering-intent","shape-rendering","stop-color","stop-opacity","strikethrough-position","strikethrough-thickness","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-rendering","underline-position","underline-thickness","unicode-bidi","unicode-range","units-per-em","v-alphabetic","v-hanging","v-ideographic","v-mathematical","vector-effect","vert-adv-y","vert-origin-x","vert-origin-y","word-spacing","writing-mode","xmlns:xlink","x-height"].forEach(function(u){var h=u.replace(ge,ke);V[h]=new ue(h,Y,!1,u,null,!1,!1)}),["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(function(u){var h=u.replace(ge,ke);V[h]=new ue(h,Y,!1,u,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(u){var h=u.replace(ge,ke);V[h]=new ue(h,Y,!1,u,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(u){V[u]=new ue(u,Y,!1,u.toLowerCase(),null,!1,!1)});var ce="xlinkHref";V[ce]=new ue("xlinkHref",Y,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(u){V[u]=new ue(u,Y,!1,u.toLowerCase(),null,!0,!0)});var L={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};function D(u,h){return u+h.charAt(0).toUpperCase()+h.substring(1)}var ae=["Webkit","ms","Moz","O"];Object.keys(L).forEach(function(u){ae.forEach(function(h){L[D(h,u)]=L[u]})});var ie={button:!0,checkbox:!0,image:!0,hidden:!0,radio:!0,reset:!0,submit:!0};function q(u,h){ie[h.type]||h.onChange||h.onInput||h.readOnly||h.disabled||h.value==null||i("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`."),h.onChange||h.readOnly||h.disabled||h.checked==null||i("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.")}function Z(u,h){if(u.indexOf("-")===-1)return typeof h.is=="string";switch(u){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var we={"aria-current":0,"aria-description":0,"aria-details":0,"aria-disabled":0,"aria-hidden":0,"aria-invalid":0,"aria-keyshortcuts":0,"aria-label":0,"aria-roledescription":0,"aria-autocomplete":0,"aria-checked":0,"aria-expanded":0,"aria-haspopup":0,"aria-level":0,"aria-modal":0,"aria-multiline":0,"aria-multiselectable":0,"aria-orientation":0,"aria-placeholder":0,"aria-pressed":0,"aria-readonly":0,"aria-required":0,"aria-selected":0,"aria-sort":0,"aria-valuemax":0,"aria-valuemin":0,"aria-valuenow":0,"aria-valuetext":0,"aria-atomic":0,"aria-busy":0,"aria-live":0,"aria-relevant":0,"aria-dropeffect":0,"aria-grabbed":0,"aria-activedescendant":0,"aria-colcount":0,"aria-colindex":0,"aria-colspan":0,"aria-controls":0,"aria-describedby":0,"aria-errormessage":0,"aria-flowto":0,"aria-labelledby":0,"aria-owns":0,"aria-posinset":0,"aria-rowcount":0,"aria-rowindex":0,"aria-rowspan":0,"aria-setsize":0},O={},xe=new RegExp("^(aria)-["+R+"]*$"),F=new RegExp("^(aria)[A-Z]["+R+"]*$");function k(u,h){{if($.call(O,h)&&O[h])return!0;if(F.test(h)){var y="aria-"+h.slice(4).toLowerCase(),C=we.hasOwnProperty(y)?y:null;if(C==null)return i("Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.",h),O[h]=!0,!0;if(h!==C)return i("Invalid ARIA attribute `%s`. Did you mean `%s`?",h,C),O[h]=!0,!0}if(xe.test(h)){var I=h.toLowerCase(),H=we.hasOwnProperty(I)?I:null;if(H==null)return O[h]=!0,!1;if(h!==H)return i("Unknown ARIA attribute `%s`. Did you mean `%s`?",h,H),O[h]=!0,!0}}return!0}function _(u,h){{var y=[];for(var C in h){var I=k(u,C);I||y.push(C)}var H=y.map(function(K){return"`"+K+"`"}).join(", ");y.length===1?i("Invalid aria prop %s on <%s> tag. For details, see https://reactjs.org/link/invalid-aria-props",H,u):y.length>1&&i("Invalid aria props %s on <%s> tag. For details, see https://reactjs.org/link/invalid-aria-props",H,u)}}function N(u,h){Z(u,h)||_(u,h)}var Q=!1;function pe(u,h){{if(u!=="input"&&u!=="textarea"&&u!=="select")return;h!=null&&h.value===null&&!Q&&(Q=!0,u==="select"&&h.multiple?i("`value` prop on `%s` should not be null. Consider using an empty array when `multiple` is set to `true` to clear the component or `undefined` for uncontrolled components.",u):i("`value` prop on `%s` should not be null. Consider using an empty string to clear the component or `undefined` for uncontrolled components.",u))}}var oe={accept:"accept",acceptcharset:"acceptCharset","accept-charset":"acceptCharset",accesskey:"accessKey",action:"action",allowfullscreen:"allowFullScreen",alt:"alt",as:"as",async:"async",autocapitalize:"autoCapitalize",autocomplete:"autoComplete",autocorrect:"autoCorrect",autofocus:"autoFocus",autoplay:"autoPlay",autosave:"autoSave",capture:"capture",cellpadding:"cellPadding",cellspacing:"cellSpacing",challenge:"challenge",charset:"charSet",checked:"checked",children:"children",cite:"cite",class:"className",classid:"classID",classname:"className",cols:"cols",colspan:"colSpan",content:"content",contenteditable:"contentEditable",contextmenu:"contextMenu",controls:"controls",controlslist:"controlsList",coords:"coords",crossorigin:"crossOrigin",dangerouslysetinnerhtml:"dangerouslySetInnerHTML",data:"data",datetime:"dateTime",default:"default",defaultchecked:"defaultChecked",defaultvalue:"defaultValue",defer:"defer",dir:"dir",disabled:"disabled",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback",download:"download",draggable:"draggable",enctype:"encType",enterkeyhint:"enterKeyHint",for:"htmlFor",form:"form",formmethod:"formMethod",formaction:"formAction",formenctype:"formEncType",formnovalidate:"formNoValidate",formtarget:"formTarget",frameborder:"frameBorder",headers:"headers",height:"height",hidden:"hidden",high:"high",href:"href",hreflang:"hrefLang",htmlfor:"htmlFor",httpequiv:"httpEquiv","http-equiv":"httpEquiv",icon:"icon",id:"id",imagesizes:"imageSizes",imagesrcset:"imageSrcSet",innerhtml:"innerHTML",inputmode:"inputMode",integrity:"integrity",is:"is",itemid:"itemID",itemprop:"itemProp",itemref:"itemRef",itemscope:"itemScope",itemtype:"itemType",keyparams:"keyParams",keytype:"keyType",kind:"kind",label:"label",lang:"lang",list:"list",loop:"loop",low:"low",manifest:"manifest",marginwidth:"marginWidth",marginheight:"marginHeight",max:"max",maxlength:"maxLength",media:"media",mediagroup:"mediaGroup",method:"method",min:"min",minlength:"minLength",multiple:"multiple",muted:"muted",name:"name",nomodule:"noModule",nonce:"nonce",novalidate:"noValidate",open:"open",optimum:"optimum",pattern:"pattern",placeholder:"placeholder",playsinline:"playsInline",poster:"poster",preload:"preload",profile:"profile",radiogroup:"radioGroup",readonly:"readOnly",referrerpolicy:"referrerPolicy",rel:"rel",required:"required",reversed:"reversed",role:"role",rows:"rows",rowspan:"rowSpan",sandbox:"sandbox",scope:"scope",scoped:"scoped",scrolling:"scrolling",seamless:"seamless",selected:"selected",shape:"shape",size:"size",sizes:"sizes",span:"span",spellcheck:"spellCheck",src:"src",srcdoc:"srcDoc",srclang:"srcLang",srcset:"srcSet",start:"start",step:"step",style:"style",summary:"summary",tabindex:"tabIndex",target:"target",title:"title",type:"type",usemap:"useMap",value:"value",width:"width",wmode:"wmode",wrap:"wrap",about:"about",accentheight:"accentHeight","accent-height":"accentHeight",accumulate:"accumulate",additive:"additive",alignmentbaseline:"alignmentBaseline","alignment-baseline":"alignmentBaseline",allowreorder:"allowReorder",alphabetic:"alphabetic",amplitude:"amplitude",arabicform:"arabicForm","arabic-form":"arabicForm",ascent:"ascent",attributename:"attributeName",attributetype:"attributeType",autoreverse:"autoReverse",azimuth:"azimuth",basefrequency:"baseFrequency",baselineshift:"baselineShift","baseline-shift":"baselineShift",baseprofile:"baseProfile",bbox:"bbox",begin:"begin",bias:"bias",by:"by",calcmode:"calcMode",capheight:"capHeight","cap-height":"capHeight",clip:"clip",clippath:"clipPath","clip-path":"clipPath",clippathunits:"clipPathUnits",cliprule:"clipRule","clip-rule":"clipRule",color:"color",colorinterpolation:"colorInterpolation","color-interpolation":"colorInterpolation",colorinterpolationfilters:"colorInterpolationFilters","color-interpolation-filters":"colorInterpolationFilters",colorprofile:"colorProfile","color-profile":"colorProfile",colorrendering:"colorRendering","color-rendering":"colorRendering",contentscripttype:"contentScriptType",contentstyletype:"contentStyleType",cursor:"cursor",cx:"cx",cy:"cy",d:"d",datatype:"datatype",decelerate:"decelerate",descent:"descent",diffuseconstant:"diffuseConstant",direction:"direction",display:"display",divisor:"divisor",dominantbaseline:"dominantBaseline","dominant-baseline":"dominantBaseline",dur:"dur",dx:"dx",dy:"dy",edgemode:"edgeMode",elevation:"elevation",enablebackground:"enableBackground","enable-background":"enableBackground",end:"end",exponent:"exponent",externalresourcesrequired:"externalResourcesRequired",fill:"fill",fillopacity:"fillOpacity","fill-opacity":"fillOpacity",fillrule:"fillRule","fill-rule":"fillRule",filter:"filter",filterres:"filterRes",filterunits:"filterUnits",floodopacity:"floodOpacity","flood-opacity":"floodOpacity",floodcolor:"floodColor","flood-color":"floodColor",focusable:"focusable",fontfamily:"fontFamily","font-family":"fontFamily",fontsize:"fontSize","font-size":"fontSize",fontsizeadjust:"fontSizeAdjust","font-size-adjust":"fontSizeAdjust",fontstretch:"fontStretch","font-stretch":"fontStretch",fontstyle:"fontStyle","font-style":"fontStyle",fontvariant:"fontVariant","font-variant":"fontVariant",fontweight:"fontWeight","font-weight":"fontWeight",format:"format",from:"from",fx:"fx",fy:"fy",g1:"g1",g2:"g2",glyphname:"glyphName","glyph-name":"glyphName",glyphorientationhorizontal:"glyphOrientationHorizontal","glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphorientationvertical:"glyphOrientationVertical","glyph-orientation-vertical":"glyphOrientationVertical",glyphref:"glyphRef",gradienttransform:"gradientTransform",gradientunits:"gradientUnits",hanging:"hanging",horizadvx:"horizAdvX","horiz-adv-x":"horizAdvX",horizoriginx:"horizOriginX","horiz-origin-x":"horizOriginX",ideographic:"ideographic",imagerendering:"imageRendering","image-rendering":"imageRendering",in2:"in2",in:"in",inlist:"inlist",intercept:"intercept",k1:"k1",k2:"k2",k3:"k3",k4:"k4",k:"k",kernelmatrix:"kernelMatrix",kernelunitlength:"kernelUnitLength",kerning:"kerning",keypoints:"keyPoints",keysplines:"keySplines",keytimes:"keyTimes",lengthadjust:"lengthAdjust",letterspacing:"letterSpacing","letter-spacing":"letterSpacing",lightingcolor:"lightingColor","lighting-color":"lightingColor",limitingconeangle:"limitingConeAngle",local:"local",markerend:"markerEnd","marker-end":"markerEnd",markerheight:"markerHeight",markermid:"markerMid","marker-mid":"markerMid",markerstart:"markerStart","marker-start":"markerStart",markerunits:"markerUnits",markerwidth:"markerWidth",mask:"mask",maskcontentunits:"maskContentUnits",maskunits:"maskUnits",mathematical:"mathematical",mode:"mode",numoctaves:"numOctaves",offset:"offset",opacity:"opacity",operator:"operator",order:"order",orient:"orient",orientation:"orientation",origin:"origin",overflow:"overflow",overlineposition:"overlinePosition","overline-position":"overlinePosition",overlinethickness:"overlineThickness","overline-thickness":"overlineThickness",paintorder:"paintOrder","paint-order":"paintOrder",panose1:"panose1","panose-1":"panose1",pathlength:"pathLength",patterncontentunits:"patternContentUnits",patterntransform:"patternTransform",patternunits:"patternUnits",pointerevents:"pointerEvents","pointer-events":"pointerEvents",points:"points",pointsatx:"pointsAtX",pointsaty:"pointsAtY",pointsatz:"pointsAtZ",prefix:"prefix",preservealpha:"preserveAlpha",preserveaspectratio:"preserveAspectRatio",primitiveunits:"primitiveUnits",property:"property",r:"r",radius:"radius",refx:"refX",refy:"refY",renderingintent:"renderingIntent","rendering-intent":"renderingIntent",repeatcount:"repeatCount",repeatdur:"repeatDur",requiredextensions:"requiredExtensions",requiredfeatures:"requiredFeatures",resource:"resource",restart:"restart",result:"result",results:"results",rotate:"rotate",rx:"rx",ry:"ry",scale:"scale",security:"security",seed:"seed",shaperendering:"shapeRendering","shape-rendering":"shapeRendering",slope:"slope",spacing:"spacing",specularconstant:"specularConstant",specularexponent:"specularExponent",speed:"speed",spreadmethod:"spreadMethod",startoffset:"startOffset",stddeviation:"stdDeviation",stemh:"stemh",stemv:"stemv",stitchtiles:"stitchTiles",stopcolor:"stopColor","stop-color":"stopColor",stopopacity:"stopOpacity","stop-opacity":"stopOpacity",strikethroughposition:"strikethroughPosition","strikethrough-position":"strikethroughPosition",strikethroughthickness:"strikethroughThickness","strikethrough-thickness":"strikethroughThickness",string:"string",stroke:"stroke",strokedasharray:"strokeDasharray","stroke-dasharray":"strokeDasharray",strokedashoffset:"strokeDashoffset","stroke-dashoffset":"strokeDashoffset",strokelinecap:"strokeLinecap","stroke-linecap":"strokeLinecap",strokelinejoin:"strokeLinejoin","stroke-linejoin":"strokeLinejoin",strokemiterlimit:"strokeMiterlimit","stroke-miterlimit":"strokeMiterlimit",strokewidth:"strokeWidth","stroke-width":"strokeWidth",strokeopacity:"strokeOpacity","stroke-opacity":"strokeOpacity",suppresscontenteditablewarning:"suppressContentEditableWarning",suppresshydrationwarning:"suppressHydrationWarning",surfacescale:"surfaceScale",systemlanguage:"systemLanguage",tablevalues:"tableValues",targetx:"targetX",targety:"targetY",textanchor:"textAnchor","text-anchor":"textAnchor",textdecoration:"textDecoration","text-decoration":"textDecoration",textlength:"textLength",textrendering:"textRendering","text-rendering":"textRendering",to:"to",transform:"transform",typeof:"typeof",u1:"u1",u2:"u2",underlineposition:"underlinePosition","underline-position":"underlinePosition",underlinethickness:"underlineThickness","underline-thickness":"underlineThickness",unicode:"unicode",unicodebidi:"unicodeBidi","unicode-bidi":"unicodeBidi",unicoderange:"unicodeRange","unicode-range":"unicodeRange",unitsperem:"unitsPerEm","units-per-em":"unitsPerEm",unselectable:"unselectable",valphabetic:"vAlphabetic","v-alphabetic":"vAlphabetic",values:"values",vectoreffect:"vectorEffect","vector-effect":"vectorEffect",version:"version",vertadvy:"vertAdvY","vert-adv-y":"vertAdvY",vertoriginx:"vertOriginX","vert-origin-x":"vertOriginX",vertoriginy:"vertOriginY","vert-origin-y":"vertOriginY",vhanging:"vHanging","v-hanging":"vHanging",videographic:"vIdeographic","v-ideographic":"vIdeographic",viewbox:"viewBox",viewtarget:"viewTarget",visibility:"visibility",vmathematical:"vMathematical","v-mathematical":"vMathematical",vocab:"vocab",widths:"widths",wordspacing:"wordSpacing","word-spacing":"wordSpacing",writingmode:"writingMode","writing-mode":"writingMode",x1:"x1",x2:"x2",x:"x",xchannelselector:"xChannelSelector",xheight:"xHeight","x-height":"xHeight",xlinkactuate:"xlinkActuate","xlink:actuate":"xlinkActuate",xlinkarcrole:"xlinkArcrole","xlink:arcrole":"xlinkArcrole",xlinkhref:"xlinkHref","xlink:href":"xlinkHref",xlinkrole:"xlinkRole","xlink:role":"xlinkRole",xlinkshow:"xlinkShow","xlink:show":"xlinkShow",xlinktitle:"xlinkTitle","xlink:title":"xlinkTitle",xlinktype:"xlinkType","xlink:type":"xlinkType",xmlbase:"xmlBase","xml:base":"xmlBase",xmllang:"xmlLang","xml:lang":"xmlLang",xmlns:"xmlns","xml:space":"xmlSpace",xmlnsxlink:"xmlnsXlink","xmlns:xlink":"xmlnsXlink",xmlspace:"xmlSpace",y1:"y1",y2:"y2",y:"y",ychannelselector:"yChannelSelector",z:"z",zoomandpan:"zoomAndPan"},Re=function(){};{var Ne={},De=/^on./,We=/^on[^A-Z]/,Je=new RegExp("^(aria)-["+R+"]*$"),Ye=new RegExp("^(aria)[A-Z]["+R+"]*$");Re=function(u,h,y,C){if($.call(Ne,h)&&Ne[h])return!0;var I=h.toLowerCase();if(I==="onfocusin"||I==="onfocusout")return i("React uses onFocus and onBlur instead of onFocusIn and onFocusOut. All React events are normalized to bubble, so onFocusIn and onFocusOut are not needed/supported by React."),Ne[h]=!0,!0;if(C!=null){var H=C.registrationNameDependencies,K=C.possibleRegistrationNames;if(H.hasOwnProperty(h))return!0;var se=K.hasOwnProperty(I)?K[I]:null;if(se!=null)return i("Invalid event handler property `%s`. Did you mean `%s`?",h,se),Ne[h]=!0,!0;if(De.test(h))return i("Unknown event handler property `%s`. It will be ignored.",h),Ne[h]=!0,!0}else if(De.test(h))return We.test(h)&&i("Invalid event handler property `%s`. React events use the camelCase naming convention, for example `onClick`.",h),Ne[h]=!0,!0;if(Je.test(h)||Ye.test(h))return!0;if(I==="innerhtml")return i("Directly setting property `innerHTML` is not permitted. For more information, lookup documentation on `dangerouslySetInnerHTML`."),Ne[h]=!0,!0;if(I==="aria")return i("The `aria` attribute is reserved for future use in React. Pass individual `aria-` attributes instead."),Ne[h]=!0,!0;if(I==="is"&&y!==null&&y!==void 0&&typeof y!="string")return i("Received a `%s` for a string attribute `is`. If this is expected, cast the value to a string.",typeof y),Ne[h]=!0,!0;if(typeof y=="number"&&isNaN(y))return i("Received NaN for the `%s` attribute. If this is expected, cast the value to a string.",h),Ne[h]=!0,!0;var be=ze(h),Pe=be!==null&&be.type===W;if(oe.hasOwnProperty(I)){var je=oe[I];if(je!==h)return i("Invalid DOM property `%s`. Did you mean `%s`?",h,je),Ne[h]=!0,!0}else if(!Pe&&h!==I)return i("React does not recognize the `%s` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `%s` instead. If you accidentally passed it from a parent component, remove it from the DOM element.",h,I),Ne[h]=!0,!0;return typeof y=="boolean"&&ye(h,y,be)?(y?i('Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.',y,h,h,y,h):i('Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.',y,h,h,y,h,h,h),Ne[h]=!0,!0):Pe?!0:ye(h,y,be)?(Ne[h]=!0,!1):((y==="false"||y==="true")&&be!==null&&be.type===P&&(i("Received the string `%s` for the boolean attribute `%s`. %s Did you mean %s={%s}?",y,h,y==="false"?"The browser will interpret it as a truthy value.":'Although this works, it will not work as expected if you pass the string "false".',h,y),Ne[h]=!0),!0)}}var Gt=function(u,h,y){{var C=[];for(var I in h){var H=Re(u,I,h[I],y);H||C.push(I)}var K=C.map(function(se){return"`"+se+"`"}).join(", ");C.length===1?i("Invalid value for prop %s on <%s> tag. Either remove it from the element, or pass a string or number value to keep it in the DOM. For details, see https://reactjs.org/link/attribute-behavior ",K,u):C.length>1&&i("Invalid values for props %s on <%s> tag. Either remove them from the element, or pass a string or number value to keep them in the DOM. For details, see https://reactjs.org/link/attribute-behavior ",K,u)}};function Ar(u,h,y){Z(u,h)||Gt(u,h,y)}var pr=function(){};{var en=/^(?:webkit|moz|o)[A-Z]/,Et=/^-ms-/,Yn=/-(.)/g,Nn=/;\s*$/,rr={},Jn={},$i=!1,dr=!1,Hr=function(u){return u.replace(Yn,function(h,y){return y.toUpperCase()})},tn=function(u){rr.hasOwnProperty(u)&&rr[u]||(rr[u]=!0,i("Unsupported style property %s. Did you mean %s?",u,Hr(u.replace(Et,"ms-"))))},mt=function(u){rr.hasOwnProperty(u)&&rr[u]||(rr[u]=!0,i("Unsupported vendor-prefixed style property %s. Did you mean %s?",u,u.charAt(0).toUpperCase()+u.slice(1)))},Rr=function(u,h){Jn.hasOwnProperty(h)&&Jn[h]||(Jn[h]=!0,i(`Style property values shouldn't contain a semicolon. Try "%s: %s" instead.`,u,h.replace(Nn,"")))},Ui=function(u,h){$i||($i=!0,i("`NaN` is an invalid value for the `%s` css style property.",u))},ki=function(u,h){dr||(dr=!0,i("`Infinity` is an invalid value for the `%s` css style property.",u))};pr=function(u,h){u.indexOf("-")>-1?tn(u):en.test(u)?mt(u):Nn.test(h)&&Rr(u,h),typeof h=="number"&&(isNaN(h)?Ui(u,h):isFinite(h)||ki(u,h))}}var yn=pr,Wi=/["'&<>]/;function Dn(u){j(u);var h=""+u,y=Wi.exec(h);if(!y)return h;var C,I="",H,K=0;for(H=y.index;H<h.length;H++){switch(h.charCodeAt(H)){case 34:C=""";break;case 38:C="&";break;case 39:C="'";break;case 60:C="<";break;case 62:C=">";break;default:continue}K!==H&&(I+=h.substring(K,H)),K=H+1,I+=C}return K!==H?I+h.substring(K,H):I}function nr(u){return typeof u=="boolean"||typeof u=="number"?""+u:Dn(u)}var Ro=/([A-Z])/g,Io=/^ms-/;function Ss(u){return u.replace(Ro,"-$1").toLowerCase().replace(Io,"-ms-")}var Jt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i,Oo=!1;function ja(u){!Oo&&Jt.test(u)&&(Oo=!0,i("A future version of React will block javascript: URLs as a security precaution. Use event handlers instead if you can. If you need to generate unsafe HTML try using dangerouslySetInnerHTML instead. React was passed %s.",JSON.stringify(u)))}var Ba=Array.isArray;function vn(u){return Ba(u)}var Mo="<script>";function Vi(u,h,y,C,I){var H=u===void 0?"":u,K=Mo,se=[];return{bootstrapChunks:se,startInlineScript:K,placeholderPrefix:H+"P:",segmentPrefix:H+"S:",boundaryPrefix:H+"B:",idPrefix:H,nextSuspenseID:0,sentCompleteSegmentFunction:!1,sentCompleteBoundaryFunction:!1,sentClientRenderFunction:!1}}var Zn=0,Ir=1,bn=2,Gi=3,Qn=4,ei=5,wn=6,ti=7;function Or(u,h){return{insertionMode:u,selectedValue:h}}function ks(u,h,y){switch(h){case"select":return Or(Ir,y.value!=null?y.value:y.defaultValue);case"svg":return Or(bn,null);case"math":return Or(Gi,null);case"foreignObject":return Or(Ir,null);case"table":return Or(Qn,null);case"thead":case"tbody":case"tfoot":return Or(ei,null);case"colgroup":return Or(ti,null);case"tr":return Or(wn,null)}return u.insertionMode>=Qn||u.insertionMode===Zn?Or(Ir,null):u}var _s=null;function Pn(u){var h=u.nextSuspenseID++;return u.boundaryPrefix+h.toString(16)}function Zt(u,h,y){var C=u.idPrefix,I=":"+C+"R"+h;return y>0&&(I+="H"+y.toString(32)),I+":"}function xn(u){return nr(u)}var Sn="<!-- -->";function ri(u,h,y,C){return h===""?C:(C&&u.push(Sn),u.push(xn(h)),!0)}function Ki(u,h,y,C){y&&C&&u.push(Sn)}var rn=new Map;function kn(u){var h=rn.get(u);if(h!==void 0)return h;var y=nr(Ss(u));return rn.set(u,y),y}var gr=' style="',ni=":",_i=";";function qi(u,h,y){if(typeof y!="object")throw new Error("The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.");var C=!0;for(var I in y)if($.call(y,I)){var H=y[I];if(!(H==null||typeof H=="boolean"||H==="")){var K=void 0,se=void 0,be=I.indexOf("--")===0;be?(K=nr(I),M(H,I),se=nr((""+H).trim())):(yn(I,H),K=kn(I),typeof H=="number"?H!==0&&!$.call(L,I)?se=H+"px":se=""+H:(M(H,I),se=nr((""+H).trim()))),C?(C=!1,u.push(gr,K,ni,se)):u.push(_i,K,ni,se)}}C||u.push(yr)}var $r=" ",_n='="',yr='"',Xi='=""';function ar(u,h,y,C){switch(y){case"style":{qi(u,h,C);return}case"defaultValue":case"defaultChecked":case"innerHTML":case"suppressContentEditableWarning":case"suppressHydrationWarning":return}if(!(y.length>2&&(y[0]==="o"||y[0]==="O")&&(y[1]==="n"||y[1]==="N"))){var I=ze(y);if(I!==null){switch(typeof C){case"function":case"symbol":return;case"boolean":if(!I.acceptsBooleans)return}var H=I.attributeName,K=H;switch(I.type){case P:C&&u.push($r,K,Xi);return;case fe:C===!0?u.push($r,K,Xi):C===!1||u.push($r,K,_n,nr(C),yr);return;case de:isNaN(C)||u.push($r,K,_n,nr(C),yr);break;case U:!isNaN(C)&&C>=1&&u.push($r,K,_n,nr(C),yr);break;default:I.sanitizeURL&&(T(C,H),C=""+C,ja(C)),u.push($r,K,_n,nr(C),yr)}}else if(Fe(y)){switch(typeof C){case"function":case"symbol":return;case"boolean":{var se=y.toLowerCase().slice(0,5);if(se!=="data-"&&se!=="aria-")return}}u.push($r,y,_n,nr(C),yr)}}}var Mr=">",E="/>";function z(u,h,y){if(h!=null){if(y!=null)throw new Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`.");if(typeof h!="object"||!("__html"in h))throw new Error("`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://reactjs.org/link/dangerously-set-inner-html for more information.");var C=h.__html;C!=null&&(j(C),u.push(""+C))}}var X=!1,re=!1,_e=!1,ve=!1,Oe=!1,$e=!1,Qe=!1;function nt(u,h){{var y=u[h];if(y!=null){var C=vn(y);u.multiple&&!C?i("The `%s` prop supplied to <select> must be an array if `multiple` is true.",h):!u.multiple&&C&&i("The `%s` prop supplied to <select> must be a scalar value if `multiple` is false.",h)}}}function tt(u,h,y){q("select",h),nt(h,"value"),nt(h,"defaultValue"),h.value!==void 0&&h.defaultValue!==void 0&&!_e&&(i("Select elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled select element and remove one of these props. More info: https://reactjs.org/link/controlled-components"),_e=!0),u.push(En("select"));var C=null,I=null;for(var H in h)if($.call(h,H)){var K=h[H];if(K==null)continue;switch(H){case"children":C=K;break;case"dangerouslySetInnerHTML":I=K;break;case"defaultValue":case"value":break;default:ar(u,y,H,K);break}}return u.push(Mr),z(u,I,C),C}function wt(u){var h="";return t.Children.forEach(u,function(y){y!=null&&(h+=y,!Oe&&typeof y!="string"&&typeof y!="number"&&(Oe=!0,i("Cannot infer the option value of complex children. Pass a `value` prop or use a plain string as children to <option>.")))}),h}var vr=' selected=""';function br(u,h,y,C){var I=C.selectedValue;u.push(En("option"));var H=null,K=null,se=null,be=null;for(var Pe in h)if($.call(h,Pe)){var je=h[Pe];if(je==null)continue;switch(Pe){case"children":H=je;break;case"selected":se=je,Qe||(i("Use the `defaultValue` or `value` props on <select> instead of setting `selected` on <option>."),Qe=!0);break;case"dangerouslySetInnerHTML":be=je;break;case"value":K=je;default:ar(u,y,Pe,je);break}}if(I!=null){var Ke;if(K!==null?(T(K,"value"),Ke=""+K):(be!==null&&($e||($e=!0,i("Pass a `value` prop if you set dangerouslyInnerHTML so React knows which value should be selected."))),Ke=wt(H)),vn(I))for(var st=0;st<I.length;st++){T(I[st],"value");var kt=""+I[st];if(kt===Ke){u.push(vr);break}}else T(I,"select.value"),""+I===Ke&&u.push(vr)}else se&&u.push(vr);return u.push(Mr),z(u,be,H),H}function wr(u,h,y){q("input",h),h.checked!==void 0&&h.defaultChecked!==void 0&&!re&&(i("%s contains an input of type %s with both checked and defaultChecked props. Input elements must be either controlled or uncontrolled (specify either the checked prop, or the defaultChecked prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components","A component",h.type),re=!0),h.value!==void 0&&h.defaultValue!==void 0&&!X&&(i("%s contains an input of type %s with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components","A component",h.type),X=!0),u.push(En("input"));var C=null,I=null,H=null,K=null;for(var se in h)if($.call(h,se)){var be=h[se];if(be==null)continue;switch(se){case"children":case"dangerouslySetInnerHTML":throw new Error("input is a self-closing tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");case"defaultChecked":K=be;break;case"defaultValue":I=be;break;case"checked":H=be;break;case"value":C=be;break;default:ar(u,y,se,be);break}}return H!==null?ar(u,y,"checked",H):K!==null&&ar(u,y,"checked",K),C!==null?ar(u,y,"value",C):I!==null&&ar(u,y,"value",I),u.push(E),null}function ii(u,h,y){q("textarea",h),h.value!==void 0&&h.defaultValue!==void 0&&!ve&&(i("Textarea elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled textarea and remove one of these props. More info: https://reactjs.org/link/controlled-components"),ve=!0),u.push(En("textarea"));var C=null,I=null,H=null;for(var K in h)if($.call(h,K)){var se=h[K];if(se==null)continue;switch(K){case"children":H=se;break;case"value":C=se;break;case"defaultValue":I=se;break;case"dangerouslySetInnerHTML":throw new Error("`dangerouslySetInnerHTML` does not make sense on <textarea>.");default:ar(u,y,K,se);break}}if(C===null&&I!==null&&(C=I),u.push(Mr),H!=null){if(i("Use the `defaultValue` or `value` props instead of setting children on <textarea>."),C!=null)throw new Error("If you supply `defaultValue` on a <textarea>, do not pass children.");if(vn(H)){if(H.length>1)throw new Error("<textarea> can only have at most one child.");j(H[0]),C=""+H[0]}j(H),C=""+H}return typeof C=="string"&&C[0]===`
|
|
350
|
+
`&&u.push(Ei),C!==null&&(T(C,"value"),u.push(xn(""+C))),null}function Cn(u,h,y,C){u.push(En(y));for(var I in h)if($.call(h,I)){var H=h[I];if(H==null)continue;switch(I){case"children":case"dangerouslySetInnerHTML":throw new Error(y+" is a self-closing tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");default:ar(u,C,I,H);break}}return u.push(E),null}function Yi(u,h,y){u.push(En("menuitem"));for(var C in h)if($.call(h,C)){var I=h[C];if(I==null)continue;switch(C){case"children":case"dangerouslySetInnerHTML":throw new Error("menuitems cannot have `children` nor `dangerouslySetInnerHTML`.");default:ar(u,y,C,I);break}}return u.push(Mr),null}function oi(u,h,y){u.push(En("title"));var C=null;for(var I in h)if($.call(h,I)){var H=h[I];if(H==null)continue;switch(I){case"children":C=H;break;case"dangerouslySetInnerHTML":throw new Error("`dangerouslySetInnerHTML` does not make sense on <title>.");default:ar(u,y,I,H);break}}u.push(Mr);{var K=Array.isArray(C)&&C.length<2?C[0]||null:C;Array.isArray(C)&&C.length>1?i("A title element received an array with more than 1 element as children. In browsers title Elements can only have Text Nodes as children. If the children being rendered output more than a single text node in aggregate the browser will display markup and comments as text in the title and hydration will likely fail and fall back to client rendering"):K!=null&&K.$$typeof!=null?i("A title element received a React element for children. In the browser title Elements can only have Text Nodes as children. If the children being rendered output more than a single text node in aggregate the browser will display markup and comments as text in the title and hydration will likely fail and fall back to client rendering"):K!=null&&typeof K!="string"&&typeof K!="number"&&i("A title element received a value that was not a string or number for children. In the browser title Elements can only have Text Nodes as children. If the children being rendered output more than a single text node in aggregate the browser will display markup and comments as text in the title and hydration will likely fail and fall back to client rendering")}return C}function Ci(u,h,y,C){u.push(En(y));var I=null,H=null;for(var K in h)if($.call(h,K)){var se=h[K];if(se==null)continue;switch(K){case"children":I=se;break;case"dangerouslySetInnerHTML":H=se;break;default:ar(u,C,K,se);break}}return u.push(Mr),z(u,H,I),typeof I=="string"?(u.push(xn(I)),null):I}function Ln(u,h,y,C){u.push(En(y));var I=null,H=null;for(var K in h)if($.call(h,K)){var se=h[K];if(se==null)continue;switch(K){case"children":I=se;break;case"dangerouslySetInnerHTML":H=se;break;case"style":qi(u,C,se);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":break;default:Fe(K)&&typeof se!="function"&&typeof se!="symbol"&&u.push($r,K,_n,nr(se),yr);break}}return u.push(Mr),z(u,H,I),I}var Ei=`
|
|
351
|
+
`;function Nd(u,h,y,C){u.push(En(y));var I=null,H=null;for(var K in h)if($.call(h,K)){var se=h[K];if(se==null)continue;switch(K){case"children":I=se;break;case"dangerouslySetInnerHTML":H=se;break;default:ar(u,C,K,se);break}}if(u.push(Mr),H!=null){if(I!=null)throw new Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`.");if(typeof H!="object"||!("__html"in H))throw new Error("`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://reactjs.org/link/dangerously-set-inner-html for more information.");var be=H.__html;be!=null&&(typeof be=="string"&&be.length>0&&be[0]===`
|
|
352
|
+
`?u.push(Ei,be):(j(be),u.push(""+be)))}return typeof I=="string"&&I[0]===`
|
|
353
|
+
`&&u.push(Ei),I}var Dd=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,Cs=new Map;function En(u){var h=Cs.get(u);if(h===void 0){if(!Dd.test(u))throw new Error("Invalid tag: "+u);h="<"+u,Cs.set(u,h)}return h}var Pd="<!DOCTYPE html>";function Fn(u,h,y,C,I){switch(N(h,y),pe(h,y),Ar(h,y,null),!y.suppressContentEditableWarning&&y.contentEditable&&y.children!=null&&i("A component is `contentEditable` and contains `children` managed by React. It is now your responsibility to guarantee that none of those nodes are unexpectedly modified or duplicated. This is probably not intentional."),I.insertionMode!==bn&&I.insertionMode!==Gi&&h.indexOf("-")===-1&&typeof y.is!="string"&&h.toLowerCase()!==h&&i("<%s /> is using incorrect casing. Use PascalCase for React components, or lowercase for HTML elements.",h),h){case"select":return tt(u,y,C);case"option":return br(u,y,C,I);case"textarea":return ii(u,y,C);case"input":return wr(u,y,C);case"menuitem":return Yi(u,y,C);case"title":return oi(u,y,C);case"listing":case"pre":return Nd(u,y,h,C);case"area":case"base":case"br":case"col":case"embed":case"hr":case"img":case"keygen":case"link":case"meta":case"param":case"source":case"track":case"wbr":return Cn(u,y,h,C);case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return Ci(u,y,h,C);case"html":return I.insertionMode===Zn&&u.push(Pd),Ci(u,y,h,C);default:return h.indexOf("-")===-1&&typeof y.is!="string"?Ci(u,y,h,C):Ln(u,y,h,C)}}var za="</",Es=">";function It(u,h,y){switch(h){case"area":case"base":case"br":case"col":case"embed":case"hr":case"img":case"input":case"keygen":case"link":case"meta":case"param":case"source":case"track":case"wbr":break;default:u.push(za,h,Es)}}function Ti(u,h){for(var y=h.bootstrapChunks,C=0;C<y.length-1;C++)l(u,y[C]);return C<y.length?c(u,y[C]):!0}var Ts='<template id="',Ai='"></template>';function si(u,h,y){l(u,Ts),l(u,h.placeholderPrefix);var C=y.toString(16);return l(u,C),c(u,Ai)}var As="<!--$-->",ai='<!--$?--><template id="',nn='"></template>',Ha="<!--$!-->",No="<!--/$-->",gc="<template",Rs='"',yc=' data-dgst="',Ld=' data-msg="',Fd=' data-stck="',Is="></template>";function vc(u,h){return c(u,As)}function Do(u,h,y){if(l(u,ai),y===null)throw new Error("An ID must have been assigned before we can complete the boundary.");return l(u,y),c(u,nn)}function $a(u,h,y,C,I){var H;return H=c(u,Ha),l(u,gc),y&&(l(u,yc),l(u,nr(y)),l(u,Rs)),C&&(l(u,Ld),l(u,nr(C)),l(u,Rs)),I&&(l(u,Fd),l(u,nr(I)),l(u,Rs)),H=c(u,Is),H}function jd(u,h){return c(u,No)}function Ji(u,h){return c(u,No)}function Ua(u,h){return c(u,No)}var Wa='<div hidden id="',Zi='">',Po="</div>",Os='<svg aria-hidden="true" style="display:none" id="',bc='">',wc="</svg>",xc='<math aria-hidden="true" style="display:none" id="',Ms='">',Nr="</math>",Sc='<table hidden id="',Ns='">',Bd="</table>",kc='<table hidden><tbody id="',Ds='">',_c="</tbody></table>",Cc='<table hidden><tr id="',Ps='">',Ls="</tr></table>",Ec='<table hidden><colgroup id="',Tc='">',Ac="</colgroup></table>";function Va(u,h,y,C){switch(y.insertionMode){case Zn:case Ir:return l(u,Wa),l(u,h.segmentPrefix),l(u,C.toString(16)),c(u,Zi);case bn:return l(u,Os),l(u,h.segmentPrefix),l(u,C.toString(16)),c(u,bc);case Gi:return l(u,xc),l(u,h.segmentPrefix),l(u,C.toString(16)),c(u,Ms);case Qn:return l(u,Sc),l(u,h.segmentPrefix),l(u,C.toString(16)),c(u,Ns);case ei:return l(u,kc),l(u,h.segmentPrefix),l(u,C.toString(16)),c(u,Ds);case wn:return l(u,Cc),l(u,h.segmentPrefix),l(u,C.toString(16)),c(u,Ps);case ti:return l(u,Ec),l(u,h.segmentPrefix),l(u,C.toString(16)),c(u,Tc);default:throw new Error("Unknown insertion mode. This is a bug in React.")}}function Rc(u,h){switch(h.insertionMode){case Zn:case Ir:return c(u,Po);case bn:return c(u,wc);case Gi:return c(u,Nr);case Qn:return c(u,Bd);case ei:return c(u,_c);case wn:return c(u,Ls);case ti:return c(u,Ac);default:throw new Error("Unknown insertion mode. This is a bug in React.")}}var A="function $RS(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)}",B='function $RC(a,b){a=document.getElementById(a);b=document.getElementById(b);b.parentNode.removeChild(b);if(a){a=a.previousSibling;var f=a.parentNode,c=a.nextSibling,e=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d)if(0===e)break;else e--;else"$"!==d&&"$?"!==d&&"$!"!==d||e++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;b.firstChild;)f.insertBefore(b.firstChild,c);a.data="$";a._reactRetry&&a._reactRetry()}}',G='function $RX(b,c,d,e){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),b._reactRetry&&b._reactRetry())}',te=A+';$RS("',Ce='$RS("',Se='","',Me='")<\/script>';function Ue(u,h,y){l(u,h.startInlineScript),h.sentCompleteSegmentFunction?l(u,Ce):(h.sentCompleteSegmentFunction=!0,l(u,te)),l(u,h.segmentPrefix);var C=y.toString(16);return l(u,C),l(u,Se),l(u,h.placeholderPrefix),l(u,C),c(u,Me)}var it=B+';$RC("',ut='$RC("',ct='","',Dt='")<\/script>';function Dr(u,h,y,C){if(l(u,h.startInlineScript),h.sentCompleteBoundaryFunction?l(u,ut):(h.sentCompleteBoundaryFunction=!0,l(u,it)),y===null)throw new Error("An ID must have been assigned before we can complete the boundary.");var I=C.toString(16);return l(u,y),l(u,ct),l(u,h.segmentPrefix),l(u,I),c(u,Dt)}var on=G+';$RX("',sn='$RX("',Fs='"',Ic=")<\/script>",Lo=",";function hv(u,h,y,C,I,H){if(l(u,h.startInlineScript),h.sentClientRenderFunction?l(u,sn):(h.sentClientRenderFunction=!0,l(u,on)),y===null)throw new Error("An ID must have been assigned before we can complete the boundary.");return l(u,y),l(u,Fs),(C||I||H)&&(l(u,Lo),l(u,zd(C||""))),(I||H)&&(l(u,Lo),l(u,zd(I||""))),H&&(l(u,Lo),l(u,zd(H))),c(u,Ic)}var pv=/[<\u2028\u2029]/g;function zd(u){var h=JSON.stringify(u);return h.replace(pv,function(y){switch(y){case"<":return"\\u003c";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("escapeJSStringsForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React")}})}function mv(u,h){var y=Vi(h);return{bootstrapChunks:y.bootstrapChunks,startInlineScript:y.startInlineScript,placeholderPrefix:y.placeholderPrefix,segmentPrefix:y.segmentPrefix,boundaryPrefix:y.boundaryPrefix,idPrefix:y.idPrefix,nextSuspenseID:y.nextSuspenseID,sentCompleteSegmentFunction:y.sentCompleteSegmentFunction,sentCompleteBoundaryFunction:y.sentCompleteBoundaryFunction,sentClientRenderFunction:y.sentClientRenderFunction,generateStaticMarkup:u}}function gv(){return{insertionMode:Ir,selectedValue:null}}function Zh(u,h,y,C){return y.generateStaticMarkup?(u.push(nr(h)),!1):ri(u,h,y,C)}function Qh(u,h,y,C){if(!h.generateStaticMarkup)return Ki(u,h,y,C)}function yv(u,h){return h.generateStaticMarkup?!0:vc(u)}function vv(u,h,y,C,I){return h.generateStaticMarkup?!0:$a(u,h,y,C,I)}function bv(u,h){return h.generateStaticMarkup?!0:jd(u)}function wv(u,h){return h.generateStaticMarkup?!0:Ua(u)}var Ur=Object.assign,xv=Symbol.for("react.element"),ep=Symbol.for("react.portal"),Oc=Symbol.for("react.fragment"),an=Symbol.for("react.strict_mode"),tp=Symbol.for("react.profiler"),Mc=Symbol.for("react.provider"),Nc=Symbol.for("react.context"),Dc=Symbol.for("react.forward_ref"),Pc=Symbol.for("react.suspense"),Ga=Symbol.for("react.suspense_list"),Ka=Symbol.for("react.memo"),js=Symbol.for("react.lazy"),Hd=Symbol.for("react.scope"),$d=Symbol.for("react.debug_trace_mode"),Ud=Symbol.for("react.legacy_hidden"),Lc=Symbol.for("react.default_value"),rp=Symbol.iterator,Sv="@@iterator";function kv(u){if(u===null||typeof u!="object")return null;var h=rp&&u[rp]||u[Sv];return typeof h=="function"?h:null}function _v(u,h,y){var C=u.displayName;if(C)return C;var I=h.displayName||h.name||"";return I!==""?y+"("+I+")":y}function Wd(u){return u.displayName||"Context"}function Wt(u){if(u==null)return null;if(typeof u.tag=="number"&&i("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof u=="function")return u.displayName||u.name||null;if(typeof u=="string")return u;switch(u){case Oc:return"Fragment";case ep:return"Portal";case tp:return"Profiler";case an:return"StrictMode";case Pc:return"Suspense";case Ga:return"SuspenseList"}if(typeof u=="object")switch(u.$$typeof){case Nc:var h=u;return Wd(h)+".Consumer";case Mc:var y=u;return Wd(y._context)+".Provider";case Dc:return _v(u,u.render,"ForwardRef");case Ka:var C=u.displayName||null;return C!==null?C:Wt(u.type)||"Memo";case js:{var I=u,H=I._payload,K=I._init;try{return Wt(K(H))}catch{return null}}}return null}var qa=0,np,Vd,zt,Bs,Gd,Kd,qd;function Xd(){}Xd.__reactDisabledLog=!0;function ip(){{if(qa===0){np=console.log,Vd=console.info,zt=console.warn,Bs=console.error,Gd=console.group,Kd=console.groupCollapsed,qd=console.groupEnd;var u={configurable:!0,enumerable:!0,value:Xd,writable:!0};Object.defineProperties(console,{info:u,log:u,warn:u,error:u,group:u,groupCollapsed:u,groupEnd:u})}qa++}}function op(){{if(qa--,qa===0){var u={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:Ur({},u,{value:np}),info:Ur({},u,{value:Vd}),warn:Ur({},u,{value:zt}),error:Ur({},u,{value:Bs}),group:Ur({},u,{value:Gd}),groupCollapsed:Ur({},u,{value:Kd}),groupEnd:Ur({},u,{value:qd})})}qa<0&&i("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Fc=r.ReactCurrentDispatcher,jc;function Xa(u,h,y){{if(jc===void 0)try{throw Error()}catch(I){var C=I.stack.trim().match(/\n( *(at )?)/);jc=C&&C[1]||""}return`
|
|
354
|
+
`+jc+u}}var Yd=!1,zs;{var Jd=typeof WeakMap=="function"?WeakMap:Map;zs=new Jd}function Fo(u,h){if(!u||Yd)return"";{var y=zs.get(u);if(y!==void 0)return y}var C;Yd=!0;var I=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var H;H=Fc.current,Fc.current=null,ip();try{if(h){var K=function(){throw Error()};if(Object.defineProperty(K.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(K,[])}catch(mr){C=mr}Reflect.construct(u,[],K)}else{try{K.call()}catch(mr){C=mr}u.call(K.prototype)}}else{try{throw Error()}catch(mr){C=mr}u()}}catch(mr){if(mr&&C&&typeof mr.stack=="string"){for(var se=mr.stack.split(`
|
|
355
|
+
`),be=C.stack.split(`
|
|
356
|
+
`),Pe=se.length-1,je=be.length-1;Pe>=1&&je>=0&&se[Pe]!==be[je];)je--;for(;Pe>=1&&je>=0;Pe--,je--)if(se[Pe]!==be[je]){if(Pe!==1||je!==1)do if(Pe--,je--,je<0||se[Pe]!==be[je]){var Ke=`
|
|
357
|
+
`+se[Pe].replace(" at new "," at ");return u.displayName&&Ke.includes("<anonymous>")&&(Ke=Ke.replace("<anonymous>",u.displayName)),typeof u=="function"&&zs.set(u,Ke),Ke}while(Pe>=1&&je>=0);break}}}finally{Yd=!1,Fc.current=H,op(),Error.prepareStackTrace=I}var st=u?u.displayName||u.name:"",kt=st?Xa(st):"";return typeof u=="function"&&zs.set(u,kt),kt}function Zd(u,h,y){return Fo(u,!0)}function Ya(u,h,y){return Fo(u,!1)}function Cv(u){var h=u.prototype;return!!(h&&h.isReactComponent)}function Ja(u,h,y){if(u==null)return"";if(typeof u=="function")return Fo(u,Cv(u));if(typeof u=="string")return Xa(u);switch(u){case Pc:return Xa("Suspense");case Ga:return Xa("SuspenseList")}if(typeof u=="object")switch(u.$$typeof){case Dc:return Ya(u.render);case Ka:return Ja(u.type,h,y);case js:{var C=u,I=C._payload,H=C._init;try{return Ja(H(I),h,y)}catch{}}}return""}var sp={},Qd=r.ReactDebugCurrentFrame;function Bc(u){if(u){var h=u._owner,y=Ja(u.type,u._source,h?h.type:null);Qd.setExtraStackFrame(y)}else Qd.setExtraStackFrame(null)}function zc(u,h,y,C,I){{var H=Function.call.bind($);for(var K in u)if(H(u,K)){var se=void 0;try{if(typeof u[K]!="function"){var be=Error((C||"React class")+": "+y+" type `"+K+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof u[K]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw be.name="Invariant Violation",be}se=u[K](h,K,C,y,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Pe){se=Pe}se&&!(se instanceof Error)&&(Bc(I),i("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",C||"React class",y,K,typeof se),Bc(null)),se instanceof Error&&!(se.message in sp)&&(sp[se.message]=!0,Bc(I),i("Failed %s type: %s",y,se.message),Bc(null))}}}var Hc;Hc={};var Za={};Object.freeze(Za);function Qa(u,h){{var y=u.contextTypes;if(!y)return Za;var C={};for(var I in y)C[I]=h[I];{var H=Wt(u)||"Unknown";zc(y,C,"context",H)}return C}}function ap(u,h,y,C){{if(typeof u.getChildContext!="function"){{var I=Wt(h)||"Unknown";Hc[I]||(Hc[I]=!0,i("%s.childContextTypes is specified but there is no getChildContext() method on the instance. You can either define getChildContext() on %s or remove childContextTypes from it.",I,I))}return y}var H=u.getChildContext();for(var K in H)if(!(K in C))throw new Error((Wt(h)||"Unknown")+'.getChildContext(): key "'+K+'" is not defined in childContextTypes.');{var se=Wt(h)||"Unknown";zc(C,H,"child context",se)}return Ur({},y,H)}}var jo;jo={};var $c=null,Qi=null;function ef(u){u.context._currentValue2=u.parentValue}function Bo(u){u.context._currentValue2=u.value}function Uc(u,h){if(u!==h){ef(u);var y=u.parent,C=h.parent;if(y===null){if(C!==null)throw new Error("The stacks must reach the root at the same time. This is a bug in React.")}else{if(C===null)throw new Error("The stacks must reach the root at the same time. This is a bug in React.");Uc(y,C)}Bo(h)}}function eo(u){ef(u);var h=u.parent;h!==null&&eo(h)}function Wc(u){var h=u.parent;h!==null&&Wc(h),Bo(u)}function Vc(u,h){ef(u);var y=u.parent;if(y===null)throw new Error("The depth must equal at least at zero before reaching the root. This is a bug in React.");y.depth===h.depth?Uc(y,h):Vc(y,h)}function el(u,h){var y=h.parent;if(y===null)throw new Error("The depth must equal at least at zero before reaching the root. This is a bug in React.");u.depth===y.depth?Uc(u,y):el(u,y),Bo(h)}function tl(u){var h=Qi,y=u;h!==y&&(h===null?Wc(y):y===null?eo(h):h.depth===y.depth?Uc(h,y):h.depth>y.depth?Vc(h,y):el(h,y),Qi=y)}function lp(u,h){var y;y=u._currentValue2,u._currentValue2=h,u._currentRenderer2!==void 0&&u._currentRenderer2!==null&&u._currentRenderer2!==jo&&i("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported."),u._currentRenderer2=jo;var C=Qi,I={parent:C,depth:C===null?0:C.depth+1,context:u,parentValue:y,value:h};return Qi=I,I}function cp(u){var h=Qi;if(h===null)throw new Error("Tried to pop a Context at the root of the app. This is a bug in React.");h.context!==u&&i("The parent context is not the expected context. This is probably a bug in React.");{var y=h.parentValue;y===Lc?h.context._currentValue2=h.context._defaultValue:h.context._currentValue2=y,u._currentRenderer2!==void 0&&u._currentRenderer2!==null&&u._currentRenderer2!==jo&&i("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported."),u._currentRenderer2=jo}return Qi=h.parent}function up(){return Qi}function to(u){var h=u._currentValue2;return h}function tf(u){return u._reactInternals}function Ev(u,h){u._reactInternals=h}var dp={},Hs={},rl,rf,Gc,Kc,qc,$s,nl,il,Xc;{rl=new Set,rf=new Set,Gc=new Set,nl=new Set,Kc=new Set,il=new Set,Xc=new Set;var ol=new Set;$s=function(u,h){if(!(u===null||typeof u=="function")){var y=h+"_"+u;ol.has(y)||(ol.add(y),i("%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.",h,u))}},qc=function(u,h){if(h===void 0){var y=Wt(u)||"Component";Kc.has(y)||(Kc.add(y),i("%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.",y))}}}function Yc(u,h){{var y=u.constructor,C=y&&Wt(y)||"ReactClass",I=C+"."+h;if(dp[I])return;i(`%s(...): Can only update a mounting component. This usually means you called %s() outside componentWillMount() on the server. This is a no-op.
|
|
358
|
+
|
|
359
|
+
Please check the code for the %s component.`,h,h,C),dp[I]=!0}}var Jc={isMounted:function(u){return!1},enqueueSetState:function(u,h,y){var C=tf(u);C.queue===null?Yc(u,"setState"):(C.queue.push(h),y!=null&&$s(y,"setState"))},enqueueReplaceState:function(u,h,y){var C=tf(u);C.replace=!0,C.queue=[h],y!=null&&$s(y,"setState")},enqueueForceUpdate:function(u,h){var y=tf(u);y.queue===null?Yc(u,"forceUpdate"):h!=null&&$s(h,"setState")}};function nf(u,h,y,C,I){var H=y(I,C);qc(h,H);var K=H==null?C:Ur({},C,H);return K}function fp(u,h,y){var C=Za,I=u.contextType;if("contextType"in u){var H=I===null||I!==void 0&&I.$$typeof===Nc&&I._context===void 0;if(!H&&!Xc.has(u)){Xc.add(u);var K="";I===void 0?K=" However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file.":typeof I!="object"?K=" However, it is set to a "+typeof I+".":I.$$typeof===Mc?K=" Did you accidentally pass the Context.Provider instead?":I._context!==void 0?K=" Did you accidentally pass the Context.Consumer instead?":K=" However, it is set to an object with keys {"+Object.keys(I).join(", ")+"}.",i("%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s",Wt(u)||"Component",K)}}typeof I=="object"&&I!==null?C=to(I):C=y;var se=new u(h,C);{if(typeof u.getDerivedStateFromProps=="function"&&(se.state===null||se.state===void 0)){var be=Wt(u)||"Component";rl.has(be)||(rl.add(be),i("`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.",be,se.state===null?"null":"undefined",be))}if(typeof u.getDerivedStateFromProps=="function"||typeof se.getSnapshotBeforeUpdate=="function"){var Pe=null,je=null,Ke=null;if(typeof se.componentWillMount=="function"&&se.componentWillMount.__suppressDeprecationWarning!==!0?Pe="componentWillMount":typeof se.UNSAFE_componentWillMount=="function"&&(Pe="UNSAFE_componentWillMount"),typeof se.componentWillReceiveProps=="function"&&se.componentWillReceiveProps.__suppressDeprecationWarning!==!0?je="componentWillReceiveProps":typeof se.UNSAFE_componentWillReceiveProps=="function"&&(je="UNSAFE_componentWillReceiveProps"),typeof se.componentWillUpdate=="function"&&se.componentWillUpdate.__suppressDeprecationWarning!==!0?Ke="componentWillUpdate":typeof se.UNSAFE_componentWillUpdate=="function"&&(Ke="UNSAFE_componentWillUpdate"),Pe!==null||je!==null||Ke!==null){var st=Wt(u)||"Component",kt=typeof u.getDerivedStateFromProps=="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";Gc.has(st)||(Gc.add(st),i(`Unsafe legacy lifecycles will not be called for components using new component APIs.
|
|
360
|
+
|
|
361
|
+
%s uses %s but also contains the following legacy lifecycles:%s%s%s
|
|
362
|
+
|
|
363
|
+
The above lifecycles should be removed. Learn more about this warning here:
|
|
364
|
+
https://reactjs.org/link/unsafe-component-lifecycles`,st,kt,Pe!==null?`
|
|
365
|
+
`+Pe:"",je!==null?`
|
|
366
|
+
`+je:"",Ke!==null?`
|
|
367
|
+
`+Ke:""))}}}return se}function hp(u,h,y){{var C=Wt(h)||"Component",I=u.render;I||(h.prototype&&typeof h.prototype.render=="function"?i("%s(...): No `render` method found on the returned component instance: did you accidentally return an object from the constructor?",C):i("%s(...): No `render` method found on the returned component instance: you may have forgotten to define `render`.",C)),u.getInitialState&&!u.getInitialState.isReactClassApproved&&!u.state&&i("getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?",C),u.getDefaultProps&&!u.getDefaultProps.isReactClassApproved&&i("getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.",C),u.propTypes&&i("propTypes was defined as an instance property on %s. Use a static property to define propTypes instead.",C),u.contextType&&i("contextType was defined as an instance property on %s. Use a static property to define contextType instead.",C),u.contextTypes&&i("contextTypes was defined as an instance property on %s. Use a static property to define contextTypes instead.",C),h.contextType&&h.contextTypes&&!il.has(h)&&(il.add(h),i("%s declares both contextTypes and contextType static properties. The legacy contextTypes property will be ignored.",C)),typeof u.componentShouldUpdate=="function"&&i("%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.",C),h.prototype&&h.prototype.isPureReactComponent&&typeof u.shouldComponentUpdate<"u"&&i("%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.",Wt(h)||"A pure component"),typeof u.componentDidUnmount=="function"&&i("%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?",C),typeof u.componentDidReceiveProps=="function"&&i("%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().",C),typeof u.componentWillRecieveProps=="function"&&i("%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?",C),typeof u.UNSAFE_componentWillRecieveProps=="function"&&i("%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?",C);var H=u.props!==y;u.props!==void 0&&H&&i("%s(...): When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.",C,C),u.defaultProps&&i("Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.",C,C),typeof u.getSnapshotBeforeUpdate=="function"&&typeof u.componentDidUpdate!="function"&&!rf.has(h)&&(rf.add(h),i("%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.",Wt(h))),typeof u.getDerivedStateFromProps=="function"&&i("%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.",C),typeof u.getDerivedStateFromError=="function"&&i("%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.",C),typeof h.getSnapshotBeforeUpdate=="function"&&i("%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.",C);var K=u.state;K&&(typeof K!="object"||vn(K))&&i("%s.state: must be set to an object or null",C),typeof u.getChildContext=="function"&&typeof h.childContextTypes!="object"&&i("%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().",C)}}function pp(u,h){var y=h.state;if(typeof h.componentWillMount=="function"){if(h.componentWillMount.__suppressDeprecationWarning!==!0){var C=Wt(u)||"Unknown";Hs[C]||(n(`componentWillMount has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.
|
|
368
|
+
|
|
369
|
+
* Move code from componentWillMount to componentDidMount (preferred in most cases) or the constructor.
|
|
370
|
+
|
|
371
|
+
Please update the following components: %s`,C),Hs[C]=!0)}h.componentWillMount()}typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),y!==h.state&&(i("%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",Wt(u)||"Component"),Jc.enqueueReplaceState(h,h.state,null))}function Tv(u,h,y,C){if(u.queue!==null&&u.queue.length>0){var I=u.queue,H=u.replace;if(u.queue=null,u.replace=!1,H&&I.length===1)h.state=I[0];else{for(var K=H?I[0]:h.state,se=!0,be=H?1:0;be<I.length;be++){var Pe=I[be],je=typeof Pe=="function"?Pe.call(h,K,y,C):Pe;je!=null&&(se?(se=!1,K=Ur({},K,je)):Ur(K,je))}h.state=K}}else u.queue=null}function mp(u,h,y,C){hp(u,h,y);var I=u.state!==void 0?u.state:null;u.updater=Jc,u.props=y,u.state=I;var H={queue:[],replace:!1};Ev(u,H);var K=h.contextType;if(typeof K=="object"&&K!==null?u.context=to(K):u.context=C,u.state===y){var se=Wt(h)||"Component";nl.has(se)||(nl.add(se),i("%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.",se))}var be=h.getDerivedStateFromProps;typeof be=="function"&&(u.state=nf(u,h,be,I,y)),typeof h.getDerivedStateFromProps!="function"&&typeof u.getSnapshotBeforeUpdate!="function"&&(typeof u.UNSAFE_componentWillMount=="function"||typeof u.componentWillMount=="function")&&(pp(h,u),Tv(H,u,y,C))}var Av={id:1,overflow:""};function Rv(u){var h=u.overflow,y=u.id,C=y&~Iv(y);return C.toString(32)+h}function of(u,h,y){var C=u.id,I=u.overflow,H=sl(C)-1,K=C&~(1<<H),se=y+1,be=sl(h)+H;if(be>30){var Pe=H-H%5,je=(1<<Pe)-1,Ke=(K&je).toString(32),st=K>>Pe,kt=H-Pe,mr=sl(h)+kt,Go=se<<kt,Ko=Go|st,Ni=Ke+I;return{id:1<<mr|Ko,overflow:Ni}}else{var Xs=se<<H,lb=Xs|K,l2=I;return{id:1<<be|lb,overflow:l2}}}function sl(u){return 32-Ov(u)}function Iv(u){return 1<<sl(u)-1}var Ov=Math.clz32?Math.clz32:Mv,sf=Math.log,Zc=Math.LN2;function Mv(u){var h=u>>>0;return h===0?32:31-(sf(h)/Zc|0)|0}function Nv(u,h){return u===h&&(u!==0||1/u===1/h)||u!==u&&h!==h}var Dv=typeof Object.is=="function"?Object.is:Nv,Ri=null,af=null,Qc=null,Lt=null,ln=!1,Us=!1,zo=0,xt=null,ro=0,eu=25,cn=!1,un;function li(){if(Ri===null)throw new Error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
372
|
+
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
373
|
+
2. You might be breaking the Rules of Hooks
|
|
374
|
+
3. You might have more than one copy of React in the same app
|
|
375
|
+
See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`);return cn&&i("Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://reactjs.org/link/rules-of-hooks"),Ri}function Pv(u,h){if(h===null)return i("%s received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.",un),!1;u.length!==h.length&&i(`The final argument passed to %s changed size between renders. The order and size of this array must remain constant.
|
|
376
|
+
|
|
377
|
+
Previous: %s
|
|
378
|
+
Incoming: %s`,un,"["+u.join(", ")+"]","["+h.join(", ")+"]");for(var y=0;y<h.length&&y<u.length;y++)if(!Dv(u[y],h[y]))return!1;return!0}function jn(){if(ro>0)throw new Error("Rendered more hooks than during the previous render");return{memoizedState:null,queue:null,next:null}}function no(){return Lt===null?Qc===null?(ln=!1,Qc=Lt=jn()):(ln=!0,Lt=Qc):Lt.next===null?(ln=!1,Lt=Lt.next=jn()):(ln=!0,Lt=Lt.next),Lt}function Ho(u,h){Ri=h,af=u,cn=!1,zo=0}function Lv(u,h,y,C){for(;Us;)Us=!1,zo=0,ro+=1,Lt=null,y=u(h,C);return al(),y}function lf(){var u=zo!==0;return u}function al(){cn=!1,Ri=null,af=null,Us=!1,Qc=null,ro=0,xt=null,Lt=null}function Fv(u){return cn&&i("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()."),to(u)}function jv(u){return un="useContext",li(),to(u)}function tu(u,h){return typeof h=="function"?h(u):h}function cf(u){return un="useState",gp(tu,u)}function gp(u,h,y){if(u!==tu&&(un="useReducer"),Ri=li(),Lt=no(),ln){var C=Lt.queue,I=C.dispatch;if(xt!==null){var H=xt.get(C);if(H!==void 0){xt.delete(C);var K=Lt.memoizedState,se=H;do{var be=se.action;cn=!0,K=u(K,be),cn=!1,se=se.next}while(se!==null);return Lt.memoizedState=K,[K,I]}}return[Lt.memoizedState,I]}else{cn=!0;var Pe;u===tu?Pe=typeof h=="function"?h():h:Pe=y!==void 0?y(h):h,cn=!1,Lt.memoizedState=Pe;var je=Lt.queue={last:null,dispatch:null},Ke=je.dispatch=vp.bind(null,Ri,je);return[Lt.memoizedState,Ke]}}function yp(u,h){Ri=li(),Lt=no();var y=h===void 0?null:h;if(Lt!==null){var C=Lt.memoizedState;if(C!==null&&y!==null){var I=C[1];if(Pv(y,I))return C[0]}}cn=!0;var H=u();return cn=!1,Lt.memoizedState=[H,y],H}function uf(u){Ri=li(),Lt=no();var h=Lt.memoizedState;if(h===null){var y={current:u};return Object.seal(y),Lt.memoizedState=y,y}else return h}function Bv(u,h){un="useLayoutEffect",i("useLayoutEffect does nothing on the server, because its effect cannot be encoded into the server renderer's output format. This will lead to a mismatch between the initial, non-hydrated UI and the intended UI. To avoid this, useLayoutEffect should only be used in components that render exclusively on the client. See https://reactjs.org/link/uselayouteffect-ssr for common fixes.")}function vp(u,h,y){if(ro>=eu)throw new Error("Too many re-renders. React limits the number of renders to prevent an infinite loop.");if(u===Ri){Us=!0;var C={action:y,next:null};xt===null&&(xt=new Map);var I=xt.get(h);if(I===void 0)xt.set(h,C);else{for(var H=I;H.next!==null;)H=H.next;H.next=C}}}function bp(u,h){return yp(function(){return u},h)}function zv(u,h,y){return li(),h(u._source)}function Hv(u,h,y){if(y===void 0)throw new Error("Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.");return y()}function $v(u){return li(),u}function Uv(){throw new Error("startTransition cannot be called during server rendering.")}function Wv(){return li(),[!1,Uv]}function Vv(){var u=af,h=Rv(u.treeContext),y=df;if(y===null)throw new Error("Invalid hook call. Hooks can only be called inside of the body of a function component.");var C=zo++;return Zt(y,h,C)}function ru(){}var wp={readContext:Fv,useContext:jv,useMemo:yp,useReducer:gp,useRef:uf,useState:cf,useInsertionEffect:ru,useLayoutEffect:Bv,useCallback:bp,useImperativeHandle:ru,useEffect:ru,useDebugValue:ru,useDeferredValue:$v,useTransition:Wv,useId:Vv,useMutableSource:zv,useSyncExternalStore:Hv},df=null;function xp(u){df=u}function nu(u){try{var h="",y=u;do{switch(y.tag){case 0:h+=Xa(y.type,null,null);break;case 1:h+=Ya(y.type,null,null);break;case 2:h+=Zd(y.type,null,null);break}y=y.parent}while(y);return h}catch(C){return`
|
|
379
|
+
Error generating stack: `+C.message+`
|
|
380
|
+
`+C.stack}}var iu=r.ReactCurrentDispatcher,ll=r.ReactDebugCurrentFrame,ou=0,Ws=1,su=2,au=3,lu=4,Vs=0,ff=1,$o=2,Sp=12800;function Gv(u){return console.error(u),null}function Gs(){}function Ks(u,h,y,C,I,H,K,se,be){var Pe=[],je=new Set,Ke={destination:null,responseState:h,progressiveChunkSize:C===void 0?Sp:C,status:Vs,fatalError:null,nextSegmentId:0,allPendingTasks:0,pendingRootTasks:0,completedRootSegment:null,abortableTasks:je,pingedTasks:Pe,clientRenderedBoundaries:[],completedBoundaries:[],partialBoundaries:[],onError:I===void 0?Gv:I,onAllReady:Gs,onShellReady:K===void 0?Gs:K,onShellError:Gs,onFatalError:Gs},st=cu(Ke,0,null,y,!1,!1);st.parentFlushed=!0;var kt=Uo(Ke,u,null,st,je,Za,$c,Av);return Pe.push(kt),Ke}function Kv(u,h){var y=u.pingedTasks;y.push(h),y.length===1&&s(function(){return Sf(u)})}function qv(u,h){return{id:_s,rootSegmentID:-1,parentFlushed:!1,pendingTasks:0,forceClientRender:!1,completedSegments:[],byteSize:0,fallbackAbortableTasks:h,errorDigest:null}}function Uo(u,h,y,C,I,H,K,se){u.allPendingTasks++,y===null?u.pendingRootTasks++:y.pendingTasks++;var be={node:h,ping:function(){return Kv(u,be)},blockedBoundary:y,blockedSegment:C,abortSet:I,legacyContext:H,context:K,treeContext:se};return be.componentStack=null,I.add(be),be}function cu(u,h,y,C,I,H){return{status:ou,id:-1,index:h,parentFlushed:!1,chunks:[],children:[],formatContext:C,boundary:y,lastPushedText:I,textEmbedded:H}}var Ii=null;function hf(){return Ii===null||Ii.componentStack===null?"":nu(Ii.componentStack)}function Wo(u,h){u.componentStack={tag:0,parent:u.componentStack,type:h}}function cl(u,h){u.componentStack={tag:1,parent:u.componentStack,type:h}}function Oi(u,h){u.componentStack={tag:2,parent:u.componentStack,type:h}}function ci(u){u.componentStack===null?i("Unexpectedly popped too many stack frames. This is a bug in React."):u.componentStack=u.componentStack.parent}var Mi=null;function uu(u,h){{var y;typeof h=="string"?y=h:h&&typeof h.message=="string"?y=h.message:y=String(h);var C=Mi||hf();Mi=null,u.errorMessage=y,u.errorComponentStack=C}}function ul(u,h){var y=u.onError(h);if(y!=null&&typeof y!="string")throw new Error('onError returned something with a type other than "string". onError should return a string and may return null or undefined but must not return anything else. It received something of type "'+typeof y+'" instead');return y}function Bn(u,h){var y=u.onShellError;y(h);var C=u.onFatalError;C(h),u.destination!==null?(u.status=$o,g(u.destination,h)):(u.status=ff,u.fatalError=h)}function dl(u,h,y){Wo(h,"Suspense");var C=h.blockedBoundary,I=h.blockedSegment,H=y.fallback,K=y.children,se=new Set,be=qv(u,se),Pe=I.chunks.length,je=cu(u,Pe,be,I.formatContext,!1,!1);I.children.push(je),I.lastPushedText=!1;var Ke=cu(u,0,null,I.formatContext,!1,!1);Ke.parentFlushed=!0,h.blockedBoundary=be,h.blockedSegment=Ke;try{if(Pr(u,h,K),Qh(Ke.chunks,u.responseState,Ke.lastPushedText,Ke.textEmbedded),Ke.status=Ws,qs(be,Ke),be.pendingTasks===0){ci(h);return}}catch(kt){Ke.status=lu,be.forceClientRender=!0,be.errorDigest=ul(u,kt),uu(be,kt)}finally{h.blockedBoundary=C,h.blockedSegment=I}var st=Uo(u,H,C,je,se,h.legacyContext,h.context,h.treeContext);st.componentStack=h.componentStack,u.pingedTasks.push(st),ci(h)}function pf(u,h,y,C){Wo(h,y);var I=h.blockedSegment,H=Fn(I.chunks,y,C,u.responseState,I.formatContext);I.lastPushedText=!1;var K=I.formatContext;I.formatContext=ks(K,y,C),Pr(u,h,H),I.formatContext=K,It(I.chunks,y),I.lastPushedText=!1,ci(h)}function fl(u){return u.prototype&&u.prototype.isReactComponent}function hl(u,h,y,C,I){var H={};Ho(h,H);var K=y(C,I);return Lv(y,C,K,I)}function kp(u,h,y,C,I){var H=y.render();y.props!==I&&(gf||i("It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.",Wt(C)||"a component"),gf=!0);{var K=C.childContextTypes;if(K!=null){var se=h.legacyContext,be=ap(y,C,se,K);h.legacyContext=be,dn(u,h,H),h.legacyContext=se;return}}dn(u,h,H)}function Xv(u,h,y,C){Oi(h,y);var I=Qa(y,h.legacyContext),H=fp(y,C,I);mp(H,y,C,I),kp(u,h,H,y,C),ci(h)}var _p={},pl={},mf={},Cp={},gf=!1,ml={},yf=!1,vf=!1,bf=!1;function Ep(u,h,y,C){var I;if(I=Qa(y,h.legacyContext),cl(h,y),y.prototype&&typeof y.prototype.render=="function"){var H=Wt(y)||"Unknown";_p[H]||(i("The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.",H,H),_p[H]=!0)}var K=hl(u,h,y,C,I),se=lf();if(typeof K=="object"&&K!==null&&typeof K.render=="function"&&K.$$typeof===void 0){var be=Wt(y)||"Unknown";pl[be]||(i("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.",be,be,be),pl[be]=!0)}if(typeof K=="object"&&K!==null&&typeof K.render=="function"&&K.$$typeof===void 0){{var Pe=Wt(y)||"Unknown";pl[Pe]||(i("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.",Pe,Pe,Pe),pl[Pe]=!0)}mp(K,y,C,I),kp(u,h,K,y,C)}else if(Tp(y),se){var je=h.treeContext,Ke=1,st=0;h.treeContext=of(je,Ke,st);try{dn(u,h,K)}finally{h.treeContext=je}}else dn(u,h,K);ci(h)}function Tp(u){{if(u&&u.childContextTypes&&i("%s(...): childContextTypes cannot be defined on a function component.",u.displayName||u.name||"Component"),u.defaultProps!==void 0){var h=Wt(u)||"Unknown";ml[h]||(i("%s: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.",h),ml[h]=!0)}if(typeof u.getDerivedStateFromProps=="function"){var y=Wt(u)||"Unknown";Cp[y]||(i("%s: Function components do not support getDerivedStateFromProps.",y),Cp[y]=!0)}if(typeof u.contextType=="object"&&u.contextType!==null){var C=Wt(u)||"Unknown";mf[C]||(i("%s: Function components do not support contextType.",C),mf[C]=!0)}}}function wf(u,h){if(u&&u.defaultProps){var y=Ur({},h),C=u.defaultProps;for(var I in C)y[I]===void 0&&(y[I]=C[I]);return y}return h}function Ap(u,h,y,C,I){cl(h,y.render);var H=hl(u,h,y.render,C,I),K=lf();if(K){var se=h.treeContext,be=1,Pe=0;h.treeContext=of(se,be,Pe);try{dn(u,h,H)}finally{h.treeContext=se}}else dn(u,h,H);ci(h)}function Yv(u,h,y,C,I){var H=y.type,K=wf(H,C);xf(u,h,H,K,I)}function Jv(u,h,y,C){y._context===void 0?y!==y.Consumer&&(bf||(bf=!0,i("Rendering <Context> directly is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?"))):y=y._context;var I=C.children;typeof I!="function"&&i("A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it.");var H=to(y),K=I(H);dn(u,h,K)}function Rp(u,h,y,C){var I=y._context,H=C.value,K=C.children,se;se=h.context,h.context=lp(I,H),dn(u,h,K),h.context=cp(I),se!==h.context&&i("Popping the context provider did not return back to the original snapshot. This is a bug in React.")}function Zv(u,h,y,C,I){Wo(h,"Lazy");var H=y._payload,K=y._init,se=K(H),be=wf(se,C);xf(u,h,se,be,I),ci(h)}function xf(u,h,y,C,I){if(typeof y=="function")if(fl(y)){Xv(u,h,y,C);return}else{Ep(u,h,y,C);return}if(typeof y=="string"){pf(u,h,y,C);return}switch(y){case Ud:case $d:case an:case tp:case Oc:{dn(u,h,C.children);return}case Ga:{Wo(h,"SuspenseList"),dn(u,h,C.children),ci(h);return}case Hd:throw new Error("ReactDOMServer does not yet support scope components.");case Pc:{dl(u,h,C);return}}if(typeof y=="object"&&y!==null)switch(y.$$typeof){case Dc:{Ap(u,h,y,C,I);return}case Ka:{Yv(u,h,y,C,I);return}case Mc:{Rp(u,h,y,C);return}case Nc:{Jv(u,h,y,C);return}case js:{Zv(u,h,y,C);return}}var H="";throw(y===void 0||typeof y=="object"&&y!==null&&Object.keys(y).length===0)&&(H+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),new Error("Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) "+("but got: "+(y==null?y:typeof y)+"."+H))}function Qv(u,h){typeof Symbol=="function"&&u[Symbol.toStringTag]==="Generator"&&(yf||i("Using Generators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. Keep in mind you might need to polyfill these features for older browsers."),yf=!0),u.entries===h&&(vf||i("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),vf=!0)}function dn(u,h,y){try{return eb(u,h,y)}catch(C){throw typeof C=="object"&&C!==null&&typeof C.then=="function"||(Mi=Mi!==null?Mi:hf()),C}}function eb(u,h,y){if(h.node=y,typeof y=="object"&&y!==null){switch(y.$$typeof){case xv:{var C=y,I=C.type,H=C.props,K=C.ref;xf(u,h,I,H,K);return}case ep:throw new Error("Portals are not currently supported by the server renderer. Render them conditionally so that they only appear on the client render.");case js:{var se=y,be=se._payload,Pe=se._init,je;try{je=Pe(be)}catch(Xs){throw typeof Xs=="object"&&Xs!==null&&typeof Xs.then=="function"&&Wo(h,"Lazy"),Xs}dn(u,h,je);return}}if(vn(y)){du(u,h,y);return}var Ke=kv(y);if(Ke){Qv(y,Ke);var st=Ke.call(y);if(st){var kt=st.next();if(!kt.done){var mr=[];do mr.push(kt.value),kt=st.next();while(!kt.done);du(u,h,mr);return}return}}var Go=Object.prototype.toString.call(y);throw new Error("Objects are not valid as a React child (found: "+(Go==="[object Object]"?"object with keys {"+Object.keys(y).join(", ")+"}":Go)+"). If you meant to render a collection of children, use an array instead.")}if(typeof y=="string"){var Ko=h.blockedSegment;Ko.lastPushedText=Zh(h.blockedSegment.chunks,y,u.responseState,Ko.lastPushedText);return}if(typeof y=="number"){var Ni=h.blockedSegment;Ni.lastPushedText=Zh(h.blockedSegment.chunks,""+y,u.responseState,Ni.lastPushedText);return}typeof y=="function"&&i("Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render. Or maybe you meant to call this function rather than return it.")}function du(u,h,y){for(var C=y.length,I=0;I<C;I++){var H=h.treeContext;h.treeContext=of(H,C,I);try{Pr(u,h,y[I])}finally{h.treeContext=H}}}function tb(u,h,y){var C=h.blockedSegment,I=C.chunks.length,H=cu(u,I,null,C.formatContext,C.lastPushedText,!0);C.children.push(H),C.lastPushedText=!1;var K=Uo(u,h.node,h.blockedBoundary,H,h.abortSet,h.legacyContext,h.context,h.treeContext);h.componentStack!==null&&(K.componentStack=h.componentStack.parent);var se=K.ping;y.then(se,se)}function Pr(u,h,y){var C=h.blockedSegment.formatContext,I=h.legacyContext,H=h.context,K=null;K=h.componentStack;try{return dn(u,h,y)}catch(se){if(al(),typeof se=="object"&&se!==null&&typeof se.then=="function"){tb(u,h,se),h.blockedSegment.formatContext=C,h.legacyContext=I,h.context=H,tl(H),h.componentStack=K;return}else throw h.blockedSegment.formatContext=C,h.legacyContext=I,h.context=H,tl(H),h.componentStack=K,se}}function rb(u,h,y,C){var I=ul(u,C);if(h===null?Bn(u,C):(h.pendingTasks--,h.forceClientRender||(h.forceClientRender=!0,h.errorDigest=I,uu(h,C),h.parentFlushed&&u.clientRenderedBoundaries.push(h))),u.allPendingTasks--,u.allPendingTasks===0){var H=u.onAllReady;H()}}function Ip(u){var h=this,y=u.blockedBoundary,C=u.blockedSegment;C.status=au,Mp(h,y,C)}function Op(u,h,y){var C=u.blockedBoundary,I=u.blockedSegment;if(I.status=au,C===null)h.allPendingTasks--,h.status!==$o&&(h.status=$o,h.destination!==null&&f(h.destination));else{if(C.pendingTasks--,!C.forceClientRender){C.forceClientRender=!0;var H=y===void 0?new Error("The render was aborted by the server without a reason."):y;C.errorDigest=h.onError(H);{var K="The server did not finish this Suspense boundary: ";H&&typeof H.message=="string"?H=K+H.message:H=K+String(H);var se=Ii;Ii=u;try{uu(C,H)}finally{Ii=se}}C.parentFlushed&&h.clientRenderedBoundaries.push(C)}if(C.fallbackAbortableTasks.forEach(function(Pe){return Op(Pe,h,y)}),C.fallbackAbortableTasks.clear(),h.allPendingTasks--,h.allPendingTasks===0){var be=h.onAllReady;be()}}}function qs(u,h){if(h.chunks.length===0&&h.children.length===1&&h.children[0].boundary===null){var y=h.children[0];y.id=h.id,y.parentFlushed=!0,y.status===Ws&&qs(u,y)}else{var C=u.completedSegments;C.push(h)}}function Mp(u,h,y){if(h===null){if(y.parentFlushed){if(u.completedRootSegment!==null)throw new Error("There can only be one root segment. This is a bug in React.");u.completedRootSegment=y}if(u.pendingRootTasks--,u.pendingRootTasks===0){u.onShellError=Gs;var C=u.onShellReady;C()}}else if(h.pendingTasks--,!h.forceClientRender){if(h.pendingTasks===0)y.parentFlushed&&y.status===Ws&&qs(h,y),h.parentFlushed&&u.completedBoundaries.push(h),h.fallbackAbortableTasks.forEach(Ip,u),h.fallbackAbortableTasks.clear();else if(y.parentFlushed&&y.status===Ws){qs(h,y);var I=h.completedSegments;I.length===1&&h.parentFlushed&&u.partialBoundaries.push(h)}}if(u.allPendingTasks--,u.allPendingTasks===0){var H=u.onAllReady;H()}}function nb(u,h){var y=h.blockedSegment;if(y.status===ou){tl(h.context);var C=null;C=Ii,Ii=h;try{dn(u,h,h.node),Qh(y.chunks,u.responseState,y.lastPushedText,y.textEmbedded),h.abortSet.delete(h),y.status=Ws,Mp(u,h.blockedBoundary,y)}catch(H){if(al(),typeof H=="object"&&H!==null&&typeof H.then=="function"){var I=h.ping;H.then(I,I)}else h.abortSet.delete(h),y.status=lu,rb(u,h.blockedBoundary,y,H)}finally{Ii=C}}}function Sf(u){if(u.status!==$o){var h=up(),y=iu.current;iu.current=wp;var C;C=ll.getCurrentStack,ll.getCurrentStack=hf;var I=df;xp(u.responseState);try{var H=u.pingedTasks,K;for(K=0;K<H.length;K++){var se=H[K];nb(u,se)}H.splice(0,K),u.destination!==null&&hu(u,u.destination)}catch(be){ul(u,be),Bn(u,be)}finally{xp(I),iu.current=y,ll.getCurrentStack=C,y===wp&&tl(h)}}}function Vo(u,h,y){switch(y.parentFlushed=!0,y.status){case ou:{var C=y.id=u.nextSegmentId++;return y.lastPushedText=!1,y.textEmbedded=!1,si(h,u.responseState,C)}case Ws:{y.status=su;for(var I=!0,H=y.chunks,K=0,se=y.children,be=0;be<se.length;be++){for(var Pe=se[be];K<Pe.index;K++)l(h,H[K]);I=gl(u,h,Pe)}for(;K<H.length-1;K++)l(h,H[K]);return K<H.length&&(I=c(h,H[K])),I}default:throw new Error("Aborted, errored or already flushed boundaries should not be flushed again. This is a bug in React.")}}function gl(u,h,y){var C=y.boundary;if(C===null)return Vo(u,h,y);if(C.parentFlushed=!0,C.forceClientRender)return vv(h,u.responseState,C.errorDigest,C.errorMessage,C.errorComponentStack),Vo(u,h,y),wv(h,u.responseState);if(C.pendingTasks>0){C.rootSegmentID=u.nextSegmentId++,C.completedSegments.length>0&&u.partialBoundaries.push(C);var I=C.id=Pn(u.responseState);return Do(h,u.responseState,I),Vo(u,h,y),Ji(h,u.responseState)}else{if(C.byteSize>u.progressiveChunkSize)return C.rootSegmentID=u.nextSegmentId++,u.completedBoundaries.push(C),Do(h,u.responseState,C.id),Vo(u,h,y),Ji(h,u.responseState);yv(h,u.responseState);var H=C.completedSegments;if(H.length!==1)throw new Error("A previously unvisited boundary must have exactly one root segment. This is a bug in React.");var K=H[0];return gl(u,h,K),bv(h,u.responseState)}}function ib(u,h,y){return hv(h,u.responseState,y.id,y.errorDigest,y.errorMessage,y.errorComponentStack)}function kf(u,h,y){return Va(h,u.responseState,y.formatContext,y.id),gl(u,h,y),Rc(h,y.formatContext)}function yl(u,h,y){for(var C=y.completedSegments,I=0;I<C.length;I++){var H=C[I];Np(u,h,y,H)}return C.length=0,Dr(h,u.responseState,y.id,y.rootSegmentID)}function fu(u,h,y){for(var C=y.completedSegments,I=0;I<C.length;I++){var H=C[I];if(!Np(u,h,y,H))return I++,C.splice(0,I),!1}return C.splice(0,I),!0}function Np(u,h,y,C){if(C.status===su)return!0;var I=C.id;if(I===-1){var H=C.id=y.rootSegmentID;if(H===-1)throw new Error("A root segment ID must have been assigned by now. This is a bug in React.");return kf(u,h,C)}else return kf(u,h,C),Ue(h,u.responseState,I)}function hu(u,h){try{var y=u.completedRootSegment;y!==null&&u.pendingRootTasks===0&&(gl(u,h,y),u.completedRootSegment=null,Ti(h,u.responseState));var C=u.clientRenderedBoundaries,I;for(I=0;I<C.length;I++){var H=C[I];if(!ib(u,h,H)){u.destination=null,I++,C.splice(0,I);return}}C.splice(0,I);var K=u.completedBoundaries;for(I=0;I<K.length;I++){var se=K[I];if(!yl(u,h,se)){u.destination=null,I++,K.splice(0,I);return}}K.splice(0,I);var be=u.partialBoundaries;for(I=0;I<be.length;I++){var Pe=be[I];if(!fu(u,h,Pe)){u.destination=null,I++,be.splice(0,I);return}}be.splice(0,I);var je=u.completedBoundaries;for(I=0;I<je.length;I++){var Ke=je[I];if(!yl(u,h,Ke)){u.destination=null,I++,je.splice(0,I);return}}je.splice(0,I)}finally{u.allPendingTasks===0&&u.pingedTasks.length===0&&u.clientRenderedBoundaries.length===0&&u.completedBoundaries.length===0&&(u.abortableTasks.size!==0&&i("There was still abortable task at the root when we closed. This is a bug in React."),f(h))}}function Dp(u){s(function(){return Sf(u)})}function ob(u,h){if(u.status===ff){u.status=$o,g(h,u.fatalError);return}if(u.status!==$o&&u.destination===null){u.destination=h;try{hu(u,h)}catch(y){ul(u,y),Bn(u,y)}}}function Pp(u,h){try{var y=u.abortableTasks;y.forEach(function(C){return Op(C,u,h)}),y.clear(),u.destination!==null&&hu(u,u.destination)}catch(C){ul(u,C),Bn(u,C)}}function _f(){}function Lp(u,h,y,C){var I=!1,H=null,K="",se={push:function(Ke){return Ke!==null&&(K+=Ke),!0},destroy:function(Ke){I=!0,H=Ke}},be=!1;function Pe(){be=!0}var je=Ks(u,mv(y,h?h.identifierPrefix:void 0),gv(),1/0,_f,void 0,Pe);if(Dp(je),Pp(je,C),ob(je,se),I)throw H;if(!be)throw new Error("A component suspended while responding to synchronous input. This will cause the UI to be replaced with a loading indicator. To fix, updates that suspend should be wrapped with startTransition.");return K}function sb(u,h){return Lp(u,h,!1,'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server')}function Fp(u,h){return Lp(u,h,!0,'The server used "renderToStaticMarkup" which does not support Suspense. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server')}function ab(){throw new Error("ReactDOMServer.renderToNodeStream(): The streaming API is not available in the browser. Use ReactDOMServer.renderToString() instead.")}function v(){throw new Error("ReactDOMServer.renderToStaticNodeStream(): The streaming API is not available in the browser. Use ReactDOMServer.renderToStaticMarkup() instead.")}_l.renderToNodeStream=ab,_l.renderToStaticMarkup=Fp,_l.renderToStaticNodeStream=v,_l.renderToString=sb,_l.version=e}()),_l}var Cm={};/**
|
|
381
|
+
* @license React
|
|
382
|
+
* react-dom-server.browser.development.js
|
|
383
|
+
*
|
|
384
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
385
|
+
*
|
|
386
|
+
* This source code is licensed under the MIT license found in the
|
|
387
|
+
* LICENSE file in the root directory of this source tree.
|
|
388
|
+
*/var fR;function Wae(){return fR||(fR=1,process.env.NODE_ENV!=="production"&&function(){var t=J,e="18.3.1",r=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(v){{for(var u=arguments.length,h=new Array(u>1?u-1:0),y=1;y<u;y++)h[y-1]=arguments[y];o("warn",v,h)}}function i(v){{for(var u=arguments.length,h=new Array(u>1?u-1:0),y=1;y<u;y++)h[y-1]=arguments[y];o("error",v,h)}}function o(v,u,h){{var y=r.ReactDebugCurrentFrame,C=y.getStackAddendum();C!==""&&(u+="%s",h=h.concat([C]));var I=h.map(function(H){return String(H)});I.unshift("Warning: "+u),Function.prototype.apply.call(console[v],console,I)}}function s(v){v()}var a=512,l=null,c=0;function d(v){l=new Uint8Array(a),c=0}function f(v,u){if(u.length!==0){if(u.length>a){c>0&&(v.enqueue(new Uint8Array(l.buffer,0,c)),l=new Uint8Array(a),c=0),v.enqueue(u);return}var h=u,y=l.length-c;y<h.length&&(y===0?v.enqueue(l):(l.set(h.subarray(0,y),c),v.enqueue(l),h=h.subarray(y)),l=new Uint8Array(a),c=0),l.set(h,c),c+=h.length}}function p(v,u){return f(v,u),!0}function m(v){l&&c>0&&(v.enqueue(new Uint8Array(l.buffer,0,c)),l=null,c=0)}function g(v){v.close()}var b=new TextEncoder;function S(v){return b.encode(v)}function w(v){return b.encode(v)}function T(v,u){typeof v.error=="function"?v.error(u):v.close()}function M(v){{var u=typeof Symbol=="function"&&Symbol.toStringTag,h=u&&v[Symbol.toStringTag]||v.constructor.name||"Object";return h}}function j(v){try{return $(v),!1}catch{return!0}}function $(v){return""+v}function W(v,u){if(j(v))return i("The provided `%s` attribute is an unsupported type %s. This value must be coerced to a string before before using it here.",u,M(v)),$(v)}function Y(v,u){if(j(v))return i("The provided `%s` CSS property is an unsupported type %s. This value must be coerced to a string before before using it here.",u,M(v)),$(v)}function ee(v){if(j(v))return i("The provided HTML markup uses a value of unsupported type %s. This value must be coerced to a string before before using it here.",M(v)),$(v)}var P=Object.prototype.hasOwnProperty,fe=0,de=1,U=2,ne=3,R=4,le=5,Ee=6,he=":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",Fe=he+"\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",ye=new RegExp("^["+he+"]["+Fe+"]*$"),ze={},ue={};function V(v){return P.call(ue,v)?!0:P.call(ze,v)?!1:ye.test(v)?(ue[v]=!0,!0):(ze[v]=!0,i("Invalid attribute name: `%s`",v),!1)}function me(v,u,h,y){if(h!==null&&h.type===fe)return!1;switch(typeof u){case"function":case"symbol":return!0;case"boolean":{if(h!==null)return!h.acceptsBooleans;var C=v.toLowerCase().slice(0,5);return C!=="data-"&&C!=="aria-"}default:return!1}}function ge(v){return ce.hasOwnProperty(v)?ce[v]:null}function ke(v,u,h,y,C,I,H){this.acceptsBooleans=u===U||u===ne||u===R,this.attributeName=y,this.attributeNamespace=C,this.mustUseProperty=h,this.propertyName=v,this.type=u,this.sanitizeURL=I,this.removeEmptyString=H}var ce={},L=["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"];L.forEach(function(v){ce[v]=new ke(v,fe,!1,v,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(v){var u=v[0],h=v[1];ce[u]=new ke(u,de,!1,h,null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(v){ce[v]=new ke(v,U,!1,v.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(v){ce[v]=new ke(v,U,!1,v,null,!1,!1)}),["allowFullScreen","async","autoFocus","autoPlay","controls","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"].forEach(function(v){ce[v]=new ke(v,ne,!1,v.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(v){ce[v]=new ke(v,ne,!0,v,null,!1,!1)}),["capture","download"].forEach(function(v){ce[v]=new ke(v,R,!1,v,null,!1,!1)}),["cols","rows","size","span"].forEach(function(v){ce[v]=new ke(v,Ee,!1,v,null,!1,!1)}),["rowSpan","start"].forEach(function(v){ce[v]=new ke(v,le,!1,v.toLowerCase(),null,!1,!1)});var D=/[\-\:]([a-z])/g,ae=function(v){return v[1].toUpperCase()};["accent-height","alignment-baseline","arabic-form","baseline-shift","cap-height","clip-path","clip-rule","color-interpolation","color-interpolation-filters","color-profile","color-rendering","dominant-baseline","enable-background","fill-opacity","fill-rule","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","glyph-name","glyph-orientation-horizontal","glyph-orientation-vertical","horiz-adv-x","horiz-origin-x","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","overline-position","overline-thickness","paint-order","panose-1","pointer-events","rendering-intent","shape-rendering","stop-color","stop-opacity","strikethrough-position","strikethrough-thickness","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-rendering","underline-position","underline-thickness","unicode-bidi","unicode-range","units-per-em","v-alphabetic","v-hanging","v-ideographic","v-mathematical","vector-effect","vert-adv-y","vert-origin-x","vert-origin-y","word-spacing","writing-mode","xmlns:xlink","x-height"].forEach(function(v){var u=v.replace(D,ae);ce[u]=new ke(u,de,!1,v,null,!1,!1)}),["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(function(v){var u=v.replace(D,ae);ce[u]=new ke(u,de,!1,v,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(v){var u=v.replace(D,ae);ce[u]=new ke(u,de,!1,v,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(v){ce[v]=new ke(v,de,!1,v.toLowerCase(),null,!1,!1)});var ie="xlinkHref";ce[ie]=new ke("xlinkHref",de,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(v){ce[v]=new ke(v,de,!1,v.toLowerCase(),null,!0,!0)});var q={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};function Z(v,u){return v+u.charAt(0).toUpperCase()+u.substring(1)}var we=["Webkit","ms","Moz","O"];Object.keys(q).forEach(function(v){we.forEach(function(u){q[Z(u,v)]=q[v]})});var O={button:!0,checkbox:!0,image:!0,hidden:!0,radio:!0,reset:!0,submit:!0};function xe(v,u){O[u.type]||u.onChange||u.onInput||u.readOnly||u.disabled||u.value==null||i("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`."),u.onChange||u.readOnly||u.disabled||u.checked==null||i("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.")}function F(v,u){if(v.indexOf("-")===-1)return typeof u.is=="string";switch(v){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var k={"aria-current":0,"aria-description":0,"aria-details":0,"aria-disabled":0,"aria-hidden":0,"aria-invalid":0,"aria-keyshortcuts":0,"aria-label":0,"aria-roledescription":0,"aria-autocomplete":0,"aria-checked":0,"aria-expanded":0,"aria-haspopup":0,"aria-level":0,"aria-modal":0,"aria-multiline":0,"aria-multiselectable":0,"aria-orientation":0,"aria-placeholder":0,"aria-pressed":0,"aria-readonly":0,"aria-required":0,"aria-selected":0,"aria-sort":0,"aria-valuemax":0,"aria-valuemin":0,"aria-valuenow":0,"aria-valuetext":0,"aria-atomic":0,"aria-busy":0,"aria-live":0,"aria-relevant":0,"aria-dropeffect":0,"aria-grabbed":0,"aria-activedescendant":0,"aria-colcount":0,"aria-colindex":0,"aria-colspan":0,"aria-controls":0,"aria-describedby":0,"aria-errormessage":0,"aria-flowto":0,"aria-labelledby":0,"aria-owns":0,"aria-posinset":0,"aria-rowcount":0,"aria-rowindex":0,"aria-rowspan":0,"aria-setsize":0},_={},N=new RegExp("^(aria)-["+Fe+"]*$"),Q=new RegExp("^(aria)[A-Z]["+Fe+"]*$");function pe(v,u){{if(P.call(_,u)&&_[u])return!0;if(Q.test(u)){var h="aria-"+u.slice(4).toLowerCase(),y=k.hasOwnProperty(h)?h:null;if(y==null)return i("Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.",u),_[u]=!0,!0;if(u!==y)return i("Invalid ARIA attribute `%s`. Did you mean `%s`?",u,y),_[u]=!0,!0}if(N.test(u)){var C=u.toLowerCase(),I=k.hasOwnProperty(C)?C:null;if(I==null)return _[u]=!0,!1;if(u!==I)return i("Unknown ARIA attribute `%s`. Did you mean `%s`?",u,I),_[u]=!0,!0}}return!0}function oe(v,u){{var h=[];for(var y in u){var C=pe(v,y);C||h.push(y)}var I=h.map(function(H){return"`"+H+"`"}).join(", ");h.length===1?i("Invalid aria prop %s on <%s> tag. For details, see https://reactjs.org/link/invalid-aria-props",I,v):h.length>1&&i("Invalid aria props %s on <%s> tag. For details, see https://reactjs.org/link/invalid-aria-props",I,v)}}function Re(v,u){F(v,u)||oe(v,u)}var Ne=!1;function De(v,u){{if(v!=="input"&&v!=="textarea"&&v!=="select")return;u!=null&&u.value===null&&!Ne&&(Ne=!0,v==="select"&&u.multiple?i("`value` prop on `%s` should not be null. Consider using an empty array when `multiple` is set to `true` to clear the component or `undefined` for uncontrolled components.",v):i("`value` prop on `%s` should not be null. Consider using an empty string to clear the component or `undefined` for uncontrolled components.",v))}}var We={accept:"accept",acceptcharset:"acceptCharset","accept-charset":"acceptCharset",accesskey:"accessKey",action:"action",allowfullscreen:"allowFullScreen",alt:"alt",as:"as",async:"async",autocapitalize:"autoCapitalize",autocomplete:"autoComplete",autocorrect:"autoCorrect",autofocus:"autoFocus",autoplay:"autoPlay",autosave:"autoSave",capture:"capture",cellpadding:"cellPadding",cellspacing:"cellSpacing",challenge:"challenge",charset:"charSet",checked:"checked",children:"children",cite:"cite",class:"className",classid:"classID",classname:"className",cols:"cols",colspan:"colSpan",content:"content",contenteditable:"contentEditable",contextmenu:"contextMenu",controls:"controls",controlslist:"controlsList",coords:"coords",crossorigin:"crossOrigin",dangerouslysetinnerhtml:"dangerouslySetInnerHTML",data:"data",datetime:"dateTime",default:"default",defaultchecked:"defaultChecked",defaultvalue:"defaultValue",defer:"defer",dir:"dir",disabled:"disabled",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback",download:"download",draggable:"draggable",enctype:"encType",enterkeyhint:"enterKeyHint",for:"htmlFor",form:"form",formmethod:"formMethod",formaction:"formAction",formenctype:"formEncType",formnovalidate:"formNoValidate",formtarget:"formTarget",frameborder:"frameBorder",headers:"headers",height:"height",hidden:"hidden",high:"high",href:"href",hreflang:"hrefLang",htmlfor:"htmlFor",httpequiv:"httpEquiv","http-equiv":"httpEquiv",icon:"icon",id:"id",imagesizes:"imageSizes",imagesrcset:"imageSrcSet",innerhtml:"innerHTML",inputmode:"inputMode",integrity:"integrity",is:"is",itemid:"itemID",itemprop:"itemProp",itemref:"itemRef",itemscope:"itemScope",itemtype:"itemType",keyparams:"keyParams",keytype:"keyType",kind:"kind",label:"label",lang:"lang",list:"list",loop:"loop",low:"low",manifest:"manifest",marginwidth:"marginWidth",marginheight:"marginHeight",max:"max",maxlength:"maxLength",media:"media",mediagroup:"mediaGroup",method:"method",min:"min",minlength:"minLength",multiple:"multiple",muted:"muted",name:"name",nomodule:"noModule",nonce:"nonce",novalidate:"noValidate",open:"open",optimum:"optimum",pattern:"pattern",placeholder:"placeholder",playsinline:"playsInline",poster:"poster",preload:"preload",profile:"profile",radiogroup:"radioGroup",readonly:"readOnly",referrerpolicy:"referrerPolicy",rel:"rel",required:"required",reversed:"reversed",role:"role",rows:"rows",rowspan:"rowSpan",sandbox:"sandbox",scope:"scope",scoped:"scoped",scrolling:"scrolling",seamless:"seamless",selected:"selected",shape:"shape",size:"size",sizes:"sizes",span:"span",spellcheck:"spellCheck",src:"src",srcdoc:"srcDoc",srclang:"srcLang",srcset:"srcSet",start:"start",step:"step",style:"style",summary:"summary",tabindex:"tabIndex",target:"target",title:"title",type:"type",usemap:"useMap",value:"value",width:"width",wmode:"wmode",wrap:"wrap",about:"about",accentheight:"accentHeight","accent-height":"accentHeight",accumulate:"accumulate",additive:"additive",alignmentbaseline:"alignmentBaseline","alignment-baseline":"alignmentBaseline",allowreorder:"allowReorder",alphabetic:"alphabetic",amplitude:"amplitude",arabicform:"arabicForm","arabic-form":"arabicForm",ascent:"ascent",attributename:"attributeName",attributetype:"attributeType",autoreverse:"autoReverse",azimuth:"azimuth",basefrequency:"baseFrequency",baselineshift:"baselineShift","baseline-shift":"baselineShift",baseprofile:"baseProfile",bbox:"bbox",begin:"begin",bias:"bias",by:"by",calcmode:"calcMode",capheight:"capHeight","cap-height":"capHeight",clip:"clip",clippath:"clipPath","clip-path":"clipPath",clippathunits:"clipPathUnits",cliprule:"clipRule","clip-rule":"clipRule",color:"color",colorinterpolation:"colorInterpolation","color-interpolation":"colorInterpolation",colorinterpolationfilters:"colorInterpolationFilters","color-interpolation-filters":"colorInterpolationFilters",colorprofile:"colorProfile","color-profile":"colorProfile",colorrendering:"colorRendering","color-rendering":"colorRendering",contentscripttype:"contentScriptType",contentstyletype:"contentStyleType",cursor:"cursor",cx:"cx",cy:"cy",d:"d",datatype:"datatype",decelerate:"decelerate",descent:"descent",diffuseconstant:"diffuseConstant",direction:"direction",display:"display",divisor:"divisor",dominantbaseline:"dominantBaseline","dominant-baseline":"dominantBaseline",dur:"dur",dx:"dx",dy:"dy",edgemode:"edgeMode",elevation:"elevation",enablebackground:"enableBackground","enable-background":"enableBackground",end:"end",exponent:"exponent",externalresourcesrequired:"externalResourcesRequired",fill:"fill",fillopacity:"fillOpacity","fill-opacity":"fillOpacity",fillrule:"fillRule","fill-rule":"fillRule",filter:"filter",filterres:"filterRes",filterunits:"filterUnits",floodopacity:"floodOpacity","flood-opacity":"floodOpacity",floodcolor:"floodColor","flood-color":"floodColor",focusable:"focusable",fontfamily:"fontFamily","font-family":"fontFamily",fontsize:"fontSize","font-size":"fontSize",fontsizeadjust:"fontSizeAdjust","font-size-adjust":"fontSizeAdjust",fontstretch:"fontStretch","font-stretch":"fontStretch",fontstyle:"fontStyle","font-style":"fontStyle",fontvariant:"fontVariant","font-variant":"fontVariant",fontweight:"fontWeight","font-weight":"fontWeight",format:"format",from:"from",fx:"fx",fy:"fy",g1:"g1",g2:"g2",glyphname:"glyphName","glyph-name":"glyphName",glyphorientationhorizontal:"glyphOrientationHorizontal","glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphorientationvertical:"glyphOrientationVertical","glyph-orientation-vertical":"glyphOrientationVertical",glyphref:"glyphRef",gradienttransform:"gradientTransform",gradientunits:"gradientUnits",hanging:"hanging",horizadvx:"horizAdvX","horiz-adv-x":"horizAdvX",horizoriginx:"horizOriginX","horiz-origin-x":"horizOriginX",ideographic:"ideographic",imagerendering:"imageRendering","image-rendering":"imageRendering",in2:"in2",in:"in",inlist:"inlist",intercept:"intercept",k1:"k1",k2:"k2",k3:"k3",k4:"k4",k:"k",kernelmatrix:"kernelMatrix",kernelunitlength:"kernelUnitLength",kerning:"kerning",keypoints:"keyPoints",keysplines:"keySplines",keytimes:"keyTimes",lengthadjust:"lengthAdjust",letterspacing:"letterSpacing","letter-spacing":"letterSpacing",lightingcolor:"lightingColor","lighting-color":"lightingColor",limitingconeangle:"limitingConeAngle",local:"local",markerend:"markerEnd","marker-end":"markerEnd",markerheight:"markerHeight",markermid:"markerMid","marker-mid":"markerMid",markerstart:"markerStart","marker-start":"markerStart",markerunits:"markerUnits",markerwidth:"markerWidth",mask:"mask",maskcontentunits:"maskContentUnits",maskunits:"maskUnits",mathematical:"mathematical",mode:"mode",numoctaves:"numOctaves",offset:"offset",opacity:"opacity",operator:"operator",order:"order",orient:"orient",orientation:"orientation",origin:"origin",overflow:"overflow",overlineposition:"overlinePosition","overline-position":"overlinePosition",overlinethickness:"overlineThickness","overline-thickness":"overlineThickness",paintorder:"paintOrder","paint-order":"paintOrder",panose1:"panose1","panose-1":"panose1",pathlength:"pathLength",patterncontentunits:"patternContentUnits",patterntransform:"patternTransform",patternunits:"patternUnits",pointerevents:"pointerEvents","pointer-events":"pointerEvents",points:"points",pointsatx:"pointsAtX",pointsaty:"pointsAtY",pointsatz:"pointsAtZ",prefix:"prefix",preservealpha:"preserveAlpha",preserveaspectratio:"preserveAspectRatio",primitiveunits:"primitiveUnits",property:"property",r:"r",radius:"radius",refx:"refX",refy:"refY",renderingintent:"renderingIntent","rendering-intent":"renderingIntent",repeatcount:"repeatCount",repeatdur:"repeatDur",requiredextensions:"requiredExtensions",requiredfeatures:"requiredFeatures",resource:"resource",restart:"restart",result:"result",results:"results",rotate:"rotate",rx:"rx",ry:"ry",scale:"scale",security:"security",seed:"seed",shaperendering:"shapeRendering","shape-rendering":"shapeRendering",slope:"slope",spacing:"spacing",specularconstant:"specularConstant",specularexponent:"specularExponent",speed:"speed",spreadmethod:"spreadMethod",startoffset:"startOffset",stddeviation:"stdDeviation",stemh:"stemh",stemv:"stemv",stitchtiles:"stitchTiles",stopcolor:"stopColor","stop-color":"stopColor",stopopacity:"stopOpacity","stop-opacity":"stopOpacity",strikethroughposition:"strikethroughPosition","strikethrough-position":"strikethroughPosition",strikethroughthickness:"strikethroughThickness","strikethrough-thickness":"strikethroughThickness",string:"string",stroke:"stroke",strokedasharray:"strokeDasharray","stroke-dasharray":"strokeDasharray",strokedashoffset:"strokeDashoffset","stroke-dashoffset":"strokeDashoffset",strokelinecap:"strokeLinecap","stroke-linecap":"strokeLinecap",strokelinejoin:"strokeLinejoin","stroke-linejoin":"strokeLinejoin",strokemiterlimit:"strokeMiterlimit","stroke-miterlimit":"strokeMiterlimit",strokewidth:"strokeWidth","stroke-width":"strokeWidth",strokeopacity:"strokeOpacity","stroke-opacity":"strokeOpacity",suppresscontenteditablewarning:"suppressContentEditableWarning",suppresshydrationwarning:"suppressHydrationWarning",surfacescale:"surfaceScale",systemlanguage:"systemLanguage",tablevalues:"tableValues",targetx:"targetX",targety:"targetY",textanchor:"textAnchor","text-anchor":"textAnchor",textdecoration:"textDecoration","text-decoration":"textDecoration",textlength:"textLength",textrendering:"textRendering","text-rendering":"textRendering",to:"to",transform:"transform",typeof:"typeof",u1:"u1",u2:"u2",underlineposition:"underlinePosition","underline-position":"underlinePosition",underlinethickness:"underlineThickness","underline-thickness":"underlineThickness",unicode:"unicode",unicodebidi:"unicodeBidi","unicode-bidi":"unicodeBidi",unicoderange:"unicodeRange","unicode-range":"unicodeRange",unitsperem:"unitsPerEm","units-per-em":"unitsPerEm",unselectable:"unselectable",valphabetic:"vAlphabetic","v-alphabetic":"vAlphabetic",values:"values",vectoreffect:"vectorEffect","vector-effect":"vectorEffect",version:"version",vertadvy:"vertAdvY","vert-adv-y":"vertAdvY",vertoriginx:"vertOriginX","vert-origin-x":"vertOriginX",vertoriginy:"vertOriginY","vert-origin-y":"vertOriginY",vhanging:"vHanging","v-hanging":"vHanging",videographic:"vIdeographic","v-ideographic":"vIdeographic",viewbox:"viewBox",viewtarget:"viewTarget",visibility:"visibility",vmathematical:"vMathematical","v-mathematical":"vMathematical",vocab:"vocab",widths:"widths",wordspacing:"wordSpacing","word-spacing":"wordSpacing",writingmode:"writingMode","writing-mode":"writingMode",x1:"x1",x2:"x2",x:"x",xchannelselector:"xChannelSelector",xheight:"xHeight","x-height":"xHeight",xlinkactuate:"xlinkActuate","xlink:actuate":"xlinkActuate",xlinkarcrole:"xlinkArcrole","xlink:arcrole":"xlinkArcrole",xlinkhref:"xlinkHref","xlink:href":"xlinkHref",xlinkrole:"xlinkRole","xlink:role":"xlinkRole",xlinkshow:"xlinkShow","xlink:show":"xlinkShow",xlinktitle:"xlinkTitle","xlink:title":"xlinkTitle",xlinktype:"xlinkType","xlink:type":"xlinkType",xmlbase:"xmlBase","xml:base":"xmlBase",xmllang:"xmlLang","xml:lang":"xmlLang",xmlns:"xmlns","xml:space":"xmlSpace",xmlnsxlink:"xmlnsXlink","xmlns:xlink":"xmlnsXlink",xmlspace:"xmlSpace",y1:"y1",y2:"y2",y:"y",ychannelselector:"yChannelSelector",z:"z",zoomandpan:"zoomAndPan"},Je=function(){};{var Ye={},Gt=/^on./,Ar=/^on[^A-Z]/,pr=new RegExp("^(aria)-["+Fe+"]*$"),en=new RegExp("^(aria)[A-Z]["+Fe+"]*$");Je=function(v,u,h,y){if(P.call(Ye,u)&&Ye[u])return!0;var C=u.toLowerCase();if(C==="onfocusin"||C==="onfocusout")return i("React uses onFocus and onBlur instead of onFocusIn and onFocusOut. All React events are normalized to bubble, so onFocusIn and onFocusOut are not needed/supported by React."),Ye[u]=!0,!0;if(y!=null){var I=y.registrationNameDependencies,H=y.possibleRegistrationNames;if(I.hasOwnProperty(u))return!0;var K=H.hasOwnProperty(C)?H[C]:null;if(K!=null)return i("Invalid event handler property `%s`. Did you mean `%s`?",u,K),Ye[u]=!0,!0;if(Gt.test(u))return i("Unknown event handler property `%s`. It will be ignored.",u),Ye[u]=!0,!0}else if(Gt.test(u))return Ar.test(u)&&i("Invalid event handler property `%s`. React events use the camelCase naming convention, for example `onClick`.",u),Ye[u]=!0,!0;if(pr.test(u)||en.test(u))return!0;if(C==="innerhtml")return i("Directly setting property `innerHTML` is not permitted. For more information, lookup documentation on `dangerouslySetInnerHTML`."),Ye[u]=!0,!0;if(C==="aria")return i("The `aria` attribute is reserved for future use in React. Pass individual `aria-` attributes instead."),Ye[u]=!0,!0;if(C==="is"&&h!==null&&h!==void 0&&typeof h!="string")return i("Received a `%s` for a string attribute `is`. If this is expected, cast the value to a string.",typeof h),Ye[u]=!0,!0;if(typeof h=="number"&&isNaN(h))return i("Received NaN for the `%s` attribute. If this is expected, cast the value to a string.",u),Ye[u]=!0,!0;var se=ge(u),be=se!==null&&se.type===fe;if(We.hasOwnProperty(C)){var Pe=We[C];if(Pe!==u)return i("Invalid DOM property `%s`. Did you mean `%s`?",u,Pe),Ye[u]=!0,!0}else if(!be&&u!==C)return i("React does not recognize the `%s` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `%s` instead. If you accidentally passed it from a parent component, remove it from the DOM element.",u,C),Ye[u]=!0,!0;return typeof h=="boolean"&&me(u,h,se)?(h?i('Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.',h,u,u,h,u):i('Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.',h,u,u,h,u,u,u),Ye[u]=!0,!0):be?!0:me(u,h,se)?(Ye[u]=!0,!1):((h==="false"||h==="true")&&se!==null&&se.type===ne&&(i("Received the string `%s` for the boolean attribute `%s`. %s Did you mean %s={%s}?",h,u,h==="false"?"The browser will interpret it as a truthy value.":'Although this works, it will not work as expected if you pass the string "false".',u,h),Ye[u]=!0),!0)}}var Et=function(v,u,h){{var y=[];for(var C in u){var I=Je(v,C,u[C],h);I||y.push(C)}var H=y.map(function(K){return"`"+K+"`"}).join(", ");y.length===1?i("Invalid value for prop %s on <%s> tag. Either remove it from the element, or pass a string or number value to keep it in the DOM. For details, see https://reactjs.org/link/attribute-behavior ",H,v):y.length>1&&i("Invalid values for props %s on <%s> tag. Either remove them from the element, or pass a string or number value to keep them in the DOM. For details, see https://reactjs.org/link/attribute-behavior ",H,v)}};function Yn(v,u,h){F(v,u)||Et(v,u,h)}var Nn=function(){};{var rr=/^(?:webkit|moz|o)[A-Z]/,Jn=/^-ms-/,$i=/-(.)/g,dr=/;\s*$/,Hr={},tn={},mt=!1,Rr=!1,Ui=function(v){return v.replace($i,function(u,h){return h.toUpperCase()})},ki=function(v){Hr.hasOwnProperty(v)&&Hr[v]||(Hr[v]=!0,i("Unsupported style property %s. Did you mean %s?",v,Ui(v.replace(Jn,"ms-"))))},yn=function(v){Hr.hasOwnProperty(v)&&Hr[v]||(Hr[v]=!0,i("Unsupported vendor-prefixed style property %s. Did you mean %s?",v,v.charAt(0).toUpperCase()+v.slice(1)))},Wi=function(v,u){tn.hasOwnProperty(u)&&tn[u]||(tn[u]=!0,i(`Style property values shouldn't contain a semicolon. Try "%s: %s" instead.`,v,u.replace(dr,"")))},Dn=function(v,u){mt||(mt=!0,i("`NaN` is an invalid value for the `%s` css style property.",v))},nr=function(v,u){Rr||(Rr=!0,i("`Infinity` is an invalid value for the `%s` css style property.",v))};Nn=function(v,u){v.indexOf("-")>-1?ki(v):rr.test(v)?yn(v):dr.test(u)&&Wi(v,u),typeof u=="number"&&(isNaN(u)?Dn(v,u):isFinite(u)||nr(v,u))}}var Ro=Nn,Io=/["'&<>]/;function Ss(v){ee(v);var u=""+v,h=Io.exec(u);if(!h)return u;var y,C="",I,H=0;for(I=h.index;I<u.length;I++){switch(u.charCodeAt(I)){case 34:y=""";break;case 38:y="&";break;case 39:y="'";break;case 60:y="<";break;case 62:y=">";break;default:continue}H!==I&&(C+=u.substring(H,I)),H=I+1,C+=y}return H!==I?C+u.substring(H,I):C}function Jt(v){return typeof v=="boolean"||typeof v=="number"?""+v:Ss(v)}var Oo=/([A-Z])/g,ja=/^ms-/;function Ba(v){return v.replace(Oo,"-$1").toLowerCase().replace(ja,"-ms-")}var vn=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i,Mo=!1;function Vi(v){!Mo&&vn.test(v)&&(Mo=!0,i("A future version of React will block javascript: URLs as a security precaution. Use event handlers instead if you can. If you need to generate unsafe HTML try using dangerouslySetInnerHTML instead. React was passed %s.",JSON.stringify(v)))}var Zn=Array.isArray;function Ir(v){return Zn(v)}var bn=w("<script>"),Gi=w("<\/script>"),Qn=w('<script src="'),ei=w('<script type="module" src="'),wn=w('" async=""><\/script>');function ti(v){return ee(v),(""+v).replace(Or,ks)}var Or=/(<\/|<)(s)(cript)/gi,ks=function(v,u,h,y){return""+u+(h==="s"?"\\u0073":"\\u0053")+y};function _s(v,u,h,y,C){var I=v===void 0?"":v,H=u===void 0?bn:w('<script nonce="'+Jt(u)+'">'),K=[];if(h!==void 0&&K.push(H,S(ti(h)),Gi),y!==void 0)for(var se=0;se<y.length;se++)K.push(Qn,S(Jt(y[se])),wn);if(C!==void 0)for(var be=0;be<C.length;be++)K.push(ei,S(Jt(C[be])),wn);return{bootstrapChunks:K,startInlineScript:H,placeholderPrefix:w(I+"P:"),segmentPrefix:w(I+"S:"),boundaryPrefix:I+"B:",idPrefix:I,nextSuspenseID:0,sentCompleteSegmentFunction:!1,sentCompleteBoundaryFunction:!1,sentClientRenderFunction:!1}}var Pn=0,Zt=1,xn=2,Sn=3,ri=4,Ki=5,rn=6,kn=7;function gr(v,u){return{insertionMode:v,selectedValue:u}}function ni(v){var u=v==="http://www.w3.org/2000/svg"?xn:v==="http://www.w3.org/1998/Math/MathML"?Sn:Pn;return gr(u,null)}function _i(v,u,h){switch(u){case"select":return gr(Zt,h.value!=null?h.value:h.defaultValue);case"svg":return gr(xn,null);case"math":return gr(Sn,null);case"foreignObject":return gr(Zt,null);case"table":return gr(ri,null);case"thead":case"tbody":case"tfoot":return gr(Ki,null);case"colgroup":return gr(kn,null);case"tr":return gr(rn,null)}return v.insertionMode>=ri||v.insertionMode===Pn?gr(Zt,null):v}var qi=null;function $r(v){var u=v.nextSuspenseID++;return w(v.boundaryPrefix+u.toString(16))}function _n(v,u,h){var y=v.idPrefix,C=":"+y+"R"+u;return h>0&&(C+="H"+h.toString(32)),C+":"}function yr(v){return Jt(v)}var Xi=w("<!-- -->");function ar(v,u,h,y){return u===""?y:(y&&v.push(Xi),v.push(S(yr(u))),!0)}function Mr(v,u,h,y){h&&y&&v.push(Xi)}var E=new Map;function z(v){var u=E.get(v);if(u!==void 0)return u;var h=w(Jt(Ba(v)));return E.set(v,h),h}var X=w(' style="'),re=w(":"),_e=w(";");function ve(v,u,h){if(typeof h!="object")throw new Error("The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.");var y=!0;for(var C in h)if(P.call(h,C)){var I=h[C];if(!(I==null||typeof I=="boolean"||I==="")){var H=void 0,K=void 0,se=C.indexOf("--")===0;se?(H=S(Jt(C)),Y(I,C),K=S(Jt((""+I).trim()))):(Ro(C,I),H=z(C),typeof I=="number"?I!==0&&!P.call(q,C)?K=S(I+"px"):K=S(""+I):(Y(I,C),K=S(Jt((""+I).trim())))),y?(y=!1,v.push(X,H,re,K)):v.push(_e,H,re,K)}}y||v.push(Qe)}var Oe=w(" "),$e=w('="'),Qe=w('"'),nt=w('=""');function tt(v,u,h,y){switch(h){case"style":{ve(v,u,y);return}case"defaultValue":case"defaultChecked":case"innerHTML":case"suppressContentEditableWarning":case"suppressHydrationWarning":return}if(!(h.length>2&&(h[0]==="o"||h[0]==="O")&&(h[1]==="n"||h[1]==="N"))){var C=ge(h);if(C!==null){switch(typeof y){case"function":case"symbol":return;case"boolean":if(!C.acceptsBooleans)return}var I=C.attributeName,H=S(I);switch(C.type){case ne:y&&v.push(Oe,H,nt);return;case R:y===!0?v.push(Oe,H,nt):y===!1||v.push(Oe,H,$e,S(Jt(y)),Qe);return;case le:isNaN(y)||v.push(Oe,H,$e,S(Jt(y)),Qe);break;case Ee:!isNaN(y)&&y>=1&&v.push(Oe,H,$e,S(Jt(y)),Qe);break;default:C.sanitizeURL&&(W(y,I),y=""+y,Vi(y)),v.push(Oe,H,$e,S(Jt(y)),Qe)}}else if(V(h)){switch(typeof y){case"function":case"symbol":return;case"boolean":{var K=h.toLowerCase().slice(0,5);if(K!=="data-"&&K!=="aria-")return}}v.push(Oe,S(h),$e,S(Jt(y)),Qe)}}}var wt=w(">"),vr=w("/>");function br(v,u,h){if(u!=null){if(h!=null)throw new Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`.");if(typeof u!="object"||!("__html"in u))throw new Error("`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://reactjs.org/link/dangerously-set-inner-html for more information.");var y=u.__html;y!=null&&(ee(y),v.push(S(""+y)))}}var wr=!1,ii=!1,Cn=!1,Yi=!1,oi=!1,Ci=!1,Ln=!1;function Ei(v,u){{var h=v[u];if(h!=null){var y=Ir(h);v.multiple&&!y?i("The `%s` prop supplied to <select> must be an array if `multiple` is true.",u):!v.multiple&&y&&i("The `%s` prop supplied to <select> must be a scalar value if `multiple` is false.",u)}}}function Nd(v,u,h){xe("select",u),Ei(u,"value"),Ei(u,"defaultValue"),u.value!==void 0&&u.defaultValue!==void 0&&!Cn&&(i("Select elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled select element and remove one of these props. More info: https://reactjs.org/link/controlled-components"),Cn=!0),v.push(nn("select"));var y=null,C=null;for(var I in u)if(P.call(u,I)){var H=u[I];if(H==null)continue;switch(I){case"children":y=H;break;case"dangerouslySetInnerHTML":C=H;break;case"defaultValue":case"value":break;default:tt(v,h,I,H);break}}return v.push(wt),br(v,C,y),y}function Dd(v){var u="";return t.Children.forEach(v,function(h){h!=null&&(u+=h,!oi&&typeof h!="string"&&typeof h!="number"&&(oi=!0,i("Cannot infer the option value of complex children. Pass a `value` prop or use a plain string as children to <option>.")))}),u}var Cs=w(' selected=""');function En(v,u,h,y){var C=y.selectedValue;v.push(nn("option"));var I=null,H=null,K=null,se=null;for(var be in u)if(P.call(u,be)){var Pe=u[be];if(Pe==null)continue;switch(be){case"children":I=Pe;break;case"selected":K=Pe,Ln||(i("Use the `defaultValue` or `value` props on <select> instead of setting `selected` on <option>."),Ln=!0);break;case"dangerouslySetInnerHTML":se=Pe;break;case"value":H=Pe;default:tt(v,h,be,Pe);break}}if(C!=null){var je;if(H!==null?(W(H,"value"),je=""+H):(se!==null&&(Ci||(Ci=!0,i("Pass a `value` prop if you set dangerouslyInnerHTML so React knows which value should be selected."))),je=Dd(I)),Ir(C))for(var Ke=0;Ke<C.length;Ke++){W(C[Ke],"value");var st=""+C[Ke];if(st===je){v.push(Cs);break}}else W(C,"select.value"),""+C===je&&v.push(Cs)}else K&&v.push(Cs);return v.push(wt),br(v,se,I),I}function Pd(v,u,h){xe("input",u),u.checked!==void 0&&u.defaultChecked!==void 0&&!ii&&(i("%s contains an input of type %s with both checked and defaultChecked props. Input elements must be either controlled or uncontrolled (specify either the checked prop, or the defaultChecked prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components","A component",u.type),ii=!0),u.value!==void 0&&u.defaultValue!==void 0&&!wr&&(i("%s contains an input of type %s with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components","A component",u.type),wr=!0),v.push(nn("input"));var y=null,C=null,I=null,H=null;for(var K in u)if(P.call(u,K)){var se=u[K];if(se==null)continue;switch(K){case"children":case"dangerouslySetInnerHTML":throw new Error("input is a self-closing tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");case"defaultChecked":H=se;break;case"defaultValue":C=se;break;case"checked":I=se;break;case"value":y=se;break;default:tt(v,h,K,se);break}}return I!==null?tt(v,h,"checked",I):H!==null&&tt(v,h,"checked",H),y!==null?tt(v,h,"value",y):C!==null&&tt(v,h,"value",C),v.push(vr),null}function Fn(v,u,h){xe("textarea",u),u.value!==void 0&&u.defaultValue!==void 0&&!Yi&&(i("Textarea elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled textarea and remove one of these props. More info: https://reactjs.org/link/controlled-components"),Yi=!0),v.push(nn("textarea"));var y=null,C=null,I=null;for(var H in u)if(P.call(u,H)){var K=u[H];if(K==null)continue;switch(H){case"children":I=K;break;case"value":y=K;break;case"defaultValue":C=K;break;case"dangerouslySetInnerHTML":throw new Error("`dangerouslySetInnerHTML` does not make sense on <textarea>.");default:tt(v,h,H,K);break}}if(y===null&&C!==null&&(y=C),v.push(wt),I!=null){if(i("Use the `defaultValue` or `value` props instead of setting children on <textarea>."),y!=null)throw new Error("If you supply `defaultValue` on a <textarea>, do not pass children.");if(Ir(I)){if(I.length>1)throw new Error("<textarea> can only have at most one child.");ee(I[0]),y=""+I[0]}ee(I),y=""+I}return typeof y=="string"&&y[0]===`
|
|
389
|
+
`&&v.push(Ai),y!==null&&(W(y,"value"),v.push(S(yr(""+y)))),null}function za(v,u,h,y){v.push(nn(h));for(var C in u)if(P.call(u,C)){var I=u[C];if(I==null)continue;switch(C){case"children":case"dangerouslySetInnerHTML":throw new Error(h+" is a self-closing tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");default:tt(v,y,C,I);break}}return v.push(vr),null}function Es(v,u,h){v.push(nn("menuitem"));for(var y in u)if(P.call(u,y)){var C=u[y];if(C==null)continue;switch(y){case"children":case"dangerouslySetInnerHTML":throw new Error("menuitems cannot have `children` nor `dangerouslySetInnerHTML`.");default:tt(v,h,y,C);break}}return v.push(wt),null}function It(v,u,h){v.push(nn("title"));var y=null;for(var C in u)if(P.call(u,C)){var I=u[C];if(I==null)continue;switch(C){case"children":y=I;break;case"dangerouslySetInnerHTML":throw new Error("`dangerouslySetInnerHTML` does not make sense on <title>.");default:tt(v,h,C,I);break}}v.push(wt);{var H=Array.isArray(y)&&y.length<2?y[0]||null:y;Array.isArray(y)&&y.length>1?i("A title element received an array with more than 1 element as children. In browsers title Elements can only have Text Nodes as children. If the children being rendered output more than a single text node in aggregate the browser will display markup and comments as text in the title and hydration will likely fail and fall back to client rendering"):H!=null&&H.$$typeof!=null?i("A title element received a React element for children. In the browser title Elements can only have Text Nodes as children. If the children being rendered output more than a single text node in aggregate the browser will display markup and comments as text in the title and hydration will likely fail and fall back to client rendering"):H!=null&&typeof H!="string"&&typeof H!="number"&&i("A title element received a value that was not a string or number for children. In the browser title Elements can only have Text Nodes as children. If the children being rendered output more than a single text node in aggregate the browser will display markup and comments as text in the title and hydration will likely fail and fall back to client rendering")}return y}function Ti(v,u,h,y){v.push(nn(h));var C=null,I=null;for(var H in u)if(P.call(u,H)){var K=u[H];if(K==null)continue;switch(H){case"children":C=K;break;case"dangerouslySetInnerHTML":I=K;break;default:tt(v,y,H,K);break}}return v.push(wt),br(v,I,C),typeof C=="string"?(v.push(S(yr(C))),null):C}function Ts(v,u,h,y){v.push(nn(h));var C=null,I=null;for(var H in u)if(P.call(u,H)){var K=u[H];if(K==null)continue;switch(H){case"children":C=K;break;case"dangerouslySetInnerHTML":I=K;break;case"style":ve(v,y,K);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":break;default:V(H)&&typeof K!="function"&&typeof K!="symbol"&&v.push(Oe,S(H),$e,S(Jt(K)),Qe);break}}return v.push(wt),br(v,I,C),C}var Ai=w(`
|
|
390
|
+
`);function si(v,u,h,y){v.push(nn(h));var C=null,I=null;for(var H in u)if(P.call(u,H)){var K=u[H];if(K==null)continue;switch(H){case"children":C=K;break;case"dangerouslySetInnerHTML":I=K;break;default:tt(v,y,H,K);break}}if(v.push(wt),I!=null){if(C!=null)throw new Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`.");if(typeof I!="object"||!("__html"in I))throw new Error("`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://reactjs.org/link/dangerously-set-inner-html for more information.");var se=I.__html;se!=null&&(typeof se=="string"&&se.length>0&&se[0]===`
|
|
391
|
+
`?v.push(Ai,S(se)):(ee(se),v.push(S(""+se))))}return typeof C=="string"&&C[0]===`
|
|
392
|
+
`&&v.push(Ai),C}var As=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,ai=new Map;function nn(v){var u=ai.get(v);if(u===void 0){if(!As.test(v))throw new Error("Invalid tag: "+v);u=w("<"+v),ai.set(v,u)}return u}var Ha=w("<!DOCTYPE html>");function No(v,u,h,y,C){switch(Re(u,h),De(u,h),Yn(u,h,null),!h.suppressContentEditableWarning&&h.contentEditable&&h.children!=null&&i("A component is `contentEditable` and contains `children` managed by React. It is now your responsibility to guarantee that none of those nodes are unexpectedly modified or duplicated. This is probably not intentional."),C.insertionMode!==xn&&C.insertionMode!==Sn&&u.indexOf("-")===-1&&typeof h.is!="string"&&u.toLowerCase()!==u&&i("<%s /> is using incorrect casing. Use PascalCase for React components, or lowercase for HTML elements.",u),u){case"select":return Nd(v,h,y);case"option":return En(v,h,y,C);case"textarea":return Fn(v,h,y);case"input":return Pd(v,h,y);case"menuitem":return Es(v,h,y);case"title":return It(v,h,y);case"listing":case"pre":return si(v,h,u,y);case"area":case"base":case"br":case"col":case"embed":case"hr":case"img":case"keygen":case"link":case"meta":case"param":case"source":case"track":case"wbr":return za(v,h,u,y);case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return Ti(v,h,u,y);case"html":return C.insertionMode===Pn&&v.push(Ha),Ti(v,h,u,y);default:return u.indexOf("-")===-1&&typeof h.is!="string"?Ti(v,h,u,y):Ts(v,h,u,y)}}var gc=w("</"),Rs=w(">");function yc(v,u,h){switch(u){case"area":case"base":case"br":case"col":case"embed":case"hr":case"img":case"input":case"keygen":case"link":case"meta":case"param":case"source":case"track":case"wbr":break;default:v.push(gc,S(u),Rs)}}function Ld(v,u){for(var h=u.bootstrapChunks,y=0;y<h.length-1;y++)f(v,h[y]);return y<h.length?p(v,h[y]):!0}var Fd=w('<template id="'),Is=w('"></template>');function vc(v,u,h){f(v,Fd),f(v,u.placeholderPrefix);var y=S(h.toString(16));return f(v,y),p(v,Is)}var Do=w("<!--$-->"),$a=w('<!--$?--><template id="'),jd=w('"></template>'),Ji=w("<!--$!-->"),Ua=w("<!--/$-->"),Wa=w("<template"),Zi=w('"'),Po=w(' data-dgst="'),Os=w(' data-msg="'),bc=w(' data-stck="'),wc=w("></template>");function xc(v,u){return p(v,Do)}function Ms(v,u,h){if(f(v,$a),h===null)throw new Error("An ID must have been assigned before we can complete the boundary.");return f(v,h),p(v,jd)}function Nr(v,u,h,y,C){var I;return I=p(v,Ji),f(v,Wa),h&&(f(v,Po),f(v,S(Jt(h))),f(v,Zi)),y&&(f(v,Os),f(v,S(Jt(y))),f(v,Zi)),C&&(f(v,bc),f(v,S(Jt(C))),f(v,Zi)),I=p(v,wc),I}function Sc(v,u){return p(v,Ua)}function Ns(v,u){return p(v,Ua)}function Bd(v,u){return p(v,Ua)}var kc=w('<div hidden id="'),Ds=w('">'),_c=w("</div>"),Cc=w('<svg aria-hidden="true" style="display:none" id="'),Ps=w('">'),Ls=w("</svg>"),Ec=w('<math aria-hidden="true" style="display:none" id="'),Tc=w('">'),Ac=w("</math>"),Va=w('<table hidden id="'),Rc=w('">'),A=w("</table>"),B=w('<table hidden><tbody id="'),G=w('">'),te=w("</tbody></table>"),Ce=w('<table hidden><tr id="'),Se=w('">'),Me=w("</tr></table>"),Ue=w('<table hidden><colgroup id="'),it=w('">'),ut=w("</colgroup></table>");function ct(v,u,h,y){switch(h.insertionMode){case Pn:case Zt:return f(v,kc),f(v,u.segmentPrefix),f(v,S(y.toString(16))),p(v,Ds);case xn:return f(v,Cc),f(v,u.segmentPrefix),f(v,S(y.toString(16))),p(v,Ps);case Sn:return f(v,Ec),f(v,u.segmentPrefix),f(v,S(y.toString(16))),p(v,Tc);case ri:return f(v,Va),f(v,u.segmentPrefix),f(v,S(y.toString(16))),p(v,Rc);case Ki:return f(v,B),f(v,u.segmentPrefix),f(v,S(y.toString(16))),p(v,G);case rn:return f(v,Ce),f(v,u.segmentPrefix),f(v,S(y.toString(16))),p(v,Se);case kn:return f(v,Ue),f(v,u.segmentPrefix),f(v,S(y.toString(16))),p(v,it);default:throw new Error("Unknown insertion mode. This is a bug in React.")}}function Dt(v,u){switch(u.insertionMode){case Pn:case Zt:return p(v,_c);case xn:return p(v,Ls);case Sn:return p(v,Ac);case ri:return p(v,A);case Ki:return p(v,te);case rn:return p(v,Me);case kn:return p(v,ut);default:throw new Error("Unknown insertion mode. This is a bug in React.")}}var Dr="function $RS(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)}",on='function $RC(a,b){a=document.getElementById(a);b=document.getElementById(b);b.parentNode.removeChild(b);if(a){a=a.previousSibling;var f=a.parentNode,c=a.nextSibling,e=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d)if(0===e)break;else e--;else"$"!==d&&"$?"!==d&&"$!"!==d||e++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;b.firstChild;)f.insertBefore(b.firstChild,c);a.data="$";a._reactRetry&&a._reactRetry()}}',sn='function $RX(b,c,d,e){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),b._reactRetry&&b._reactRetry())}',Fs=w(Dr+';$RS("'),Ic=w('$RS("'),Lo=w('","'),hv=w('")<\/script>');function pv(v,u,h){f(v,u.startInlineScript),u.sentCompleteSegmentFunction?f(v,Ic):(u.sentCompleteSegmentFunction=!0,f(v,Fs)),f(v,u.segmentPrefix);var y=S(h.toString(16));return f(v,y),f(v,Lo),f(v,u.placeholderPrefix),f(v,y),p(v,hv)}var zd=w(on+';$RC("'),mv=w('$RC("'),gv=w('","'),Zh=w('")<\/script>');function Qh(v,u,h,y){if(f(v,u.startInlineScript),u.sentCompleteBoundaryFunction?f(v,mv):(u.sentCompleteBoundaryFunction=!0,f(v,zd)),h===null)throw new Error("An ID must have been assigned before we can complete the boundary.");var C=S(y.toString(16));return f(v,h),f(v,gv),f(v,u.segmentPrefix),f(v,C),p(v,Zh)}var yv=w(sn+';$RX("'),vv=w('$RX("'),bv=w('"'),wv=w(")<\/script>"),Ur=w(",");function xv(v,u,h,y,C,I){if(f(v,u.startInlineScript),u.sentClientRenderFunction?f(v,vv):(u.sentClientRenderFunction=!0,f(v,yv)),h===null)throw new Error("An ID must have been assigned before we can complete the boundary.");return f(v,h),f(v,bv),(y||C||I)&&(f(v,Ur),f(v,S(Oc(y||"")))),(C||I)&&(f(v,Ur),f(v,S(Oc(C||"")))),I&&(f(v,Ur),f(v,S(Oc(I)))),p(v,wv)}var ep=/[<\u2028\u2029]/g;function Oc(v){var u=JSON.stringify(v);return u.replace(ep,function(h){switch(h){case"<":return"\\u003c";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("escapeJSStringsForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React")}})}var an=Object.assign,tp=Symbol.for("react.element"),Mc=Symbol.for("react.portal"),Nc=Symbol.for("react.fragment"),Dc=Symbol.for("react.strict_mode"),Pc=Symbol.for("react.profiler"),Ga=Symbol.for("react.provider"),Ka=Symbol.for("react.context"),js=Symbol.for("react.forward_ref"),Hd=Symbol.for("react.suspense"),$d=Symbol.for("react.suspense_list"),Ud=Symbol.for("react.memo"),Lc=Symbol.for("react.lazy"),rp=Symbol.for("react.scope"),Sv=Symbol.for("react.debug_trace_mode"),kv=Symbol.for("react.legacy_hidden"),_v=Symbol.for("react.default_value"),Wd=Symbol.iterator,Wt="@@iterator";function qa(v){if(v===null||typeof v!="object")return null;var u=Wd&&v[Wd]||v[Wt];return typeof u=="function"?u:null}function np(v,u,h){var y=v.displayName;if(y)return y;var C=u.displayName||u.name||"";return C!==""?h+"("+C+")":h}function Vd(v){return v.displayName||"Context"}function zt(v){if(v==null)return null;if(typeof v.tag=="number"&&i("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof v=="function")return v.displayName||v.name||null;if(typeof v=="string")return v;switch(v){case Nc:return"Fragment";case Mc:return"Portal";case Pc:return"Profiler";case Dc:return"StrictMode";case Hd:return"Suspense";case $d:return"SuspenseList"}if(typeof v=="object")switch(v.$$typeof){case Ka:var u=v;return Vd(u)+".Consumer";case Ga:var h=v;return Vd(h._context)+".Provider";case js:return np(v,v.render,"ForwardRef");case Ud:var y=v.displayName||null;return y!==null?y:zt(v.type)||"Memo";case Lc:{var C=v,I=C._payload,H=C._init;try{return zt(H(I))}catch{return null}}}return null}var Bs=0,Gd,Kd,qd,Xd,ip,op,Fc;function jc(){}jc.__reactDisabledLog=!0;function Xa(){{if(Bs===0){Gd=console.log,Kd=console.info,qd=console.warn,Xd=console.error,ip=console.group,op=console.groupCollapsed,Fc=console.groupEnd;var v={configurable:!0,enumerable:!0,value:jc,writable:!0};Object.defineProperties(console,{info:v,log:v,warn:v,error:v,group:v,groupCollapsed:v,groupEnd:v})}Bs++}}function Yd(){{if(Bs--,Bs===0){var v={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:an({},v,{value:Gd}),info:an({},v,{value:Kd}),warn:an({},v,{value:qd}),error:an({},v,{value:Xd}),group:an({},v,{value:ip}),groupCollapsed:an({},v,{value:op}),groupEnd:an({},v,{value:Fc})})}Bs<0&&i("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var zs=r.ReactCurrentDispatcher,Jd;function Fo(v,u,h){{if(Jd===void 0)try{throw Error()}catch(C){var y=C.stack.trim().match(/\n( *(at )?)/);Jd=y&&y[1]||""}return`
|
|
393
|
+
`+Jd+v}}var Zd=!1,Ya;{var Cv=typeof WeakMap=="function"?WeakMap:Map;Ya=new Cv}function Ja(v,u){if(!v||Zd)return"";{var h=Ya.get(v);if(h!==void 0)return h}var y;Zd=!0;var C=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var I;I=zs.current,zs.current=null,Xa();try{if(u){var H=function(){throw Error()};if(Object.defineProperty(H.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(H,[])}catch(kt){y=kt}Reflect.construct(v,[],H)}else{try{H.call()}catch(kt){y=kt}v.call(H.prototype)}}else{try{throw Error()}catch(kt){y=kt}v()}}catch(kt){if(kt&&y&&typeof kt.stack=="string"){for(var K=kt.stack.split(`
|
|
394
|
+
`),se=y.stack.split(`
|
|
395
|
+
`),be=K.length-1,Pe=se.length-1;be>=1&&Pe>=0&&K[be]!==se[Pe];)Pe--;for(;be>=1&&Pe>=0;be--,Pe--)if(K[be]!==se[Pe]){if(be!==1||Pe!==1)do if(be--,Pe--,Pe<0||K[be]!==se[Pe]){var je=`
|
|
396
|
+
`+K[be].replace(" at new "," at ");return v.displayName&&je.includes("<anonymous>")&&(je=je.replace("<anonymous>",v.displayName)),typeof v=="function"&&Ya.set(v,je),je}while(be>=1&&Pe>=0);break}}}finally{Zd=!1,zs.current=I,Yd(),Error.prepareStackTrace=C}var Ke=v?v.displayName||v.name:"",st=Ke?Fo(Ke):"";return typeof v=="function"&&Ya.set(v,st),st}function sp(v,u,h){return Ja(v,!0)}function Qd(v,u,h){return Ja(v,!1)}function Bc(v){var u=v.prototype;return!!(u&&u.isReactComponent)}function zc(v,u,h){if(v==null)return"";if(typeof v=="function")return Ja(v,Bc(v));if(typeof v=="string")return Fo(v);switch(v){case Hd:return Fo("Suspense");case $d:return Fo("SuspenseList")}if(typeof v=="object")switch(v.$$typeof){case js:return Qd(v.render);case Ud:return zc(v.type,u,h);case Lc:{var y=v,C=y._payload,I=y._init;try{return zc(I(C),u,h)}catch{}}}return""}var Hc={},Za=r.ReactDebugCurrentFrame;function Qa(v){if(v){var u=v._owner,h=zc(v.type,v._source,u?u.type:null);Za.setExtraStackFrame(h)}else Za.setExtraStackFrame(null)}function ap(v,u,h,y,C){{var I=Function.call.bind(P);for(var H in v)if(I(v,H)){var K=void 0;try{if(typeof v[H]!="function"){var se=Error((y||"React class")+": "+h+" type `"+H+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof v[H]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw se.name="Invariant Violation",se}K=v[H](u,H,y,h,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(be){K=be}K&&!(K instanceof Error)&&(Qa(C),i("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",y||"React class",h,H,typeof K),Qa(null)),K instanceof Error&&!(K.message in Hc)&&(Hc[K.message]=!0,Qa(C),i("Failed %s type: %s",h,K.message),Qa(null))}}}var jo;jo={};var $c={};Object.freeze($c);function Qi(v,u){{var h=v.contextTypes;if(!h)return $c;var y={};for(var C in h)y[C]=u[C];{var I=zt(v)||"Unknown";ap(h,y,"context",I)}return y}}function ef(v,u,h,y){{if(typeof v.getChildContext!="function"){{var C=zt(u)||"Unknown";jo[C]||(jo[C]=!0,i("%s.childContextTypes is specified but there is no getChildContext() method on the instance. You can either define getChildContext() on %s or remove childContextTypes from it.",C,C))}return h}var I=v.getChildContext();for(var H in I)if(!(H in y))throw new Error((zt(u)||"Unknown")+'.getChildContext(): key "'+H+'" is not defined in childContextTypes.');{var K=zt(u)||"Unknown";ap(y,I,"child context",K)}return an({},h,I)}}var Bo;Bo={};var Uc=null,eo=null;function Wc(v){v.context._currentValue=v.parentValue}function Vc(v){v.context._currentValue=v.value}function el(v,u){if(v!==u){Wc(v);var h=v.parent,y=u.parent;if(h===null){if(y!==null)throw new Error("The stacks must reach the root at the same time. This is a bug in React.")}else{if(y===null)throw new Error("The stacks must reach the root at the same time. This is a bug in React.");el(h,y)}Vc(u)}}function tl(v){Wc(v);var u=v.parent;u!==null&&tl(u)}function lp(v){var u=v.parent;u!==null&&lp(u),Vc(v)}function cp(v,u){Wc(v);var h=v.parent;if(h===null)throw new Error("The depth must equal at least at zero before reaching the root. This is a bug in React.");h.depth===u.depth?el(h,u):cp(h,u)}function up(v,u){var h=u.parent;if(h===null)throw new Error("The depth must equal at least at zero before reaching the root. This is a bug in React.");v.depth===h.depth?el(v,h):up(v,h),Vc(u)}function to(v){var u=eo,h=v;u!==h&&(u===null?lp(h):h===null?tl(u):u.depth===h.depth?el(u,h):u.depth>h.depth?cp(u,h):up(u,h),eo=h)}function tf(v,u){var h;h=v._currentValue,v._currentValue=u,v._currentRenderer!==void 0&&v._currentRenderer!==null&&v._currentRenderer!==Bo&&i("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported."),v._currentRenderer=Bo;var y=eo,C={parent:y,depth:y===null?0:y.depth+1,context:v,parentValue:h,value:u};return eo=C,C}function Ev(v){var u=eo;if(u===null)throw new Error("Tried to pop a Context at the root of the app. This is a bug in React.");u.context!==v&&i("The parent context is not the expected context. This is probably a bug in React.");{var h=u.parentValue;h===_v?u.context._currentValue=u.context._defaultValue:u.context._currentValue=h,v._currentRenderer!==void 0&&v._currentRenderer!==null&&v._currentRenderer!==Bo&&i("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported."),v._currentRenderer=Bo}return eo=u.parent}function dp(){return eo}function Hs(v){var u=v._currentValue;return u}function rl(v){return v._reactInternals}function rf(v,u){v._reactInternals=u}var Gc={},Kc={},qc,$s,nl,il,Xc,ol,Yc,Jc,nf;{qc=new Set,$s=new Set,nl=new Set,Yc=new Set,il=new Set,Jc=new Set,nf=new Set;var fp=new Set;ol=function(v,u){if(!(v===null||typeof v=="function")){var h=u+"_"+v;fp.has(h)||(fp.add(h),i("%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.",u,v))}},Xc=function(v,u){if(u===void 0){var h=zt(v)||"Component";il.has(h)||(il.add(h),i("%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.",h))}}}function hp(v,u){{var h=v.constructor,y=h&&zt(h)||"ReactClass",C=y+"."+u;if(Gc[C])return;i(`%s(...): Can only update a mounting component. This usually means you called %s() outside componentWillMount() on the server. This is a no-op.
|
|
397
|
+
|
|
398
|
+
Please check the code for the %s component.`,u,u,y),Gc[C]=!0}}var pp={isMounted:function(v){return!1},enqueueSetState:function(v,u,h){var y=rl(v);y.queue===null?hp(v,"setState"):(y.queue.push(u),h!=null&&ol(h,"setState"))},enqueueReplaceState:function(v,u,h){var y=rl(v);y.replace=!0,y.queue=[u],h!=null&&ol(h,"setState")},enqueueForceUpdate:function(v,u){var h=rl(v);h.queue===null?hp(v,"forceUpdate"):u!=null&&ol(u,"setState")}};function Tv(v,u,h,y,C){var I=h(C,y);Xc(u,I);var H=I==null?y:an({},y,I);return H}function mp(v,u,h){var y=$c,C=v.contextType;if("contextType"in v){var I=C===null||C!==void 0&&C.$$typeof===Ka&&C._context===void 0;if(!I&&!nf.has(v)){nf.add(v);var H="";C===void 0?H=" However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file.":typeof C!="object"?H=" However, it is set to a "+typeof C+".":C.$$typeof===Ga?H=" Did you accidentally pass the Context.Provider instead?":C._context!==void 0?H=" Did you accidentally pass the Context.Consumer instead?":H=" However, it is set to an object with keys {"+Object.keys(C).join(", ")+"}.",i("%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s",zt(v)||"Component",H)}}typeof C=="object"&&C!==null?y=Hs(C):y=h;var K=new v(u,y);{if(typeof v.getDerivedStateFromProps=="function"&&(K.state===null||K.state===void 0)){var se=zt(v)||"Component";qc.has(se)||(qc.add(se),i("`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.",se,K.state===null?"null":"undefined",se))}if(typeof v.getDerivedStateFromProps=="function"||typeof K.getSnapshotBeforeUpdate=="function"){var be=null,Pe=null,je=null;if(typeof K.componentWillMount=="function"&&K.componentWillMount.__suppressDeprecationWarning!==!0?be="componentWillMount":typeof K.UNSAFE_componentWillMount=="function"&&(be="UNSAFE_componentWillMount"),typeof K.componentWillReceiveProps=="function"&&K.componentWillReceiveProps.__suppressDeprecationWarning!==!0?Pe="componentWillReceiveProps":typeof K.UNSAFE_componentWillReceiveProps=="function"&&(Pe="UNSAFE_componentWillReceiveProps"),typeof K.componentWillUpdate=="function"&&K.componentWillUpdate.__suppressDeprecationWarning!==!0?je="componentWillUpdate":typeof K.UNSAFE_componentWillUpdate=="function"&&(je="UNSAFE_componentWillUpdate"),be!==null||Pe!==null||je!==null){var Ke=zt(v)||"Component",st=typeof v.getDerivedStateFromProps=="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";nl.has(Ke)||(nl.add(Ke),i(`Unsafe legacy lifecycles will not be called for components using new component APIs.
|
|
399
|
+
|
|
400
|
+
%s uses %s but also contains the following legacy lifecycles:%s%s%s
|
|
401
|
+
|
|
402
|
+
The above lifecycles should be removed. Learn more about this warning here:
|
|
403
|
+
https://reactjs.org/link/unsafe-component-lifecycles`,Ke,st,be!==null?`
|
|
404
|
+
`+be:"",Pe!==null?`
|
|
405
|
+
`+Pe:"",je!==null?`
|
|
406
|
+
`+je:""))}}}return K}function Av(v,u,h){{var y=zt(u)||"Component",C=v.render;C||(u.prototype&&typeof u.prototype.render=="function"?i("%s(...): No `render` method found on the returned component instance: did you accidentally return an object from the constructor?",y):i("%s(...): No `render` method found on the returned component instance: you may have forgotten to define `render`.",y)),v.getInitialState&&!v.getInitialState.isReactClassApproved&&!v.state&&i("getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?",y),v.getDefaultProps&&!v.getDefaultProps.isReactClassApproved&&i("getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.",y),v.propTypes&&i("propTypes was defined as an instance property on %s. Use a static property to define propTypes instead.",y),v.contextType&&i("contextType was defined as an instance property on %s. Use a static property to define contextType instead.",y),v.contextTypes&&i("contextTypes was defined as an instance property on %s. Use a static property to define contextTypes instead.",y),u.contextType&&u.contextTypes&&!Jc.has(u)&&(Jc.add(u),i("%s declares both contextTypes and contextType static properties. The legacy contextTypes property will be ignored.",y)),typeof v.componentShouldUpdate=="function"&&i("%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.",y),u.prototype&&u.prototype.isPureReactComponent&&typeof v.shouldComponentUpdate<"u"&&i("%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.",zt(u)||"A pure component"),typeof v.componentDidUnmount=="function"&&i("%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?",y),typeof v.componentDidReceiveProps=="function"&&i("%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().",y),typeof v.componentWillRecieveProps=="function"&&i("%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?",y),typeof v.UNSAFE_componentWillRecieveProps=="function"&&i("%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?",y);var I=v.props!==h;v.props!==void 0&&I&&i("%s(...): When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.",y,y),v.defaultProps&&i("Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.",y,y),typeof v.getSnapshotBeforeUpdate=="function"&&typeof v.componentDidUpdate!="function"&&!$s.has(u)&&($s.add(u),i("%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.",zt(u))),typeof v.getDerivedStateFromProps=="function"&&i("%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.",y),typeof v.getDerivedStateFromError=="function"&&i("%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.",y),typeof u.getSnapshotBeforeUpdate=="function"&&i("%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.",y);var H=v.state;H&&(typeof H!="object"||Ir(H))&&i("%s.state: must be set to an object or null",y),typeof v.getChildContext=="function"&&typeof u.childContextTypes!="object"&&i("%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().",y)}}function Rv(v,u){var h=u.state;if(typeof u.componentWillMount=="function"){if(u.componentWillMount.__suppressDeprecationWarning!==!0){var y=zt(v)||"Unknown";Kc[y]||(n(`componentWillMount has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.
|
|
407
|
+
|
|
408
|
+
* Move code from componentWillMount to componentDidMount (preferred in most cases) or the constructor.
|
|
409
|
+
|
|
410
|
+
Please update the following components: %s`,y),Kc[y]=!0)}u.componentWillMount()}typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount(),h!==u.state&&(i("%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",zt(v)||"Component"),pp.enqueueReplaceState(u,u.state,null))}function of(v,u,h,y){if(v.queue!==null&&v.queue.length>0){var C=v.queue,I=v.replace;if(v.queue=null,v.replace=!1,I&&C.length===1)u.state=C[0];else{for(var H=I?C[0]:u.state,K=!0,se=I?1:0;se<C.length;se++){var be=C[se],Pe=typeof be=="function"?be.call(u,H,h,y):be;Pe!=null&&(K?(K=!1,H=an({},H,Pe)):an(H,Pe))}u.state=H}}else v.queue=null}function sl(v,u,h,y){Av(v,u,h);var C=v.state!==void 0?v.state:null;v.updater=pp,v.props=h,v.state=C;var I={queue:[],replace:!1};rf(v,I);var H=u.contextType;if(typeof H=="object"&&H!==null?v.context=Hs(H):v.context=y,v.state===h){var K=zt(u)||"Component";Yc.has(K)||(Yc.add(K),i("%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.",K))}var se=u.getDerivedStateFromProps;typeof se=="function"&&(v.state=Tv(v,u,se,C,h)),typeof u.getDerivedStateFromProps!="function"&&typeof v.getSnapshotBeforeUpdate!="function"&&(typeof v.UNSAFE_componentWillMount=="function"||typeof v.componentWillMount=="function")&&(Rv(u,v),of(I,v,h,y))}var Iv={id:1,overflow:""};function Ov(v){var u=v.overflow,h=v.id,y=h&~Mv(h);return y.toString(32)+u}function sf(v,u,h){var y=v.id,C=v.overflow,I=Zc(y)-1,H=y&~(1<<I),K=h+1,se=Zc(u)+I;if(se>30){var be=I-I%5,Pe=(1<<be)-1,je=(H&Pe).toString(32),Ke=H>>be,st=I-be,kt=Zc(u)+st,mr=K<<st,Go=mr|Ke,Ko=je+C;return{id:1<<kt|Go,overflow:Ko}}else{var Ni=K<<I,Xs=Ni|H,lb=C;return{id:1<<se|Xs,overflow:lb}}}function Zc(v){return 32-Nv(v)}function Mv(v){return 1<<Zc(v)-1}var Nv=Math.clz32?Math.clz32:af,Dv=Math.log,Ri=Math.LN2;function af(v){var u=v>>>0;return u===0?32:31-(Dv(u)/Ri|0)|0}function Qc(v,u){return v===u&&(v!==0||1/v===1/u)||v!==v&&u!==u}var Lt=typeof Object.is=="function"?Object.is:Qc,ln=null,Us=null,zo=null,xt=null,ro=!1,eu=!1,cn=0,un=null,li=0,Pv=25,jn=!1,no;function Ho(){if(ln===null)throw new Error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
411
|
+
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
412
|
+
2. You might be breaking the Rules of Hooks
|
|
413
|
+
3. You might have more than one copy of React in the same app
|
|
414
|
+
See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`);return jn&&i("Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://reactjs.org/link/rules-of-hooks"),ln}function Lv(v,u){if(u===null)return i("%s received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.",no),!1;v.length!==u.length&&i(`The final argument passed to %s changed size between renders. The order and size of this array must remain constant.
|
|
415
|
+
|
|
416
|
+
Previous: %s
|
|
417
|
+
Incoming: %s`,no,"["+v.join(", ")+"]","["+u.join(", ")+"]");for(var h=0;h<u.length&&h<v.length;h++)if(!Lt(v[h],u[h]))return!1;return!0}function lf(){if(li>0)throw new Error("Rendered more hooks than during the previous render");return{memoizedState:null,queue:null,next:null}}function al(){return xt===null?zo===null?(ro=!1,zo=xt=lf()):(ro=!0,xt=zo):xt.next===null?(ro=!1,xt=xt.next=lf()):(ro=!0,xt=xt.next),xt}function Fv(v,u){ln=u,Us=v,jn=!1,cn=0}function jv(v,u,h,y){for(;eu;)eu=!1,cn=0,li+=1,xt=null,h=v(u,y);return cf(),h}function tu(){var v=cn!==0;return v}function cf(){jn=!1,ln=null,Us=null,eu=!1,zo=null,li=0,un=null,xt=null}function gp(v){return jn&&i("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()."),Hs(v)}function yp(v){return no="useContext",Ho(),Hs(v)}function uf(v,u){return typeof u=="function"?u(v):u}function Bv(v){return no="useState",vp(uf,v)}function vp(v,u,h){if(v!==uf&&(no="useReducer"),ln=Ho(),xt=al(),ro){var y=xt.queue,C=y.dispatch;if(un!==null){var I=un.get(y);if(I!==void 0){un.delete(y);var H=xt.memoizedState,K=I;do{var se=K.action;jn=!0,H=v(H,se),jn=!1,K=K.next}while(K!==null);return xt.memoizedState=H,[H,C]}}return[xt.memoizedState,C]}else{jn=!0;var be;v===uf?be=typeof u=="function"?u():u:be=h!==void 0?h(u):u,jn=!1,xt.memoizedState=be;var Pe=xt.queue={last:null,dispatch:null},je=Pe.dispatch=$v.bind(null,ln,Pe);return[xt.memoizedState,je]}}function bp(v,u){ln=Ho(),xt=al();var h=u===void 0?null:u;if(xt!==null){var y=xt.memoizedState;if(y!==null&&h!==null){var C=y[1];if(Lv(h,C))return y[0]}}jn=!0;var I=v();return jn=!1,xt.memoizedState=[I,h],I}function zv(v){ln=Ho(),xt=al();var u=xt.memoizedState;if(u===null){var h={current:v};return Object.seal(h),xt.memoizedState=h,h}else return u}function Hv(v,u){no="useLayoutEffect",i("useLayoutEffect does nothing on the server, because its effect cannot be encoded into the server renderer's output format. This will lead to a mismatch between the initial, non-hydrated UI and the intended UI. To avoid this, useLayoutEffect should only be used in components that render exclusively on the client. See https://reactjs.org/link/uselayouteffect-ssr for common fixes.")}function $v(v,u,h){if(li>=Pv)throw new Error("Too many re-renders. React limits the number of renders to prevent an infinite loop.");if(v===ln){eu=!0;var y={action:h,next:null};un===null&&(un=new Map);var C=un.get(u);if(C===void 0)un.set(u,y);else{for(var I=C;I.next!==null;)I=I.next;I.next=y}}}function Uv(v,u){return bp(function(){return v},u)}function Wv(v,u,h){return Ho(),u(v._source)}function Vv(v,u,h){if(h===void 0)throw new Error("Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.");return h()}function ru(v){return Ho(),v}function wp(){throw new Error("startTransition cannot be called during server rendering.")}function df(){return Ho(),[!1,wp]}function xp(){var v=Us,u=Ov(v.treeContext),h=ll;if(h===null)throw new Error("Invalid hook call. Hooks can only be called inside of the body of a function component.");var y=cn++;return _n(h,u,y)}function nu(){}var iu={readContext:gp,useContext:yp,useMemo:bp,useReducer:vp,useRef:zv,useState:Bv,useInsertionEffect:nu,useLayoutEffect:Hv,useCallback:Uv,useImperativeHandle:nu,useEffect:nu,useDebugValue:nu,useDeferredValue:ru,useTransition:df,useId:xp,useMutableSource:Wv,useSyncExternalStore:Vv},ll=null;function ou(v){ll=v}function Ws(v){try{var u="",h=v;do{switch(h.tag){case 0:u+=Fo(h.type,null,null);break;case 1:u+=Qd(h.type,null,null);break;case 2:u+=sp(h.type,null,null);break}h=h.parent}while(h);return u}catch(y){return`
|
|
418
|
+
Error generating stack: `+y.message+`
|
|
419
|
+
`+y.stack}}var su=r.ReactCurrentDispatcher,au=r.ReactDebugCurrentFrame,lu=0,Vs=1,ff=2,$o=3,Sp=4,Gv=0,Gs=1,Ks=2,Kv=12800;function qv(v){return console.error(v),null}function Uo(){}function cu(v,u,h,y,C,I,H,K,se){var be=[],Pe=new Set,je={destination:null,responseState:u,progressiveChunkSize:y===void 0?Kv:y,status:Gv,fatalError:null,nextSegmentId:0,allPendingTasks:0,pendingRootTasks:0,completedRootSegment:null,abortableTasks:Pe,pingedTasks:be,clientRenderedBoundaries:[],completedBoundaries:[],partialBoundaries:[],onError:C===void 0?qv:C,onAllReady:I===void 0?Uo:I,onShellReady:H===void 0?Uo:H,onShellError:K===void 0?Uo:K,onFatalError:se===void 0?Uo:se},Ke=cl(je,0,null,h,!1,!1);Ke.parentFlushed=!0;var st=Wo(je,v,null,Ke,Pe,$c,Uc,Iv);return be.push(st),je}function Ii(v,u){var h=v.pingedTasks;h.push(u),h.length===1&&s(function(){return kf(v)})}function hf(v,u){return{id:qi,rootSegmentID:-1,parentFlushed:!1,pendingTasks:0,forceClientRender:!1,completedSegments:[],byteSize:0,fallbackAbortableTasks:u,errorDigest:null}}function Wo(v,u,h,y,C,I,H,K){v.allPendingTasks++,h===null?v.pendingRootTasks++:h.pendingTasks++;var se={node:u,ping:function(){return Ii(v,se)},blockedBoundary:h,blockedSegment:y,abortSet:C,legacyContext:I,context:H,treeContext:K};return se.componentStack=null,C.add(se),se}function cl(v,u,h,y,C,I){return{status:lu,id:-1,index:u,parentFlushed:!1,chunks:[],children:[],formatContext:y,boundary:h,lastPushedText:C,textEmbedded:I}}var Oi=null;function ci(){return Oi===null||Oi.componentStack===null?"":Ws(Oi.componentStack)}function Mi(v,u){v.componentStack={tag:0,parent:v.componentStack,type:u}}function uu(v,u){v.componentStack={tag:1,parent:v.componentStack,type:u}}function ul(v,u){v.componentStack={tag:2,parent:v.componentStack,type:u}}function Bn(v){v.componentStack===null?i("Unexpectedly popped too many stack frames. This is a bug in React."):v.componentStack=v.componentStack.parent}var dl=null;function pf(v,u){{var h;typeof u=="string"?h=u:u&&typeof u.message=="string"?h=u.message:h=String(u);var y=dl||ci();dl=null,v.errorMessage=h,v.errorComponentStack=y}}function fl(v,u){var h=v.onError(u);if(h!=null&&typeof h!="string")throw new Error('onError returned something with a type other than "string". onError should return a string and may return null or undefined but must not return anything else. It received something of type "'+typeof h+'" instead');return h}function hl(v,u){var h=v.onShellError;h(u);var y=v.onFatalError;y(u),v.destination!==null?(v.status=Ks,T(v.destination,u)):(v.status=Gs,v.fatalError=u)}function kp(v,u,h){Mi(u,"Suspense");var y=u.blockedBoundary,C=u.blockedSegment,I=h.fallback,H=h.children,K=new Set,se=hf(v,K),be=C.chunks.length,Pe=cl(v,be,se,C.formatContext,!1,!1);C.children.push(Pe),C.lastPushedText=!1;var je=cl(v,0,null,C.formatContext,!1,!1);je.parentFlushed=!0,u.blockedBoundary=se,u.blockedSegment=je;try{if(qs(v,u,H),Mr(je.chunks,v.responseState,je.lastPushedText,je.textEmbedded),je.status=Vs,Vo(se,je),se.pendingTasks===0){Bn(u);return}}catch(st){je.status=Sp,se.forceClientRender=!0,se.errorDigest=fl(v,st),pf(se,st)}finally{u.blockedBoundary=y,u.blockedSegment=C}var Ke=Wo(v,I,y,Pe,K,u.legacyContext,u.context,u.treeContext);Ke.componentStack=u.componentStack,v.pingedTasks.push(Ke),Bn(u)}function Xv(v,u,h,y){Mi(u,h);var C=u.blockedSegment,I=No(C.chunks,h,y,v.responseState,C.formatContext);C.lastPushedText=!1;var H=C.formatContext;C.formatContext=_i(H,h,y),qs(v,u,I),C.formatContext=H,yc(C.chunks,h),C.lastPushedText=!1,Bn(u)}function _p(v){return v.prototype&&v.prototype.isReactComponent}function pl(v,u,h,y,C){var I={};Fv(u,I);var H=h(y,C);return jv(h,y,H,C)}function mf(v,u,h,y,C){var I=h.render();h.props!==C&&(bf||i("It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.",zt(y)||"a component"),bf=!0);{var H=y.childContextTypes;if(H!=null){var K=u.legacyContext,se=ef(h,y,K,H);u.legacyContext=se,Pr(v,u,I),u.legacyContext=K;return}}Pr(v,u,I)}function Cp(v,u,h,y){ul(u,h);var C=Qi(h,u.legacyContext),I=mp(h,y,C);sl(I,h,y,C),mf(v,u,I,h,y),Bn(u)}var gf={},ml={},yf={},vf={},bf=!1,Ep={},Tp=!1,wf=!1,Ap=!1;function Yv(v,u,h,y){var C;if(C=Qi(h,u.legacyContext),uu(u,h),h.prototype&&typeof h.prototype.render=="function"){var I=zt(h)||"Unknown";gf[I]||(i("The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.",I,I),gf[I]=!0)}var H=pl(v,u,h,y,C),K=tu();if(typeof H=="object"&&H!==null&&typeof H.render=="function"&&H.$$typeof===void 0){var se=zt(h)||"Unknown";ml[se]||(i("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.",se,se,se),ml[se]=!0)}if(typeof H=="object"&&H!==null&&typeof H.render=="function"&&H.$$typeof===void 0){{var be=zt(h)||"Unknown";ml[be]||(i("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.",be,be,be),ml[be]=!0)}sl(H,h,y,C),mf(v,u,H,h,y)}else if(Jv(h),K){var Pe=u.treeContext,je=1,Ke=0;u.treeContext=sf(Pe,je,Ke);try{Pr(v,u,H)}finally{u.treeContext=Pe}}else Pr(v,u,H);Bn(u)}function Jv(v){{if(v&&v.childContextTypes&&i("%s(...): childContextTypes cannot be defined on a function component.",v.displayName||v.name||"Component"),v.defaultProps!==void 0){var u=zt(v)||"Unknown";Ep[u]||(i("%s: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.",u),Ep[u]=!0)}if(typeof v.getDerivedStateFromProps=="function"){var h=zt(v)||"Unknown";vf[h]||(i("%s: Function components do not support getDerivedStateFromProps.",h),vf[h]=!0)}if(typeof v.contextType=="object"&&v.contextType!==null){var y=zt(v)||"Unknown";yf[y]||(i("%s: Function components do not support contextType.",y),yf[y]=!0)}}}function Rp(v,u){if(v&&v.defaultProps){var h=an({},u),y=v.defaultProps;for(var C in y)h[C]===void 0&&(h[C]=y[C]);return h}return u}function Zv(v,u,h,y,C){uu(u,h.render);var I=pl(v,u,h.render,y,C),H=tu();if(H){var K=u.treeContext,se=1,be=0;u.treeContext=sf(K,se,be);try{Pr(v,u,I)}finally{u.treeContext=K}}else Pr(v,u,I);Bn(u)}function xf(v,u,h,y,C){var I=h.type,H=Rp(I,y);du(v,u,I,H,C)}function Qv(v,u,h,y){h._context===void 0?h!==h.Consumer&&(Ap||(Ap=!0,i("Rendering <Context> directly is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?"))):h=h._context;var C=y.children;typeof C!="function"&&i("A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it.");var I=Hs(h),H=C(I);Pr(v,u,H)}function dn(v,u,h,y){var C=h._context,I=y.value,H=y.children,K;K=u.context,u.context=tf(C,I),Pr(v,u,H),u.context=Ev(C),K!==u.context&&i("Popping the context provider did not return back to the original snapshot. This is a bug in React.")}function eb(v,u,h,y,C){Mi(u,"Lazy");var I=h._payload,H=h._init,K=H(I),se=Rp(K,y);du(v,u,K,se,C),Bn(u)}function du(v,u,h,y,C){if(typeof h=="function")if(_p(h)){Cp(v,u,h,y);return}else{Yv(v,u,h,y);return}if(typeof h=="string"){Xv(v,u,h,y);return}switch(h){case kv:case Sv:case Dc:case Pc:case Nc:{Pr(v,u,y.children);return}case $d:{Mi(u,"SuspenseList"),Pr(v,u,y.children),Bn(u);return}case rp:throw new Error("ReactDOMServer does not yet support scope components.");case Hd:{kp(v,u,y);return}}if(typeof h=="object"&&h!==null)switch(h.$$typeof){case js:{Zv(v,u,h,y,C);return}case Ud:{xf(v,u,h,y,C);return}case Ga:{dn(v,u,h,y);return}case Ka:{Qv(v,u,h,y);return}case Lc:{eb(v,u,h,y);return}}var I="";throw(h===void 0||typeof h=="object"&&h!==null&&Object.keys(h).length===0)&&(I+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),new Error("Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) "+("but got: "+(h==null?h:typeof h)+"."+I))}function tb(v,u){typeof Symbol=="function"&&v[Symbol.toStringTag]==="Generator"&&(Tp||i("Using Generators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. Keep in mind you might need to polyfill these features for older browsers."),Tp=!0),v.entries===u&&(wf||i("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),wf=!0)}function Pr(v,u,h){try{return rb(v,u,h)}catch(y){throw typeof y=="object"&&y!==null&&typeof y.then=="function"||(dl=dl!==null?dl:ci()),y}}function rb(v,u,h){if(u.node=h,typeof h=="object"&&h!==null){switch(h.$$typeof){case tp:{var y=h,C=y.type,I=y.props,H=y.ref;du(v,u,C,I,H);return}case Mc:throw new Error("Portals are not currently supported by the server renderer. Render them conditionally so that they only appear on the client render.");case Lc:{var K=h,se=K._payload,be=K._init,Pe;try{Pe=be(se)}catch(Ni){throw typeof Ni=="object"&&Ni!==null&&typeof Ni.then=="function"&&Mi(u,"Lazy"),Ni}Pr(v,u,Pe);return}}if(Ir(h)){Ip(v,u,h);return}var je=qa(h);if(je){tb(h,je);var Ke=je.call(h);if(Ke){var st=Ke.next();if(!st.done){var kt=[];do kt.push(st.value),st=Ke.next();while(!st.done);Ip(v,u,kt);return}return}}var mr=Object.prototype.toString.call(h);throw new Error("Objects are not valid as a React child (found: "+(mr==="[object Object]"?"object with keys {"+Object.keys(h).join(", ")+"}":mr)+"). If you meant to render a collection of children, use an array instead.")}if(typeof h=="string"){var Go=u.blockedSegment;Go.lastPushedText=ar(u.blockedSegment.chunks,h,v.responseState,Go.lastPushedText);return}if(typeof h=="number"){var Ko=u.blockedSegment;Ko.lastPushedText=ar(u.blockedSegment.chunks,""+h,v.responseState,Ko.lastPushedText);return}typeof h=="function"&&i("Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render. Or maybe you meant to call this function rather than return it.")}function Ip(v,u,h){for(var y=h.length,C=0;C<y;C++){var I=u.treeContext;u.treeContext=sf(I,y,C);try{qs(v,u,h[C])}finally{u.treeContext=I}}}function Op(v,u,h){var y=u.blockedSegment,C=y.chunks.length,I=cl(v,C,null,y.formatContext,y.lastPushedText,!0);y.children.push(I),y.lastPushedText=!1;var H=Wo(v,u.node,u.blockedBoundary,I,u.abortSet,u.legacyContext,u.context,u.treeContext);u.componentStack!==null&&(H.componentStack=u.componentStack.parent);var K=H.ping;h.then(K,K)}function qs(v,u,h){var y=u.blockedSegment.formatContext,C=u.legacyContext,I=u.context,H=null;H=u.componentStack;try{return Pr(v,u,h)}catch(K){if(cf(),typeof K=="object"&&K!==null&&typeof K.then=="function"){Op(v,u,K),u.blockedSegment.formatContext=y,u.legacyContext=C,u.context=I,to(I),u.componentStack=H;return}else throw u.blockedSegment.formatContext=y,u.legacyContext=C,u.context=I,to(I),u.componentStack=H,K}}function Mp(v,u,h,y){var C=fl(v,y);if(u===null?hl(v,y):(u.pendingTasks--,u.forceClientRender||(u.forceClientRender=!0,u.errorDigest=C,pf(u,y),u.parentFlushed&&v.clientRenderedBoundaries.push(u))),v.allPendingTasks--,v.allPendingTasks===0){var I=v.onAllReady;I()}}function nb(v){var u=this,h=v.blockedBoundary,y=v.blockedSegment;y.status=$o,gl(u,h,y)}function Sf(v,u,h){var y=v.blockedBoundary,C=v.blockedSegment;if(C.status=$o,y===null)u.allPendingTasks--,u.status!==Ks&&(u.status=Ks,u.destination!==null&&g(u.destination));else{if(y.pendingTasks--,!y.forceClientRender){y.forceClientRender=!0;var I=h===void 0?new Error("The render was aborted by the server without a reason."):h;y.errorDigest=u.onError(I);{var H="The server did not finish this Suspense boundary: ";I&&typeof I.message=="string"?I=H+I.message:I=H+String(I);var K=Oi;Oi=v;try{pf(y,I)}finally{Oi=K}}y.parentFlushed&&u.clientRenderedBoundaries.push(y)}if(y.fallbackAbortableTasks.forEach(function(be){return Sf(be,u,h)}),y.fallbackAbortableTasks.clear(),u.allPendingTasks--,u.allPendingTasks===0){var se=u.onAllReady;se()}}}function Vo(v,u){if(u.chunks.length===0&&u.children.length===1&&u.children[0].boundary===null){var h=u.children[0];h.id=u.id,h.parentFlushed=!0,h.status===Vs&&Vo(v,h)}else{var y=v.completedSegments;y.push(u)}}function gl(v,u,h){if(u===null){if(h.parentFlushed){if(v.completedRootSegment!==null)throw new Error("There can only be one root segment. This is a bug in React.");v.completedRootSegment=h}if(v.pendingRootTasks--,v.pendingRootTasks===0){v.onShellError=Uo;var y=v.onShellReady;y()}}else if(u.pendingTasks--,!u.forceClientRender){if(u.pendingTasks===0)h.parentFlushed&&h.status===Vs&&Vo(u,h),u.parentFlushed&&v.completedBoundaries.push(u),u.fallbackAbortableTasks.forEach(nb,v),u.fallbackAbortableTasks.clear();else if(h.parentFlushed&&h.status===Vs){Vo(u,h);var C=u.completedSegments;C.length===1&&u.parentFlushed&&v.partialBoundaries.push(u)}}if(v.allPendingTasks--,v.allPendingTasks===0){var I=v.onAllReady;I()}}function ib(v,u){var h=u.blockedSegment;if(h.status===lu){to(u.context);var y=null;y=Oi,Oi=u;try{Pr(v,u,u.node),Mr(h.chunks,v.responseState,h.lastPushedText,h.textEmbedded),u.abortSet.delete(u),h.status=Vs,gl(v,u.blockedBoundary,h)}catch(I){if(cf(),typeof I=="object"&&I!==null&&typeof I.then=="function"){var C=u.ping;I.then(C,C)}else u.abortSet.delete(u),h.status=Sp,Mp(v,u.blockedBoundary,h,I)}finally{Oi=y}}}function kf(v){if(v.status!==Ks){var u=dp(),h=su.current;su.current=iu;var y;y=au.getCurrentStack,au.getCurrentStack=ci;var C=ll;ou(v.responseState);try{var I=v.pingedTasks,H;for(H=0;H<I.length;H++){var K=I[H];ib(v,K)}I.splice(0,H),v.destination!==null&&_f(v,v.destination)}catch(se){fl(v,se),hl(v,se)}finally{ou(C),su.current=h,au.getCurrentStack=y,h===iu&&to(u)}}}function yl(v,u,h){switch(h.parentFlushed=!0,h.status){case lu:{var y=h.id=v.nextSegmentId++;return h.lastPushedText=!1,h.textEmbedded=!1,vc(u,v.responseState,y)}case Vs:{h.status=ff;for(var C=!0,I=h.chunks,H=0,K=h.children,se=0;se<K.length;se++){for(var be=K[se];H<be.index;H++)f(u,I[H]);C=fu(v,u,be)}for(;H<I.length-1;H++)f(u,I[H]);return H<I.length&&(C=p(u,I[H])),C}default:throw new Error("Aborted, errored or already flushed boundaries should not be flushed again. This is a bug in React.")}}function fu(v,u,h){var y=h.boundary;if(y===null)return yl(v,u,h);if(y.parentFlushed=!0,y.forceClientRender)return Nr(u,v.responseState,y.errorDigest,y.errorMessage,y.errorComponentStack),yl(v,u,h),Bd(u,v.responseState);if(y.pendingTasks>0){y.rootSegmentID=v.nextSegmentId++,y.completedSegments.length>0&&v.partialBoundaries.push(y);var C=y.id=$r(v.responseState);return Ms(u,v.responseState,C),yl(v,u,h),Ns(u,v.responseState)}else{if(y.byteSize>v.progressiveChunkSize)return y.rootSegmentID=v.nextSegmentId++,v.completedBoundaries.push(y),Ms(u,v.responseState,y.id),yl(v,u,h),Ns(u,v.responseState);xc(u,v.responseState);var I=y.completedSegments;if(I.length!==1)throw new Error("A previously unvisited boundary must have exactly one root segment. This is a bug in React.");var H=I[0];return fu(v,u,H),Sc(u,v.responseState)}}function Np(v,u,h){return xv(u,v.responseState,h.id,h.errorDigest,h.errorMessage,h.errorComponentStack)}function hu(v,u,h){return ct(u,v.responseState,h.formatContext,h.id),fu(v,u,h),Dt(u,h.formatContext)}function Dp(v,u,h){for(var y=h.completedSegments,C=0;C<y.length;C++){var I=y[C];Pp(v,u,h,I)}return y.length=0,Qh(u,v.responseState,h.id,h.rootSegmentID)}function ob(v,u,h){for(var y=h.completedSegments,C=0;C<y.length;C++){var I=y[C];if(!Pp(v,u,h,I))return C++,y.splice(0,C),!1}return y.splice(0,C),!0}function Pp(v,u,h,y){if(y.status===ff)return!0;var C=y.id;if(C===-1){var I=y.id=h.rootSegmentID;if(I===-1)throw new Error("A root segment ID must have been assigned by now. This is a bug in React.");return hu(v,u,y)}else return hu(v,u,y),pv(u,v.responseState,C)}function _f(v,u){d();try{var h=v.completedRootSegment;h!==null&&v.pendingRootTasks===0&&(fu(v,u,h),v.completedRootSegment=null,Ld(u,v.responseState));var y=v.clientRenderedBoundaries,C;for(C=0;C<y.length;C++){var I=y[C];Np(v,u,I)}y.splice(0,C);var H=v.completedBoundaries;for(C=0;C<H.length;C++){var K=H[C];Dp(v,u,K)}H.splice(0,C),m(u),d(u);var se=v.partialBoundaries;for(C=0;C<se.length;C++){var be=se[C];if(!ob(v,u,be)){v.destination=null,C++,se.splice(0,C);return}}se.splice(0,C);var Pe=v.completedBoundaries;for(C=0;C<Pe.length;C++){var je=Pe[C];Dp(v,u,je)}Pe.splice(0,C)}finally{m(u),v.allPendingTasks===0&&v.pingedTasks.length===0&&v.clientRenderedBoundaries.length===0&&v.completedBoundaries.length===0&&(v.abortableTasks.size!==0&&i("There was still abortable task at the root when we closed. This is a bug in React."),g(u))}}function Lp(v){s(function(){return kf(v)})}function sb(v,u){if(v.status===Gs){v.status=Ks,T(u,v.fatalError);return}if(v.status!==Ks&&v.destination===null){v.destination=u;try{_f(v,u)}catch(h){fl(v,h),hl(v,h)}}}function Fp(v,u){try{var h=v.abortableTasks;h.forEach(function(y){return Sf(y,v,u)}),h.clear(),v.destination!==null&&_f(v,v.destination)}catch(y){fl(v,y),hl(v,y)}}function ab(v,u){return new Promise(function(h,y){var C,I,H=new Promise(function(Ke,st){I=Ke,C=st});function K(){var Ke=new ReadableStream({type:"bytes",pull:function(st){sb(be,st)},cancel:function(st){Fp(be)}},{highWaterMark:0});Ke.allReady=H,h(Ke)}function se(Ke){H.catch(function(){}),y(Ke)}var be=cu(v,_s(u?u.identifierPrefix:void 0,u?u.nonce:void 0,u?u.bootstrapScriptContent:void 0,u?u.bootstrapScripts:void 0,u?u.bootstrapModules:void 0),ni(u?u.namespaceURI:void 0),u?u.progressiveChunkSize:void 0,u?u.onError:void 0,I,K,se,C);if(u&&u.signal){var Pe=u.signal,je=function(){Fp(be,Pe.reason),Pe.removeEventListener("abort",je)};Pe.addEventListener("abort",je)}Lp(be)})}Cm.renderToReadableStream=ab,Cm.version=e}()),Cm}var tc,m1;process.env.NODE_ENV==="production"?(tc=Hae(),m1=$ae()):(tc=Uae(),m1=Wae());mc.version=tc.version;mc.renderToString=tc.renderToString;mc.renderToStaticMarkup=tc.renderToStaticMarkup;mc.renderToNodeStream=tc.renderToNodeStream;mc.renderToStaticNodeStream=tc.renderToStaticNodeStream;mc.renderToReadableStream=m1.renderToReadableStream;function Vae(t){const e=mc.renderToStaticMarkup(t),i=new DOMParser().parseFromString(e,"image/svg+xml").documentElement,o=["svg",{...Array.from(i.attributes).reduce((s,a)=>(s[a.name]=a.value,s),{})}];return Array.from(i.childNodes).forEach(s=>{if(s.nodeType===1){const a=[s.tagName.toLowerCase(),Array.from(s.attributes).reduce((l,c)=>(l[c.name]=c.value,l),{})];s.textContent&&a.push(s.textContent),o.push(a)}}),o}const Gae={audio:x.jsx(He.LucideAudioLines,{}),video:x.jsx(He.LucideVideo,{}),file:x.jsx(He.LucideFile,{}),image:x.jsx(He.LucideImage,{}),pdf:x.jsx(vN,{}),word:x.jsx(bN,{}),excel:x.jsx(He.LucideSheet,{}),ppt:x.jsx(He.LucideTableProperties,{})};function a2(t,e=!1){const r=z7(t),n=Gae[r]||x.jsx(x.Fragment,{});return e?Vae(n):n}const Kae="_attachment_1x1ms_1",qae="_wrap_1x1ms_2",k0={attachment:Kae,wrap:qae};function Xae({editor:t,node:e,updateAttributes:r,deleteNode:n,extension:i}){var $;const o=J.useRef(),s=Wy(),{hasTrigger:a,fileName:l,fileSize:c,fileExt:d,fileType:f,url:p,error:m}=e.attrs,[g,b]=J.useState(!1),{t:S}=Ct(),w=($=i==null?void 0:i.options)==null?void 0:$.upload,T=J.useCallback(()=>{!s||p||s&&o.current.click()},[s,p]),M=J.useCallback(async W=>{const Y=W.target.files&&W.target.files[0];if(!Y)return;const ee={fileName:j7(Y.name),fileSize:Y.size,fileType:Y.type,fileExt:B7(Y.name)};b(!0);try{const P=await w(Y);r({...ee,url:P}),b(!1)}catch(P){r({error:`File upload fail: ${P&&P.message}`||"Unknown error"}),b(!1),o.current.value=""}},[b,r]);J.useEffect(()=>{!p&&!a&&(T(),r({hasTrigger:!0}))},[p,a,T,r]);const j=J.useCallback(()=>n(),[t]);return s&&!p?x.jsx(gi,{children:x.jsxs("div",{className:Gr(k0.wrap,"render-wrapper"),children:[x.jsx("p",{style:{cursor:"pointer"},onClick:T,children:g?x.jsx("span",{children:S("editor.attachment.uploading")}):x.jsx("span",{children:S("editor.attachment.please_upload")})}),x.jsx("input",{ref:o,type:"file",hidden:!0,onChange:M})]})}):p?x.jsx(gi,{children:x.jsxs("div",{className:Gr(k0.wrap,"render-wrapper"),onClick:T,children:[x.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-[4px]",children:[x.jsx("span",{children:a2(f)}),x.jsxs("span",{children:[l,".",d]}),x.jsxs("span",{children:["(",IM(c),")"]})]}),x.jsx(Ve,{icon:"Trash2",action:j,tooltip:S("editor.delete")})]})}):m!=="null"?x.jsx(gi,{children:x.jsx("div",{className:Gr(k0.wrap,"render-wrapper"),onClick:T,children:x.jsx("p",{children:m})})}):x.jsx(x.Fragment,{})}const Yae=Nt.create({name:"attachment",content:"",marks:"",group:"block",selectable:!0,atom:!0,draggable:!0,addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),HTMLAttributes:{class:"attachment"},button:({editor:e,t:r})=>({component:Ve,componentProps:{action:()=>e.chain().focus().setAttachment().run(),isActive:()=>!1,disabled:!1,icon:"Attachment",tooltip:r("editor.attachment.tooltip")}})}},parseHTML(){return[{tag:"div[class=attachment]"}]},renderHTML({HTMLAttributes:t}){const{url:e="",fileName:r="",fileSize:n="",fileType:i="",fileExt:o=""}=t||{};return["div",lt(this.options.HTMLAttributes||{},t||{}),e?["a",{href:e||"#"},["span",{class:"attachment__icon"},a2(i,!0)],["span",{class:"attachment__text"},`${r}.${o} (${IM(n)})`]]:["div",{class:"attachment__placeholder"}]]},addAttributes(){return{fileName:{default:null,parseHTML:fn("filename")},fileSize:{default:null,parseHTML:fn("filesize")},fileType:{default:null,parseHTML:fn("filetype")},fileExt:{default:null,parseHTML:fn("fileext")},url:{default:null,parseHTML:fn("url")},hasTrigger:{default:!1,parseHTML:t=>fn("hastrigger")(t)==="true"},error:{default:null,parseHTML:fn("error")}}},addCommands(){return{setAttachment:(t={})=>({chain:e})=>e().insertContent({type:this.name,attrs:t}).run()}},addNodeView(){return _o(Xae)}}),Em={TOP_LEFT:"tl",TOP_RIGHT:"tr",BOTTOM_LEFT:"bl",BOTTOM_RIGHT:"br"};function Jae(t){var W,Y;const[e,r]=J.useState({width:nd,height:nd}),[n,i]=J.useState({width:0,height:0}),[o]=J.useState([Em.TOP_LEFT,Em.TOP_RIGHT,Em.BOTTOM_LEFT,Em.BOTTOM_RIGHT]),[s,a]=J.useState(!1),[l,c]=J.useState({x:0,y:0,w:0,h:0,dir:""}),{align:d}=(W=t==null?void 0:t.node)==null?void 0:W.attrs,f=J.useMemo(()=>{var R;const{src:ee,alt:P,width:fe,height:de}=(R=t==null?void 0:t.node)==null?void 0:R.attrs,U=Og(fe)?`${fe}px`:fe,ne=Og(de)?`${de}px`:de;return{src:ee||void 0,alt:P||void 0,style:{width:U||void 0,height:ne||void 0}}},[(Y=t==null?void 0:t.node)==null?void 0:Y.attrs]),p=J.useMemo(()=>{const{style:{width:ee}}=f;return{width:ee==="100%"?ee:void 0}},[f]);function m(ee){i({width:ee.target.width,height:ee.target.height})}function g(){const{editor:ee,getPos:P}=t;ee.commands.setNodeSelection(P())}const b=J.useCallback(Yl(()=>{const{editor:ee}=t,{width:P}=getComputedStyle(ee.view.dom);r(fe=>({...fe,width:Number.parseInt(P,10)}))},id),[t==null?void 0:t.editor]);function S(ee,P){ee.preventDefault(),ee.stopPropagation();const fe=n.width,de=n.height,U=fe/de;let ne=Number(t.node.attrs.width),R=Number(t.node.attrs.height);const le=e.width;ne&&!R?(ne=ne>le?le:ne,R=Math.round(ne/U)):R&&!ne?(ne=Math.round(R*U),ne=ne>le?le:ne):!ne&&!R?(ne=fe>le?le:fe,R=Math.round(ne/U)):ne=ne>le?le:ne,ds.flushSync(()=>{a(!0),c({x:ee.clientX,y:ee.clientY,w:ne,h:R,dir:P})})}const w=J.useCallback(Yl(ee=>{if(ee.preventDefault(),ee.stopPropagation(),!s)return;const{x:P,w:fe,dir:de}=l,U=(ee.clientX-P)*(/l/.test(de)?-1:1),ne=eN(fe+U,dS,e.width);t.updateAttributes({width:ne,height:null})},id),[s,l,e,t.updateAttributes]),T=J.useCallback(ee=>{ee.preventDefault(),ee.stopPropagation(),s&&(ds.flushSync(()=>{c({x:0,y:0,w:0,h:0,dir:""}),a(!1)}),g())},[s,g]),M=J.useCallback(()=>{document==null||document.addEventListener("mousemove",w,!0),document==null||document.addEventListener("mouseup",T,!0)},[w,T]),j=J.useCallback(()=>{document==null||document.removeEventListener("mousemove",w,!0),document==null||document.removeEventListener("mouseup",T,!0)},[w,T]);J.useEffect(()=>(s?M():j(),()=>{j()}),[s,M,j]);const $=J.useMemo(()=>new ResizeObserver(()=>b()),[b]);return J.useEffect(()=>($.observe(t.editor.view.dom),()=>{$.disconnect()}),[t.editor.view.dom,$]),x.jsx(gi,{className:"image-view",style:{...p,width:"100%",textAlign:d},children:x.jsxs("div",{draggable:"true","data-drag-handle":!0,className:`image-view__body ${t!=null&&t.selected?"image-view__body--focused":""} ${s?"image-view__body--resizing":""}`,style:p,children:[x.jsx("img",{src:f.src,alt:f.alt,style:f.style,height:"auto",className:"image-view__body__image block",onLoad:m,onClick:g}),(t==null?void 0:t.editor.view.editable)&&((t==null?void 0:t.selected)||s)&&x.jsx("div",{className:"image-resizer",children:o==null?void 0:o.map(ee=>x.jsx("span",{className:`image-resizer__handler image-resizer__handler--${ee}`,onMouseDown:P=>S(P,ee)},`image-dir-${ee}`))})]})})}function Zae({selectImage:t,giphyApiKey:e,children:r}){const[n,i]=J.useState([]),[o]=J.useState(15),s=J.useRef(null),a=(c,d="search")=>{if(!e)return;const p=`${d==="search"?`https://api.giphy.com/v1/gifs/search?q=${c}`:`https://api.giphy.com/v1/gifs/trending?q=${c}`}&limit=${o}&api_key=${e}`;fetch(p).then(m=>m.json()).then(m=>{i(m.data)}).catch(m=>{console.log(m)})};J.useEffect(()=>{a("","trend")},[]);const l=J.useCallback(Xy(c=>{if(!c.target.value){a("","trend");return}a(c.target.value)},350),[]);return x.jsxs(xi,{modal:!0,children:[x.jsx(Si,{asChild:!0,children:r}),x.jsx(Xn,{hideWhenDetached:!0,className:"richtext-w-full richtext-h-full richtext-p-2",align:"start",side:"bottom",children:e?x.jsxs(x.Fragment,{children:[x.jsx("div",{className:"richtext-w-full richtext-mb-[10px]",children:x.jsx(hn,{ref:s,type:"text",placeholder:"Search GIF",onChange:l})}),x.jsx("div",{className:"richtext-max-h-[280px] richtext-overflow-y-auto",children:x.jsx("div",{className:"richtext-grid richtext-grid-cols-2 richtext-gap-1 ",children:n!=null&&n.length?n==null?void 0:n.map(c=>x.jsx("img",{alt:"giphy",className:"richtext-text-center richtext-cursor-pointer",onClick:d=>t(c),height:c.images.fixed_width_downsampled.height,width:c.images.fixed_width_downsampled.width,src:c.images.fixed_width_downsampled.url},`giphy-${c.id}`)):x.jsx("p",{children:"No GIFs found"})})})]}):x.jsx("div",{children:x.jsx("p",{children:"Missing Giphy API Key"})})})]})}function Qae({editor:t,icon:e,giphyApiKey:r,...n}){const i=o=>{const{url:s}=o.images.original;t.chain().focus().setImageGif({src:s}).run()};return x.jsx(Zae,{selectImage:i,giphyApiKey:r,children:x.jsx(Ve,{tooltip:n==null?void 0:n.tooltip,icon:e})})}const pk=GS.extend({name:"imageGif",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),inline:!1,content:"",marks:"",group:"block",GIPHY_API_KEY:"",draggable:!1,selectable:!0,atom:!0,button:({editor:e,extension:r,t:n})=>{var o;const i=((o=r==null?void 0:r.options)==null?void 0:o.GIPHY_API_KEY)||"";return{component:Qae,componentProps:{editor:e,action:()=>{},isActive:()=>!1,disabled:!1,icon:"GifIcon",tooltip:n("editor.imageGif.tooltip"),giphyApiKey:i}}}}},addAttributes(){var t;return{...(t=this.parent)==null?void 0:t.call(this),width:{default:null,parseHTML:e=>{const r=e.style.width||e.getAttribute("width")||"10";return r===void 0?null:Number.parseInt(`${r}`,10)},renderHTML:e=>({width:e.width})},align:{default:"center",parseHTML:e=>e.getAttribute("align"),renderHTML:e=>({align:e.align})}}},addNodeView(){return _o(Jae)},addCommands(){var t;return{...(t=this.parent)==null?void 0:t.call(this),setImageGif:e=>({commands:r})=>r.insertContent({type:this.name,attrs:e}),updateImageGif:e=>({commands:r})=>r.updateAttributes(this.name,e),setAlignImageGif:e=>({commands:r})=>r.updateAttributes(this.name,{align:e})}},renderHTML({HTMLAttributes:t}){const{align:e}=t;return["div",{style:e?`text-align: ${e};`:"",class:"imageGIf"},["img",lt({height:"auto"},this.options.HTMLAttributes,t)]]},parseHTML(){return[{tag:"div[class=imageGIf]",getAttrs:t=>{const e=t.querySelector("img"),r=e==null?void 0:e.getAttribute("width");return{src:e==null?void 0:e.getAttribute("src"),alt:e==null?void 0:e.getAttribute("alt"),title:e==null?void 0:e.getAttribute("title"),width:r?Number.parseInt(r,10):null,align:(e==null?void 0:e.getAttribute("align"))||t.style.textAlign||null}}}]}}),hR=`graph TB
|
|
420
|
+
a-->b`,ele=({editor:t,upload:e})=>{const[r,n]=J.useState(hR),[i,o]=J.useState(""),[s,a]=J.useState(!1),l=J.useRef(null),c=async p=>{try{const{svg:m}=await Zm.render("mermaid-svg",p);o(m)}catch{o("")}},d=()=>{Zm.initialize({darkMode:!1,startOnLoad:!1,fontSize:12,theme:"base"}),c(r)};J.useEffect(()=>{s&&d()},[s]),J.useEffect(()=>{s&&c(r)},[r]);const f=async()=>{if(r!==""){if(r){const p=l.current.querySelector("svg"),{width:m,height:g}=p.getBoundingClientRect(),b=`mermaid-${RM()}.svg`;let S=AM(p.outerHTML);if(e){const w=hS(S,b);S=await e(w)}t==null||t.chain().focus().setMermaid({type:"mermaid",src:S,alt:encodeURIComponent(r),width:m,height:g},!!r).run()}a(!1)}};return x.jsxs(lc,{open:s,onOpenChange:a,children:[x.jsx(cc,{asChild:!0,children:x.jsx(Ve,{icon:"Mermaid",tooltip:"Mermaid",action:()=>a(!0)})}),x.jsxs(Na,{className:"!richtext-max-w-[1300px] richtext-z-[99999]",children:[x.jsx(Da,{children:"Mermaid"}),x.jsx("div",{style:{height:"100%",borderWidth:1},children:x.jsxs("div",{className:"richtext-flex richtext-gap-[10px] richtext-rounded-[10px] richtext-p-[10px]",children:[x.jsx(Vh,{className:"richtext-flex-1",value:r,onChange:p=>n(p.target.value),autoFocus:!0,required:!0,rows:10,defaultValue:hR,placeholder:"Text",style:{color:"hsl(var(--richtext-foreground))"}}),x.jsx("div",{className:"richtext-flex-1 richtext-flex richtext-items-center richtext-justify-center richtext-rounded-[10px] richtext-p-[10px]",style:{height:"100%",borderWidth:1,minHeight:500,background:"#fff"},ref:l,dangerouslySetInnerHTML:{__html:i}})]})}),x.jsx(_d,{children:x.jsx(Mt,{type:"button",onClick:f,children:"Save changes"})})]})]})},Tm={TOP_LEFT:"tl",TOP_RIGHT:"tr",BOTTOM_LEFT:"bl",BOTTOM_RIGHT:"br"};function tle({editor:t,node:e,updateAttributes:r,getPos:n,selected:i}){const[o,s]=J.useState({width:nd,height:nd}),[a,l]=J.useState({width:0,height:0}),[c]=J.useState([Tm.TOP_LEFT,Tm.TOP_RIGHT,Tm.BOTTOM_LEFT,Tm.BOTTOM_RIGHT]),[d,f]=J.useState(!1),[p,m]=J.useState({x:0,y:0,w:0,h:0,dir:""}),{align:g}=e==null?void 0:e.attrs,b=J.useMemo(()=>{const{src:fe,alt:de,width:U,height:ne}=e==null?void 0:e.attrs,R=U0(U)?`${U}px`:U,le=U0(ne)?`${ne}px`:ne;return{src:fe||void 0,alt:de||void 0,style:{width:R||void 0,height:le||void 0}}},[e==null?void 0:e.attrs]),S=J.useMemo(()=>{const{style:{width:fe}}=b;return{width:fe==="100%"?fe:void 0}},[b]);function w(fe){l({width:fe.target.width,height:fe.target.height})}function T(){t.commands.setNodeSelection(n())}const M=J.useCallback(Yl(()=>{const{width:fe}=getComputedStyle(t.view.dom);s(de=>({...de,width:Number.parseInt(fe,10)}))},id),[t]);function j(fe,de){fe.preventDefault(),fe.stopPropagation();const U=a.width,ne=a.height,R=U/ne;let le=Number(e.attrs.width),Ee=Number(e.attrs.height);const he=o.width;le&&!Ee?(le=le>he?he:le,Ee=Math.round(le/R)):Ee&&!le?(le=Math.round(Ee*R),le=le>he?he:le):!le&&!Ee?(le=U>he?he:U,Ee=Math.round(le/R)):le=le>he?he:le,ds.flushSync(()=>{f(!0),m({x:fe.clientX,y:fe.clientY,w:le,h:Ee,dir:de})})}const $=J.useCallback(Yl(fe=>{if(fe.preventDefault(),fe.stopPropagation(),!d)return;const{x:de,w:U,dir:ne}=p,R=(fe.clientX-de)*(/l/.test(ne)?-1:1),le=SM(U+R,dS,o.width);r({width:le,height:null})},id),[d,p,o,r]),W=J.useCallback(fe=>{fe.preventDefault(),fe.stopPropagation(),d&&(ds.flushSync(()=>{m({x:0,y:0,w:0,h:0,dir:""}),f(!1)}),T())},[d,T]),Y=J.useCallback(()=>{document==null||document.addEventListener("mousemove",$,!0),document==null||document.addEventListener("mouseup",W,!0)},[$,W]),ee=J.useCallback(()=>{document==null||document.removeEventListener("mousemove",$,!0),document==null||document.removeEventListener("mouseup",W,!0)},[$,W]);J.useEffect(()=>(d?Y():ee(),()=>{ee()}),[d,Y,ee]);const P=J.useMemo(()=>new ResizeObserver(()=>M()),[M]);return J.useEffect(()=>(P.observe(t.view.dom),()=>{P.disconnect()}),[t.view.dom,P]),x.jsx(gi,{className:"image-view",style:{...S,width:"100%",textAlign:g},children:x.jsxs("div",{draggable:"true","data-drag-handle":!0,className:`image-view__body ${i?"image-view__body--focused":""} ${d?"image-view__body--resizing":""}`,style:{...S,background:"#fff"},children:[x.jsx("img",{src:b.src,alt:b.alt,style:b.style,height:"auto",className:"image-view__body__image block",onLoad:w,onClick:T}),t.view.editable&&(i||d)&&x.jsx("div",{className:"image-resizer",children:c==null?void 0:c.map(fe=>x.jsx("span",{className:`image-resizer__handler image-resizer__handler--${fe}`,onMouseDown:de=>j(de,fe)},`image-dir-${fe}`))})]})})}const g1=GS.extend({name:"mermaid",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),inline:!1,content:"",marks:"",group:"block",draggable:!1,selectable:!0,atom:!0,HTMLAttributes:{class:"mermaid"},button:({editor:e,t:r,extension:n})=>{var i;return{component:ele,componentProps:{action:()=>{},isActive:()=>!1,disabled:!1,editor:e,icon:"Mermaid",tooltip:r("editor.mermaid.tooltip"),upload:(i=n==null?void 0:n.options)==null?void 0:i.upload}}}}},addAttributes(){var t;return{...(t=this.parent)==null?void 0:t.call(this),width:{default:null,parseHTML:e=>{const r=e.style.width||e.getAttribute("width")||"10";return r===void 0?null:Number.parseInt(`${r}`,10)},renderHTML:e=>({width:e.width})},height:{default:null,parseHTML:e=>{const r=e.style.height||e.getAttribute("height")||"10";return r===void 0?null:Number.parseInt(`${r}`,10)},renderHTML:e=>({height:e.height})},align:{default:"center",parseHTML:e=>e.getAttribute("align"),renderHTML:e=>({align:e.align})}}},addNodeView(){return _o(tle)},addCommands(){return{setMermaid:(t,e)=>({commands:r,editor:n})=>e?r.insertContent({type:this.name,attrs:t}):r.insertContentAt(n.state.selection.anchor,{type:this.name,attrs:t}),setAlignImageMermaid:t=>({commands:e})=>e.updateAttributes(this.name,{align:t})}},renderHTML({HTMLAttributes:t}){const{align:e}=t;return["div",{style:e?`text-align: ${e};`:"",class:"imageMermaid"},["img",lt(this.options.HTMLAttributes,t)]]},parseHTML(){return[{tag:"div[class=imageMermaid]",getAttrs:t=>{const e=t.querySelector("img"),r=e==null?void 0:e.getAttribute("width"),n=e==null?void 0:e.getAttribute("height");return{src:e==null?void 0:e.getAttribute("src"),alt:e==null?void 0:e.getAttribute("alt"),width:r?Number.parseInt(r,10):null,height:n?Number.parseInt(n,10):null,align:(e==null?void 0:e.getAttribute("align"))||t.style.textAlign||null}}}]}});function rle(){var o;const t=J.useRef({editor:null}),[e,r]=J.useState(!1),[n,i]=J.useState(null);return J.useEffect(()=>{var s;(s=t.current)!=null&&s.editor&&(r(!0),i(t.current.editor))},[t,(o=t.current)==null?void 0:o.editor]),{isReady:e,editor:n,editorRef:t}}exports.Attachment=Yae;exports.BaseKit=yJ;exports.Blockquote=eY;exports.Bold=zq;exports.BubbleMenu=qn;exports.BulletList=UX;exports.Clear=WX;exports.Code=rX;exports.CodeBlock=fD;exports.Color=LX;exports.Column=rv;exports.ColumnActionButton=fJ;exports.Emoji=UQ;exports.Excalidraw=Tl;exports.ExportPdf=YQ;exports.ExportWord=bae;exports.FontFamily=_X;exports.FontSize=MX;exports.FormatPainter=dQ;exports.Heading=TX;exports.Highlight=zX;exports.History=HY;exports.HorizontalRule=AY;exports.Iframe=Al;exports.Image=RD;exports.ImageGif=pk;exports.ImportWord=eee;exports.Indent=xJ;exports.Italic=Gq;exports.Katex=Nl;exports.LineHeight=TJ;exports.Link=EY;exports.Mention=zae;exports.Mermaid=g1;exports.MoreMark=wJ;exports.MultiColumn=dd;exports.OrderedList=KX;exports.SearchAndReplace=zD;exports.SlashCommand=PJ;exports.Strike=Zq;exports.SubAndSuperScript=vJ;exports.Table=uQ;exports.TableOfContents=s2;exports.TaskList=JX;exports.TextAlign=IX;exports.TextDirection=Oae;exports.Twitter=Ag;exports.Underline=qq;exports.Video=ID;exports.default=qV;exports.en=dM;exports.hu_HU=mM;exports.locale=QH;exports.pt_BR=fM;exports.useEditorState=rle;exports.vi=hM;exports.zh_CN=pM;
|