@harbour-enterprises/superdoc 0.12.5 → 0.12.7

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.
Files changed (43) hide show
  1. package/dist/chunks/super-editor.es-BMTopH0N.cjs +455 -0
  2. package/dist/chunks/{super-editor.es-uFc1kYwr.es.js → super-editor.es-CvWf9Igx.es.js} +9157 -8920
  3. package/dist/core/SuperDoc.d.ts.map +1 -1
  4. package/dist/style.css +1 -1
  5. package/dist/super-editor/ai-writer.es.js +2 -2
  6. package/dist/super-editor/chunks/{converter-Cid1Ewvn.js → converter-DPOXB8vR.js} +1585 -1519
  7. package/dist/super-editor/chunks/{docx-zipper-CldOGPZ9.js → docx-zipper-DTjI-Z4r.js} +1 -1
  8. package/dist/super-editor/chunks/{editor-DfsXlTev.js → editor-aYSWfnOz.js} +5467 -5308
  9. package/dist/super-editor/chunks/{toolbar-1h7-NG3P.js → toolbar-B5CeHdmH.js} +964 -958
  10. package/dist/super-editor/components/toolbar/defaultItems.d.ts.map +1 -1
  11. package/dist/super-editor/components/toolbar/super-toolbar.d.ts.map +1 -1
  12. package/dist/super-editor/converter.es.js +1 -1
  13. package/dist/super-editor/core/Editor.d.ts +21 -3
  14. package/dist/super-editor/core/Editor.d.ts.map +1 -1
  15. package/dist/super-editor/core/commands/setMark.d.ts +2 -1
  16. package/dist/super-editor/core/commands/setMark.d.ts.map +1 -1
  17. package/dist/super-editor/core/commands/unsetAllMarks.d.ts +2 -1
  18. package/dist/super-editor/core/commands/unsetAllMarks.d.ts.map +1 -1
  19. package/dist/super-editor/core/commands/unsetMark.d.ts +2 -1
  20. package/dist/super-editor/core/commands/unsetMark.d.ts.map +1 -1
  21. package/dist/super-editor/core/helpers/annotator.d.ts +18 -1
  22. package/dist/super-editor/core/helpers/annotator.d.ts.map +1 -1
  23. package/dist/super-editor/core/super-converter/SuperConverter.d.ts +4 -1
  24. package/dist/super-editor/core/super-converter/SuperConverter.d.ts.map +1 -1
  25. package/dist/super-editor/core/super-converter/exporter.d.ts.map +1 -1
  26. package/dist/super-editor/core/super-converter/helpers.d.ts +1 -0
  27. package/dist/super-editor/core/super-converter/helpers.d.ts.map +1 -1
  28. package/dist/super-editor/docx-zipper.es.js +2 -2
  29. package/dist/super-editor/editor.es.js +3 -3
  30. package/dist/super-editor/extensions/pagination/pagination-helpers.d.ts +15 -0
  31. package/dist/super-editor/extensions/pagination/pagination-helpers.d.ts.map +1 -1
  32. package/dist/super-editor/file-zipper.es.js +1 -1
  33. package/dist/super-editor/style.css +1 -1
  34. package/dist/super-editor/super-editor.es.js +271 -264
  35. package/dist/super-editor/toolbar.es.js +2 -2
  36. package/dist/super-editor.cjs +1 -1
  37. package/dist/super-editor.es.js +8 -8
  38. package/dist/superdoc.cjs +5 -5
  39. package/dist/superdoc.es.js +4 -4
  40. package/dist/superdoc.umd.js +9230 -8990
  41. package/dist/superdoc.umd.js.map +1 -1
  42. package/package.json +1 -1
  43. package/dist/chunks/super-editor.es-Bqp77LuU.cjs +0 -455
@@ -0,0 +1,455 @@
1
+ "use strict";const Yr=require("yjs"),w=require("./vue-BQCc2YbW.cjs");function ES(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const Ee=ES(Yr);var TS=Object.defineProperty,sb=t=>{throw TypeError(t)},$S=(t,e,n)=>e in t?TS(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ta=(t,e,n)=>$S(t,typeof e!="symbol"?e+"":e,n),OS=(t,e,n)=>e.has(t)||sb("Cannot "+n),ab=(t,e,n)=>e.has(t)?sb("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Dn=(t,e,n)=>(OS(t,e,"access private method"),n),zt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof w.global<"u"?w.global:typeof self<"u"?self:{};function Wl(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function MS(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var o=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return t[r]}})}),n}var wt={},Gl={};Gl.byteLength=NS;Gl.toByteArray=FS;Gl.fromByteArray=LS;var _n=[],pn=[],DS=typeof Uint8Array<"u"?Uint8Array:Array,Sc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var To=0,_S=Sc.length;To<_S;++To)_n[To]=Sc[To],pn[Sc.charCodeAt(To)]=To;pn[45]=62;pn[95]=63;function lb(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");n===-1&&(n=e);var r=n===e?0:4-n%4;return[n,r]}function NS(t){var e=lb(t),n=e[0],r=e[1];return(n+r)*3/4-r}function IS(t,e,n){return(e+n)*3/4-n}function FS(t){var e,n=lb(t),r=n[0],o=n[1],i=new DS(IS(t,r,o)),s=0,a=o>0?r-4:r,l;for(l=0;l<a;l+=4)e=pn[t.charCodeAt(l)]<<18|pn[t.charCodeAt(l+1)]<<12|pn[t.charCodeAt(l+2)]<<6|pn[t.charCodeAt(l+3)],i[s++]=e>>16&255,i[s++]=e>>8&255,i[s++]=e&255;return o===2&&(e=pn[t.charCodeAt(l)]<<2|pn[t.charCodeAt(l+1)]>>4,i[s++]=e&255),o===1&&(e=pn[t.charCodeAt(l)]<<10|pn[t.charCodeAt(l+1)]<<4|pn[t.charCodeAt(l+2)]>>2,i[s++]=e>>8&255,i[s++]=e&255),i}function RS(t){return _n[t>>18&63]+_n[t>>12&63]+_n[t>>6&63]+_n[t&63]}function BS(t,e,n){for(var r,o=[],i=e;i<n;i+=3)r=(t[i]<<16&16711680)+(t[i+1]<<8&65280)+(t[i+2]&255),o.push(RS(r));return o.join("")}function LS(t){for(var e,n=t.length,r=n%3,o=[],i=16383,s=0,a=n-r;s<a;s+=i)o.push(BS(t,s,s+i>a?a:s+i));return r===1?(e=t[n-1],o.push(_n[e>>2]+_n[e<<4&63]+"==")):r===2&&(e=(t[n-2]<<8)+t[n-1],o.push(_n[e>>10]+_n[e>>4&63]+_n[e<<2&63]+"=")),o.join("")}var Wp={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */Wp.read=function(t,e,n,r,o){var i,s,a=o*8-r-1,l=(1<<a)-1,c=l>>1,u=-7,d=n?o-1:0,p=n?-1:1,f=t[e+d];for(d+=p,i=f&(1<<-u)-1,f>>=-u,u+=a;u>0;i=i*256+t[e+d],d+=p,u-=8);for(s=i&(1<<-u)-1,i>>=-u,u+=r;u>0;s=s*256+t[e+d],d+=p,u-=8);if(i===0)i=1-c;else{if(i===l)return s?NaN:(f?-1:1)*(1/0);s=s+Math.pow(2,r),i=i-c}return(f?-1:1)*s*Math.pow(2,i-r)};Wp.write=function(t,e,n,r,o,i){var s,a,l,c=i*8-o-1,u=(1<<c)-1,d=u>>1,p=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:i-1,h=r?1:-1,m=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=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),s+d>=1?e+=p/l:e+=p*Math.pow(2,1-d),e*l>=2&&(s++,l/=2),s+d>=u?(a=0,s=u):s+d>=1?(a=(e*l-1)*Math.pow(2,o),s=s+d):(a=e*Math.pow(2,d-1)*Math.pow(2,o),s=0));o>=8;t[n+f]=a&255,f+=h,a/=256,o-=8);for(s=s<<o|a,c+=o;c>0;t[n+f]=s&255,f+=h,s/=256,c-=8);t[n+f-h]|=m*128};/*!
2
+ * The buffer module from node.js, for the browser.
3
+ *
4
+ * @author Feross Aboukhadijeh <https://feross.org>
5
+ * @license MIT
6
+ */(function(t){const e=Gl,n=Wp,r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=C,t.INSPECT_MAX_BYTES=50;const o=2147483647;t.kMaxLength=o;const{Uint8Array:i,ArrayBuffer:s,SharedArrayBuffer:a}=globalThis;u.TYPED_ARRAY_SUPPORT=l(),!u.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 l(){try{const x=new i(1),O={foo:function(){return 42}};return Object.setPrototypeOf(O,i.prototype),Object.setPrototypeOf(x,O),x.foo()===42}catch{return!1}}Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}});function c(x){if(x>o)throw new RangeError('The value "'+x+'" is invalid for option "size"');const O=new i(x);return Object.setPrototypeOf(O,u.prototype),O}function u(x,O,_){if(typeof x=="number"){if(typeof O=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return h(x)}return d(x,O,_)}u.poolSize=8192;function d(x,O,_){if(typeof x=="string")return m(x,O);if(s.isView(x))return g(x);if(x==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof x);if(he(x,s)||x&&he(x.buffer,s)||typeof a<"u"&&(he(x,a)||x&&he(x.buffer,a)))return v(x,O,_);if(typeof x=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const P=x.valueOf&&x.valueOf();if(P!=null&&P!==x)return u.from(P,O,_);const B=k(x);if(B)return B;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof x[Symbol.toPrimitive]=="function")return u.from(x[Symbol.toPrimitive]("string"),O,_);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof x)}u.from=function(x,O,_){return d(x,O,_)},Object.setPrototypeOf(u.prototype,i.prototype),Object.setPrototypeOf(u,i);function p(x){if(typeof x!="number")throw new TypeError('"size" argument must be of type number');if(x<0)throw new RangeError('The value "'+x+'" is invalid for option "size"')}function f(x,O,_){return p(x),x<=0?c(x):O!==void 0?typeof _=="string"?c(x).fill(O,_):c(x).fill(O):c(x)}u.alloc=function(x,O,_){return f(x,O,_)};function h(x){return p(x),c(x<0?0:b(x)|0)}u.allocUnsafe=function(x){return h(x)},u.allocUnsafeSlow=function(x){return h(x)};function m(x,O){if((typeof O!="string"||O==="")&&(O="utf8"),!u.isEncoding(O))throw new TypeError("Unknown encoding: "+O);const _=D(x,O)|0;let P=c(_);const B=P.write(x,O);return B!==_&&(P=P.slice(0,B)),P}function y(x){const O=x.length<0?0:b(x.length)|0,_=c(O);for(let P=0;P<O;P+=1)_[P]=x[P]&255;return _}function g(x){if(he(x,i)){const O=new i(x);return v(O.buffer,O.byteOffset,O.byteLength)}return y(x)}function v(x,O,_){if(O<0||x.byteLength<O)throw new RangeError('"offset" is outside of buffer bounds');if(x.byteLength<O+(_||0))throw new RangeError('"length" is outside of buffer bounds');let P;return O===void 0&&_===void 0?P=new i(x):_===void 0?P=new i(x,O):P=new i(x,O,_),Object.setPrototypeOf(P,u.prototype),P}function k(x){if(u.isBuffer(x)){const O=b(x.length)|0,_=c(O);return _.length===0||x.copy(_,0,0,O),_}if(x.length!==void 0)return typeof x.length!="number"||be(x.length)?c(0):y(x);if(x.type==="Buffer"&&Array.isArray(x.data))return y(x.data)}function b(x){if(x>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return x|0}function C(x){return+x!=x&&(x=0),u.alloc(+x)}u.isBuffer=function(x){return x!=null&&x._isBuffer===!0&&x!==u.prototype},u.compare=function(x,O){if(he(x,i)&&(x=u.from(x,x.offset,x.byteLength)),he(O,i)&&(O=u.from(O,O.offset,O.byteLength)),!u.isBuffer(x)||!u.isBuffer(O))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(x===O)return 0;let _=x.length,P=O.length;for(let B=0,U=Math.min(_,P);B<U;++B)if(x[B]!==O[B]){_=x[B],P=O[B];break}return _<P?-1:P<_?1:0},u.isEncoding=function(x){switch(String(x).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}},u.concat=function(x,O){if(!Array.isArray(x))throw new TypeError('"list" argument must be an Array of Buffers');if(x.length===0)return u.alloc(0);let _;if(O===void 0)for(O=0,_=0;_<x.length;++_)O+=x[_].length;const P=u.allocUnsafe(O);let B=0;for(_=0;_<x.length;++_){let U=x[_];if(he(U,i))B+U.length>P.length?(u.isBuffer(U)||(U=u.from(U)),U.copy(P,B)):i.prototype.set.call(P,U,B);else if(u.isBuffer(U))U.copy(P,B);else throw new TypeError('"list" argument must be an Array of Buffers');B+=U.length}return P};function D(x,O){if(u.isBuffer(x))return x.length;if(s.isView(x)||he(x,s))return x.byteLength;if(typeof x!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof x);const _=x.length,P=arguments.length>2&&arguments[2]===!0;if(!P&&_===0)return 0;let B=!1;for(;;)switch(O){case"ascii":case"latin1":case"binary":return _;case"utf8":case"utf-8":return de(x).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _*2;case"hex":return _>>>1;case"base64":return me(x).length;default:if(B)return P?-1:de(x).length;O=(""+O).toLowerCase(),B=!0}}u.byteLength=D;function M(x,O,_){let P=!1;if((O===void 0||O<0)&&(O=0),O>this.length||((_===void 0||_>this.length)&&(_=this.length),_<=0)||(_>>>=0,O>>>=0,_<=O))return"";for(x||(x="utf8");;)switch(x){case"hex":return R(this,O,_);case"utf8":case"utf-8":return W(this,O,_);case"ascii":return ue(this,O,_);case"latin1":case"binary":return Z(this,O,_);case"base64":return ie(this,O,_);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ee(this,O,_);default:if(P)throw new TypeError("Unknown encoding: "+x);x=(x+"").toLowerCase(),P=!0}}u.prototype._isBuffer=!0;function I(x,O,_){const P=x[O];x[O]=x[_],x[_]=P}u.prototype.swap16=function(){const x=this.length;if(x%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let O=0;O<x;O+=2)I(this,O,O+1);return this},u.prototype.swap32=function(){const x=this.length;if(x%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let O=0;O<x;O+=4)I(this,O,O+3),I(this,O+1,O+2);return this},u.prototype.swap64=function(){const x=this.length;if(x%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let O=0;O<x;O+=8)I(this,O,O+7),I(this,O+1,O+6),I(this,O+2,O+5),I(this,O+3,O+4);return this},u.prototype.toString=function(){const x=this.length;return x===0?"":arguments.length===0?W(this,0,x):M.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(x){if(!u.isBuffer(x))throw new TypeError("Argument must be a Buffer");return this===x?!0:u.compare(this,x)===0},u.prototype.inspect=function(){let x="";const O=t.INSPECT_MAX_BYTES;return x=this.toString("hex",0,O).replace(/(.{2})/g,"$1 ").trim(),this.length>O&&(x+=" ... "),"<Buffer "+x+">"},r&&(u.prototype[r]=u.prototype.inspect),u.prototype.compare=function(x,O,_,P,B){if(he(x,i)&&(x=u.from(x,x.offset,x.byteLength)),!u.isBuffer(x))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof x);if(O===void 0&&(O=0),_===void 0&&(_=x?x.length:0),P===void 0&&(P=0),B===void 0&&(B=this.length),O<0||_>x.length||P<0||B>this.length)throw new RangeError("out of range index");if(P>=B&&O>=_)return 0;if(P>=B)return-1;if(O>=_)return 1;if(O>>>=0,_>>>=0,P>>>=0,B>>>=0,this===x)return 0;let U=B-P,te=_-O;const ge=Math.min(U,te),xe=this.slice(P,B),ke=x.slice(O,_);for(let Oe=0;Oe<ge;++Oe)if(xe[Oe]!==ke[Oe]){U=xe[Oe],te=ke[Oe];break}return U<te?-1:te<U?1:0};function E(x,O,_,P,B){if(x.length===0)return-1;if(typeof _=="string"?(P=_,_=0):_>2147483647?_=2147483647:_<-2147483648&&(_=-2147483648),_=+_,be(_)&&(_=B?0:x.length-1),_<0&&(_=x.length+_),_>=x.length){if(B)return-1;_=x.length-1}else if(_<0)if(B)_=0;else return-1;if(typeof O=="string"&&(O=u.from(O,P)),u.isBuffer(O))return O.length===0?-1:G(x,O,_,P,B);if(typeof O=="number")return O=O&255,typeof i.prototype.indexOf=="function"?B?i.prototype.indexOf.call(x,O,_):i.prototype.lastIndexOf.call(x,O,_):G(x,[O],_,P,B);throw new TypeError("val must be string, number or Buffer")}function G(x,O,_,P,B){let U=1,te=x.length,ge=O.length;if(P!==void 0&&(P=String(P).toLowerCase(),P==="ucs2"||P==="ucs-2"||P==="utf16le"||P==="utf-16le")){if(x.length<2||O.length<2)return-1;U=2,te/=2,ge/=2,_/=2}function xe(Oe,Ne){return U===1?Oe[Ne]:Oe.readUInt16BE(Ne*U)}let ke;if(B){let Oe=-1;for(ke=_;ke<te;ke++)if(xe(x,ke)===xe(O,Oe===-1?0:ke-Oe)){if(Oe===-1&&(Oe=ke),ke-Oe+1===ge)return Oe*U}else Oe!==-1&&(ke-=ke-Oe),Oe=-1}else for(_+ge>te&&(_=te-ge),ke=_;ke>=0;ke--){let Oe=!0;for(let Ne=0;Ne<ge;Ne++)if(xe(x,ke+Ne)!==xe(O,Ne)){Oe=!1;break}if(Oe)return ke}return-1}u.prototype.includes=function(x,O,_){return this.indexOf(x,O,_)!==-1},u.prototype.indexOf=function(x,O,_){return E(this,x,O,_,!0)},u.prototype.lastIndexOf=function(x,O,_){return E(this,x,O,_,!1)};function oe(x,O,_,P){_=Number(_)||0;const B=x.length-_;P?(P=Number(P),P>B&&(P=B)):P=B;const U=O.length;P>U/2&&(P=U/2);let te;for(te=0;te<P;++te){const ge=parseInt(O.substr(te*2,2),16);if(be(ge))return te;x[_+te]=ge}return te}function N(x,O,_,P){return we(de(O,x.length-_),x,_,P)}function H(x,O,_,P){return we(fe(O),x,_,P)}function A(x,O,_,P){return we(me(O),x,_,P)}function J(x,O,_,P){return we(ae(O,x.length-_),x,_,P)}u.prototype.write=function(x,O,_,P){if(O===void 0)P="utf8",_=this.length,O=0;else if(_===void 0&&typeof O=="string")P=O,_=this.length,O=0;else if(isFinite(O))O=O>>>0,isFinite(_)?(_=_>>>0,P===void 0&&(P="utf8")):(P=_,_=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const B=this.length-O;if((_===void 0||_>B)&&(_=B),x.length>0&&(_<0||O<0)||O>this.length)throw new RangeError("Attempt to write outside buffer bounds");P||(P="utf8");let U=!1;for(;;)switch(P){case"hex":return oe(this,x,O,_);case"utf8":case"utf-8":return N(this,x,O,_);case"ascii":case"latin1":case"binary":return H(this,x,O,_);case"base64":return A(this,x,O,_);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return J(this,x,O,_);default:if(U)throw new TypeError("Unknown encoding: "+P);P=(""+P).toLowerCase(),U=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ie(x,O,_){return O===0&&_===x.length?e.fromByteArray(x):e.fromByteArray(x.slice(O,_))}function W(x,O,_){_=Math.min(x.length,_);const P=[];let B=O;for(;B<_;){const U=x[B];let te=null,ge=U>239?4:U>223?3:U>191?2:1;if(B+ge<=_){let xe,ke,Oe,Ne;switch(ge){case 1:U<128&&(te=U);break;case 2:xe=x[B+1],(xe&192)===128&&(Ne=(U&31)<<6|xe&63,Ne>127&&(te=Ne));break;case 3:xe=x[B+1],ke=x[B+2],(xe&192)===128&&(ke&192)===128&&(Ne=(U&15)<<12|(xe&63)<<6|ke&63,Ne>2047&&(Ne<55296||Ne>57343)&&(te=Ne));break;case 4:xe=x[B+1],ke=x[B+2],Oe=x[B+3],(xe&192)===128&&(ke&192)===128&&(Oe&192)===128&&(Ne=(U&15)<<18|(xe&63)<<12|(ke&63)<<6|Oe&63,Ne>65535&&Ne<1114112&&(te=Ne))}}te===null?(te=65533,ge=1):te>65535&&(te-=65536,P.push(te>>>10&1023|55296),te=56320|te&1023),P.push(te),B+=ge}return X(P)}const ce=4096;function X(x){const O=x.length;if(O<=ce)return String.fromCharCode.apply(String,x);let _="",P=0;for(;P<O;)_+=String.fromCharCode.apply(String,x.slice(P,P+=ce));return _}function ue(x,O,_){let P="";_=Math.min(x.length,_);for(let B=O;B<_;++B)P+=String.fromCharCode(x[B]&127);return P}function Z(x,O,_){let P="";_=Math.min(x.length,_);for(let B=O;B<_;++B)P+=String.fromCharCode(x[B]);return P}function R(x,O,_){const P=x.length;(!O||O<0)&&(O=0),(!_||_<0||_>P)&&(_=P);let B="";for(let U=O;U<_;++U)B+=ze[x[U]];return B}function ee(x,O,_){const P=x.slice(O,_);let B="";for(let U=0;U<P.length-1;U+=2)B+=String.fromCharCode(P[U]+P[U+1]*256);return B}u.prototype.slice=function(x,O){const _=this.length;x=~~x,O=O===void 0?_:~~O,x<0?(x+=_,x<0&&(x=0)):x>_&&(x=_),O<0?(O+=_,O<0&&(O=0)):O>_&&(O=_),O<x&&(O=x);const P=this.subarray(x,O);return Object.setPrototypeOf(P,u.prototype),P};function ne(x,O,_){if(x%1!==0||x<0)throw new RangeError("offset is not uint");if(x+O>_)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUintLE=u.prototype.readUIntLE=function(x,O,_){x=x>>>0,O=O>>>0,_||ne(x,O,this.length);let P=this[x],B=1,U=0;for(;++U<O&&(B*=256);)P+=this[x+U]*B;return P},u.prototype.readUintBE=u.prototype.readUIntBE=function(x,O,_){x=x>>>0,O=O>>>0,_||ne(x,O,this.length);let P=this[x+--O],B=1;for(;O>0&&(B*=256);)P+=this[x+--O]*B;return P},u.prototype.readUint8=u.prototype.readUInt8=function(x,O){return x=x>>>0,O||ne(x,1,this.length),this[x]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(x,O){return x=x>>>0,O||ne(x,2,this.length),this[x]|this[x+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(x,O){return x=x>>>0,O||ne(x,2,this.length),this[x]<<8|this[x+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(x,O){return x=x>>>0,O||ne(x,4,this.length),(this[x]|this[x+1]<<8|this[x+2]<<16)+this[x+3]*16777216},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(x,O){return x=x>>>0,O||ne(x,4,this.length),this[x]*16777216+(this[x+1]<<16|this[x+2]<<8|this[x+3])},u.prototype.readBigUInt64LE=Ce(function(x){x=x>>>0,Q(x,"offset");const O=this[x],_=this[x+7];(O===void 0||_===void 0)&&z(x,this.length-8);const P=O+this[++x]*2**8+this[++x]*2**16+this[++x]*2**24,B=this[++x]+this[++x]*2**8+this[++x]*2**16+_*2**24;return BigInt(P)+(BigInt(B)<<BigInt(32))}),u.prototype.readBigUInt64BE=Ce(function(x){x=x>>>0,Q(x,"offset");const O=this[x],_=this[x+7];(O===void 0||_===void 0)&&z(x,this.length-8);const P=O*2**24+this[++x]*2**16+this[++x]*2**8+this[++x],B=this[++x]*2**24+this[++x]*2**16+this[++x]*2**8+_;return(BigInt(P)<<BigInt(32))+BigInt(B)}),u.prototype.readIntLE=function(x,O,_){x=x>>>0,O=O>>>0,_||ne(x,O,this.length);let P=this[x],B=1,U=0;for(;++U<O&&(B*=256);)P+=this[x+U]*B;return B*=128,P>=B&&(P-=Math.pow(2,8*O)),P},u.prototype.readIntBE=function(x,O,_){x=x>>>0,O=O>>>0,_||ne(x,O,this.length);let P=O,B=1,U=this[x+--P];for(;P>0&&(B*=256);)U+=this[x+--P]*B;return B*=128,U>=B&&(U-=Math.pow(2,8*O)),U},u.prototype.readInt8=function(x,O){return x=x>>>0,O||ne(x,1,this.length),this[x]&128?(255-this[x]+1)*-1:this[x]},u.prototype.readInt16LE=function(x,O){x=x>>>0,O||ne(x,2,this.length);const _=this[x]|this[x+1]<<8;return _&32768?_|4294901760:_},u.prototype.readInt16BE=function(x,O){x=x>>>0,O||ne(x,2,this.length);const _=this[x+1]|this[x]<<8;return _&32768?_|4294901760:_},u.prototype.readInt32LE=function(x,O){return x=x>>>0,O||ne(x,4,this.length),this[x]|this[x+1]<<8|this[x+2]<<16|this[x+3]<<24},u.prototype.readInt32BE=function(x,O){return x=x>>>0,O||ne(x,4,this.length),this[x]<<24|this[x+1]<<16|this[x+2]<<8|this[x+3]},u.prototype.readBigInt64LE=Ce(function(x){x=x>>>0,Q(x,"offset");const O=this[x],_=this[x+7];(O===void 0||_===void 0)&&z(x,this.length-8);const P=this[x+4]+this[x+5]*2**8+this[x+6]*2**16+(_<<24);return(BigInt(P)<<BigInt(32))+BigInt(O+this[++x]*2**8+this[++x]*2**16+this[++x]*2**24)}),u.prototype.readBigInt64BE=Ce(function(x){x=x>>>0,Q(x,"offset");const O=this[x],_=this[x+7];(O===void 0||_===void 0)&&z(x,this.length-8);const P=(O<<24)+this[++x]*2**16+this[++x]*2**8+this[++x];return(BigInt(P)<<BigInt(32))+BigInt(this[++x]*2**24+this[++x]*2**16+this[++x]*2**8+_)}),u.prototype.readFloatLE=function(x,O){return x=x>>>0,O||ne(x,4,this.length),n.read(this,x,!0,23,4)},u.prototype.readFloatBE=function(x,O){return x=x>>>0,O||ne(x,4,this.length),n.read(this,x,!1,23,4)},u.prototype.readDoubleLE=function(x,O){return x=x>>>0,O||ne(x,8,this.length),n.read(this,x,!0,52,8)},u.prototype.readDoubleBE=function(x,O){return x=x>>>0,O||ne(x,8,this.length),n.read(this,x,!1,52,8)};function se(x,O,_,P,B,U){if(!u.isBuffer(x))throw new TypeError('"buffer" argument must be a Buffer instance');if(O>B||O<U)throw new RangeError('"value" argument is out of bounds');if(_+P>x.length)throw new RangeError("Index out of range")}u.prototype.writeUintLE=u.prototype.writeUIntLE=function(x,O,_,P){if(x=+x,O=O>>>0,_=_>>>0,!P){const te=Math.pow(2,8*_)-1;se(this,x,O,_,te,0)}let B=1,U=0;for(this[O]=x&255;++U<_&&(B*=256);)this[O+U]=x/B&255;return O+_},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(x,O,_,P){if(x=+x,O=O>>>0,_=_>>>0,!P){const te=Math.pow(2,8*_)-1;se(this,x,O,_,te,0)}let B=_-1,U=1;for(this[O+B]=x&255;--B>=0&&(U*=256);)this[O+B]=x/U&255;return O+_},u.prototype.writeUint8=u.prototype.writeUInt8=function(x,O,_){return x=+x,O=O>>>0,_||se(this,x,O,1,255,0),this[O]=x&255,O+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(x,O,_){return x=+x,O=O>>>0,_||se(this,x,O,2,65535,0),this[O]=x&255,this[O+1]=x>>>8,O+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(x,O,_){return x=+x,O=O>>>0,_||se(this,x,O,2,65535,0),this[O]=x>>>8,this[O+1]=x&255,O+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(x,O,_){return x=+x,O=O>>>0,_||se(this,x,O,4,4294967295,0),this[O+3]=x>>>24,this[O+2]=x>>>16,this[O+1]=x>>>8,this[O]=x&255,O+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(x,O,_){return x=+x,O=O>>>0,_||se(this,x,O,4,4294967295,0),this[O]=x>>>24,this[O+1]=x>>>16,this[O+2]=x>>>8,this[O+3]=x&255,O+4};function Y(x,O,_,P,B){re(O,P,B,x,_,7);let U=Number(O&BigInt(4294967295));x[_++]=U,U=U>>8,x[_++]=U,U=U>>8,x[_++]=U,U=U>>8,x[_++]=U;let te=Number(O>>BigInt(32)&BigInt(4294967295));return x[_++]=te,te=te>>8,x[_++]=te,te=te>>8,x[_++]=te,te=te>>8,x[_++]=te,_}function $(x,O,_,P,B){re(O,P,B,x,_,7);let U=Number(O&BigInt(4294967295));x[_+7]=U,U=U>>8,x[_+6]=U,U=U>>8,x[_+5]=U,U=U>>8,x[_+4]=U;let te=Number(O>>BigInt(32)&BigInt(4294967295));return x[_+3]=te,te=te>>8,x[_+2]=te,te=te>>8,x[_+1]=te,te=te>>8,x[_]=te,_+8}u.prototype.writeBigUInt64LE=Ce(function(x,O=0){return Y(this,x,O,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeBigUInt64BE=Ce(function(x,O=0){return $(this,x,O,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeIntLE=function(x,O,_,P){if(x=+x,O=O>>>0,!P){const ge=Math.pow(2,8*_-1);se(this,x,O,_,ge-1,-ge)}let B=0,U=1,te=0;for(this[O]=x&255;++B<_&&(U*=256);)x<0&&te===0&&this[O+B-1]!==0&&(te=1),this[O+B]=(x/U>>0)-te&255;return O+_},u.prototype.writeIntBE=function(x,O,_,P){if(x=+x,O=O>>>0,!P){const ge=Math.pow(2,8*_-1);se(this,x,O,_,ge-1,-ge)}let B=_-1,U=1,te=0;for(this[O+B]=x&255;--B>=0&&(U*=256);)x<0&&te===0&&this[O+B+1]!==0&&(te=1),this[O+B]=(x/U>>0)-te&255;return O+_},u.prototype.writeInt8=function(x,O,_){return x=+x,O=O>>>0,_||se(this,x,O,1,127,-128),x<0&&(x=255+x+1),this[O]=x&255,O+1},u.prototype.writeInt16LE=function(x,O,_){return x=+x,O=O>>>0,_||se(this,x,O,2,32767,-32768),this[O]=x&255,this[O+1]=x>>>8,O+2},u.prototype.writeInt16BE=function(x,O,_){return x=+x,O=O>>>0,_||se(this,x,O,2,32767,-32768),this[O]=x>>>8,this[O+1]=x&255,O+2},u.prototype.writeInt32LE=function(x,O,_){return x=+x,O=O>>>0,_||se(this,x,O,4,2147483647,-2147483648),this[O]=x&255,this[O+1]=x>>>8,this[O+2]=x>>>16,this[O+3]=x>>>24,O+4},u.prototype.writeInt32BE=function(x,O,_){return x=+x,O=O>>>0,_||se(this,x,O,4,2147483647,-2147483648),x<0&&(x=4294967295+x+1),this[O]=x>>>24,this[O+1]=x>>>16,this[O+2]=x>>>8,this[O+3]=x&255,O+4},u.prototype.writeBigInt64LE=Ce(function(x,O=0){return Y(this,x,O,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),u.prototype.writeBigInt64BE=Ce(function(x,O=0){return $(this,x,O,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function T(x,O,_,P,B,U){if(_+P>x.length)throw new RangeError("Index out of range");if(_<0)throw new RangeError("Index out of range")}function K(x,O,_,P,B){return O=+O,_=_>>>0,B||T(x,O,_,4),n.write(x,O,_,P,23,4),_+4}u.prototype.writeFloatLE=function(x,O,_){return K(this,x,O,!0,_)},u.prototype.writeFloatBE=function(x,O,_){return K(this,x,O,!1,_)};function q(x,O,_,P,B){return O=+O,_=_>>>0,B||T(x,O,_,8),n.write(x,O,_,P,52,8),_+8}u.prototype.writeDoubleLE=function(x,O,_){return q(this,x,O,!0,_)},u.prototype.writeDoubleBE=function(x,O,_){return q(this,x,O,!1,_)},u.prototype.copy=function(x,O,_,P){if(!u.isBuffer(x))throw new TypeError("argument should be a Buffer");if(_||(_=0),!P&&P!==0&&(P=this.length),O>=x.length&&(O=x.length),O||(O=0),P>0&&P<_&&(P=_),P===_||x.length===0||this.length===0)return 0;if(O<0)throw new RangeError("targetStart out of bounds");if(_<0||_>=this.length)throw new RangeError("Index out of range");if(P<0)throw new RangeError("sourceEnd out of bounds");P>this.length&&(P=this.length),x.length-O<P-_&&(P=x.length-O+_);const B=P-_;return this===x&&typeof i.prototype.copyWithin=="function"?this.copyWithin(O,_,P):i.prototype.set.call(x,this.subarray(_,P),O),B},u.prototype.fill=function(x,O,_,P){if(typeof x=="string"){if(typeof O=="string"?(P=O,O=0,_=this.length):typeof _=="string"&&(P=_,_=this.length),P!==void 0&&typeof P!="string")throw new TypeError("encoding must be a string");if(typeof P=="string"&&!u.isEncoding(P))throw new TypeError("Unknown encoding: "+P);if(x.length===1){const U=x.charCodeAt(0);(P==="utf8"&&U<128||P==="latin1")&&(x=U)}}else typeof x=="number"?x=x&255:typeof x=="boolean"&&(x=Number(x));if(O<0||this.length<O||this.length<_)throw new RangeError("Out of range index");if(_<=O)return this;O=O>>>0,_=_===void 0?this.length:_>>>0,x||(x=0);let B;if(typeof x=="number")for(B=O;B<_;++B)this[B]=x;else{const U=u.isBuffer(x)?x:u.from(x,P),te=U.length;if(te===0)throw new TypeError('The value "'+x+'" is invalid for argument "value"');for(B=0;B<_-O;++B)this[B+O]=U[B%te]}return this};const F={};function L(x,O,_){F[x]=class extends _{constructor(){super(),Object.defineProperty(this,"message",{value:O.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${x}]`,this.stack,delete this.name}get code(){return x}set code(P){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:P,writable:!0})}toString(){return`${this.name} [${x}]: ${this.message}`}}}L("ERR_BUFFER_OUT_OF_BOUNDS",function(x){return x?`${x} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),L("ERR_INVALID_ARG_TYPE",function(x,O){return`The "${x}" argument must be of type number. Received type ${typeof O}`},TypeError),L("ERR_OUT_OF_RANGE",function(x,O,_){let P=`The value of "${x}" is out of range.`,B=_;return Number.isInteger(_)&&Math.abs(_)>2**32?B=le(String(_)):typeof _=="bigint"&&(B=String(_),(_>BigInt(2)**BigInt(32)||_<-(BigInt(2)**BigInt(32)))&&(B=le(B)),B+="n"),P+=` It must be ${O}. Received ${B}`,P},RangeError);function le(x){let O="",_=x.length;const P=x[0]==="-"?1:0;for(;_>=P+4;_-=3)O=`_${x.slice(_-3,_)}${O}`;return`${x.slice(0,_)}${O}`}function S(x,O,_){Q(O,"offset"),(x[O]===void 0||x[O+_]===void 0)&&z(O,x.length-(_+1))}function re(x,O,_,P,B,U){if(x>_||x<O){const te=typeof O=="bigint"?"n":"";let ge;throw O===0||O===BigInt(0)?ge=`>= 0${te} and < 2${te} ** ${(U+1)*8}${te}`:ge=`>= -(2${te} ** ${(U+1)*8-1}${te}) and < 2 ** ${(U+1)*8-1}${te}`,new F.ERR_OUT_OF_RANGE("value",ge,x)}S(P,B,U)}function Q(x,O){if(typeof x!="number")throw new F.ERR_INVALID_ARG_TYPE(O,"number",x)}function z(x,O,_){throw Math.floor(x)!==x?(Q(x,_),new F.ERR_OUT_OF_RANGE("offset","an integer",x)):O<0?new F.ERR_BUFFER_OUT_OF_BOUNDS:new F.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${O}`,x)}const V=/[^+/0-9A-Za-z-_]/g;function j(x){if(x=x.split("=")[0],x=x.trim().replace(V,""),x.length<2)return"";for(;x.length%4!==0;)x=x+"=";return x}function de(x,O){O=O||1/0;let _;const P=x.length;let B=null;const U=[];for(let te=0;te<P;++te){if(_=x.charCodeAt(te),_>55295&&_<57344){if(!B){if(_>56319){(O-=3)>-1&&U.push(239,191,189);continue}else if(te+1===P){(O-=3)>-1&&U.push(239,191,189);continue}B=_;continue}if(_<56320){(O-=3)>-1&&U.push(239,191,189),B=_;continue}_=(B-55296<<10|_-56320)+65536}else B&&(O-=3)>-1&&U.push(239,191,189);if(B=null,_<128){if((O-=1)<0)break;U.push(_)}else if(_<2048){if((O-=2)<0)break;U.push(_>>6|192,_&63|128)}else if(_<65536){if((O-=3)<0)break;U.push(_>>12|224,_>>6&63|128,_&63|128)}else if(_<1114112){if((O-=4)<0)break;U.push(_>>18|240,_>>12&63|128,_>>6&63|128,_&63|128)}else throw new Error("Invalid code point")}return U}function fe(x){const O=[];for(let _=0;_<x.length;++_)O.push(x.charCodeAt(_)&255);return O}function ae(x,O){let _,P,B;const U=[];for(let te=0;te<x.length&&!((O-=2)<0);++te)_=x.charCodeAt(te),P=_>>8,B=_%256,U.push(B),U.push(P);return U}function me(x){return e.toByteArray(j(x))}function we(x,O,_,P){let B;for(B=0;B<P&&!(B+_>=O.length||B>=x.length);++B)O[B+_]=x[B];return B}function he(x,O){return x instanceof O||x!=null&&x.constructor!=null&&x.constructor.name!=null&&x.constructor.name===O.name}function be(x){return x!==x}const ze=function(){const x="0123456789abcdef",O=new Array(256);for(let _=0;_<16;++_){const P=_*16;for(let B=0;B<16;++B)O[P+B]=x[_]+x[B]}return O}();function Ce(x){return typeof BigInt>"u"?ct:x}function ct(){throw new Error("BigInt not supported")}})(wt);const mt=wt.Buffer,PS=wt.Blob,zS=wt.BlobOptions,jS=wt.Buffer,qS=wt.File,VS=wt.FileOptions,US=wt.INSPECT_MAX_BYTES,HS=wt.SlowBuffer,WS=wt.TranscodeEncoding,GS=wt.atob,KS=wt.btoa,JS=wt.constants,XS=wt.isAscii,YS=wt.isUtf8,ZS=wt.kMaxLength,QS=wt.kStringMaxLength,eA=wt.resolveObjectURL,tA=wt.transcode,nA=Object.freeze(Object.defineProperty({__proto__:null,Blob:PS,BlobOptions:zS,Buffer:jS,File:qS,FileOptions:VS,INSPECT_MAX_BYTES:US,SlowBuffer:HS,TranscodeEncoding:WS,atob:GS,btoa:KS,constants:JS,default:mt,isAscii:XS,isUtf8:YS,kMaxLength:ZS,kStringMaxLength:QS,resolveObjectURL:eA,transcode:tA},Symbol.toStringTag,{value:"Module"}));var cb={},na={exports:{}},fh;function Gp(){if(fh)return na.exports;fh=1;var t=typeof Reflect=="object"?Reflect:null,e=t&&typeof t.apply=="function"?t.apply:function(b,C,D){return Function.prototype.apply.call(b,C,D)},n;t&&typeof t.ownKeys=="function"?n=t.ownKeys:Object.getOwnPropertySymbols?n=function(b){return Object.getOwnPropertyNames(b).concat(Object.getOwnPropertySymbols(b))}:n=function(b){return Object.getOwnPropertyNames(b)};function r(b){console&&console.warn&&console.warn(b)}var o=Number.isNaN||function(b){return b!==b};function i(){i.init.call(this)}na.exports=i,na.exports.once=g,i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var s=10;function a(b){if(typeof b!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof b)}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(b){if(typeof b!="number"||b<0||o(b))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+b+".");s=b}}),i.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},i.prototype.setMaxListeners=function(b){if(typeof b!="number"||b<0||o(b))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+b+".");return this._maxListeners=b,this};function l(b){return b._maxListeners===void 0?i.defaultMaxListeners:b._maxListeners}i.prototype.getMaxListeners=function(){return l(this)},i.prototype.emit=function(b){for(var C=[],D=1;D<arguments.length;D++)C.push(arguments[D]);var M=b==="error",I=this._events;if(I!==void 0)M=M&&I.error===void 0;else if(!M)return!1;if(M){var E;if(C.length>0&&(E=C[0]),E instanceof Error)throw E;var G=new Error("Unhandled error."+(E?" ("+E.message+")":""));throw G.context=E,G}var oe=I[b];if(oe===void 0)return!1;if(typeof oe=="function")e(oe,this,C);else for(var N=oe.length,H=h(oe,N),D=0;D<N;++D)e(H[D],this,C);return!0};function c(b,C,D,M){var I,E,G;if(a(D),E=b._events,E===void 0?(E=b._events=Object.create(null),b._eventsCount=0):(E.newListener!==void 0&&(b.emit("newListener",C,D.listener?D.listener:D),E=b._events),G=E[C]),G===void 0)G=E[C]=D,++b._eventsCount;else if(typeof G=="function"?G=E[C]=M?[D,G]:[G,D]:M?G.unshift(D):G.push(D),I=l(b),I>0&&G.length>I&&!G.warned){G.warned=!0;var oe=new Error("Possible EventEmitter memory leak detected. "+G.length+" "+String(C)+" listeners added. Use emitter.setMaxListeners() to increase limit");oe.name="MaxListenersExceededWarning",oe.emitter=b,oe.type=C,oe.count=G.length,r(oe)}return b}i.prototype.addListener=function(b,C){return c(this,b,C,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(b,C){return c(this,b,C,!0)};function u(){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 d(b,C,D){var M={fired:!1,wrapFn:void 0,target:b,type:C,listener:D},I=u.bind(M);return I.listener=D,M.wrapFn=I,I}i.prototype.once=function(b,C){return a(C),this.on(b,d(this,b,C)),this},i.prototype.prependOnceListener=function(b,C){return a(C),this.prependListener(b,d(this,b,C)),this},i.prototype.removeListener=function(b,C){var D,M,I,E,G;if(a(C),M=this._events,M===void 0)return this;if(D=M[b],D===void 0)return this;if(D===C||D.listener===C)--this._eventsCount===0?this._events=Object.create(null):(delete M[b],M.removeListener&&this.emit("removeListener",b,D.listener||C));else if(typeof D!="function"){for(I=-1,E=D.length-1;E>=0;E--)if(D[E]===C||D[E].listener===C){G=D[E].listener,I=E;break}if(I<0)return this;I===0?D.shift():m(D,I),D.length===1&&(M[b]=D[0]),M.removeListener!==void 0&&this.emit("removeListener",b,G||C)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(b){var C,D,M;if(D=this._events,D===void 0)return this;if(D.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):D[b]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete D[b]),this;if(arguments.length===0){var I=Object.keys(D),E;for(M=0;M<I.length;++M)E=I[M],E!=="removeListener"&&this.removeAllListeners(E);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(C=D[b],typeof C=="function")this.removeListener(b,C);else if(C!==void 0)for(M=C.length-1;M>=0;M--)this.removeListener(b,C[M]);return this};function p(b,C,D){var M=b._events;if(M===void 0)return[];var I=M[C];return I===void 0?[]:typeof I=="function"?D?[I.listener||I]:[I]:D?y(I):h(I,I.length)}i.prototype.listeners=function(b){return p(this,b,!0)},i.prototype.rawListeners=function(b){return p(this,b,!1)},i.listenerCount=function(b,C){return typeof b.listenerCount=="function"?b.listenerCount(C):f.call(b,C)},i.prototype.listenerCount=f;function f(b){var C=this._events;if(C!==void 0){var D=C[b];if(typeof D=="function")return 1;if(D!==void 0)return D.length}return 0}i.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]};function h(b,C){for(var D=new Array(C),M=0;M<C;++M)D[M]=b[M];return D}function m(b,C){for(;C+1<b.length;C++)b[C]=b[C+1];b.pop()}function y(b){for(var C=new Array(b.length),D=0;D<C.length;++D)C[D]=b[D].listener||b[D];return C}function g(b,C){return new Promise(function(D,M){function I(G){b.removeListener(C,E),M(G)}function E(){typeof b.removeListener=="function"&&b.removeListener("error",I),D([].slice.call(arguments))}k(b,C,E,{once:!0}),C!=="error"&&v(b,I,{once:!0})})}function v(b,C,D){typeof b.on=="function"&&k(b,"error",C,D)}function k(b,C,D,M){if(typeof b.on=="function")M.once?b.once(C,D):b.on(C,D);else if(typeof b.addEventListener=="function")b.addEventListener(C,function I(E){M.once&&b.removeEventListener(C,I),D(E)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof b)}return na.exports}var Ac={exports:{}},hh;function ko(){return hh||(hh=1,typeof Object.create=="function"?Ac.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:Ac.exports=function(t,e){if(e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}}),Ac.exports}function rA(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ub={exports:{}},dt=ub.exports={},Tn,$n;function wd(){throw new Error("setTimeout has not been defined")}function bd(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Tn=setTimeout:Tn=wd}catch{Tn=wd}try{typeof clearTimeout=="function"?$n=clearTimeout:$n=bd}catch{$n=bd}})();function db(t){if(Tn===setTimeout)return setTimeout(t,0);if((Tn===wd||!Tn)&&setTimeout)return Tn=setTimeout,setTimeout(t,0);try{return Tn(t,0)}catch{try{return Tn.call(null,t,0)}catch{return Tn.call(this,t,0)}}}function oA(t){if($n===clearTimeout)return clearTimeout(t);if(($n===bd||!$n)&&clearTimeout)return $n=clearTimeout,clearTimeout(t);try{return $n(t)}catch{try{return $n.call(null,t)}catch{return $n.call(this,t)}}}var Zn=[],Go=!1,Zr,Fa=-1;function iA(){!Go||!Zr||(Go=!1,Zr.length?Zn=Zr.concat(Zn):Fa=-1,Zn.length&&pb())}function pb(){if(!Go){var t=db(iA);Go=!0;for(var e=Zn.length;e;){for(Zr=Zn,Zn=[];++Fa<e;)Zr&&Zr[Fa].run();Fa=-1,e=Zn.length}Zr=null,Go=!1,oA(t)}}dt.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];Zn.push(new fb(t,e)),Zn.length===1&&!Go&&db(pb)};function fb(t,e){this.fun=t,this.array=e}fb.prototype.run=function(){this.fun.apply(null,this.array)};dt.title="browser";dt.browser=!0;dt.env={};dt.argv=[];dt.version="";dt.versions={};function ar(){}dt.on=ar;dt.addListener=ar;dt.once=ar;dt.off=ar;dt.removeListener=ar;dt.removeAllListeners=ar;dt.emit=ar;dt.prependListener=ar;dt.prependOnceListener=ar;dt.listeners=function(t){return[]};dt.binding=function(t){throw new Error("process.binding is not supported")};dt.cwd=function(){return"/"};dt.chdir=function(t){throw new Error("process.chdir is not supported")};dt.umask=function(){return 0};var sA=ub.exports;const Se=rA(sA);var mh,gh;function hb(){return gh||(gh=1,mh=Gp().EventEmitter),mh}const Kl=MS(nA);var yh={},wh={},bh,vh;function mb(){return vh||(vh=1,bh=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},e=Symbol("test"),n=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var r=42;t[e]=r;for(var o in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var i=Object.getOwnPropertySymbols(t);if(i.length!==1||i[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(t,e);if(s.value!==r||s.enumerable!==!0)return!1}return!0}),bh}var Cc,xh;function Jl(){if(xh)return Cc;xh=1;var t=mb();return Cc=function(){return t()&&!!Symbol.toStringTag},Cc}var kh,Sh;function gb(){return Sh||(Sh=1,kh=Object),kh}var Ah,Ch;function aA(){return Ch||(Ch=1,Ah=Error),Ah}var Eh,Th;function lA(){return Th||(Th=1,Eh=EvalError),Eh}var $h,Oh;function cA(){return Oh||(Oh=1,$h=RangeError),$h}var Mh,Dh;function uA(){return Dh||(Dh=1,Mh=ReferenceError),Mh}var _h,Nh;function yb(){return Nh||(Nh=1,_h=SyntaxError),_h}var Ih,Fh;function Ps(){return Fh||(Fh=1,Ih=TypeError),Ih}var Rh,Bh;function dA(){return Bh||(Bh=1,Rh=URIError),Rh}var Lh,Ph;function pA(){return Ph||(Ph=1,Lh=Math.abs),Lh}var zh,jh;function fA(){return jh||(jh=1,zh=Math.floor),zh}var qh,Vh;function hA(){return Vh||(Vh=1,qh=Math.max),qh}var Uh,Hh;function mA(){return Hh||(Hh=1,Uh=Math.min),Uh}var Wh,Gh;function gA(){return Gh||(Gh=1,Wh=Math.pow),Wh}var Kh,Jh;function yA(){return Jh||(Jh=1,Kh=Math.round),Kh}var Xh,Yh;function wA(){return Yh||(Yh=1,Xh=Number.isNaN||function(t){return t!==t}),Xh}var Ec,Zh;function bA(){if(Zh)return Ec;Zh=1;var t=wA();return Ec=function(e){return t(e)||e===0?e:e<0?-1:1},Ec}var Qh,em;function vA(){return em||(em=1,Qh=Object.getOwnPropertyDescriptor),Qh}var Tc,tm;function bi(){if(tm)return Tc;tm=1;var t=vA();if(t)try{t([],"length")}catch{t=null}return Tc=t,Tc}var $c,nm;function Xl(){if(nm)return $c;nm=1;var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch{t=!1}return $c=t,$c}var Oc,rm;function xA(){if(rm)return Oc;rm=1;var t=typeof Symbol<"u"&&Symbol,e=mb();return Oc=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},Oc}var om,im;function wb(){return im||(im=1,om=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),om}var Mc,sm;function bb(){if(sm)return Mc;sm=1;var t=gb();return Mc=t.getPrototypeOf||null,Mc}var Dc,am;function kA(){if(am)return Dc;am=1;var t="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,n=Math.max,r="[object Function]",o=function(a,l){for(var c=[],u=0;u<a.length;u+=1)c[u]=a[u];for(var d=0;d<l.length;d+=1)c[d+a.length]=l[d];return c},i=function(a,l){for(var c=[],u=l,d=0;u<a.length;u+=1,d+=1)c[d]=a[u];return c},s=function(a,l){for(var c="",u=0;u<a.length;u+=1)c+=a[u],u+1<a.length&&(c+=l);return c};return Dc=function(a){var l=this;if(typeof l!="function"||e.apply(l)!==r)throw new TypeError(t+l);for(var c=i(arguments,1),u,d=function(){if(this instanceof u){var y=l.apply(this,o(c,arguments));return Object(y)===y?y:this}return l.apply(a,o(c,arguments))},p=n(0,l.length-c.length),f=[],h=0;h<p;h++)f[h]="$"+h;if(u=Function("binder","return function ("+s(f,",")+"){ return binder.apply(this,arguments); }")(d),l.prototype){var m=function(){};m.prototype=l.prototype,u.prototype=new m,m.prototype=null}return u},Dc}var _c,lm;function zs(){if(lm)return _c;lm=1;var t=kA();return _c=Function.prototype.bind||t,_c}var cm,um;function Kp(){return um||(um=1,cm=Function.prototype.call),cm}var dm,pm;function Jp(){return pm||(pm=1,dm=Function.prototype.apply),dm}var fm,hm;function SA(){return hm||(hm=1,fm=typeof Reflect<"u"&&Reflect&&Reflect.apply),fm}var Nc,mm;function vb(){if(mm)return Nc;mm=1;var t=zs(),e=Jp(),n=Kp(),r=SA();return Nc=r||t.call(n,e),Nc}var Ic,gm;function Xp(){if(gm)return Ic;gm=1;var t=zs(),e=Ps(),n=Kp(),r=vb();return Ic=function(o){if(o.length<1||typeof o[0]!="function")throw new e("a function is required");return r(t,n,o)},Ic}var Fc,ym;function AA(){if(ym)return Fc;ym=1;var t=Xp(),e=bi(),n;try{n=[].__proto__===Array.prototype}catch(s){if(!s||typeof s!="object"||!("code"in s)||s.code!=="ERR_PROTO_ACCESS")throw s}var r=!!n&&e&&e(Object.prototype,"__proto__"),o=Object,i=o.getPrototypeOf;return Fc=r&&typeof r.get=="function"?t([r.get]):typeof i=="function"?function(s){return i(s==null?s:o(s))}:!1,Fc}var Rc,wm;function Yp(){if(wm)return Rc;wm=1;var t=wb(),e=bb(),n=AA();return Rc=t?function(r){return t(r)}:e?function(r){if(!r||typeof r!="object"&&typeof r!="function")throw new TypeError("getProto: not an object");return e(r)}:n?function(r){return n(r)}:null,Rc}var Bc,bm;function xb(){if(bm)return Bc;bm=1;var t=Function.prototype.call,e=Object.prototype.hasOwnProperty,n=zs();return Bc=n.call(t,e),Bc}var Lc,vm;function kb(){if(vm)return Lc;vm=1;var t,e=gb(),n=aA(),r=lA(),o=cA(),i=uA(),s=yb(),a=Ps(),l=dA(),c=pA(),u=fA(),d=hA(),p=mA(),f=gA(),h=yA(),m=bA(),y=Function,g=function(K){try{return y('"use strict"; return ('+K+").constructor;")()}catch{}},v=bi(),k=Xl(),b=function(){throw new a},C=v?function(){try{return arguments.callee,b}catch{try{return v(arguments,"callee").get}catch{return b}}}():b,D=xA()(),M=Yp(),I=bb(),E=wb(),G=Jp(),oe=Kp(),N={},H=typeof Uint8Array>"u"||!M?t:M(Uint8Array),A={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?t:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?t:ArrayBuffer,"%ArrayIteratorPrototype%":D&&M?M([][Symbol.iterator]()):t,"%AsyncFromSyncIteratorPrototype%":t,"%AsyncFunction%":N,"%AsyncGenerator%":N,"%AsyncGeneratorFunction%":N,"%AsyncIteratorPrototype%":N,"%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%":n,"%eval%":eval,"%EvalError%":r,"%Float16Array%":typeof Float16Array>"u"?t:Float16Array,"%Float32Array%":typeof Float32Array>"u"?t:Float32Array,"%Float64Array%":typeof Float64Array>"u"?t:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?t:FinalizationRegistry,"%Function%":y,"%GeneratorFunction%":N,"%Int8Array%":typeof Int8Array>"u"?t:Int8Array,"%Int16Array%":typeof Int16Array>"u"?t:Int16Array,"%Int32Array%":typeof Int32Array>"u"?t:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":D&&M?M(M([][Symbol.iterator]())):t,"%JSON%":typeof JSON=="object"?JSON:t,"%Map%":typeof Map>"u"?t:Map,"%MapIteratorPrototype%":typeof Map>"u"||!D||!M?t:M(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":e,"%Object.getOwnPropertyDescriptor%":v,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?t:Promise,"%Proxy%":typeof Proxy>"u"?t:Proxy,"%RangeError%":o,"%ReferenceError%":i,"%Reflect%":typeof Reflect>"u"?t:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?t:Set,"%SetIteratorPrototype%":typeof Set>"u"||!D||!M?t:M(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?t:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":D&&M?M(""[Symbol.iterator]()):t,"%Symbol%":D?Symbol:t,"%SyntaxError%":s,"%ThrowTypeError%":C,"%TypedArray%":H,"%TypeError%":a,"%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%":l,"%WeakMap%":typeof WeakMap>"u"?t:WeakMap,"%WeakRef%":typeof WeakRef>"u"?t:WeakRef,"%WeakSet%":typeof WeakSet>"u"?t:WeakSet,"%Function.prototype.call%":oe,"%Function.prototype.apply%":G,"%Object.defineProperty%":k,"%Object.getPrototypeOf%":I,"%Math.abs%":c,"%Math.floor%":u,"%Math.max%":d,"%Math.min%":p,"%Math.pow%":f,"%Math.round%":h,"%Math.sign%":m,"%Reflect.getPrototypeOf%":E};if(M)try{null.error}catch(K){var J=M(M(K));A["%Error.prototype%"]=J}var ie=function K(q){var F;if(q==="%AsyncFunction%")F=g("async function () {}");else if(q==="%GeneratorFunction%")F=g("function* () {}");else if(q==="%AsyncGeneratorFunction%")F=g("async function* () {}");else if(q==="%AsyncGenerator%"){var L=K("%AsyncGeneratorFunction%");L&&(F=L.prototype)}else if(q==="%AsyncIteratorPrototype%"){var le=K("%AsyncGenerator%");le&&M&&(F=M(le.prototype))}return A[q]=F,F},W={__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"]},ce=zs(),X=xb(),ue=ce.call(oe,Array.prototype.concat),Z=ce.call(G,Array.prototype.splice),R=ce.call(oe,String.prototype.replace),ee=ce.call(oe,String.prototype.slice),ne=ce.call(oe,RegExp.prototype.exec),se=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Y=/\\(\\)?/g,$=function(K){var q=ee(K,0,1),F=ee(K,-1);if(q==="%"&&F!=="%")throw new s("invalid intrinsic syntax, expected closing `%`");if(F==="%"&&q!=="%")throw new s("invalid intrinsic syntax, expected opening `%`");var L=[];return R(K,se,function(le,S,re,Q){L[L.length]=re?R(Q,Y,"$1"):S||le}),L},T=function(K,q){var F=K,L;if(X(W,F)&&(L=W[F],F="%"+L[0]+"%"),X(A,F)){var le=A[F];if(le===N&&(le=ie(F)),typeof le>"u"&&!q)throw new a("intrinsic "+K+" exists, but is not available. Please file an issue!");return{alias:L,name:F,value:le}}throw new s("intrinsic "+K+" does not exist!")};return Lc=function(K,q){if(typeof K!="string"||K.length===0)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof q!="boolean")throw new a('"allowMissing" argument must be a boolean');if(ne(/^%?[^%]*%?$/,K)===null)throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var F=$(K),L=F.length>0?F[0]:"",le=T("%"+L+"%",q),S=le.name,re=le.value,Q=!1,z=le.alias;z&&(L=z[0],Z(F,ue([0,1],z)));for(var V=1,j=!0;V<F.length;V+=1){var de=F[V],fe=ee(de,0,1),ae=ee(de,-1);if((fe==='"'||fe==="'"||fe==="`"||ae==='"'||ae==="'"||ae==="`")&&fe!==ae)throw new s("property names with quotes must have matching quotes");if((de==="constructor"||!j)&&(Q=!0),L+="."+de,S="%"+L+"%",X(A,S))re=A[S];else if(re!=null){if(!(de in re)){if(!q)throw new a("base intrinsic for "+K+" exists, but the property is not available.");return}if(v&&V+1>=F.length){var me=v(re,de);j=!!me,j&&"get"in me&&!("originalValue"in me.get)?re=me.get:re=re[de]}else j=X(re,de),re=re[de];j&&!Q&&(A[S]=re)}}return re},Lc}var Pc,xm;function js(){if(xm)return Pc;xm=1;var t=kb(),e=Xp(),n=e([t("%String.prototype.indexOf%")]);return Pc=function(r,o){var i=t(r,!!o);return typeof i=="function"&&n(r,".prototype.")>-1?e([i]):i},Pc}var zc,km;function CA(){if(km)return zc;km=1;var t=Jl()(),e=js(),n=e("Object.prototype.toString"),r=function(s){return t&&s&&typeof s=="object"&&Symbol.toStringTag in s?!1:n(s)==="[object Arguments]"},o=function(s){return r(s)?!0:s!==null&&typeof s=="object"&&"length"in s&&typeof s.length=="number"&&s.length>=0&&n(s)!=="[object Array]"&&"callee"in s&&n(s.callee)==="[object Function]"},i=function(){return r(arguments)}();return r.isLegacyArguments=o,zc=i?r:o,zc}var jc,Sm;function EA(){if(Sm)return jc;Sm=1;var t=js(),e=Jl()(),n=xb(),r=bi(),o;if(e){var i=t("RegExp.prototype.exec"),s={},a=function(){throw s},l={toString:a,valueOf:a};typeof Symbol.toPrimitive=="symbol"&&(l[Symbol.toPrimitive]=a),o=function(d){if(!d||typeof d!="object")return!1;var p=r(d,"lastIndex"),f=p&&n(p,"value");if(!f)return!1;try{i(d,l)}catch(h){return h===s}}}else{var c=t("Object.prototype.toString"),u="[object RegExp]";o=function(d){return!d||typeof d!="object"&&typeof d!="function"?!1:c(d)===u}}return jc=o,jc}var qc,Am;function TA(){if(Am)return qc;Am=1;var t=js(),e=EA(),n=t("RegExp.prototype.exec"),r=Ps();return qc=function(o){if(!e(o))throw new r("`regex` must be a RegExp");return function(i){return n(o,i)!==null}},qc}var Vc,Cm;function $A(){if(Cm)return Vc;Cm=1;var t=js(),e=TA(),n=e(/^\s*(?:function)?\*/),r=Jl()(),o=Yp(),i=t("Object.prototype.toString"),s=t("Function.prototype.toString"),a=function(){if(!r)return!1;try{return Function("return function*() {}")()}catch{}},l;return Vc=function(c){if(typeof c!="function")return!1;if(n(s(c)))return!0;if(!r){var u=i(c);return u==="[object GeneratorFunction]"}if(!o)return!1;if(typeof l>"u"){var d=a();l=d?o(d):!1}return o(c)===l},Vc}var Uc,Em;function OA(){if(Em)return Uc;Em=1;var t=Function.prototype.toString,e=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,n,r;if(typeof e=="function"&&typeof Object.defineProperty=="function")try{n=Object.defineProperty({},"length",{get:function(){throw r}}),r={},e(function(){throw 42},null,n)}catch(v){v!==r&&(e=null)}else e=null;var o=/^\s*class\b/,i=function(v){try{var k=t.call(v);return o.test(k)}catch{return!1}},s=function(v){try{return i(v)?!1:(t.call(v),!0)}catch{return!1}},a=Object.prototype.toString,l="[object Object]",c="[object Function]",u="[object GeneratorFunction]",d="[object HTMLAllCollection]",p="[object HTML document.all class]",f="[object HTMLCollection]",h=typeof Symbol=="function"&&!!Symbol.toStringTag,m=!(0 in[,]),y=function(){return!1};if(typeof document=="object"){var g=document.all;a.call(g)===a.call(document.all)&&(y=function(v){if((m||!v)&&(typeof v>"u"||typeof v=="object"))try{var k=a.call(v);return(k===d||k===p||k===f||k===l)&&v("")==null}catch{}return!1})}return Uc=e?function(v){if(y(v))return!0;if(!v||typeof v!="function"&&typeof v!="object")return!1;try{e(v,null,n)}catch(k){if(k!==r)return!1}return!i(v)&&s(v)}:function(v){if(y(v))return!0;if(!v||typeof v!="function"&&typeof v!="object")return!1;if(h)return s(v);if(i(v))return!1;var k=a.call(v);return k!==c&&k!==u&&!/^\[object HTML/.test(k)?!1:s(v)},Uc}var Hc,Tm;function MA(){if(Tm)return Hc;Tm=1;var t=OA(),e=Object.prototype.toString,n=Object.prototype.hasOwnProperty,r=function(a,l,c){for(var u=0,d=a.length;u<d;u++)n.call(a,u)&&(c==null?l(a[u],u,a):l.call(c,a[u],u,a))},o=function(a,l,c){for(var u=0,d=a.length;u<d;u++)c==null?l(a.charAt(u),u,a):l.call(c,a.charAt(u),u,a)},i=function(a,l,c){for(var u in a)n.call(a,u)&&(c==null?l(a[u],u,a):l.call(c,a[u],u,a))};function s(a){return e.call(a)==="[object Array]"}return Hc=function(a,l,c){if(!t(l))throw new TypeError("iterator must be a function");var u;arguments.length>=3&&(u=c),s(a)?r(a,l,u):typeof a=="string"?o(a,l,u):i(a,l,u)},Hc}var $m,Om;function DA(){return Om||(Om=1,$m=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),$m}var Wc,Mm;function _A(){if(Mm)return Wc;Mm=1;var t=DA(),e=typeof globalThis>"u"?zt:globalThis;return Wc=function(){for(var n=[],r=0;r<t.length;r++)typeof e[t[r]]=="function"&&(n[n.length]=t[r]);return n},Wc}var Dm={exports:{}},Gc,_m;function NA(){if(_m)return Gc;_m=1;var t=Xl(),e=yb(),n=Ps(),r=bi();return Gc=function(o,i,s){if(!o||typeof o!="object"&&typeof o!="function")throw new n("`obj` must be an object or a function`");if(typeof i!="string"&&typeof i!="symbol")throw new n("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new n("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new n("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new n("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new n("`loose`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,u=arguments.length>6?arguments[6]:!1,d=!!r&&r(o,i);if(t)t(o,i,{configurable:c===null&&d?d.configurable:!c,enumerable:a===null&&d?d.enumerable:!a,value:s,writable:l===null&&d?d.writable:!l});else if(u||!a&&!l&&!c)o[i]=s;else throw new e("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Gc}var Kc,Nm;function IA(){if(Nm)return Kc;Nm=1;var t=Xl(),e=function(){return!!t};return e.hasArrayLengthDefineBug=function(){if(!t)return null;try{return t([],"length",{value:1}).length!==1}catch{return!0}},Kc=e,Kc}var Jc,Im;function FA(){if(Im)return Jc;Im=1;var t=kb(),e=NA(),n=IA()(),r=bi(),o=Ps(),i=t("%Math.floor%");return Jc=function(s,a){if(typeof s!="function")throw new o("`fn` is not a function");if(typeof a!="number"||a<0||a>4294967295||i(a)!==a)throw new o("`length` must be a positive 32-bit integer");var l=arguments.length>2&&!!arguments[2],c=!0,u=!0;if("length"in s&&r){var d=r(s,"length");d&&!d.configurable&&(c=!1),d&&!d.writable&&(u=!1)}return(c||u||!l)&&(n?e(s,"length",a,!0,!0):e(s,"length",a)),s},Jc}var Xc,Fm;function RA(){if(Fm)return Xc;Fm=1;var t=zs(),e=Jp(),n=vb();return Xc=function(){return n(t,e,arguments)},Xc}var Rm;function BA(){return Rm||(Rm=1,function(t){var e=FA(),n=Xl(),r=Xp(),o=RA();t.exports=function(i){var s=r(arguments),a=i.length-(arguments.length-1);return e(s,1+(a>0?a:0),!0)},n?n(t.exports,"apply",{value:o}):t.exports.apply=o}(Dm)),Dm.exports}var Yc,Bm;function Sb(){if(Bm)return Yc;Bm=1;var t=MA(),e=_A(),n=BA(),r=js(),o=bi(),i=Yp(),s=r("Object.prototype.toString"),a=Jl()(),l=typeof globalThis>"u"?zt:globalThis,c=e(),u=r("String.prototype.slice"),d=r("Array.prototype.indexOf",!0)||function(m,y){for(var g=0;g<m.length;g+=1)if(m[g]===y)return g;return-1},p={__proto__:null};a&&o&&i?t(c,function(m){var y=new l[m];if(Symbol.toStringTag in y&&i){var g=i(y),v=o(g,Symbol.toStringTag);if(!v&&g){var k=i(g);v=o(k,Symbol.toStringTag)}p["$"+m]=n(v.get)}}):t(c,function(m){var y=new l[m],g=y.slice||y.set;g&&(p["$"+m]=n(g))});var f=function(m){var y=!1;return t(p,function(g,v){if(!y)try{"$"+g(m)===v&&(y=u(v,1))}catch{}}),y},h=function(m){var y=!1;return t(p,function(g,v){if(!y)try{g(m),y=u(v,1)}catch{}}),y};return Yc=function(m){if(!m||typeof m!="object")return!1;if(!a){var y=u(s(m),8,-1);return d(c,y)>-1?y:y!=="Object"?!1:h(m)}return o?f(m):null},Yc}var Zc,Lm;function LA(){if(Lm)return Zc;Lm=1;var t=Sb();return Zc=function(e){return!!t(e)},Zc}var Pm;function PA(){return Pm||(Pm=1,function(t){var e=CA(),n=$A(),r=Sb(),o=LA();function i(j){return j.call.bind(j)}var s=typeof BigInt<"u",a=typeof Symbol<"u",l=i(Object.prototype.toString),c=i(Number.prototype.valueOf),u=i(String.prototype.valueOf),d=i(Boolean.prototype.valueOf);if(s)var p=i(BigInt.prototype.valueOf);if(a)var f=i(Symbol.prototype.valueOf);function h(j,de){if(typeof j!="object")return!1;try{return de(j),!0}catch{return!1}}t.isArgumentsObject=e,t.isGeneratorFunction=n,t.isTypedArray=o;function m(j){return typeof Promise<"u"&&j instanceof Promise||j!==null&&typeof j=="object"&&typeof j.then=="function"&&typeof j.catch=="function"}t.isPromise=m;function y(j){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(j):o(j)||ee(j)}t.isArrayBufferView=y;function g(j){return r(j)==="Uint8Array"}t.isUint8Array=g;function v(j){return r(j)==="Uint8ClampedArray"}t.isUint8ClampedArray=v;function k(j){return r(j)==="Uint16Array"}t.isUint16Array=k;function b(j){return r(j)==="Uint32Array"}t.isUint32Array=b;function C(j){return r(j)==="Int8Array"}t.isInt8Array=C;function D(j){return r(j)==="Int16Array"}t.isInt16Array=D;function M(j){return r(j)==="Int32Array"}t.isInt32Array=M;function I(j){return r(j)==="Float32Array"}t.isFloat32Array=I;function E(j){return r(j)==="Float64Array"}t.isFloat64Array=E;function G(j){return r(j)==="BigInt64Array"}t.isBigInt64Array=G;function oe(j){return r(j)==="BigUint64Array"}t.isBigUint64Array=oe;function N(j){return l(j)==="[object Map]"}N.working=typeof Map<"u"&&N(new Map);function H(j){return typeof Map>"u"?!1:N.working?N(j):j instanceof Map}t.isMap=H;function A(j){return l(j)==="[object Set]"}A.working=typeof Set<"u"&&A(new Set);function J(j){return typeof Set>"u"?!1:A.working?A(j):j instanceof Set}t.isSet=J;function ie(j){return l(j)==="[object WeakMap]"}ie.working=typeof WeakMap<"u"&&ie(new WeakMap);function W(j){return typeof WeakMap>"u"?!1:ie.working?ie(j):j instanceof WeakMap}t.isWeakMap=W;function ce(j){return l(j)==="[object WeakSet]"}ce.working=typeof WeakSet<"u"&&ce(new WeakSet);function X(j){return ce(j)}t.isWeakSet=X;function ue(j){return l(j)==="[object ArrayBuffer]"}ue.working=typeof ArrayBuffer<"u"&&ue(new ArrayBuffer);function Z(j){return typeof ArrayBuffer>"u"?!1:ue.working?ue(j):j instanceof ArrayBuffer}t.isArrayBuffer=Z;function R(j){return l(j)==="[object DataView]"}R.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&R(new DataView(new ArrayBuffer(1),0,1));function ee(j){return typeof DataView>"u"?!1:R.working?R(j):j instanceof DataView}t.isDataView=ee;var ne=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function se(j){return l(j)==="[object SharedArrayBuffer]"}function Y(j){return typeof ne>"u"?!1:(typeof se.working>"u"&&(se.working=se(new ne)),se.working?se(j):j instanceof ne)}t.isSharedArrayBuffer=Y;function $(j){return l(j)==="[object AsyncFunction]"}t.isAsyncFunction=$;function T(j){return l(j)==="[object Map Iterator]"}t.isMapIterator=T;function K(j){return l(j)==="[object Set Iterator]"}t.isSetIterator=K;function q(j){return l(j)==="[object Generator]"}t.isGeneratorObject=q;function F(j){return l(j)==="[object WebAssembly.Module]"}t.isWebAssemblyCompiledModule=F;function L(j){return h(j,c)}t.isNumberObject=L;function le(j){return h(j,u)}t.isStringObject=le;function S(j){return h(j,d)}t.isBooleanObject=S;function re(j){return s&&h(j,p)}t.isBigIntObject=re;function Q(j){return a&&h(j,f)}t.isSymbolObject=Q;function z(j){return L(j)||le(j)||S(j)||re(j)||Q(j)}t.isBoxedPrimitive=z;function V(j){return typeof Uint8Array<"u"&&(Z(j)||Y(j))}t.isAnyArrayBuffer=V,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(j){Object.defineProperty(t,j,{enumerable:!1,value:function(){throw new Error(j+" is not supported in userland")}})})}(wh)),wh}var zm,jm;function zA(){return jm||(jm=1,zm=function(t){return t&&typeof t=="object"&&typeof t.copy=="function"&&typeof t.fill=="function"&&typeof t.readUInt8=="function"}),zm}var qm;function Ab(){return qm||(qm=1,function(t){var e=Object.getOwnPropertyDescriptors||function(R){for(var ee=Object.keys(R),ne={},se=0;se<ee.length;se++)ne[ee[se]]=Object.getOwnPropertyDescriptor(R,ee[se]);return ne},n=/%[sdj%]/g;t.format=function(R){if(!C(R)){for(var ee=[],ne=0;ne<arguments.length;ne++)ee.push(s(arguments[ne]));return ee.join(" ")}for(var ne=1,se=arguments,Y=se.length,$=String(R).replace(n,function(q){if(q==="%%")return"%";if(ne>=Y)return q;switch(q){case"%s":return String(se[ne++]);case"%d":return Number(se[ne++]);case"%j":try{return JSON.stringify(se[ne++])}catch{return"[Circular]"}default:return q}}),T=se[ne];ne<Y;T=se[++ne])v(T)||!E(T)?$+=" "+T:$+=" "+s(T);return $},t.deprecate=function(R,ee){if(typeof Se<"u"&&Se.noDeprecation===!0)return R;if(typeof Se>"u")return function(){return t.deprecate(R,ee).apply(this,arguments)};var ne=!1;function se(){if(!ne){if(Se.throwDeprecation)throw new Error(ee);Se.traceDeprecation?console.trace(ee):console.error(ee),ne=!0}return R.apply(this,arguments)}return se};var r={},o=/^$/;if(Se.env.NODE_DEBUG){var i=Se.env.NODE_DEBUG;i=i.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),o=new RegExp("^"+i+"$","i")}t.debuglog=function(R){if(R=R.toUpperCase(),!r[R])if(o.test(R)){var ee=Se.pid;r[R]=function(){var ne=t.format.apply(t,arguments);console.error("%s %d: %s",R,ee,ne)}}else r[R]=function(){};return r[R]};function s(R,ee){var ne={seen:[],stylize:l};return arguments.length>=3&&(ne.depth=arguments[2]),arguments.length>=4&&(ne.colors=arguments[3]),g(ee)?ne.showHidden=ee:ee&&t._extend(ne,ee),M(ne.showHidden)&&(ne.showHidden=!1),M(ne.depth)&&(ne.depth=2),M(ne.colors)&&(ne.colors=!1),M(ne.customInspect)&&(ne.customInspect=!0),ne.colors&&(ne.stylize=a),u(ne,R,ne.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(R,ee){var ne=s.styles[ee];return ne?"\x1B["+s.colors[ne][0]+"m"+R+"\x1B["+s.colors[ne][1]+"m":R}function l(R,ee){return R}function c(R){var ee={};return R.forEach(function(ne,se){ee[ne]=!0}),ee}function u(R,ee,ne){if(R.customInspect&&ee&&N(ee.inspect)&&ee.inspect!==t.inspect&&!(ee.constructor&&ee.constructor.prototype===ee)){var se=ee.inspect(ne,R);return C(se)||(se=u(R,se,ne)),se}var Y=d(R,ee);if(Y)return Y;var $=Object.keys(ee),T=c($);if(R.showHidden&&($=Object.getOwnPropertyNames(ee)),oe(ee)&&($.indexOf("message")>=0||$.indexOf("description")>=0))return p(ee);if($.length===0){if(N(ee)){var K=ee.name?": "+ee.name:"";return R.stylize("[Function"+K+"]","special")}if(I(ee))return R.stylize(RegExp.prototype.toString.call(ee),"regexp");if(G(ee))return R.stylize(Date.prototype.toString.call(ee),"date");if(oe(ee))return p(ee)}var q="",F=!1,L=["{","}"];if(y(ee)&&(F=!0,L=["[","]"]),N(ee)){var le=ee.name?": "+ee.name:"";q=" [Function"+le+"]"}if(I(ee)&&(q=" "+RegExp.prototype.toString.call(ee)),G(ee)&&(q=" "+Date.prototype.toUTCString.call(ee)),oe(ee)&&(q=" "+p(ee)),$.length===0&&(!F||ee.length==0))return L[0]+q+L[1];if(ne<0)return I(ee)?R.stylize(RegExp.prototype.toString.call(ee),"regexp"):R.stylize("[Object]","special");R.seen.push(ee);var S;return F?S=f(R,ee,ne,T,$):S=$.map(function(re){return h(R,ee,ne,T,re,F)}),R.seen.pop(),m(S,q,L)}function d(R,ee){if(M(ee))return R.stylize("undefined","undefined");if(C(ee)){var ne="'"+JSON.stringify(ee).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return R.stylize(ne,"string")}if(b(ee))return R.stylize(""+ee,"number");if(g(ee))return R.stylize(""+ee,"boolean");if(v(ee))return R.stylize("null","null")}function p(R){return"["+Error.prototype.toString.call(R)+"]"}function f(R,ee,ne,se,Y){for(var $=[],T=0,K=ee.length;T<K;++T)ce(ee,String(T))?$.push(h(R,ee,ne,se,String(T),!0)):$.push("");return Y.forEach(function(q){q.match(/^\d+$/)||$.push(h(R,ee,ne,se,q,!0))}),$}function h(R,ee,ne,se,Y,$){var T,K,q;if(q=Object.getOwnPropertyDescriptor(ee,Y)||{value:ee[Y]},q.get?q.set?K=R.stylize("[Getter/Setter]","special"):K=R.stylize("[Getter]","special"):q.set&&(K=R.stylize("[Setter]","special")),ce(se,Y)||(T="["+Y+"]"),K||(R.seen.indexOf(q.value)<0?(v(ne)?K=u(R,q.value,null):K=u(R,q.value,ne-1),K.indexOf(`
7
+ `)>-1&&($?K=K.split(`
8
+ `).map(function(F){return" "+F}).join(`
9
+ `).slice(2):K=`
10
+ `+K.split(`
11
+ `).map(function(F){return" "+F}).join(`
12
+ `))):K=R.stylize("[Circular]","special")),M(T)){if($&&Y.match(/^\d+$/))return K;T=JSON.stringify(""+Y),T.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(T=T.slice(1,-1),T=R.stylize(T,"name")):(T=T.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),T=R.stylize(T,"string"))}return T+": "+K}function m(R,ee,ne){var se=R.reduce(function(Y,$){return $.indexOf(`
13
+ `)>=0,Y+$.replace(/\u001b\[\d\d?m/g,"").length+1},0);return se>60?ne[0]+(ee===""?"":ee+`
14
+ `)+" "+R.join(`,
15
+ `)+" "+ne[1]:ne[0]+ee+" "+R.join(", ")+" "+ne[1]}t.types=PA();function y(R){return Array.isArray(R)}t.isArray=y;function g(R){return typeof R=="boolean"}t.isBoolean=g;function v(R){return R===null}t.isNull=v;function k(R){return R==null}t.isNullOrUndefined=k;function b(R){return typeof R=="number"}t.isNumber=b;function C(R){return typeof R=="string"}t.isString=C;function D(R){return typeof R=="symbol"}t.isSymbol=D;function M(R){return R===void 0}t.isUndefined=M;function I(R){return E(R)&&A(R)==="[object RegExp]"}t.isRegExp=I,t.types.isRegExp=I;function E(R){return typeof R=="object"&&R!==null}t.isObject=E;function G(R){return E(R)&&A(R)==="[object Date]"}t.isDate=G,t.types.isDate=G;function oe(R){return E(R)&&(A(R)==="[object Error]"||R instanceof Error)}t.isError=oe,t.types.isNativeError=oe;function N(R){return typeof R=="function"}t.isFunction=N;function H(R){return R===null||typeof R=="boolean"||typeof R=="number"||typeof R=="string"||typeof R=="symbol"||typeof R>"u"}t.isPrimitive=H,t.isBuffer=zA();function A(R){return Object.prototype.toString.call(R)}function J(R){return R<10?"0"+R.toString(10):R.toString(10)}var ie=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function W(){var R=new Date,ee=[J(R.getHours()),J(R.getMinutes()),J(R.getSeconds())].join(":");return[R.getDate(),ie[R.getMonth()],ee].join(" ")}t.log=function(){console.log("%s - %s",W(),t.format.apply(t,arguments))},t.inherits=ko(),t._extend=function(R,ee){if(!ee||!E(ee))return R;for(var ne=Object.keys(ee),se=ne.length;se--;)R[ne[se]]=ee[ne[se]];return R};function ce(R,ee){return Object.prototype.hasOwnProperty.call(R,ee)}var X=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;t.promisify=function(R){if(typeof R!="function")throw new TypeError('The "original" argument must be of type Function');if(X&&R[X]){var ee=R[X];if(typeof ee!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(ee,X,{value:ee,enumerable:!1,writable:!1,configurable:!0}),ee}function ee(){for(var ne,se,Y=new Promise(function(K,q){ne=K,se=q}),$=[],T=0;T<arguments.length;T++)$.push(arguments[T]);$.push(function(K,q){K?se(K):ne(q)});try{R.apply(this,$)}catch(K){se(K)}return Y}return Object.setPrototypeOf(ee,Object.getPrototypeOf(R)),X&&Object.defineProperty(ee,X,{value:ee,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(ee,e(R))},t.promisify.custom=X;function ue(R,ee){if(!R){var ne=new Error("Promise was rejected with a falsy value");ne.reason=R,R=ne}return ee(R)}function Z(R){if(typeof R!="function")throw new TypeError('The "original" argument must be of type Function');function ee(){for(var ne=[],se=0;se<arguments.length;se++)ne.push(arguments[se]);var Y=ne.pop();if(typeof Y!="function")throw new TypeError("The last argument must be of type Function");var $=this,T=function(){return Y.apply($,arguments)};R.apply(this,ne).then(function(K){Se.nextTick(T.bind(null,null,K))},function(K){Se.nextTick(ue.bind(null,K,T))})}return Object.setPrototypeOf(ee,Object.getPrototypeOf(R)),Object.defineProperties(ee,e(R)),ee}t.callbackify=Z}(yh)),yh}var Qc,Vm;function jA(){if(Vm)return Qc;Vm=1;function t(h,m){var y=Object.keys(h);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(h);m&&(g=g.filter(function(v){return Object.getOwnPropertyDescriptor(h,v).enumerable})),y.push.apply(y,g)}return y}function e(h){for(var m=1;m<arguments.length;m++){var y=arguments[m]!=null?arguments[m]:{};m%2?t(Object(y),!0).forEach(function(g){n(h,g,y[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(y)):t(Object(y)).forEach(function(g){Object.defineProperty(h,g,Object.getOwnPropertyDescriptor(y,g))})}return h}function n(h,m,y){return m=s(m),m in h?Object.defineProperty(h,m,{value:y,enumerable:!0,configurable:!0,writable:!0}):h[m]=y,h}function r(h,m){if(!(h instanceof m))throw new TypeError("Cannot call a class as a function")}function o(h,m){for(var y=0;y<m.length;y++){var g=m[y];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(h,s(g.key),g)}}function i(h,m,y){return m&&o(h.prototype,m),Object.defineProperty(h,"prototype",{writable:!1}),h}function s(h){var m=a(h,"string");return typeof m=="symbol"?m:String(m)}function a(h,m){if(typeof h!="object"||h===null)return h;var y=h[Symbol.toPrimitive];if(y!==void 0){var g=y.call(h,m);if(typeof g!="object")return g;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(h)}var l=Kl,c=l.Buffer,u=Ab(),d=u.inspect,p=d&&d.custom||"inspect";function f(h,m,y){c.prototype.copy.call(h,m,y)}return Qc=function(){function h(){r(this,h),this.head=null,this.tail=null,this.length=0}return i(h,[{key:"push",value:function(m){var y={data:m,next:null};this.length>0?this.tail.next=y:this.head=y,this.tail=y,++this.length}},{key:"unshift",value:function(m){var y={data:m,next:this.head};this.length===0&&(this.tail=y),this.head=y,++this.length}},{key:"shift",value:function(){if(this.length!==0){var m=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,m}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(m){if(this.length===0)return"";for(var y=this.head,g=""+y.data;y=y.next;)g+=m+y.data;return g}},{key:"concat",value:function(m){if(this.length===0)return c.alloc(0);for(var y=c.allocUnsafe(m>>>0),g=this.head,v=0;g;)f(g.data,y,v),v+=g.data.length,g=g.next;return y}},{key:"consume",value:function(m,y){var g;return m<this.head.data.length?(g=this.head.data.slice(0,m),this.head.data=this.head.data.slice(m)):m===this.head.data.length?g=this.shift():g=y?this._getString(m):this._getBuffer(m),g}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(m){var y=this.head,g=1,v=y.data;for(m-=v.length;y=y.next;){var k=y.data,b=m>k.length?k.length:m;if(b===k.length?v+=k:v+=k.slice(0,m),m-=b,m===0){b===k.length?(++g,y.next?this.head=y.next:this.head=this.tail=null):(this.head=y,y.data=k.slice(b));break}++g}return this.length-=g,v}},{key:"_getBuffer",value:function(m){var y=c.allocUnsafe(m),g=this.head,v=1;for(g.data.copy(y),m-=g.data.length;g=g.next;){var k=g.data,b=m>k.length?k.length:m;if(k.copy(y,y.length-m,0,b),m-=b,m===0){b===k.length?(++v,g.next?this.head=g.next:this.head=this.tail=null):(this.head=g,g.data=k.slice(b));break}++v}return this.length-=v,y}},{key:p,value:function(m,y){return d(this,e(e({},y),{},{depth:0,customInspect:!1}))}}]),h}(),Qc}var eu,Um;function Cb(){if(Um)return eu;Um=1;function t(s,a){var l=this,c=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return c||u?(a?a(s):s&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,Se.nextTick(o,this,s)):Se.nextTick(o,this,s)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(s||null,function(d){!a&&d?l._writableState?l._writableState.errorEmitted?Se.nextTick(n,l):(l._writableState.errorEmitted=!0,Se.nextTick(e,l,d)):Se.nextTick(e,l,d):a?(Se.nextTick(n,l),a(d)):Se.nextTick(n,l)}),this)}function e(s,a){o(s,a),n(s)}function n(s){s._writableState&&!s._writableState.emitClose||s._readableState&&!s._readableState.emitClose||s.emit("close")}function r(){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 o(s,a){s.emit("error",a)}function i(s,a){var l=s._readableState,c=s._writableState;l&&l.autoDestroy||c&&c.autoDestroy?s.destroy(a):s.emit("error",a)}return eu={destroy:t,undestroy:r,errorOrDestroy:i},eu}var tu={},Hm;function vi(){if(Hm)return tu;Hm=1;function t(a,l){a.prototype=Object.create(l.prototype),a.prototype.constructor=a,a.__proto__=l}var e={};function n(a,l,c){c||(c=Error);function u(p,f,h){return typeof l=="string"?l:l(p,f,h)}var d=function(p){t(f,p);function f(h,m,y){return p.call(this,u(h,m,y))||this}return f}(c);d.prototype.name=c.name,d.prototype.code=a,e[a]=d}function r(a,l){if(Array.isArray(a)){var c=a.length;return a=a.map(function(u){return String(u)}),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 o(a,l,c){return a.substr(0,l.length)===l}function i(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 n("ERR_INVALID_OPT_VALUE",function(a,l){return'The value "'+l+'" is invalid for option "'+a+'"'},TypeError),n("ERR_INVALID_ARG_TYPE",function(a,l,c){var u;typeof l=="string"&&o(l,"not ")?(u="must not be",l=l.replace(/^not /,"")):u="must be";var d;if(i(a," argument"))d="The ".concat(a," ").concat(u," ").concat(r(l,"type"));else{var p=s(a,".")?"property":"argument";d='The "'.concat(a,'" ').concat(p," ").concat(u," ").concat(r(l,"type"))}return d+=". Received type ".concat(typeof c),d},TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",function(a){return"The "+a+" method is not implemented"}),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",function(a){return"Cannot call "+a+" after a stream was destroyed"}),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",function(a){return"Unknown encoding: "+a},TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),tu.codes=e,tu}var nu,Wm;function Eb(){if(Wm)return nu;Wm=1;var t=vi().codes.ERR_INVALID_OPT_VALUE;function e(r,o,i){return r.highWaterMark!=null?r.highWaterMark:o?r[i]:null}function n(r,o,i,s){var a=e(o,s,i);if(a!=null){if(!(isFinite(a)&&Math.floor(a)===a)||a<0){var l=s?i:"highWaterMark";throw new t(l,a)}return Math.floor(a)}return r.objectMode?16:16*1024}return nu={getHighWaterMark:n},nu}var ru,Gm;function qA(){if(Gm)return ru;Gm=1,ru=t;function t(n,r){if(e("noDeprecation"))return n;var o=!1;function i(){if(!o){if(e("throwDeprecation"))throw new Error(r);e("traceDeprecation")?console.trace(r):console.warn(r),o=!0}return n.apply(this,arguments)}return i}function e(n){try{if(!zt.localStorage)return!1}catch{return!1}var r=zt.localStorage[n];return r==null?!1:String(r).toLowerCase()==="true"}return ru}var ou,Km;function Tb(){if(Km)return ou;Km=1,ou=I;function t(Y){var $=this;this.next=null,this.entry=null,this.finish=function(){se($,Y)}}var e;I.WritableState=D;var n={deprecate:qA()},r=hb(),o=Kl.Buffer,i=(typeof zt<"u"?zt:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function s(Y){return o.from(Y)}function a(Y){return o.isBuffer(Y)||Y instanceof i}var l=Cb(),c=Eb(),u=c.getHighWaterMark,d=vi().codes,p=d.ERR_INVALID_ARG_TYPE,f=d.ERR_METHOD_NOT_IMPLEMENTED,h=d.ERR_MULTIPLE_CALLBACK,m=d.ERR_STREAM_CANNOT_PIPE,y=d.ERR_STREAM_DESTROYED,g=d.ERR_STREAM_NULL_VALUES,v=d.ERR_STREAM_WRITE_AFTER_END,k=d.ERR_UNKNOWN_ENCODING,b=l.errorOrDestroy;ko()(I,r);function C(){}function D(Y,$,T){e=e||ti(),Y=Y||{},typeof T!="boolean"&&(T=$ instanceof e),this.objectMode=!!Y.objectMode,T&&(this.objectMode=this.objectMode||!!Y.writableObjectMode),this.highWaterMark=u(this,Y,"writableHighWaterMark",T),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var K=Y.decodeStrings===!1;this.decodeStrings=!K,this.defaultEncoding=Y.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(q){ie($,q)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=Y.emitClose!==!1,this.autoDestroy=!!Y.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new t(this)}D.prototype.getBuffer=function(){for(var Y=this.bufferedRequest,$=[];Y;)$.push(Y),Y=Y.next;return $},function(){try{Object.defineProperty(D.prototype,"buffer",{get:n.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var M;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(M=Function.prototype[Symbol.hasInstance],Object.defineProperty(I,Symbol.hasInstance,{value:function(Y){return M.call(this,Y)?!0:this!==I?!1:Y&&Y._writableState instanceof D}})):M=function(Y){return Y instanceof this};function I(Y){e=e||ti();var $=this instanceof e;if(!$&&!M.call(I,this))return new I(Y);this._writableState=new D(Y,this,$),this.writable=!0,Y&&(typeof Y.write=="function"&&(this._write=Y.write),typeof Y.writev=="function"&&(this._writev=Y.writev),typeof Y.destroy=="function"&&(this._destroy=Y.destroy),typeof Y.final=="function"&&(this._final=Y.final)),r.call(this)}I.prototype.pipe=function(){b(this,new m)};function E(Y,$){var T=new v;b(Y,T),Se.nextTick($,T)}function G(Y,$,T,K){var q;return T===null?q=new g:typeof T!="string"&&!$.objectMode&&(q=new p("chunk",["string","Buffer"],T)),q?(b(Y,q),Se.nextTick(K,q),!1):!0}I.prototype.write=function(Y,$,T){var K=this._writableState,q=!1,F=!K.objectMode&&a(Y);return F&&!o.isBuffer(Y)&&(Y=s(Y)),typeof $=="function"&&(T=$,$=null),F?$="buffer":$||($=K.defaultEncoding),typeof T!="function"&&(T=C),K.ending?E(this,T):(F||G(this,K,Y,T))&&(K.pendingcb++,q=N(this,K,F,Y,$,T)),q},I.prototype.cork=function(){this._writableState.corked++},I.prototype.uncork=function(){var Y=this._writableState;Y.corked&&(Y.corked--,!Y.writing&&!Y.corked&&!Y.bufferProcessing&&Y.bufferedRequest&&X(this,Y))},I.prototype.setDefaultEncoding=function(Y){if(typeof Y=="string"&&(Y=Y.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((Y+"").toLowerCase())>-1))throw new k(Y);return this._writableState.defaultEncoding=Y,this},Object.defineProperty(I.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function oe(Y,$,T){return!Y.objectMode&&Y.decodeStrings!==!1&&typeof $=="string"&&($=o.from($,T)),$}Object.defineProperty(I.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function N(Y,$,T,K,q,F){if(!T){var L=oe($,K,q);K!==L&&(T=!0,q="buffer",K=L)}var le=$.objectMode?1:K.length;$.length+=le;var S=$.length<$.highWaterMark;if(S||($.needDrain=!0),$.writing||$.corked){var re=$.lastBufferedRequest;$.lastBufferedRequest={chunk:K,encoding:q,isBuf:T,callback:F,next:null},re?re.next=$.lastBufferedRequest:$.bufferedRequest=$.lastBufferedRequest,$.bufferedRequestCount+=1}else H(Y,$,!1,le,K,q,F);return S}function H(Y,$,T,K,q,F,L){$.writelen=K,$.writecb=L,$.writing=!0,$.sync=!0,$.destroyed?$.onwrite(new y("write")):T?Y._writev(q,$.onwrite):Y._write(q,F,$.onwrite),$.sync=!1}function A(Y,$,T,K,q){--$.pendingcb,T?(Se.nextTick(q,K),Se.nextTick(ee,Y,$),Y._writableState.errorEmitted=!0,b(Y,K)):(q(K),Y._writableState.errorEmitted=!0,b(Y,K),ee(Y,$))}function J(Y){Y.writing=!1,Y.writecb=null,Y.length-=Y.writelen,Y.writelen=0}function ie(Y,$){var T=Y._writableState,K=T.sync,q=T.writecb;if(typeof q!="function")throw new h;if(J(T),$)A(Y,T,K,$,q);else{var F=ue(T)||Y.destroyed;!F&&!T.corked&&!T.bufferProcessing&&T.bufferedRequest&&X(Y,T),K?Se.nextTick(W,Y,T,F,q):W(Y,T,F,q)}}function W(Y,$,T,K){T||ce(Y,$),$.pendingcb--,K(),ee(Y,$)}function ce(Y,$){$.length===0&&$.needDrain&&($.needDrain=!1,Y.emit("drain"))}function X(Y,$){$.bufferProcessing=!0;var T=$.bufferedRequest;if(Y._writev&&T&&T.next){var K=$.bufferedRequestCount,q=new Array(K),F=$.corkedRequestsFree;F.entry=T;for(var L=0,le=!0;T;)q[L]=T,T.isBuf||(le=!1),T=T.next,L+=1;q.allBuffers=le,H(Y,$,!0,$.length,q,"",F.finish),$.pendingcb++,$.lastBufferedRequest=null,F.next?($.corkedRequestsFree=F.next,F.next=null):$.corkedRequestsFree=new t($),$.bufferedRequestCount=0}else{for(;T;){var S=T.chunk,re=T.encoding,Q=T.callback,z=$.objectMode?1:S.length;if(H(Y,$,!1,z,S,re,Q),T=T.next,$.bufferedRequestCount--,$.writing)break}T===null&&($.lastBufferedRequest=null)}$.bufferedRequest=T,$.bufferProcessing=!1}I.prototype._write=function(Y,$,T){T(new f("_write()"))},I.prototype._writev=null,I.prototype.end=function(Y,$,T){var K=this._writableState;return typeof Y=="function"?(T=Y,Y=null,$=null):typeof $=="function"&&(T=$,$=null),Y!=null&&this.write(Y,$),K.corked&&(K.corked=1,this.uncork()),K.ending||ne(this,K,T),this},Object.defineProperty(I.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function ue(Y){return Y.ending&&Y.length===0&&Y.bufferedRequest===null&&!Y.finished&&!Y.writing}function Z(Y,$){Y._final(function(T){$.pendingcb--,T&&b(Y,T),$.prefinished=!0,Y.emit("prefinish"),ee(Y,$)})}function R(Y,$){!$.prefinished&&!$.finalCalled&&(typeof Y._final=="function"&&!$.destroyed?($.pendingcb++,$.finalCalled=!0,Se.nextTick(Z,Y,$)):($.prefinished=!0,Y.emit("prefinish")))}function ee(Y,$){var T=ue($);if(T&&(R(Y,$),$.pendingcb===0&&($.finished=!0,Y.emit("finish"),$.autoDestroy))){var K=Y._readableState;(!K||K.autoDestroy&&K.endEmitted)&&Y.destroy()}return T}function ne(Y,$,T){$.ending=!0,ee(Y,$),T&&($.finished?Se.nextTick(T):Y.once("finish",T)),$.ended=!0,Y.writable=!1}function se(Y,$,T){var K=Y.entry;for(Y.entry=null;K;){var q=K.callback;$.pendingcb--,q(T),K=K.next}$.corkedRequestsFree.next=Y}return Object.defineProperty(I.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(Y){this._writableState&&(this._writableState.destroyed=Y)}}),I.prototype.destroy=l.destroy,I.prototype._undestroy=l.undestroy,I.prototype._destroy=function(Y,$){$(Y)},ou}var iu,Jm;function ti(){if(Jm)return iu;Jm=1;var t=Object.keys||function(c){var u=[];for(var d in c)u.push(d);return u};iu=s;var e=$b(),n=Tb();ko()(s,e);for(var r=t(n.prototype),o=0;o<r.length;o++){var i=r[o];s.prototype[i]||(s.prototype[i]=n.prototype[i])}function s(c){if(!(this instanceof s))return new s(c);e.call(this,c),n.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||Se.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(c){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=c,this._writableState.destroyed=c)}}),iu}var su={},au={exports:{}},Xm;function VA(){return Xm||(Xm=1,function(t,e){var n=Kl,r=n.Buffer;function o(s,a){for(var l in s)a[l]=s[l]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=i);function i(s,a,l){return r(s,a,l)}o(r,i),i.from=function(s,a,l){if(typeof s=="number")throw new TypeError("Argument must not be a number");return r(s,a,l)},i.alloc=function(s,a,l){if(typeof s!="number")throw new TypeError("Argument must be a number");var c=r(s);return a!==void 0?typeof l=="string"?c.fill(a,l):c.fill(a):c.fill(0),c},i.allocUnsafe=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return r(s)},i.allocUnsafeSlow=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return n.SlowBuffer(s)}}(au,au.exports)),au.exports}var Ym;function vd(){if(Ym)return su;Ym=1;var t=VA().Buffer,e=t.isEncoding||function(g){switch(g=""+g,g&&g.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 n(g){if(!g)return"utf8";for(var v;;)switch(g){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 g;default:if(v)return;g=(""+g).toLowerCase(),v=!0}}function r(g){var v=n(g);if(typeof v!="string"&&(t.isEncoding===e||!e(g)))throw new Error("Unknown encoding: "+g);return v||g}su.StringDecoder=o;function o(g){this.encoding=r(g);var v;switch(this.encoding){case"utf16le":this.text=d,this.end=p,v=4;break;case"utf8":this.fillLast=l,v=4;break;case"base64":this.text=f,this.end=h,v=3;break;default:this.write=m,this.end=y;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(v)}o.prototype.write=function(g){if(g.length===0)return"";var v,k;if(this.lastNeed){if(v=this.fillLast(g),v===void 0)return"";k=this.lastNeed,this.lastNeed=0}else k=0;return k<g.length?v?v+this.text(g,k):this.text(g,k):v||""},o.prototype.end=u,o.prototype.text=c,o.prototype.fillLast=function(g){if(this.lastNeed<=g.length)return g.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);g.copy(this.lastChar,this.lastTotal-this.lastNeed,0,g.length),this.lastNeed-=g.length};function i(g){return g<=127?0:g>>5===6?2:g>>4===14?3:g>>3===30?4:g>>6===2?-1:-2}function s(g,v,k){var b=v.length-1;if(b<k)return 0;var C=i(v[b]);return C>=0?(C>0&&(g.lastNeed=C-1),C):--b<k||C===-2?0:(C=i(v[b]),C>=0?(C>0&&(g.lastNeed=C-2),C):--b<k||C===-2?0:(C=i(v[b]),C>=0?(C>0&&(C===2?C=0:g.lastNeed=C-3),C):0))}function a(g,v,k){if((v[0]&192)!==128)return g.lastNeed=0,"�";if(g.lastNeed>1&&v.length>1){if((v[1]&192)!==128)return g.lastNeed=1,"�";if(g.lastNeed>2&&v.length>2&&(v[2]&192)!==128)return g.lastNeed=2,"�"}}function l(g){var v=this.lastTotal-this.lastNeed,k=a(this,g);if(k!==void 0)return k;if(this.lastNeed<=g.length)return g.copy(this.lastChar,v,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);g.copy(this.lastChar,v,0,g.length),this.lastNeed-=g.length}function c(g,v){var k=s(this,g,v);if(!this.lastNeed)return g.toString("utf8",v);this.lastTotal=k;var b=g.length-(k-this.lastNeed);return g.copy(this.lastChar,0,b),g.toString("utf8",v,b)}function u(g){var v=g&&g.length?this.write(g):"";return this.lastNeed?v+"�":v}function d(g,v){if((g.length-v)%2===0){var k=g.toString("utf16le",v);if(k){var b=k.charCodeAt(k.length-1);if(b>=55296&&b<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=g[g.length-2],this.lastChar[1]=g[g.length-1],k.slice(0,-1)}return k}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=g[g.length-1],g.toString("utf16le",v,g.length-1)}function p(g){var v=g&&g.length?this.write(g):"";if(this.lastNeed){var k=this.lastTotal-this.lastNeed;return v+this.lastChar.toString("utf16le",0,k)}return v}function f(g,v){var k=(g.length-v)%3;return k===0?g.toString("base64",v):(this.lastNeed=3-k,this.lastTotal=3,k===1?this.lastChar[0]=g[g.length-1]:(this.lastChar[0]=g[g.length-2],this.lastChar[1]=g[g.length-1]),g.toString("base64",v,g.length-k))}function h(g){var v=g&&g.length?this.write(g):"";return this.lastNeed?v+this.lastChar.toString("base64",0,3-this.lastNeed):v}function m(g){return g.toString(this.encoding)}function y(g){return g&&g.length?this.write(g):""}return su}var lu,Zm;function Zp(){if(Zm)return lu;Zm=1;var t=vi().codes.ERR_STREAM_PREMATURE_CLOSE;function e(i){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];i.apply(this,l)}}}function n(){}function r(i){return i.setHeader&&typeof i.abort=="function"}function o(i,s,a){if(typeof s=="function")return o(i,null,s);s||(s={}),a=e(a||n);var l=s.readable||s.readable!==!1&&i.readable,c=s.writable||s.writable!==!1&&i.writable,u=function(){i.writable||p()},d=i._writableState&&i._writableState.finished,p=function(){c=!1,d=!0,l||a.call(i)},f=i._readableState&&i._readableState.endEmitted,h=function(){l=!1,f=!0,c||a.call(i)},m=function(v){a.call(i,v)},y=function(){var v;if(l&&!f)return(!i._readableState||!i._readableState.ended)&&(v=new t),a.call(i,v);if(c&&!d)return(!i._writableState||!i._writableState.ended)&&(v=new t),a.call(i,v)},g=function(){i.req.on("finish",p)};return r(i)?(i.on("complete",p),i.on("abort",y),i.req?g():i.on("request",g)):c&&!i._writableState&&(i.on("end",u),i.on("close",u)),i.on("end",h),i.on("finish",p),s.error!==!1&&i.on("error",m),i.on("close",y),function(){i.removeListener("complete",p),i.removeListener("abort",y),i.removeListener("request",g),i.req&&i.req.removeListener("finish",p),i.removeListener("end",u),i.removeListener("close",u),i.removeListener("finish",p),i.removeListener("end",h),i.removeListener("error",m),i.removeListener("close",y)}}return lu=o,lu}var cu,Qm;function UA(){if(Qm)return cu;Qm=1;var t;function e(k,b,C){return b=n(b),b in k?Object.defineProperty(k,b,{value:C,enumerable:!0,configurable:!0,writable:!0}):k[b]=C,k}function n(k){var b=r(k,"string");return typeof b=="symbol"?b:String(b)}function r(k,b){if(typeof k!="object"||k===null)return k;var C=k[Symbol.toPrimitive];if(C!==void 0){var D=C.call(k,b);if(typeof D!="object")return D;throw new TypeError("@@toPrimitive must return a primitive value.")}return(b==="string"?String:Number)(k)}var o=Zp(),i=Symbol("lastResolve"),s=Symbol("lastReject"),a=Symbol("error"),l=Symbol("ended"),c=Symbol("lastPromise"),u=Symbol("handlePromise"),d=Symbol("stream");function p(k,b){return{value:k,done:b}}function f(k){var b=k[i];if(b!==null){var C=k[d].read();C!==null&&(k[c]=null,k[i]=null,k[s]=null,b(p(C,!1)))}}function h(k){Se.nextTick(f,k)}function m(k,b){return function(C,D){k.then(function(){if(b[l]){C(p(void 0,!0));return}b[u](C,D)},D)}}var y=Object.getPrototypeOf(function(){}),g=Object.setPrototypeOf((t={get stream(){return this[d]},next:function(){var k=this,b=this[a];if(b!==null)return Promise.reject(b);if(this[l])return Promise.resolve(p(void 0,!0));if(this[d].destroyed)return new Promise(function(I,E){Se.nextTick(function(){k[a]?E(k[a]):I(p(void 0,!0))})});var C=this[c],D;if(C)D=new Promise(m(C,this));else{var M=this[d].read();if(M!==null)return Promise.resolve(p(M,!1));D=new Promise(this[u])}return this[c]=D,D}},e(t,Symbol.asyncIterator,function(){return this}),e(t,"return",function(){var k=this;return new Promise(function(b,C){k[d].destroy(null,function(D){if(D){C(D);return}b(p(void 0,!0))})})}),t),y),v=function(k){var b,C=Object.create(g,(b={},e(b,d,{value:k,writable:!0}),e(b,i,{value:null,writable:!0}),e(b,s,{value:null,writable:!0}),e(b,a,{value:null,writable:!0}),e(b,l,{value:k._readableState.endEmitted,writable:!0}),e(b,u,{value:function(D,M){var I=C[d].read();I?(C[c]=null,C[i]=null,C[s]=null,D(p(I,!1))):(C[i]=D,C[s]=M)},writable:!0}),b));return C[c]=null,o(k,function(D){if(D&&D.code!=="ERR_STREAM_PREMATURE_CLOSE"){var M=C[s];M!==null&&(C[c]=null,C[i]=null,C[s]=null,M(D)),C[a]=D;return}var I=C[i];I!==null&&(C[c]=null,C[i]=null,C[s]=null,I(p(void 0,!0))),C[l]=!0}),k.on("readable",h.bind(null,C)),C};return cu=v,cu}var eg,tg;function HA(){return tg||(tg=1,eg=function(){throw new Error("Readable.from is not available in the browser")}),eg}var uu,ng;function $b(){if(ng)return uu;ng=1,uu=E;var t;E.ReadableState=I,Gp().EventEmitter;var e=function(F,L){return F.listeners(L).length},n=hb(),r=Kl.Buffer,o=(typeof zt<"u"?zt:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function i(F){return r.from(F)}function s(F){return r.isBuffer(F)||F instanceof o}var a=Ab(),l;a&&a.debuglog?l=a.debuglog("stream"):l=function(){};var c=jA(),u=Cb(),d=Eb(),p=d.getHighWaterMark,f=vi().codes,h=f.ERR_INVALID_ARG_TYPE,m=f.ERR_STREAM_PUSH_AFTER_EOF,y=f.ERR_METHOD_NOT_IMPLEMENTED,g=f.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,v,k,b;ko()(E,n);var C=u.errorOrDestroy,D=["error","close","destroy","pause","resume"];function M(F,L,le){if(typeof F.prependListener=="function")return F.prependListener(L,le);!F._events||!F._events[L]?F.on(L,le):Array.isArray(F._events[L])?F._events[L].unshift(le):F._events[L]=[le,F._events[L]]}function I(F,L,le){t=t||ti(),F=F||{},typeof le!="boolean"&&(le=L instanceof t),this.objectMode=!!F.objectMode,le&&(this.objectMode=this.objectMode||!!F.readableObjectMode),this.highWaterMark=p(this,F,"readableHighWaterMark",le),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=F.emitClose!==!1,this.autoDestroy=!!F.autoDestroy,this.destroyed=!1,this.defaultEncoding=F.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,F.encoding&&(v||(v=vd().StringDecoder),this.decoder=new v(F.encoding),this.encoding=F.encoding)}function E(F){if(t=t||ti(),!(this instanceof E))return new E(F);var L=this instanceof t;this._readableState=new I(F,this,L),this.readable=!0,F&&(typeof F.read=="function"&&(this._read=F.read),typeof F.destroy=="function"&&(this._destroy=F.destroy)),n.call(this)}Object.defineProperty(E.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(F){this._readableState&&(this._readableState.destroyed=F)}}),E.prototype.destroy=u.destroy,E.prototype._undestroy=u.undestroy,E.prototype._destroy=function(F,L){L(F)},E.prototype.push=function(F,L){var le=this._readableState,S;return le.objectMode?S=!0:typeof F=="string"&&(L=L||le.defaultEncoding,L!==le.encoding&&(F=r.from(F,L),L=""),S=!0),G(this,F,L,!1,S)},E.prototype.unshift=function(F){return G(this,F,null,!0,!1)};function G(F,L,le,S,re){l("readableAddChunk",L);var Q=F._readableState;if(L===null)Q.reading=!1,ie(F,Q);else{var z;if(re||(z=N(Q,L)),z)C(F,z);else if(Q.objectMode||L&&L.length>0)if(typeof L!="string"&&!Q.objectMode&&Object.getPrototypeOf(L)!==r.prototype&&(L=i(L)),S)Q.endEmitted?C(F,new g):oe(F,Q,L,!0);else if(Q.ended)C(F,new m);else{if(Q.destroyed)return!1;Q.reading=!1,Q.decoder&&!le?(L=Q.decoder.write(L),Q.objectMode||L.length!==0?oe(F,Q,L,!1):X(F,Q)):oe(F,Q,L,!1)}else S||(Q.reading=!1,X(F,Q))}return!Q.ended&&(Q.length<Q.highWaterMark||Q.length===0)}function oe(F,L,le,S){L.flowing&&L.length===0&&!L.sync?(L.awaitDrain=0,F.emit("data",le)):(L.length+=L.objectMode?1:le.length,S?L.buffer.unshift(le):L.buffer.push(le),L.needReadable&&W(F)),X(F,L)}function N(F,L){var le;return!s(L)&&typeof L!="string"&&L!==void 0&&!F.objectMode&&(le=new h("chunk",["string","Buffer","Uint8Array"],L)),le}E.prototype.isPaused=function(){return this._readableState.flowing===!1},E.prototype.setEncoding=function(F){v||(v=vd().StringDecoder);var L=new v(F);this._readableState.decoder=L,this._readableState.encoding=this._readableState.decoder.encoding;for(var le=this._readableState.buffer.head,S="";le!==null;)S+=L.write(le.data),le=le.next;return this._readableState.buffer.clear(),S!==""&&this._readableState.buffer.push(S),this._readableState.length=S.length,this};var H=1073741824;function A(F){return F>=H?F=H:(F--,F|=F>>>1,F|=F>>>2,F|=F>>>4,F|=F>>>8,F|=F>>>16,F++),F}function J(F,L){return F<=0||L.length===0&&L.ended?0:L.objectMode?1:F!==F?L.flowing&&L.length?L.buffer.head.data.length:L.length:(F>L.highWaterMark&&(L.highWaterMark=A(F)),F<=L.length?F:L.ended?L.length:(L.needReadable=!0,0))}E.prototype.read=function(F){l("read",F),F=parseInt(F,10);var L=this._readableState,le=F;if(F!==0&&(L.emittedReadable=!1),F===0&&L.needReadable&&((L.highWaterMark!==0?L.length>=L.highWaterMark:L.length>0)||L.ended))return l("read: emitReadable",L.length,L.ended),L.length===0&&L.ended?T(this):W(this),null;if(F=J(F,L),F===0&&L.ended)return L.length===0&&T(this),null;var S=L.needReadable;l("need readable",S),(L.length===0||L.length-F<L.highWaterMark)&&(S=!0,l("length less than watermark",S)),L.ended||L.reading?(S=!1,l("reading or ended",S)):S&&(l("do read"),L.reading=!0,L.sync=!0,L.length===0&&(L.needReadable=!0),this._read(L.highWaterMark),L.sync=!1,L.reading||(F=J(le,L)));var re;return F>0?re=$(F,L):re=null,re===null?(L.needReadable=L.length<=L.highWaterMark,F=0):(L.length-=F,L.awaitDrain=0),L.length===0&&(L.ended||(L.needReadable=!0),le!==F&&L.ended&&T(this)),re!==null&&this.emit("data",re),re};function ie(F,L){if(l("onEofChunk"),!L.ended){if(L.decoder){var le=L.decoder.end();le&&le.length&&(L.buffer.push(le),L.length+=L.objectMode?1:le.length)}L.ended=!0,L.sync?W(F):(L.needReadable=!1,L.emittedReadable||(L.emittedReadable=!0,ce(F)))}}function W(F){var L=F._readableState;l("emitReadable",L.needReadable,L.emittedReadable),L.needReadable=!1,L.emittedReadable||(l("emitReadable",L.flowing),L.emittedReadable=!0,Se.nextTick(ce,F))}function ce(F){var L=F._readableState;l("emitReadable_",L.destroyed,L.length,L.ended),!L.destroyed&&(L.length||L.ended)&&(F.emit("readable"),L.emittedReadable=!1),L.needReadable=!L.flowing&&!L.ended&&L.length<=L.highWaterMark,Y(F)}function X(F,L){L.readingMore||(L.readingMore=!0,Se.nextTick(ue,F,L))}function ue(F,L){for(;!L.reading&&!L.ended&&(L.length<L.highWaterMark||L.flowing&&L.length===0);){var le=L.length;if(l("maybeReadMore read 0"),F.read(0),le===L.length)break}L.readingMore=!1}E.prototype._read=function(F){C(this,new y("_read()"))},E.prototype.pipe=function(F,L){var le=this,S=this._readableState;switch(S.pipesCount){case 0:S.pipes=F;break;case 1:S.pipes=[S.pipes,F];break;default:S.pipes.push(F);break}S.pipesCount+=1,l("pipe count=%d opts=%j",S.pipesCount,L);var re=(!L||L.end!==!1)&&F!==Se.stdout&&F!==Se.stderr,Q=re?V:be;S.endEmitted?Se.nextTick(Q):le.once("end",Q),F.on("unpipe",z);function z(ze,Ce){l("onunpipe"),ze===le&&Ce&&Ce.hasUnpiped===!1&&(Ce.hasUnpiped=!0,fe())}function V(){l("onend"),F.end()}var j=Z(le);F.on("drain",j);var de=!1;function fe(){l("cleanup"),F.removeListener("close",we),F.removeListener("finish",he),F.removeListener("drain",j),F.removeListener("error",me),F.removeListener("unpipe",z),le.removeListener("end",V),le.removeListener("end",be),le.removeListener("data",ae),de=!0,S.awaitDrain&&(!F._writableState||F._writableState.needDrain)&&j()}le.on("data",ae);function ae(ze){l("ondata");var Ce=F.write(ze);l("dest.write",Ce),Ce===!1&&((S.pipesCount===1&&S.pipes===F||S.pipesCount>1&&q(S.pipes,F)!==-1)&&!de&&(l("false write response, pause",S.awaitDrain),S.awaitDrain++),le.pause())}function me(ze){l("onerror",ze),be(),F.removeListener("error",me),e(F,"error")===0&&C(F,ze)}M(F,"error",me);function we(){F.removeListener("finish",he),be()}F.once("close",we);function he(){l("onfinish"),F.removeListener("close",we),be()}F.once("finish",he);function be(){l("unpipe"),le.unpipe(F)}return F.emit("pipe",le),S.flowing||(l("pipe resume"),le.resume()),F};function Z(F){return function(){var L=F._readableState;l("pipeOnDrain",L.awaitDrain),L.awaitDrain&&L.awaitDrain--,L.awaitDrain===0&&e(F,"data")&&(L.flowing=!0,Y(F))}}E.prototype.unpipe=function(F){var L=this._readableState,le={hasUnpiped:!1};if(L.pipesCount===0)return this;if(L.pipesCount===1)return F&&F!==L.pipes?this:(F||(F=L.pipes),L.pipes=null,L.pipesCount=0,L.flowing=!1,F&&F.emit("unpipe",this,le),this);if(!F){var S=L.pipes,re=L.pipesCount;L.pipes=null,L.pipesCount=0,L.flowing=!1;for(var Q=0;Q<re;Q++)S[Q].emit("unpipe",this,{hasUnpiped:!1});return this}var z=q(L.pipes,F);return z===-1?this:(L.pipes.splice(z,1),L.pipesCount-=1,L.pipesCount===1&&(L.pipes=L.pipes[0]),F.emit("unpipe",this,le),this)},E.prototype.on=function(F,L){var le=n.prototype.on.call(this,F,L),S=this._readableState;return F==="data"?(S.readableListening=this.listenerCount("readable")>0,S.flowing!==!1&&this.resume()):F==="readable"&&!S.endEmitted&&!S.readableListening&&(S.readableListening=S.needReadable=!0,S.flowing=!1,S.emittedReadable=!1,l("on readable",S.length,S.reading),S.length?W(this):S.reading||Se.nextTick(ee,this)),le},E.prototype.addListener=E.prototype.on,E.prototype.removeListener=function(F,L){var le=n.prototype.removeListener.call(this,F,L);return F==="readable"&&Se.nextTick(R,this),le},E.prototype.removeAllListeners=function(F){var L=n.prototype.removeAllListeners.apply(this,arguments);return(F==="readable"||F===void 0)&&Se.nextTick(R,this),L};function R(F){var L=F._readableState;L.readableListening=F.listenerCount("readable")>0,L.resumeScheduled&&!L.paused?L.flowing=!0:F.listenerCount("data")>0&&F.resume()}function ee(F){l("readable nexttick read 0"),F.read(0)}E.prototype.resume=function(){var F=this._readableState;return F.flowing||(l("resume"),F.flowing=!F.readableListening,ne(this,F)),F.paused=!1,this};function ne(F,L){L.resumeScheduled||(L.resumeScheduled=!0,Se.nextTick(se,F,L))}function se(F,L){l("resume",L.reading),L.reading||F.read(0),L.resumeScheduled=!1,F.emit("resume"),Y(F),L.flowing&&!L.reading&&F.read(0)}E.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 Y(F){var L=F._readableState;for(l("flow",L.flowing);L.flowing&&F.read()!==null;);}E.prototype.wrap=function(F){var L=this,le=this._readableState,S=!1;F.on("end",function(){if(l("wrapped end"),le.decoder&&!le.ended){var z=le.decoder.end();z&&z.length&&L.push(z)}L.push(null)}),F.on("data",function(z){if(l("wrapped data"),le.decoder&&(z=le.decoder.write(z)),!(le.objectMode&&z==null)&&!(!le.objectMode&&(!z||!z.length))){var V=L.push(z);V||(S=!0,F.pause())}});for(var re in F)this[re]===void 0&&typeof F[re]=="function"&&(this[re]=function(z){return function(){return F[z].apply(F,arguments)}}(re));for(var Q=0;Q<D.length;Q++)F.on(D[Q],this.emit.bind(this,D[Q]));return this._read=function(z){l("wrapped _read",z),S&&(S=!1,F.resume())},this},typeof Symbol=="function"&&(E.prototype[Symbol.asyncIterator]=function(){return k===void 0&&(k=UA()),k(this)}),Object.defineProperty(E.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(E.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(E.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(F){this._readableState&&(this._readableState.flowing=F)}}),E._fromList=$,Object.defineProperty(E.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function $(F,L){if(L.length===0)return null;var le;return L.objectMode?le=L.buffer.shift():!F||F>=L.length?(L.decoder?le=L.buffer.join(""):L.buffer.length===1?le=L.buffer.first():le=L.buffer.concat(L.length),L.buffer.clear()):le=L.buffer.consume(F,L.decoder),le}function T(F){var L=F._readableState;l("endReadable",L.endEmitted),L.endEmitted||(L.ended=!0,Se.nextTick(K,L,F))}function K(F,L){if(l("endReadableNT",F.endEmitted,F.length),!F.endEmitted&&F.length===0&&(F.endEmitted=!0,L.readable=!1,L.emit("end"),F.autoDestroy)){var le=L._writableState;(!le||le.autoDestroy&&le.finished)&&L.destroy()}}typeof Symbol=="function"&&(E.from=function(F,L){return b===void 0&&(b=HA()),b(E,F,L)});function q(F,L){for(var le=0,S=F.length;le<S;le++)if(F[le]===L)return le;return-1}return uu}var du,rg;function Ob(){if(rg)return du;rg=1,du=a;var t=vi().codes,e=t.ERR_METHOD_NOT_IMPLEMENTED,n=t.ERR_MULTIPLE_CALLBACK,r=t.ERR_TRANSFORM_ALREADY_TRANSFORMING,o=t.ERR_TRANSFORM_WITH_LENGTH_0,i=ti();ko()(a,i);function s(u,d){var p=this._transformState;p.transforming=!1;var f=p.writecb;if(f===null)return this.emit("error",new n);p.writechunk=null,p.writecb=null,d!=null&&this.push(d),f(u);var h=this._readableState;h.reading=!1,(h.needReadable||h.length<h.highWaterMark)&&this._read(h.highWaterMark)}function a(u){if(!(this instanceof a))return new a(u);i.call(this,u),this._transformState={afterTransform:s.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,u&&(typeof u.transform=="function"&&(this._transform=u.transform),typeof u.flush=="function"&&(this._flush=u.flush)),this.on("prefinish",l)}function l(){var u=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(d,p){c(u,d,p)}):c(this,null,null)}a.prototype.push=function(u,d){return this._transformState.needTransform=!1,i.prototype.push.call(this,u,d)},a.prototype._transform=function(u,d,p){p(new e("_transform()"))},a.prototype._write=function(u,d,p){var f=this._transformState;if(f.writecb=p,f.writechunk=u,f.writeencoding=d,!f.transforming){var h=this._readableState;(f.needTransform||h.needReadable||h.length<h.highWaterMark)&&this._read(h.highWaterMark)}},a.prototype._read=function(u){var d=this._transformState;d.writechunk!==null&&!d.transforming?(d.transforming=!0,this._transform(d.writechunk,d.writeencoding,d.afterTransform)):d.needTransform=!0},a.prototype._destroy=function(u,d){i.prototype._destroy.call(this,u,function(p){d(p)})};function c(u,d,p){if(d)return u.emit("error",d);if(p!=null&&u.push(p),u._writableState.length)throw new o;if(u._transformState.transforming)throw new r;return u.push(null)}return du}var pu,og;function WA(){if(og)return pu;og=1,pu=e;var t=Ob();ko()(e,t);function e(n){if(!(this instanceof e))return new e(n);t.call(this,n)}return e.prototype._transform=function(n,r,o){o(null,n)},pu}var fu,ig;function GA(){if(ig)return fu;ig=1;var t;function e(p){var f=!1;return function(){f||(f=!0,p.apply(void 0,arguments))}}var n=vi().codes,r=n.ERR_MISSING_ARGS,o=n.ERR_STREAM_DESTROYED;function i(p){if(p)throw p}function s(p){return p.setHeader&&typeof p.abort=="function"}function a(p,f,h,m){m=e(m);var y=!1;p.on("close",function(){y=!0}),t===void 0&&(t=Zp()),t(p,{readable:f,writable:h},function(v){if(v)return m(v);y=!0,m()});var g=!1;return function(v){if(!y&&!g){if(g=!0,s(p))return p.abort();if(typeof p.destroy=="function")return p.destroy();m(v||new o("pipe"))}}}function l(p){p()}function c(p,f){return p.pipe(f)}function u(p){return!p.length||typeof p[p.length-1]!="function"?i:p.pop()}function d(){for(var p=arguments.length,f=new Array(p),h=0;h<p;h++)f[h]=arguments[h];var m=u(f);if(Array.isArray(f[0])&&(f=f[0]),f.length<2)throw new r("streams");var y,g=f.map(function(v,k){var b=k<f.length-1,C=k>0;return a(v,b,C,function(D){y||(y=D),D&&g.forEach(l),!b&&(g.forEach(l),m(y))})});return f.reduce(c)}return fu=d,fu}var hu,sg;function KA(){if(sg)return hu;sg=1,hu=n;var t=Gp().EventEmitter,e=ko();e(n,t),n.Readable=$b(),n.Writable=Tb(),n.Duplex=ti(),n.Transform=Ob(),n.PassThrough=WA(),n.finished=Zp(),n.pipeline=GA(),n.Stream=n;function n(){t.call(this)}return n.prototype.pipe=function(r,o){var i=this;function s(f){r.writable&&r.write(f)===!1&&i.pause&&i.pause()}i.on("data",s);function a(){i.readable&&i.resume&&i.resume()}r.on("drain",a),!r._isStdio&&(!o||o.end!==!1)&&(i.on("end",c),i.on("close",u));var l=!1;function c(){l||(l=!0,r.end())}function u(){l||(l=!0,typeof r.destroy=="function"&&r.destroy())}function d(f){if(p(),t.listenerCount(this,"error")===0)throw f}i.on("error",d),r.on("error",d);function p(){i.removeListener("data",s),r.removeListener("drain",a),i.removeListener("end",c),i.removeListener("close",u),i.removeListener("error",d),r.removeListener("error",d),i.removeListener("end",p),i.removeListener("close",p),r.removeListener("close",p)}return i.on("end",p),i.on("close",p),r.on("close",p),r.emit("pipe",i),r},hu}(function(t){(function(e){e.parser=function($,T){return new r($,T)},e.SAXParser=r,e.SAXStream=u,e.createStream=c,e.MAX_BUFFER_LENGTH=64*1024;var n=["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 r($,T){if(!(this instanceof r))return new r($,T);var K=this;i(K),K.q=K.c="",K.bufferCheckPosition=e.MAX_BUFFER_LENGTH,K.opt=T||{},K.opt.lowercase=K.opt.lowercase||K.opt.lowercasetags,K.looseCase=K.opt.lowercase?"toLowerCase":"toUpperCase",K.tags=[],K.closed=K.closedRoot=K.sawRoot=!1,K.tag=K.error=null,K.strict=!!$,K.noscript=!!($||K.opt.noscript),K.state=E.BEGIN,K.strictEntities=K.opt.strictEntities,K.ENTITIES=K.strictEntities?Object.create(e.XML_ENTITIES):Object.create(e.ENTITIES),K.attribList=[],K.opt.xmlns&&(K.ns=Object.create(m)),K.opt.unquotedAttributeValues===void 0&&(K.opt.unquotedAttributeValues=!$),K.trackPosition=K.opt.position!==!1,K.trackPosition&&(K.position=K.line=K.column=0),oe(K,"onready")}Object.create||(Object.create=function($){function T(){}T.prototype=$;var K=new T;return K}),Object.keys||(Object.keys=function($){var T=[];for(var K in $)$.hasOwnProperty(K)&&T.push(K);return T});function o($){for(var T=Math.max(e.MAX_BUFFER_LENGTH,10),K=0,q=0,F=n.length;q<F;q++){var L=$[n[q]].length;if(L>T)switch(n[q]){case"textNode":H($);break;case"cdata":N($,"oncdata",$.cdata),$.cdata="";break;case"script":N($,"onscript",$.script),$.script="";break;default:J($,"Max buffer length exceeded: "+n[q])}K=Math.max(K,L)}var le=e.MAX_BUFFER_LENGTH-K;$.bufferCheckPosition=le+$.position}function i($){for(var T=0,K=n.length;T<K;T++)$[n[T]]=""}function s($){H($),$.cdata!==""&&(N($,"oncdata",$.cdata),$.cdata=""),$.script!==""&&(N($,"onscript",$.script),$.script="")}r.prototype={end:function(){ie(this)},write:Y,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){s(this)}};var a;try{a=KA().Stream}catch{a=function(){}}a||(a=function(){});var l=e.EVENTS.filter(function($){return $!=="error"&&$!=="end"});function c($,T){return new u($,T)}function u($,T){if(!(this instanceof u))return new u($,T);a.apply(this),this._parser=new r($,T),this.writable=!0,this.readable=!0;var K=this;this._parser.onend=function(){K.emit("end")},this._parser.onerror=function(q){K.emit("error",q),K._parser.error=null},this._decoder=null,l.forEach(function(q){Object.defineProperty(K,"on"+q,{get:function(){return K._parser["on"+q]},set:function(F){if(!F)return K.removeAllListeners(q),K._parser["on"+q]=F,F;K.on(q,F)},enumerable:!0,configurable:!1})})}u.prototype=Object.create(a.prototype,{constructor:{value:u}}),u.prototype.write=function($){if(typeof mt=="function"&&typeof mt.isBuffer=="function"&&mt.isBuffer($)){if(!this._decoder){var T=vd().StringDecoder;this._decoder=new T("utf8")}$=this._decoder.write($)}return this._parser.write($.toString()),this.emit("data",$),!0},u.prototype.end=function($){return $&&$.length&&this.write($),this._parser.end(),!0},u.prototype.on=function($,T){var K=this;return!K._parser["on"+$]&&l.indexOf($)!==-1&&(K._parser["on"+$]=function(){var q=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);q.splice(0,0,$),K.emit.apply(K,q)}),a.prototype.on.call(K,$,T)};var d="[CDATA[",p="DOCTYPE",f="http://www.w3.org/XML/1998/namespace",h="http://www.w3.org/2000/xmlns/",m={xml:f,xmlns:h},y=/[:_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]/,g=/[:_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-]/,v=/[#:_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]/,k=/[#:_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 b($){return $===" "||$===`
16
+ `||$==="\r"||$===" "}function C($){return $==='"'||$==="'"}function D($){return $===">"||b($)}function M($,T){return $.test(T)}function I($,T){return!M($,T)}var E=0;e.STATE={BEGIN:E++,BEGIN_WHITESPACE:E++,TEXT:E++,TEXT_ENTITY:E++,OPEN_WAKA:E++,SGML_DECL:E++,SGML_DECL_QUOTED:E++,DOCTYPE:E++,DOCTYPE_QUOTED:E++,DOCTYPE_DTD:E++,DOCTYPE_DTD_QUOTED:E++,COMMENT_STARTING:E++,COMMENT:E++,COMMENT_ENDING:E++,COMMENT_ENDED:E++,CDATA:E++,CDATA_ENDING:E++,CDATA_ENDING_2:E++,PROC_INST:E++,PROC_INST_BODY:E++,PROC_INST_ENDING:E++,OPEN_TAG:E++,OPEN_TAG_SLASH:E++,ATTRIB:E++,ATTRIB_NAME:E++,ATTRIB_NAME_SAW_WHITE:E++,ATTRIB_VALUE:E++,ATTRIB_VALUE_QUOTED:E++,ATTRIB_VALUE_CLOSED:E++,ATTRIB_VALUE_UNQUOTED:E++,ATTRIB_VALUE_ENTITY_Q:E++,ATTRIB_VALUE_ENTITY_U:E++,CLOSE_TAG:E++,CLOSE_TAG_SAW_WHITE:E++,SCRIPT:E++,SCRIPT_ENDING:E++},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($){var T=e.ENTITIES[$],K=typeof T=="number"?String.fromCharCode(T):T;e.ENTITIES[$]=K});for(var G in e.STATE)e.STATE[e.STATE[G]]=G;E=e.STATE;function oe($,T,K){$[T]&&$[T](K)}function N($,T,K){$.textNode&&H($),oe($,T,K)}function H($){$.textNode=A($.opt,$.textNode),$.textNode&&oe($,"ontext",$.textNode),$.textNode=""}function A($,T){return $.trim&&(T=T.trim()),$.normalize&&(T=T.replace(/\s+/g," ")),T}function J($,T){return H($),$.trackPosition&&(T+=`
17
+ Line: `+$.line+`
18
+ Column: `+$.column+`
19
+ Char: `+$.c),T=new Error(T),$.error=T,oe($,"onerror",T),$}function ie($){return $.sawRoot&&!$.closedRoot&&W($,"Unclosed root tag"),$.state!==E.BEGIN&&$.state!==E.BEGIN_WHITESPACE&&$.state!==E.TEXT&&J($,"Unexpected end"),H($),$.c="",$.closed=!0,oe($,"onend"),r.call($,$.strict,$.opt),$}function W($,T){if(typeof $!="object"||!($ instanceof r))throw new Error("bad call to strictFail");$.strict&&J($,T)}function ce($){$.strict||($.tagName=$.tagName[$.looseCase]());var T=$.tags[$.tags.length-1]||$,K=$.tag={name:$.tagName,attributes:{}};$.opt.xmlns&&(K.ns=T.ns),$.attribList.length=0,N($,"onopentagstart",K)}function X($,T){var K=$.indexOf(":"),q=K<0?["",$]:$.split(":"),F=q[0],L=q[1];return T&&$==="xmlns"&&(F="xmlns",L=""),{prefix:F,local:L}}function ue($){if($.strict||($.attribName=$.attribName[$.looseCase]()),$.attribList.indexOf($.attribName)!==-1||$.tag.attributes.hasOwnProperty($.attribName)){$.attribName=$.attribValue="";return}if($.opt.xmlns){var T=X($.attribName,!0),K=T.prefix,q=T.local;if(K==="xmlns")if(q==="xml"&&$.attribValue!==f)W($,"xml: prefix must be bound to "+f+`
20
+ Actual: `+$.attribValue);else if(q==="xmlns"&&$.attribValue!==h)W($,"xmlns: prefix must be bound to "+h+`
21
+ Actual: `+$.attribValue);else{var F=$.tag,L=$.tags[$.tags.length-1]||$;F.ns===L.ns&&(F.ns=Object.create(L.ns)),F.ns[q]=$.attribValue}$.attribList.push([$.attribName,$.attribValue])}else $.tag.attributes[$.attribName]=$.attribValue,N($,"onattribute",{name:$.attribName,value:$.attribValue});$.attribName=$.attribValue=""}function Z($,T){if($.opt.xmlns){var K=$.tag,q=X($.tagName);K.prefix=q.prefix,K.local=q.local,K.uri=K.ns[q.prefix]||"",K.prefix&&!K.uri&&(W($,"Unbound namespace prefix: "+JSON.stringify($.tagName)),K.uri=q.prefix);var F=$.tags[$.tags.length-1]||$;K.ns&&F.ns!==K.ns&&Object.keys(K.ns).forEach(function(ae){N($,"onopennamespace",{prefix:ae,uri:K.ns[ae]})});for(var L=0,le=$.attribList.length;L<le;L++){var S=$.attribList[L],re=S[0],Q=S[1],z=X(re,!0),V=z.prefix,j=z.local,de=V===""?"":K.ns[V]||"",fe={name:re,value:Q,prefix:V,local:j,uri:de};V&&V!=="xmlns"&&!de&&(W($,"Unbound namespace prefix: "+JSON.stringify(V)),fe.uri=V),$.tag.attributes[re]=fe,N($,"onattribute",fe)}$.attribList.length=0}$.tag.isSelfClosing=!!T,$.sawRoot=!0,$.tags.push($.tag),N($,"onopentag",$.tag),T||(!$.noscript&&$.tagName.toLowerCase()==="script"?$.state=E.SCRIPT:$.state=E.TEXT,$.tag=null,$.tagName=""),$.attribName=$.attribValue="",$.attribList.length=0}function R($){if(!$.tagName){W($,"Weird empty close tag."),$.textNode+="</>",$.state=E.TEXT;return}if($.script){if($.tagName!=="script"){$.script+="</"+$.tagName+">",$.tagName="",$.state=E.SCRIPT;return}N($,"onscript",$.script),$.script=""}var T=$.tags.length,K=$.tagName;$.strict||(K=K[$.looseCase]());for(var q=K;T--;){var F=$.tags[T];if(F.name!==q)W($,"Unexpected close tag");else break}if(T<0){W($,"Unmatched closing tag: "+$.tagName),$.textNode+="</"+$.tagName+">",$.state=E.TEXT;return}$.tagName=K;for(var L=$.tags.length;L-- >T;){var le=$.tag=$.tags.pop();$.tagName=$.tag.name,N($,"onclosetag",$.tagName);var S={};for(var re in le.ns)S[re]=le.ns[re];var Q=$.tags[$.tags.length-1]||$;$.opt.xmlns&&le.ns!==Q.ns&&Object.keys(le.ns).forEach(function(z){var V=le.ns[z];N($,"onclosenamespace",{prefix:z,uri:V})})}T===0&&($.closedRoot=!0),$.tagName=$.attribValue=$.attribName="",$.attribList.length=0,$.state=E.TEXT}function ee($){var T=$.entity,K=T.toLowerCase(),q,F="";return $.ENTITIES[T]?$.ENTITIES[T]:$.ENTITIES[K]?$.ENTITIES[K]:(T=K,T.charAt(0)==="#"&&(T.charAt(1)==="x"?(T=T.slice(2),q=parseInt(T,16),F=q.toString(16)):(T=T.slice(1),q=parseInt(T,10),F=q.toString(10))),T=T.replace(/^0+/,""),isNaN(q)||F.toLowerCase()!==T?(W($,"Invalid character entity"),"&"+$.entity+";"):String.fromCodePoint(q))}function ne($,T){T==="<"?($.state=E.OPEN_WAKA,$.startTagPosition=$.position):b(T)||(W($,"Non-whitespace before first tag."),$.textNode=T,$.state=E.TEXT)}function se($,T){var K="";return T<$.length&&(K=$.charAt(T)),K}function Y($){var T=this;if(this.error)throw this.error;if(T.closed)return J(T,"Cannot write after close. Assign an onready handler.");if($===null)return ie(T);typeof $=="object"&&($=$.toString());for(var K=0,q="";q=se($,K++),T.c=q,!!q;)switch(T.trackPosition&&(T.position++,q===`
22
+ `?(T.line++,T.column=0):T.column++),T.state){case E.BEGIN:if(T.state=E.BEGIN_WHITESPACE,q==="\uFEFF")continue;ne(T,q);continue;case E.BEGIN_WHITESPACE:ne(T,q);continue;case E.TEXT:if(T.sawRoot&&!T.closedRoot){for(var F=K-1;q&&q!=="<"&&q!=="&";)q=se($,K++),q&&T.trackPosition&&(T.position++,q===`
23
+ `?(T.line++,T.column=0):T.column++);T.textNode+=$.substring(F,K-1)}q==="<"&&!(T.sawRoot&&T.closedRoot&&!T.strict)?(T.state=E.OPEN_WAKA,T.startTagPosition=T.position):(!b(q)&&(!T.sawRoot||T.closedRoot)&&W(T,"Text data outside of root node."),q==="&"?T.state=E.TEXT_ENTITY:T.textNode+=q);continue;case E.SCRIPT:q==="<"?T.state=E.SCRIPT_ENDING:T.script+=q;continue;case E.SCRIPT_ENDING:q==="/"?T.state=E.CLOSE_TAG:(T.script+="<"+q,T.state=E.SCRIPT);continue;case E.OPEN_WAKA:if(q==="!")T.state=E.SGML_DECL,T.sgmlDecl="";else if(!b(q))if(M(y,q))T.state=E.OPEN_TAG,T.tagName=q;else if(q==="/")T.state=E.CLOSE_TAG,T.tagName="";else if(q==="?")T.state=E.PROC_INST,T.procInstName=T.procInstBody="";else{if(W(T,"Unencoded <"),T.startTagPosition+1<T.position){var L=T.position-T.startTagPosition;q=new Array(L).join(" ")+q}T.textNode+="<"+q,T.state=E.TEXT}continue;case E.SGML_DECL:if(T.sgmlDecl+q==="--"){T.state=E.COMMENT,T.comment="",T.sgmlDecl="";continue}T.doctype&&T.doctype!==!0&&T.sgmlDecl?(T.state=E.DOCTYPE_DTD,T.doctype+="<!"+T.sgmlDecl+q,T.sgmlDecl=""):(T.sgmlDecl+q).toUpperCase()===d?(N(T,"onopencdata"),T.state=E.CDATA,T.sgmlDecl="",T.cdata=""):(T.sgmlDecl+q).toUpperCase()===p?(T.state=E.DOCTYPE,(T.doctype||T.sawRoot)&&W(T,"Inappropriately located doctype declaration"),T.doctype="",T.sgmlDecl=""):q===">"?(N(T,"onsgmldeclaration",T.sgmlDecl),T.sgmlDecl="",T.state=E.TEXT):(C(q)&&(T.state=E.SGML_DECL_QUOTED),T.sgmlDecl+=q);continue;case E.SGML_DECL_QUOTED:q===T.q&&(T.state=E.SGML_DECL,T.q=""),T.sgmlDecl+=q;continue;case E.DOCTYPE:q===">"?(T.state=E.TEXT,N(T,"ondoctype",T.doctype),T.doctype=!0):(T.doctype+=q,q==="["?T.state=E.DOCTYPE_DTD:C(q)&&(T.state=E.DOCTYPE_QUOTED,T.q=q));continue;case E.DOCTYPE_QUOTED:T.doctype+=q,q===T.q&&(T.q="",T.state=E.DOCTYPE);continue;case E.DOCTYPE_DTD:q==="]"?(T.doctype+=q,T.state=E.DOCTYPE):q==="<"?(T.state=E.OPEN_WAKA,T.startTagPosition=T.position):C(q)?(T.doctype+=q,T.state=E.DOCTYPE_DTD_QUOTED,T.q=q):T.doctype+=q;continue;case E.DOCTYPE_DTD_QUOTED:T.doctype+=q,q===T.q&&(T.state=E.DOCTYPE_DTD,T.q="");continue;case E.COMMENT:q==="-"?T.state=E.COMMENT_ENDING:T.comment+=q;continue;case E.COMMENT_ENDING:q==="-"?(T.state=E.COMMENT_ENDED,T.comment=A(T.opt,T.comment),T.comment&&N(T,"oncomment",T.comment),T.comment=""):(T.comment+="-"+q,T.state=E.COMMENT);continue;case E.COMMENT_ENDED:q!==">"?(W(T,"Malformed comment"),T.comment+="--"+q,T.state=E.COMMENT):T.doctype&&T.doctype!==!0?T.state=E.DOCTYPE_DTD:T.state=E.TEXT;continue;case E.CDATA:q==="]"?T.state=E.CDATA_ENDING:T.cdata+=q;continue;case E.CDATA_ENDING:q==="]"?T.state=E.CDATA_ENDING_2:(T.cdata+="]"+q,T.state=E.CDATA);continue;case E.CDATA_ENDING_2:q===">"?(T.cdata&&N(T,"oncdata",T.cdata),N(T,"onclosecdata"),T.cdata="",T.state=E.TEXT):q==="]"?T.cdata+="]":(T.cdata+="]]"+q,T.state=E.CDATA);continue;case E.PROC_INST:q==="?"?T.state=E.PROC_INST_ENDING:b(q)?T.state=E.PROC_INST_BODY:T.procInstName+=q;continue;case E.PROC_INST_BODY:if(!T.procInstBody&&b(q))continue;q==="?"?T.state=E.PROC_INST_ENDING:T.procInstBody+=q;continue;case E.PROC_INST_ENDING:q===">"?(N(T,"onprocessinginstruction",{name:T.procInstName,body:T.procInstBody}),T.procInstName=T.procInstBody="",T.state=E.TEXT):(T.procInstBody+="?"+q,T.state=E.PROC_INST_BODY);continue;case E.OPEN_TAG:M(g,q)?T.tagName+=q:(ce(T),q===">"?Z(T):q==="/"?T.state=E.OPEN_TAG_SLASH:(b(q)||W(T,"Invalid character in tag name"),T.state=E.ATTRIB));continue;case E.OPEN_TAG_SLASH:q===">"?(Z(T,!0),R(T)):(W(T,"Forward-slash in opening tag not followed by >"),T.state=E.ATTRIB);continue;case E.ATTRIB:if(b(q))continue;q===">"?Z(T):q==="/"?T.state=E.OPEN_TAG_SLASH:M(y,q)?(T.attribName=q,T.attribValue="",T.state=E.ATTRIB_NAME):W(T,"Invalid attribute name");continue;case E.ATTRIB_NAME:q==="="?T.state=E.ATTRIB_VALUE:q===">"?(W(T,"Attribute without value"),T.attribValue=T.attribName,ue(T),Z(T)):b(q)?T.state=E.ATTRIB_NAME_SAW_WHITE:M(g,q)?T.attribName+=q:W(T,"Invalid attribute name");continue;case E.ATTRIB_NAME_SAW_WHITE:if(q==="=")T.state=E.ATTRIB_VALUE;else{if(b(q))continue;W(T,"Attribute without value"),T.tag.attributes[T.attribName]="",T.attribValue="",N(T,"onattribute",{name:T.attribName,value:""}),T.attribName="",q===">"?Z(T):M(y,q)?(T.attribName=q,T.state=E.ATTRIB_NAME):(W(T,"Invalid attribute name"),T.state=E.ATTRIB)}continue;case E.ATTRIB_VALUE:if(b(q))continue;C(q)?(T.q=q,T.state=E.ATTRIB_VALUE_QUOTED):(T.opt.unquotedAttributeValues||J(T,"Unquoted attribute value"),T.state=E.ATTRIB_VALUE_UNQUOTED,T.attribValue=q);continue;case E.ATTRIB_VALUE_QUOTED:if(q!==T.q){q==="&"?T.state=E.ATTRIB_VALUE_ENTITY_Q:T.attribValue+=q;continue}ue(T),T.q="",T.state=E.ATTRIB_VALUE_CLOSED;continue;case E.ATTRIB_VALUE_CLOSED:b(q)?T.state=E.ATTRIB:q===">"?Z(T):q==="/"?T.state=E.OPEN_TAG_SLASH:M(y,q)?(W(T,"No whitespace between attributes"),T.attribName=q,T.attribValue="",T.state=E.ATTRIB_NAME):W(T,"Invalid attribute name");continue;case E.ATTRIB_VALUE_UNQUOTED:if(!D(q)){q==="&"?T.state=E.ATTRIB_VALUE_ENTITY_U:T.attribValue+=q;continue}ue(T),q===">"?Z(T):T.state=E.ATTRIB;continue;case E.CLOSE_TAG:if(T.tagName)q===">"?R(T):M(g,q)?T.tagName+=q:T.script?(T.script+="</"+T.tagName,T.tagName="",T.state=E.SCRIPT):(b(q)||W(T,"Invalid tagname in closing tag"),T.state=E.CLOSE_TAG_SAW_WHITE);else{if(b(q))continue;I(y,q)?T.script?(T.script+="</"+q,T.state=E.SCRIPT):W(T,"Invalid tagname in closing tag."):T.tagName=q}continue;case E.CLOSE_TAG_SAW_WHITE:if(b(q))continue;q===">"?R(T):W(T,"Invalid characters in closing tag");continue;case E.TEXT_ENTITY:case E.ATTRIB_VALUE_ENTITY_Q:case E.ATTRIB_VALUE_ENTITY_U:var le,S;switch(T.state){case E.TEXT_ENTITY:le=E.TEXT,S="textNode";break;case E.ATTRIB_VALUE_ENTITY_Q:le=E.ATTRIB_VALUE_QUOTED,S="attribValue";break;case E.ATTRIB_VALUE_ENTITY_U:le=E.ATTRIB_VALUE_UNQUOTED,S="attribValue";break}if(q===";"){var re=ee(T);T.opt.unparsedEntities&&!Object.values(e.XML_ENTITIES).includes(re)?(T.entity="",T.state=le,T.write(re)):(T[S]+=re,T.entity="",T.state=le)}else M(T.entity.length?k:v,q)?T.entity+=q:(W(T,"Invalid character in entity name"),T[S]+="&"+T.entity+q,T.entity="",T.state=le);continue;default:throw new Error(T,"Unknown state: "+T.state)}return T.position>=T.bufferCheckPosition&&o(T),T}/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */String.fromCodePoint||function(){var $=String.fromCharCode,T=Math.floor,K=function(){var q=16384,F=[],L,le,S=-1,re=arguments.length;if(!re)return"";for(var Q="";++S<re;){var z=Number(arguments[S]);if(!isFinite(z)||z<0||z>1114111||T(z)!==z)throw RangeError("Invalid code point: "+z);z<=65535?F.push(z):(z-=65536,L=(z>>10)+55296,le=z%1024+56320,F.push(L,le)),(S+1===re||F.length>q)&&(Q+=$.apply(null,F),F.length=0)}return Q};Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:K,configurable:!0,writable:!0}):String.fromCodePoint=K}()})(t)})(cb);var Qp={isArray:function(t){return Array.isArray?Array.isArray(t):Object.prototype.toString.call(t)==="[object Array]"}},JA=Qp.isArray,ef={copyOptions:function(t){var e,n={};for(e in t)t.hasOwnProperty(e)&&(n[e]=t[e]);return n},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"&&!JA(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}},XA=cb,We=ef,Ko=Qp.isArray,pe,Be;function YA(t){return pe=We.copyOptions(t),We.ensureFlagExists("ignoreDeclaration",pe),We.ensureFlagExists("ignoreInstruction",pe),We.ensureFlagExists("ignoreAttributes",pe),We.ensureFlagExists("ignoreText",pe),We.ensureFlagExists("ignoreComment",pe),We.ensureFlagExists("ignoreCdata",pe),We.ensureFlagExists("ignoreDoctype",pe),We.ensureFlagExists("compact",pe),We.ensureFlagExists("alwaysChildren",pe),We.ensureFlagExists("addParent",pe),We.ensureFlagExists("trim",pe),We.ensureFlagExists("nativeType",pe),We.ensureFlagExists("nativeTypeAttributes",pe),We.ensureFlagExists("sanitize",pe),We.ensureFlagExists("instructionHasAttributes",pe),We.ensureFlagExists("captureSpacesBetweenElements",pe),We.ensureAlwaysArrayExists(pe),We.ensureKeyExists("declaration",pe),We.ensureKeyExists("instruction",pe),We.ensureKeyExists("attributes",pe),We.ensureKeyExists("text",pe),We.ensureKeyExists("comment",pe),We.ensureKeyExists("cdata",pe),We.ensureKeyExists("doctype",pe),We.ensureKeyExists("type",pe),We.ensureKeyExists("name",pe),We.ensureKeyExists("elements",pe),We.ensureKeyExists("parent",pe),pe}function Mb(t){var e=Number(t);if(!isNaN(e))return e;var n=t.toLowerCase();return n==="true"?!0:n==="false"?!1:t}function qs(t,e){var n;if(pe.compact){if(!Be[pe[t+"Key"]]&&(Ko(pe.alwaysArray)?pe.alwaysArray.indexOf(pe[t+"Key"])!==-1:pe.alwaysArray)&&(Be[pe[t+"Key"]]=[]),Be[pe[t+"Key"]]&&!Ko(Be[pe[t+"Key"]])&&(Be[pe[t+"Key"]]=[Be[pe[t+"Key"]]]),t+"Fn"in pe&&typeof e=="string"&&(e=pe[t+"Fn"](e,Be)),t==="instruction"&&("instructionFn"in pe||"instructionNameFn"in pe)){for(n in e)if(e.hasOwnProperty(n))if("instructionFn"in pe)e[n]=pe.instructionFn(e[n],n,Be);else{var r=e[n];delete e[n],e[pe.instructionNameFn(n,r,Be)]=r}}Ko(Be[pe[t+"Key"]])?Be[pe[t+"Key"]].push(e):Be[pe[t+"Key"]]=e}else{Be[pe.elementsKey]||(Be[pe.elementsKey]=[]);var o={};if(o[pe.typeKey]=t,t==="instruction"){for(n in e)if(e.hasOwnProperty(n))break;o[pe.nameKey]="instructionNameFn"in pe?pe.instructionNameFn(n,e,Be):n,pe.instructionHasAttributes?(o[pe.attributesKey]=e[n][pe.attributesKey],"instructionFn"in pe&&(o[pe.attributesKey]=pe.instructionFn(o[pe.attributesKey],n,Be))):("instructionFn"in pe&&(e[n]=pe.instructionFn(e[n],n,Be)),o[pe.instructionKey]=e[n])}else t+"Fn"in pe&&(e=pe[t+"Fn"](e,Be)),o[pe[t+"Key"]]=e;pe.addParent&&(o[pe.parentKey]=Be),Be[pe.elementsKey].push(o)}}function Db(t){if("attributesFn"in pe&&t&&(t=pe.attributesFn(t,Be)),(pe.trim||"attributeValueFn"in pe||"attributeNameFn"in pe||pe.nativeTypeAttributes)&&t){var e;for(e in t)if(t.hasOwnProperty(e)&&(pe.trim&&(t[e]=t[e].trim()),pe.nativeTypeAttributes&&(t[e]=Mb(t[e])),"attributeValueFn"in pe&&(t[e]=pe.attributeValueFn(t[e],e,Be)),"attributeNameFn"in pe)){var n=t[e];delete t[e],t[pe.attributeNameFn(e,t[e],Be)]=n}}return t}function ZA(t){var e={};if(t.body&&(t.name.toLowerCase()==="xml"||pe.instructionHasAttributes)){for(var n=/([\w:-]+)\s*=\s*(?:"([^"]*)"|'([^']*)'|(\w+))\s*/g,r;(r=n.exec(t.body))!==null;)e[r[1]]=r[2]||r[3]||r[4];e=Db(e)}if(t.name.toLowerCase()==="xml"){if(pe.ignoreDeclaration)return;Be[pe.declarationKey]={},Object.keys(e).length&&(Be[pe.declarationKey][pe.attributesKey]=e),pe.addParent&&(Be[pe.declarationKey][pe.parentKey]=Be)}else{if(pe.ignoreInstruction)return;pe.trim&&(t.body=t.body.trim());var o={};pe.instructionHasAttributes&&Object.keys(e).length?(o[t.name]={},o[t.name][pe.attributesKey]=e):o[t.name]=t.body,qs("instruction",o)}}function QA(t,e){var n;if(typeof t=="object"&&(e=t.attributes,t=t.name),e=Db(e),"elementNameFn"in pe&&(t=pe.elementNameFn(t,Be)),pe.compact){if(n={},!pe.ignoreAttributes&&e&&Object.keys(e).length){n[pe.attributesKey]={};var r;for(r in e)e.hasOwnProperty(r)&&(n[pe.attributesKey][r]=e[r])}!(t in Be)&&(Ko(pe.alwaysArray)?pe.alwaysArray.indexOf(t)!==-1:pe.alwaysArray)&&(Be[t]=[]),Be[t]&&!Ko(Be[t])&&(Be[t]=[Be[t]]),Ko(Be[t])?Be[t].push(n):Be[t]=n}else Be[pe.elementsKey]||(Be[pe.elementsKey]=[]),n={},n[pe.typeKey]="element",n[pe.nameKey]=t,!pe.ignoreAttributes&&e&&Object.keys(e).length&&(n[pe.attributesKey]=e),pe.alwaysChildren&&(n[pe.elementsKey]=[]),Be[pe.elementsKey].push(n);n[pe.parentKey]=Be,Be=n}function eC(t){pe.ignoreText||!t.trim()&&!pe.captureSpacesBetweenElements||(pe.trim&&(t=t.trim()),pe.nativeType&&(t=Mb(t)),pe.sanitize&&(t=t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")),qs("text",t))}function tC(t){pe.ignoreComment||(pe.trim&&(t=t.trim()),qs("comment",t))}function nC(t){var e=Be[pe.parentKey];pe.addParent||delete Be[pe.parentKey],Be=e}function rC(t){pe.ignoreCdata||(pe.trim&&(t=t.trim()),qs("cdata",t))}function oC(t){pe.ignoreDoctype||(t=t.replace(/^ /,""),pe.trim&&(t=t.trim()),qs("doctype",t))}function iC(t){t.note=t}var _b=function(t,e){var n=XA.parser(!0,{}),r={};if(Be=r,pe=YA(e),n.opt={strictEntities:!0},n.onopentag=QA,n.ontext=eC,n.oncomment=tC,n.onclosetag=nC,n.onerror=iC,n.oncdata=rC,n.ondoctype=oC,n.onprocessinginstruction=ZA,n.write(t).close(),r[pe.elementsKey]){var o=r[pe.elementsKey];delete r[pe.elementsKey],r[pe.elementsKey]=o,delete r.text}return r},ag=ef,sC=_b;function aC(t){var e=ag.copyOptions(t);return ag.ensureSpacesExists(e),e}var lC=function(t,e){var n,r,o,i;return n=aC(e),r=sC(t,n),i="compact"in n&&n.compact?"_parent":"parent","addParent"in n&&n.addParent?o=JSON.stringify(r,function(s,a){return s===i?"_":a},n.spaces):o=JSON.stringify(r,null,n.spaces),o.replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")},Ze=ef,cC=Qp.isArray,_t,Nt;function uC(t){var e=Ze.copyOptions(t);return Ze.ensureFlagExists("ignoreDeclaration",e),Ze.ensureFlagExists("ignoreInstruction",e),Ze.ensureFlagExists("ignoreAttributes",e),Ze.ensureFlagExists("ignoreText",e),Ze.ensureFlagExists("ignoreComment",e),Ze.ensureFlagExists("ignoreCdata",e),Ze.ensureFlagExists("ignoreDoctype",e),Ze.ensureFlagExists("compact",e),Ze.ensureFlagExists("indentText",e),Ze.ensureFlagExists("indentCdata",e),Ze.ensureFlagExists("indentAttributes",e),Ze.ensureFlagExists("indentInstruction",e),Ze.ensureFlagExists("fullTagEmptyElement",e),Ze.ensureFlagExists("noQuotesForNativeAttributes",e),Ze.ensureSpacesExists(e),typeof e.spaces=="number"&&(e.spaces=Array(e.spaces+1).join(" ")),Ze.ensureKeyExists("declaration",e),Ze.ensureKeyExists("instruction",e),Ze.ensureKeyExists("attributes",e),Ze.ensureKeyExists("text",e),Ze.ensureKeyExists("comment",e),Ze.ensureKeyExists("cdata",e),Ze.ensureKeyExists("doctype",e),Ze.ensureKeyExists("type",e),Ze.ensureKeyExists("name",e),Ze.ensureKeyExists("elements",e),e}function On(t,e,n){return(!n&&t.spaces?`
24
+ `:"")+Array(e+1).join(t.spaces)}function Yl(t,e,n){if(e.ignoreAttributes)return"";"attributesFn"in e&&(t=e.attributesFn(t,Nt,_t));var r,o,i,s,a=[];for(r in t)t.hasOwnProperty(r)&&t[r]!==null&&t[r]!==void 0&&(s=e.noQuotesForNativeAttributes&&typeof t[r]!="string"?"":'"',o=""+t[r],o=o.replace(/"/g,"&quot;"),i="attributeNameFn"in e?e.attributeNameFn(r,o,Nt,_t):r,a.push(e.spaces&&e.indentAttributes?On(e,n+1,!1):" "),a.push(i+"="+s+("attributeValueFn"in e?e.attributeValueFn(o,r,Nt,_t):o)+s));return t&&Object.keys(t).length&&e.spaces&&e.indentAttributes&&a.push(On(e,n,!1)),a.join("")}function Nb(t,e,n){return _t=t,Nt="xml",e.ignoreDeclaration?"":"<?xml"+Yl(t[e.attributesKey],e,n)+"?>"}function Ib(t,e,n){if(e.ignoreInstruction)return"";var r;for(r in t)if(t.hasOwnProperty(r))break;var o="instructionNameFn"in e?e.instructionNameFn(r,t[r],Nt,_t):r;if(typeof t[r]=="object")return _t=t,Nt=o,"<?"+o+Yl(t[r][e.attributesKey],e,n)+"?>";var i=t[r]?t[r]:"";return"instructionFn"in e&&(i=e.instructionFn(i,r,Nt,_t)),"<?"+o+(i?" "+i:"")+"?>"}function Fb(t,e){return e.ignoreComment?"":"<!--"+("commentFn"in e?e.commentFn(t,Nt,_t):t)+"-->"}function Rb(t,e){return e.ignoreCdata?"":"<![CDATA["+("cdataFn"in e?e.cdataFn(t,Nt,_t):t.replace("]]>","]]]]><![CDATA[>"))+"]]>"}function Bb(t,e){return e.ignoreDoctype?"":"<!DOCTYPE "+("doctypeFn"in e?e.doctypeFn(t,Nt,_t):t)+">"}function tf(t,e){return e.ignoreText?"":(t=""+t,t=t.replace(/&amp;/g,"&"),t=t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),"textFn"in e?e.textFn(t,Nt,_t):t)}function dC(t,e){var n;if(t.elements&&t.elements.length)for(n=0;n<t.elements.length;++n)switch(t.elements[n][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 pC(t,e,n){_t=t,Nt=t.name;var r=[],o="elementNameFn"in e?e.elementNameFn(t.name,t):t.name;r.push("<"+o),t[e.attributesKey]&&r.push(Yl(t[e.attributesKey],e,n));var i=t[e.elementsKey]&&t[e.elementsKey].length||t[e.attributesKey]&&t[e.attributesKey]["xml:space"]==="preserve";return i||("fullTagEmptyElementFn"in e?i=e.fullTagEmptyElementFn(t.name,t):i=e.fullTagEmptyElement),i?(r.push(">"),t[e.elementsKey]&&t[e.elementsKey].length&&(r.push(Lb(t[e.elementsKey],e,n+1)),_t=t,Nt=t.name),r.push(e.spaces&&dC(t,e)?`
25
+ `+Array(n+1).join(e.spaces):""),r.push("</"+o+">")):r.push("/>"),r.join("")}function Lb(t,e,n,r){return t.reduce(function(o,i){var s=On(e,n,r&&!o);switch(i.type){case"element":return o+s+pC(i,e,n);case"comment":return o+s+Fb(i[e.commentKey],e);case"doctype":return o+s+Bb(i[e.doctypeKey],e);case"cdata":return o+(e.indentCdata?s:"")+Rb(i[e.cdataKey],e);case"text":return o+(e.indentText?s:"")+tf(i[e.textKey],e);case"instruction":var a={};return a[i[e.nameKey]]=i[e.attributesKey]?i:i[e.instructionKey],o+(e.indentInstruction?s:"")+Ib(a,e,n)}},"")}function Pb(t,e,n){var r;for(r in t)if(t.hasOwnProperty(r))switch(r){case e.parentKey:case e.attributesKey:break;case e.textKey:if(e.indentText||n)return!0;break;case e.cdataKey:if(e.indentCdata||n)return!0;break;case e.instructionKey:if(e.indentInstruction||n)return!0;break;case e.doctypeKey:case e.commentKey:return!0;default:return!0}return!1}function fC(t,e,n,r,o){_t=t,Nt=e;var i="elementNameFn"in n?n.elementNameFn(e,t):e;if(typeof t>"u"||t===null||t==="")return"fullTagEmptyElementFn"in n&&n.fullTagEmptyElementFn(e,t)||n.fullTagEmptyElement?"<"+i+"></"+i+">":"<"+i+"/>";var s=[];if(e){if(s.push("<"+i),typeof t!="object")return s.push(">"+tf(t,n)+"</"+i+">"),s.join("");t[n.attributesKey]&&s.push(Yl(t[n.attributesKey],n,r));var a=Pb(t,n,!0)||t[n.attributesKey]&&t[n.attributesKey]["xml:space"]==="preserve";if(a||("fullTagEmptyElementFn"in n?a=n.fullTagEmptyElementFn(e,t):a=n.fullTagEmptyElement),a)s.push(">");else return s.push("/>"),s.join("")}return s.push(zb(t,n,r+1,!1)),_t=t,Nt=e,e&&s.push((o?On(n,r,!1):"")+"</"+i+">"),s.join("")}function zb(t,e,n,r){var o,i,s,a=[];for(i in t)if(t.hasOwnProperty(i))for(s=cC(t[i])?t[i]:[t[i]],o=0;o<s.length;++o){switch(i){case e.declarationKey:a.push(Nb(s[o],e,n));break;case e.instructionKey:a.push((e.indentInstruction?On(e,n,r):"")+Ib(s[o],e,n));break;case e.attributesKey:case e.parentKey:break;case e.textKey:a.push((e.indentText?On(e,n,r):"")+tf(s[o],e));break;case e.cdataKey:a.push((e.indentCdata?On(e,n,r):"")+Rb(s[o],e));break;case e.doctypeKey:a.push(On(e,n,r)+Bb(s[o],e));break;case e.commentKey:a.push(On(e,n,r)+Fb(s[o],e));break;default:a.push(On(e,n,r)+fC(s[o],i,e,n,Pb(s[o],e)))}r=r&&!a.length}return a.join("")}var jb=function(t,e){e=uC(e);var n=[];return _t=t,Nt="_root_",e.compact?n.push(zb(t,e,0,!0)):(t[e.declarationKey]&&n.push(Nb(t[e.declarationKey],e,0)),t[e.elementsKey]&&t[e.elementsKey].length&&n.push(Lb(t[e.elementsKey],e,0,!n.length))),n.join("")},hC=jb,mC=function(t,e){t instanceof mt&&(t=t.toString());var n=null;if(typeof t=="string")try{n=JSON.parse(t)}catch{throw new Error("The JSON structure is invalid")}else n=t;return hC(n,e)},gC=_b,yC=lC,wC=jb,bC=mC,vC={xml2js:gC,xml2json:yC,js2xml:wC,json2xml:bC};const nf=Wl(vC);var ra,xC=new Uint8Array(16);function kC(){if(!ra&&(ra=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!ra))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ra(xC)}const SC=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function AC(t){return typeof t=="string"&&SC.test(t)}var kt=[];for(var mu=0;mu<256;++mu)kt.push((mu+256).toString(16).substr(1));function CC(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=(kt[t[e+0]]+kt[t[e+1]]+kt[t[e+2]]+kt[t[e+3]]+"-"+kt[t[e+4]]+kt[t[e+5]]+"-"+kt[t[e+6]]+kt[t[e+7]]+"-"+kt[t[e+8]]+kt[t[e+9]]+"-"+kt[t[e+10]]+kt[t[e+11]]+kt[t[e+12]]+kt[t[e+13]]+kt[t[e+14]]+kt[t[e+15]]).toLowerCase();if(!AC(n))throw TypeError("Stringified UUID is invalid");return n}function Lr(t,e,n){t=t||{};var r=t.random||(t.rng||kC)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,CC(r)}var il={exports:{}};/*! https://mths.be/he v1.2.0 by @mathias | MIT license */il.exports;(function(t,e){(function(n){var r=e,o=t&&t.exports==r&&t,i=typeof zt=="object"&&zt;(i.global===i||i.window===i)&&(n=i);var s=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,a=/[\x01-\x7F]/g,l=/[\x01-\t\x0B\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,c=/<\u20D2|=\u20E5|>\u20D2|\u205F\u200A|\u219D\u0338|\u2202\u0338|\u2220\u20D2|\u2229\uFE00|\u222A\uFE00|\u223C\u20D2|\u223D\u0331|\u223E\u0333|\u2242\u0338|\u224B\u0338|\u224D\u20D2|\u224E\u0338|\u224F\u0338|\u2250\u0338|\u2261\u20E5|\u2264\u20D2|\u2265\u20D2|\u2266\u0338|\u2267\u0338|\u2268\uFE00|\u2269\uFE00|\u226A\u0338|\u226A\u20D2|\u226B\u0338|\u226B\u20D2|\u227F\u0338|\u2282\u20D2|\u2283\u20D2|\u228A\uFE00|\u228B\uFE00|\u228F\u0338|\u2290\u0338|\u2293\uFE00|\u2294\uFE00|\u22B4\u20D2|\u22B5\u20D2|\u22D8\u0338|\u22D9\u0338|\u22DA\uFE00|\u22DB\uFE00|\u22F5\u0338|\u22F9\u0338|\u2933\u0338|\u29CF\u0338|\u29D0\u0338|\u2A6D\u0338|\u2A70\u0338|\u2A7D\u0338|\u2A7E\u0338|\u2AA1\u0338|\u2AA2\u0338|\u2AAC\uFE00|\u2AAD\uFE00|\u2AAF\u0338|\u2AB0\u0338|\u2AC5\u0338|\u2AC6\u0338|\u2ACB\uFE00|\u2ACC\uFE00|\u2AFD\u20E5|[\xA0-\u0113\u0116-\u0122\u0124-\u012B\u012E-\u014D\u0150-\u017E\u0192\u01B5\u01F5\u0237\u02C6\u02C7\u02D8-\u02DD\u0311\u0391-\u03A1\u03A3-\u03A9\u03B1-\u03C9\u03D1\u03D2\u03D5\u03D6\u03DC\u03DD\u03F0\u03F1\u03F5\u03F6\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E\u045F\u2002-\u2005\u2007-\u2010\u2013-\u2016\u2018-\u201A\u201C-\u201E\u2020-\u2022\u2025\u2026\u2030-\u2035\u2039\u203A\u203E\u2041\u2043\u2044\u204F\u2057\u205F-\u2063\u20AC\u20DB\u20DC\u2102\u2105\u210A-\u2113\u2115-\u211E\u2122\u2124\u2127-\u2129\u212C\u212D\u212F-\u2131\u2133-\u2138\u2145-\u2148\u2153-\u215E\u2190-\u219B\u219D-\u21A7\u21A9-\u21AE\u21B0-\u21B3\u21B5-\u21B7\u21BA-\u21DB\u21DD\u21E4\u21E5\u21F5\u21FD-\u2205\u2207-\u2209\u220B\u220C\u220F-\u2214\u2216-\u2218\u221A\u221D-\u2238\u223A-\u2257\u2259\u225A\u225C\u225F-\u2262\u2264-\u228B\u228D-\u229B\u229D-\u22A5\u22A7-\u22B0\u22B2-\u22BB\u22BD-\u22DB\u22DE-\u22E3\u22E6-\u22F7\u22F9-\u22FE\u2305\u2306\u2308-\u2310\u2312\u2313\u2315\u2316\u231C-\u231F\u2322\u2323\u232D\u232E\u2336\u233D\u233F\u237C\u23B0\u23B1\u23B4-\u23B6\u23DC-\u23DF\u23E2\u23E7\u2423\u24C8\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2550-\u256C\u2580\u2584\u2588\u2591-\u2593\u25A1\u25AA\u25AB\u25AD\u25AE\u25B1\u25B3-\u25B5\u25B8\u25B9\u25BD-\u25BF\u25C2\u25C3\u25CA\u25CB\u25EC\u25EF\u25F8-\u25FC\u2605\u2606\u260E\u2640\u2642\u2660\u2663\u2665\u2666\u266A\u266D-\u266F\u2713\u2717\u2720\u2736\u2758\u2772\u2773\u27C8\u27C9\u27E6-\u27ED\u27F5-\u27FA\u27FC\u27FF\u2902-\u2905\u290C-\u2913\u2916\u2919-\u2920\u2923-\u292A\u2933\u2935-\u2939\u293C\u293D\u2945\u2948-\u294B\u294E-\u2976\u2978\u2979\u297B-\u297F\u2985\u2986\u298B-\u2996\u299A\u299C\u299D\u29A4-\u29B7\u29B9\u29BB\u29BC\u29BE-\u29C5\u29C9\u29CD-\u29D0\u29DC-\u29DE\u29E3-\u29E5\u29EB\u29F4\u29F6\u2A00-\u2A02\u2A04\u2A06\u2A0C\u2A0D\u2A10-\u2A17\u2A22-\u2A27\u2A29\u2A2A\u2A2D-\u2A31\u2A33-\u2A3C\u2A3F\u2A40\u2A42-\u2A4D\u2A50\u2A53-\u2A58\u2A5A-\u2A5D\u2A5F\u2A66\u2A6A\u2A6D-\u2A75\u2A77-\u2A9A\u2A9D-\u2AA2\u2AA4-\u2AB0\u2AB3-\u2AC8\u2ACB\u2ACC\u2ACF-\u2ADB\u2AE4\u2AE6-\u2AE9\u2AEB-\u2AF3\u2AFD\uFB00-\uFB04]|\uD835[\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDD6B]/g,u={"­":"shy","‌":"zwnj","‍":"zwj","‎":"lrm","⁣":"ic","⁢":"it","⁡":"af","‏":"rlm","​":"ZeroWidthSpace","⁠":"NoBreak","̑":"DownBreve","⃛":"tdot","⃜":"DotDot"," ":"Tab","\n":"NewLine"," ":"puncsp"," ":"MediumSpace"," ":"thinsp"," ":"hairsp"," ":"emsp13"," ":"ensp"," ":"emsp14"," ":"emsp"," ":"numsp"," ":"nbsp","  ":"ThickSpace","‾":"oline",_:"lowbar","‐":"dash","–":"ndash","—":"mdash","―":"horbar",",":"comma",";":"semi","⁏":"bsemi",":":"colon","⩴":"Colone","!":"excl","¡":"iexcl","?":"quest","¿":"iquest",".":"period","‥":"nldr","…":"mldr","·":"middot","'":"apos","‘":"lsquo","’":"rsquo","‚":"sbquo","‹":"lsaquo","›":"rsaquo",'"':"quot","“":"ldquo","”":"rdquo","„":"bdquo","«":"laquo","»":"raquo","(":"lpar",")":"rpar","[":"lsqb","]":"rsqb","{":"lcub","}":"rcub","⌈":"lceil","⌉":"rceil","⌊":"lfloor","⌋":"rfloor","⦅":"lopar","⦆":"ropar","⦋":"lbrke","⦌":"rbrke","⦍":"lbrkslu","⦎":"rbrksld","⦏":"lbrksld","⦐":"rbrkslu","⦑":"langd","⦒":"rangd","⦓":"lparlt","⦔":"rpargt","⦕":"gtlPar","⦖":"ltrPar","⟦":"lobrk","⟧":"robrk","⟨":"lang","⟩":"rang","⟪":"Lang","⟫":"Rang","⟬":"loang","⟭":"roang","❲":"lbbrk","❳":"rbbrk","‖":"Vert","§":"sect","¶":"para","@":"commat","*":"ast","/":"sol",undefined:null,"&":"amp","#":"num","%":"percnt","‰":"permil","‱":"pertenk","†":"dagger","‡":"Dagger","•":"bull","⁃":"hybull","′":"prime","″":"Prime","‴":"tprime","⁗":"qprime","‵":"bprime","⁁":"caret","`":"grave","´":"acute","˜":"tilde","^":"Hat","¯":"macr","˘":"breve","˙":"dot","¨":"die","˚":"ring","˝":"dblac","¸":"cedil","˛":"ogon","ˆ":"circ","ˇ":"caron","°":"deg","©":"copy","®":"reg","℗":"copysr","℘":"wp","℞":"rx","℧":"mho","℩":"iiota","←":"larr","↚":"nlarr","→":"rarr","↛":"nrarr","↑":"uarr","↓":"darr","↔":"harr","↮":"nharr","↕":"varr","↖":"nwarr","↗":"nearr","↘":"searr","↙":"swarr","↝":"rarrw","↝̸":"nrarrw","↞":"Larr","↟":"Uarr","↠":"Rarr","↡":"Darr","↢":"larrtl","↣":"rarrtl","↤":"mapstoleft","↥":"mapstoup","↦":"map","↧":"mapstodown","↩":"larrhk","↪":"rarrhk","↫":"larrlp","↬":"rarrlp","↭":"harrw","↰":"lsh","↱":"rsh","↲":"ldsh","↳":"rdsh","↵":"crarr","↶":"cularr","↷":"curarr","↺":"olarr","↻":"orarr","↼":"lharu","↽":"lhard","↾":"uharr","↿":"uharl","⇀":"rharu","⇁":"rhard","⇂":"dharr","⇃":"dharl","⇄":"rlarr","⇅":"udarr","⇆":"lrarr","⇇":"llarr","⇈":"uuarr","⇉":"rrarr","⇊":"ddarr","⇋":"lrhar","⇌":"rlhar","⇐":"lArr","⇍":"nlArr","⇑":"uArr","⇒":"rArr","⇏":"nrArr","⇓":"dArr","⇔":"iff","⇎":"nhArr","⇕":"vArr","⇖":"nwArr","⇗":"neArr","⇘":"seArr","⇙":"swArr","⇚":"lAarr","⇛":"rAarr","⇝":"zigrarr","⇤":"larrb","⇥":"rarrb","⇵":"duarr","⇽":"loarr","⇾":"roarr","⇿":"hoarr","∀":"forall","∁":"comp","∂":"part","∂̸":"npart","∃":"exist","∄":"nexist","∅":"empty","∇":"Del","∈":"in","∉":"notin","∋":"ni","∌":"notni","϶":"bepsi","∏":"prod","∐":"coprod","∑":"sum","+":"plus","±":"pm","÷":"div","×":"times","<":"lt","≮":"nlt","<⃒":"nvlt","=":"equals","≠":"ne","=⃥":"bne","⩵":"Equal",">":"gt","≯":"ngt",">⃒":"nvgt","¬":"not","|":"vert","¦":"brvbar","−":"minus","∓":"mp","∔":"plusdo","⁄":"frasl","∖":"setmn","∗":"lowast","∘":"compfn","√":"Sqrt","∝":"prop","∞":"infin","∟":"angrt","∠":"ang","∠⃒":"nang","∡":"angmsd","∢":"angsph","∣":"mid","∤":"nmid","∥":"par","∦":"npar","∧":"and","∨":"or","∩":"cap","∩︀":"caps","∪":"cup","∪︀":"cups","∫":"int","∬":"Int","∭":"tint","⨌":"qint","∮":"oint","∯":"Conint","∰":"Cconint","∱":"cwint","∲":"cwconint","∳":"awconint","∴":"there4","∵":"becaus","∶":"ratio","∷":"Colon","∸":"minusd","∺":"mDDot","∻":"homtht","∼":"sim","≁":"nsim","∼⃒":"nvsim","∽":"bsim","∽̱":"race","∾":"ac","∾̳":"acE","∿":"acd","≀":"wr","≂":"esim","≂̸":"nesim","≃":"sime","≄":"nsime","≅":"cong","≇":"ncong","≆":"simne","≈":"ap","≉":"nap","≊":"ape","≋":"apid","≋̸":"napid","≌":"bcong","≍":"CupCap","≭":"NotCupCap","≍⃒":"nvap","≎":"bump","≎̸":"nbump","≏":"bumpe","≏̸":"nbumpe","≐":"doteq","≐̸":"nedot","≑":"eDot","≒":"efDot","≓":"erDot","≔":"colone","≕":"ecolon","≖":"ecir","≗":"cire","≙":"wedgeq","≚":"veeeq","≜":"trie","≟":"equest","≡":"equiv","≢":"nequiv","≡⃥":"bnequiv","≤":"le","≰":"nle","≤⃒":"nvle","≥":"ge","≱":"nge","≥⃒":"nvge","≦":"lE","≦̸":"nlE","≧":"gE","≧̸":"ngE","≨︀":"lvnE","≨":"lnE","≩":"gnE","≩︀":"gvnE","≪":"ll","≪̸":"nLtv","≪⃒":"nLt","≫":"gg","≫̸":"nGtv","≫⃒":"nGt","≬":"twixt","≲":"lsim","≴":"nlsim","≳":"gsim","≵":"ngsim","≶":"lg","≸":"ntlg","≷":"gl","≹":"ntgl","≺":"pr","⊀":"npr","≻":"sc","⊁":"nsc","≼":"prcue","⋠":"nprcue","≽":"sccue","⋡":"nsccue","≾":"prsim","≿":"scsim","≿̸":"NotSucceedsTilde","⊂":"sub","⊄":"nsub","⊂⃒":"vnsub","⊃":"sup","⊅":"nsup","⊃⃒":"vnsup","⊆":"sube","⊈":"nsube","⊇":"supe","⊉":"nsupe","⊊︀":"vsubne","⊊":"subne","⊋︀":"vsupne","⊋":"supne","⊍":"cupdot","⊎":"uplus","⊏":"sqsub","⊏̸":"NotSquareSubset","⊐":"sqsup","⊐̸":"NotSquareSuperset","⊑":"sqsube","⋢":"nsqsube","⊒":"sqsupe","⋣":"nsqsupe","⊓":"sqcap","⊓︀":"sqcaps","⊔":"sqcup","⊔︀":"sqcups","⊕":"oplus","⊖":"ominus","⊗":"otimes","⊘":"osol","⊙":"odot","⊚":"ocir","⊛":"oast","⊝":"odash","⊞":"plusb","⊟":"minusb","⊠":"timesb","⊡":"sdotb","⊢":"vdash","⊬":"nvdash","⊣":"dashv","⊤":"top","⊥":"bot","⊧":"models","⊨":"vDash","⊭":"nvDash","⊩":"Vdash","⊮":"nVdash","⊪":"Vvdash","⊫":"VDash","⊯":"nVDash","⊰":"prurel","⊲":"vltri","⋪":"nltri","⊳":"vrtri","⋫":"nrtri","⊴":"ltrie","⋬":"nltrie","⊴⃒":"nvltrie","⊵":"rtrie","⋭":"nrtrie","⊵⃒":"nvrtrie","⊶":"origof","⊷":"imof","⊸":"mumap","⊹":"hercon","⊺":"intcal","⊻":"veebar","⊽":"barvee","⊾":"angrtvb","⊿":"lrtri","⋀":"Wedge","⋁":"Vee","⋂":"xcap","⋃":"xcup","⋄":"diam","⋅":"sdot","⋆":"Star","⋇":"divonx","⋈":"bowtie","⋉":"ltimes","⋊":"rtimes","⋋":"lthree","⋌":"rthree","⋍":"bsime","⋎":"cuvee","⋏":"cuwed","⋐":"Sub","⋑":"Sup","⋒":"Cap","⋓":"Cup","⋔":"fork","⋕":"epar","⋖":"ltdot","⋗":"gtdot","⋘":"Ll","⋘̸":"nLl","⋙":"Gg","⋙̸":"nGg","⋚︀":"lesg","⋚":"leg","⋛":"gel","⋛︀":"gesl","⋞":"cuepr","⋟":"cuesc","⋦":"lnsim","⋧":"gnsim","⋨":"prnsim","⋩":"scnsim","⋮":"vellip","⋯":"ctdot","⋰":"utdot","⋱":"dtdot","⋲":"disin","⋳":"isinsv","⋴":"isins","⋵":"isindot","⋵̸":"notindot","⋶":"notinvc","⋷":"notinvb","⋹":"isinE","⋹̸":"notinE","⋺":"nisd","⋻":"xnis","⋼":"nis","⋽":"notnivc","⋾":"notnivb","⌅":"barwed","⌆":"Barwed","⌌":"drcrop","⌍":"dlcrop","⌎":"urcrop","⌏":"ulcrop","⌐":"bnot","⌒":"profline","⌓":"profsurf","⌕":"telrec","⌖":"target","⌜":"ulcorn","⌝":"urcorn","⌞":"dlcorn","⌟":"drcorn","⌢":"frown","⌣":"smile","⌭":"cylcty","⌮":"profalar","⌶":"topbot","⌽":"ovbar","⌿":"solbar","⍼":"angzarr","⎰":"lmoust","⎱":"rmoust","⎴":"tbrk","⎵":"bbrk","⎶":"bbrktbrk","⏜":"OverParenthesis","⏝":"UnderParenthesis","⏞":"OverBrace","⏟":"UnderBrace","⏢":"trpezium","⏧":"elinters","␣":"blank","─":"boxh","│":"boxv","┌":"boxdr","┐":"boxdl","└":"boxur","┘":"boxul","├":"boxvr","┤":"boxvl","┬":"boxhd","┴":"boxhu","┼":"boxvh","═":"boxH","║":"boxV","╒":"boxdR","╓":"boxDr","╔":"boxDR","╕":"boxdL","╖":"boxDl","╗":"boxDL","╘":"boxuR","╙":"boxUr","╚":"boxUR","╛":"boxuL","╜":"boxUl","╝":"boxUL","╞":"boxvR","╟":"boxVr","╠":"boxVR","╡":"boxvL","╢":"boxVl","╣":"boxVL","╤":"boxHd","╥":"boxhD","╦":"boxHD","╧":"boxHu","╨":"boxhU","╩":"boxHU","╪":"boxvH","╫":"boxVh","╬":"boxVH","▀":"uhblk","▄":"lhblk","█":"block","░":"blk14","▒":"blk12","▓":"blk34","□":"squ","▪":"squf","▫":"EmptyVerySmallSquare","▭":"rect","▮":"marker","▱":"fltns","△":"xutri","▴":"utrif","▵":"utri","▸":"rtrif","▹":"rtri","▽":"xdtri","▾":"dtrif","▿":"dtri","◂":"ltrif","◃":"ltri","◊":"loz","○":"cir","◬":"tridot","◯":"xcirc","◸":"ultri","◹":"urtri","◺":"lltri","◻":"EmptySmallSquare","◼":"FilledSmallSquare","★":"starf","☆":"star","☎":"phone","♀":"female","♂":"male","♠":"spades","♣":"clubs","♥":"hearts","♦":"diams","♪":"sung","✓":"check","✗":"cross","✠":"malt","✶":"sext","❘":"VerticalSeparator","⟈":"bsolhsub","⟉":"suphsol","⟵":"xlarr","⟶":"xrarr","⟷":"xharr","⟸":"xlArr","⟹":"xrArr","⟺":"xhArr","⟼":"xmap","⟿":"dzigrarr","⤂":"nvlArr","⤃":"nvrArr","⤄":"nvHarr","⤅":"Map","⤌":"lbarr","⤍":"rbarr","⤎":"lBarr","⤏":"rBarr","⤐":"RBarr","⤑":"DDotrahd","⤒":"UpArrowBar","⤓":"DownArrowBar","⤖":"Rarrtl","⤙":"latail","⤚":"ratail","⤛":"lAtail","⤜":"rAtail","⤝":"larrfs","⤞":"rarrfs","⤟":"larrbfs","⤠":"rarrbfs","⤣":"nwarhk","⤤":"nearhk","⤥":"searhk","⤦":"swarhk","⤧":"nwnear","⤨":"toea","⤩":"tosa","⤪":"swnwar","⤳":"rarrc","⤳̸":"nrarrc","⤵":"cudarrr","⤶":"ldca","⤷":"rdca","⤸":"cudarrl","⤹":"larrpl","⤼":"curarrm","⤽":"cularrp","⥅":"rarrpl","⥈":"harrcir","⥉":"Uarrocir","⥊":"lurdshar","⥋":"ldrushar","⥎":"LeftRightVector","⥏":"RightUpDownVector","⥐":"DownLeftRightVector","⥑":"LeftUpDownVector","⥒":"LeftVectorBar","⥓":"RightVectorBar","⥔":"RightUpVectorBar","⥕":"RightDownVectorBar","⥖":"DownLeftVectorBar","⥗":"DownRightVectorBar","⥘":"LeftUpVectorBar","⥙":"LeftDownVectorBar","⥚":"LeftTeeVector","⥛":"RightTeeVector","⥜":"RightUpTeeVector","⥝":"RightDownTeeVector","⥞":"DownLeftTeeVector","⥟":"DownRightTeeVector","⥠":"LeftUpTeeVector","⥡":"LeftDownTeeVector","⥢":"lHar","⥣":"uHar","⥤":"rHar","⥥":"dHar","⥦":"luruhar","⥧":"ldrdhar","⥨":"ruluhar","⥩":"rdldhar","⥪":"lharul","⥫":"llhard","⥬":"rharul","⥭":"lrhard","⥮":"udhar","⥯":"duhar","⥰":"RoundImplies","⥱":"erarr","⥲":"simrarr","⥳":"larrsim","⥴":"rarrsim","⥵":"rarrap","⥶":"ltlarr","⥸":"gtrarr","⥹":"subrarr","⥻":"suplarr","⥼":"lfisht","⥽":"rfisht","⥾":"ufisht","⥿":"dfisht","⦚":"vzigzag","⦜":"vangrt","⦝":"angrtvbd","⦤":"ange","⦥":"range","⦦":"dwangle","⦧":"uwangle","⦨":"angmsdaa","⦩":"angmsdab","⦪":"angmsdac","⦫":"angmsdad","⦬":"angmsdae","⦭":"angmsdaf","⦮":"angmsdag","⦯":"angmsdah","⦰":"bemptyv","⦱":"demptyv","⦲":"cemptyv","⦳":"raemptyv","⦴":"laemptyv","⦵":"ohbar","⦶":"omid","⦷":"opar","⦹":"operp","⦻":"olcross","⦼":"odsold","⦾":"olcir","⦿":"ofcir","⧀":"olt","⧁":"ogt","⧂":"cirscir","⧃":"cirE","⧄":"solb","⧅":"bsolb","⧉":"boxbox","⧍":"trisb","⧎":"rtriltri","⧏":"LeftTriangleBar","⧏̸":"NotLeftTriangleBar","⧐":"RightTriangleBar","⧐̸":"NotRightTriangleBar","⧜":"iinfin","⧝":"infintie","⧞":"nvinfin","⧣":"eparsl","⧤":"smeparsl","⧥":"eqvparsl","⧫":"lozf","⧴":"RuleDelayed","⧶":"dsol","⨀":"xodot","⨁":"xoplus","⨂":"xotime","⨄":"xuplus","⨆":"xsqcup","⨍":"fpartint","⨐":"cirfnint","⨑":"awint","⨒":"rppolint","⨓":"scpolint","⨔":"npolint","⨕":"pointint","⨖":"quatint","⨗":"intlarhk","⨢":"pluscir","⨣":"plusacir","⨤":"simplus","⨥":"plusdu","⨦":"plussim","⨧":"plustwo","⨩":"mcomma","⨪":"minusdu","⨭":"loplus","⨮":"roplus","⨯":"Cross","⨰":"timesd","⨱":"timesbar","⨳":"smashp","⨴":"lotimes","⨵":"rotimes","⨶":"otimesas","⨷":"Otimes","⨸":"odiv","⨹":"triplus","⨺":"triminus","⨻":"tritime","⨼":"iprod","⨿":"amalg","⩀":"capdot","⩂":"ncup","⩃":"ncap","⩄":"capand","⩅":"cupor","⩆":"cupcap","⩇":"capcup","⩈":"cupbrcap","⩉":"capbrcup","⩊":"cupcup","⩋":"capcap","⩌":"ccups","⩍":"ccaps","⩐":"ccupssm","⩓":"And","⩔":"Or","⩕":"andand","⩖":"oror","⩗":"orslope","⩘":"andslope","⩚":"andv","⩛":"orv","⩜":"andd","⩝":"ord","⩟":"wedbar","⩦":"sdote","⩪":"simdot","⩭":"congdot","⩭̸":"ncongdot","⩮":"easter","⩯":"apacir","⩰":"apE","⩰̸":"napE","⩱":"eplus","⩲":"pluse","⩳":"Esim","⩷":"eDDot","⩸":"equivDD","⩹":"ltcir","⩺":"gtcir","⩻":"ltquest","⩼":"gtquest","⩽":"les","⩽̸":"nles","⩾":"ges","⩾̸":"nges","⩿":"lesdot","⪀":"gesdot","⪁":"lesdoto","⪂":"gesdoto","⪃":"lesdotor","⪄":"gesdotol","⪅":"lap","⪆":"gap","⪇":"lne","⪈":"gne","⪉":"lnap","⪊":"gnap","⪋":"lEg","⪌":"gEl","⪍":"lsime","⪎":"gsime","⪏":"lsimg","⪐":"gsiml","⪑":"lgE","⪒":"glE","⪓":"lesges","⪔":"gesles","⪕":"els","⪖":"egs","⪗":"elsdot","⪘":"egsdot","⪙":"el","⪚":"eg","⪝":"siml","⪞":"simg","⪟":"simlE","⪠":"simgE","⪡":"LessLess","⪡̸":"NotNestedLessLess","⪢":"GreaterGreater","⪢̸":"NotNestedGreaterGreater","⪤":"glj","⪥":"gla","⪦":"ltcc","⪧":"gtcc","⪨":"lescc","⪩":"gescc","⪪":"smt","⪫":"lat","⪬":"smte","⪬︀":"smtes","⪭":"late","⪭︀":"lates","⪮":"bumpE","⪯":"pre","⪯̸":"npre","⪰":"sce","⪰̸":"nsce","⪳":"prE","⪴":"scE","⪵":"prnE","⪶":"scnE","⪷":"prap","⪸":"scap","⪹":"prnap","⪺":"scnap","⪻":"Pr","⪼":"Sc","⪽":"subdot","⪾":"supdot","⪿":"subplus","⫀":"supplus","⫁":"submult","⫂":"supmult","⫃":"subedot","⫄":"supedot","⫅":"subE","⫅̸":"nsubE","⫆":"supE","⫆̸":"nsupE","⫇":"subsim","⫈":"supsim","⫋︀":"vsubnE","⫋":"subnE","⫌︀":"vsupnE","⫌":"supnE","⫏":"csub","⫐":"csup","⫑":"csube","⫒":"csupe","⫓":"subsup","⫔":"supsub","⫕":"subsub","⫖":"supsup","⫗":"suphsub","⫘":"supdsub","⫙":"forkv","⫚":"topfork","⫛":"mlcp","⫤":"Dashv","⫦":"Vdashl","⫧":"Barv","⫨":"vBar","⫩":"vBarv","⫫":"Vbar","⫬":"Not","⫭":"bNot","⫮":"rnmid","⫯":"cirmid","⫰":"midcir","⫱":"topcir","⫲":"nhpar","⫳":"parsim","⫽":"parsl","⫽⃥":"nparsl","♭":"flat","♮":"natur","♯":"sharp","¤":"curren","¢":"cent",$:"dollar","£":"pound","¥":"yen","€":"euro","¹":"sup1","½":"half","⅓":"frac13","¼":"frac14","⅕":"frac15","⅙":"frac16","⅛":"frac18","²":"sup2","⅔":"frac23","⅖":"frac25","³":"sup3","¾":"frac34","⅗":"frac35","⅜":"frac38","⅘":"frac45","⅚":"frac56","⅝":"frac58","⅞":"frac78","𝒶":"ascr","𝕒":"aopf","𝔞":"afr","𝔸":"Aopf","𝔄":"Afr","𝒜":"Ascr",ª:"ordf",á:"aacute",Á:"Aacute",à:"agrave",À:"Agrave",ă:"abreve",Ă:"Abreve",â:"acirc",Â:"Acirc",å:"aring",Å:"angst",ä:"auml",Ä:"Auml",ã:"atilde",Ã:"Atilde",ą:"aogon",Ą:"Aogon",ā:"amacr",Ā:"Amacr",æ:"aelig",Æ:"AElig","𝒷":"bscr","𝕓":"bopf","𝔟":"bfr","𝔹":"Bopf",ℬ:"Bscr","𝔅":"Bfr","𝔠":"cfr","𝒸":"cscr","𝕔":"copf",ℭ:"Cfr","𝒞":"Cscr",ℂ:"Copf",ć:"cacute",Ć:"Cacute",ĉ:"ccirc",Ĉ:"Ccirc",č:"ccaron",Č:"Ccaron",ċ:"cdot",Ċ:"Cdot",ç:"ccedil",Ç:"Ccedil","℅":"incare","𝔡":"dfr","ⅆ":"dd","𝕕":"dopf","𝒹":"dscr","𝒟":"Dscr","𝔇":"Dfr","ⅅ":"DD","𝔻":"Dopf",ď:"dcaron",Ď:"Dcaron",đ:"dstrok",Đ:"Dstrok",ð:"eth",Ð:"ETH","ⅇ":"ee",ℯ:"escr","𝔢":"efr","𝕖":"eopf",ℰ:"Escr","𝔈":"Efr","𝔼":"Eopf",é:"eacute",É:"Eacute",è:"egrave",È:"Egrave",ê:"ecirc",Ê:"Ecirc",ě:"ecaron",Ě:"Ecaron",ë:"euml",Ë:"Euml",ė:"edot",Ė:"Edot",ę:"eogon",Ę:"Eogon",ē:"emacr",Ē:"Emacr","𝔣":"ffr","𝕗":"fopf","𝒻":"fscr","𝔉":"Ffr","𝔽":"Fopf",ℱ:"Fscr",ff:"fflig",ffi:"ffilig",ffl:"ffllig",fi:"filig",fj:"fjlig",fl:"fllig",ƒ:"fnof",ℊ:"gscr","𝕘":"gopf","𝔤":"gfr","𝒢":"Gscr","𝔾":"Gopf","𝔊":"Gfr",ǵ:"gacute",ğ:"gbreve",Ğ:"Gbreve",ĝ:"gcirc",Ĝ:"Gcirc",ġ:"gdot",Ġ:"Gdot",Ģ:"Gcedil","𝔥":"hfr",ℎ:"planckh","𝒽":"hscr","𝕙":"hopf",ℋ:"Hscr",ℌ:"Hfr",ℍ:"Hopf",ĥ:"hcirc",Ĥ:"Hcirc",ℏ:"hbar",ħ:"hstrok",Ħ:"Hstrok","𝕚":"iopf","𝔦":"ifr","𝒾":"iscr","ⅈ":"ii","𝕀":"Iopf",ℐ:"Iscr",ℑ:"Im",í:"iacute",Í:"Iacute",ì:"igrave",Ì:"Igrave",î:"icirc",Î:"Icirc",ï:"iuml",Ï:"Iuml",ĩ:"itilde",Ĩ:"Itilde",İ:"Idot",į:"iogon",Į:"Iogon",ī:"imacr",Ī:"Imacr",ij:"ijlig",IJ:"IJlig",ı:"imath","𝒿":"jscr","𝕛":"jopf","𝔧":"jfr","𝒥":"Jscr","𝔍":"Jfr","𝕁":"Jopf",ĵ:"jcirc",Ĵ:"Jcirc","ȷ":"jmath","𝕜":"kopf","𝓀":"kscr","𝔨":"kfr","𝒦":"Kscr","𝕂":"Kopf","𝔎":"Kfr",ķ:"kcedil",Ķ:"Kcedil","𝔩":"lfr","𝓁":"lscr",ℓ:"ell","𝕝":"lopf",ℒ:"Lscr","𝔏":"Lfr","𝕃":"Lopf",ĺ:"lacute",Ĺ:"Lacute",ľ:"lcaron",Ľ:"Lcaron",ļ:"lcedil",Ļ:"Lcedil",ł:"lstrok",Ł:"Lstrok",ŀ:"lmidot",Ŀ:"Lmidot","𝔪":"mfr","𝕞":"mopf","𝓂":"mscr","𝔐":"Mfr","𝕄":"Mopf",ℳ:"Mscr","𝔫":"nfr","𝕟":"nopf","𝓃":"nscr",ℕ:"Nopf","𝒩":"Nscr","𝔑":"Nfr",ń:"nacute",Ń:"Nacute",ň:"ncaron",Ň:"Ncaron",ñ:"ntilde",Ñ:"Ntilde",ņ:"ncedil",Ņ:"Ncedil","№":"numero",ŋ:"eng",Ŋ:"ENG","𝕠":"oopf","𝔬":"ofr",ℴ:"oscr","𝒪":"Oscr","𝔒":"Ofr","𝕆":"Oopf",º:"ordm",ó:"oacute",Ó:"Oacute",ò:"ograve",Ò:"Ograve",ô:"ocirc",Ô:"Ocirc",ö:"ouml",Ö:"Ouml",ő:"odblac",Ő:"Odblac",õ:"otilde",Õ:"Otilde",ø:"oslash",Ø:"Oslash",ō:"omacr",Ō:"Omacr",œ:"oelig",Œ:"OElig","𝔭":"pfr","𝓅":"pscr","𝕡":"popf",ℙ:"Popf","𝔓":"Pfr","𝒫":"Pscr","𝕢":"qopf","𝔮":"qfr","𝓆":"qscr","𝒬":"Qscr","𝔔":"Qfr",ℚ:"Qopf",ĸ:"kgreen","𝔯":"rfr","𝕣":"ropf","𝓇":"rscr",ℛ:"Rscr",ℜ:"Re",ℝ:"Ropf",ŕ:"racute",Ŕ:"Racute",ř:"rcaron",Ř:"Rcaron",ŗ:"rcedil",Ŗ:"Rcedil","𝕤":"sopf","𝓈":"sscr","𝔰":"sfr","𝕊":"Sopf","𝔖":"Sfr","𝒮":"Sscr","Ⓢ":"oS",ś:"sacute",Ś:"Sacute",ŝ:"scirc",Ŝ:"Scirc",š:"scaron",Š:"Scaron",ş:"scedil",Ş:"Scedil",ß:"szlig","𝔱":"tfr","𝓉":"tscr","𝕥":"topf","𝒯":"Tscr","𝔗":"Tfr","𝕋":"Topf",ť:"tcaron",Ť:"Tcaron",ţ:"tcedil",Ţ:"Tcedil","™":"trade",ŧ:"tstrok",Ŧ:"Tstrok","𝓊":"uscr","𝕦":"uopf","𝔲":"ufr","𝕌":"Uopf","𝔘":"Ufr","𝒰":"Uscr",ú:"uacute",Ú:"Uacute",ù:"ugrave",Ù:"Ugrave",ŭ:"ubreve",Ŭ:"Ubreve",û:"ucirc",Û:"Ucirc",ů:"uring",Ů:"Uring",ü:"uuml",Ü:"Uuml",ű:"udblac",Ű:"Udblac",ũ:"utilde",Ũ:"Utilde",ų:"uogon",Ų:"Uogon",ū:"umacr",Ū:"Umacr","𝔳":"vfr","𝕧":"vopf","𝓋":"vscr","𝔙":"Vfr","𝕍":"Vopf","𝒱":"Vscr","𝕨":"wopf","𝓌":"wscr","𝔴":"wfr","𝒲":"Wscr","𝕎":"Wopf","𝔚":"Wfr",ŵ:"wcirc",Ŵ:"Wcirc","𝔵":"xfr","𝓍":"xscr","𝕩":"xopf","𝕏":"Xopf","𝔛":"Xfr","𝒳":"Xscr","𝔶":"yfr","𝓎":"yscr","𝕪":"yopf","𝒴":"Yscr","𝔜":"Yfr","𝕐":"Yopf",ý:"yacute",Ý:"Yacute",ŷ:"ycirc",Ŷ:"Ycirc",ÿ:"yuml",Ÿ:"Yuml","𝓏":"zscr","𝔷":"zfr","𝕫":"zopf",ℨ:"Zfr",ℤ:"Zopf","𝒵":"Zscr",ź:"zacute",Ź:"Zacute",ž:"zcaron",Ž:"Zcaron",ż:"zdot",Ż:"Zdot",Ƶ:"imped",þ:"thorn",Þ:"THORN",ʼn:"napos",α:"alpha",Α:"Alpha",β:"beta",Β:"Beta",γ:"gamma",Γ:"Gamma",δ:"delta",Δ:"Delta",ε:"epsi","ϵ":"epsiv",Ε:"Epsilon",ϝ:"gammad",Ϝ:"Gammad",ζ:"zeta",Ζ:"Zeta",η:"eta",Η:"Eta",θ:"theta",ϑ:"thetav",Θ:"Theta",ι:"iota",Ι:"Iota",κ:"kappa",ϰ:"kappav",Κ:"Kappa",λ:"lambda",Λ:"Lambda",μ:"mu",µ:"micro",Μ:"Mu",ν:"nu",Ν:"Nu",ξ:"xi",Ξ:"Xi",ο:"omicron",Ο:"Omicron",π:"pi",ϖ:"piv",Π:"Pi",ρ:"rho",ϱ:"rhov",Ρ:"Rho",σ:"sigma",Σ:"Sigma",ς:"sigmaf",τ:"tau",Τ:"Tau",υ:"upsi",Υ:"Upsilon",ϒ:"Upsi",φ:"phi",ϕ:"phiv",Φ:"Phi",χ:"chi",Χ:"Chi",ψ:"psi",Ψ:"Psi",ω:"omega",Ω:"ohm",а:"acy",А:"Acy",б:"bcy",Б:"Bcy",в:"vcy",В:"Vcy",г:"gcy",Г:"Gcy",ѓ:"gjcy",Ѓ:"GJcy",д:"dcy",Д:"Dcy",ђ:"djcy",Ђ:"DJcy",е:"iecy",Е:"IEcy",ё:"iocy",Ё:"IOcy",є:"jukcy",Є:"Jukcy",ж:"zhcy",Ж:"ZHcy",з:"zcy",З:"Zcy",ѕ:"dscy",Ѕ:"DScy",и:"icy",И:"Icy",і:"iukcy",І:"Iukcy",ї:"yicy",Ї:"YIcy",й:"jcy",Й:"Jcy",ј:"jsercy",Ј:"Jsercy",к:"kcy",К:"Kcy",ќ:"kjcy",Ќ:"KJcy",л:"lcy",Л:"Lcy",љ:"ljcy",Љ:"LJcy",м:"mcy",М:"Mcy",н:"ncy",Н:"Ncy",њ:"njcy",Њ:"NJcy",о:"ocy",О:"Ocy",п:"pcy",П:"Pcy",р:"rcy",Р:"Rcy",с:"scy",С:"Scy",т:"tcy",Т:"Tcy",ћ:"tshcy",Ћ:"TSHcy",у:"ucy",У:"Ucy",ў:"ubrcy",Ў:"Ubrcy",ф:"fcy",Ф:"Fcy",х:"khcy",Х:"KHcy",ц:"tscy",Ц:"TScy",ч:"chcy",Ч:"CHcy",џ:"dzcy",Џ:"DZcy",ш:"shcy",Ш:"SHcy",щ:"shchcy",Щ:"SHCHcy",ъ:"hardcy",Ъ:"HARDcy",ы:"ycy",Ы:"Ycy",ь:"softcy",Ь:"SOFTcy",э:"ecy",Э:"Ecy",ю:"yucy",Ю:"YUcy",я:"yacy",Я:"YAcy",ℵ:"aleph",ℶ:"beth",ℷ:"gimel",ℸ:"daleth"},d=/["&'<>`]/g,p={'"':"&quot;","&":"&amp;","'":"&#x27;","<":"&lt;",">":"&gt;","`":"&#x60;"},f=/&#(?:[xX][^a-fA-F0-9]|[^0-9xX])/,h=/[\0-\x08\x0B\x0E-\x1F\x7F-\x9F\uFDD0-\uFDEF\uFFFE\uFFFF]|[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,m=/&(CounterClockwiseContourIntegral|DoubleLongLeftRightArrow|ClockwiseContourIntegral|NotNestedGreaterGreater|NotSquareSupersetEqual|DiacriticalDoubleAcute|NotRightTriangleEqual|NotSucceedsSlantEqual|NotPrecedesSlantEqual|CloseCurlyDoubleQuote|NegativeVeryThinSpace|DoubleContourIntegral|FilledVerySmallSquare|CapitalDifferentialD|OpenCurlyDoubleQuote|EmptyVerySmallSquare|NestedGreaterGreater|DoubleLongRightArrow|NotLeftTriangleEqual|NotGreaterSlantEqual|ReverseUpEquilibrium|DoubleLeftRightArrow|NotSquareSubsetEqual|NotDoubleVerticalBar|RightArrowLeftArrow|NotGreaterFullEqual|NotRightTriangleBar|SquareSupersetEqual|DownLeftRightVector|DoubleLongLeftArrow|leftrightsquigarrow|LeftArrowRightArrow|NegativeMediumSpace|blacktriangleright|RightDownVectorBar|PrecedesSlantEqual|RightDoubleBracket|SucceedsSlantEqual|NotLeftTriangleBar|RightTriangleEqual|SquareIntersection|RightDownTeeVector|ReverseEquilibrium|NegativeThickSpace|longleftrightarrow|Longleftrightarrow|LongLeftRightArrow|DownRightTeeVector|DownRightVectorBar|GreaterSlantEqual|SquareSubsetEqual|LeftDownVectorBar|LeftDoubleBracket|VerticalSeparator|rightleftharpoons|NotGreaterGreater|NotSquareSuperset|blacktriangleleft|blacktriangledown|NegativeThinSpace|LeftDownTeeVector|NotLessSlantEqual|leftrightharpoons|DoubleUpDownArrow|DoubleVerticalBar|LeftTriangleEqual|FilledSmallSquare|twoheadrightarrow|NotNestedLessLess|DownLeftTeeVector|DownLeftVectorBar|RightAngleBracket|NotTildeFullEqual|NotReverseElement|RightUpDownVector|DiacriticalTilde|NotSucceedsTilde|circlearrowright|NotPrecedesEqual|rightharpoondown|DoubleRightArrow|NotSucceedsEqual|NonBreakingSpace|NotRightTriangle|LessEqualGreater|RightUpTeeVector|LeftAngleBracket|GreaterFullEqual|DownArrowUpArrow|RightUpVectorBar|twoheadleftarrow|GreaterEqualLess|downharpoonright|RightTriangleBar|ntrianglerighteq|NotSupersetEqual|LeftUpDownVector|DiacriticalAcute|rightrightarrows|vartriangleright|UpArrowDownArrow|DiacriticalGrave|UnderParenthesis|EmptySmallSquare|LeftUpVectorBar|leftrightarrows|DownRightVector|downharpoonleft|trianglerighteq|ShortRightArrow|OverParenthesis|DoubleLeftArrow|DoubleDownArrow|NotSquareSubset|bigtriangledown|ntrianglelefteq|UpperRightArrow|curvearrowright|vartriangleleft|NotLeftTriangle|nleftrightarrow|LowerRightArrow|NotHumpDownHump|NotGreaterTilde|rightthreetimes|LeftUpTeeVector|NotGreaterEqual|straightepsilon|LeftTriangleBar|rightsquigarrow|ContourIntegral|rightleftarrows|CloseCurlyQuote|RightDownVector|LeftRightVector|nLeftrightarrow|leftharpoondown|circlearrowleft|SquareSuperset|OpenCurlyQuote|hookrightarrow|HorizontalLine|DiacriticalDot|NotLessGreater|ntriangleright|DoubleRightTee|InvisibleComma|InvisibleTimes|LowerLeftArrow|DownLeftVector|NotSubsetEqual|curvearrowleft|trianglelefteq|NotVerticalBar|TildeFullEqual|downdownarrows|NotGreaterLess|RightTeeVector|ZeroWidthSpace|looparrowright|LongRightArrow|doublebarwedge|ShortLeftArrow|ShortDownArrow|RightVectorBar|GreaterGreater|ReverseElement|rightharpoonup|LessSlantEqual|leftthreetimes|upharpoonright|rightarrowtail|LeftDownVector|Longrightarrow|NestedLessLess|UpperLeftArrow|nshortparallel|leftleftarrows|leftrightarrow|Leftrightarrow|LeftRightArrow|longrightarrow|upharpoonleft|RightArrowBar|ApplyFunction|LeftTeeVector|leftarrowtail|NotEqualTilde|varsubsetneqq|varsupsetneqq|RightTeeArrow|SucceedsEqual|SucceedsTilde|LeftVectorBar|SupersetEqual|hookleftarrow|DifferentialD|VerticalTilde|VeryThinSpace|blacktriangle|bigtriangleup|LessFullEqual|divideontimes|leftharpoonup|UpEquilibrium|ntriangleleft|RightTriangle|measuredangle|shortparallel|longleftarrow|Longleftarrow|LongLeftArrow|DoubleLeftTee|Poincareplane|PrecedesEqual|triangleright|DoubleUpArrow|RightUpVector|fallingdotseq|looparrowleft|PrecedesTilde|NotTildeEqual|NotTildeTilde|smallsetminus|Proportional|triangleleft|triangledown|UnderBracket|NotHumpEqual|exponentiale|ExponentialE|NotLessTilde|HilbertSpace|RightCeiling|blacklozenge|varsupsetneq|HumpDownHump|GreaterEqual|VerticalLine|LeftTeeArrow|NotLessEqual|DownTeeArrow|LeftTriangle|varsubsetneq|Intersection|NotCongruent|DownArrowBar|LeftUpVector|LeftArrowBar|risingdotseq|GreaterTilde|RoundImplies|SquareSubset|ShortUpArrow|NotSuperset|quaternions|precnapprox|backepsilon|preccurlyeq|OverBracket|blacksquare|MediumSpace|VerticalBar|circledcirc|circleddash|CircleMinus|CircleTimes|LessGreater|curlyeqprec|curlyeqsucc|diamondsuit|UpDownArrow|Updownarrow|RuleDelayed|Rrightarrow|updownarrow|RightVector|nRightarrow|nrightarrow|eqslantless|LeftCeiling|Equilibrium|SmallCircle|expectation|NotSucceeds|thickapprox|GreaterLess|SquareUnion|NotPrecedes|NotLessLess|straightphi|succnapprox|succcurlyeq|SubsetEqual|sqsupseteq|Proportion|Laplacetrf|ImaginaryI|supsetneqq|NotGreater|gtreqqless|NotElement|ThickSpace|TildeEqual|TildeTilde|Fouriertrf|rmoustache|EqualTilde|eqslantgtr|UnderBrace|LeftVector|UpArrowBar|nLeftarrow|nsubseteqq|subsetneqq|nsupseteqq|nleftarrow|succapprox|lessapprox|UpTeeArrow|upuparrows|curlywedge|lesseqqgtr|varepsilon|varnothing|RightFloor|complement|CirclePlus|sqsubseteq|Lleftarrow|circledast|RightArrow|Rightarrow|rightarrow|lmoustache|Bernoullis|precapprox|mapstoleft|mapstodown|longmapsto|dotsquare|downarrow|DoubleDot|nsubseteq|supsetneq|leftarrow|nsupseteq|subsetneq|ThinSpace|ngeqslant|subseteqq|HumpEqual|NotSubset|triangleq|NotCupCap|lesseqgtr|heartsuit|TripleDot|Leftarrow|Coproduct|Congruent|varpropto|complexes|gvertneqq|LeftArrow|LessTilde|supseteqq|MinusPlus|CircleDot|nleqslant|NotExists|gtreqless|nparallel|UnionPlus|LeftFloor|checkmark|CenterDot|centerdot|Mellintrf|gtrapprox|bigotimes|OverBrace|spadesuit|therefore|pitchfork|rationals|PlusMinus|Backslash|Therefore|DownBreve|backsimeq|backprime|DownArrow|nshortmid|Downarrow|lvertneqq|eqvparsl|imagline|imagpart|infintie|integers|Integral|intercal|LessLess|Uarrocir|intlarhk|sqsupset|angmsdaf|sqsubset|llcorner|vartheta|cupbrcap|lnapprox|Superset|SuchThat|succnsim|succneqq|angmsdag|biguplus|curlyvee|trpezium|Succeeds|NotTilde|bigwedge|angmsdah|angrtvbd|triminus|cwconint|fpartint|lrcorner|smeparsl|subseteq|urcorner|lurdshar|laemptyv|DDotrahd|approxeq|ldrushar|awconint|mapstoup|backcong|shortmid|triangle|geqslant|gesdotol|timesbar|circledR|circledS|setminus|multimap|naturals|scpolint|ncongdot|RightTee|boxminus|gnapprox|boxtimes|andslope|thicksim|angmsdaa|varsigma|cirfnint|rtriltri|angmsdab|rppolint|angmsdac|barwedge|drbkarow|clubsuit|thetasym|bsolhsub|capbrcup|dzigrarr|doteqdot|DotEqual|dotminus|UnderBar|NotEqual|realpart|otimesas|ulcorner|hksearow|hkswarow|parallel|PartialD|elinters|emptyset|plusacir|bbrktbrk|angmsdad|pointint|bigoplus|angmsdae|Precedes|bigsqcup|varkappa|notindot|supseteq|precneqq|precnsim|profalar|profline|profsurf|leqslant|lesdotor|raemptyv|subplus|notnivb|notnivc|subrarr|zigrarr|vzigzag|submult|subedot|Element|between|cirscir|larrbfs|larrsim|lotimes|lbrksld|lbrkslu|lozenge|ldrdhar|dbkarow|bigcirc|epsilon|simrarr|simplus|ltquest|Epsilon|luruhar|gtquest|maltese|npolint|eqcolon|npreceq|bigodot|ddagger|gtrless|bnequiv|harrcir|ddotseq|equivDD|backsim|demptyv|nsqsube|nsqsupe|Upsilon|nsubset|upsilon|minusdu|nsucceq|swarrow|nsupset|coloneq|searrow|boxplus|napprox|natural|asympeq|alefsym|congdot|nearrow|bigstar|diamond|supplus|tritime|LeftTee|nvinfin|triplus|NewLine|nvltrie|nvrtrie|nwarrow|nexists|Diamond|ruluhar|Implies|supmult|angzarr|suplarr|suphsub|questeq|because|digamma|Because|olcross|bemptyv|omicron|Omicron|rotimes|NoBreak|intprod|angrtvb|orderof|uwangle|suphsol|lesdoto|orslope|DownTee|realine|cudarrl|rdldhar|OverBar|supedot|lessdot|supdsub|topfork|succsim|rbrkslu|rbrksld|pertenk|cudarrr|isindot|planckh|lessgtr|pluscir|gesdoto|plussim|plustwo|lesssim|cularrp|rarrsim|Cayleys|notinva|notinvb|notinvc|UpArrow|Uparrow|uparrow|NotLess|dwangle|precsim|Product|curarrm|Cconint|dotplus|rarrbfs|ccupssm|Cedilla|cemptyv|notniva|quatint|frac35|frac38|frac45|frac56|frac58|frac78|tridot|xoplus|gacute|gammad|Gammad|lfisht|lfloor|bigcup|sqsupe|gbreve|Gbreve|lharul|sqsube|sqcups|Gcedil|apacir|llhard|lmidot|Lmidot|lmoust|andand|sqcaps|approx|Abreve|spades|circeq|tprime|divide|topcir|Assign|topbot|gesdot|divonx|xuplus|timesd|gesles|atilde|solbar|SOFTcy|loplus|timesb|lowast|lowbar|dlcorn|dlcrop|softcy|dollar|lparlt|thksim|lrhard|Atilde|lsaquo|smashp|bigvee|thinsp|wreath|bkarow|lsquor|lstrok|Lstrok|lthree|ltimes|ltlarr|DotDot|simdot|ltrPar|weierp|xsqcup|angmsd|sigmav|sigmaf|zeetrf|Zcaron|zcaron|mapsto|vsupne|thetav|cirmid|marker|mcomma|Zacute|vsubnE|there4|gtlPar|vsubne|bottom|gtrarr|SHCHcy|shchcy|midast|midcir|middot|minusb|minusd|gtrdot|bowtie|sfrown|mnplus|models|colone|seswar|Colone|mstpos|searhk|gtrsim|nacute|Nacute|boxbox|telrec|hairsp|Tcedil|nbumpe|scnsim|ncaron|Ncaron|ncedil|Ncedil|hamilt|Scedil|nearhk|hardcy|HARDcy|tcedil|Tcaron|commat|nequiv|nesear|tcaron|target|hearts|nexist|varrho|scedil|Scaron|scaron|hellip|Sacute|sacute|hercon|swnwar|compfn|rtimes|rthree|rsquor|rsaquo|zacute|wedgeq|homtht|barvee|barwed|Barwed|rpargt|horbar|conint|swarhk|roplus|nltrie|hslash|hstrok|Hstrok|rmoust|Conint|bprime|hybull|hyphen|iacute|Iacute|supsup|supsub|supsim|varphi|coprod|brvbar|agrave|Supset|supset|igrave|Igrave|notinE|Agrave|iiiint|iinfin|copysr|wedbar|Verbar|vangrt|becaus|incare|verbar|inodot|bullet|drcorn|intcal|drcrop|cularr|vellip|Utilde|bumpeq|cupcap|dstrok|Dstrok|CupCap|cupcup|cupdot|eacute|Eacute|supdot|iquest|easter|ecaron|Ecaron|ecolon|isinsv|utilde|itilde|Itilde|curarr|succeq|Bumpeq|cacute|ulcrop|nparsl|Cacute|nprcue|egrave|Egrave|nrarrc|nrarrw|subsup|subsub|nrtrie|jsercy|nsccue|Jsercy|kappav|kcedil|Kcedil|subsim|ulcorn|nsimeq|egsdot|veebar|kgreen|capand|elsdot|Subset|subset|curren|aacute|lacute|Lacute|emptyv|ntilde|Ntilde|lagran|lambda|Lambda|capcap|Ugrave|langle|subdot|emsp13|numero|emsp14|nvdash|nvDash|nVdash|nVDash|ugrave|ufisht|nvHarr|larrfs|nvlArr|larrhk|larrlp|larrpl|nvrArr|Udblac|nwarhk|larrtl|nwnear|oacute|Oacute|latail|lAtail|sstarf|lbrace|odblac|Odblac|lbrack|udblac|odsold|eparsl|lcaron|Lcaron|ograve|Ograve|lcedil|Lcedil|Aacute|ssmile|ssetmn|squarf|ldquor|capcup|ominus|cylcty|rharul|eqcirc|dagger|rfloor|rfisht|Dagger|daleth|equals|origof|capdot|equest|dcaron|Dcaron|rdquor|oslash|Oslash|otilde|Otilde|otimes|Otimes|urcrop|Ubreve|ubreve|Yacute|Uacute|uacute|Rcedil|rcedil|urcorn|parsim|Rcaron|Vdashl|rcaron|Tstrok|percnt|period|permil|Exists|yacute|rbrack|rbrace|phmmat|ccaron|Ccaron|planck|ccedil|plankv|tstrok|female|plusdo|plusdu|ffilig|plusmn|ffllig|Ccedil|rAtail|dfisht|bernou|ratail|Rarrtl|rarrtl|angsph|rarrpl|rarrlp|rarrhk|xwedge|xotime|forall|ForAll|Vvdash|vsupnE|preceq|bigcap|frac12|frac13|frac14|primes|rarrfs|prnsim|frac15|Square|frac16|square|lesdot|frac18|frac23|propto|prurel|rarrap|rangle|puncsp|frac25|Racute|qprime|racute|lesges|frac34|abreve|AElig|eqsim|utdot|setmn|urtri|Equal|Uring|seArr|uring|searr|dashv|Dashv|mumap|nabla|iogon|Iogon|sdote|sdotb|scsim|napid|napos|equiv|natur|Acirc|dblac|erarr|nbump|iprod|erDot|ucirc|awint|esdot|angrt|ncong|isinE|scnap|Scirc|scirc|ndash|isins|Ubrcy|nearr|neArr|isinv|nedot|ubrcy|acute|Ycirc|iukcy|Iukcy|xutri|nesim|caret|jcirc|Jcirc|caron|twixt|ddarr|sccue|exist|jmath|sbquo|ngeqq|angst|ccaps|lceil|ngsim|UpTee|delta|Delta|rtrif|nharr|nhArr|nhpar|rtrie|jukcy|Jukcy|kappa|rsquo|Kappa|nlarr|nlArr|TSHcy|rrarr|aogon|Aogon|fflig|xrarr|tshcy|ccirc|nleqq|filig|upsih|nless|dharl|nlsim|fjlig|ropar|nltri|dharr|robrk|roarr|fllig|fltns|roang|rnmid|subnE|subne|lAarr|trisb|Ccirc|acirc|ccups|blank|VDash|forkv|Vdash|langd|cedil|blk12|blk14|laquo|strns|diams|notin|vDash|larrb|blk34|block|disin|uplus|vdash|vBarv|aelig|starf|Wedge|check|xrArr|lates|lbarr|lBarr|notni|lbbrk|bcong|frasl|lbrke|frown|vrtri|vprop|vnsup|gamma|Gamma|wedge|xodot|bdquo|srarr|doteq|ldquo|boxdl|boxdL|gcirc|Gcirc|boxDl|boxDL|boxdr|boxdR|boxDr|TRADE|trade|rlhar|boxDR|vnsub|npart|vltri|rlarr|boxhd|boxhD|nprec|gescc|nrarr|nrArr|boxHd|boxHD|boxhu|boxhU|nrtri|boxHu|clubs|boxHU|times|colon|Colon|gimel|xlArr|Tilde|nsime|tilde|nsmid|nspar|THORN|thorn|xlarr|nsube|nsubE|thkap|xhArr|comma|nsucc|boxul|boxuL|nsupe|nsupE|gneqq|gnsim|boxUl|boxUL|grave|boxur|boxuR|boxUr|boxUR|lescc|angle|bepsi|boxvh|varpi|boxvH|numsp|Theta|gsime|gsiml|theta|boxVh|boxVH|boxvl|gtcir|gtdot|boxvL|boxVl|boxVL|crarr|cross|Cross|nvsim|boxvr|nwarr|nwArr|sqsup|dtdot|Uogon|lhard|lharu|dtrif|ocirc|Ocirc|lhblk|duarr|odash|sqsub|Hacek|sqcup|llarr|duhar|oelig|OElig|ofcir|boxvR|uogon|lltri|boxVr|csube|uuarr|ohbar|csupe|ctdot|olarr|olcir|harrw|oline|sqcap|omacr|Omacr|omega|Omega|boxVR|aleph|lneqq|lnsim|loang|loarr|rharu|lobrk|hcirc|operp|oplus|rhard|Hcirc|orarr|Union|order|ecirc|Ecirc|cuepr|szlig|cuesc|breve|reals|eDDot|Breve|hoarr|lopar|utrif|rdquo|Umacr|umacr|efDot|swArr|ultri|alpha|rceil|ovbar|swarr|Wcirc|wcirc|smtes|smile|bsemi|lrarr|aring|parsl|lrhar|bsime|uhblk|lrtri|cupor|Aring|uharr|uharl|slarr|rbrke|bsolb|lsime|rbbrk|RBarr|lsimg|phone|rBarr|rbarr|icirc|lsquo|Icirc|emacr|Emacr|ratio|simne|plusb|simlE|simgE|simeq|pluse|ltcir|ltdot|empty|xharr|xdtri|iexcl|Alpha|ltrie|rarrw|pound|ltrif|xcirc|bumpe|prcue|bumpE|asymp|amacr|cuvee|Sigma|sigma|iiint|udhar|iiota|ijlig|IJlig|supnE|imacr|Imacr|prime|Prime|image|prnap|eogon|Eogon|rarrc|mdash|mDDot|cuwed|imath|supne|imped|Amacr|udarr|prsim|micro|rarrb|cwint|raquo|infin|eplus|range|rangd|Ucirc|radic|minus|amalg|veeeq|rAarr|epsiv|ycirc|quest|sharp|quot|zwnj|Qscr|race|qscr|Qopf|qopf|qint|rang|Rang|Zscr|zscr|Zopf|zopf|rarr|rArr|Rarr|Pscr|pscr|prop|prod|prnE|prec|ZHcy|zhcy|prap|Zeta|zeta|Popf|popf|Zdot|plus|zdot|Yuml|yuml|phiv|YUcy|yucy|Yscr|yscr|perp|Yopf|yopf|part|para|YIcy|Ouml|rcub|yicy|YAcy|rdca|ouml|osol|Oscr|rdsh|yacy|real|oscr|xvee|andd|rect|andv|Xscr|oror|ordm|ordf|xscr|ange|aopf|Aopf|rHar|Xopf|opar|Oopf|xopf|xnis|rhov|oopf|omid|xmap|oint|apid|apos|ogon|ascr|Ascr|odot|odiv|xcup|xcap|ocir|oast|nvlt|nvle|nvgt|nvge|nvap|Wscr|wscr|auml|ntlg|ntgl|nsup|nsub|nsim|Nscr|nscr|nsce|Wopf|ring|npre|wopf|npar|Auml|Barv|bbrk|Nopf|nopf|nmid|nLtv|beta|ropf|Ropf|Beta|beth|nles|rpar|nleq|bnot|bNot|nldr|NJcy|rscr|Rscr|Vscr|vscr|rsqb|njcy|bopf|nisd|Bopf|rtri|Vopf|nGtv|ngtr|vopf|boxh|boxH|boxv|nges|ngeq|boxV|bscr|scap|Bscr|bsim|Vert|vert|bsol|bull|bump|caps|cdot|ncup|scnE|ncap|nbsp|napE|Cdot|cent|sdot|Vbar|nang|vBar|chcy|Mscr|mscr|sect|semi|CHcy|Mopf|mopf|sext|circ|cire|mldr|mlcp|cirE|comp|shcy|SHcy|vArr|varr|cong|copf|Copf|copy|COPY|malt|male|macr|lvnE|cscr|ltri|sime|ltcc|simg|Cscr|siml|csub|Uuml|lsqb|lsim|uuml|csup|Lscr|lscr|utri|smid|lpar|cups|smte|lozf|darr|Lopf|Uscr|solb|lopf|sopf|Sopf|lneq|uscr|spar|dArr|lnap|Darr|dash|Sqrt|LJcy|ljcy|lHar|dHar|Upsi|upsi|diam|lesg|djcy|DJcy|leqq|dopf|Dopf|dscr|Dscr|dscy|ldsh|ldca|squf|DScy|sscr|Sscr|dsol|lcub|late|star|Star|Uopf|Larr|lArr|larr|uopf|dtri|dzcy|sube|subE|Lang|lang|Kscr|kscr|Kopf|kopf|KJcy|kjcy|KHcy|khcy|DZcy|ecir|edot|eDot|Jscr|jscr|succ|Jopf|jopf|Edot|uHar|emsp|ensp|Iuml|iuml|eopf|isin|Iscr|iscr|Eopf|epar|sung|epsi|escr|sup1|sup2|sup3|Iota|iota|supe|supE|Iopf|iopf|IOcy|iocy|Escr|esim|Esim|imof|Uarr|QUOT|uArr|uarr|euml|IEcy|iecy|Idot|Euml|euro|excl|Hscr|hscr|Hopf|hopf|TScy|tscy|Tscr|hbar|tscr|flat|tbrk|fnof|hArr|harr|half|fopf|Fopf|tdot|gvnE|fork|trie|gtcc|fscr|Fscr|gdot|gsim|Gscr|gscr|Gopf|gopf|gneq|Gdot|tosa|gnap|Topf|topf|geqq|toea|GJcy|gjcy|tint|gesl|mid|Sfr|ggg|top|ges|gla|glE|glj|geq|gne|gEl|gel|gnE|Gcy|gcy|gap|Tfr|tfr|Tcy|tcy|Hat|Tau|Ffr|tau|Tab|hfr|Hfr|ffr|Fcy|fcy|icy|Icy|iff|ETH|eth|ifr|Ifr|Eta|eta|int|Int|Sup|sup|ucy|Ucy|Sum|sum|jcy|ENG|ufr|Ufr|eng|Jcy|jfr|els|ell|egs|Efr|efr|Jfr|uml|kcy|Kcy|Ecy|ecy|kfr|Kfr|lap|Sub|sub|lat|lcy|Lcy|leg|Dot|dot|lEg|leq|les|squ|div|die|lfr|Lfr|lgE|Dfr|dfr|Del|deg|Dcy|dcy|lne|lnE|sol|loz|smt|Cup|lrm|cup|lsh|Lsh|sim|shy|map|Map|mcy|Mcy|mfr|Mfr|mho|gfr|Gfr|sfr|cir|Chi|chi|nap|Cfr|vcy|Vcy|cfr|Scy|scy|ncy|Ncy|vee|Vee|Cap|cap|nfr|scE|sce|Nfr|nge|ngE|nGg|vfr|Vfr|ngt|bot|nGt|nis|niv|Rsh|rsh|nle|nlE|bne|Bfr|bfr|nLl|nlt|nLt|Bcy|bcy|not|Not|rlm|wfr|Wfr|npr|nsc|num|ocy|ast|Ocy|ofr|xfr|Xfr|Ofr|ogt|ohm|apE|olt|Rho|ape|rho|Rfr|rfr|ord|REG|ang|reg|orv|And|and|AMP|Rcy|amp|Afr|ycy|Ycy|yen|yfr|Yfr|rcy|par|pcy|Pcy|pfr|Pfr|phi|Phi|afr|Acy|acy|zcy|Zcy|piv|acE|acd|zfr|Zfr|pre|prE|psi|Psi|qfr|Qfr|zwj|Or|ge|Gg|gt|gg|el|oS|lt|Lt|LT|Re|lg|gl|eg|ne|Im|it|le|DD|wp|wr|nu|Nu|dd|lE|Sc|sc|pi|Pi|ee|af|ll|Ll|rx|gE|xi|pm|Xi|ic|pr|Pr|in|ni|mp|mu|ac|Mu|or|ap|Gt|GT|ii);|&(Aacute|Agrave|Atilde|Ccedil|Eacute|Egrave|Iacute|Igrave|Ntilde|Oacute|Ograve|Oslash|Otilde|Uacute|Ugrave|Yacute|aacute|agrave|atilde|brvbar|ccedil|curren|divide|eacute|egrave|frac12|frac14|frac34|iacute|igrave|iquest|middot|ntilde|oacute|ograve|oslash|otilde|plusmn|uacute|ugrave|yacute|AElig|Acirc|Aring|Ecirc|Icirc|Ocirc|THORN|Ucirc|acirc|acute|aelig|aring|cedil|ecirc|icirc|iexcl|laquo|micro|ocirc|pound|raquo|szlig|thorn|times|ucirc|Auml|COPY|Euml|Iuml|Ouml|QUOT|Uuml|auml|cent|copy|euml|iuml|macr|nbsp|ordf|ordm|ouml|para|quot|sect|sup1|sup2|sup3|uuml|yuml|AMP|ETH|REG|amp|deg|eth|not|reg|shy|uml|yen|GT|LT|gt|lt)(?!;)([=a-zA-Z0-9]?)|&#([0-9]+)(;?)|&#[xX]([a-fA-F0-9]+)(;?)|&([0-9a-zA-Z]+)/g,y={aacute:"á",Aacute:"Á",abreve:"ă",Abreve:"Ă",ac:"∾",acd:"∿",acE:"∾̳",acirc:"â",Acirc:"Â",acute:"´",acy:"а",Acy:"А",aelig:"æ",AElig:"Æ",af:"⁡",afr:"𝔞",Afr:"𝔄",agrave:"à",Agrave:"À",alefsym:"ℵ",aleph:"ℵ",alpha:"α",Alpha:"Α",amacr:"ā",Amacr:"Ā",amalg:"⨿",amp:"&",AMP:"&",and:"∧",And:"⩓",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",aogon:"ą",Aogon:"Ą",aopf:"𝕒",Aopf:"𝔸",ap:"≈",apacir:"⩯",ape:"≊",apE:"⩰",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",aring:"å",Aring:"Å",ascr:"𝒶",Ascr:"𝒜",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",atilde:"ã",Atilde:"Ã",auml:"ä",Auml:"Ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",barwed:"⌅",Barwed:"⌆",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",bcy:"б",Bcy:"Б",bdquo:"„",becaus:"∵",because:"∵",Because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",beta:"β",Beta:"Β",beth:"ℶ",between:"≬",bfr:"𝔟",Bfr:"𝔅",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bnot:"⌐",bNot:"⫭",bopf:"𝕓",Bopf:"𝔹",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxdl:"┐",boxdL:"╕",boxDl:"╖",boxDL:"╗",boxdr:"┌",boxdR:"╒",boxDr:"╓",boxDR:"╔",boxh:"─",boxH:"═",boxhd:"┬",boxhD:"╥",boxHd:"╤",boxHD:"╦",boxhu:"┴",boxhU:"╨",boxHu:"╧",boxHU:"╩",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxul:"┘",boxuL:"╛",boxUl:"╜",boxUL:"╝",boxur:"└",boxuR:"╘",boxUr:"╙",boxUR:"╚",boxv:"│",boxV:"║",boxvh:"┼",boxvH:"╪",boxVh:"╫",boxVH:"╬",boxvl:"┤",boxvL:"╡",boxVl:"╢",boxVL:"╣",boxvr:"├",boxvR:"╞",boxVr:"╟",boxVR:"╠",bprime:"‵",breve:"˘",Breve:"˘",brvbar:"¦",bscr:"𝒷",Bscr:"ℬ",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpe:"≏",bumpE:"⪮",bumpeq:"≏",Bumpeq:"≎",cacute:"ć",Cacute:"Ć",cap:"∩",Cap:"⋒",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",ccaron:"č",Ccaron:"Č",ccedil:"ç",Ccedil:"Ç",ccirc:"ĉ",Ccirc:"Ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",cdot:"ċ",Cdot:"Ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",CenterDot:"·",cfr:"𝔠",Cfr:"ℭ",chcy:"ч",CHcy:"Ч",check:"✓",checkmark:"✓",chi:"χ",Chi:"Χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cire:"≗",cirE:"⧃",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",colon:":",Colon:"∷",colone:"≔",Colone:"⩴",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",conint:"∮",Conint:"∯",ContourIntegral:"∮",copf:"𝕔",Copf:"ℂ",coprod:"∐",Coproduct:"∐",copy:"©",COPY:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",cross:"✗",Cross:"⨯",cscr:"𝒸",Cscr:"𝒞",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cup:"∪",Cup:"⋓",cupbrcap:"⩈",cupcap:"⩆",CupCap:"≍",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dagger:"†",Dagger:"‡",daleth:"ℸ",darr:"↓",dArr:"⇓",Darr:"↡",dash:"‐",dashv:"⊣",Dashv:"⫤",dbkarow:"⤏",dblac:"˝",dcaron:"ď",Dcaron:"Ď",dcy:"д",Dcy:"Д",dd:"ⅆ",DD:"ⅅ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",delta:"δ",Delta:"Δ",demptyv:"⦱",dfisht:"⥿",dfr:"𝔡",Dfr:"𝔇",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",diamond:"⋄",Diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",djcy:"ђ",DJcy:"Ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",dopf:"𝕕",Dopf:"𝔻",dot:"˙",Dot:"¨",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",downarrow:"↓",Downarrow:"⇓",DownArrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",dscr:"𝒹",Dscr:"𝒟",dscy:"ѕ",DScy:"Ѕ",dsol:"⧶",dstrok:"đ",Dstrok:"Đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",dzcy:"џ",DZcy:"Џ",dzigrarr:"⟿",eacute:"é",Eacute:"É",easter:"⩮",ecaron:"ě",Ecaron:"Ě",ecir:"≖",ecirc:"ê",Ecirc:"Ê",ecolon:"≕",ecy:"э",Ecy:"Э",eDDot:"⩷",edot:"ė",eDot:"≑",Edot:"Ė",ee:"ⅇ",efDot:"≒",efr:"𝔢",Efr:"𝔈",eg:"⪚",egrave:"è",Egrave:"È",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",emacr:"ē",Emacr:"Ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",eng:"ŋ",ENG:"Ŋ",ensp:" ",eogon:"ę",Eogon:"Ę",eopf:"𝕖",Eopf:"𝔼",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",epsilon:"ε",Epsilon:"Ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",escr:"ℯ",Escr:"ℰ",esdot:"≐",esim:"≂",Esim:"⩳",eta:"η",Eta:"Η",eth:"ð",ETH:"Ð",euml:"ë",Euml:"Ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",exponentiale:"ⅇ",ExponentialE:"ⅇ",fallingdotseq:"≒",fcy:"ф",Fcy:"Ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",ffr:"𝔣",Ffr:"𝔉",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",fopf:"𝕗",Fopf:"𝔽",forall:"∀",ForAll:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"𝒻",Fscr:"ℱ",gacute:"ǵ",gamma:"γ",Gamma:"Γ",gammad:"ϝ",Gammad:"Ϝ",gap:"⪆",gbreve:"ğ",Gbreve:"Ğ",Gcedil:"Ģ",gcirc:"ĝ",Gcirc:"Ĝ",gcy:"г",Gcy:"Г",gdot:"ġ",Gdot:"Ġ",ge:"≥",gE:"≧",gel:"⋛",gEl:"⪌",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",gfr:"𝔤",Gfr:"𝔊",gg:"≫",Gg:"⋙",ggg:"⋙",gimel:"ℷ",gjcy:"ѓ",GJcy:"Ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gnE:"≩",gneq:"⪈",gneqq:"≩",gnsim:"⋧",gopf:"𝕘",Gopf:"𝔾",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",gscr:"ℊ",Gscr:"𝒢",gsim:"≳",gsime:"⪎",gsiml:"⪐",gt:">",Gt:"≫",GT:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",hardcy:"ъ",HARDcy:"Ъ",harr:"↔",hArr:"⇔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",hcirc:"ĥ",Hcirc:"Ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",Hfr:"ℌ",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",Hopf:"ℍ",horbar:"―",HorizontalLine:"─",hscr:"𝒽",Hscr:"ℋ",hslash:"ℏ",hstrok:"ħ",Hstrok:"Ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",iacute:"í",Iacute:"Í",ic:"⁣",icirc:"î",Icirc:"Î",icy:"и",Icy:"И",Idot:"İ",iecy:"е",IEcy:"Е",iexcl:"¡",iff:"⇔",ifr:"𝔦",Ifr:"ℑ",igrave:"ì",Igrave:"Ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",ijlig:"ij",IJlig:"IJ",Im:"ℑ",imacr:"ī",Imacr:"Ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",int:"∫",Int:"∬",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",iocy:"ё",IOcy:"Ё",iogon:"į",Iogon:"Į",iopf:"𝕚",Iopf:"𝕀",iota:"ι",Iota:"Ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",Iscr:"ℐ",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",itilde:"ĩ",Itilde:"Ĩ",iukcy:"і",Iukcy:"І",iuml:"ï",Iuml:"Ï",jcirc:"ĵ",Jcirc:"Ĵ",jcy:"й",Jcy:"Й",jfr:"𝔧",Jfr:"𝔍",jmath:"ȷ",jopf:"𝕛",Jopf:"𝕁",jscr:"𝒿",Jscr:"𝒥",jsercy:"ј",Jsercy:"Ј",jukcy:"є",Jukcy:"Є",kappa:"κ",Kappa:"Κ",kappav:"ϰ",kcedil:"ķ",Kcedil:"Ķ",kcy:"к",Kcy:"К",kfr:"𝔨",Kfr:"𝔎",kgreen:"ĸ",khcy:"х",KHcy:"Х",kjcy:"ќ",KJcy:"Ќ",kopf:"𝕜",Kopf:"𝕂",kscr:"𝓀",Kscr:"𝒦",lAarr:"⇚",lacute:"ĺ",Lacute:"Ĺ",laemptyv:"⦴",lagran:"ℒ",lambda:"λ",Lambda:"Λ",lang:"⟨",Lang:"⟪",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",larr:"←",lArr:"⇐",Larr:"↞",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",latail:"⤙",lAtail:"⤛",late:"⪭",lates:"⪭︀",lbarr:"⤌",lBarr:"⤎",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",lcaron:"ľ",Lcaron:"Ľ",lcedil:"ļ",Lcedil:"Ļ",lceil:"⌈",lcub:"{",lcy:"л",Lcy:"Л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",lE:"≦",LeftAngleBracket:"⟨",leftarrow:"←",Leftarrow:"⇐",LeftArrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",Leftrightarrow:"⇔",LeftRightArrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",leg:"⋚",lEg:"⪋",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",lfr:"𝔩",Lfr:"𝔏",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",ljcy:"љ",LJcy:"Љ",ll:"≪",Ll:"⋘",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",lmidot:"ŀ",Lmidot:"Ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lnE:"≨",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",Longleftarrow:"⟸",LongLeftArrow:"⟵",longleftrightarrow:"⟷",Longleftrightarrow:"⟺",LongLeftRightArrow:"⟷",longmapsto:"⟼",longrightarrow:"⟶",Longrightarrow:"⟹",LongRightArrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",lopf:"𝕝",Lopf:"𝕃",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",Lscr:"ℒ",lsh:"↰",Lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",lstrok:"ł",Lstrok:"Ł",lt:"<",Lt:"≪",LT:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",map:"↦",Map:"⤅",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",mcy:"м",Mcy:"М",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",mfr:"𝔪",Mfr:"𝔐",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",mopf:"𝕞",Mopf:"𝕄",mp:"∓",mscr:"𝓂",Mscr:"ℳ",mstpos:"∾",mu:"μ",Mu:"Μ",multimap:"⊸",mumap:"⊸",nabla:"∇",nacute:"ń",Nacute:"Ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",ncaron:"ň",Ncaron:"Ň",ncedil:"ņ",Ncedil:"Ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",ncy:"н",Ncy:"Н",ndash:"–",ne:"≠",nearhk:"⤤",nearr:"↗",neArr:"⇗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:`
26
+ `,nexist:"∄",nexists:"∄",nfr:"𝔫",Nfr:"𝔑",nge:"≱",ngE:"≧̸",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",ngt:"≯",nGt:"≫⃒",ngtr:"≯",nGtv:"≫̸",nharr:"↮",nhArr:"⇎",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",njcy:"њ",NJcy:"Њ",nlarr:"↚",nlArr:"⇍",nldr:"‥",nle:"≰",nlE:"≦̸",nleftarrow:"↚",nLeftarrow:"⇍",nleftrightarrow:"↮",nLeftrightarrow:"⇎",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nlt:"≮",nLt:"≪⃒",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",nopf:"𝕟",Nopf:"ℕ",not:"¬",Not:"⫬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrarr:"↛",nrArr:"⇏",nrarrc:"⤳̸",nrarrw:"↝̸",nrightarrow:"↛",nRightarrow:"⇏",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",nscr:"𝓃",Nscr:"𝒩",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsube:"⊈",nsubE:"⫅̸",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupe:"⊉",nsupE:"⫆̸",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",ntilde:"ñ",Ntilde:"Ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",nu:"ν",Nu:"Ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nvdash:"⊬",nvDash:"⊭",nVdash:"⊮",nVDash:"⊯",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwarr:"↖",nwArr:"⇖",nwarrow:"↖",nwnear:"⤧",oacute:"ó",Oacute:"Ó",oast:"⊛",ocir:"⊚",ocirc:"ô",Ocirc:"Ô",ocy:"о",Ocy:"О",odash:"⊝",odblac:"ő",Odblac:"Ő",odiv:"⨸",odot:"⊙",odsold:"⦼",oelig:"œ",OElig:"Œ",ofcir:"⦿",ofr:"𝔬",Ofr:"𝔒",ogon:"˛",ograve:"ò",Ograve:"Ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",omacr:"ō",Omacr:"Ō",omega:"ω",Omega:"Ω",omicron:"ο",Omicron:"Ο",omid:"⦶",ominus:"⊖",oopf:"𝕠",Oopf:"𝕆",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",or:"∨",Or:"⩔",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",oscr:"ℴ",Oscr:"𝒪",oslash:"ø",Oslash:"Ø",osol:"⊘",otilde:"õ",Otilde:"Õ",otimes:"⊗",Otimes:"⨷",otimesas:"⨶",ouml:"ö",Ouml:"Ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",pcy:"п",Pcy:"П",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",pfr:"𝔭",Pfr:"𝔓",phi:"φ",Phi:"Φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",pi:"π",Pi:"Π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",popf:"𝕡",Popf:"ℙ",pound:"£",pr:"≺",Pr:"⪻",prap:"⪷",prcue:"≼",pre:"⪯",prE:"⪳",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",prime:"′",Prime:"″",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",pscr:"𝓅",Pscr:"𝒫",psi:"ψ",Psi:"Ψ",puncsp:" ",qfr:"𝔮",Qfr:"𝔔",qint:"⨌",qopf:"𝕢",Qopf:"ℚ",qprime:"⁗",qscr:"𝓆",Qscr:"𝒬",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',QUOT:'"',rAarr:"⇛",race:"∽̱",racute:"ŕ",Racute:"Ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",Rang:"⟫",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarr:"→",rArr:"⇒",Rarr:"↠",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",rarrtl:"↣",Rarrtl:"⤖",rarrw:"↝",ratail:"⤚",rAtail:"⤜",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rBarr:"⤏",RBarr:"⤐",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",rcaron:"ř",Rcaron:"Ř",rcedil:"ŗ",Rcedil:"Ŗ",rceil:"⌉",rcub:"}",rcy:"р",Rcy:"Р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",reg:"®",REG:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",Rfr:"ℜ",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",rho:"ρ",Rho:"Ρ",rhov:"ϱ",RightAngleBracket:"⟩",rightarrow:"→",Rightarrow:"⇒",RightArrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",Ropf:"ℝ",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",rscr:"𝓇",Rscr:"ℛ",rsh:"↱",Rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",sacute:"ś",Sacute:"Ś",sbquo:"‚",sc:"≻",Sc:"⪼",scap:"⪸",scaron:"š",Scaron:"Š",sccue:"≽",sce:"⪰",scE:"⪴",scedil:"ş",Scedil:"Ş",scirc:"ŝ",Scirc:"Ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",scy:"с",Scy:"С",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",searr:"↘",seArr:"⇘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",sfr:"𝔰",Sfr:"𝔖",sfrown:"⌢",sharp:"♯",shchcy:"щ",SHCHcy:"Щ",shcy:"ш",SHcy:"Ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",sigma:"σ",Sigma:"Σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",softcy:"ь",SOFTcy:"Ь",sol:"/",solb:"⧄",solbar:"⌿",sopf:"𝕤",Sopf:"𝕊",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",square:"□",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",sscr:"𝓈",Sscr:"𝒮",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",star:"☆",Star:"⋆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",Sub:"⋐",subdot:"⪽",sube:"⊆",subE:"⫅",subedot:"⫃",submult:"⫁",subne:"⊊",subnE:"⫋",subplus:"⪿",subrarr:"⥹",subset:"⊂",Subset:"⋐",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",sum:"∑",Sum:"∑",sung:"♪",sup:"⊃",Sup:"⋑",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supe:"⊇",supE:"⫆",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supne:"⊋",supnE:"⫌",supplus:"⫀",supset:"⊃",Supset:"⋑",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swarr:"↙",swArr:"⇙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",tau:"τ",Tau:"Τ",tbrk:"⎴",tcaron:"ť",Tcaron:"Ť",tcedil:"ţ",Tcedil:"Ţ",tcy:"т",Tcy:"Т",tdot:"⃛",telrec:"⌕",tfr:"𝔱",Tfr:"𝔗",there4:"∴",therefore:"∴",Therefore:"∴",theta:"θ",Theta:"Θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",thorn:"þ",THORN:"Þ",tilde:"˜",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",topf:"𝕥",Topf:"𝕋",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",TRADE:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",tscr:"𝓉",Tscr:"𝒯",tscy:"ц",TScy:"Ц",tshcy:"ћ",TSHcy:"Ћ",tstrok:"ŧ",Tstrok:"Ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",uacute:"ú",Uacute:"Ú",uarr:"↑",uArr:"⇑",Uarr:"↟",Uarrocir:"⥉",ubrcy:"ў",Ubrcy:"Ў",ubreve:"ŭ",Ubreve:"Ŭ",ucirc:"û",Ucirc:"Û",ucy:"у",Ucy:"У",udarr:"⇅",udblac:"ű",Udblac:"Ű",udhar:"⥮",ufisht:"⥾",ufr:"𝔲",Ufr:"𝔘",ugrave:"ù",Ugrave:"Ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",umacr:"ū",Umacr:"Ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",uogon:"ų",Uogon:"Ų",uopf:"𝕦",Uopf:"𝕌",uparrow:"↑",Uparrow:"⇑",UpArrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",updownarrow:"↕",Updownarrow:"⇕",UpDownArrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",upsi:"υ",Upsi:"ϒ",upsih:"ϒ",upsilon:"υ",Upsilon:"Υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",uring:"ů",Uring:"Ů",urtri:"◹",uscr:"𝓊",Uscr:"𝒰",utdot:"⋰",utilde:"ũ",Utilde:"Ũ",utri:"▵",utrif:"▴",uuarr:"⇈",uuml:"ü",Uuml:"Ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",vArr:"⇕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vBar:"⫨",Vbar:"⫫",vBarv:"⫩",vcy:"в",Vcy:"В",vdash:"⊢",vDash:"⊨",Vdash:"⊩",VDash:"⊫",Vdashl:"⫦",vee:"∨",Vee:"⋁",veebar:"⊻",veeeq:"≚",vellip:"⋮",verbar:"|",Verbar:"‖",vert:"|",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",vfr:"𝔳",Vfr:"𝔙",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",vopf:"𝕧",Vopf:"𝕍",vprop:"∝",vrtri:"⊳",vscr:"𝓋",Vscr:"𝒱",vsubne:"⊊︀",vsubnE:"⫋︀",vsupne:"⊋︀",vsupnE:"⫌︀",Vvdash:"⊪",vzigzag:"⦚",wcirc:"ŵ",Wcirc:"Ŵ",wedbar:"⩟",wedge:"∧",Wedge:"⋀",wedgeq:"≙",weierp:"℘",wfr:"𝔴",Wfr:"𝔚",wopf:"𝕨",Wopf:"𝕎",wp:"℘",wr:"≀",wreath:"≀",wscr:"𝓌",Wscr:"𝒲",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",xfr:"𝔵",Xfr:"𝔛",xharr:"⟷",xhArr:"⟺",xi:"ξ",Xi:"Ξ",xlarr:"⟵",xlArr:"⟸",xmap:"⟼",xnis:"⋻",xodot:"⨀",xopf:"𝕩",Xopf:"𝕏",xoplus:"⨁",xotime:"⨂",xrarr:"⟶",xrArr:"⟹",xscr:"𝓍",Xscr:"𝒳",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",yacute:"ý",Yacute:"Ý",yacy:"я",YAcy:"Я",ycirc:"ŷ",Ycirc:"Ŷ",ycy:"ы",Ycy:"Ы",yen:"¥",yfr:"𝔶",Yfr:"𝔜",yicy:"ї",YIcy:"Ї",yopf:"𝕪",Yopf:"𝕐",yscr:"𝓎",Yscr:"𝒴",yucy:"ю",YUcy:"Ю",yuml:"ÿ",Yuml:"Ÿ",zacute:"ź",Zacute:"Ź",zcaron:"ž",Zcaron:"Ž",zcy:"з",Zcy:"З",zdot:"ż",Zdot:"Ż",zeetrf:"ℨ",ZeroWidthSpace:"​",zeta:"ζ",Zeta:"Ζ",zfr:"𝔷",Zfr:"ℨ",zhcy:"ж",ZHcy:"Ж",zigrarr:"⇝",zopf:"𝕫",Zopf:"ℤ",zscr:"𝓏",Zscr:"𝒵",zwj:"‍",zwnj:"‌"},g={aacute:"á",Aacute:"Á",acirc:"â",Acirc:"Â",acute:"´",aelig:"æ",AElig:"Æ",agrave:"à",Agrave:"À",amp:"&",AMP:"&",aring:"å",Aring:"Å",atilde:"ã",Atilde:"Ã",auml:"ä",Auml:"Ä",brvbar:"¦",ccedil:"ç",Ccedil:"Ç",cedil:"¸",cent:"¢",copy:"©",COPY:"©",curren:"¤",deg:"°",divide:"÷",eacute:"é",Eacute:"É",ecirc:"ê",Ecirc:"Ê",egrave:"è",Egrave:"È",eth:"ð",ETH:"Ð",euml:"ë",Euml:"Ë",frac12:"½",frac14:"¼",frac34:"¾",gt:">",GT:">",iacute:"í",Iacute:"Í",icirc:"î",Icirc:"Î",iexcl:"¡",igrave:"ì",Igrave:"Ì",iquest:"¿",iuml:"ï",Iuml:"Ï",laquo:"«",lt:"<",LT:"<",macr:"¯",micro:"µ",middot:"·",nbsp:" ",not:"¬",ntilde:"ñ",Ntilde:"Ñ",oacute:"ó",Oacute:"Ó",ocirc:"ô",Ocirc:"Ô",ograve:"ò",Ograve:"Ò",ordf:"ª",ordm:"º",oslash:"ø",Oslash:"Ø",otilde:"õ",Otilde:"Õ",ouml:"ö",Ouml:"Ö",para:"¶",plusmn:"±",pound:"£",quot:'"',QUOT:'"',raquo:"»",reg:"®",REG:"®",sect:"§",shy:"­",sup1:"¹",sup2:"²",sup3:"³",szlig:"ß",thorn:"þ",THORN:"Þ",times:"×",uacute:"ú",Uacute:"Ú",ucirc:"û",Ucirc:"Û",ugrave:"ù",Ugrave:"Ù",uml:"¨",uuml:"ü",Uuml:"Ü",yacute:"ý",Yacute:"Ý",yen:"¥",yuml:"ÿ"},v={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"},k=[1,2,3,4,5,6,7,8,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,64976,64977,64978,64979,64980,64981,64982,64983,64984,64985,64986,64987,64988,64989,64990,64991,64992,64993,64994,64995,64996,64997,64998,64999,65e3,65001,65002,65003,65004,65005,65006,65007,65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111],b=String.fromCharCode,C={},D=C.hasOwnProperty,M=function(X,ue){return D.call(X,ue)},I=function(X,ue){for(var Z=-1,R=X.length;++Z<R;)if(X[Z]==ue)return!0;return!1},E=function(X,ue){if(!X)return ue;var Z={},R;for(R in ue)Z[R]=M(X,R)?X[R]:ue[R];return Z},G=function(X,ue){var Z="";return X>=55296&&X<=57343||X>1114111?(ue&&H("character reference outside the permissible Unicode range"),"�"):M(v,X)?(ue&&H("disallowed character reference"),v[X]):(ue&&I(k,X)&&H("disallowed character reference"),X>65535&&(X-=65536,Z+=b(X>>>10&1023|55296),X=56320|X&1023),Z+=b(X),Z)},oe=function(X){return"&#x"+X.toString(16).toUpperCase()+";"},N=function(X){return"&#"+X+";"},H=function(X){throw Error("Parse error: "+X)},A=function(X,ue){ue=E(ue,A.options);var Z=ue.strict;Z&&h.test(X)&&H("forbidden code point");var R=ue.encodeEverything,ee=ue.useNamedReferences,ne=ue.allowUnsafeSymbols,se=ue.decimal?N:oe,Y=function($){return se($.charCodeAt(0))};return R?(X=X.replace(a,function($){return ee&&M(u,$)?"&"+u[$]+";":Y($)}),ee&&(X=X.replace(/&gt;\u20D2/g,"&nvgt;").replace(/&lt;\u20D2/g,"&nvlt;").replace(/&#x66;&#x6A;/g,"&fjlig;")),ee&&(X=X.replace(c,function($){return"&"+u[$]+";"}))):ee?(ne||(X=X.replace(d,function($){return"&"+u[$]+";"})),X=X.replace(/&gt;\u20D2/g,"&nvgt;").replace(/&lt;\u20D2/g,"&nvlt;"),X=X.replace(c,function($){return"&"+u[$]+";"})):ne||(X=X.replace(d,Y)),X.replace(s,function($){var T=$.charCodeAt(0),K=$.charCodeAt(1),q=(T-55296)*1024+K-56320+65536;return se(q)}).replace(l,Y)};A.options={allowUnsafeSymbols:!1,encodeEverything:!1,strict:!1,useNamedReferences:!1,decimal:!1};var J=function(X,ue){ue=E(ue,J.options);var Z=ue.strict;return Z&&f.test(X)&&H("malformed character reference"),X.replace(m,function(R,ee,ne,se,Y,$,T,K,q){var F,L,le,S,re,Q;return ee?(re=ee,y[re]):ne?(re=ne,Q=se,Q&&ue.isAttributeValue?(Z&&Q=="="&&H("`&` did not start a character reference"),R):(Z&&H("named character reference was not terminated by a semicolon"),g[re]+(Q||""))):Y?(le=Y,L=$,Z&&!L&&H("character reference was not terminated by a semicolon"),F=parseInt(le,10),G(F,Z)):T?(S=T,L=K,Z&&!L&&H("character reference was not terminated by a semicolon"),F=parseInt(S,16),G(F,Z)):(Z&&H("named character reference was not terminated by a semicolon"),R)})};J.options={isAttributeValue:!1,strict:!1};var ie=function(X){return X.replace(d,function(ue){return p[ue]})},W={version:"1.2.0",encode:A,decode:J,escape:ie,unescape:J};if(r&&!r.nodeType)if(o)o.exports=W;else for(var ce in W)M(W,ce)&&(r[ce]=W[ce]);else n.he=W})(zt)})(il,il.exports);var EC=il.exports;const TC=Wl(EC);function St(t){this.content=t}St.prototype={constructor:St,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,n){var r=n&&n!=t?this.remove(n):this,o=r.find(t),i=r.content.slice();return o==-1?i.push(n||t,e):(i[o+1]=e,n&&(i[o]=n)),new St(i)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new St(n)},addToStart:function(t,e){return new St([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new St(n)},addBefore:function(t,e,n){var r=this.remove(e),o=r.content.slice(),i=r.find(t);return o.splice(i==-1?o.length:i,0,e,n),new St(o)},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=St.from(t),t.size?new St(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=St.from(t),t.size?new St(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=St.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};St.from=function(t){if(t instanceof St)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new St(e)};function qb(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let o=t.child(r),i=e.child(r);if(o==i){n+=o.nodeSize;continue}if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(let s=0;o.text[s]==i.text[s];s++)n++;return n}if(o.content.size||i.content.size){let s=qb(o.content,i.content,n+1);if(s!=null)return s}n+=o.nodeSize}}function Vb(t,e,n,r){for(let o=t.childCount,i=e.childCount;;){if(o==0||i==0)return o==i?null:{a:n,b:r};let s=t.child(--o),a=e.child(--i),l=s.nodeSize;if(s==a){n-=l,r-=l;continue}if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let c=0,u=Math.min(s.text.length,a.text.length);for(;c<u&&s.text[s.text.length-c-1]==a.text[a.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(s.content.size||a.content.size){let c=Vb(s.content,a.content,n-1,r-1);if(c)return c}n-=l,r-=l}}let ye=class Bt{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,o=0,i){for(let s=0,a=0;a<n;s++){let l=this.content[s],c=a+l.nodeSize;if(c>e&&r(l,o+a,i||null,s)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,e-u),Math.min(l.content.size,n-u),r,o+u)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,o){let i="",s=!0;return this.nodesBetween(e,n,(a,l)=>{let c=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?o?typeof o=="function"?o(a):o:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&r&&(s?s=!1:i+=r),i+=c},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,o=this.content.slice(),i=0;for(n.isText&&n.sameMarkup(r)&&(o[o.length-1]=n.withText(n.text+r.text),i=1);i<e.content.length;i++)o.push(e.content[i]);return new Bt(o,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],o=0;if(n>e)for(let i=0,s=0;s<n;i++){let a=this.content[i],l=s+a.nodeSize;l>e&&((s<e||l>n)&&(a.isText?a=a.cut(Math.max(0,e-s),Math.min(a.text.length,n-s)):a=a.cut(Math.max(0,e-s-1),Math.min(a.content.size,n-s-1))),r.push(a),o+=a.nodeSize),s=l}return new Bt(r,o)}cutByIndex(e,n){return e==n?Bt.empty:e==0&&n==this.content.length?this:new Bt(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let o=this.content.slice(),i=this.size+n.nodeSize-r.nodeSize;return o[e]=n,new Bt(o,i)}addToStart(e){return new Bt([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Bt(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))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 n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let o=this.content[n];e(o,r,n),r+=o.nodeSize}}findDiffStart(e,n=0){return qb(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return Vb(this,e,n,r)}findIndex(e,n=-1){if(e==0)return oa(0,e);if(e==this.size)return oa(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,o=0;;r++){let i=this.child(r),s=o+i.nodeSize;if(s>=e)return s==e||n>0?oa(r+1,s):oa(r,o);o=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,n){if(!n)return Bt.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new Bt(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Bt.empty;let n,r=0;for(let o=0;o<e.length;o++){let i=e[o];r+=i.nodeSize,o&&i.isText&&e[o-1].sameMarkup(i)?(n||(n=e.slice(0,o)),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new Bt(n||e,r)}static from(e){if(!e)return Bt.empty;if(e instanceof Bt)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new Bt([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}};ye.empty=new ye([],0);const gu={index:0,offset:0};function oa(t,e){return gu.index=t,gu.offset=e,gu}function sl(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!sl(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!sl(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let Xe=class xd{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let o=0;o<e.length;o++){let i=e[o];if(this.eq(i))return e;if(this.type.excludes(i.type))n||(n=e.slice(0,o));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(n||(n=e.slice(0,o)),n.push(this),r=!0),n&&n.push(i)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&sl(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let o=r.create(n.attrs);return r.checkAttrs(o.attrs),o}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return xd.none;if(e instanceof xd)return[e];let n=e.slice();return n.sort((r,o)=>r.type.rank-o.type.rank),n}};Xe.none=[];let al=class extends Error{},ve=class Ro{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=Hb(this.content,e+this.openStart,n);return r&&new Ro(r,this.openStart,this.openEnd)}removeBetween(e,n){return new Ro(Ub(this.content,e+this.openStart,n+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,n){if(!n)return Ro.empty;let r=n.openStart||0,o=n.openEnd||0;if(typeof r!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Ro(ye.fromJSON(e,n.content),r,o)}static maxOpen(e,n=!0){let r=0,o=0;for(let i=e.firstChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.lastChild)o++;return new Ro(e,r,o)}};ve.empty=new ve(ye.empty,0,0);function Ub(t,e,n){let{index:r,offset:o}=t.findIndex(e),i=t.maybeChild(r),{index:s,offset:a}=t.findIndex(n);if(o==e||i.isText){if(a!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,i.copy(Ub(i.content,e-o-1,n-o-1)))}function Hb(t,e,n,r){let{index:o,offset:i}=t.findIndex(e),s=t.maybeChild(o);if(i==e||s.isText)return t.cut(0,e).append(n).append(t.cut(e));let a=Hb(s.content,e-i-1,n);return a&&t.replaceChild(o,s.copy(a))}function $C(t,e,n){if(n.openStart>t.depth)throw new al("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new al("Inconsistent open depths");return Wb(t,e,n,0)}function Wb(t,e,n,r){let o=t.index(r),i=t.node(r);if(o==e.index(r)&&r<t.depth-n.openStart){let s=Wb(t,e,n,r+1);return i.copy(i.content.replaceChild(o,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let s=t.parent,a=s.content;return io(s,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:s,end:a}=OC(n,t);return io(i,Kb(t,s,a,e,r))}else return io(i,ll(t,e,r))}function Gb(t,e){if(!e.type.compatibleContent(t.type))throw new al("Cannot join "+e.type.name+" onto "+t.type.name)}function kd(t,e,n){let r=t.node(n);return Gb(r,e.node(n)),r}function oo(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Yi(t,e,n,r){let o=(e||t).node(n),i=0,s=e?e.index(n):o.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(oo(t.nodeAfter,r),i++));for(let a=i;a<s;a++)oo(o.child(a),r);e&&e.depth==n&&e.textOffset&&oo(e.nodeBefore,r)}function io(t,e){return t.type.checkContent(e),t.copy(e)}function Kb(t,e,n,r,o){let i=t.depth>o&&kd(t,e,o+1),s=r.depth>o&&kd(n,r,o+1),a=[];return Yi(null,t,o,a),i&&s&&e.index(o)==n.index(o)?(Gb(i,s),oo(io(i,Kb(t,e,n,r,o+1)),a)):(i&&oo(io(i,ll(t,e,o+1)),a),Yi(e,n,o,a),s&&oo(io(s,ll(n,r,o+1)),a)),Yi(r,null,o,a),new ye(a)}function ll(t,e,n){let r=[];if(Yi(null,t,n,r),t.depth>n){let o=kd(t,e,n+1);oo(io(o,ll(t,e,n+1)),r)}return Yi(e,null,n,r),new ye(r)}function OC(t,e){let n=e.depth-t.openStart,r=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)r=e.node(o).copy(ye.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}let lg=class Sd{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.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,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],o=e.child(n);return r?e.child(n).cut(r):o}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],o=n==0?0:this.path[n*3-1]+1;for(let i=0;i<e;i++)o+=r.child(i).nodeSize;return o}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return Xe.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),o=e.maybeChild(n);if(!r){let a=r;r=o,o=a}let i=r.marks;for(var s=0;s<i.length;s++)i[s].type.spec.inclusive===!1&&(!o||!i[s].isInSet(o.marks))&&(i=i[s--].removeFromSet(i));return i}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,o=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!o||!r[i].isInSet(o.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new cl(this,e,r);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 n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],o=0,i=n;for(let s=e;;){let{index:a,offset:l}=s.content.findIndex(i),c=i-l;if(r.push(s,a,o+l),!c||(s=s.child(a),s.isText))break;i=c-1,o+=l+1}return new Sd(n,r,i)}static resolveCached(e,n){let r=cg.get(e);if(r)for(let i=0;i<r.elts.length;i++){let s=r.elts[i];if(s.pos==n)return s}else cg.set(e,r=new MC);let o=r.elts[r.i]=Sd.resolve(e,n);return r.i=(r.i+1)%DC,o}},MC=class{constructor(){this.elts=[],this.i=0}};const DC=12,cg=new WeakMap;let cl=class{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}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 _C=Object.create(null);let so=class Ad{constructor(e,n,r,o=Xe.none){this.type=e,this.attrs=n,this.marks=o,this.content=r||ye.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,n,r,o=0){this.content.nodesBetween(e,n,r,o,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,n,r,o){return this.content.textBetween(e,n,r,o)}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,n,r){return this.type==e&&sl(this.attrs,n||e.defaultAttrs||_C)&&Xe.sameSet(this.marks,r||Xe.none)}copy(e=null){return e==this.content?this:new Ad(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Ad(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return ve.empty;let o=this.resolve(e),i=this.resolve(n),s=r?0:o.sharedDepth(n),a=o.start(s),l=o.node(s).content.cut(o.pos-a,i.pos-a);return new ve(l,o.depth-s,i.depth-s)}replace(e,n,r){return $C(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:o}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(o==e||n.isText)return n;e-=o+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let o=this.content.child(n-1);return{node:o,index:n-1,offset:r-o.nodeSize}}resolve(e){return lg.resolveCached(this,e)}resolveNoCache(e){return lg.resolve(this,e)}rangeHasMark(e,n,r){let o=!1;return n>e&&this.nodesBetween(e,n,i=>(r.isInSet(i.marks)&&(o=!0),!o)),o}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()+")"),Jb(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=ye.empty,o=0,i=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,o,i),a=s&&s.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=o;l<i;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,o){if(o&&!this.type.allowsMarks(o))return!1;let i=this.contentMatchAt(e).matchType(r),s=i&&i.matchFragment(this.content,n);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=Xe.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!Xe.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n 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(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let o=ye.fromJSON(e,n.content),i=e.nodeType(n.type).create(n.attrs,o,r);return i.type.checkAttrs(i.attrs),i}};so.prototype.text=void 0;let NC=class Cd extends so{constructor(e,n,r,o){if(super(e,n,null,o),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Jb(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Cd(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Cd(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function Jb(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}let ms=class Xb{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new IC(e,n);if(r.next==null)return Xb.empty;let o=Yb(r);r.next&&r.err("Unexpected trailing text");let i=jC(zC(o));return qC(i,r),i}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let o=this;for(let i=n;o&&i<r;i++)o=o.matchType(e.child(i).type);return o}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:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let o=[this];function i(s,a){let l=s.matchFragment(e,r);if(l&&(!n||l.validEnd))return ye.from(a.map(c=>c.createAndFill()));for(let c=0;c<s.next.length;c++){let{type:u,next:d}=s.next[c];if(!(u.isText||u.hasRequiredAttrs())&&o.indexOf(d)==-1){o.push(d);let p=i(d,a.concat(u));if(p)return p}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let o=r.shift(),i=o.match;if(i.matchType(e)){let s=[];for(let a=o;a.type;a=a.via)s.push(a.type);return s.reverse()}for(let s=0;s<i.next.length;s++){let{type:a,next:l}=i.next[s];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!o.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:o}),n[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 n(r){e.push(r);for(let o=0;o<r.next.length;o++)e.indexOf(r.next[o].next)==-1&&n(r.next[o].next)}return n(this),e.map((r,o)=>{let i=o+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)i+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return i}).join(`
27
+ `)}};ms.empty=new ms(!0);let IC=class{constructor(e,n){this.string=e,this.nodeTypes=n,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 Yb(t){let e=[];do e.push(FC(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function FC(t){let e=[];do e.push(RC(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function RC(t){let e=PC(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=BC(t,e);else break;return e}function ug(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function BC(t,e){let n=ug(t),r=n;return t.eat(",")&&(t.next!="}"?r=ug(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function LC(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let o=[];for(let i in n){let s=n[i];s.isInGroup(e)&&o.push(s)}return o.length==0&&t.err("No node type or group '"+e+"' found"),o}function PC(t){if(t.eat("(")){let e=Yb(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=LC(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function zC(t){let e=[[]];return o(i(t,0),n()),e;function n(){return e.push([])-1}function r(s,a,l){let c={term:l,to:a};return e[s].push(c),c}function o(s,a){s.forEach(l=>l.to=a)}function i(s,a){if(s.type=="choice")return s.exprs.reduce((l,c)=>l.concat(i(c,a)),[]);if(s.type=="seq")for(let l=0;;l++){let c=i(s.exprs[l],a);if(l==s.exprs.length-1)return c;o(c,a=n())}else if(s.type=="star"){let l=n();return r(a,l),o(i(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=n();return o(i(s.expr,a),l),o(i(s.expr,l),l),[r(l)]}else{if(s.type=="opt")return[r(a)].concat(i(s.expr,a));if(s.type=="range"){let l=a;for(let c=0;c<s.min;c++){let u=n();o(i(s.expr,l),u),l=u}if(s.max==-1)o(i(s.expr,l),l);else for(let c=s.min;c<s.max;c++){let u=n();r(l,u),o(i(s.expr,l),u),l=u}return[r(l)]}else{if(s.type=="name")return[r(a,void 0,s.value)];throw new Error("Unknown expr type")}}}}function Zb(t,e){return e-t}function dg(t,e){let n=[];return r(e),n.sort(Zb);function r(o){let i=t[o];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(o);for(let s=0;s<i.length;s++){let{term:a,to:l}=i[s];!a&&n.indexOf(l)==-1&&r(l)}}}function jC(t){let e=Object.create(null);return n(dg(t,0));function n(r){let o=[];r.forEach(s=>{t[s].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let u=0;u<o.length;u++)o[u][0]==a&&(c=o[u][1]);dg(t,l).forEach(u=>{c||o.push([a,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let i=e[r.join(",")]=new ms(r.indexOf(t.length-1)>-1);for(let s=0;s<o.length;s++){let a=o[s][1].sort(Zb);i.next.push({type:o[s][0],next:e[a.join(",")]||n(a)})}return i}}function qC(t,e){for(let n=0,r=[t];n<r.length;n++){let o=r[n],i=!o.validEnd,s=[];for(let a=0;a<o.next.length;a++){let{type:l,next:c}=o.next[a];s.push(l.name),i&&!(l.isText||l.hasRequiredAttrs())&&(i=!1),r.indexOf(c)==-1&&r.push(c)}i&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Qb(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function ev(t,e){let n=Object.create(null);for(let r in t){let o=e&&e[r];if(o===void 0){let i=t[r];if(i.hasDefault)o=i.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=o}return n}function tv(t,e,n,r){for(let o in e)if(!(o in t))throw new RangeError(`Unsupported attribute ${o} for ${n} of type ${o}`);for(let o in t){let i=t[o];i.validate&&i.validate(e[o])}}function nv(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new UC(t,r,e[r]);return n}let pg=class rv{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=nv(e,r.attrs),this.defaultAttrs=Qb(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==ms.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:ev(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new so(this,this.computeAttrs(e),ye.from(n),Xe.setFrom(r))}createChecked(e=null,n,r){return n=ye.from(n),this.checkContent(n),new so(this,this.computeAttrs(e),n,Xe.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=ye.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let o=this.contentMatch.matchFragment(n),i=o&&o.fillBefore(ye.empty,!0);return i?new so(this,e,n.append(i),Xe.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).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){tv(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 n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:Xe.none:e}static compile(e,n){let r=Object.create(null);e.forEach((i,s)=>r[i]=new rv(i,n,s));let o=n.spec.topNode||"doc";if(!r[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function VC(t,e,n){let r=n.split("|");return o=>{let i=o===null?"null":typeof o;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${i}`)}}let UC=class{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?VC(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}},ov=class iv{constructor(e,n,r,o){this.name=e,this.rank=n,this.schema=r,this.spec=o,this.attrs=nv(e,o.attrs),this.excluded=null;let i=Qb(this.attrs);this.instance=i?new Xe(this,i):null}create(e=null){return!e&&this.instance?this.instance:new Xe(this,ev(this.attrs,e))}static compile(e,n){let r=Object.create(null),o=0;return e.forEach((i,s)=>r[i]=new iv(i,o++,n,s)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){tv(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}},sv=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let o in e)n[o]=e[o];n.nodes=St.from(e.nodes),n.marks=St.from(e.marks||{}),this.nodes=pg.compile(this.spec.nodes,this),this.marks=ov.compile(this.spec.marks,this);let r=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");let i=this.nodes[o],s=i.spec.content||"",a=i.spec.marks;if(i.contentMatch=r[s]||(r[s]=ms.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=a=="_"?null:a?fg(this,a.split(" ")):a==""||!i.inlineContent?[]:null}for(let o in this.marks){let i=this.marks[o],s=i.spec.excludes;i.excluded=s==null?[i]:s==""?[]:fg(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,n=null,r,o){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof pg){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(n,r,o)}text(e,n){let r=this.nodes.text;return new NC(r,r.defaultAttrs,e,Xe.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return so.fromJSON(this,e)}markFromJSON(e){return Xe.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}};function fg(t,e){let n=[];for(let r=0;r<e.length;r++){let o=e[r],i=t.marks[o],s=i;if(i)n.push(i);else for(let a in t.marks){let l=t.marks[a];(o=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(o)>-1)&&n.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function HC(t){return t.tag!=null}function WC(t){return t.style!=null}let er=class Ed{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(o=>{if(HC(o))this.tags.push(o);else if(WC(o)){let i=/[^=]*/.exec(o.style)[0];r.indexOf(i)<0&&r.push(i),this.styles.push(o)}}),this.normalizeLists=!this.tags.some(o=>{if(!/^(ul|ol)\b/.test(o.tag)||!o.node)return!1;let i=e.nodes[o.node];return i.contentMatch.matchType(i)})}parse(e,n={}){let r=new mg(this,n,!1);return r.addAll(e,Xe.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new mg(this,n,!0);return r.addAll(e,Xe.none,n.from,n.to),ve.maxOpen(r.finish())}matchTag(e,n,r){for(let o=r?this.tags.indexOf(r)+1:0;o<this.tags.length;o++){let i=this.tags[o];if(JC(e,i.tag)&&(i.namespace===void 0||e.namespaceURI==i.namespace)&&(!i.context||n.matchesContext(i.context))){if(i.getAttrs){let s=i.getAttrs(e);if(s===!1)continue;i.attrs=s||void 0}return i}}}matchStyle(e,n,r,o){for(let i=o?this.styles.indexOf(o)+1:0;i<this.styles.length;i++){let s=this.styles[i],a=s.style;if(!(a.indexOf(e)!=0||s.context&&!r.matchesContext(s.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(s.getAttrs){let l=s.getAttrs(n);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){let n=[];function r(o){let i=o.priority==null?50:o.priority,s=0;for(;s<n.length;s++){let a=n[s];if((a.priority==null?50:a.priority)<i)break}n.splice(s,0,o)}for(let o in e.marks){let i=e.marks[o].spec.parseDOM;i&&i.forEach(s=>{r(s=gg(s)),s.mark||s.ignore||s.clearMark||(s.mark=o)})}for(let o in e.nodes){let i=e.nodes[o].spec.parseDOM;i&&i.forEach(s=>{r(s=gg(s)),s.node||s.ignore||s.mark||(s.node=o)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Ed(e,Ed.schemaRules(e)))}};const av={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},GC={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},lv={ol:!0,ul:!0},gs=1,Td=2,Ra=4;function hg(t,e,n){return e!=null?(e?gs:0)|(e==="full"?Td:0):t&&t.whitespace=="pre"?gs|Td:n&-5}let ia=class{constructor(e,n,r,o,i,s){this.type=e,this.attrs=n,this.marks=r,this.solid=o,this.options=s,this.content=[],this.activeMarks=Xe.none,this.match=i||(s&Ra?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(ye.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,o;return(o=r.findWrapping(e.type))?(this.match=r,o):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&gs)){let r=this.content[this.content.length-1],o;if(r&&r.isText&&(o=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-o[0].length))}}let n=ye.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(ye.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!av.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},mg=class{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let o=n.topNode,i,s=hg(null,n.preserveWhitespace,0)|(r?Ra:0);o?i=new ia(o.type,o.attrs,Xe.none,!0,n.topMatch||o.type.contentMatch,s):r?i=new ia(null,null,Xe.none,!0,null,s):i=new ia(e.schema.topNodeType,null,Xe.none,!0,null,s),this.nodes=[i],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,o=this.top,i=o.options&Td?"full":this.localPreserveWS||(o.options&gs)>0;if(i==="full"||o.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(i)i!=="full"?r=r.replace(/\r?\n|\r/g," "):r=r.replace(/\r\n?/g,`
28
+ `);else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let s=o.content[o.content.length-1],a=e.previousSibling;(!s||a&&a.nodeName=="BR"||s.isText&&/[ \t\r\n\u000c]$/.test(s.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),n,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let o=this.localPreserveWS,i=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let s=e.nodeName.toLowerCase(),a;lv.hasOwnProperty(s)&&this.parser.normalizeLists&&KC(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,r));e:if(l?l.ignore:GC.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,n);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,u=this.needsBlock;if(av.hasOwnProperty(s))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),c=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let d=l&&l.skip?n:this.readStyles(e,n);d&&this.addAll(e,d),c&&this.sync(i),this.needsBlock=u}else{let c=this.readStyles(e,n);c&&this.addElementByRule(e,l,c,l.consuming===!1?a:void 0)}this.localPreserveWS=o}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
29
+ `),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let o=0;o<this.parser.matchedStyles.length;o++){let i=this.parser.matchedStyles[o],s=r.getPropertyValue(i);if(s)for(let a=void 0;;){let l=this.parser.matchStyle(i,s,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(c=>!l.clearMark(c)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return n}addElementByRule(e,n,r,o){let i,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let l=this.enter(s,n.attrs||null,r,n.preserveWhitespace);l&&(i=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let a=this.top;if(s&&s.isLeaf)this.findInside(e);else if(o)this.addElement(e,r,o);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,r,!1));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l,r),this.findAround(e,l,!1)}i&&this.sync(a)&&this.open--}addAll(e,n,r,o){let i=r||0;for(let s=r?e.childNodes[r]:e.firstChild,a=o==null?null:e.childNodes[o];s!=a;s=s.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(s,n);this.findAtPoint(e,i)}findPlace(e,n,r){let o,i;for(let s=this.open,a=0;s>=0;s--){let l=this.nodes[s],c=l.findWrapping(e);if(c&&(!o||o.length>c.length+a)&&(o=c,i=l,!c.length))break;if(l.solid){if(r)break;a+=2}}if(!o)return null;this.sync(i);for(let s=0;s<o.length;s++)n=this.enterInner(o[s],null,n,!1);return n}insertNode(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(n=this.enterInner(i,null,n))}let o=this.findPlace(e,n,r);if(o){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let s=Xe.none;for(let a of o.concat(e.marks))(i.type?i.type.allowsMarkType(a.type):yg(a.type,e.type))&&(s=a.addToSet(s));return i.content.push(e.mark(s)),!0}return!1}enter(e,n,r,o){let i=this.findPlace(e.create(n),r,!1);return i&&(i=this.enterInner(e,n,r,!0,o)),i}enterInner(e,n,r,o=!1,i){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(e);let a=hg(e,i,s.options);s.options&Ra&&s.content.length==0&&(a|=Ra);let l=Xe.none;return r=r.filter(c=>(s.type?s.type.allowsMarkType(c.type):yg(c.type,e))?(l=c.addToSet(l),!1):!0),this.nodes.push(new ia(e,n,l,o,null,a)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].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 n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=gs)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let o=r.length-1;o>=0;o--)e+=r[o].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let o=0;o<this.find.length;o++)this.find[o].pos==null&&e.nodeType==1&&e.contains(this.find[o].node)&&n.compareDocumentPosition(this.find[o].node)&(r?2:4)&&(this.find[o].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,o=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(o?0:1),s=(a,l)=>{for(;a>=0;a--){let c=n[a];if(c==""){if(a==n.length-1||a==0)continue;for(;l>=i;l--)if(s(a-1,l))return!0;return!1}else{let u=l>0||l==0&&o?this.nodes[l].type:r&&l>=i?r.node(l-i).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;l--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}};function KC(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&lv.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function JC(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function gg(t){let e={};for(let n in t)e[n]=t[n];return e}function yg(t,e){let n=e.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(t))continue;let i=[],s=a=>{i.push(a);for(let l=0;l<a.edgeCount;l++){let{type:c,next:u}=a.edge(l);if(c==e||i.indexOf(u)<0&&s(u))return!0}};if(s(o.contentMatch))return!0}}let xi=class cv{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=yu(n).createDocumentFragment());let o=r,i=[];return e.forEach(s=>{if(i.length||s.marks.length){let a=0,l=0;for(;a<i.length&&l<s.marks.length;){let c=s.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(i[a][0])||c.type.spec.spanning===!1)break;a++,l++}for(;a<i.length;)o=i.pop()[1];for(;l<s.marks.length;){let c=s.marks[l++],u=this.serializeMark(c,s.isInline,n);u&&(i.push([c,o]),o.appendChild(u.dom),o=u.contentDOM||u.dom)}}o.appendChild(this.serializeNodeInner(s,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:o}=Ba(yu(n),this.nodes[e.type.name](e),null,e.attrs);if(o){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,o)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let o=e.marks.length-1;o>=0;o--){let i=this.serializeMark(e.marks[o],e.isInline,n);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(e,n,r={}){let o=this.marks[e.type.name];return o&&Ba(yu(r),o(e,n),null,e.attrs)}static renderSpec(e,n,r=null,o){return Ba(e,n,r,o)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new cv(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=wg(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return wg(e.marks)}};function wg(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function yu(t){return t.document||window.document}const bg=new WeakMap;function XC(t){let e=bg.get(t);return e===void 0&&bg.set(t,e=YC(t)),e}function YC(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let o=0;o<r.length;o++)n(r[o]);else for(let o in r)n(r[o])}return n(t),e}function Ba(t,e,n,r){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 o=e[0],i;if(typeof o!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(i=XC(r))&&i.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=o.indexOf(" ");s>0&&(n=o.slice(0,s),o=o.slice(s+1));let a,l=n?t.createElementNS(n,o):t.createElement(o),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let d in c)if(c[d]!=null){let p=d.indexOf(" ");p>0?l.setAttributeNS(d.slice(0,p),d.slice(p+1),c[d]):l.setAttribute(d,c[d])}}for(let d=u;d<e.length;d++){let p=e[d];if(p===0){if(d<e.length-1||d>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:f,contentDOM:h}=Ba(t,p,n,r);if(l.appendChild(f),h){if(a)throw new RangeError("Multiple content holes");a=h}}}return{dom:l,contentDOM:a}}const uv=65535,dv=Math.pow(2,16);function ZC(t,e){return t+e*dv}function vg(t){return t&uv}function QC(t){return(t-(t&uv))/dv}const pv=1,fv=2,La=4,hv=8;let $d=class{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&hv)>0}get deletedBefore(){return(this.delInfo&(pv|La))>0}get deletedAfter(){return(this.delInfo&(fv|La))>0}get deletedAcross(){return(this.delInfo&La)>0}},mo=class Bo{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&Bo.empty)return Bo.empty}recover(e){let n=0,r=vg(e);if(!this.inverted)for(let o=0;o<r;o++)n+=this.ranges[o*3+2]-this.ranges[o*3+1];return this.ranges[r*3]+n+QC(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let o=0,i=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?o:0);if(l>e)break;let c=this.ranges[a+i],u=this.ranges[a+s],d=l+c;if(e<=d){let p=c?e==l?-1:e==d?1:n:n,f=l+o+(p<0?0:u);if(r)return f;let h=e==(n<0?l:d)?null:ZC(a/3,e-l),m=e==l?fv:e==d?pv:La;return(n<0?e!=l:e!=d)&&(m|=hv),new $d(f,m,h)}o+=u-c}return r?e+o:new $d(e+o,0,null)}touches(e,n){let r=0,o=vg(n),i=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?r:0);if(l>e)break;let c=this.ranges[a+i],u=l+c;if(e<=u&&a==o*3)return!0;r+=this.ranges[a+s]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let o=0,i=0;o<this.ranges.length;o+=3){let s=this.ranges[o],a=s-(this.inverted?i:0),l=s+(this.inverted?0:i),c=this.ranges[o+n],u=this.ranges[o+r];e(a,a+c,l,l+u),i+=u-c}}invert(){return new Bo(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Bo.empty:new Bo(e<0?[0,-e,0]:[0,0,e])}};mo.empty=new mo([]);let ni=class Od{constructor(e,n,r=0,o=e?e.length:0){this.mirror=n,this.from=r,this.to=o,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new Od(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,r=this._maps.length;n<e._maps.length;n++){let o=e.getMirror(n);this.appendMap(e._maps[n],o!=null&&o<n?r+o:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this._maps.length+e._maps.length;n>=0;n--){let o=e.getMirror(n);this.appendMap(e._maps[n].invert(),o!=null&&o>n?r-o-1:void 0)}}invert(){let e=new Od;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let o=0;for(let i=this.from;i<this.to;i++){let s=this._maps[i],a=s.mapResult(e,n);if(a.recover!=null){let l=this.getMirror(i);if(l!=null&&l>i&&l<this.to){i=l,e=this._maps[l].recover(a.recover);continue}}o|=a.delInfo,e=a.pos}return r?e:new $d(e,o,null)}};const wu=Object.create(null);let Rt=class{getMap(){return mo.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=wu[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in wu)throw new RangeError("Duplicate use of step JSON ID "+e);return wu[e]=n,n.prototype.jsonID=e,n}},jt=class Ii{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new Ii(e,null)}static fail(e){return new Ii(null,e)}static fromReplace(e,n,r,o){try{return Ii.ok(e.replace(n,r,o))}catch(i){if(i instanceof al)return Ii.fail(i.message);throw i}}};function rf(t,e,n){let r=[];for(let o=0;o<t.childCount;o++){let i=t.child(o);i.content.size&&(i=i.copy(rf(i.content,e,i))),i.isInline&&(i=e(i,n,o)),r.push(i)}return ye.fromArray(r)}let Vs=class Fi extends Rt{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),o=r.node(r.sharedDepth(this.to)),i=new ve(rf(n.content,(s,a)=>!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),o),n.openStart,n.openEnd);return jt.fromReplace(e,this.from,this.to,i)}invert(){return new vn(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Fi(n.pos,r.pos,this.mark)}merge(e){return e instanceof Fi&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Fi(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,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Fi(n.from,n.to,e.markFromJSON(n.mark))}};Rt.jsonID("addMark",Vs);let vn=class Ri extends Rt{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new ve(rf(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),e),n.openStart,n.openEnd);return jt.fromReplace(e,this.from,this.to,r)}invert(){return new Vs(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Ri(n.pos,r.pos,this.mark)}merge(e){return e instanceof Ri&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ri(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,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Ri(n.from,n.to,e.markFromJSON(n.mark))}};Rt.jsonID("removeMark",vn);let of=class Bi extends Rt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return jt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return jt.fromReplace(e,this.pos,this.pos+1,new ve(ye.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let o=0;o<n.marks.length;o++)if(!n.marks[o].isInSet(r))return new Bi(this.pos,n.marks[o]);return new Bi(this.pos,this.mark)}}return new ul(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Bi(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Bi(n.pos,e.markFromJSON(n.mark))}};Rt.jsonID("addNodeMark",of);let ul=class Md extends Rt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return jt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return jt.fromReplace(e,this.pos,this.pos+1,new ve(ye.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new of(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Md(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Md(n.pos,e.markFromJSON(n.mark))}};Rt.jsonID("removeNodeMark",ul);let Tt=class Hr extends Rt{constructor(e,n,r,o=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=o}apply(e){return this.structure&&Dd(e,this.from,this.to)?jt.fail("Structure replace would overwrite content"):jt.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new mo([this.from,this.to-this.from,this.slice.size])}invert(e){return new Hr(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new Hr(n.pos,Math.max(n.pos,r.pos),this.slice,this.structure)}merge(e){if(!(e instanceof Hr)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?ve.empty:new ve(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Hr(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?ve.empty:new ve(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Hr(e.from,this.to,n,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,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Hr(n.from,n.to,ve.fromJSON(e,n.slice),!!n.structure)}};Rt.jsonID("replace",Tt);let Zt=class Pa extends Rt{constructor(e,n,r,o,i,s,a=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=o,this.slice=i,this.insert=s,this.structure=a}apply(e){if(this.structure&&(Dd(e,this.from,this.gapFrom)||Dd(e,this.gapTo,this.to)))return jt.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return jt.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?jt.fromReplace(e,this.from,this.to,r):jt.fail("Content does not fit in gap")}getMap(){return new mo([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new Pa(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),o=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||o<n.pos||i>r.pos?null:new Pa(n.pos,r.pos,o,i,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,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Pa(n.from,n.to,n.gapFrom,n.gapTo,ve.fromJSON(e,n.slice),n.insert,!!n.structure)}};Rt.jsonID("replaceAround",Zt);function Dd(t,e,n){let r=t.resolve(e),o=n-e,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let s=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}}return!1}function eE(t,e,n,r){let o=[],i=[],s,a;t.doc.nodesBetween(e,n,(l,c,u)=>{if(!l.isInline)return;let d=l.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let p=Math.max(c,e),f=Math.min(c+l.nodeSize,n),h=r.addToSet(d);for(let m=0;m<d.length;m++)d[m].isInSet(h)||(s&&s.to==p&&s.mark.eq(d[m])?s.to=f:o.push(s=new vn(p,f,d[m])));a&&a.to==p?a.to=f:i.push(a=new Vs(p,f,r))}}),o.forEach(l=>t.step(l)),i.forEach(l=>t.step(l))}function tE(t,e,n,r){let o=[],i=0;t.doc.nodesBetween(e,n,(s,a)=>{if(!s.isInline)return;i++;let l=null;if(r instanceof ov){let c=s.marks,u;for(;u=r.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(s.marks)&&(l=[r]):l=s.marks;if(l&&l.length){let c=Math.min(a+s.nodeSize,n);for(let u=0;u<l.length;u++){let d=l[u],p;for(let f=0;f<o.length;f++){let h=o[f];h.step==i-1&&d.eq(o[f].style)&&(p=h)}p?(p.to=c,p.step=i):o.push({style:d,from:Math.max(a,e),to:c,step:i})}}}),o.forEach(s=>t.step(new vn(s.from,s.to,s.style)))}function sf(t,e,n,r=n.contentMatch,o=!0){let i=t.doc.nodeAt(e),s=[],a=e+1;for(let l=0;l<i.childCount;l++){let c=i.child(l),u=a+c.nodeSize,d=r.matchType(c.type);if(!d)s.push(new Tt(a,u,ve.empty));else{r=d;for(let p=0;p<c.marks.length;p++)n.allowsMarkType(c.marks[p].type)||t.step(new vn(a,u,c.marks[p]));if(o&&c.isText&&n.whitespace!="pre"){let p,f=/\r?\n|\r/g,h;for(;p=f.exec(c.text);)h||(h=new ve(ye.from(n.schema.text(" ",n.allowedMarks(c.marks))),0,0)),s.push(new Tt(a+p.index,a+p.index+p[0].length,h))}}a=u}if(!r.validEnd){let l=r.fillBefore(ye.empty,!0);t.replace(a,a,new ve(l,0,0))}for(let l=s.length-1;l>=0;l--)t.step(s[l])}function nE(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Us(t){let e=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth;;--n){let r=t.$from.node(n),o=t.$from.index(n),i=t.$to.indexAfter(n);if(n<t.depth&&r.canReplace(o,i,e))return n;if(n==0||r.type.spec.isolating||!nE(r,o,i))break}return null}function rE(t,e,n){let{$from:r,$to:o,depth:i}=e,s=r.before(i+1),a=o.after(i+1),l=s,c=a,u=ye.empty,d=0;for(let h=i,m=!1;h>n;h--)m||r.index(h)>0?(m=!0,u=ye.from(r.node(h).copy(u)),d++):l--;let p=ye.empty,f=0;for(let h=i,m=!1;h>n;h--)m||o.after(h+1)<o.end(h)?(m=!0,p=ye.from(o.node(h).copy(p)),f++):c++;t.step(new Zt(l,c,s,a,new ve(u.append(p),d,f),u.size-d,!0))}function mv(t,e,n=null,r=t){let o=oE(t,e),i=o&&iE(r,e);return i?o.map(xg).concat({type:e,attrs:n}).concat(i.map(xg)):null}function xg(t){return{type:t,attrs:null}}function oE(t,e){let{parent:n,startIndex:r,endIndex:o}=t,i=n.contentMatchAt(r).findWrapping(e);if(!i)return null;let s=i.length?i[0]:e;return n.canReplaceWith(r,o,s)?i:null}function iE(t,e){let{parent:n,startIndex:r,endIndex:o}=t,i=n.child(r),s=e.contentMatch.findWrapping(i.type);if(!s)return null;let a=(s.length?s[s.length-1]:e).contentMatch;for(let l=r;a&&l<o;l++)a=a.matchType(n.child(l).type);return!a||!a.validEnd?null:s}function sE(t,e,n){let r=ye.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let a=n[s].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=ye.from(n[s].type.create(n[s].attrs,r))}let o=e.start,i=e.end;t.step(new Zt(o,i,o,i,new ve(r,0,0),n.length,!0))}function aE(t,e,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=t.steps.length;t.doc.nodesBetween(e,n,(s,a)=>{let l=typeof o=="function"?o(s):o;if(s.isTextblock&&!s.hasMarkup(r,l)&&lE(t.doc,t.mapping.slice(i).map(a),r)){let c=null;if(r.schema.linebreakReplacement){let f=r.whitespace=="pre",h=!!r.contentMatch.matchType(r.schema.linebreakReplacement);f&&!h?c=!1:!f&&h&&(c=!0)}c===!1&&yv(t,s,a,i),sf(t,t.mapping.slice(i).map(a,1),r,void 0,c===null);let u=t.mapping.slice(i),d=u.map(a,1),p=u.map(a+s.nodeSize,1);return t.step(new Zt(d,p,d+1,p-1,new ve(ye.from(r.create(l,null,s.marks)),0,0),1,!0)),c===!0&&gv(t,s,a,i),!1}})}function gv(t,e,n,r){e.forEach((o,i)=>{if(o.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(o.text);){let l=t.mapping.slice(r).map(n+1+i+s.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function yv(t,e,n,r){e.forEach((o,i)=>{if(o.type==o.type.schema.linebreakReplacement){let s=t.mapping.slice(r).map(n+1+i);t.replaceWith(s,s+1,e.type.schema.text(`
30
+ `))}})}function lE(t,e,n){let r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}function cE(t,e,n,r,o){let i=t.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let s=n.create(r,null,o||i.marks);if(i.isLeaf)return t.replaceWith(e,e+i.nodeSize,s);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new Zt(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new ve(ye.from(s),0,0),1,!0))}function tr(t,e,n=1,r){let o=t.resolve(e),i=o.depth-n,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let c=o.depth-1,u=n-2;c>i;c--,u--){let d=o.node(c),p=o.index(c);if(d.type.spec.isolating)return!1;let f=d.content.cutByIndex(p,d.childCount),h=r&&r[u+1];h&&(f=f.replaceChild(0,h.type.create(h.attrs)));let m=r&&r[u]||d;if(!d.canReplace(p+1,d.childCount)||!m.type.validContent(f))return!1}let a=o.indexAfter(i),l=r&&r[0];return o.node(i).canReplaceWith(a,a,l?l.type:o.node(i+1).type)}function uE(t,e,n=1,r){let o=t.doc.resolve(e),i=ye.empty,s=ye.empty;for(let a=o.depth,l=o.depth-n,c=n-1;a>l;a--,c--){i=ye.from(o.node(a).copy(i));let u=r&&r[c];s=ye.from(u?u.type.create(u.attrs,s):o.node(a).copy(s))}t.step(new Tt(e,e,new ve(i.append(s),n,n),!0))}function Pr(t,e){let n=t.resolve(e),r=n.index();return wv(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function dE(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let o=0;o<e.childCount;o++){let i=e.child(o),s=i.type==r?t.type.schema.nodes.text:i.type;if(n=n.matchType(s),!n||!t.type.allowsMarks(i.marks))return!1}return n.validEnd}function wv(t,e){return!!(t&&e&&!t.isLeaf&&dE(t,e))}function bv(t,e,n=-1){let r=t.resolve(e);for(let o=r.depth;;o--){let i,s,a=r.index(o);if(o==r.depth?(i=r.nodeBefore,s=r.nodeAfter):n>0?(i=r.node(o+1),a++,s=r.node(o).maybeChild(a)):(i=r.node(o).maybeChild(a-1),s=r.node(o+1)),i&&!i.isTextblock&&wv(i,s)&&r.node(o).canReplace(a,a+1))return e;if(o==0)break;e=n<0?r.before(o):r.after(o)}}function pE(t,e,n){let r=null,{linebreakReplacement:o}=t.doc.type.schema,i=t.doc.resolve(e-n),s=i.node().type;if(o&&s.inlineContent){let u=s.whitespace=="pre",d=!!s.contentMatch.matchType(o);u&&!d?r=!1:!u&&d&&(r=!0)}let a=t.steps.length;if(r===!1){let u=t.doc.resolve(e+n);yv(t,u.node(),u.before(),a)}s.inlineContent&&sf(t,e+n-1,s,i.node().contentMatchAt(i.index()),r==null);let l=t.mapping.slice(a),c=l.map(e-n);if(t.step(new Tt(c,l.map(e+n,-1),ve.empty,!0)),r===!0){let u=t.doc.resolve(c);gv(t,u.node(),u.before(),t.steps.length)}return t}function fE(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let o=r.depth-1;o>=0;o--){let i=r.index(o);if(r.node(o).canReplaceWith(i,i,n))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(let o=r.depth-1;o>=0;o--){let i=r.indexAfter(o);if(r.node(o).canReplaceWith(i,i,n))return r.after(o+1);if(i<r.node(o).childCount)return null}return null}function vv(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let o=n.content;for(let i=0;i<n.openStart;i++)o=o.firstChild.content;for(let i=1;i<=(n.openStart==0&&n.size?2:1);i++)for(let s=r.depth;s>=0;s--){let a=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,l=r.index(s)+(a>0?1:0),c=r.node(s),u=!1;if(i==1)u=c.canReplace(l,l,o);else{let d=c.contentMatchAt(l).findWrapping(o.firstChild.type);u=d&&c.canReplaceWith(l,l,d[0])}if(u)return a==0?r.pos:a<0?r.before(s+1):r.after(s+1)}return null}function af(t,e,n=e,r=ve.empty){if(e==n&&!r.size)return null;let o=t.resolve(e),i=t.resolve(n);return xv(o,i,r)?new Tt(e,n,r):new hE(o,i,r).fit()}function xv(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}let hE=class{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=ye.empty;for(let o=0;o<=e.depth;o++){let i=e.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(e.indexAfter(o))})}for(let o=e.depth;o>0;o--)this.placed=ye.from(e.node(o).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(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(e<0?this.$to:r.doc.resolve(e));if(!o)return null;let i=this.placed,s=r.depth,a=o.depth;for(;s&&a&&i.childCount==1;)i=i.firstChild.content,s--,a--;let l=new ve(i,s,a);return e>-1?new Zt(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new Tt(r.pos,o.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,o=this.unplaced.openEnd;r<e;r++){let i=n.firstChild;if(n.childCount>1&&(o=0),i.type.spec.isolating&&o<=r){e=r;break}n=i.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let o,i=null;r?(i=bu(this.unplaced.content,r-1).firstChild,o=i.content):o=this.unplaced.content;let s=o.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:c}=this.frontier[a],u,d=null;if(n==1&&(s?c.matchType(s.type)||(d=c.fillBefore(ye.from(s),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:a,parent:i,inject:d};if(n==2&&s&&(u=c.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:i,wrap:u};if(i&&c.matchType(i.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=bu(e,n);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new ve(e,n+1,Math.max(r,o.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=bu(e,n);if(o.childCount<=1&&n>0){let i=e.size-n<=n+o.size;this.unplaced=new ve(Li(e,n-1,1),n-1,i?n-1:r)}else this.unplaced=new ve(Li(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:o,wrap:i}){for(;this.depth>n;)this.closeFrontierNode();if(i)for(let m=0;m<i.length;m++)this.openFrontierNode(i[m]);let s=this.unplaced,a=r?r.content:s.content,l=s.openStart-e,c=0,u=[],{match:d,type:p}=this.frontier[n];if(o){for(let m=0;m<o.childCount;m++)u.push(o.child(m));d=d.matchFragment(o)}let f=a.size+e-(s.content.size-s.openEnd);for(;c<a.childCount;){let m=a.child(c),y=d.matchType(m.type);if(!y)break;c++,(c>1||l==0||m.content.size)&&(d=y,u.push(kv(m.mark(p.allowedMarks(m.marks)),c==1?l:0,c==a.childCount?f:-1)))}let h=c==a.childCount;h||(f=-1),this.placed=Pi(this.placed,n,ye.from(u)),this.frontier[n].match=d,h&&f<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,y=a;m<f;m++){let g=y.lastChild;this.frontier.push({type:g.type,match:g.contentMatchAt(g.childCount)}),y=g.content}this.unplaced=h?e==0?ve.empty:new ve(Li(s.content,e-1,1),e-1,f<0?s.openEnd:e-1):new ve(Li(s.content,e,c),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!vu(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,o=this.$to.after(r);for(;r>1&&o==this.$to.end(--r);)++o;return o}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:o}=this.frontier[n],i=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),s=vu(e,n,o,r,i);if(s){for(let a=n-1;a>=0;a--){let{match:l,type:c}=this.frontier[a],u=vu(e,a,c,l,!0);if(!u||u.childCount)continue e}return{depth:n,fit:s,move:i?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Pi(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let o=e.node(r),i=o.type.contentMatch.fillBefore(o.content,!0,e.index(r));this.openFrontierNode(o.type,o.attrs,i)}return e}openFrontierNode(e,n=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(e),this.placed=Pi(this.placed,this.depth,ye.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(ye.empty,!0);e.childCount&&(this.placed=Pi(this.placed,this.frontier.length,e))}};function Li(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Li(t.firstChild.content,e-1,n)))}function Pi(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Pi(t.lastChild.content,e-1,n)))}function bu(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function kv(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,kv(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(ye.empty,!0)))),t.copy(r)}function vu(t,e,n,r,o){let i=t.node(e),s=o?t.indexAfter(e):t.index(e);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let a=r.fillBefore(i.content,!0,s);return a&&!mE(n,i.content,s)?a:null}function mE(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function gE(t){return t.spec.defining||t.spec.definingForContent}function yE(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let o=t.doc.resolve(e),i=t.doc.resolve(n);if(xv(o,i,r))return t.step(new Tt(e,n,r));let s=Av(o,t.doc.resolve(n));s[s.length-1]==0&&s.pop();let a=-(o.depth+1);s.unshift(a);for(let p=o.depth,f=o.pos-1;p>0;p--,f--){let h=o.node(p).type.spec;if(h.defining||h.definingAsContext||h.isolating)break;s.indexOf(p)>-1?a=p:o.before(p)==f&&s.splice(1,0,-p)}let l=s.indexOf(a),c=[],u=r.openStart;for(let p=r.content,f=0;;f++){let h=p.firstChild;if(c.push(h),f==r.openStart)break;p=h.content}for(let p=u-1;p>=0;p--){let f=c[p],h=gE(f.type);if(h&&!f.sameMarkup(o.node(Math.abs(a)-1)))u=p;else if(h||!f.type.isTextblock)break}for(let p=r.openStart;p>=0;p--){let f=(p+u+1)%(r.openStart+1),h=c[f];if(h)for(let m=0;m<s.length;m++){let y=s[(m+l)%s.length],g=!0;y<0&&(g=!1,y=-y);let v=o.node(y-1),k=o.index(y-1);if(v.canReplaceWith(k,k,h.type,h.marks))return t.replace(o.before(y),g?i.after(y):n,new ve(Sv(r.content,0,r.openStart,f),f,r.openEnd))}}let d=t.steps.length;for(let p=s.length-1;p>=0&&(t.replace(e,n,r),!(t.steps.length>d));p--){let f=s[p];f<0||(e=o.before(f),n=i.after(f))}}function Sv(t,e,n,r,o){if(e<n){let i=t.firstChild;t=t.replaceChild(0,i.copy(Sv(i.content,e+1,n,r,i)))}if(e>r){let i=o.contentMatchAt(0),s=i.fillBefore(t).append(t);t=s.append(i.matchFragment(s).fillBefore(ye.empty,!0))}return t}function wE(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let o=fE(t.doc,e,r.type);o!=null&&(e=n=o)}t.replaceRange(e,n,new ve(ye.from(r),0,0))}function bE(t,e,n){let r=t.doc.resolve(e),o=t.doc.resolve(n),i=Av(r,o);for(let s=0;s<i.length;s++){let a=i[s],l=s==i.length-1;if(l&&a==0||r.node(a).type.contentMatch.validEnd)return t.delete(r.start(a),o.end(a));if(a>0&&(l||r.node(a-1).canReplace(r.index(a-1),o.indexAfter(a-1))))return t.delete(r.before(a),o.after(a))}for(let s=1;s<=r.depth&&s<=o.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&o.end(s)-n!=o.depth-s&&r.start(s-1)==o.start(s-1)&&r.node(s-1).canReplace(r.index(s-1),o.index(s-1)))return t.delete(r.before(s),n);t.delete(e,n)}function Av(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let o=r;o>=0;o--){let i=t.start(o);if(i<t.pos-(t.depth-o)||e.end(o)>e.pos+(e.depth-o)||t.node(o).type.spec.isolating||e.node(o).type.spec.isolating)break;(i==e.start(o)||o==t.depth&&o==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&o&&e.start(o-1)==i-1)&&n.push(o)}return n}let Cv=class za extends Rt{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return jt.fail("No node at attribute step's position");let r=Object.create(null);for(let i in n.attrs)r[i]=n.attrs[i];r[this.attr]=this.value;let o=n.type.create(r,null,n.marks);return jt.fromReplace(e,this.pos,this.pos+1,new ve(ye.from(o),0,n.isLeaf?0:1))}getMap(){return mo.empty}invert(e){return new za(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new za(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new za(n.pos,n.attr,n.value)}};Rt.jsonID("attr",Cv);let Ev=class _d extends Rt{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let o in e.attrs)n[o]=e.attrs[o];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return jt.ok(r)}getMap(){return mo.empty}invert(e){return new _d(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new _d(n.attr,n.value)}};Rt.jsonID("docAttr",Ev);let ri=class extends Error{};ri=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};ri.prototype=Object.create(Error.prototype);ri.prototype.constructor=ri;ri.prototype.name="TransformError";let Tv=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new ni}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new ri(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=ve.empty){let o=af(this.doc,e,n,r);return o&&this.step(o),this}replaceWith(e,n,r){return this.replace(e,n,new ve(ye.from(r),0,0))}delete(e,n){return this.replace(e,n,ve.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return yE(this,e,n,r),this}replaceRangeWith(e,n,r){return wE(this,e,n,r),this}deleteRange(e,n){return bE(this,e,n),this}lift(e,n){return rE(this,e,n),this}join(e,n=1){return pE(this,e,n),this}wrap(e,n){return sE(this,e,n),this}setBlockType(e,n=e,r,o=null){return aE(this,e,n,r,o),this}setNodeMarkup(e,n,r=null,o){return cE(this,e,n,r,o),this}setNodeAttribute(e,n,r){return this.step(new Cv(e,n,r)),this}setDocAttribute(e,n){return this.step(new Ev(e,n)),this}addNodeMark(e,n){return this.step(new of(e,n)),this}removeNodeMark(e,n){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n instanceof Xe)n.isInSet(r.marks)&&this.step(new ul(e,n));else{let o=r.marks,i,s=[];for(;i=n.isInSet(o);)s.push(new ul(e,i)),o=i.removeFromSet(o);for(let a=s.length-1;a>=0;a--)this.step(s[a])}return this}split(e,n=1,r){return uE(this,e,n,r),this}addMark(e,n,r){return eE(this,e,n,r),this}removeMark(e,n,r){return tE(this,e,n,r),this}clearIncompatible(e,n,r){return sf(this,e,n,r),this}};const xu=Object.create(null);let je=class{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new $v(e.min(n),e.max(n))]}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 n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=ve.empty){let r=n.content.lastChild,o=null;for(let a=0;a<n.openEnd;a++)o=r,r=r.lastChild;let i=e.steps.length,s=this.ranges;for(let a=0;a<s.length;a++){let{$from:l,$to:c}=s[a],u=e.mapping.slice(i);e.replaceRange(u.map(l.pos),u.map(c.pos),a?ve.empty:n),a==0&&Ag(e,i,(r?r.isInline:o&&o.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,o=this.ranges;for(let i=0;i<o.length;i++){let{$from:s,$to:a}=o[i],l=e.mapping.slice(r),c=l.map(s.pos),u=l.map(a.pos);i?e.deleteRange(c,u):(e.replaceRangeWith(c,u,n),Ag(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let o=e.parent.inlineContent?new Pe(e):Lo(e.node(0),e.parent,e.pos,e.index(),n,r);if(o)return o;for(let i=e.depth-1;i>=0;i--){let s=n<0?Lo(e.node(0),e.node(i),e.before(i+1),e.index(i),n,r):Lo(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,n,r);if(s)return s}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new Nn(e.node(0))}static atStart(e){return Lo(e,e,0,0,1)||new Nn(e)}static atEnd(e){return Lo(e,e,e.content.size,e.childCount,-1)||new Nn(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=xu[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in xu)throw new RangeError("Duplicate use of selection JSON ID "+e);return xu[e]=n,n.prototype.jsonID=e,n}getBookmark(){return Pe.between(this.$anchor,this.$head).getBookmark()}};je.prototype.visible=!0;let $v=class{constructor(e,n){this.$from=e,this.$to=n}},kg=!1;function Sg(t){!kg&&!t.parent.inlineContent&&(kg=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}let Pe=class zi extends je{constructor(e,n=e){Sg(e),Sg(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return je.near(r);let o=e.resolve(n.map(this.anchor));return new zi(o.parent.inlineContent?o:r,r)}replace(e,n=ve.empty){if(super.replace(e,n),n==ve.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof zi&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Ov(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new zi(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let o=e.resolve(n);return new this(o,r==n?o:e.resolve(r))}static between(e,n,r){let o=e.pos-n.pos;if((!r||o)&&(r=o>=0?1:-1),!n.parent.inlineContent){let i=je.findFrom(n,r,!0)||je.findFrom(n,-r,!0);if(i)n=i.$head;else return je.near(n,r)}return e.parent.inlineContent||(o==0?e=n:(e=(je.findFrom(e,-r,!0)||je.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=o<0&&(e=n))),new zi(e,n)}};je.jsonID("text",Pe);let Ov=class Mv{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Mv(e.map(this.anchor),e.map(this.head))}resolve(e){return Pe.between(e.resolve(this.anchor),e.resolve(this.head))}},_e=class ji extends je{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:o}=n.mapResult(this.anchor),i=e.resolve(o);return r?je.near(i):new ji(i)}content(){return new ve(ye.from(this.node),0,0)}eq(e){return e instanceof ji&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new vE(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new ji(e.resolve(n.anchor))}static create(e,n){return new ji(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}};_e.prototype.visible=!1;je.jsonID("node",_e);let vE=class Dv{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new Ov(r,r):new Dv(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&_e.isSelectable(r)?new _e(n):je.near(n)}},Nn=class ja extends je{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=ve.empty){if(n==ve.empty){e.delete(0,e.doc.content.size);let r=je.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new ja(e)}map(e){return new ja(e)}eq(e){return e instanceof ja}getBookmark(){return xE}};je.jsonID("all",Nn);const xE={map(){return this},resolve(t){return new Nn(t)}};function Lo(t,e,n,r,o,i=!1){if(e.inlineContent)return Pe.create(t,n);for(let s=r-(o>0?0:1);o>0?s<e.childCount:s>=0;s+=o){let a=e.child(s);if(a.isAtom){if(!i&&_e.isSelectable(a))return _e.create(t,n-(o<0?a.nodeSize:0))}else{let l=Lo(t,a,n+o,o<0?a.childCount:0,o,i);if(l)return l}n+=a.nodeSize*o}return null}function Ag(t,e,n){let r=t.steps.length-1;if(r<e)return;let o=t.steps[r];if(!(o instanceof Tt||o instanceof Zt))return;let i=t.mapping.maps[r],s;i.forEach((a,l,c,u)=>{s==null&&(s=u)}),t.setSelection(je.near(t.doc.resolve(s),n))}const Cg=1,Eg=2,Tg=4;let kE=class extends Tv{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|Cg)&-3,this.storedMarks=null,this}get selectionSet(){return(this.updated&Cg)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Eg,this}ensureMarks(e){return Xe.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&Eg)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&-3,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||Xe.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let o=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(o.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let i=this.storedMarks;if(!i){let s=this.doc.resolve(n);i=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,o.text(e,i)),this.selection.empty||this.setSelection(je.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,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|=Tg,this}get scrolledIntoView(){return(this.updated&Tg)>0}};function $g(t,e){return!e||!t?t:t.bind(e)}let qi=class{constructor(e,n,r){this.name=e,this.init=$g(n.init,r),this.apply=$g(n.apply,r)}};const SE=[new qi("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new qi("selection",{init(t,e){return t.selection||je.atStart(e.doc)},apply(t){return t.selection}}),new qi("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new qi("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];let ku=class{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=SE.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new qi(r.key,r.spec.state,r))})}},Zi=class Vi{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,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let o=this.config.plugins[r];if(o.spec.filterTransaction&&!o.spec.filterTransaction.call(o,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),o=null;for(;;){let i=!1;for(let s=0;s<this.config.plugins.length;s++){let a=this.config.plugins[s];if(a.spec.appendTransaction){let l=o?o[s].n:0,c=o?o[s].state:this,u=l<n.length&&a.spec.appendTransaction.call(a,l?n.slice(l):n,c,r);if(u&&r.filterTransaction(u,s)){if(u.setMeta("appendedTransaction",e),!o){o=[];for(let d=0;d<this.config.plugins.length;d++)o.push(d<s?{state:r,n:n.length}:{state:this,n:0})}n.push(u),r=r.applyInner(u),i=!0}o&&(o[s]={state:r,n:n.length})}}if(!i)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new Vi(this.config),r=this.config.fields;for(let o=0;o<r.length;o++){let i=r[o];n[i.name]=i.apply(e,this[i.name],this,n)}return n}get tr(){return new kE(this)}static create(e){let n=new ku(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new Vi(n);for(let o=0;o<n.fields.length;o++)r[n.fields[o].name]=n.fields[o].init(e,r);return r}reconfigure(e){let n=new ku(this.schema,e.plugins),r=n.fields,o=new Vi(n);for(let i=0;i<r.length;i++){let s=r[i].name;o[s]=this.hasOwnProperty(s)?this[s]:r[i].init(e,o)}return o}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=e[r],i=o.spec.state;i&&i.toJSON&&(n[r]=i.toJSON.call(o,this[o.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let o=new ku(e.schema,e.plugins),i=new Vi(o);return o.fields.forEach(s=>{if(s.name=="doc")i.doc=so.fromJSON(e.schema,n.doc);else if(s.name=="selection")i.selection=je.fromJSON(i.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(i.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],c=l.spec.state;if(l.key==s.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){i[s.name]=c.fromJSON.call(l,e,n[a],i);return}}i[s.name]=s.init(e,i)}}),i}};function _v(t,e,n){for(let r in t){let o=t[r];o instanceof Function?o=o.bind(e):r=="handleDOMEvents"&&(o=_v(o,e,{})),n[r]=o}return n}let Ue=class{constructor(e){this.spec=e,this.props={},e.props&&_v(e.props,this,this.props),this.key=e.key?e.key.key:Nv("plugin")}getState(e){return e[this.key]}};const Su=Object.create(null);function Nv(t){return t in Su?t+"$"+ ++Su[t]:(Su[t]=0,t+"$")}let Ge=class{constructor(e="key"){this.key=Nv(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}};const dl=t=>t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`),AE=t=>dl(t),qa=Object.freeze({RESOLVED:"resolved",NEW:"new",ADD:"add",UPDATE:"update",DELETED:"deleted",PENDING:"pending",SELECTED:"selected",COMMENTS_LIST:"comments-list",CHANGE_ACCEPTED:"change-accepted",CHANGE_REJECTED:"change-rejected"}),CE={mounted(t,e,n){const r=o=>{t.contains(o.target)||e.value(o)};document.addEventListener("click",r),t.__clickOutsideHandler=r},unmounted(t){document.removeEventListener("click",t.__clickOutsideHandler),delete t.__clickOutsideHandler}};function Ke(t,e=null,...n){return typeof t=="function"?e?t.bind(e)(...n):t(...n):t}function EE(t={}){return Object.keys(t).length===0&&t.constructor===Object}const TE=()=>typeof navigator<"u"?/Mac/.test(navigator.platform):!1,$E=()=>["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform),Iv=t=>Object.prototype.toString.call(t)==="[object RegExp]";function oi(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(o=>n.strict?e[o]===t[o]:Iv(e[o])?e[o].test(t[o]):e[o]===t[o]):!0}function Og(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,o)=>(n.includes(o)||(r[o]=t[o]),r),{})}const OE=/[\d-.]+(\w+)$/,ME=["px","rem","em","in","q","mm","cm","pt","pc","vh","vw","vmin","vmax"];function nr(t="0"){const e=t.toString()||"0",n=Number.parseFloat(e),r=(e.match(OE)?.[1]??"").toLowerCase();return[n,ME.includes(r)?r:null]}function pl(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function ii(t){if(t!=null)return typeof t=="string"&&(t=parseFloat(t)),Math.round(t*1440)}function Wt(t){if(t!=null)return typeof t=="string"&&(t=parseInt(t,10)),Math.round(t/1440*100)/100}function nt(t){if(t!=null)return t=Wt(t),Math.round(t*96)}function at(t){if(t!=null)return t=t/96,ii(t)}function Jo(t){if(t!=null)return t/240}function Nd(t){if(t!=null)return t*240}function DE(t){if(t!=null)return Math.round(t/2)}function Gt(t){if(t==null)return;typeof t=="string"&&(t=parseFloat(t));const e=t*96/914400;return Math.round(e)}function Vr(t){if(t!=null)return typeof t=="string"&&(t=parseFloat(t)),Math.round(t*9525)}function Fv(t){return t==null?void 0:parseFloat(t)/8*1.3333}function Rv(t){if(t!=null)return Math.round(t*6)}function Bv(t){if(t!=null)return t/20}function _E(t){if(t!=null)return t*20}const NE=async(t,e)=>{const n=/^https?:|^blob:|^file:|^data:/i.test(t);if(e&&n&&typeof fetch=="function"){const i=await fetch(t);if(!i.ok)throw new Error(`Fetch failed: ${i.status} ${i.statusText}`);return await i.arrayBuffer()}const r=t.includes(",")?t.split(",",2)[1]:t.trim().replace(/\s/g,"");try{if(typeof globalThis.atob=="function"){const i=globalThis.atob(r),s=new Uint8Array(i.length);for(let a=0;a<i.length;a++)s[a]=i.charCodeAt(a);return s.buffer}}catch(i){console.warn("atob failed, falling back to Buffer:",i)}const o=mt.from(r,"base64");return o.buffer.slice(o.byteOffset,o.byteOffset+o.byteLength)},IE=t=>{const e=new window.DOMParser().parseFromString(t,"text/xml").querySelectorAll("Default");return Array.from(e).map(n=>n.getAttribute("Extension"))},FE=t=>new Map([["yellow","#ffff00"],["green","#00ff00"],["blue","#0000FFFF"],["cyan","#00ffff"],["magenta","#ff00ff"],["red","#ff0000"],["darkYellow","#808000FF"],["darkGreen","#008000FF"],["darkBlue","#000080"],["darkCyan","#008080FF"],["darkMagenta","#800080FF"],["darkGray","#808080FF"],["darkRed","#800000FF"],["lightGray","#C0C0C0FF"],["black","#000"]]).get(t)||null;function RE(t){if(!t||typeof t!="string")return!1;switch(t.length){case 3:return/^[0-9A-F]{3}$/i.test(t);case 6:return/^[0-9A-F]{6}$/i.test(t);case 8:return/^[0-9A-F]{8}$/i.test(t);default:return!1}}const BE=t=>{const e=Number(t).toString(16);return e.length===1?"0"+e:e},LE=t=>"#"+t.match(/\d+/g).map(BE).join(""),Zl=(t,e,n="",r=!1)=>{let[o,i]=nr(t);return Number.isNaN(o)||o===0?{}:n==="atLeast"&&o<1?{}:(i=i||e,o+=i?4:.2,r?{"line-height":`${o}${i}`}:`line-height: ${o}${i}`)},PE=(t,e)=>{const n=new Uint8Array(t),r=e.replace(/[-{}]/g,"");if(r.length!==32){console.error("Invalid GUID");return}const o=new Uint8Array(16);for(let i=0,s=0;i<32;i+=2,s++){const a=r[i]+r[i+1];o[s]=parseInt(a,16)}for(let i=0;i<32;i++){const s=15-i%16;n[i]^=o[s]}return n.buffer},Id=(t,e)=>t.className?.split(" ")?.indexOf(e)>=0?!0:t.parentNode&&Id(t.parentNode,e);function Yn(t=8){const e="0123456789abcdef";let n=[];for(let r=0;r<t;r++){const o=Math.floor(Math.random()*e.length);n.push(e[o])}return n.join("")}function lf(){return Math.floor(Math.random()*2147483647).toString(16).toUpperCase().padStart(8,"0")}const zE={"xmlns:wpc":"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas","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:oel":"http://schemas.microsoft.com/office/2019/extlst","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:w16du":"http://schemas.microsoft.com/office/word/2023/wordml/word16du","xmlns:w16sdtdh":"http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash","xmlns:w16sdtfl":"http://schemas.microsoft.com/office/word/2024/wordml/sdtformatlock","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","mc:Ignorable":"w14 w15 w16se w16cid w16 w16cex w16sdtdh w16sdtfl w16du wp14"},jE={elements:[{type:"element",name:"Properties",attributes:{xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/custom-properties","xmlns:vt":"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"},elements:[]}]},qE={elements:[{type:"element",name:"w:settings",attributes:{"xmlns:w":"http://schemas.openxmlformats.org/wordprocessingml/2006/main"},elements:[]}]},VE={type:"element",name:"w:r",elements:[{type:"element",name:"w:rPr",elements:[{type:"element",name:"w:rStyle",attributes:{"w:val":"CommentReference"}}]},{type:"element",name:"w:annotationRef"}]},Mg={Normal:{type:"element",name:"w:style",attributes:{"w:type":"paragraph","w:default":"1","w:styleId":"Normal"},elements:[{type:"element",name:"w:name",attributes:{"w:val":"Normal"}},{type:"element",name:"w:qFormat"}]},Title:{type:"element",name:"w:style",attributes:{"w:type":"paragraph","w:styleId":"Title"},elements:[{type:"element",name:"w:name",attributes:{"w:val":"Title"}},{type:"element",name:"w:basedOn",attributes:{"w:val":"Normal"}},{type:"element",name:"w:next",attributes:{"w:val":"Normal"}},{type:"element",name:"w:link",attributes:{"w:val":"TitleChar"}},{type:"element",name:"w:uiPriority",attributes:{"w:val":"10"}},{type:"element",name:"w:qFormat"},{type:"element",name:"w:rsid",attributes:{"w:val":"00B72667"}},{type:"element",name:"w:pPr",elements:[{type:"element",name:"w:spacing",attributes:{"w:after":"80"}},{type:"element",name:"w:contextualSpacing"}]},{type:"element",name:"w:rPr",elements:[{type:"element",name:"w:rFonts",attributes:{"w:asciiTheme":"majorHAnsi","w:eastAsiaTheme":"majorEastAsia","w:hAnsiTheme":"majorHAnsi","w:cstheme":"majorBidi"}},{type:"element",name:"w:spacing",attributes:{"w:val":"-10"}},{type:"element",name:"w:kern",attributes:{"w:val":"28"}},{type:"element",name:"w:sz",attributes:{"w:val":"56"}},{type:"element",name:"w:szCs",attributes:{"w:val":"56"}}]}]},Subtitle:{type:"element",name:"w:style",attributes:{"w:type":"paragraph","w:styleId":"Subtitle"},elements:[{type:"element",name:"w:name",attributes:{"w:val":"Subtitle"}},{type:"element",name:"w:basedOn",attributes:{"w:val":"Normal"}},{type:"element",name:"w:next",attributes:{"w:val":"Normal"}},{type:"element",name:"w:link",attributes:{"w:val":"SubtitleChar"}},{type:"element",name:"w:uiPriority",attributes:{"w:val":"11"}},{type:"element",name:"w:qFormat"},{type:"element",name:"w:rsid",attributes:{"w:val":"00B72667"}},{type:"element",name:"w:pPr",elements:[{type:"element",name:"w:numPr",elements:[{type:"element",name:"w:ilvl",attributes:{"w:val":"1"}}]},{type:"element",name:"w:spacing",attributes:{"w:after":"160"}}]},{type:"element",name:"w:rPr",elements:[{type:"element",name:"w:rFonts",attributes:{"w:asciiTheme":"minorHAnsi","w:eastAsiaTheme":"majorEastAsia","w:hAnsiTheme":"minorHAnsi","w:cstheme":"majorBidi"}},{type:"element",name:"w:color",attributes:{"w:val":"595959","w:themeColor":"text1","w:themeTint":"A6"}},{type:"element",name:"w:spacing",attributes:{"w:val":"15"}},{type:"element",name:"w:sz",attributes:{"w:val":"28"}},{type:"element",name:"w:szCs",attributes:{"w:val":"28"}}]}]},Heading1:{type:"element",name:"w:style",attributes:{"w:type":"paragraph","w:styleId":"Heading1"},elements:[{type:"element",name:"w:name",attributes:{"w:val":"heading 1"}},{type:"element",name:"w:basedOn",attributes:{"w:val":"Normal"}},{type:"element",name:"w:next",attributes:{"w:val":"Normal"}},{type:"element",name:"w:link",attributes:{"w:val":"Heading1Char"}},{type:"element",name:"w:uiPriority",attributes:{"w:val":"9"}},{type:"element",name:"w:qFormat"},{type:"element",name:"w:rsid",attributes:{"w:val":"00233D7B"}},{type:"element",name:"w:pPr",elements:[{type:"element",name:"w:keepNext"},{type:"element",name:"w:keepLines"},{type:"element",name:"w:spacing",attributes:{"w:before":"360","w:after":"80"}},{type:"element",name:"w:outlineLvl",attributes:{"w:val":"0"}}]},{type:"element",name:"w:rPr",elements:[{type:"element",name:"w:rFonts",attributes:{"w:asciiTheme":"majorHAnsi","w:eastAsiaTheme":"majorEastAsia","w:hAnsiTheme":"majorHAnsi","w:cstheme":"majorBidi"}},{type:"element",name:"w:color",attributes:{"w:val":"0F4761","w:themeColor":"accent1","w:themeShade":"BF"}},{type:"element",name:"w:sz",attributes:{"w:val":"40"}},{type:"element",name:"w:szCs",attributes:{"w:val":"40"}}]}]},Heading2:{type:"element",name:"w:style",attributes:{"w:type":"paragraph","w:styleId":"Heading2"},elements:[{type:"element",name:"w:name",attributes:{"w:val":"heading 2"}},{type:"element",name:"w:basedOn",attributes:{"w:val":"Normal"}},{type:"element",name:"w:next",attributes:{"w:val":"Normal"}},{type:"element",name:"w:link",attributes:{"w:val":"Heading2Char"}},{type:"element",name:"w:uiPriority",attributes:{"w:val":"9"}},{type:"element",name:"w:semiHidden"},{type:"element",name:"w:unhideWhenUsed"},{type:"element",name:"w:qFormat"},{type:"element",name:"w:rsid",attributes:{"w:val":"00233D7B"}},{type:"element",name:"w:pPr",elements:[{type:"element",name:"w:keepNext"},{type:"element",name:"w:keepLines"},{type:"element",name:"w:spacing",attributes:{"w:before":"160","w:after":"80"}},{type:"element",name:"w:outlineLvl",attributes:{"w:val":"1"}}]},{type:"element",name:"w:rPr",elements:[{type:"element",name:"w:rFonts",attributes:{"w:asciiTheme":"majorHAnsi","w:eastAsiaTheme":"majorEastAsia","w:hAnsiTheme":"majorHAnsi","w:cstheme":"majorBidi"}},{type:"element",name:"w:color",attributes:{"w:val":"0F4761","w:themeColor":"accent1","w:themeShade":"BF"}},{type:"element",name:"w:sz",attributes:{"w:val":"32"}},{type:"element",name:"w:szCs",attributes:{"w:val":"32"}}]}]},Heading3:{type:"element",name:"w:style",attributes:{"w:type":"paragraph","w:styleId":"Heading3"},elements:[{type:"element",name:"w:name",attributes:{"w:val":"heading 3"}},{type:"element",name:"w:basedOn",attributes:{"w:val":"Normal"}},{type:"element",name:"w:next",attributes:{"w:val":"Normal"}},{type:"element",name:"w:link",attributes:{"w:val":"Heading3Char"}},{type:"element",name:"w:uiPriority",attributes:{"w:val":"9"}},{type:"element",name:"w:semiHidden"},{type:"element",name:"w:unhideWhenUsed"},{type:"element",name:"w:qFormat"},{type:"element",name:"w:rsid",attributes:{"w:val":"00233D7B"}},{type:"element",name:"w:pPr",elements:[{type:"element",name:"w:keepNext"},{type:"element",name:"w:keepLines"},{type:"element",name:"w:spacing",attributes:{"w:before":"160","w:after":"80"}},{type:"element",name:"w:outlineLvl",attributes:{"w:val":"2"}}]},{type:"element",name:"w:rPr",elements:[{type:"element",name:"w:rFonts",attributes:{"w:eastAsiaTheme":"majorEastAsia","w:cstheme":"majorBidi"}},{type:"element",name:"w:color",attributes:{"w:val":"0F4761","w:themeColor":"accent1","w:themeShade":"BF"}},{type:"element",name:"w:sz",attributes:{"w:val":"28"}},{type:"element",name:"w:szCs",attributes:{"w:val":"28"}}]}]}},UE={declaration:{attributes:{version:"1.0",encoding:"UTF-8",standalone:"yes"}},elements:[{type:"element",name:"w:comments",attributes:{"xmlns:wpc":"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas","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:oel":"http://schemas.microsoft.com/office/2019/extlst","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:w16du":"http://schemas.microsoft.com/office/word/2023/wordml/word16du","xmlns:w16sdtdh":"http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash","xmlns:w16sdtfl":"http://schemas.microsoft.com/office/word/2024/wordml/sdtformatlock","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","mc:Ignorable":"w14 w15 w16se w16cid w16 w16cex w16sdtdh w16sdtfl w16du wp14"},elements:[]}]},HE={declaration:{attributes:{version:"1.0",encoding:"UTF-8",standalone:"yes"}},elements:[{type:"element",name:"w15:commentsEx",attributes:{"xmlns:wpc":"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas","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:oel":"http://schemas.microsoft.com/office/2019/extlst","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:w16du":"http://schemas.microsoft.com/office/word/2023/wordml/word16du","xmlns:w16sdtdh":"http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash","xmlns:w16sdtfl":"http://schemas.microsoft.com/office/word/2024/wordml/sdtformatlock","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","mc:Ignorable":"w14 w15 w16se w16cid w16 w16cex w16sdtdh w16sdtfl w16du wp14"},elements:[]}]},WE={declaration:{attributes:{version:"1.0",encoding:"UTF-8",standalone:"yes"}},elements:[{type:"element",name:"w16cex:commentsExtensible",attributes:{"xmlns:wpc":"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas","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:cr":"http://schemas.microsoft.com/office/comments/2020/reactions","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:oel":"http://schemas.microsoft.com/office/2019/extlst","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:w16du":"http://schemas.microsoft.com/office/word/2023/wordml/word16du","xmlns:w16sdtdh":"http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash","xmlns:w16sdtfl":"http://schemas.microsoft.com/office/word/2024/wordml/sdtformatlock","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","mc:Ignorable":"w14 w15 w16se w16cid w16 w16cex w16sdtdh w16sdtfl cr w16du wp14"},elements:[]}]},GE={declaration:{attributes:{version:"1.0",encoding:"UTF-8",standalone:"yes"}},elements:[{type:"element",name:"w16cid:commentsIds",attributes:{"xmlns:wpc":"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas","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:oel":"http://schemas.microsoft.com/office/2019/extlst","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:w16du":"http://schemas.microsoft.com/office/word/2023/wordml/word16du","xmlns:w16sdtdh":"http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash","xmlns:w16sdtfl":"http://schemas.microsoft.com/office/word/2024/wordml/sdtformatlock","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","mc:Ignorable":"w14 w15 w16se w16cid w16 w16cex w16sdtdh w16sdtfl w16du wp14"},elements:[]}]},KE={elements:[{type:"element",name:"Relationships",attributes:{xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"},elements:[{type:"element",name:"Relationship",attributes:{Id:"rId8",Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable",Target:"fontTable.xml"}},{type:"element",name:"Relationship",attributes:{Id:"rId3",Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings",Target:"webSettings.xml"}},{type:"element",name:"Relationship",attributes:{Id:"rId7",Type:"http://schemas.microsoft.com/office/2018/08/relationships/commentsExtensible",Target:"commentsExtensible.xml"}},{type:"element",name:"Relationship",attributes:{Id:"rId2",Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings",Target:"settings.xml"}},{type:"element",name:"Relationship",attributes:{Id:"rId1",Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",Target:"styles.xml"}},{type:"element",name:"Relationship",attributes:{Id:"rId6",Type:"http://schemas.microsoft.com/office/2016/09/relationships/commentsIds",Target:"commentsIds.xml"}},{type:"element",name:"Relationship",attributes:{Id:"rId5",Type:"http://schemas.microsoft.com/office/2011/relationships/commentsExtended",Target:"commentsExtended.xml"}},{type:"element",name:"Relationship",attributes:{Id:"rId10",Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",Target:"theme/theme1.xml"}},{type:"element",name:"Relationship",attributes:{Id:"rId4",Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",Target:"comments.xml"}}]}]},JE={declaration:{attributes:{version:"1.0",encoding:"UTF-8",standalone:"yes"}},elements:[{type:"element",name:"Types",attributes:{xmlns:"http://schemas.openxmlformats.org/package/2006/content-types"},elements:[{type:"element",name:"Default",attributes:{Extension:"rels",ContentType:"application/vnd.openxmlformats-package.relationships+xml"}},{type:"element",name:"Default",attributes:{Extension:"xml",ContentType:"application/xml"}},{type:"element",name:"Override",attributes:{PartName:"/word/document.xml",ContentType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"}},{type:"element",name:"Override",attributes:{PartName:"/word/styles.xml",ContentType:"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml"}},{type:"element",name:"Override",attributes:{PartName:"/word/settings.xml",ContentType:"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml"}},{type:"element",name:"Override",attributes:{PartName:"/word/webSettings.xml",ContentType:"application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml"}},{type:"element",name:"Override",attributes:{PartName:"/word/comments.xml",ContentType:"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml"}},{type:"element",name:"Override",attributes:{PartName:"/word/commentsExtended.xml",ContentType:"application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtended+xml"}},{type:"element",name:"Override",attributes:{PartName:"/word/commentsIds.xml",ContentType:"application/vnd.openxmlformats-officedocument.wordprocessingml.commentsIds+xml"}},{type:"element",name:"Override",attributes:{PartName:"/word/commentsExtensible.xml",ContentType:"application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtensible+xml"}},{type:"element",name:"Override",attributes:{PartName:"/word/fontTable.xml",ContentType:"application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml"}},{type:"element",name:"Override",attributes:{PartName:"/word/people.xml",ContentType:"application/vnd.openxmlformats-officedocument.wordprocessingml.people+xml"}},{type:"element",name:"Override",attributes:{PartName:"/word/theme/theme1.xml",ContentType:"application/vnd.openxmlformats-officedocument.theme+xml"}},{type:"element",name:"Override",attributes:{PartName:"/docProps/core.xml",ContentType:"application/vnd.openxmlformats-package.core-properties+xml"}},{type:"element",name:"Override",attributes:{PartName:"/docProps/app.xml",ContentType:"application/vnd.openxmlformats-officedocument.extended-properties+xml"}},{type:"element",name:"Override",attributes:{PartName:"/word/numbering.xml",ContentType:"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml"}}]}]},Po={COMMENTS_XML_DEF:UE,COMMENTS_EXTENDED_XML_DEF:HE,COMMENTS_EXTENSIBLE_XML_DEF:WE,COMMENTS_IDS_XML_DEF:GE,DOCUMENT_RELS_XML_DEF:KE,CONTENT_TYPES:JE},It="trackInsert",ut="trackDelete",vt="trackFormat",Qt=t=>{if(t)try{return JSON.parse(JSON.stringify(t))}catch(e){console.error("Error in carbonCopy",t,e);return}},XE={attributes:{"w:abstractNumId":"1"}},YE={attributes:{"w:abstractNumId":"0"}},Lv={declaration:{attributes:{version:"1.0",encoding:"UTF-8",standalone:"yes"}},elements:[{type:"element",name:"w:numbering",attributes:{"xmlns:wpc":"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas","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:oel":"http://schemas.microsoft.com/office/2019/extlst","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:w16du":"http://schemas.microsoft.com/office/word/2023/wordml/word16du","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","mc:Ignorable":"w14 w15 w16se w16cid w16 w16cex w16sdtdh w16du wp14"},elements:[{type:"element",name:"w:abstractNum",attributes:{"w:abstractNumId":"0","w15:restartNumberingAfterBreak":"0"},elements:[{type:"element",name:"w:nsid",attributes:{"w:val":"16126B07"}},{type:"element",name:"w:multiLevelType",attributes:{"w:val":"hybridMultilevel"}},{type:"element",name:"w:tmpl",attributes:{"w:val":"51EC4E08"}},{type:"element",name:"w:lvl",attributes:{"w:ilvl":"0","w:tplc":"04090001"},elements:[{type:"element",name:"w:start",attributes:{"w:val":"1"}},{type:"element",name:"w:numFmt",attributes:{"w:val":"bullet"}},{type:"element",name:"w:lvlText",attributes:{"w:val":""}},{type:"element",name:"w:lvlJc",attributes:{"w:val":"left"}},{type:"element",name:"w:pPr",elements:[{type:"element",name:"w:ind",attributes:{"w:left":"720","w:hanging":"360"}}]},{type:"element",name:"w:rPr",elements:[{type:"element",name:"w:rFonts",attributes:{"w:ascii":"Symbol","w:hAnsi":"Symbol","w:hint":"default"}}]}]},{type:"element",name:"w:lvl",attributes:{"w:ilvl":"1","w:tplc":"04090003","w:tentative":"1"},elements:[{type:"element",name:"w:start",attributes:{"w:val":"1"}},{type:"element",name:"w:numFmt",attributes:{"w:val":"bullet"}},{type:"element",name:"w:lvlText",attributes:{"w:val":"o"}},{type:"element",name:"w:lvlJc",attributes:{"w:val":"left"}},{type:"element",name:"w:pPr",elements:[{type:"element",name:"w:ind",attributes:{"w:left":"1440","w:hanging":"360"}}]},{type:"element",name:"w:rPr",elements:[{type:"element",name:"w:rFonts",attributes:{"w:ascii":"Courier New","w:hAnsi":"Courier New","w:cs":"Courier New","w:hint":"default"}}]}]},{type:"element",name:"w:lvl",attributes:{"w:ilvl":"2","w:tplc":"04090005","w:tentative":"1"},elements:[{type:"element",name:"w:start",attributes:{"w:val":"1"}},{type:"element",name:"w:numFmt",attributes:{"w:val":"bullet"}},{type:"element",name:"w:lvlText",attributes:{"w:val":""}},{type:"element",name:"w:lvlJc",attributes:{"w:val":"left"}},{type:"element",name:"w:pPr",elements:[{type:"element",name:"w:ind",attributes:{"w:left":"2160","w:hanging":"360"}}]},{type:"element",name:"w:rPr",elements:[{type:"element",name:"w:rFonts",attributes:{"w:ascii":"Wingdings","w:hAnsi":"Wingdings","w:hint":"default"}}]}]},{type:"element",name:"w:lvl",attributes:{"w:ilvl":"3","w:tplc":"04090001","w:tentative":"1"},elements:[{type:"element",name:"w:start",attributes:{"w:val":"1"}},{type:"element",name:"w:numFmt",attributes:{"w:val":"bullet"}},{type:"element",name:"w:lvlText",attributes:{"w:val":""}},{type:"element",name:"w:lvlJc",attributes:{"w:val":"left"}},{type:"element",name:"w:pPr",elements:[{type:"element",name:"w:ind",attributes:{"w:left":"2880","w:hanging":"360"}}]},{type:"element",name:"w:rPr",elements:[{type:"element",name:"w:rFonts",attributes:{"w:ascii":"Symbol","w:hAnsi":"Symbol","w:hint":"default"}}]}]},{type:"element",name:"w:lvl",attributes:{"w:ilvl":"4","w:tplc":"04090003","w:tentative":"1"},elements:[{type:"element",name:"w:start",attributes:{"w:val":"1"}},{type:"element",name:"w:numFmt",attributes:{"w:val":"bullet"}},{type:"element",name:"w:lvlText",attributes:{"w:val":"o"}},{type:"element",name:"w:lvlJc",attributes:{"w:val":"left"}},{type:"element",name:"w:pPr",elements:[{type:"element",name:"w:ind",attributes:{"w:left":"3600","w:hanging":"360"}}]},{type:"element",name:"w:rPr",elements:[{type:"element",name:"w:rFonts",attributes:{"w:ascii":"Courier New","w:hAnsi":"Courier New","w:cs":"Courier New","w:hint":"default"}}]}]},{type:"element",name:"w:lvl",attributes:{"w:ilvl":"5","w:tplc":"04090005","w:tentative":"1"},elements:[{type:"element",name:"w:start",attributes:{"w:val":"1"}},{type:"element",name:"w:numFmt",attributes:{"w:val":"bullet"}},{type:"element",name:"w:lvlText",attributes:{"w:val":""}},{type:"element",name:"w:lvlJc",attributes:{"w:val":"left"}},{type:"element",name:"w:pPr",elements:[{type:"element",name:"w:ind",attributes:{"w:left":"4320","w:hanging":"360"}}]},{type:"element",name:"w:rPr",elements:[{type:"element",name:"w:rFonts",attributes:{"w:ascii":"Wingdings","w:hAnsi":"Wingdings","w:hint":"default"}}]}]},{type:"element",name:"w:lvl",attributes:{"w:ilvl":"6","w:tplc":"04090001","w:tentative":"1"},elements:[{type:"element",name:"w:start",attributes:{"w:val":"1"}},{type:"element",name:"w:numFmt",attributes:{"w:val":"bullet"}},{type:"element",name:"w:lvlText",attributes:{"w:val":""}},{type:"element",name:"w:lvlJc",attributes:{"w:val":"left"}},{type:"element",name:"w:pPr",elements:[{type:"element",name:"w:ind",attributes:{"w:left":"5040","w:hanging":"360"}}]},{type:"element",name:"w:rPr",elements:[{type:"element",name:"w:rFonts",attributes:{"w:ascii":"Symbol","w:hAnsi":"Symbol","w:hint":"default"}}]}]},{type:"element",name:"w:lvl",attributes:{"w:ilvl":"7","w:tplc":"04090003","w:tentative":"1"},elements:[{type:"element",name:"w:start",attributes:{"w:val":"1"}},{type:"element",name:"w:numFmt",attributes:{"w:val":"bullet"}},{type:"element",name:"w:lvlText",attributes:{"w:val":"o"}},{type:"element",name:"w:lvlJc",attributes:{"w:val":"left"}},{type:"element",name:"w:pPr",elements:[{type:"element",name:"w:ind",attributes:{"w:left":"5760","w:hanging":"360"}}]},{type:"element",name:"w:rPr",elements:[{type:"element",name:"w:rFonts",attributes:{"w:ascii":"Courier New","w:hAnsi":"Courier New","w:cs":"Courier New","w:hint":"default"}}]}]},{type:"element",name:"w:lvl",attributes:{"w:ilvl":"8","w:tplc":"04090005","w:tentative":"1"},elements:[{type:"element",name:"w:start",attributes:{"w:val":"1"}},{type:"element",name:"w:numFmt",attributes:{"w:val":"bullet"}},{type:"element",name:"w:lvlText",attributes:{"w:val":""}},{type:"element",name:"w:lvlJc",attributes:{"w:val":"left"}},{type:"element",name:"w:pPr",elements:[{type:"element",name:"w:ind",attributes:{"w:left":"6480","w:hanging":"360"}}]},{type:"element",name:"w:rPr",elements:[{type:"element",name:"w:rFonts",attributes:{"w:ascii":"Wingdings","w:hAnsi":"Wingdings","w:hint":"default"}}]}]}]},{type:"element",name:"w:abstractNum",attributes:{"w:abstractNumId":"1","w15:restartNumberingAfterBreak":"0"},elements:[{type:"element",name:"w:nsid",attributes:{"w:val":"587013BA"}},{type:"element",name:"w:multiLevelType",attributes:{"w:val":"hybridMultilevel"}},{type:"element",name:"w:tmpl",attributes:{"w:val":"EE6417C4"}},{type:"element",name:"w:lvl",attributes:{"w:ilvl":"0","w:tplc":"0409000F"},elements:[{type:"element",name:"w:start",attributes:{"w:val":"1"}},{type:"element",name:"w:numFmt",attributes:{"w:val":"decimal"}},{type:"element",name:"w:lvlText",attributes:{"w:val":"%1."}},{type:"element",name:"w:lvlJc",attributes:{"w:val":"left"}},{type:"element",name:"w:pPr",elements:[{type:"element",name:"w:ind",attributes:{"w:left":"720","w:hanging":"360"}}]}]},{type:"element",name:"w:lvl",attributes:{"w:ilvl":"1","w:tplc":"04090019","w:tentative":"1"},elements:[{type:"element",name:"w:start",attributes:{"w:val":"1"}},{type:"element",name:"w:numFmt",attributes:{"w:val":"lowerLetter"}},{type:"element",name:"w:lvlText",attributes:{"w:val":"%2."}},{type:"element",name:"w:lvlJc",attributes:{"w:val":"left"}},{type:"element",name:"w:pPr",elements:[{type:"element",name:"w:ind",attributes:{"w:left":"1440","w:hanging":"360"}}]}]},{type:"element",name:"w:lvl",attributes:{"w:ilvl":"2","w:tplc":"0409001B","w:tentative":"1"},elements:[{type:"element",name:"w:start",attributes:{"w:val":"1"}},{type:"element",name:"w:numFmt",attributes:{"w:val":"lowerRoman"}},{type:"element",name:"w:lvlText",attributes:{"w:val":"%3."}},{type:"element",name:"w:lvlJc",attributes:{"w:val":"right"}},{type:"element",name:"w:pPr",elements:[{type:"element",name:"w:ind",attributes:{"w:left":"2160","w:hanging":"180"}}]}]},{type:"element",name:"w:lvl",attributes:{"w:ilvl":"3","w:tplc":"0409000F","w:tentative":"1"},elements:[{type:"element",name:"w:start",attributes:{"w:val":"1"}},{type:"element",name:"w:numFmt",attributes:{"w:val":"decimal"}},{type:"element",name:"w:lvlText",attributes:{"w:val":"%4."}},{type:"element",name:"w:lvlJc",attributes:{"w:val":"left"}},{type:"element",name:"w:pPr",elements:[{type:"element",name:"w:ind",attributes:{"w:left":"2880","w:hanging":"360"}}]}]},{type:"element",name:"w:lvl",attributes:{"w:ilvl":"4","w:tplc":"04090019","w:tentative":"1"},elements:[{type:"element",name:"w:start",attributes:{"w:val":"1"}},{type:"element",name:"w:numFmt",attributes:{"w:val":"lowerLetter"}},{type:"element",name:"w:lvlText",attributes:{"w:val":"%5."}},{type:"element",name:"w:lvlJc",attributes:{"w:val":"left"}},{type:"element",name:"w:pPr",elements:[{type:"element",name:"w:ind",attributes:{"w:left":"3600","w:hanging":"360"}}]}]},{type:"element",name:"w:lvl",attributes:{"w:ilvl":"5","w:tplc":"0409001B","w:tentative":"1"},elements:[{type:"element",name:"w:start",attributes:{"w:val":"1"}},{type:"element",name:"w:numFmt",attributes:{"w:val":"lowerRoman"}},{type:"element",name:"w:lvlText",attributes:{"w:val":"%6."}},{type:"element",name:"w:lvlJc",attributes:{"w:val":"right"}},{type:"element",name:"w:pPr",elements:[{type:"element",name:"w:ind",attributes:{"w:left":"4320","w:hanging":"180"}}]}]},{type:"element",name:"w:lvl",attributes:{"w:ilvl":"6","w:tplc":"0409000F","w:tentative":"1"},elements:[{type:"element",name:"w:start",attributes:{"w:val":"1"}},{type:"element",name:"w:numFmt",attributes:{"w:val":"decimal"}},{type:"element",name:"w:lvlText",attributes:{"w:val":"%7."}},{type:"element",name:"w:lvlJc",attributes:{"w:val":"left"}},{type:"element",name:"w:pPr",elements:[{type:"element",name:"w:ind",attributes:{"w:left":"5040","w:hanging":"360"}}]}]},{type:"element",name:"w:lvl",attributes:{"w:ilvl":"7","w:tplc":"04090019","w:tentative":"1"},elements:[{type:"element",name:"w:start",attributes:{"w:val":"1"}},{type:"element",name:"w:numFmt",attributes:{"w:val":"lowerLetter"}},{type:"element",name:"w:lvlText",attributes:{"w:val":"%8."}},{type:"element",name:"w:lvlJc",attributes:{"w:val":"left"}},{type:"element",name:"w:pPr",elements:[{type:"element",name:"w:ind",attributes:{"w:left":"5760","w:hanging":"360"}}]}]},{type:"element",name:"w:lvl",attributes:{"w:ilvl":"8","w:tplc":"0409001B","w:tentative":"1"},elements:[{type:"element",name:"w:start",attributes:{"w:val":"1"}},{type:"element",name:"w:numFmt",attributes:{"w:val":"lowerRoman"}},{type:"element",name:"w:lvlText",attributes:{"w:val":"%9."}},{type:"element",name:"w:lvlJc",attributes:{"w:val":"right"}},{type:"element",name:"w:pPr",elements:[{type:"element",name:"w:ind",attributes:{"w:left":"6480","w:hanging":"180"}}]}]}]},{type:"element",name:"w:num",attributes:{"w:numId":"1","w16cid:durableId":"100147962"},elements:[{type:"element",name:"w:abstractNumId",attributes:{"w:val":"0"}}]},{type:"element",name:"w:num",attributes:{"w:numId":"2","w16cid:durableId":"485517411"},elements:[{type:"element",name:"w:abstractNumId",attributes:{"w:val":"1"}}]}]}]};function Dg(t,e){const{node:n,commentsExportType:r,exportedCommentDefs:o=[]}=t;if(!o.length||r==="clean")return;const i=n.attrs["w:id"],s=t.comments.find(p=>p.commentId==i);if(!s)return;const a=t.comments?.findIndex(p=>p.commentId===s.commentId),l=s.parentCommentId;let c;l&&(c=t.comments.find(p=>p.commentId===l||p.importedId===l));const u=c?.isInternal||s.isInternal;if(r==="external"&&u||s.resolvedTime)return;let d=ZE(e,a);if(e==="End"){const p={name:"w:r",elements:[{name:"w:commentReference",attributes:{"w:id":String(a)}}]};d=[d,p]}return d}const ZE=(t,e)=>({name:`w:commentRange${t}`,attributes:{"w:id":String(e)}}),QE=t=>({...t,commentParaId:lf()}),e4=(t,e,n,r)=>{const o=jv({editor:r,node:t.commentJSON}),i={"w:id":String(e),"w:author":t.creatorName||t.importedAuthor?.name,"w:email":t.creatorEmail||t.importedAuthor?.email,"w:date":Pv(t.createdTime),"w:initials":t4(t.creatorName),"w:done":t.resolvedTime?"1":"0","w15:paraId":t.commentParaId,"custom:internalId":t.commentId||t.internalId,"custom:trackedChange":t.trackedChange,"custom:trackedChangeText":t.trackedChangeText||null,"custom:trackedChangeType":t.trackedChangeType,"custom:trackedDeletedText":t.deletedText||null};if(t?.parentCommentId){const s=n.find(a=>a.commentId===t.parentCommentId);i["w15:paraIdParent"]=s.commentParaId}return{type:"element",name:"w:comment",attributes:i,elements:[o]}},t4=t=>t?t.replace("(imported)","").trim().split(" ").map(e=>e[0]).join(""):null,Pv=t=>new Date(t||Date.now()).toISOString().replace(/\.\d{3}Z$/,"Z"),n4=(t=[],e)=>{const n=Qt(e);return t.forEach(r=>{r.elements[0].elements.unshift(VE);const o=r.attributes["w15:paraId"];r.elements[0].attributes["w14:paraId"]=o,r.attributes={"w:id":r.attributes["w:id"],"w:author":r.attributes["w:author"],"w:email":r.attributes["w:email"],"w:date":r.attributes["w:date"],"w:initials":r.attributes["w:initials"],"custom:internalId":r.attributes["custom:internalId"],"custom:trackedChange":r.attributes["custom:trackedChange"],"custom:trackedChangeText":r.attributes["custom:trackedChangeText"],"custom:trackedChangeType":r.attributes["custom:trackedChangeType"],"custom:trackedDeletedText":r.attributes["custom:trackedDeletedText"],"xmlns:custom":"http://schemas.openxmlformats.org/wordprocessingml/2006/main"}}),n.elements[0].elements=t,n},r4=(t=[],e)=>{const n=Qt(e),r=t.map(o=>{const i={"w15:paraId":o.commentParaId,"w15:done":o.resolvedTime?"1":"0"},s=o.parentCommentId;if(s){const a=t.find(l=>l.commentId===s);i["w15:paraIdParent"]=a.commentParaId}return{type:"element",name:"w15:commentEx",attributes:i}});return n.elements[0].elements=r,n},o4=(t=[],e,n)=>{const r=Qt(e),o=Qt(n);return r.elements[0].elements=[],o.elements[0].elements=[],t.forEach(i=>{const s=lf(),a={type:"element",name:"w16cid:commentId",attributes:{"w16cid:paraId":i.commentParaId,"w16cid:durableId":s}};r.elements[0].elements.push(a);const l={type:"element",name:"w16cex:commentExtensible",attributes:{"w16cex:durableId":s,"w16cex:dateUtc":Pv()}};o.elements[0].elements.push(l)}),{documentIdsUpdated:r,extensibleUpdated:o}},i4=t=>{const e=Qt(t);return e["word/comments.xml"]=Po.COMMENTS_XML_DEF,e["word/commentsExtended.xml"]=Po.COMMENTS_EXTENDED_XML_DEF,e["word/commentsExtensible.xml"]=Po.COMMENTS_EXTENSIBLE_XML_DEF,e["word/commentsIds.xml"]=Po.COMMENTS_IDS_XML_DEF,e["[Content_Types].xml"]=Po.CONTENT_TYPES,e},s4=t=>{const e=Qt(t);return delete e["word/comments.xml"],delete e["word/commentsExtended.xml"],delete e["word/commentsExtensible.xml"],delete e["word/commentsIds.xml"],e},sa=t=>({...Po.DOCUMENT_RELS_XML_DEF.elements[0].elements.find(e=>e.attributes.Target===t)}),a4=({convertedXml:t,defs:e,commentsWithParaIds:n,exportType:r,converter:o})=>{const i=[];if(r==="clean")return{documentXml:s4(t),relationships:i};const s=i4(t);s["word/comments.xml"]=n4(e,s["word/comments.xml"]),i.push(sa("comments.xml")),s["word/commentsExtended.xml"]=r4(n,s["word/commentsExtended.xml"]),i.push(sa("commentsExtended.xml"));const{documentIdsUpdated:a,extensibleUpdated:l}=o4(n,s["word/commentsIds.xml"],s["word/commentsExtensible.xml"]);return s["word/commentsIds.xml"]=a,s["word/commentsExtensible.xml"]=l,i.push(sa("commentsIds.xml")),i.push(sa("commentsExtensible.xml")),{relationships:i,documentXml:s}},Fd=(t,e)=>e?["width",`${Math.max(e,t)}px`]:["min-width",`${t}px`],zv=(t,e,n,r)=>{let o=0,i=!0;const s=[],a=[],l=t.firstChild;if(!l)return{};for(let f=0,h=0;f<l.childCount;f++){const{colspan:m,colwidth:y}=l.child(f).attrs;for(let g=0;g<m;g++,h++){const v=n===h?r:y&&y[g];o+=v||e,v||(i=!1);const[k,b]=Fd(e,v);s.push(["col",{style:`${k}: ${b}`}]),a.push(parseInt(b,10))}}const c=i?`${o}px`:"",u=i?"":`${o}px`,d=["colgroup",{},...s],p=[...a];return{colgroup:d,tableWidth:c,tableMinWidth:u,colgroupValues:p}};function ki(t){const{type:e}=t.node||{},n={doc:u4,body:l4,paragraph:jv,text:p4,bulletList:Ng,orderedList:Ng,lineBreak:v4,table:x4,tableRow:T4,tableCell:O4,bookmarkStart:_4,fieldAnnotation:P4,tab:S4,image:Hv,hardBreak:z4,commentRangeStart:()=>Dg(t,"Start"),commentRangeEnd:()=>Dg(t,"End"),commentReference:()=>null,shapeContainer:j4,shapeTextbox:q4,contentBlock:V4,structuredContent:W4};return n[e]?n[e](t):(console.error("No translation function found for node type:",e),null)}function l4(t){const e=t.bodyNode?.elements.find(r=>r.name==="w:sectPr")||{};if(t.converter){const r=t.converter.pageStyles.pageMargins,o=e.elements.find(s=>s.name==="w:pgMar"),{attributes:i}=o;Object.entries(r).forEach(([s,a])=>{const l=ii(a);i[`w:${s}`]=l}),o.attributes=i}const n=lr(t);return t.isHeaderFooter?{name:"w:body",elements:[...n]}:{name:"w:body",elements:[...n,e]}}function jv(t){const e=lr(t),n=e.find(i=>i.name==="htmlAnnotation");if(n)return n.elements;const r=c4(t.node);r&&e.unshift(r);let o={};return t.node.attrs?.rsidRDefault&&(o["w:rsidRDefault"]=t.node.attrs.rsidRDefault),{name:"w:p",elements:e,attributes:o}}function c4(t){const{attrs:e={}}=t,n=[],{styleId:r}=e;r&&n.push({name:"w:pStyle",attributes:{"w:val":r}});const{spacing:o,indent:i,textAlign:s,textIndent:a,lineHeight:l,marksAttrs:c,keepLines:u,keepNext:d,dropcap:p}=e;if(o){const{lineSpaceBefore:h,lineSpaceAfter:m,line:y,lineRule:g}=o,v={};h>=0&&(v["w:before"]=at(h)),m>=0&&(v["w:after"]=at(m)),g==="exact"?l&&(v["w:line"]=_E(parseFloat(l))):l&&(v["w:line"]=Nd(l)),v["w:lineRule"]=g||"auto";const k={name:"w:spacing",attributes:v};n.push(k)}if(l&&!o){const h={name:"w:spacing",attributes:{"w:line":Nd(l)}};n.push(h)}if(i){const{left:h,right:m,firstLine:y,hanging:g}=i,v={};(h||h===0)&&(v["w:left"]=at(h)),(m||m===0)&&(v["w:right"]=at(m)),(y||y===0)&&(v["w:firstLine"]=at(y)),(g||g===0)&&(v["w:hanging"]=at(g)),a&&!v["w:left"]&&(v["w:left"]=ii(a));const k={name:"w:ind",attributes:v};n.push(k)}else if(a){const h={name:"w:ind",attributes:{"w:left":ii(a)}};n.push(h)}if(s){const h={name:"w:jc",attributes:{"w:val":s==="justify"?"both":s}};n.push(h)}if(c){const h=ec(c),m=qv(h);n.push(m)}u&&n.push({name:"w:keepLines",attributes:{"w:val":u}}),d&&n.push({name:"w:keepNext",attributes:{"w:val":d}}),p&&n.push({name:"w:framePr",attributes:{"w:dropCap":p.type,"w:lines":p.lines,"w:wrap":p.wrap,"w:vAnchor":p.vAnchor,"w:hAnchor":p.hAnchor}});const f=t.attrs?.paragraphProperties?.sectPr;return f&&n.push(f),n.length?{name:"w:pPr",elements:n}:null}function u4(t){const e={type:"body",content:t.node.content};return[{name:"w:document",elements:[ki({...t,node:e})],attributes:zE},t]}function lr(t){const{content:e}=t.node;if(!e)return[];const n=[];return e.forEach(r=>{let o=ki({...t,node:r});(o?.name||o?.type)!=="w:sdt"&&(o=d4(o)),o instanceof Array?n.push(...o):n.push(o)}),n.filter(r=>r)}const d4=t=>{if(!t)return t;const e=t.elements?.some(o=>o.name==="w:r"),n=t.elements?.some(o=>o.name==="w:sdt");if(!t.elements?.find(o=>o.name==="w:sdt")?.elements?.find(o=>o.name==="w:sdtPr")?.elements?.some(o=>o.name==="w:alias"))return t;let r=t;if(e&&n){const o=t.elements.filter(s=>s.name==="w:sdt"),i=t.elements.filter(s=>s.name!=="w:sdt");r=[...i.filter(s=>s.name==="w:r").every(s=>s.elements.filter(a=>a.name==="w:t")?.every(a=>a.elements[0].text.trim().length>0))?[{...t,elements:i}]:[],{name:"w:p",elements:o}]}return r};function Ql(t,e,n){const r=/^\s|\s$/.test(t)?"preserve":null,o=r?{"xml:space":r}:null,i=[],s=ec(e);if(i.push({name:"w:t",elements:[{text:t,type:"text"}],attributes:o}),n){const{editor:a}=n,l=a.extensionService.extensions.filter(c=>c.isExternal===!0);e.forEach(c=>{const u=l.some(p=>{const f=p.name;return c.type===f});if(!u)return;let d="";Object.entries(c.attrs).forEach(([p,f])=>{f&&(d+=`${p}=${f};`)}),u&&(i.unshift({type:"element",name:"w:bookmarkStart",attributes:{"w:id":"5000","w:name":c.type+";"+d}}),i.push({type:"element",name:"w:bookmarkEnd",attributes:{"w:id":"5000"}}))})}return Hs(i,s)}function p4(t){const{node:e}=t,n=[It,ut];if(e.marks?.some(i=>n.includes(i.type)))return h4(t);if(e.marks?.some(i=>i.type==="link"))return m4(t);const{text:r,marks:o=[]}=e;return Ql(r,o,t)}function f4(t){const e=t.find(n=>n.type===vt);if(e)return{type:"element",name:"w:rPrChange",attributes:{"w:id":e.attrs.id,"w:author":e.attrs.author,"w:authorEmail":e.attrs.authorEmail,"w:date":e.attrs.date},elements:e.attrs.before.map(n=>ec([n])).filter(n=>n!==void 0)}}function h4(t){const{node:e}=t,n=e.marks,r=[It,ut,vt],o=n.find(l=>r.includes(l.type)),i=o.type===It,s=f4(n);e.marks=n.filter(l=>!r.includes(l.type)),s&&e.marks.push(s);const a=ki({...t,node:e});if(!i){const l=a.elements.find(c=>c.name==="w:t");l.name="w:delText"}return{name:i?"w:ins":"w:del",type:"element",attributes:{"w:id":o.attrs.id,"w:author":o.attrs.author,"w:authorEmail":o.attrs.authorEmail,"w:date":o.attrs.date},elements:[a]}}function Hs(t,e){let n=[];return Array.isArray(t)?n=t:n=[t],e&&e.length&&n.unshift(qv(e)),{name:"w:r",elements:n}}function qv(t=[]){return{name:"w:rPr",elements:t.filter(e=>!!Object.keys(e).length)}}function ec(t=[]){return t.flatMap(e=>e.type==="textStyle"?Object.entries(e.attrs).filter(([n,r])=>r).map(([n,r])=>{const o={type:n,attrs:e.attrs};return Ig(o)}):Ig(e))}function m4(t){const{node:e}=t,n=e.marks.find(a=>a.type==="link"),r=n.attrs.href;let o=n.attrs.rId;o||(o=Uv(t,r)),e.marks=e.marks.filter(a=>a.type!=="link");const i=ki({...t,node:e}),s=Vv(i);return{name:"w:hyperlink",type:"element",attributes:{"r:id":o},elements:[s]}}function Vv(t){if(!t)return t;const e=Qt(t);if(!e)return e;const n={name:"w:rStyle",attributes:{"w:val":"Hyperlink"}},r={name:"w:color",attributes:{"w:val":"467886"}};if(e.name==="w:r"){const o=e.elements.find(i=>i.name==="w:rPr");if(o){const i=o.elements.find(a=>a.name==="w:color"),s=o.elements.find(a=>a.name==="w:rStyle");i||o.elements.unshift(r),s||o.elements.unshift(n)}else{const i={name:"w:rPr",elements:[n,r]};e.elements.unshift(i)}}return e}function Uv(t,e){const n="rId"+Yn();return(!t.relationships||!Array.isArray(t.relationships))&&(t.relationships=[]),t.relationships.push({type:"element",name:"Relationship",attributes:{Id:n,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",Target:e,TargetMode:"External"}}),n}function _g(t,e){const n="rId"+Yn(),r={type:"element",name:"Relationship",attributes:{Id:n,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",Target:e}};return t.relationships.push(r),n}function Ng(t){const{type:e}=t.node,n=b4(t),r=[];return n.forEach(o=>{const{level:i,listType:s,pPrs:a,content:l,attrs:c={}}=o,u=(o.attrs.numId||o.listId)??g4(t,s),d=w4(i,u,a);l.forEach((p,f)=>{const h=Object.assign({},p);h.attrs={...h.attrs,...o.attrs};const m=ki({...t,node:h});m.elements||(m.elements=[]);const y=m.elements.findIndex(D=>D.name==="w:pPr");if(!m.elements.filter(D=>D.name!=="w:pPr").length){const D={name:"w:p",type:"element",elements:p.attrs.paragraphProperties?[p.attrs.paragraphProperties]:[]};return r.push(D)}const{attributes:g}=c,{originalInlineRunProps:v}=g||{};if(v&&d.elements.push(v),y===-1)m.elements.unshift(Qt(d));else{const D=Qt(d).elements.map(M=>m.elements[y].elements.find(E=>E.name===M.name)||M);m.elements[y].elements=D}let k;o.attrs?.importedFontSize&&(k={name:"w:sz",attributes:{"w:val":parseInt(o.attrs.importedFontSize.split("pt")[0])*2}});let b;o.attrs?.importedFontFamily&&(b={name:"w:rFonts",attributes:{"w:ascii":o.attrs?.importedFontFamily,"w:hAnsi":o.attrs?.importedFontFamily}});const C=m.elements.find(D=>D.name==="w:rPr");if(C)C.elements.push(fontSize);else if(k||b){const D=[];k&&D.push(k),b&&D.push(b),m.elements.unshift({name:"w:rPr",elements:D})}if(f!==0){const D=m.elements.find(I=>I.name==="w:pPr"),M=D.elements.findIndex(I=>I.name==="w:numPr");M!==-1&&D.elements.splice(M,1)}r.push(m)})}),r}function g4(t,e){const n=y4(t.converter?.numbering?.definitions),r=e==="bullet"?YE:XE,o=n,i=r.attributes["w:abstractNumId"],s={type:"element",name:"w:num",attributes:{"w:numId":String(o),"w16cid:durableId":"485517411"},elements:[{name:"w:abstractNumId",attributes:{"w:val":String(i)}}]};return t.converter.numbering.definitions[o]=s,o}const y4=t=>!t||!Object.keys(t).length?0:Math.max(...Object.keys(t).map(e=>parseInt(e,10)))+1;function w4(t,e,n=[]){return{name:"w:pPr",type:"element",elements:[{name:"w:numPr",type:"element",elements:[{name:"w:ilvl",type:"element",attributes:{"w:val":t}},{name:"w:numId",type:"element",attributes:{"w:val":e}}]},...n]}}function b4({node:t}){const{content:e,attrs:n={}}=t,{listId:r,syncId:o}=t.attrs||{},i=t.attrs["list-style-type"],{attributes:s={}}=n,a=s?.parentAttributes?.paragraphProperties?.elements?.filter(u=>u.name!=="w:numPr")||[],l=[];function c(u,d=0){!u||!u.length||u.forEach(p=>{const f=p.attrs?.indent;if(f){const{left:g,right:v,firstLine:k,hanging:b}=f,C={};g!==void 0&&(C["w:left"]=at(g)),v!==void 0&&(C["w:right"]=at(v)),k!==void 0&&(C["w:firstLine"]=at(k)),b!==void 0&&(C["w:hanging"]=at(b));const D={type:"element",name:"w:ind",attributes:C},M=a.findIndex(I=>I.name==="w:ind");M!==-1&&(a[M]=D)}const h=p.content?.filter(g=>g.type==="bulletList"||g.type==="orderedList")||[],m=p.content?.filter(g=>g.type!=="bulletList"&&g.type!=="orderedList")||[],y={...p,content:m,listId:r,level:d,listType:i,syncId:o,pPrs:a};l.push(y),h.length&&c(h[0].content,d+1)})}return c(e),l}function v4(t){const e={},{lineBreakType:n}=t.node?.attrs||{};return n&&(e["w:type"]=n),{name:"w:br",attributes:e}}function x4(t){t.node=k4(t.node,t);const e=lr(t),n=A4(t.node),r=E4(t.node,t);return e.unshift(n),e.unshift(r),{name:"w:tbl",elements:e}}function k4(t,{editorSchema:e}){const{content:n}=t;for(let r=0;r<n.length;r++){const o=n[r];if(o.content)for(let i=0;i<o.content?.length;i++){const s=o.content[i];if(!s){console.log("no cell");continue}const{attrs:a}=s;if(a.rowspan>1){const l=n.slice(r+1,r+a.rowspan),c={type:s.type,content:[e.nodes.paragraph.createAndFill().toJSON()],attrs:{...s.attrs,colspan:null,rowspan:null,continueMerge:!0}};l.forEach((u,d)=>{u.content.splice(i,0,c)})}}}return t}function S4(t){const{marks:e=[]}=t.node,n=ec(e);return Hs({name:"w:tab"},n)}function A4(t){const e=[],{attrs:n}=t,{tableWidth:r,tableWidthType:o,tableStyleId:i,borders:s,tableIndent:a,tableLayout:l,tableCellSpacing:c}=n;if(i){const u={name:"w:tblStyle",attributes:{"w:val":i}};e.push(u)}if(s){const u=C4(t);e.push(u)}if(a){const{width:u,type:d}=a,p={name:"w:tblInd",attributes:{"w:w":at(u),"w:type":d}};e.push(p)}if(l){const u={name:"w:tblLayout",attributes:{"w:type":l}};e.push(u)}if(r&&r.width){const u={name:"w:tblW",attributes:{"w:w":at(r.width),"w:type":r.type}};e.push(u)}return c&&e.push({name:"w:tblCellSpacing",attributes:{"w:w":c.w,"w:type":c.type}}),{name:"w:tblPr",elements:e}}function C4(t){const{borders:e}=t.attrs,n=[];return e?(["top","bottom","left","right","insideH","insideV"].forEach(r=>{const o=e[r];if(!o)return;let i={};!Object.keys(o).length||!o.size?i={"w:val":"nil"}:i={"w:val":"single","w:sz":Rv(o.size),"w:space":o.space||0,"w:color":o?.color?.substring(1)||"000000"};const s={name:`w:${r}`,attributes:i};n.push(s)}),{name:"w:tblBorders",elements:n}):void 0}function E4(t,e){const{editorSchema:n}=e;let r=[];try{const i=n.nodeFromJSON(t),s=25,{colgroupValues:a}=zv(i,s);r=a}catch{r=[]}const o=[];return r?.forEach(i=>{o.push({name:"w:gridCol",attributes:{"w:w":at(i)}})}),{name:"w:tblGrid",elements:o}}function T4(t){const e=lr(t),n=$4(t.node);return n.elements.length&&e.unshift(n),{name:"w:tr",elements:e}}function $4(t){const{attrs:e}=t,n=[],{rowHeight:r,rowHeightType:o}=e;if(r){const i={"w:val":at(r)};o&&(i["w:hRule"]=o);const s={name:"w:trHeight",attributes:i};n.push(s)}return{name:"w:trPr",elements:n}}function O4(t){const e=lr({...t,tableCell:t.node}),n=M4(t.node);return e.unshift(n),{name:"w:tc",elements:e}}function M4(t){const e=[],{attrs:n}=t,{colwidth:r=[],cellWidthType:o="dxa",background:i={},colspan:s,rowspan:a,widthUnit:l}=n,c=r.reduce((m,y)=>m+y,0),u={name:"w:tcW",attributes:{"w:w":l==="px"?at(c):ii(c),"w:type":o}};if(e.push(u),s){const m={name:"w:gridSpan",attributes:{"w:val":`${s}`}};e.push(m)}const{color:d}=i||{};if(d){const m={name:"w:shd",attributes:{"w:fill":d}};e.push(m)}const{cellMargins:p}=n;if(p){const m={name:"w:tcMar",elements:D4(p)};e.push(m)}const{verticalAlign:f}=n;if(f){const m={name:"w:vAlign",attributes:{"w:val":f}};e.push(m)}if(a&&a>1){const m={name:"w:vMerge",type:"element",attributes:{"w:val":"restart"}};e.push(m)}else if(n.continueMerge){const m={name:"w:vMerge",type:"element"};e.push(m)}const{borders:h={}}=n;if(h&&Object.keys(h).length){const m={name:"w:tcBorders",elements:Object.entries(h).map(([y,g])=>g.size?{name:`w:${y}`,attributes:{"w:val":"single","w:color":g.color?g.color.substring(1):"auto","w:sz":Rv(g.size),"w:space":g.space||0}}:{name:`w:${y}`,attributes:{"w:val":"nil"}})};e.push(m)}return{name:"w:tcPr",elements:e}}function D4(t){const e=[],{top:n,right:r,bottom:o,left:i}=t;return n!=null&&e.push({name:"w:top",attributes:{"w:w":at(n)}}),r!=null&&e.push({name:"w:right",attributes:{"w:w":at(r)}}),o!=null&&e.push({name:"w:bottom",attributes:{"w:w":at(o)}}),i!=null&&e.push({name:"w:left",attributes:{"w:w":at(i)}}),e}function _4(t){const e={name:"w:bookmarkStart",attributes:{"w:id":t.node.attrs.id,"w:name":t.node.attrs.name}},n={name:"w:bookmarkEnd",attributes:{"w:id":t.node.attrs.id}};return[e,n]}function Ig(t){const e=Nr.markTypes.find(i=>i.type===t.type);if(!e)return{};const n={name:e.name,attributes:{}},{attrs:r}=t;let o;switch(t.type){case"bold":case"italic":delete n.attributes,n.type="element";break;case"underline":n.type="element",n.attributes["w:val"]=r.underlineType;break;case"fontSize":o=r.fontSize,n.attributes["w:val"]=o.slice(0,-2)*2;break;case"fontFamily":o=r.fontFamily,["w:ascii","w:eastAsia","w:hAnsi","w:cs"].forEach(s=>{const a=o.split(", ");n.attributes[s]=a[0]?a[0]:o});break;case"color":let i=r.color.replace(/^#/,"").replace(/;$/,"");i.startsWith("rgb")&&(i=LE(i)),n.attributes["w:val"]=i;break;case"textAlign":n.attributes["w:val"]=r.textAlign;break;case"textIndent":n.attributes["w:firstline"]=ii(r.textIndent);break;case"lineHeight":n.attributes["w:line"]=Nd(r.lineHeight);break;case"highlight":n.attributes["w:fill"]=r.color?.substring(1),n.attributes["w:color"]="auto",n.attributes["w:val"]="clear",n.name="w:shd";break}return n}function N4(t){if(!t)return{};const e=t.split(";")[0].split("/")[1];if(!t||e!=="png")return{originalWidth:void 0,originalHeight:void 0};let n=t.split(",")[1].slice(0,50),r=Uint8Array.from(atob(n),i=>i.charCodeAt(0)),o=new DataView(r.buffer,0,28);return{originalWidth:o.getInt32(16),originalHeight:o.getInt32(20)}}function I4(t,e,n,r){let o=t,i=e,s=Math.min(n/t,r/e);return o=Math.round(o*s),i=Math.round(i*s),{scaledWidth:o,scaledHeight:i}}function Hv(t,e){const{node:{attrs:n={},marks:r=[]},tableCell:o}=t;let i=n.rId;const s=n.src||n.imageSrc,{originalWidth:a,originalHeight:l}=N4(s);let c=n.size?{w:Vr(n.size.width),h:Vr(n.size.height)}:e;if(a&&l){const m=Gt(c.w),y=Gt(c.h),{scaledWidth:g,scaledHeight:v}=I4(a,l,m,y);c={w:Vr(g),h:Vr(v)}}if(o){const m=o.attrs.colwidth.reduce((C,D)=>C+D,0),y=o.attrs.cellMargins?.left||8,g=o.attrs.cellMargins?.right||8,v=Vr(m-(y+g)),{width:k,height:b}=U4(c.w,c.h,v);k&&b&&(c={w:k,h:b})}if(t.node.type==="image"&&!i){const m=s?.split("word/")[1];i=_g(t,m)}else if(t.node.type==="fieldAnnotation"&&!i){const m=s?.split(";")[0].split("/")[1];if(!m)return Wv(t);const y=Yn(4),g=n.fieldId.replace("-","_"),v=`media/${g}_${y}.${m}`;i=_g(t,v),t.media[`${g}_${y}.${m}`]=s}let u=n.originalPadding||{distT:0,distB:0,distL:0,distR:0};const d=[];let p=[];n.isAnchor&&(u={...u,simplePos:n.originalAttributes?.simplePos,relativeHeight:1,behindDoc:n.originalAttributes?.behindDoc,locked:n.originalAttributes?.locked,layoutInCell:n.originalAttributes?.layoutInCell,allowOverlap:n.originalAttributes?.allowOverlap},n.simplePos&&d.push({name:"wp:simplePos",attributes:{x:0,y:0}}),n.anchorData&&(d.push({name:"wp:positionH",attributes:{relativeFrom:n.anchorData.hRelativeFrom},...n.marginOffset.left&&{elements:[{name:"wp:posOffset",elements:[{type:"text",text:Vr(n.marginOffset.left).toString()}]}]},...n.anchorData.alignH&&{elements:[{name:"wp:align",elements:[{type:"text",text:n.anchorData.alignH}]}]}}),d.push({name:"wp:positionV",attributes:{relativeFrom:n.anchorData.vRelativeFrom},...n.marginOffset.top&&{elements:[{name:"wp:posOffset",elements:[{type:"text",text:Vr(n.marginOffset.top).toString()}]}]},...n.anchorData.alignV&&{elements:[{name:"wp:align",elements:[{type:"text",text:n.anchorData.alignV}]}]}})),n.wrapText&&p.push({name:"wp:wrapSquare",attributes:{wrapText:n.wrapText}}),n.wrapTopAndBottom&&p.push({name:"wp:wrapTopAndBottom"}));const f="http://schemas.openxmlformats.org/drawingml/2006/main",h="http://schemas.openxmlformats.org/drawingml/2006/picture";return Hs({name:"w:drawing",elements:[{name:n.isAnchor?"wp:anchor":"wp:inline",attributes:u,elements:[...d,{name:"wp:extent",attributes:{cx:c.w,cy:c.h}},{name:"wp:effectExtent",attributes:{l:0,t:0,r:0,b:0}},...p,{name:"wp:docPr",attributes:{id:n.id||0,name:n.alt,descr:n.title}},{name:"wp:cNvGraphicFramePr",elements:[{name:"a:graphicFrameLocks",attributes:{"xmlns:a":f,noChangeAspect:1}}]},{name:"a:graphic",attributes:{"xmlns:a":f},elements:[{name:"a:graphicData",attributes:{uri:h},elements:[{name:"pic:pic",attributes:{"xmlns:pic":h},elements:[{name:"pic:nvPicPr",elements:[{name:"pic:cNvPr",attributes:{id:n.id||0,name:n.title}},{name:"pic:cNvPicPr",elements:[{name:"a:picLocks",attributes:{noChangeAspect:1,noChangeArrowheads:1}}]}]},{name:"pic:blipFill",elements:[{name:"a:blip",attributes:{"r:embed":i}},{name:"a:stretch",elements:[{name:"a:fillRect"}]}]},{name:"pic:spPr",attributes:{bwMode:"auto"},elements:[{name:"a:xfrm",elements:[{name:"a:ext",attributes:{cx:c.w,cy:c.h}},{name:"a:off",attributes:{x:0,y:0}}]},{name:"a:prstGeom",attributes:{prst:"rect"},elements:[{name:"a:avLst"}]},{name:"a:noFill"}]}]}]}]}]}]},[])}function Wv(t){const{node:{attrs:e={},marks:n=[]}}=t,r=Gv(e);return Ql(e.displayLabel,[...n,...r],t)}function F4(t){const{node:{attrs:e={},marks:n=[]}}=t,r=TC.decode(e.displayLabel);return Ql(r,n,t)}function R4(t){const{node:{attrs:e={},marks:n=[]},editorSchema:r}=t,o=new window.DOMParser().parseFromString(e.rawHtml||e.displayLabel,"text/html"),i=Gv(e),s=[...n,...i];let a=Zi.create({doc:er.fromSchema(r).parse(o)});s.length&&(a=H4(a,s));const l=a.doc.toJSON();return{name:"htmlAnnotation",elements:lr({...t,node:l})}}function Fg(t,e){return Hv(t,e)}function B4(t){const{node:{attrs:e={},marks:n=[]}}=t,r=Uv(t,e.linkUrl),o=Ql(e.linkUrl,n,t),i=Vv(o);return{name:"w:hyperlink",type:"element",attributes:{"r:id":r,"w:history":1},elements:[i]}}function L4(t){const e={w:4286250,h:4286250},n={w:99e4,h:495e3};return{text:Wv,image:r=>Fg(r,e),signature:r=>Fg(r,n),checkbox:F4,html:R4,link:B4}[t]}const Gv=(t={})=>{const{fontFamily:e,fontSize:n,bold:r,underline:o,italic:i,textColor:s,textHighlight:a}=t,l=[];return e&&l.push({type:"fontFamily",attrs:{fontFamily:e}}),n&&l.push({type:"fontSize",attrs:{fontSize:n}}),r&&l.push({type:"bold",attrs:{}}),o&&l.push({type:"underline",attrs:{}}),i&&l.push({type:"italic",attrs:{}}),s&&l.push({type:"color",attrs:{color:s}}),a&&l.push({type:"highlight",attrs:{color:a}}),l};function P4(t){const{node:e,isFinalDoc:n}=t,{attrs:r={}}=e,o=L4(r.type);if(!o)return{};let i,s;if(n)return o(t);i=o(t),s=[i],r.type==="html"&&(s=[...i.elements]);const a="http://schemas.openxmlformats.org/wordprocessingml/2006/main";return{name:"w:sdt",elements:[{name:"w:sdtPr",elements:[{name:"w:tag",attributes:{"w:val":r.fieldId}},{name:"w:alias",attributes:{"w:val":r.displayLabel}},{name:"w:fieldType",attributes:{"xmlns:w":a,"w:val":r.fieldType}},{name:"w:fieldTypeShort",attributes:{"xmlns:w":a,"w:val":r.type}},{name:"w:fieldColor",attributes:{"xmlns:w":a,"w:val":r.fieldColor}},{name:"w:fieldMultipleImage",attributes:{"xmlns:w":a,"w:val":r.multipleImage}},{name:"w:fieldFontFamily",attributes:{"xmlns:w":a,"w:val":r.fontFamily}},{name:"w:fieldFontSize",attributes:{"xmlns:w":a,"w:val":r.fontSize}},{name:"w:fieldTextColor",attributes:{"xmlns:w":a,"w:val":r.textColor}},{name:"w:fieldTextHighlight",attributes:{"xmlns:w":a,"w:val":r.textHighlight}}]},{name:"w:sdtContent",elements:s}]}}function z4(t){const{node:e={}}=t,{attrs:n={}}=e,{pageBreakSource:r}=n;return r==="sectPr"?null:{name:"w:r",elements:[{name:"w:br",type:"element",attributes:{"w:type":"page"}}]}}function j4(t){const{node:e}=t,n=lr(t),r={name:"v:shape",attributes:{...e.attrs.attributes,fillcolor:e.attrs.fillcolor},elements:[...n,...e.attrs.wrapAttributes?[{name:"w10:wrap",attributes:{...e.attrs.wrapAttributes}}]:[]]},o={name:"w:pict",attributes:{"w14:anchorId":Math.floor(Math.random()*4294967295).toString()},elements:[r]};return{name:"w:p",elements:[Hs(o)]}}function q4(t){const{node:e}=t,n={name:"w:txbxContent",elements:lr(t)};return{name:"v:textbox",attributes:{...e.attrs.attributes},elements:[n]}}function V4(t){const{node:e}=t,{drawingContent:n}=e.attrs,r={name:"w:drawing",elements:[...n?[...n.elements||[]]:[]]};return{name:"w:p",elements:[Hs({name:"mc:AlternateContent",elements:[{name:"mc:Choice",attributes:{Requires:"wps"},elements:[r]}]})]}}var Jr,Kv,Au,Cu;let Rg=class{constructor(e){ab(this,Jr),this.converter=e}schemaToXml(e,n=!1){return Dn(this,Jr,Kv).call(this,e,n).join("")}};Jr=new WeakSet,Kv=function(t,e=falase){const n=JSON.parse(JSON.stringify(t)),r=this.converter.declaration.attributes,o=`<?xml${Object.entries(r).map(([s,a])=>` ${s}="${a}"`).join("")}?>`,i=Dn(this,Jr,Cu).call(this,n,e);return[o,...i]},Au=function(t){if(t)return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")},Cu=function(t,e=!1){if(!t)return null;let{name:n}=t;const{elements:r,attributes:o}=t;let i=`<${n}`;for(let l in o){const c=typeof o[l]=="string"?Dn(this,Jr,Au).call(this,o[l]):o[l];i+=` ${l}="${c}"`}const s=n&&(!r||!r.length);s?i+=" />":i+=">";let a=[i];if(!n&&t.type==="text")return t.text;if(n==="w:instrText")a.push(r[0].text);else if(n==="w:t"||n==="w:delText"||n==="wp:posOffset"){const l=Dn(this,Jr,Au).call(this,r[0].text);a.push(l)}else if(r)for(let l of r){const c=Dn(this,Jr,Cu).call(this,l);if(!c)continue;if(typeof c=="string"){a.push(c);continue}const u=c.filter(d=>d!=="<undefined>"&&d!=="</undefined>");a.push(...u)}return s||a.push(`</${n}>`),a};function U4(t,e,n){if(t>n){let r=n/t,o=Math.round(e*r);return{width:n,height:o}}return{width:t,height:e}}function H4(t,e){const{tr:n,doc:r,schema:o}=t,i=["fontFamily","fontSize","highlight"];if(!e.some(d=>i.includes(d.type)))return t;const s=e.find(d=>d.type==="fontFamily"),a=e.find(d=>d.type==="fontSize"),l=e.find(d=>d.type==="highlight"),c=o.marks.textStyle,u=o.marks.highlight;return r.descendants((d,p)=>{if(!d.isText)return;const f=d.marks.find(m=>m.type.name==="textStyle"),h=d.marks.find(m=>m.type.name==="highlight");f?!f?.attrs.fontFamily&&s?n.addMark(p,p+d.nodeSize,c.create({...f?.attrs,...s.attrs})):!f?.attrs.fontSize&&a&&n.addMark(p,p+d.nodeSize,c.create({...f?.attrs,...a.attrs})):n.addMark(p,p+d.nodeSize,c.create({...s?.attrs,...a?.attrs})),h||n.addMark(p,p+d.nodeSize,u.create({...l?.attrs}))}),t.apply(n)}function W4(t){const{node:e}=t,{attrs:n={}}=e,r=[{name:"w:sdtContent",elements:lr({...t,nodes:e.content})}];return r.unshift(n.sdtPr),{name:"w:sdt",elements:r}}const G4='<w:document xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" 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:oel="http://schemas.microsoft.com/office/2019/extlst" 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" mc:Ignorable="w14 w15 w16se w16cid w16 w16cex w16sdtdh wp14"><w:body></w:body></w:document>',K4=t=>JSON.parse(nf.xml2json(t,null,2)),J4=(t,e=G4)=>t["word/document.xml"]||K4(e),X4=t=>{const{nodes:e}=t;if(e.length===0)return{nodes:[],consumed:0};const n=e[0];switch(n.name){case"w:tbl":return{nodes:[Z4(n,t)],consumed:1}}return{nodes:[],consumed:0}},Y4={handlerName:"tableNodeHandler",handler:X4};function Z4(t,e){const{docx:n,nodeListHandler:r}=e,o=t.elements.find(k=>k.name==="w:tblPr"),i=o.elements.find(k=>k.name==="w:tblBorders")?.elements||[],{borders:s,rowBorders:a}=Xv(i),l=o.elements.find(k=>k.name==="w:tblStyle"),c={tableStyleId:l?.attributes["w:val"]},u=o?.elements.find(k=>k.name==="w:tblInd");if(u){const{"w:w":k,"w:type":b}=u.attributes;c.tableIndent={width:nt(k),type:b}}const d=o?.elements.find(k=>k.name==="w:tblLayout");if(d){const{"w:type":k}=d.attributes;c.tableLayout=k}const p=Jv(l,n),f=o.elements.find(k=>k.name==="w:tblW");f&&(c.tableWidth={width:nt(f.attributes["w:w"]),type:f.attributes["w:type"]});const h=o.elements.find(k=>k.name==="w:tblCellSpacing");h&&(c.tableCellSpacing={w:h.attributes["w:w"],type:h.attributes["w:type"]},c.borderCollapse="separate");const m=t.elements.filter(k=>k.name==="w:tr"),y=Object.keys(s)?.length?s:p?.borders,g=Object.keys(a)?.length?a:p?.rowBorders;c.borders=y;const v=[];return m.forEach(k=>{const b=t6(k,t,g,l,e);b.content?.length&&v.push(b)}),{type:"table",content:v,attrs:c}}function Q4(t,e,n,r,o=null,i,s,a){const{docx:l,nodeListHandler:c}=s,u=t.elements.find(N=>N.name==="w:tcPr"),d=u?.elements?.find(N=>N.name==="w:tcBorders"),p=e6(d,r),f=Yv(n),h=u?.elements?.find(N=>N.name==="w:tcW");let m=h?nt(h.attributes["w:w"]):null;const y=h?.attributes["w:type"];!m&&o&&(m=o);const g=Bg(t),{attributes:v}=g||{},k={color:u?.elements?.find(N=>N.name==="w:shd")?.attributes["w:fill"]},b=u?.elements?.find(N=>N.name==="w:gridSpan")?.attributes["w:val"],C=u?.elements?.find(N=>N.name==="w:tcMar"),D=u?.elements?.find(N=>N.name==="w:vAlign")?.attributes["w:val"]||"top",M={},I=Jv(i,l)||{};M.cellMargins=n6(C,I);const{fontSize:E,fonts:G={}}=I,oe=G.ascii;if(m){M.colwidth=[m],M.widthUnit="px";const N=f,H=f&&f.length>0,A=parseInt(b,10);if(A&&A>1&&H){let J=[];for(let ie=0;ie<A;ie++){let W=N[a+ie];typeof W<"u"?J.push(W):J.push(100)}J.length&&(M.colwidth=[...J])}}if(y&&(M.widthType=y),b&&(M.colspan=parseInt(b,10)),k&&(M.background=k),M.verticalAlign=D,E&&(M.fontSize=E),oe&&(M.fontFamily=oe.ascii),r&&(M.borders={...r}),p&&(M.borders=Object.assign(M.borders||{},p)),v&&v["w:val"]==="restart"){const N=n.elements.filter(W=>W.name==="w:tr"),H=N.findIndex(W=>W===e),A=N.slice(H+1);let J=e.elements.filter(W=>W.name==="w:tc").findIndex(W=>W===t),ie=1;for(let W of A){const ce=W.elements.findIndex(R=>R.name==="w:tc"),X=W.elements[ce+J];if(!X)break;const ue=Bg(X),{attributes:Z}=ue||{};if(!ue&&!Z||Z&&Z["w:val"]==="restart")break;ie++,W.elements.splice(ce+J,1)}M.rowspan=ie}return{type:"tableCell",content:c.handler({...s,nodes:t.elements}),attrs:M}}const Bg=t=>t.elements.find(e=>e.name==="w:tcPr")?.elements?.find(e=>e.name==="w:vMerge"),aa=(t,e,n={})=>{const r=t?.elements?.find(o=>o.name===`w:${e}`)?.attributes;if(r&&r["w:val"]!=="nil"){const o={},i=r["w:color"];i&&(o.color=i==="auto"?"#000000":`#${i}`);const s=r["w:sz"];return s&&(o.size=Fv(s)),o}if(r&&r["w:val"]==="nil"){const o=Object.assign({},n[e]||{});return Object.keys(o)?(o.val="none",o):null}return null},e6=(t,e)=>{if(!t)return null;const n={},r=aa(t,"bottom",e);r&&(n.bottom=r);const o=aa(t,"top",e);o&&(n.top=o);const i=aa(t,"left",e);i&&(n.left=i);const s=aa(t,"right",e);return s&&(n.right=s),n};function Jv(t,e,n){if(!t)return null;const r={},{attributes:o={}}=t,i=o["w:val"];if(!i)return null;const s=e["word/styles.xml"],{elements:a}=s.elements[0],l=a.filter(m=>m.name==="w:style"),c=l.find(m=>m.attributes["w:styleId"]===i);if(!c)return null;r.name=c.elements.find(m=>m.name==="w:name");const u=c.elements.find(m=>m.name==="w:basedOn");c.elements.find(m=>m.name==="w:uiPriority");let d;if(u?.attributes){const m=l.find(y=>y.attributes["w:styleId"]===u.attributes["w:val"]);d=m?m.elements.find(y=>y.name==="w:tblPr"):{}}const p=c.elements.find(m=>m.name==="w:pPr");if(p){const m=p.elements.find(y=>y.name==="w:jc");m?.attributes&&(r.justification=m.attributes["w:val"])}const f=c?.elements.find(m=>m.name==="w:rPr");if(f){const m=f.elements.find(g=>g.name==="w:rFonts");if(m){const{"w:ascii":g,"w:hAnsi":v,"w:cs":k}=m.attributes;r.fonts={ascii:g,hAnsi:v,cs:k}}const y=f.elements.find(g=>g.name==="w:sz");y?.attributes&&(r.fontSize=DE(y.attributes["w:val"])+"pt")}const h=c.elements.find(m=>m.name==="w:tblPr");if(h&&h.elements){d&&d.elements&&h.elements.push(...d.elements);const m=h?.elements?.find(b=>b.name==="w:tblBorders"),{elements:y=[]}=m||{},{borders:g,rowBorders:v}=Xv(y);g&&(r.borders=g),v&&(r.rowBorders=v);const k=h?.elements.find(b=>b.name==="w:tblCellMar");if(k){const b=k.elements.find(I=>I.name==="w:left"),C=k.elements.find(I=>I.name==="w:right"),D=k.elements.find(I=>I.name==="w:top"),M=k.elements.find(I=>I.name==="w:bottom");r.cellMargins={marginLeft:b?.attributes["w:w"],marginRight:C?.attributes["w:w"],marginTop:D?.attributes["w:w"],marginBottom:M?.attributes["w:w"]}}}return r}function Xv(t){const e={},n={};return t.forEach(r=>{const{name:o}=r,i=o.split("w:")[1],{attributes:s}=r,a={},l=s["w:color"],c=s["w:sz"];l&&l!=="auto"&&(a.color=l.startsWith("#")?l:`#${l}`),c&&c!=="auto"&&(a.size=Fv(c)),["insideH","insideV"].includes(i)&&(n[i]=a),e[i]=a}),{borders:e,rowBorders:n}}function t6(t,e,n,r,o){const i={},s=t.elements.find(d=>d.name==="w:trPr")?.elements?.find(d=>d.name==="w:trHeight"),a=s?.attributes["w:val"];s?.attributes["w:hRule"];const l={};n?.insideH&&(l.bottom=n.insideH),n?.insideV&&(l.right=n.insideV),i.borders=l,a&&(i.rowHeight=nt(a));const c=Yv(e),u=t.elements.filter(d=>d.name==="w:tc");return{type:"tableRow",content:u?.map((d,p)=>{const f=u.length>1?c[p]:null;return Q4(d,t,e,l,f,r,o,p)})||[],attrs:i}}const n6=(t,e)=>{const n=t?.elements?.find(m=>m.name==="w:left"),r=t?.elements?.find(m=>m.name==="w:right"),o=t?.elements?.find(m=>m.name==="w:top"),i=t?.elements?.find(m=>m.name==="w:bottom"),s=n?.attributes["w:w"],a=r?.attributes["w:w"],l=o?.attributes["w:w"],c=i?.attributes["w:w"],{cellMargins:u={}}=e,{marginLeft:d,marginRight:p,marginTop:f,marginBottom:h}=u;return{left:nt(s??d),right:nt(a??p),top:nt(l??f),bottom:nt(c??h)}},Yv=t=>t.elements.find(e=>e.name==="w:tblGrid")?.elements?.flatMap(e=>e.name!=="w:gridCol"?[]:nt(e.attributes["w:w"]))||[],r6=t=>{const{nodes:e,filename:n}=t,r=["w:drawing","w:p"];if(e.length===0||!r.includes(e[0].name))return{nodes:[],consumed:0};const o=e[0];let i;if(o.name==="w:drawing"?i=o:i=o.elements.find(d=>d.name==="w:drawing"),!i)return{nodes:[],consumed:0};let s;const{elements:a}=i,l=n||null,c=a.find(d=>d.name==="wp:anchor");c&&(s=Lg(a[0],l,t),s.attrs.isAnchor=c);const u=a.find(d=>d.name==="wp:inline");return u&&(s=Lg(u,l,t)),{nodes:s?[s]:[],consumed:1}};function Lg(t,e,n){const{docx:r}=n,{attributes:o}=t,i={top:Gt(o.distT),bottom:Gt(o.distB),left:Gt(o.distL),right:Gt(o.distR)},s=t.elements.find(X=>X.name==="wp:extent"),a={width:Gt(s.attributes?.cx),height:Gt(s.attributes?.cy)},l=t.elements.find(X=>X.name==="a:graphic").elements.find(X=>X.name==="a:graphicData"),{uri:c}=l?.attributes;if(c&&c==="http://schemas.microsoft.com/office/word/2010/wordprocessingShape")return o6(n,t,l);const u=l.elements.find(X=>X.name==="pic:pic");if(!u||!u.elements)return null;const d=u.elements.find(X=>X.name==="pic:blipFill").elements.find(X=>X.name==="a:blip"),p=t.elements.find(X=>X.name==="wp:positionH"),f=p?.elements.find(X=>X.name==="wp:posOffset"),h=Gt(f?.elements[0]?.text),m=p?.attributes.relativeFrom,y=p?.elements.find(X=>X.name==="wp:align")?.elements[0]?.text,g=t.elements.find(X=>X.name==="wp:positionV"),v=g?.elements.find(X=>X.name==="wp:posOffset"),k=Gt(v?.elements[0]?.text),b=g?.attributes.relativeFrom,C=g?.elements.find(X=>X.name==="wp:align")?.elements[0]?.text,D=t.elements.find(X=>X.name==="wp:simplePos"),M=t.elements.find(X=>X.name==="wp:wrapSquare"),I=t.elements.find(X=>X.name==="wp:wrapTopAndBottom"),E=t.elements.find(X=>X.name==="wp:docPr");let G=null;(m||y||b||C)&&(G={hRelativeFrom:m,vRelativeFrom:b,alignH:y,alignV:C});const oe={left:h,top:k},{attributes:N}=d,H=N["r:embed"];let A=r[`word/_rels/${e||"document.xml"}.rels`];A||(A=r["word/_rels/document.xml.rels"]);const J=A.elements.find(X=>X.name==="Relationships"),{elements:ie}=J,W=ie.find(X=>X.attributes.Id===H),{attributes:ce}=W;return{type:"image",attrs:{src:`word/${ce.Target}`,alt:E?.attributes.name||"Image",id:E?.attributes.id||"",title:E?.attributes.descr||"Image",inline:!0,padding:i,marginOffset:oe,size:a,anchorData:G,...D&&{simplePos:{x:D.attributes.x,y:D.attributes.y}},...M&&{wrapText:M.attributes.wrapText},wrapTopAndBottom:!!I,originalPadding:{distT:o.distT,distB:o.distB,distL:o.distL,distR:o.distR},originalAttributes:t.attributes,rId:ce.Id}}}const o6=(t,e,n)=>{const r=n.elements.find(l=>l.name==="wps:wsp"),o=r.elements.find(l=>l.name==="wps:txbx")?.elements?.find(l=>l.name==="w:txbxContent");e.elements.find(l=>l.name==="wp:docPr");const i=r.elements.find(l=>l.name==="wps:spPr"),s=i?.elements.find(l=>l.name==="a:prstGeom");if(s&&s.attributes.prst==="rect")return i6(t,i);if(!o)return null;const{nodeListHandler:a}=t;return a.handler({...t,node:o.elements[0],nodes:o.elements})[0]},i6=(t,e)=>{const n={},[r]=t.nodes;r?.name==="w:drawing"&&(n.drawingContent=r);const o=e.elements.find(u=>u.name==="a:xfrm"),i=o.elements.find(u=>u.name==="a:off"),s=o.elements.find(u=>u.name==="a:ext");e.elements.find(u=>u.name==="a:ln");const a=e.elements.find(u=>u.name==="a:solidFill"),l={top:Gt(i.attributes.y),left:Gt(i.attributes.x),width:Gt(s.attributes.cx),height:Gt(s.attributes.cy)};n.size=l;const c=a?.elements[0]?.attributes.val;return c&&(n.background="#"+c),{type:"contentBlock",attrs:n}},s6={handlerName:"drawingNodeHandler",handler:r6};function si(t,e=[],n=null){const r=[],o=new Set;return t?.elements?.forEach(i=>{const s=Nr.markTypes.filter(a=>a.name===i.name);s.length||["w:shd","w:rStyle","w:pStyle","w:numPr","w:outlineLvl","w:bdr","w:pBdr","w:noProof","w:contextualSpacing","w:keepNext","w:tabs","w:keepLines"].includes(i.name)&&e.push(i.name),s.forEach(a=>{if(!a||o.has(a.type))return;o.add(a.type);const{attributes:l={}}=i,c={type:a.type};if(!(l["w:val"]=="0"||l["w:val"]==="none")){if(a.mark&&(c.type=a.mark),Object.keys(l).length){const u=l6(a.type,l,n);if(u==null)return;c.attrs={},c.attrs[a.property]=u}r.push(c)}})}),Rd(r)}function a6(t,e){const n=t.elements?.find(s=>s.name==="w:rPrChange");if(!n)return[];const{attributes:r}=n,o={id:r["w:id"],date:r["w:date"],author:r["w:author"],authorEmail:r["w:authorEmail"]},i=si(n);return[{type:vt,attrs:{...o,before:i,after:[...e]}}]}function Rd(t){const e=t.filter(o=>o.type==="textStyle"),n=t.filter(o=>o.type!=="textStyle"),r={};return e.length&&e.forEach(o=>{const{attrs:i={}}=o;Object.keys(i).forEach(s=>{r[s]=i[s]})}),[...n,{type:"textStyle",attrs:r}]}function l6(t,e,n){t==="tabs"&&(t="textIndent");const r={color:()=>`#${e["w:val"]}`,fontSize:()=>`${e["w:val"]/2}pt`,textIndent:()=>u6(e),fontFamily:()=>c6(e,n),lineHeight:()=>d6(e),textAlign:()=>e["w:val"],link:()=>e.href,underline:()=>e["w:val"],bold:()=>e?.["w:val"]||null,italic:()=>e?.["w:val"]||null,highlight:()=>p6(e)};if(t in r||console.debug("❗️❗️ No value mapper for:",t,"Attributes:",e),t in r)return r[t],r[t]()}function c6(t,e){const n=t["w:ascii"],r=t["w:asciiTheme"];if(!e||!r)return n;const o=e["word/theme/theme1.xml"];if(!o)return n;const{elements:i}=o,{elements:s}=i[0];return s.find(a=>a.name==="a:themeElements").elements.find(a=>a.name==="a:fontScheme").elements.find(a=>a.name==="a:majorFont").elements.find(a=>a.name==="a:latin").attributes.typeface}function u6(t){let e=t["w:left"];return e?`${Wt(e)}in`:null}function d6(t){const e=t["w:line"],n=t["w:lineRule"];return!e||e==="0"?null:n==="exact"?`${Bv(e)}pt`:`${Jo(e)}`}function p6(t){const e=t["w:fill"];return e&&e!=="auto"?`#${e}`:RE(t?.["w:val"])?`#${t["w:val"]}`:FE(t?.["w:val"])||null}function go(t,e){const n=[],r=[],{attributes:o={},elements:i=[]}=t,{nodes:s,paragraphProperties:a={},runProperties:l={}}=f6(i);return i.find(c=>c.name==="w:r")&&(a.elements=a?.elements?.filter(c=>c.name!=="w:rPr")),l&&l?.elements?.length&&n.push(...si(l,r)),a&&a.elements?.length&&n.push(...si(a,r)),n.push(...a6(l,n)),a&&a.elements?.length&&(o.paragraphProperties=a),n&&t.name==="w:p"&&n.forEach(c=>{const u=Object.keys(c.attrs??{})[0];if(u){const d=c.attrs[u];o[u]=d}}),{elements:s,attributes:o,marks:n,unknownMarks:r}}function f6(t){const e=t.find(o=>o.name==="w:pPr"),n=t.find(o=>o.name==="w:rPr"),r=t.find(o=>o.name==="w:sectPr");return{nodes:t.filter(o=>o.name!=="w:pPr"&&o.name!=="w:rPr"&&o.name!=="w:sectPr"),paragraphProperties:e,runProperties:n,sectionProperties:r}}function Va(t){return Nr.allowedElements[t.name||t.type]}const h6=t=>!!Nr.propertyTypes[t.name||t.type];function Zv(t){return t.filter(e=>e.name==="w:r").some(e=>e.elements.some(n=>n.name==="w:t"))}const m6=t=>{const{nodes:e,nodeListHandler:n}=t;if(e.length===0||!(e[0].name==="w:del"||e[0].name==="w:ins"||e[0].name==="w:sdt"))return{nodes:[],consumed:0};const r=e[0];let o;if(["w:ins","w:del"].includes(r.name))o=r;else{const d=r.elements.find(p=>p.name==="w:sdtContent")?.elements.find(p=>["w:ins","w:del"].includes(p.name));d&&(o=d)}if(!o)return{nodes:[],consumed:0};const{name:i}=o,{attributes:s,elements:a}=go(o),l=n.handler({...t,insideTrackChange:!0,nodes:a}),c=i==="w:del"?ut:It,u={id:s["w:id"],date:s["w:date"],author:s["w:author"],authorEmail:s["w:authorEmail"]};return l.forEach(d=>{d.marks===void 0&&(d.marks=[]),d.marks.push({type:c,attrs:u})}),{nodes:l,consumed:1}},g6={handlerName:"trackChangeNodeHandler",handler:m6},y6=t=>{const{nodes:e,docx:n,nodeListHandler:r}=t;if(e.length===0||e[0].name!=="w:hyperlink")return{nodes:[],consumed:0};const o=e[0],i=n["word/_rels/document.xml.rels"].elements.find(m=>m.name==="Relationships"),{elements:s}=i,{attributes:a}=o,l=a["r:id"],c=a["w:anchor"];a["w:history"];const u=s.find(m=>m.attributes.Id===l)||{},{attributes:d={}}=u;let p=d.Target;c&&!p&&(p=`#${c}`);const f=o.elements.filter(m=>m.name==="w:r"),h={type:"link",attrs:{href:p,rId:l}};for(const m of f){m.marks||(m.marks=[]),m.marks.push(h);const y=m.elements.find(g=>g.name==="w:rPr");if(y&&y.elements.find(g=>g.name==="w:rStyle")){const g=n["word/styles.xml"],{elements:v}=g.elements[0],k=v.filter(b=>b.name==="w:style").find(b=>b.attributes["w:styleId"]==="Hyperlink")?.elements?.find(b=>b.name==="w:rPr");k&&m.elements.unshift(k)}}return{nodes:r.handler({...t,nodes:f}),consumed:1}},w6={handlerName:"hyperlinkNodeHandler",handler:y6},b6=t=>{const{nodes:e,nodeListHandler:n,parentStyleId:r,docx:o}=t;if(e.length===0||e[0].name!=="w:r")return{nodes:[],consumed:0};const i=e[0],s={...t,nodes:i.elements};let a=n.handler(s)?.filter(u=>u)||[];const l=i.elements?.some(u=>u.name==="w:rPr"),c=v6(o,r);if(l){const{marks:u=[],attributes:d={}}=go(i),p=u.find(m=>m.type==="textStyle"),f=p&&Object.keys(p.attrs).length>0;c.marks&&!f&&u.push(...c.marks),i.marks&&u.push(...i.marks);const h=Rd(u);a=a.map(m=>{const y=m.marks||[];return{...m,marks:[...h,...y],attributes:d}})}else c.marks&&(a=a.map(u=>({...u,marks:Rd(c.marks)})));return{nodes:a,consumed:1}},v6=(t,e)=>{const n=t?.["word/styles.xml"];if(!n)return{};const r=n.elements[0].elements.filter(o=>o.name==="w:style").find(o=>o.attributes["w:styleId"]===e)||{};return r?go(r):{}},x6={handlerName:"runNodeHandler",handler:b6},k6=t=>{const{nodes:e,insideTrackChange:n}=t;if(e.length===0||!(e[0].name==="w:t"||n&&e[0].name==="w:delText"))return{nodes:[],consumed:0};const r=e[0],{type:o}=r,{attributes:i,elements:s,marks:a=[]}=go(r);let l;if(s.length===1)l=s[0].text;else if(!s.length&&"attributes"in r&&r.attributes["xml:space"]==="preserve")l=" ";else return{nodes:[],consumed:0};return{nodes:[{type:Va(r),text:l,attrs:{type:o,attributes:i||{}},marks:a}],consumed:1}},S6={handlerName:"textNodeHandler",handler:k6},Qv=t=>{if(!t||!Array.isArray(t))return t;let e=[],n=null;for(let r of t)r.type==="text"?n&&A6(n,r)?n={...n,text:n.text+=r.text}:(n&&e.push(n),n={...r}):(n&&(e.push(n),n=null),e.push(r));return n&&e.push(n),e},A6=(t,e)=>{if(!t||!e)return!1;let n=t.marks??[],r=e.marks??[];if(n.length!==r.length)return!1;for(let o=0;o<n.length;o++)if(n[o].attrs||(n[o].attrs={}),r[o].attrs||(r[o].attrs={}),n[o].type!==r[o].type||Object.keys(n[o].attrs).length!==Object.keys(r[o].attrs).length||!C6(n[o].attrs,r[o].attrs))return!1;return!0},C6=(t={},e={})=>oi(t,e),E6=t=>{const{nodes:e,lists:n,docx:r}=t;if(e.length===0||e[0].name!=="w:p")return{nodes:[],consumed:0};const o=Qt(e[0]),i=i1(o.elements);o.elements=i;const s=o.elements.find(a=>a.name==="w:pPr");if(Bd(o,r)){const a=Qt(e),l=[];let c=a.shift();for(;c&&Bd(c,r);)l.push(c),c=a.shift(),c?.elements&&!Zv(c.elements)&&(l.push(c),c=a.shift());return{nodes:[e1({listItems:l,params:t,originalPpr:s})],consumed:l.filter(u=>u.seen).length,lists:n}}else return{nodes:[],consumed:0,lists:n}},T6={handlerName:"listHandler",handler:E6};function e1({listItems:t,originalPpr:e,params:n,listLevel:r=0,actualListLevel:o=0,currentListNumId:i=null,path:s="",isNested:a=!1}){const{docx:l,nodeListHandler:c,lists:u}=n,d=[];let p,f;const h=c.handlerEntities.find(k=>k.handlerName==="standardNodeHandler")?.handler;if(!h)return console.error("Standard node handler not found"),{nodes:[],consumed:0};const m=t[0].elements.find(k=>k.name==="w:pPr")?.elements?.find(k=>k.name==="w:pStyle")?.attributes["w:val"],y=tc({node:t[0],styleId:m,docx:l});i=ai(y),o=parseInt(y?.elements?.find(k=>k.name==="w:ilvl")?.attributes["w:val"])||0,o===void 0&&(o=t1(m,l));let g=0;for(let[k,b]of t.entries()){if(b.seen)continue;if(b.elements&&!Zv(b.elements)){const $=h({...n,nodes:[b]}).nodes[0];$&&d[d.length-1]?.content.push($),b.seen=!0;continue}const{attributes:C,elements:D,marks:M=[]}=go(b),I=cf(m,l)||{},{marks:E}=go(I),G=M.find($=>$.type==="textStyle"),oe=E?.find($=>$.type==="textStyle"),{listType:N,listOrderingType:H,ilvl:A,listrPrs:J,listpPrs:ie,start:W,lvlText:ce,lvlJc:X,numId:ue}=D6(b,r,l);f=H;const Z=parseInt(A),R=o===Z&&ue===i,ee=M6({firstListId:ue,secondListId:i,level:Z,pStyleId:null,docx:l}),ne=ue!==i&&!ee,se=r<Z||r===Z&&ne&&g===r;u[i]||(u[i]={}),u[i][r]||(u[i][r]=Number(W));const Y={};if(R&&!se){p=N,b.seen=!0;const $=[];let T={type:"paragraph",content:c.handler({...n,nodes:[C.paragraphProperties,...D]})?.filter(S=>S)};T.content&&(T={...T,attrs:{textAlign:G?.attrs.textAlign||oe?.attrs.textAlign||null,rsidRDefault:C?.["w:rsidRDefault"]||null,styleId:m},content:Qv(T.content)}),$.push(T),g=r;let K=[];if(f!=="bullet"&&(K=[...s,u[i][r]],u[i][o]++),!s.length&&o>0){const S=u[i];if(S){const re=[];Object.keys(S).forEach(Q=>{re.push(S[Q])}),K=re}}let q=b.elements.find(S=>S.name==="w:pPr")?.elements.find(S=>S.name==="w:ind");const F=I?.elements?.find(S=>S.name==="w:pPr")?.elements?.find(S=>S.name==="w:ind");if(q||(q=F),q){const S={};q.attributes||(q.attributes={}),q.attributes["w:left"]!==void 0&&(S.left=nt(q.attributes["w:left"])),q.attributes["w:right"]!==void 0&&(S.right=nt(q.attributes["w:right"])),q.attributes["w:firstLine"]!==void 0&&(S.firstLine=nt(q.attributes["w:firstLine"])),q.attributes["w:hanging"]!==void 0&&(S.hanging=nt(q.attributes["w:hanging"])),Y.indent=S}ie&&(Y.listParagraphProperties=ie),J&&(Y.listRunProperties=J),Y.textStyle=G,Y.order=W,Y.lvlText=ce,Y.lvlJc=G?.attrs.textAlign,Y.listLevel=K,Y.listNumberingType=H,Y.attributes={parentAttributes:b?.attributes||null};const L=e?.elements?.find(S=>S.name==="w:rPr");L&&(Y.attributes.originalInlineRunProps=L),Y.numId=ue,l&&(Y.spacing=r1(b,l,m));const le=Pg($,Y,[]);d.push(le)}else if(se){const $=[...s,u[i][r]],T=e1({listItems:t.slice(k),originalPpr:e,params:n,listLevel:r+1,actualListLevel:r,currentListNumId:ue,path:$,isNested:!0});g=T.lastNestedListLevel,delete T.lastNestedListLevel;const K=d[d.length-1];K?K.content.push(T):d.push(Pg([T],Y,[]))}else if(ue){g=r,r>0&&b.elements[0].elements.find($=>$.name==="w:numPr")&&(u[i][r]=0);break}else{b.seen=!0;const $=h({...n,nodes:[b]}).nodes[0];d[d.length-1]?.content.push($)}}const v={type:p||"bulletList",content:d,attrs:{"list-style-type":f,listId:i,attributes:{parentAttributes:t[0]?.attributes||null}}};return a&&(v.lastNestedListLevel=g),v}const t1=(t,e)=>{const n=cf(t,e)?.elements?.find(r=>r.name==="w:pPr")?.elements?.find(r=>r.name==="w:outlineLvl");try{return parseInt(n?.attributes["w:val"])}catch{}};function Bd(t,e){const{elements:n}=t,r=n?.find(l=>l.name==="w:pPr");if(!r)return!1;const o=r.elements?.find(l=>l.name==="w:pStyle");let i=r.elements?.find(l=>l.name==="w:numPr"),s=ai(i);const a=o?.attributes["w:val"];return a&&!s&&(i=tc({node:t,styleId:a,docx:e}),s=ai(i)),!!s}const ai=t=>t?.elements?.find(e=>e.name==="w:numId")?.attributes["w:val"];function cf(t,e){const n=e["word/styles.xml"];return n?n.elements.find(r=>r.name==="w:styles").elements.filter(r=>r.name==="w:style").find(r=>r.attributes["w:styleId"]===t):{}}function tc({node:t,styleId:e,docx:n,seenStyleIds:r=new Set}){let o=t?.elements?.find(l=>l.name==="w:pPr")?.elements?.find(l=>l.name==="w:numPr"),i=ai(o);if(i)return o;const s=cf(e,n);o=s?.elements?.find(l=>l.name==="w:pPr")?.elements?.find(l=>l.name==="w:numPr"),i=ai(o);const a=s?.elements?.find(l=>l.name==="w:basedOn");if(!i&&!r.has(e)){const l=a?.attributes["w:val"];return r.add(e),l?tc({styleId:l,docx:n,seenStyleIds:r}):null}return o}function Pg(t,e,n){return{type:"listItem",content:t,attrs:e,marks:n}}const $6=["decimal","decimalZero","lowerRoman","upperRoman","lowerLetter","upperLetter","ordinal","cardinalText","ordinalText","hex","chicago","none"],O6=["bullet","square","circle","disc"],M6=({firstListId:t,secondListId:e,level:n,pStyleId:r,docx:o})=>{const{numFmt:i,lvlText:s,lvlJc:a}=fl(t,n,r,o),{numFmt:l,lvlText:c,lvlJc:u}=fl(e,n,r,o);return i===l&&s===c&&a===u},zg=(t,e)=>{const n=e["word/styles.xml"];if(!n)return null;const{elements:r}=n,o=r[0].elements.filter(h=>h.name==="w:style"),i=o.find(h=>h.attributes["w:styleId"]===t)||{},s=i?.elements?.find(h=>h.name==="w:pPr");if(!s)return null;let a=s?.elements?.find(h=>h.name==="w:numPr");if(!a)return null;let l=a?.elements?.find(h=>h.name==="w:numId")||{},c=ai(a),u=a?.elements?.find(h=>h.name==="w:ilvl"),d=u?.attributes?.["w:val"];const p=i?.elements?.find(h=>h.name==="w:basedOn")?.attributes?.["w:val"];let f=0;for(;a&&!c&&f<10;)a=(o.find(h=>h.attributes["w:styleId"]===p)||{})?.elements?.find(h=>h.name==="w:pPr")?.elements?.find(h=>h.name==="w:numPr"),l=a?.elements?.find(h=>h.name==="w:numId")||{},c=l?.attributes?.["w:val"],u||(u=a?.elements?.find(h=>h.name==="w:ilvl"),d=u?.attributes?.["w:val"]),f++;return{numId:c,ilvl:d}},fl=(t,e,n,r)=>{const o=r["word/numbering.xml"];if(!o)return{};const{elements:i}=o,s=i[0];if(n){const{numId:k,ilvl:b}=zg(n,r)||{};!t&&k&&(t=k),!e&&b&&(e=b?parseInt(b):null)}const a=s.elements,l=a.filter(k=>k.name==="w:abstractNum"),c=a.filter(k=>k.name==="w:num").find(k=>k.attributes["w:numId"]===t)?.elements[0].attributes["w:val"],u=l?.find(k=>k.attributes["w:abstractNumId"]===c),d=_6(u,e),p=u?.elements?.find(k=>k.name==="w:numStyleLink")?.attributes["w:val"];if(p){const k=zg(p,r);return fl(k.numId,e,null,r)}const f=d?.elements?.find(k=>k.name==="w:start")?.attributes["w:val"],h=d?.elements?.find(k=>k.name==="w:numFmt")?.attributes["w:val"],m=d?.elements?.find(k=>k.name==="w:lvlText").attributes["w:val"],y=d?.elements?.find(k=>k.name==="w:lvlJc").attributes["w:val"],g=d?.elements?.find(k=>k.name==="w:pPr"),v=d?.elements?.find(k=>k.name==="w:rPr");return{start:f,numFmt:h,lvlText:m,lvlJc:y,pPr:g,rPr:v}};function D6(t,e,n){if(!t)return;const{attributes:r={}}=t,{paragraphProperties:o={}}=r,{elements:i=[]}=o,s=t.elements.find(b=>b.name==="w:pPr")?.elements?.find(b=>b.name==="w:pStyle")?.attributes["w:val"],a=tc({node:t,styleId:s,docx:n});if(!a)return{};const l=a?.elements.find(b=>b.name==="w:numId")?.attributes["w:val"],c=a?.elements.find(b=>b.name==="w:ilvl")?.attributes["w:val"]||t1(s,n),u=i.find(b=>b.name==="w:pStyle")?.attributes["w:val"],{start:d,numFmt:p,lvlText:f,lvlJc:h,pPr:m,rPr:y}=fl(l,e,u,n);let g,v;m&&(g=N6(m)),y&&(v=I6(y));let k;if(O6.includes(p?.toLowerCase()))k="bulletList";else if($6.includes(p))k="orderedList";else return{};return{listType:k,listOrderingType:p,ilvl:c,numId:l,listrPrs:v,listpPrs:g,start:d,lvlText:f,lvlJc:h}}function _6(t,e){return t?.elements?.find(n=>Number(n.attributes["w:ilvl"])===e)}function N6(t){const{elements:e}=t,n=["w:ind","w:jc","w:tabs"],r={};return e&&e.forEach(o=>{n.includes(o.name);const{attributes:i={}}=o;Object.keys(i).forEach(s=>{r[s]=i[s]})}),r}function I6(t){const{elements:e}=t,n=["w:rFonts","w:b","w:bCs","w:i","w:iCs","w:strike","w:dstrike","w:color","w:sz","w:szCs","w:u","w:bdr","w:shd","w:vertAlign","w:jc","w:spacing","w:w","w:smallCaps","w:position","w:lang"],r={};return e&&e.forEach(o=>{n.includes(o.name);const{attributes:i={}}=o;Object.keys(i).forEach(s=>{r[s]=i[s]})}),r}const n1=t=>{const{nodes:e,docx:n,nodeListHandler:r,filename:o}=t;if(e.length===0||e[0].name!=="w:p")return{nodes:[],consumed:0};const i=Qt(e[0]);let s,a=i1(i.elements);if(i.elements=a,Bd(i,n))return{nodes:[],consumed:0};const l=r.handlerEntities.find(b=>b.handlerName==="standardNodeHandler")?.handler;if(!l)return console.error("Standard node handler not found"),{nodes:[],consumed:0};const c={...t,nodes:[i]},u=l(c);u.nodes.length===1&&(s=u.nodes[0]);const d=i.elements?.find(b=>b.name==="w:pPr"),p=d?.elements?.find(b=>b.name==="w:pStyle"),f=d?.elements?.find(b=>b.name==="w:rPr"),h=d?.elements?.find(b=>b.name==="w:framePr");if(f){let b=si(f,[]);if(!s.content?.length){let C=b?.findIndex(D=>D.type==="highlight");C!==-1&&b.splice(C,1)}s.attrs.marksAttrs=b}let m;if(p&&(m=p.attributes["w:val"],s.attrs.styleId=m),n){const b=F6(i,n,m);s.attrs.indent||(s.attrs.indent={}),(b.left||b.left===0)&&(s.attrs.indent.left=b.left),(b.right||b.right===0)&&(s.attrs.indent.right=b.right),(b.firstLine||b.firstLine===0)&&(s.attrs.indent.firstLine=b.firstLine),(b.hanging||b.hanging===0)&&(s.attrs.indent.hanging=b.hanging),(b.textIndent||b.textIndent===0)&&(s.attrs.textIndent=`${b.textIndent}in`)}const y=d?.elements?.find(b=>b.name==="w:jc");y&&y.attributes&&(s.attrs.textAlign=y.attributes["w:val"]);const g=d?.elements?.find(b=>b.name==="w:keepLines");g&&g.attributes&&(s.attrs.keepLines=g.attributes["w:val"]);const v=d?.elements?.find(b=>b.name==="w:keepNext");if(v&&v.attributes&&(s.attrs.keepNext=v.attributes["w:val"]),n){const b=i.attributes?.["w:rsidRDefault"];s.attrs.spacing=r1(i,n,m,s.attrs.marksAttrs),s.attrs.rsidRDefault=b}h&&h.attributes["w:dropCap"]&&(s.attrs.dropcap={type:h.attributes["w:dropCap"],lines:h.attributes["w:lines"],wrap:h.attributes["w:wrap"],hAnchor:h.attributes["w:hAnchor"],vAnchor:h.attributes["w:vAnchor"]}),s.attrs.filename=o,s&&s.content&&(s={...s,content:Qv(s.content)});const k=d?.elements?.find(b=>b.name==="w:sectPr");return k&&(s.attrs.paragraphProperties||(s.attrs.paragraphProperties={}),s.attrs.paragraphProperties.sectPr=k,s.attrs.pageBreakSource="sectPr"),{nodes:s?[s]:[],consumed:1}},F6=(t,e,n="")=>{const r={left:0,right:0,firstLine:0,hanging:0,textIndent:0},{indent:o={}}=o1(e,n),i=t.elements?.find(d=>d.name==="w:pPr")?.elements?.find(d=>d.name==="w:ind")?.attributes||{},s=i?.["w:left"]||o?.["w:left"],a=i?.["w:right"]||o?.["w:right"],l=i?.["w:firstLine"]||o?.["w:firstLine"],c=i?.["w:hanging"]||o?.["w:hanging"];s&&(r.left=nt(s)),a&&(r.right=nt(a)),l&&(r.firstLine=nt(l)),c&&(r.hanging=nt(c));const u=s-parseInt(c||0)||0;return u&&(r.textIndent=Wt(u)),r},r1=(t,e,n="",r=[])=>{const o={lineSpaceAfter:0,lineSpaceBefore:0,line:0,lineRule:null},{spacing:i={}}=o1(e,n);let s,a,l,c;const u=t.elements?.find(y=>y.name==="w:pPr")?.elements?.find(y=>y.name==="w:spacing")?.attributes||{},d=r.find(y=>y.type==="textStyle")?.attrs?.fontSize,p=u?.["w:line"]||l||i?.["w:line"];p&&(o.line=Jo(p));const f=u?.["w:lineRule"]||c||i?.["w:lineRule"];f&&(o.lineRule=f),f==="exact"&&p&&(o.line=`${Bv(p)}pt`);const h=u?.["w:before"]||a||i?.["w:before"];h&&(o.lineSpaceBefore=nt(h)),u?.["w:beforeAutospacing"]==="1"&&d&&(o.lineSpaceBefore+=Math.round(parseInt(d)*.5*96/72));const m=u?.["w:after"]||s||i?.["w:after"];return m&&(o.lineSpaceAfter=nt(m)),u?.["w:afterAutospacing"]==="1"&&d&&(o.lineSpaceAfter+=Math.round(parseInt(d)*.5*96/72)),o},o1=(t,e="")=>{const n=t["word/styles.xml"];if(!n)return{};const r=(n.elements[0].elements?.find(k=>k.name==="w:docDefaults")).elements.find(k=>k.name==="w:pPrDefault")?.elements?.find(k=>k.name==="w:pPr"),o=r?.elements?.find(k=>k.name==="w:spacing")||{},i=r?.elements?.find(k=>k.name==="w:ind")||{},s=n.elements[0].elements?.find(k=>k.name==="w:style"&&k.attributes["w:styleId"]==="Normal")?.elements?.find(k=>k.name==="w:pPr"),a=s?.elements?.find(k=>k.name==="w:spacing")||{},l=s?.elements?.find(k=>k.name==="w:ind")||{};let c={},u={},d={};if(e){const k=n.elements[0].elements?.find(b=>b.name==="w:style"&&b.attributes["w:styleId"]===e)?.elements?.find(b=>b.name==="w:pPr");c=k?.elements?.find(b=>b.name==="w:spacing")||{},u=k?.elements?.find(b=>b.name==="w:ind")||{},d=k?.elements?.find(b=>b.name==="w:jc")||{}}const{attributes:p}=o,{attributes:f}=a,{attributes:h}=c,{attributes:m}=d,{attributes:y}=i,{attributes:g}=l,{attributes:v}=u;return{spacing:h||p||f,indent:v||y||g,justify:m}},R6={handlerName:"paragraphNodeHandler",handler:n1};function B6(t,e){const n={lineSpaceBefore:null,lineSpaceAfter:null};if(!t)return n;const r=e["word/styles.xml"];if(!r)return n;const{elements:o}=r.elements[0],i=o.filter(ie=>{const{attributes:W}=ie;return W&&W["w:styleId"]===t}),s=i[0];if(!s)return n;const a=i.find(ie=>ie.elements.find(W=>W.name==="w:qFormat")),l=i.find(ie=>ie.elements.some(W=>W.name==="w:name"))?.elements.find(ie=>ie.name==="w:name")?.attributes["w:val"],c=s.elements.find(ie=>ie.name==="w:pPr"),u=c?.elements?.find(ie=>ie.name==="w:spacing"),d=c?.elements?.find(ie=>ie.name==="w:jc"),p=c?.elements?.find(ie=>ie.name==="w:ind");let f,h,m;u&&(f=nt(u?.attributes["w:before"]),h=nt(u?.attributes["w:after"]),m=Jo(u?.attributes["w:line"]));let y,g,v,k;p&&(y=d?.attributes["w:val"],g=nt(p?.attributes["w:left"]),v=nt(p?.attributes["w:right"]),k=nt(p?.attributes["w:firstLine"]));const b=c?.elements?.find(ie=>ie.name==="w:keepNext"),C=c?.elements?.find(ie=>ie.name==="w:keepLines"),D=c?.elements?.find(ie=>ie.name==="w:outlineLvl"),M=D?.attributes["w:val"],I=c?.elements?.find(ie=>ie.name==="w:pageBreakBefore");let E=0;I&&(I.attributes?.["w:val"]?E=Number(I?.attributes?.["w:val"]):E=1);const G=c?.elements?.find(ie=>ie.name==="w:pageBreakAfter");let oe;G&&(G.attributes?.["w:val"]?oe=Number(G?.attributes?.["w:val"]):oe=1);const N={name:l,qFormat:!!a,keepNext:!!b,keepLines:!!C,outlineLevel:D?parseInt(M):null,pageBreakBefore:!!E,pageBreakAfter:!!oe},H=s.elements.find(ie=>ie.name==="w:rPr"),A=si(H,[],e)||{},J={spacing:{lineSpaceAfter:h,lineSpaceBefore:f,line:m},textAlign:y,indent:{leftIndent:g,rightIndent:v,firstLine:k}};return A.forEach(ie=>{const{type:W,attrs:ce}=ie;if(W==="textStyle"){Object.entries(ce).forEach(([X,ue])=>{J[dl(X)]=ue});return}J[W]=ce}),{attrs:N,styles:J}}function i1(t=[]){const e=[];let n=[],r=!1;for(const o of t){const i=o.elements?.find(s=>s.name==="w:fldChar")?.attributes?.["w:fldCharType"];if(i==="begin"){n=[o],r=!0;continue}if(i==="separate"&&r){n.push(o);continue}if(i==="end"&&r){n.push(o),e.push(...L6(n)),n=[],r=!1;continue}r?n.push(o):e.push(o)}return n.length&&e.push(...n),e}const L6=(t=[])=>{let e=[],n=!1,r=!1;const o=t.findIndex(c=>c.elements?.some(u=>u.name==="w:fldChar"&&u.attributes["w:fldCharType"]==="separate")),i=t.findIndex(c=>c.elements?.some(u=>u.name==="w:fldChar"&&u.attributes["w:fldCharType"]==="end")),s=t.slice(o+1,i),a=t.find(c=>c.elements?.some(u=>u.name==="w:instrText"))?.elements?.find(c=>c.name==="w:instrText")?.elements[0].text;n||(n=a?.trim().startsWith("PAGE")),r||(r=a?.trim().startsWith("NUMPAGES"));const l=a?.match(/HYPERLINK\s+"([^"]+)"/);if(n)e.push({name:"sd:autoPageNumber",type:"element"});else if(r)e.push({name:"sd:totalPageNumber",type:"element"});else if(l&&l?.length>=2){const c=l[1],u=[];s.forEach(p=>{const f=p.elements.find(m=>m.name==="w:rPr");if(!f)return;const{elements:h}=f;h.forEach(m=>{u.push(m)})});const d={name:"w:rPr",type:"element",elements:[{name:"link",attributes:{href:c}},...u]};e.push({name:"w:r",type:"element",elements:[d,...s]})}return e},P6=t=>nodeListHandler.handler({...t,nodes:node.elements}),z6=t=>{const{nodes:e}=t;if(e.length===0||e[0].name!=="w:sdt")return{nodes:[],consumed:0};const n=e[0],r=n.elements.find(s=>s.name==="w:sdtPr")?.elements.find(s=>s.name==="w:docPartObj")?.elements.find(s=>s.name==="w:docPartGallery")?.attributes["w:val"];if(!r)return{nodes:[],consumed:0};if(!jg[r])return{nodes:[],consumed:0};const o=n?.elements.find(s=>s.name==="w:sdtContent"),i=jg[r];return{nodes:i({...t,nodes:[o]}),consumed:1}},jg={"Table of Contents":P6},j6=t=>{const{nodes:e,docx:n,nodeListHandler:r,insideTrackChange:o}=t;if(e.length===0||e[0].name!=="w:sdt")return{nodes:[],consumed:0};const i=e[0],s=i.elements.find(M=>M.name==="w:sdtPr"),a=i.elements.find(M=>M.name==="w:sdtContent"),l=s?.elements.find(M=>M.name==="w:fieldTypeShort")?.attributes["w:val"],{attrs:c,marks:u}=s1(a);if(s?.elements.find(M=>M.name==="w:docPartObj"))return z6({nodes:e,docx:n,nodeListHandler:r,insideTrackChange:o});const d=s?.elements.find(M=>M.name==="w:alias"),p=s?.elements.find(M=>M.name==="w:tag"),f=s?.elements.find(M=>M.name==="w:fieldType")?.attributes["w:val"],h=s?.elements.find(M=>M.name==="w:fieldColor")?.attributes["w:val"],m=s?.elements.find(M=>M.name==="w:fieldMultipleImage")?.attributes["w:val"],y=s?.elements.find(M=>M.name==="w:fieldFontFamily")?.attributes["w:val"],g=s?.elements.find(M=>M.name==="w:fieldFontSize")?.attributes["w:val"],v=s?.elements.find(M=>M.name==="w:fieldTextColor")?.attributes["w:val"],k=s?.elements.find(M=>M.name==="w:fieldTextHighlight")?.attributes["w:val"],b={type:l,fieldId:p?.attributes["w:val"],displayLabel:d?.attributes["w:val"],fieldType:f,fieldColor:h,multipleImage:m==="true",fontFamily:y!=="null"?y:null,fontSize:g!=="null"?g:null,textColor:v!=="null"?v:null,textHighlight:k!=="null"?k:null},C={...b,...c};if(!b.fieldId||!b.displayLabel)return{nodes:[],consumed:0};let D={type:"text",text:`{{${b.displayLabel}}}`,attrs:C,marks:u};return t.editor.options.annotations&&(D={type:"fieldAnnotation",attrs:C}),{nodes:[D],consumed:1}},s1=(t={},e)=>{const n=t.elements?.find(s=>s.name==="w:r")?.elements?.find(s=>s.name==="w:rPr");if(!n)return{};const r=si(n,[])||[],o=[];r.forEach(s=>{const{type:a}=s;if(a==="textStyle"){const{attrs:l}=s;Object.keys(l).forEach(c=>{o.push({type:c,attrs:l[c]})})}else o.push(s)});const i={};return o?.forEach(s=>{const{type:a}=s;i[a]=s.attrs||!0}),{attrs:i,marks:r}},q6={handlerName:"annotationNodeHandler",handler:j6},V6=t=>{const{nodes:e,nodeListHandler:n}=t;if(e.length===0||e[0].name!=="w:sdt")return{nodes:[],consumed:0};const r=e[0],o=r.elements.find(a=>a.name==="w:sdtPr"),i=r.elements.find(a=>a.name==="w:sdtContent"),{marks:s}=s1(i);return{nodes:[{type:"structuredContent",content:n.handler({...t,nodes:i?.elements}),marks:s,attrs:{sdtPr:o}}],consumed:1}},U6={handlerName:"sdtNodeHandler",handler:V6},H6=t=>{const{nodes:e,docx:n,nodeListHandler:r}=t;if(!e||e.length===0)return{nodes:[],consumed:0};const o=e[0],{name:i}=o,{attributes:s,elements:a,marks:l=[]}=go(o);if(i==="w:sdt")return{nodes:[],consumed:0};if(h6(o))return{nodes:[{type:Va(o),attrs:{...s},marks:[]}],consumed:0};if(!Va(o))return{nodes:[{type:i,content:a,attrs:{...s},marks:l}],consumed:0,unhandled:!0};const c=[],u=W6(o);if(a&&a.length){const d=a.map(h=>(h.marks||(h.marks=[]),h.marks.push(...l),h)),p={...t,nodes:d,parentStyleId:u},f=r.handler(p);c.push(...f)}return{nodes:[{type:Va(o),content:c,attrs:{...s},marks:[]}],consumed:1}},W6=t=>{const e=t.elements?.find(n=>n.name==="w:pPr")?.elements?.find(n=>n.name==="w:pStyle");return e?e.attributes["w:val"]:null},G6={handlerName:"standardNodeHandler",handler:H6},K6=t=>{const{nodes:e}=t;return e.length===0||e[0].name!=="w:br"?{nodes:[],consumed:0}:{nodes:[{type:e[0].attributes?.["w:type"]==="page"?"hardBreak":"lineBreak"}],consumed:1}},J6={handlerName:"lineBreakNodeHandler",handler:K6},X6=t=>{const{nodes:e,nodeListHandler:n,editor:r}=t;if(e.length===0||e[0].name!=="w:bookmarkStart")return{nodes:[],consumed:0};const o=e[0],i=n.handlerEntities.find(d=>d.handlerName==="standardNodeHandler")?.handler;if(!i)return console.error("Standard node handler not found"),{nodes:[],consumed:0};const s=r?.extensionService?.extensions?.filter(d=>d.isExternal===!0)||[],a=o.attributes["w:name"]?.split(";")[0],l=s.find(d=>d.name===a);if(l){const d=e.findIndex(y=>y.name==="w:bookmarkEnd"&&y.attributes["w:id"]===o.attributes["w:id"]),p=e.slice(1,d),f=t.nodeListHandler,h={};o.attributes["w:name"].split(";").forEach(y=>{const[g,v]=y.split("=");g&&v&&(h[g]=v)});const m=f.handler({...t,nodes:p});return m.forEach(y=>{y.marks.push({type:l.name,attrs:h})}),{nodes:m,consumed:m.length+2}}const c={...t,nodes:[o]},u=i(c);return u.nodes.length===1&&(u.nodes[0].attrs.name=o.attributes["w:name"],u.nodes[0].attrs.id=o.attributes["w:id"]),u},Y6={handlerName:"bookmarkNodeHandler",handler:X6},Z6=t=>{const e={nodes:[],consumed:0},{nodes:n,nodeListHandler:r,parentStyleId:o,docx:i}=t;if(n.length===0||n[0].name!=="w:p")return e;const s=n[0]?.elements?.find(d=>d.name==="w:r");if(!s?.elements?.some(d=>d.name==="mc:AlternateContent"))return e;const a=s.elements.find(d=>d.name==="mc:AlternateContent");s.elements.findIndex(d=>d.name==="mc:AlternateContent");const l=["wps","wp14","w14","w15"],c=a.elements.find(d=>d.name==="mc:Choice"&&l.includes(d.attributes.Requires));if(!c)return e;const u=c.elements;return{nodes:r.handler({...t,nodes:u}),consumed:1}},Q6={handlerName:"alternateChoiceHandler",handler:Z6},eT=t=>{const{nodes:e}=t;return e.length===0||e[0].name!=="sd:autoPageNumber"?{nodes:[],consumed:0}:{nodes:[{type:"page-number"}],consumed:1}},tT={handlerName:"autoPageNumberHandler",handler:eT},nT=t=>{const{nodes:e}=t;return e.length===0||e[0].name!=="sd:totalPageNumber"?{nodes:[],consumed:0}:{nodes:[{type:"total-page-number"}],consumed:1}},rT={handlerName:"autoTotalPageCountEntity",handler:nT},oT=t=>{const{nodes:e,docx:n,parentStyleId:r}=t;if(e.length===0||e[0].name!=="w:tab")return{nodes:[],consumed:0};const o=e[0],i=n["word/styles.xml"];if(i&&i.elements?.length){const a=i.elements[0]?.elements?.find(l=>l.attributes?.["w:styleId"]===r)?.elements?.find(l=>l.name==="w:pPr")?.elements?.find(l=>l.name==="w:tabs")?.elements?.find(l=>l.name==="w:tab");nt(a?.attributes?.["w:pos"])}const{attributes:s={}}=o;return{nodes:[{type:"tab",attrs:{tabSize:s["w:val"]||48},content:[]}],consumed:1}},iT={handlerName:"tabNodeHandler",handler:oT},sT=t=>{const{nodes:e}=t;if(!e.length||e[0].name!=="w:p")return{nodes:[],consumed:0};const[n]=e,r=n.elements?.find(l=>l.name==="w:r")?.elements?.find(l=>l.name==="w:pict");if(!r)return{nodes:[],consumed:0};const o=r,i=o.elements?.find(l=>l.name==="v:shape");o.elements?.find(l=>l.name==="v:shapetype");const s=o.elements?.find(l=>l.name==="v:group");if(!i&&!s)return{nodes:[],consumed:0};let a=null;return s&&!i?a=null:i.elements?.find(l=>l.name==="v:textbox")&&(a=aT({pict:r,pNode:n,shape:i,params:t})),{nodes:a?[a]:[],consumed:1}};function aT({pict:t,pNode:e,shape:n,params:r}){const o={},i={},s=n.attributes||{};o.attributes=s,s.fillcolor&&(o.fillcolor=s.fillcolor);const a=lT(s.style),l=cT(a);l&&(o.style=l);const c=n.elements?.find(p=>p.name==="v:textbox"),u=n.elements?.find(p=>p.name==="w10:wrap");u?.attributes&&(o.wrapAttributes=u.attributes),c?.attributes&&(i.attributes=c.attributes);const d=(c?.elements?.find(p=>p.name==="w:txbxContent")?.elements||[]).map(p=>n1({nodes:[p],docx:r.docx,nodeListHandler:ys()})).reduce((p,f)=>[...p,...f.nodes],[]);return{type:"shapeContainer",attrs:o,content:[{type:"shapeTextbox",attrs:i,content:d}]}}function lT(t){return t?t.split(";").filter(e=>!!e.trim()).reduce((e,n)=>{const[r,o]=n.split(":").map(i=>i.trim());return r&&o&&(e[r]=o),e},{}):{}}function cT(t){const e=["width","height"];let n="";for(const[r,o]of Object.entries(t))e.includes(r)&&(n+=`${r}: ${o};`);return n}const uT={handlerName:"handlePictNode",handler:sT};function dT({docx:t}){const e=ys(),n=t["word/comments.xml"];if(!n)return;const{elements:r}=n;if(!r||!r.length)return;const{elements:o=[]}=r[0],i=o.map(s=>{const{attributes:a}=s,l=a["w:id"],c=a["w:author"],u=a["w:email"],d=a["w:initials"],p=a["w:date"],f=a["custom:internalId"],h=a["custom:trackedChange"]==="true",m=a["custom:trackedChangeType"],y=a["custom:trackedChangeText"]!=="null"?a["custom:trackedChangeText"]:null,g=a["custom:trackedDeletedText"]!=="null"?a["custom:trackedDeletedText"]:null,v=new Date(p).getTime(),{elements:k}=s,b=k[0],{elements:C}=b,D=e.handler({nodes:s.elements,nodeListHandler:e,docx:t}),{attrs:M}=D[0],I=M["w14:paraId"];return{commentId:f||Lr(),importedId:l,creatorName:c,creatorEmail:u,createdTime:v,textJson:D[0],initials:d,paraId:I,trackedChange:h,trackedChangeText:y,trackedChangeType:m,trackedDeletedText:g}});return pT({docx:t,comments:i})}const pT=({docx:t,comments:e})=>{const n=t["word/commentsExtended.xml"];if(!n)return[];const{elements:r}=n,{elements:o}=r[0],i=o.filter(s=>s.name==="w15:commentEx");return e.map(s=>{const a=i.find(d=>d.attributes["w15:paraId"]===s.paraId);if(!a)return{...s};const{isDone:l,paraIdParent:c}=fT(a);let u;return c&&(u=e.find(d=>d.paraId===c)),{...s,isDone:l,parentCommentId:u?.commentId}})},fT=t=>{const{attributes:e}=t,n=e["w15:paraId"],r=e["w15:done"]==="1",o=e["w15:paraIdParent"];return{paraId:n,isDone:r,paraIdParent:o}},hT=(t,e,n)=>{const r=Qt(J4(t));if(!r)return null;if(e?.telemetry){const s=Object.keys(t).map(a=>{const l=a.split("/");return{filePath:a,fileDepth:l.length,fileType:a.split(".").pop()}});e.telemetry.trackFileStructure({totalFiles:s.length,maxDepth:Math.max(...s.map(a=>a.fileDepth)),totalNodes:0,files:s},e.fileSource,e.documentId,e.documentInternalId)}const o=ys(),i=r.elements[0].elements.find(s=>s.name==="w:body");if(i){const s=i,a=["w:sectPr"],l=s.elements?.filter(p=>!a.includes(p.name))??[],c=dT({docx:t}),u={},d={type:"doc",content:o.handler({nodes:l,nodeListHandler:o,docx:t,converter:e,editor:n,lists:u}),attrs:{attributes:r.elements[0].attributes}};return d.content.length>1&&e?.telemetry?.trackUsage("document_import",{documentType:"docx",timestamp:new Date().toISOString()}),{pmDoc:d,savedTagsToRestore:s,pageStyles:gT(s,t,e,n),comments:c,linkedStyles:yT(t),numbering:vT(t)}}return null},ys=()=>{const t=[Q6,x6,uT,R6,T6,S6,J6,q6,U6,Y6,w6,s6,g6,Y4,iT,tT,rT,G6];return{handler:mT(t),handlerEntities:t}},mT=t=>{const e=(r,o,i,s)=>!r||o<0||o>=r.length?{elementIndex:o,error:"index_out_of_bounds",arrayLength:r?.length}:{elementName:r[o]?.name,attributes:i?.attrs,marks:i?.marks,elementPath:s,type:i?.type,content:i?.content},n=({nodes:r,docx:o,insideTrackChange:i,converter:s,editor:a,filename:l,parentStyleId:c,lists:u})=>{if(!r||!r.length)return[];const d=[];try{for(let p=0;p<r.length;p++)try{const f=r.slice(p);if(!f||f.length===0)continue;const{nodes:h,consumed:m,unhandled:y}=t.reduce((v,k)=>v.consumed>0?v:k.handler({nodes:f,docx:o,nodeListHandler:{handler:n,handlerEntities:t},insideTrackChange:i,converter:s,editor:a,filename:l,parentStyleId:c,lists:u}),{nodes:[],consumed:0}),g=e(r,p,h[0],`/word/${l||"document.xml"}`);if(y){if(!g.elementName)continue;s?.telemetry?.trackStatistic("unknown",g);continue}else{s?.telemetry?.trackStatistic("node",g),(g.type==="orderedList"||g.type==="bulletList")&&g.content.forEach(k=>{const b=e([k],0,k,`/word/${l||"document.xml"}`);s?.telemetry?.trackStatistic("attributes",b)});const v=h[0]?.marks?.find(k=>k.type==="highlight");v&&s?.docHiglightColors.add(v.attrs.color.toUpperCase())}m>0&&(p+=m-1),h&&h.forEach(v=>{if(v?.type&&!["runProperties"].includes(v.type)){if(v.type==="text"&&Array.isArray(v.content)&&!v.content.length)return;d.push(v)}})}catch(f){console.debug("Import error",f),a?.emit("exception",{error:f}),s?.telemetry?.trackStatistic("error",{type:"processing_error",message:f.message,name:f.name,stack:f.stack,fileName:`/word/${l||"document.xml"}`})}return d}catch(p){throw console.debug("Error during import",p),a?.emit("exception",{error:p}),s?.telemetry?.trackStatistic("error",{type:"fatal_error",message:p.message,name:p.name,stack:p.stack,fileName:`/word/${l||"document.xml"}`}),p}};return n};function gT(t,e,n,r){const o=t.elements?.find(s=>s.name==="w:sectPr"),i={};return o?.elements?.forEach(s=>{const{name:a,attributes:l}=s;switch(a){case"w:pgSz":i.pageSize={width:Wt(l["w:w"]),height:Wt(l["w:h"])};break;case"w:pgMar":i.pageMargins={top:Wt(l["w:top"]),right:Wt(l["w:right"]),bottom:Wt(l["w:bottom"]),left:Wt(l["w:left"]),header:Wt(l["w:header"]),footer:Wt(l["w:footer"]),gutter:Wt(l["w:gutter"])};break;case"w:cols":i.columns={space:Wt(l["w:space"]),num:l["w:num"],equalWidth:l["w:equalWidth"]};break;case"w:docGrid":i.docGrid={linePitch:Wt(l["w:linePitch"]),type:l["w:type"]};break;case"w:titlePg":n.headerIds.titlePg=!0}}),bT(e,n,r),i.alternateHeaders=xT(e),i}function yT(t){const e=t["word/styles.xml"];if(!e)return[];const{elements:n}=e.elements[0],r=n.filter(i=>i.name==="w:style");n.find(i=>i.name==="w:latentStyles")?.elements.forEach(i=>{const{attributes:s}=i;r.find(a=>a.attributes["w:styleId"]===s["w:name"])});const o=[];return r.forEach(i=>{const s=i.attributes["w:styleId"],a=B6(s,t),l={id:i.attributes["w:styleId"],type:i.attributes["w:type"],definition:a,attributes:{}};o.push(l)}),o}function wT(t){if(!t)return null;const e=Qt(t),{elements:n}=e.elements[0];return Object.keys(Mg).forEach(r=>{if(!n.some(o=>o.attributes?.["w:styleId"]===r)){const o=Mg[r];e.elements[0].elements.push(o)}}),e}const bT=(t,e,n)=>{const r=t["word/_rels/document.xml.rels"].elements.find(u=>u.name==="Relationships"),{elements:o}=r,i="http://schemas.openxmlformats.org/officeDocument/2006/relationships/header",s="http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer",a=o.filter(u=>u.attributes.Type===i),l=o.filter(u=>u.attributes.Type===s),c=(a1(t["word/document.xml"])||[]).flatMap(u=>u.elements);a.forEach(u=>{const{rId:d,referenceFile:p,currentFileName:f}=qg(u,t);let h=c.find(g=>g.name==="w:headerReference"&&g.attributes["r:id"]===d)?.attributes["w:type"];e.headerIds[h]&&(h=null);const m=ys(),y=m.handler({nodes:p.elements[0].elements,nodeListHandler:m,docx:t,converter:e,editor:n,filename:f});e.headerIds.ids||(e.headerIds.ids=[]),e.headerIds.ids.push(d),e.headers[d]={type:"doc",content:[...y]},h&&(e.headerIds[h]=d)}),l.forEach(u=>{const{rId:d,referenceFile:p,currentFileName:f}=qg(u,t),h=c.find(g=>g.name==="w:footerReference"&&g.attributes["r:id"]===d)?.attributes["w:type"],m=ys(),y=m.handler({nodes:p.elements[0].elements,nodeListHandler:m,docx:t,converter:e,editor:n,filename:f});e.footerIds.ids||(e.footerIds.ids=[]),e.footerIds.ids.push(d),e.footers[d]={type:"doc",content:[...y]},e.footerIds[h]=d})},a1=(t,e=[])=>{for(const n in t)t[n]==="w:sectPr"?e.push(t):typeof t[n]=="object"&&a1(t[n],e);return e},qg=(t,e)=>{const n=t.attributes.Id,r=t.attributes.Target,o=e[`word/${r}`];return{rId:n,referenceFile:o,currentFileName:r}};function vT(t){let e=t["word/numbering.xml"];(!e||!e.elements?.length||!e.elements[0].elements?.length)&&(e=Lv);const n=e.elements[0].elements,r=n.filter(a=>a.name==="w:abstractNum"),o=n.filter(a=>a.name==="w:num"),i={};r.forEach(a=>{const l=Number(a.attributes["w:abstractNumId"]);i[l]=a});const s={};return o.forEach(a=>{const l=Number(a.attributes["w:numId"]);s[l]=a}),{abstracts:i,definitions:s}}const xT=t=>{const e=t["word/settings.xml"];if(!e||!e.elements?.length)return!1;const{elements:n=[]}=e.elements[0];return!!n.find(r=>r.name==="w:evenAndOddHeaders")},kT="http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink";var Wr,l1,c1,u1,d1,p1;const Ui=class f1{constructor(e=null){ab(this,Wr),this.debug=e?.debug||!1,this.declaration=null,this.documentAttributes=null,this.convertedXml={},this.docx=e?.docx||[],this.media=e?.media||{},this.fonts=e?.fonts||{},this.addedMedia={},this.comments=[],this.docHiglightColors=new Set([]),this.xml=e?.xml,this.declaration=null,this.numbering={},this.numbering=null,this.pageStyles=null,this.initialJSON=null,this.headers={},this.headerIds={default:null,even:null,odd:null,first:null},this.headerEditors=[],this.footers={},this.footerIds={default:null,even:null,odd:null,first:null},this.footerEditors=[],this.linkedStyles=[],this.json=e?.json,this.tagsNotInSchema=["w:body"],this.savedTagsToRestore=[],this.telemetry=e?.telemetry||null,this.documentInternalId=null,this.fileSource=e?.fileSource||null,this.documentId=e?.documentId||null,(this.docx.length||this.xml)&&this.parseFromXml()}parseFromXml(){this.docx?.forEach(e=>{this.convertedXml[e.name]=this.parseXmlToJson(e.content),e.name==="word/document.xml"&&(this.documentAttributes=this.convertedXml[e.name].elements[0]?.attributes),e.name==="word/styles.xml"&&(this.convertedXml[e.name]=wT(this.convertedXml[e.name]))}),this.initialJSON=this.convertedXml["word/document.xml"],this.initialJSON||(this.initialJSON=this.parseXmlToJson(this.xml)),this.declaration=this.initialJSON?.declaration}parseXmlToJson(e){return JSON.parse(nf.xml2json(e,null,2))}static getStoredSuperdocVersion(e){try{const n=e.find(a=>a.name==="docProps/custom.xml");if(!n)return;const r=new f1,o=n.content,i=r.parseXmlToJson(o).elements.find(a=>a.name==="Properties");if(!i.elements)return;const s=i.elements.find(a=>a.name==="property"&&a.attributes.name==="SuperdocVersion");return s?s.elements[0].elements[0].text:void 0}catch(n){console.warn("Error getting Superdoc version",n);return}}static updateDocumentVersion(e=this.convertedXml,n="0.12.7"){const r="docProps/custom.xml";e[r]||(e[r]=h1());const o=e["docProps/custom.xml"];if(!o)return;const i=o.elements.find(a=>a.name==="Properties");i.elements||(i.elements=[]);const s=i.elements.find(a=>a.name==="property"&&a.attributes.name==="SuperdocVersion");if(s)s.elements[0].elements[0].elements[0].text=n;else{const a=m1();i.elements.push(a)}return e}getDocumentDefaultStyles(){const e=this.convertedXml["word/styles.xml"];if(!e)return{};const n=e.elements[0].elements.find(i=>i.name==="w:docDefaults").elements.find(i=>i.name==="w:rPrDefault");if(!n.elements)return{};const r=n.elements[0].elements,o=r?.find(i=>i.name==="w:rFonts");if("elements"in n){const i=r.find(d=>d.name==="w:rFonts")?.attributes["w:asciiTheme"];let s,a,l;if(i){const d=this.getThemeInfo(i);s=d.typeface,a=d.panose}else o&&(s=o?.attributes["w:ascii"]);(e.elements[0].elements.filter(d=>d.name==="w:style"&&d.attributes["w:styleId"]==="Normal")||[]).forEach(d=>{const p=d.elements.find(f=>f.name==="w:rPr");s=p?.elements?.find(f=>f.name==="w:rFonts")?.attributes["w:ascii"],l=Number(p?.elements?.find(f=>f.name==="w:sz")?.attributes["w:val"])/2});const c=l||Number(r.find(d=>d.name==="w:sz")?.attributes["w:val"])/2||12,u=r.find(d=>d.name==="w:kern")?.attributes["w:val"];return{fontSizePt:c,kern:u,typeface:s,panose:a}}}getDocumentFonts(){const e=this.convertedXml["word/fontTable.xml"];if(!e||!Object.keys(this.fonts).length)return;const n=e.elements.find(s=>s.name==="w:fonts")?.elements.filter(s=>s.elements?.some(a=>a?.attributes&&a.attributes["r:id"]&&a.attributes["w:fontKey"]))?.reduce((s,a)=>{const l=a.elements.filter(c=>c.name.startsWith("w:embed"))?.map(c=>({...c,fontFamily:a.attributes["w:name"]}));return[...s,...l]},[]),r=this.convertedXml["word/_rels/fontTable.xml.rels"]?.elements.find(s=>s.name==="Relationships")||{},{elements:o}=r;let i="";for(const s of n){const a=o.find(y=>y.attributes.Id===s.attributes["r:id"])?.attributes?.Target;if(!a)return;const l=this.fonts[`word/${a}`]?.buffer;if(!l)return;const c=PE(l,s.attributes["w:fontKey"]);if(!c)return;const u=new Blob([c],{type:"font/ttf"}),d=URL.createObjectURL(u),p=s.name.includes("Regular"),f=s.name.includes("Bold"),h=s.name.includes("Italic"),m=s.name.includes("Light");i+=`
31
+ @font-face {
32
+ font-style: ${h?"italic":"normal"};
33
+ font-weight: ${p?"normal":f?"bold":m?"200":"normal"};
34
+ font-display: swap;
35
+ font-family: ${s.fontFamily};
36
+ src: url(${d}) format('truetype');
37
+ }
38
+ `}return i}getDocumentInternalId(){const e="word/settings.xml";this.convertedXml[e]||(this.convertedXml[e]=qE);const n=Object.assign({},this.convertedXml[e]);if(!n.elements[0]?.elements?.length){const o=this.createDocumentIdElement(n);n.elements[0].elements=[o],n.elements[0].attributes["xmlns:w15"]||(n.elements[0].attributes["xmlns:w15"]="http://schemas.microsoft.com/office/word/2012/wordml"),this.convertedXml[e]=n;return}const r=n.elements[0].elements.find(o=>o.name==="w15:docId");this.documentInternalId=r?.attributes["w15:val"]}createDocumentIdElement(){const e=Lr().toUpperCase();return this.documentInternalId=e,{type:"element",name:"w15:docId",attributes:{"w15:val":`{${e}}`}}}getThemeInfo(e){e=e.toLowerCase();const n=this.convertedXml["word/theme/theme1.xml"].elements.find(s=>s.name==="a:theme").elements.find(s=>s.name==="a:themeElements").elements.find(s=>s.name==="a:fontScheme");let r;e.startsWith("major")?r=n.elements.find(s=>s.name==="a:majorFont").elements[0]:e.startsWith("minor")&&(r=n.elements.find(s=>s.name==="a:minorFont").elements[0]);const{typeface:o,panose:i}=r.attributes;return{typeface:o,panose:i}}getSchema(e){this.getDocumentInternalId();const n=hT({...this.convertedXml,media:this.media},this,e);return n?(this.savedTagsToRestore.push({...n.savedTagsToRestore}),this.pageStyles=n.pageStyles,this.numbering=n.numbering,this.comments=n.comments,this.linkedStyles=n.linkedStyles,n.pmDoc):null}schemaToXml(e,n=!1){return new Rg(this).schemaToXml(e,n)}async exportToDocx(e,n,r,o=!1,i,s=[],a){const l=s.map(m=>QE(m)),c=l.map((m,y)=>e4(m,y,l,a)),{result:u,params:d}=this.exportToXmlJson({data:e,editorSchema:n,comments:s,commentDefinitions:c,commentsExportType:i,isFinalDoc:o,editor:a}),p=new Rg(this).schemaToXml(u);await Dn(this,Wr,p1).call(this,{...r,...d.media,...this.media},a);let f={...this.convertedXml},h=[];if(s.length){const{documentXml:m,relationships:y}=Dn(this,Wr,c1).call(this,{defs:d.exportedCommentDefs,exportType:i,commentsWithParaIds:l});f={...m},h=y}return this.convertedXml={...this.convertedXml,...f},Dn(this,Wr,d1).call(this,[...d.relationships,...h]),Dn(this,Wr,u1).call(this,{isFinalDoc:o}),ST(this.convertedXml),Dn(this,Wr,l1).call(this,d),p}exportToXmlJson({data:e,editorSchema:n,comments:r,commentDefinitions:o,commentsExportType:i="clean",isFinalDoc:s=!1,editor:a,isHeaderFooter:l=!1}){const c=this.savedTagsToRestore.find(p=>p.name==="w:body"),[u,d]=ki({node:e,bodyNode:c,relationships:[],documentMedia:{},media:{},isFinalDoc:s,editorSchema:n,converter:this,pageStyles:this.pageStyles,comments:r,commentsExportType:i,exportedCommentDefs:o,editor:a,isHeaderFooter:l});return{result:u,params:d}}};Wr=new WeakSet,l1=function(t){const e="word/numbering.xml";let n=this.convertedXml[e];const r=this.numbering;n||(n=Lv);const o=n.elements[0],i=Object.values(r.abstracts).map(a=>a),s=Object.values(r.definitions).map(a=>a);o.elements=[...i,...s],this.convertedXml[e]=n},c1=function({defs:t,exportType:e,commentsWithParaIds:n}){const{documentXml:r,relationships:o}=a4({exportType:e,convertedXml:this.convertedXml,defs:t,commentsWithParaIds:n,converter:this});return{documentXml:r,relationships:o}},u1=function({isFinalDoc:t=!1}){const e=this.convertedXml["word/_rels/document.xml.rels"].elements.find(n=>n.name==="Relationships");Object.entries(this.headers).forEach(([n,r])=>{const o=e.elements.find(u=>u.attributes.Id===n)?.attributes.Target,i=this.headerEditors.find(u=>u.id===n);if(!i)return;const{result:s,params:a}=this.exportToXmlJson({data:r,editor:i.editor,editorSchema:i.editor.schema,comments:[],commentDefinitions:[],isHeaderFooter:!0,isFinalDoc:t}),l=s.elements[0].elements,c=this.convertedXml[`word/${o}`];if(c.elements[0].elements=l,a.relationships.length){const u=this.convertedXml[`word/_rels/${o}.rels`]?.elements?.find(d=>d.name==="Relationships")?.elements||[];this.convertedXml[`word/_rels/${o}.rels`]={declaration:this.initialJSON?.declaration,elements:[{name:"Relationships",attributes:{xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"},elements:[...u,...a.relationships]}]}}}),Object.entries(this.footers).forEach(([n,r])=>{const o=e.elements.find(u=>u.attributes.Id===n)?.attributes.Target,i=this.footerEditors.find(u=>u.id===n);if(!i)return;const{result:s,params:a}=this.exportToXmlJson({data:r,editor:i.editor,editorSchema:i.editor.schema,comments:[],commentDefinitions:[],isHeaderFooter:!0,isFinalDoc:t}),l=s.elements[0].elements,c=this.convertedXml[`word/${o}`];if(c.elements[0].elements=l,a.relationships.length){const u=this.convertedXml[`word/_rels/${o}.rels`]?.elements?.find(d=>d.name==="Relationships")?.elements||[];this.convertedXml[`word/_rels/${o}.rels`]={declaration:this.initialJSON?.declaration,elements:[{name:"Relationships",attributes:{xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"},elements:[...u,...a.relationships]}]}}})},d1=function(t=[]){const e=this.convertedXml["word/_rels/document.xml.rels"],n=e.elements.find(s=>s.name==="Relationships"),r=[],o=/rId|mi/g;let i=Math.max(...n.elements.map(s=>Number(s.attributes.Id.replace(o,""))));t.forEach(s=>{const a=s.attributes.Id,l=n.elements.find(d=>d.attributes.Target===s.attributes.Target),c=s.attributes.Target?.startsWith("media/")&&a.length>6,u=s.attributes.Type===kT&&a.length>6;l&&!c&&!u||(s.attributes.Target=s.attributes?.Target?.replace(/&/g,"&amp;"),s.attributes.Id=a.length>6?a:`rId${++i}`,r.push(s))}),n.elements=[...n.elements,...r],this.convertedXml["word/_rels/document.xml.rels"]=e},p1=async function(t,e){const n={};for(const r in t){if(typeof t[r]!="string")return;const o=r.split("/").pop();n[o]=await NE(t[r],e.options.isHeadless)}this.convertedXml.media={...this.convertedXml.media,...n},this.media=this.convertedXml.media,this.addedMedia=n},ta(Ui,"allowedElements",Object.freeze({"w:document":"doc","w:body":"body","w:p":"paragraph","w:r":"run","w:t":"text","w:delText":"text","w:br":"lineBreak","w:tbl":"table","w:tr":"tableRow","w:tc":"tableCell","w:drawing":"drawing","w:bookmarkStart":"bookmarkStart","w:sectPr":"sectionProperties","w:rPr":"runProperties","w:commentRangeStart":"commentRangeStart","w:commentRangeEnd":"commentRangeEnd","w:commentReference":"commentReference"})),ta(Ui,"markTypes",[{name:"w:b",type:"bold"},{name:"w:bCs",type:"bold"},{name:"w:i",type:"italic"},{name:"w:iCs",type:"italic"},{name:"w:u",type:"underline",mark:"underline",property:"underlineType"},{name:"w:strike",type:"strike"},{name:"w:color",type:"color",mark:"textStyle",property:"color"},{name:"w:sz",type:"fontSize",mark:"textStyle",property:"fontSize"},{name:"w:szCs",type:"fontSize",mark:"textStyle",property:"fontSize"},{name:"w:rFonts",type:"fontFamily",mark:"textStyle",property:"fontFamily"},{name:"w:jc",type:"textAlign",mark:"textStyle",property:"textAlign"},{name:"w:ind",type:"textIndent",mark:"textStyle",property:"textIndent"},{name:"w:spacing",type:"lineHeight",mark:"textStyle",property:"lineHeight"},{name:"link",type:"link",mark:"link",property:"href"},{name:"w:highlight",type:"highlight",mark:"highlight",property:"color"},{name:"w:shd",type:"highlight",mark:"highlight",property:"color"}]),ta(Ui,"propertyTypes",Object.freeze({"w:pPr":"paragraphProperties","w:rPr":"runProperties","w:sectPr":"sectionProperties","w:numPr":"numberingProperties","w:tcPr":"tableCellProperties"})),ta(Ui,"elements",new Set(["w:document","w:body","w:p","w:r","w:t","w:delText"]));let Nr=Ui;function ST(t){const e="docProps/custom.xml";t[e]||(t[e]=h1());const n=t[e].elements.find(s=>s.name==="Properties");n.elements||(n.elements=[]);const r=n.elements,o=r.filter(s=>typeof s=="object"&&s!==null).filter(s=>{const{attributes:a}=s;return a.name!=="SuperdocVersion"});let i=2;try{i=o.length?Math.max(...r.map(s=>s.attributes.pid))+1:2}catch{}return o.push(m1(i)),n.elements=o,t}function h1(){return jE}function m1(t=2,e="0.12.7"){return{type:"element",name:"property",attributes:{name:"SuperdocVersion",fmtid:"{D5CDD505-2E9C-101B-9397-08002B2CF9AE}",pid:t},elements:[{type:"element",name:"vt:lpwstr",elements:[{type:"text",text:e}]}]}}function la(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 g1={exports:{}};(function(t,e){(function(n){t.exports=n()})(function(){return function n(r,o,i){function s(c,u){if(!o[c]){if(!r[c]){var d=typeof la=="function"&&la;if(!u&&d)return d(c,!0);if(a)return a(c,!0);var p=new Error("Cannot find module '"+c+"'");throw p.code="MODULE_NOT_FOUND",p}var f=o[c]={exports:{}};r[c][0].call(f.exports,function(h){var m=r[c][1][h];return s(m||h)},f,f.exports,n,r,o,i)}return o[c].exports}for(var a=typeof la=="function"&&la,l=0;l<i.length;l++)s(i[l]);return s}({1:[function(n,r,o){var i=n("./utils"),s=n("./support"),a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";o.encode=function(l){for(var c,u,d,p,f,h,m,y=[],g=0,v=l.length,k=v,b=i.getTypeOf(l)!=="string";g<l.length;)k=v-g,d=b?(c=l[g++],u=g<v?l[g++]:0,g<v?l[g++]:0):(c=l.charCodeAt(g++),u=g<v?l.charCodeAt(g++):0,g<v?l.charCodeAt(g++):0),p=c>>2,f=(3&c)<<4|u>>4,h=1<k?(15&u)<<2|d>>6:64,m=2<k?63&d:64,y.push(a.charAt(p)+a.charAt(f)+a.charAt(h)+a.charAt(m));return y.join("")},o.decode=function(l){var c,u,d,p,f,h,m=0,y=0,g="data:";if(l.substr(0,g.length)===g)throw new Error("Invalid base64 input, it looks like a data url.");var v,k=3*(l=l.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(l.charAt(l.length-1)===a.charAt(64)&&k--,l.charAt(l.length-2)===a.charAt(64)&&k--,k%1!=0)throw new Error("Invalid base64 input, bad content length.");for(v=s.uint8array?new Uint8Array(0|k):new Array(0|k);m<l.length;)c=a.indexOf(l.charAt(m++))<<2|(p=a.indexOf(l.charAt(m++)))>>4,u=(15&p)<<4|(f=a.indexOf(l.charAt(m++)))>>2,d=(3&f)<<6|(h=a.indexOf(l.charAt(m++))),v[y++]=c,f!==64&&(v[y++]=u),h!==64&&(v[y++]=d);return v}},{"./support":30,"./utils":32}],2:[function(n,r,o){var i=n("./external"),s=n("./stream/DataWorker"),a=n("./stream/Crc32Probe"),l=n("./stream/DataLengthProbe");function c(u,d,p,f,h){this.compressedSize=u,this.uncompressedSize=d,this.crc32=p,this.compression=f,this.compressedContent=h}c.prototype={getContentWorker:function(){var u=new s(i.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),d=this;return u.on("end",function(){if(this.streamInfo.data_length!==d.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),u},getCompressedWorker:function(){return new s(i.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},c.createWorkerFrom=function(u,d,p){return u.pipe(new a).pipe(new l("uncompressedSize")).pipe(d.compressWorker(p)).pipe(new l("compressedSize")).withStreamInfo("compression",d)},r.exports=c},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(n,r,o){var i=n("./stream/GenericWorker");o.STORE={magic:"\0\0",compressWorker:function(){return new i("STORE compression")},uncompressWorker:function(){return new i("STORE decompression")}},o.DEFLATE=n("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(n,r,o){var i=n("./utils"),s=function(){for(var a,l=[],c=0;c<256;c++){a=c;for(var u=0;u<8;u++)a=1&a?3988292384^a>>>1:a>>>1;l[c]=a}return l}();r.exports=function(a,l){return a!==void 0&&a.length?i.getTypeOf(a)!=="string"?function(c,u,d,p){var f=s,h=p+d;c^=-1;for(var m=p;m<h;m++)c=c>>>8^f[255&(c^u[m])];return-1^c}(0|l,a,a.length,0):function(c,u,d,p){var f=s,h=p+d;c^=-1;for(var m=p;m<h;m++)c=c>>>8^f[255&(c^u.charCodeAt(m))];return-1^c}(0|l,a,a.length,0):0}},{"./utils":32}],5:[function(n,r,o){o.base64=!1,o.binary=!1,o.dir=!1,o.createFolders=!0,o.date=null,o.compression=null,o.compressionOptions=null,o.comment=null,o.unixPermissions=null,o.dosPermissions=null},{}],6:[function(n,r,o){var i=null;i=typeof Promise<"u"?Promise:n("lie"),r.exports={Promise:i}},{lie:37}],7:[function(n,r,o){var i=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",s=n("pako"),a=n("./utils"),l=n("./stream/GenericWorker"),c=i?"uint8array":"array";function u(d,p){l.call(this,"FlateWorker/"+d),this._pako=null,this._pakoAction=d,this._pakoOptions=p,this.meta={}}o.magic="\b\0",a.inherits(u,l),u.prototype.processChunk=function(d){this.meta=d.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(c,d.data),!1)},u.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},u.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},u.prototype._createPako=function(){this._pako=new s[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var d=this;this._pako.onData=function(p){d.push({data:p,meta:d.meta})}},o.compressWorker=function(d){return new u("Deflate",d)},o.uncompressWorker=function(){return new u("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(n,r,o){function i(f,h){var m,y="";for(m=0;m<h;m++)y+=String.fromCharCode(255&f),f>>>=8;return y}function s(f,h,m,y,g,v){var k,b,C=f.file,D=f.compression,M=v!==c.utf8encode,I=a.transformTo("string",v(C.name)),E=a.transformTo("string",c.utf8encode(C.name)),G=C.comment,oe=a.transformTo("string",v(G)),N=a.transformTo("string",c.utf8encode(G)),H=E.length!==C.name.length,A=N.length!==G.length,J="",ie="",W="",ce=C.dir,X=C.date,ue={crc32:0,compressedSize:0,uncompressedSize:0};h&&!m||(ue.crc32=f.crc32,ue.compressedSize=f.compressedSize,ue.uncompressedSize=f.uncompressedSize);var Z=0;h&&(Z|=8),M||!H&&!A||(Z|=2048);var R=0,ee=0;ce&&(R|=16),g==="UNIX"?(ee=798,R|=function(se,Y){var $=se;return se||($=Y?16893:33204),(65535&$)<<16}(C.unixPermissions,ce)):(ee=20,R|=function(se){return 63&(se||0)}(C.dosPermissions)),k=X.getUTCHours(),k<<=6,k|=X.getUTCMinutes(),k<<=5,k|=X.getUTCSeconds()/2,b=X.getUTCFullYear()-1980,b<<=4,b|=X.getUTCMonth()+1,b<<=5,b|=X.getUTCDate(),H&&(ie=i(1,1)+i(u(I),4)+E,J+="up"+i(ie.length,2)+ie),A&&(W=i(1,1)+i(u(oe),4)+N,J+="uc"+i(W.length,2)+W);var ne="";return ne+=`
39
+ \0`,ne+=i(Z,2),ne+=D.magic,ne+=i(k,2),ne+=i(b,2),ne+=i(ue.crc32,4),ne+=i(ue.compressedSize,4),ne+=i(ue.uncompressedSize,4),ne+=i(I.length,2),ne+=i(J.length,2),{fileRecord:d.LOCAL_FILE_HEADER+ne+I+J,dirRecord:d.CENTRAL_FILE_HEADER+i(ee,2)+ne+i(oe.length,2)+"\0\0\0\0"+i(R,4)+i(y,4)+I+J+oe}}var a=n("../utils"),l=n("../stream/GenericWorker"),c=n("../utf8"),u=n("../crc32"),d=n("../signature");function p(f,h,m,y){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=h,this.zipPlatform=m,this.encodeFileName=y,this.streamFiles=f,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(f){var h=f.meta.percent||0,m=this.entriesCount,y=this._sources.length;this.accumulate?this.contentBuffer.push(f):(this.bytesWritten+=f.data.length,l.prototype.push.call(this,{data:f.data,meta:{currentFile:this.currentFile,percent:m?(h+100*(m-y-1))/m:100}}))},p.prototype.openedSource=function(f){this.currentSourceOffset=this.bytesWritten,this.currentFile=f.file.name;var h=this.streamFiles&&!f.file.dir;if(h){var m=s(f,h,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:m.fileRecord,meta:{percent:0}})}else this.accumulate=!0},p.prototype.closedSource=function(f){this.accumulate=!1;var h=this.streamFiles&&!f.file.dir,m=s(f,h,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(m.dirRecord),h)this.push({data:function(y){return d.DATA_DESCRIPTOR+i(y.crc32,4)+i(y.compressedSize,4)+i(y.uncompressedSize,4)}(f),meta:{percent:100}});else for(this.push({data:m.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},p.prototype.flush=function(){for(var f=this.bytesWritten,h=0;h<this.dirRecords.length;h++)this.push({data:this.dirRecords[h],meta:{percent:100}});var m=this.bytesWritten-f,y=function(g,v,k,b,C){var D=a.transformTo("string",C(b));return d.CENTRAL_DIRECTORY_END+"\0\0\0\0"+i(g,2)+i(g,2)+i(v,4)+i(k,4)+i(D.length,2)+D}(this.dirRecords.length,m,f,this.zipComment,this.encodeFileName);this.push({data:y,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(f){this._sources.push(f);var h=this;return f.on("data",function(m){h.processChunk(m)}),f.on("end",function(){h.closedSource(h.previous.streamInfo),h._sources.length?h.prepareNextSource():h.end()}),f.on("error",function(m){h.error(m)}),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(f){var h=this._sources;if(!l.prototype.error.call(this,f))return!1;for(var m=0;m<h.length;m++)try{h[m].error(f)}catch{}return!0},p.prototype.lock=function(){l.prototype.lock.call(this);for(var f=this._sources,h=0;h<f.length;h++)f[h].lock()},r.exports=p},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(n,r,o){var i=n("../compressions"),s=n("./ZipFileWorker");o.generateWorker=function(a,l,c){var u=new s(l.streamFiles,c,l.platform,l.encodeFileName),d=0;try{a.forEach(function(p,f){d++;var h=function(v,k){var b=v||k,C=i[b];if(!C)throw new Error(b+" is not a valid compression method !");return C}(f.options.compression,l.compression),m=f.options.compressionOptions||l.compressionOptions||{},y=f.dir,g=f.date;f._compressWorker(h,m).withStreamInfo("file",{name:p,dir:y,date:g,comment:f.comment||"",unixPermissions:f.unixPermissions,dosPermissions:f.dosPermissions}).pipe(u)}),u.entriesCount=d}catch(p){u.error(p)}return u}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(n,r,o){function i(){if(!(this instanceof i))return new i;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 i;for(var a in this)typeof this[a]!="function"&&(s[a]=this[a]);return s}}(i.prototype=n("./object")).loadAsync=n("./load"),i.support=n("./support"),i.defaults=n("./defaults"),i.version="3.10.1",i.loadAsync=function(s,a){return new i().loadAsync(s,a)},i.external=n("./external"),r.exports=i},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(n,r,o){var i=n("./utils"),s=n("./external"),a=n("./utf8"),l=n("./zipEntries"),c=n("./stream/Crc32Probe"),u=n("./nodejsUtils");function d(p){return new s.Promise(function(f,h){var m=p.decompressed.getContentWorker().pipe(new c);m.on("error",function(y){h(y)}).on("end",function(){m.streamInfo.crc32!==p.decompressed.crc32?h(new Error("Corrupted zip : CRC32 mismatch")):f()}).resume()})}r.exports=function(p,f){var h=this;return f=i.extend(f||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:a.utf8decode}),u.isNode&&u.isStream(p)?s.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):i.prepareContent("the loaded zip file",p,!0,f.optimizedBinaryString,f.base64).then(function(m){var y=new l(f);return y.load(m),y}).then(function(m){var y=[s.Promise.resolve(m)],g=m.files;if(f.checkCRC32)for(var v=0;v<g.length;v++)y.push(d(g[v]));return s.Promise.all(y)}).then(function(m){for(var y=m.shift(),g=y.files,v=0;v<g.length;v++){var k=g[v],b=k.fileNameStr,C=i.resolve(k.fileNameStr);h.file(C,k.decompressed,{binary:!0,optimizedBinaryString:!0,date:k.date,dir:k.dir,comment:k.fileCommentStr.length?k.fileCommentStr:null,unixPermissions:k.unixPermissions,dosPermissions:k.dosPermissions,createFolders:f.createFolders}),k.dir||(h.file(C).unsafeOriginalName=b)}return y.zipComment.length&&(h.comment=y.zipComment),h})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(n,r,o){var i=n("../utils"),s=n("../stream/GenericWorker");function a(l,c){s.call(this,"Nodejs stream input adapter for "+l),this._upstreamEnded=!1,this._bindStream(c)}i.inherits(a,s),a.prototype._bindStream=function(l){var c=this;(this._stream=l).pause(),l.on("data",function(u){c.push({data:u,meta:{percent:0}})}).on("error",function(u){c.isPaused?this.generatedError=u:c.error(u)}).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)},r.exports=a},{"../stream/GenericWorker":28,"../utils":32}],13:[function(n,r,o){var i=n("readable-stream").Readable;function s(a,l,c){i.call(this,l),this._helper=a;var u=this;a.on("data",function(d,p){u.push(d)||u._helper.pause(),c&&c(p)}).on("error",function(d){u.emit("error",d)}).on("end",function(){u.push(null)})}n("../utils").inherits(s,i),s.prototype._read=function(){this._helper.resume()},r.exports=s},{"../utils":32,"readable-stream":16}],14:[function(n,r,o){r.exports={isNode:typeof mt<"u",newBufferFrom:function(i,s){if(mt.from&&mt.from!==Uint8Array.from)return mt.from(i,s);if(typeof i=="number")throw new Error('The "data" argument must not be a number');return new mt(i,s)},allocBuffer:function(i){if(mt.alloc)return mt.alloc(i);var s=new mt(i);return s.fill(0),s},isBuffer:function(i){return mt.isBuffer(i)},isStream:function(i){return i&&typeof i.on=="function"&&typeof i.pause=="function"&&typeof i.resume=="function"}}},{}],15:[function(n,r,o){function i(C,D,M){var I,E=a.getTypeOf(D),G=a.extend(M||{},u);G.date=G.date||new Date,G.compression!==null&&(G.compression=G.compression.toUpperCase()),typeof G.unixPermissions=="string"&&(G.unixPermissions=parseInt(G.unixPermissions,8)),G.unixPermissions&&16384&G.unixPermissions&&(G.dir=!0),G.dosPermissions&&16&G.dosPermissions&&(G.dir=!0),G.dir&&(C=g(C)),G.createFolders&&(I=y(C))&&v.call(this,I,!0);var oe=E==="string"&&G.binary===!1&&G.base64===!1;M&&M.binary!==void 0||(G.binary=!oe),(D instanceof d&&D.uncompressedSize===0||G.dir||!D||D.length===0)&&(G.base64=!1,G.binary=!0,D="",G.compression="STORE",E="string");var N=null;N=D instanceof d||D instanceof l?D:h.isNode&&h.isStream(D)?new m(C,D):a.prepareContent(C,D,G.binary,G.optimizedBinaryString,G.base64);var H=new p(C,N,G);this.files[C]=H}var s=n("./utf8"),a=n("./utils"),l=n("./stream/GenericWorker"),c=n("./stream/StreamHelper"),u=n("./defaults"),d=n("./compressedObject"),p=n("./zipObject"),f=n("./generate"),h=n("./nodejsUtils"),m=n("./nodejs/NodejsStreamInputAdapter"),y=function(C){C.slice(-1)==="/"&&(C=C.substring(0,C.length-1));var D=C.lastIndexOf("/");return 0<D?C.substring(0,D):""},g=function(C){return C.slice(-1)!=="/"&&(C+="/"),C},v=function(C,D){return D=D!==void 0?D:u.createFolders,C=g(C),this.files[C]||i.call(this,C,null,{dir:!0,createFolders:D}),this.files[C]};function k(C){return Object.prototype.toString.call(C)==="[object RegExp]"}var b={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(C){var D,M,I;for(D in this.files)I=this.files[D],(M=D.slice(this.root.length,D.length))&&D.slice(0,this.root.length)===this.root&&C(M,I)},filter:function(C){var D=[];return this.forEach(function(M,I){C(M,I)&&D.push(I)}),D},file:function(C,D,M){if(arguments.length!==1)return C=this.root+C,i.call(this,C,D,M),this;if(k(C)){var I=C;return this.filter(function(G,oe){return!oe.dir&&I.test(G)})}var E=this.files[this.root+C];return E&&!E.dir?E:null},folder:function(C){if(!C)return this;if(k(C))return this.filter(function(E,G){return G.dir&&C.test(E)});var D=this.root+C,M=v.call(this,D),I=this.clone();return I.root=M.name,I},remove:function(C){C=this.root+C;var D=this.files[C];if(D||(C.slice(-1)!=="/"&&(C+="/"),D=this.files[C]),D&&!D.dir)delete this.files[C];else for(var M=this.filter(function(E,G){return G.name.slice(0,C.length)===C}),I=0;I<M.length;I++)delete this.files[M[I].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(C){var D,M={};try{if((M=a.extend(C||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:s.utf8encode})).type=M.type.toLowerCase(),M.compression=M.compression.toUpperCase(),M.type==="binarystring"&&(M.type="string"),!M.type)throw new Error("No output type specified.");a.checkSupport(M.type),M.platform!=="darwin"&&M.platform!=="freebsd"&&M.platform!=="linux"&&M.platform!=="sunos"||(M.platform="UNIX"),M.platform==="win32"&&(M.platform="DOS");var I=M.comment||this.comment||"";D=f.generateWorker(this,M,I)}catch(E){(D=new l("error")).error(E)}return new c(D,M.type||"string",M.mimeType)},generateAsync:function(C,D){return this.generateInternalStream(C).accumulate(D)},generateNodeStream:function(C,D){return(C=C||{}).type||(C.type="nodebuffer"),this.generateInternalStream(C).toNodejsStream(D)}};r.exports=b},{"./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(n,r,o){r.exports=n("stream")},{stream:void 0}],17:[function(n,r,o){var i=n("./DataReader");function s(a){i.call(this,a);for(var l=0;l<this.data.length;l++)a[l]=255&a[l]}n("../utils").inherits(s,i),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),u=a.charCodeAt(2),d=a.charCodeAt(3),p=this.length-4;0<=p;--p)if(this.data[p]===l&&this.data[p+1]===c&&this.data[p+2]===u&&this.data[p+3]===d)return p-this.zero;return-1},s.prototype.readAndCheckSignature=function(a){var l=a.charCodeAt(0),c=a.charCodeAt(1),u=a.charCodeAt(2),d=a.charCodeAt(3),p=this.readData(4);return l===p[0]&&c===p[1]&&u===p[2]&&d===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},r.exports=s},{"../utils":32,"./DataReader":18}],18:[function(n,r,o){var i=n("../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 i.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))}},r.exports=s},{"../utils":32}],19:[function(n,r,o){var i=n("./Uint8ArrayReader");function s(a){i.call(this,a)}n("../utils").inherits(s,i),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},r.exports=s},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(n,r,o){var i=n("./DataReader");function s(a){i.call(this,a)}n("../utils").inherits(s,i),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},r.exports=s},{"../utils":32,"./DataReader":18}],21:[function(n,r,o){var i=n("./ArrayReader");function s(a){i.call(this,a)}n("../utils").inherits(s,i),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},r.exports=s},{"../utils":32,"./ArrayReader":17}],22:[function(n,r,o){var i=n("../utils"),s=n("../support"),a=n("./ArrayReader"),l=n("./StringReader"),c=n("./NodeBufferReader"),u=n("./Uint8ArrayReader");r.exports=function(d){var p=i.getTypeOf(d);return i.checkSupport(p),p!=="string"||s.uint8array?p==="nodebuffer"?new c(d):s.uint8array?new u(i.transformTo("uint8array",d)):new a(i.transformTo("array",d)):new l(d)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(n,r,o){o.LOCAL_FILE_HEADER="PK",o.CENTRAL_FILE_HEADER="PK",o.CENTRAL_DIRECTORY_END="PK",o.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",o.ZIP64_CENTRAL_DIRECTORY_END="PK",o.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(n,r,o){var i=n("./GenericWorker"),s=n("../utils");function a(l){i.call(this,"ConvertWorker to "+l),this.destType=l}s.inherits(a,i),a.prototype.processChunk=function(l){this.push({data:s.transformTo(this.destType,l.data),meta:l.meta})},r.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(n,r,o){var i=n("./GenericWorker"),s=n("../crc32");function a(){i.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}n("../utils").inherits(a,i),a.prototype.processChunk=function(l){this.streamInfo.crc32=s(l.data,this.streamInfo.crc32||0),this.push(l)},r.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(n,r,o){var i=n("../utils"),s=n("./GenericWorker");function a(l){s.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}i.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)},r.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(n,r,o){var i=n("../utils"),s=n("./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(u){c.dataIsReady=!0,c.data=u,c.max=u&&u.length||0,c.type=i.getTypeOf(u),c.isPaused||c._tickAndRepeat()},function(u){c.error(u)})}i.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,i.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(i.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}})},r.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(n,r,o){function i(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}i.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}},r.exports=i},{}],29:[function(n,r,o){var i=n("../utils"),s=n("./ConvertWorker"),a=n("./GenericWorker"),l=n("../base64"),c=n("../support"),u=n("../external"),d=null;if(c.nodestream)try{d=n("../nodejs/NodejsStreamOutputAdapter")}catch{}function p(h,m){return new u.Promise(function(y,g){var v=[],k=h._internalType,b=h._outputType,C=h._mimeType;h.on("data",function(D,M){v.push(D),m&&m(M)}).on("error",function(D){v=[],g(D)}).on("end",function(){try{var D=function(M,I,E){switch(M){case"blob":return i.newBlob(i.transformTo("arraybuffer",I),E);case"base64":return l.encode(I);default:return i.transformTo(M,I)}}(b,function(M,I){var E,G=0,oe=null,N=0;for(E=0;E<I.length;E++)N+=I[E].length;switch(M){case"string":return I.join("");case"array":return Array.prototype.concat.apply([],I);case"uint8array":for(oe=new Uint8Array(N),E=0;E<I.length;E++)oe.set(I[E],G),G+=I[E].length;return oe;case"nodebuffer":return mt.concat(I);default:throw new Error("concat : unsupported type '"+M+"'")}}(k,v),C);y(D)}catch(M){g(M)}v=[]}).resume()})}function f(h,m,y){var g=m;switch(m){case"blob":case"arraybuffer":g="uint8array";break;case"base64":g="string"}try{this._internalType=g,this._outputType=m,this._mimeType=y,i.checkSupport(g),this._worker=h.pipe(new s(g)),h.lock()}catch(v){this._worker=new a("error"),this._worker.error(v)}}f.prototype={accumulate:function(h){return p(this,h)},on:function(h,m){var y=this;return h==="data"?this._worker.on(h,function(g){m.call(y,g.data,g.meta)}):this._worker.on(h,function(){i.delay(m,arguments,y)}),this},resume:function(){return i.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(h){if(i.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new d(this,{objectMode:this._outputType!=="nodebuffer"},h)}},r.exports=f},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(n,r,o){if(o.base64=!0,o.array=!0,o.string=!0,o.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",o.nodebuffer=typeof mt<"u",o.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")o.blob=!1;else{var i=new ArrayBuffer(0);try{o.blob=new Blob([i],{type:"application/zip"}).size===0}catch{try{var s=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);s.append(i),o.blob=s.getBlob("application/zip").size===0}catch{o.blob=!1}}}try{o.nodestream=!!n("readable-stream").Readable}catch{o.nodestream=!1}},{"readable-stream":16}],31:[function(n,r,o){for(var i=n("./utils"),s=n("./support"),a=n("./nodejsUtils"),l=n("./stream/GenericWorker"),c=new Array(256),u=0;u<256;u++)c[u]=252<=u?6:248<=u?5:240<=u?4:224<=u?3:192<=u?2:1;c[254]=c[254]=1;function d(){l.call(this,"utf-8 decode"),this.leftOver=null}function p(){l.call(this,"utf-8 encode")}o.utf8encode=function(f){return s.nodebuffer?a.newBufferFrom(f,"utf-8"):function(h){var m,y,g,v,k,b=h.length,C=0;for(v=0;v<b;v++)(64512&(y=h.charCodeAt(v)))==55296&&v+1<b&&(64512&(g=h.charCodeAt(v+1)))==56320&&(y=65536+(y-55296<<10)+(g-56320),v++),C+=y<128?1:y<2048?2:y<65536?3:4;for(m=s.uint8array?new Uint8Array(C):new Array(C),v=k=0;k<C;v++)(64512&(y=h.charCodeAt(v)))==55296&&v+1<b&&(64512&(g=h.charCodeAt(v+1)))==56320&&(y=65536+(y-55296<<10)+(g-56320),v++),y<128?m[k++]=y:(y<2048?m[k++]=192|y>>>6:(y<65536?m[k++]=224|y>>>12:(m[k++]=240|y>>>18,m[k++]=128|y>>>12&63),m[k++]=128|y>>>6&63),m[k++]=128|63&y);return m}(f)},o.utf8decode=function(f){return s.nodebuffer?i.transformTo("nodebuffer",f).toString("utf-8"):function(h){var m,y,g,v,k=h.length,b=new Array(2*k);for(m=y=0;m<k;)if((g=h[m++])<128)b[y++]=g;else if(4<(v=c[g]))b[y++]=65533,m+=v-1;else{for(g&=v===2?31:v===3?15:7;1<v&&m<k;)g=g<<6|63&h[m++],v--;1<v?b[y++]=65533:g<65536?b[y++]=g:(g-=65536,b[y++]=55296|g>>10&1023,b[y++]=56320|1023&g)}return b.length!==y&&(b.subarray?b=b.subarray(0,y):b.length=y),i.applyFromCharCode(b)}(f=i.transformTo(s.uint8array?"uint8array":"array",f))},i.inherits(d,l),d.prototype.processChunk=function(f){var h=i.transformTo(s.uint8array?"uint8array":"array",f.data);if(this.leftOver&&this.leftOver.length){if(s.uint8array){var m=h;(h=new Uint8Array(m.length+this.leftOver.length)).set(this.leftOver,0),h.set(m,this.leftOver.length)}else h=this.leftOver.concat(h);this.leftOver=null}var y=function(v,k){var b;for((k=k||v.length)>v.length&&(k=v.length),b=k-1;0<=b&&(192&v[b])==128;)b--;return b<0||b===0?k:b+c[v[b]]>k?b:k}(h),g=h;y!==h.length&&(s.uint8array?(g=h.subarray(0,y),this.leftOver=h.subarray(y,h.length)):(g=h.slice(0,y),this.leftOver=h.slice(y,h.length))),this.push({data:o.utf8decode(g),meta:f.meta})},d.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:o.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},o.Utf8DecodeWorker=d,i.inherits(p,l),p.prototype.processChunk=function(f){this.push({data:o.utf8encode(f.data),meta:f.meta})},o.Utf8EncodeWorker=p},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(n,r,o){var i=n("./support"),s=n("./base64"),a=n("./nodejsUtils"),l=n("./external");function c(m){return m}function u(m,y){for(var g=0;g<m.length;++g)y[g]=255&m.charCodeAt(g);return y}n("setimmediate"),o.newBlob=function(m,y){o.checkSupport("blob");try{return new Blob([m],{type:y})}catch{try{var g=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return g.append(m),g.getBlob(y)}catch{throw new Error("Bug : can't construct the Blob.")}}};var d={stringifyByChunk:function(m,y,g){var v=[],k=0,b=m.length;if(b<=g)return String.fromCharCode.apply(null,m);for(;k<b;)y==="array"||y==="nodebuffer"?v.push(String.fromCharCode.apply(null,m.slice(k,Math.min(k+g,b)))):v.push(String.fromCharCode.apply(null,m.subarray(k,Math.min(k+g,b)))),k+=g;return v.join("")},stringifyByChar:function(m){for(var y="",g=0;g<m.length;g++)y+=String.fromCharCode(m[g]);return y},applyCanBeUsed:{uint8array:function(){try{return i.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}}(),nodebuffer:function(){try{return i.nodebuffer&&String.fromCharCode.apply(null,a.allocBuffer(1)).length===1}catch{return!1}}()}};function p(m){var y=65536,g=o.getTypeOf(m),v=!0;if(g==="uint8array"?v=d.applyCanBeUsed.uint8array:g==="nodebuffer"&&(v=d.applyCanBeUsed.nodebuffer),v)for(;1<y;)try{return d.stringifyByChunk(m,g,y)}catch{y=Math.floor(y/2)}return d.stringifyByChar(m)}function f(m,y){for(var g=0;g<m.length;g++)y[g]=m[g];return y}o.applyFromCharCode=p;var h={};h.string={string:c,array:function(m){return u(m,new Array(m.length))},arraybuffer:function(m){return h.string.uint8array(m).buffer},uint8array:function(m){return u(m,new Uint8Array(m.length))},nodebuffer:function(m){return u(m,a.allocBuffer(m.length))}},h.array={string:p,array:c,arraybuffer:function(m){return new Uint8Array(m).buffer},uint8array:function(m){return new Uint8Array(m)},nodebuffer:function(m){return a.newBufferFrom(m)}},h.arraybuffer={string:function(m){return p(new Uint8Array(m))},array:function(m){return f(new Uint8Array(m),new Array(m.byteLength))},arraybuffer:c,uint8array:function(m){return new Uint8Array(m)},nodebuffer:function(m){return a.newBufferFrom(new Uint8Array(m))}},h.uint8array={string:p,array:function(m){return f(m,new Array(m.length))},arraybuffer:function(m){return m.buffer},uint8array:c,nodebuffer:function(m){return a.newBufferFrom(m)}},h.nodebuffer={string:p,array:function(m){return f(m,new Array(m.length))},arraybuffer:function(m){return h.nodebuffer.uint8array(m).buffer},uint8array:function(m){return f(m,new Uint8Array(m.length))},nodebuffer:c},o.transformTo=function(m,y){if(y=y||"",!m)return y;o.checkSupport(m);var g=o.getTypeOf(y);return h[g][m](y)},o.resolve=function(m){for(var y=m.split("/"),g=[],v=0;v<y.length;v++){var k=y[v];k==="."||k===""&&v!==0&&v!==y.length-1||(k===".."?g.pop():g.push(k))}return g.join("/")},o.getTypeOf=function(m){return typeof m=="string"?"string":Object.prototype.toString.call(m)==="[object Array]"?"array":i.nodebuffer&&a.isBuffer(m)?"nodebuffer":i.uint8array&&m instanceof Uint8Array?"uint8array":i.arraybuffer&&m instanceof ArrayBuffer?"arraybuffer":void 0},o.checkSupport=function(m){if(!i[m.toLowerCase()])throw new Error(m+" is not supported by this platform")},o.MAX_VALUE_16BITS=65535,o.MAX_VALUE_32BITS=-1,o.pretty=function(m){var y,g,v="";for(g=0;g<(m||"").length;g++)v+="\\x"+((y=m.charCodeAt(g))<16?"0":"")+y.toString(16).toUpperCase();return v},o.delay=function(m,y,g){setImmediate(function(){m.apply(g||null,y||[])})},o.inherits=function(m,y){function g(){}g.prototype=y.prototype,m.prototype=new g},o.extend=function(){var m,y,g={};for(m=0;m<arguments.length;m++)for(y in arguments[m])Object.prototype.hasOwnProperty.call(arguments[m],y)&&g[y]===void 0&&(g[y]=arguments[m][y]);return g},o.prepareContent=function(m,y,g,v,k){return l.Promise.resolve(y).then(function(b){return i.blob&&(b instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(b))!==-1)&&typeof FileReader<"u"?new l.Promise(function(C,D){var M=new FileReader;M.onload=function(I){C(I.target.result)},M.onerror=function(I){D(I.target.error)},M.readAsArrayBuffer(b)}):b}).then(function(b){var C=o.getTypeOf(b);return C?(C==="arraybuffer"?b=o.transformTo("uint8array",b):C==="string"&&(k?b=s.decode(b):g&&v!==!0&&(b=function(D){return u(D,i.uint8array?new Uint8Array(D.length):new Array(D.length))}(b))),b):l.Promise.reject(new Error("Can't read the data of '"+m+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(n,r,o){var i=n("./reader/readerFor"),s=n("./utils"),a=n("./signature"),l=n("./zipEntry"),c=n("./support");function u(d){this.files=[],this.loadOptions=d}u.prototype={checkSignature:function(d){if(!this.reader.readAndCheckSignature(d)){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(d)+")")}},isSignature:function(d,p){var f=this.reader.index;this.reader.setIndex(d);var h=this.reader.readString(4)===p;return this.reader.setIndex(f),h},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 d=this.reader.readData(this.zipCommentLength),p=c.uint8array?"uint8array":"array",f=s.transformTo(p,d);this.zipComment=this.loadOptions.decodeFileName(f)},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 d,p,f,h=this.zip64EndOfCentralSize-44;0<h;)d=this.reader.readInt(2),p=this.reader.readInt(4),f=this.reader.readData(p),this.zip64ExtensibleData[d]={id:d,length:p,value:f}},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 d,p;for(d=0;d<this.files.length;d++)p=this.files[d],this.reader.setIndex(p.localHeaderOffset),this.checkSignature(a.LOCAL_FILE_HEADER),p.readLocalPart(this.reader),p.handleUTF8(),p.processAttributes()},readCentralDir:function(){var d;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(a.CENTRAL_FILE_HEADER);)(d=new l({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(d);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 d=this.reader.lastIndexOfSignature(a.CENTRAL_DIRECTORY_END);if(d<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(d);var p=d;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,(d=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(d),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 f=this.centralDirOffset+this.centralDirSize;this.zip64&&(f+=20,f+=12+this.zip64EndOfCentralSize);var h=p-f;if(0<h)this.isSignature(p,a.CENTRAL_FILE_HEADER)||(this.reader.zero=h);else if(h<0)throw new Error("Corrupted zip: missing "+Math.abs(h)+" bytes.")},prepareReader:function(d){this.reader=i(d)},load:function(d){this.prepareReader(d),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},r.exports=u},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(n,r,o){var i=n("./reader/readerFor"),s=n("./utils"),a=n("./compressedObject"),l=n("./crc32"),c=n("./utf8"),u=n("./compressions"),d=n("./support");function p(f,h){this.options=f,this.loadOptions=h}p.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(f){var h,m;if(f.skip(22),this.fileNameLength=f.readInt(2),m=f.readInt(2),this.fileName=f.readData(this.fileNameLength),f.skip(m),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((h=function(y){for(var g in u)if(Object.prototype.hasOwnProperty.call(u,g)&&u[g].magic===y)return u[g];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,h,f.readData(this.compressedSize))},readCentralPart:function(f){this.versionMadeBy=f.readInt(2),f.skip(2),this.bitFlag=f.readInt(2),this.compressionMethod=f.readString(2),this.date=f.readDate(),this.crc32=f.readInt(4),this.compressedSize=f.readInt(4),this.uncompressedSize=f.readInt(4);var h=f.readInt(2);if(this.extraFieldsLength=f.readInt(2),this.fileCommentLength=f.readInt(2),this.diskNumberStart=f.readInt(2),this.internalFileAttributes=f.readInt(2),this.externalFileAttributes=f.readInt(4),this.localHeaderOffset=f.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");f.skip(h),this.readExtraFields(f),this.parseZIP64ExtraField(f),this.fileComment=f.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var f=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),f==0&&(this.dosPermissions=63&this.externalFileAttributes),f==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var f=i(this.extraFields[1].value);this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=f.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=f.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=f.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=f.readInt(4))}},readExtraFields:function(f){var h,m,y,g=f.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});f.index+4<g;)h=f.readInt(2),m=f.readInt(2),y=f.readData(m),this.extraFields[h]={id:h,length:m,value:y};f.setIndex(g)},handleUTF8:function(){var f=d.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=c.utf8decode(this.fileName),this.fileCommentStr=c.utf8decode(this.fileComment);else{var h=this.findExtraFieldUnicodePath();if(h!==null)this.fileNameStr=h;else{var m=s.transformTo(f,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(m)}var y=this.findExtraFieldUnicodeComment();if(y!==null)this.fileCommentStr=y;else{var g=s.transformTo(f,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(g)}}},findExtraFieldUnicodePath:function(){var f=this.extraFields[28789];if(f){var h=i(f.value);return h.readInt(1)!==1||l(this.fileName)!==h.readInt(4)?null:c.utf8decode(h.readData(f.length-5))}return null},findExtraFieldUnicodeComment:function(){var f=this.extraFields[25461];if(f){var h=i(f.value);return h.readInt(1)!==1||l(this.fileComment)!==h.readInt(4)?null:c.utf8decode(h.readData(f.length-5))}return null}},r.exports=p},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(n,r,o){function i(h,m,y){this.name=h,this.dir=y.dir,this.date=y.date,this.comment=y.comment,this.unixPermissions=y.unixPermissions,this.dosPermissions=y.dosPermissions,this._data=m,this._dataBinary=y.binary,this.options={compression:y.compression,compressionOptions:y.compressionOptions}}var s=n("./stream/StreamHelper"),a=n("./stream/DataWorker"),l=n("./utf8"),c=n("./compressedObject"),u=n("./stream/GenericWorker");i.prototype={internalStream:function(h){var m=null,y="string";try{if(!h)throw new Error("No output type specified.");var g=(y=h.toLowerCase())==="string"||y==="text";y!=="binarystring"&&y!=="text"||(y="string"),m=this._decompressWorker();var v=!this._dataBinary;v&&!g&&(m=m.pipe(new l.Utf8EncodeWorker)),!v&&g&&(m=m.pipe(new l.Utf8DecodeWorker))}catch(k){(m=new u("error")).error(k)}return new s(m,y,"")},async:function(h,m){return this.internalStream(h).accumulate(m)},nodeStream:function(h,m){return this.internalStream(h||"nodebuffer").toNodejsStream(m)},_compressWorker:function(h,m){if(this._data instanceof c&&this._data.compression.magic===h.magic)return this._data.getCompressedWorker();var y=this._decompressWorker();return this._dataBinary||(y=y.pipe(new l.Utf8EncodeWorker)),c.createWorkerFrom(y,h,m)},_decompressWorker:function(){return this._data instanceof c?this._data.getContentWorker():this._data instanceof u?this._data:new a(this._data)}};for(var d=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],p=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},f=0;f<d.length;f++)i.prototype[d[f]]=p;r.exports=i},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(n,r,o){(function(i){var s,a,l=i.MutationObserver||i.WebKitMutationObserver;if(l){var c=0,u=new l(h),d=i.document.createTextNode("");u.observe(d,{characterData:!0}),s=function(){d.data=c=++c%2}}else if(i.setImmediate||i.MessageChannel===void 0)s="document"in i&&"onreadystatechange"in i.document.createElement("script")?function(){var m=i.document.createElement("script");m.onreadystatechange=function(){h(),m.onreadystatechange=null,m.parentNode.removeChild(m),m=null},i.document.documentElement.appendChild(m)}:function(){setTimeout(h,0)};else{var p=new i.MessageChannel;p.port1.onmessage=h,s=function(){p.port2.postMessage(0)}}var f=[];function h(){var m,y;a=!0;for(var g=f.length;g;){for(y=f,f=[],m=-1;++m<g;)y[m]();g=f.length}a=!1}r.exports=function(m){f.push(m)!==1||a||s()}}).call(this,typeof zt<"u"?zt:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(n,r,o){var i=n("immediate");function s(){}var a={},l=["REJECTED"],c=["FULFILLED"],u=["PENDING"];function d(g){if(typeof g!="function")throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,g!==s&&m(this,g)}function p(g,v,k){this.promise=g,typeof v=="function"&&(this.onFulfilled=v,this.callFulfilled=this.otherCallFulfilled),typeof k=="function"&&(this.onRejected=k,this.callRejected=this.otherCallRejected)}function f(g,v,k){i(function(){var b;try{b=v(k)}catch(C){return a.reject(g,C)}b===g?a.reject(g,new TypeError("Cannot resolve promise with itself")):a.resolve(g,b)})}function h(g){var v=g&&g.then;if(g&&(typeof g=="object"||typeof g=="function")&&typeof v=="function")return function(){v.apply(g,arguments)}}function m(g,v){var k=!1;function b(M){k||(k=!0,a.reject(g,M))}function C(M){k||(k=!0,a.resolve(g,M))}var D=y(function(){v(C,b)});D.status==="error"&&b(D.value)}function y(g,v){var k={};try{k.value=g(v),k.status="success"}catch(b){k.status="error",k.value=b}return k}(r.exports=d).prototype.finally=function(g){if(typeof g!="function")return this;var v=this.constructor;return this.then(function(k){return v.resolve(g()).then(function(){return k})},function(k){return v.resolve(g()).then(function(){throw k})})},d.prototype.catch=function(g){return this.then(null,g)},d.prototype.then=function(g,v){if(typeof g!="function"&&this.state===c||typeof v!="function"&&this.state===l)return this;var k=new this.constructor(s);return this.state!==u?f(k,this.state===c?g:v,this.outcome):this.queue.push(new p(k,g,v)),k},p.prototype.callFulfilled=function(g){a.resolve(this.promise,g)},p.prototype.otherCallFulfilled=function(g){f(this.promise,this.onFulfilled,g)},p.prototype.callRejected=function(g){a.reject(this.promise,g)},p.prototype.otherCallRejected=function(g){f(this.promise,this.onRejected,g)},a.resolve=function(g,v){var k=y(h,v);if(k.status==="error")return a.reject(g,k.value);var b=k.value;if(b)m(g,b);else{g.state=c,g.outcome=v;for(var C=-1,D=g.queue.length;++C<D;)g.queue[C].callFulfilled(v)}return g},a.reject=function(g,v){g.state=l,g.outcome=v;for(var k=-1,b=g.queue.length;++k<b;)g.queue[k].callRejected(v);return g},d.resolve=function(g){return g instanceof this?g:a.resolve(new this(s),g)},d.reject=function(g){var v=new this(s);return a.reject(v,g)},d.all=function(g){var v=this;if(Object.prototype.toString.call(g)!=="[object Array]")return this.reject(new TypeError("must be an array"));var k=g.length,b=!1;if(!k)return this.resolve([]);for(var C=new Array(k),D=0,M=-1,I=new this(s);++M<k;)E(g[M],M);return I;function E(G,oe){v.resolve(G).then(function(N){C[oe]=N,++D!==k||b||(b=!0,a.resolve(I,C))},function(N){b||(b=!0,a.reject(I,N))})}},d.race=function(g){var v=this;if(Object.prototype.toString.call(g)!=="[object Array]")return this.reject(new TypeError("must be an array"));var k=g.length,b=!1;if(!k)return this.resolve([]);for(var C=-1,D=new this(s);++C<k;)M=g[C],v.resolve(M).then(function(I){b||(b=!0,a.resolve(D,I))},function(I){b||(b=!0,a.reject(D,I))});var M;return D}},{immediate:36}],38:[function(n,r,o){var i={};(0,n("./lib/utils/common").assign)(i,n("./lib/deflate"),n("./lib/inflate"),n("./lib/zlib/constants")),r.exports=i},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(n,r,o){var i=n("./zlib/deflate"),s=n("./utils/common"),a=n("./utils/strings"),l=n("./zlib/messages"),c=n("./zlib/zstream"),u=Object.prototype.toString,d=0,p=-1,f=0,h=8;function m(g){if(!(this instanceof m))return new m(g);this.options=s.assign({level:p,method:h,chunkSize:16384,windowBits:15,memLevel:8,strategy:f,to:""},g||{});var v=this.options;v.raw&&0<v.windowBits?v.windowBits=-v.windowBits:v.gzip&&0<v.windowBits&&v.windowBits<16&&(v.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var k=i.deflateInit2(this.strm,v.level,v.method,v.windowBits,v.memLevel,v.strategy);if(k!==d)throw new Error(l[k]);if(v.header&&i.deflateSetHeader(this.strm,v.header),v.dictionary){var b;if(b=typeof v.dictionary=="string"?a.string2buf(v.dictionary):u.call(v.dictionary)==="[object ArrayBuffer]"?new Uint8Array(v.dictionary):v.dictionary,(k=i.deflateSetDictionary(this.strm,b))!==d)throw new Error(l[k]);this._dict_set=!0}}function y(g,v){var k=new m(v);if(k.push(g,!0),k.err)throw k.msg||l[k.err];return k.result}m.prototype.push=function(g,v){var k,b,C=this.strm,D=this.options.chunkSize;if(this.ended)return!1;b=v===~~v?v:v===!0?4:0,typeof g=="string"?C.input=a.string2buf(g):u.call(g)==="[object ArrayBuffer]"?C.input=new Uint8Array(g):C.input=g,C.next_in=0,C.avail_in=C.input.length;do{if(C.avail_out===0&&(C.output=new s.Buf8(D),C.next_out=0,C.avail_out=D),(k=i.deflate(C,b))!==1&&k!==d)return this.onEnd(k),!(this.ended=!0);C.avail_out!==0&&(C.avail_in!==0||b!==4&&b!==2)||(this.options.to==="string"?this.onData(a.buf2binstring(s.shrinkBuf(C.output,C.next_out))):this.onData(s.shrinkBuf(C.output,C.next_out)))}while((0<C.avail_in||C.avail_out===0)&&k!==1);return b===4?(k=i.deflateEnd(this.strm),this.onEnd(k),this.ended=!0,k===d):b!==2||(this.onEnd(d),!(C.avail_out=0))},m.prototype.onData=function(g){this.chunks.push(g)},m.prototype.onEnd=function(g){g===d&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=g,this.msg=this.strm.msg},o.Deflate=m,o.deflate=y,o.deflateRaw=function(g,v){return(v=v||{}).raw=!0,y(g,v)},o.gzip=function(g,v){return(v=v||{}).gzip=!0,y(g,v)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(n,r,o){var i=n("./zlib/inflate"),s=n("./utils/common"),a=n("./utils/strings"),l=n("./zlib/constants"),c=n("./zlib/messages"),u=n("./zlib/zstream"),d=n("./zlib/gzheader"),p=Object.prototype.toString;function f(m){if(!(this instanceof f))return new f(m);this.options=s.assign({chunkSize:16384,windowBits:0,to:""},m||{});var y=this.options;y.raw&&0<=y.windowBits&&y.windowBits<16&&(y.windowBits=-y.windowBits,y.windowBits===0&&(y.windowBits=-15)),!(0<=y.windowBits&&y.windowBits<16)||m&&m.windowBits||(y.windowBits+=32),15<y.windowBits&&y.windowBits<48&&!(15&y.windowBits)&&(y.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var g=i.inflateInit2(this.strm,y.windowBits);if(g!==l.Z_OK)throw new Error(c[g]);this.header=new d,i.inflateGetHeader(this.strm,this.header)}function h(m,y){var g=new f(y);if(g.push(m,!0),g.err)throw g.msg||c[g.err];return g.result}f.prototype.push=function(m,y){var g,v,k,b,C,D,M=this.strm,I=this.options.chunkSize,E=this.options.dictionary,G=!1;if(this.ended)return!1;v=y===~~y?y:y===!0?l.Z_FINISH:l.Z_NO_FLUSH,typeof m=="string"?M.input=a.binstring2buf(m):p.call(m)==="[object ArrayBuffer]"?M.input=new Uint8Array(m):M.input=m,M.next_in=0,M.avail_in=M.input.length;do{if(M.avail_out===0&&(M.output=new s.Buf8(I),M.next_out=0,M.avail_out=I),(g=i.inflate(M,l.Z_NO_FLUSH))===l.Z_NEED_DICT&&E&&(D=typeof E=="string"?a.string2buf(E):p.call(E)==="[object ArrayBuffer]"?new Uint8Array(E):E,g=i.inflateSetDictionary(this.strm,D)),g===l.Z_BUF_ERROR&&G===!0&&(g=l.Z_OK,G=!1),g!==l.Z_STREAM_END&&g!==l.Z_OK)return this.onEnd(g),!(this.ended=!0);M.next_out&&(M.avail_out!==0&&g!==l.Z_STREAM_END&&(M.avail_in!==0||v!==l.Z_FINISH&&v!==l.Z_SYNC_FLUSH)||(this.options.to==="string"?(k=a.utf8border(M.output,M.next_out),b=M.next_out-k,C=a.buf2string(M.output,k),M.next_out=b,M.avail_out=I-b,b&&s.arraySet(M.output,M.output,k,b,0),this.onData(C)):this.onData(s.shrinkBuf(M.output,M.next_out)))),M.avail_in===0&&M.avail_out===0&&(G=!0)}while((0<M.avail_in||M.avail_out===0)&&g!==l.Z_STREAM_END);return g===l.Z_STREAM_END&&(v=l.Z_FINISH),v===l.Z_FINISH?(g=i.inflateEnd(this.strm),this.onEnd(g),this.ended=!0,g===l.Z_OK):v!==l.Z_SYNC_FLUSH||(this.onEnd(l.Z_OK),!(M.avail_out=0))},f.prototype.onData=function(m){this.chunks.push(m)},f.prototype.onEnd=function(m){m===l.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=m,this.msg=this.strm.msg},o.Inflate=f,o.inflate=h,o.inflateRaw=function(m,y){return(y=y||{}).raw=!0,h(m,y)},o.ungzip=h},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(n,r,o){var i=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";o.assign=function(l){for(var c=Array.prototype.slice.call(arguments,1);c.length;){var u=c.shift();if(u){if(typeof u!="object")throw new TypeError(u+"must be non-object");for(var d in u)u.hasOwnProperty(d)&&(l[d]=u[d])}}return l},o.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,u,d,p){if(c.subarray&&l.subarray)l.set(c.subarray(u,u+d),p);else for(var f=0;f<d;f++)l[p+f]=c[u+f]},flattenChunks:function(l){var c,u,d,p,f,h;for(c=d=0,u=l.length;c<u;c++)d+=l[c].length;for(h=new Uint8Array(d),c=p=0,u=l.length;c<u;c++)f=l[c],h.set(f,p),p+=f.length;return h}},a={arraySet:function(l,c,u,d,p){for(var f=0;f<d;f++)l[p+f]=c[u+f]},flattenChunks:function(l){return[].concat.apply([],l)}};o.setTyped=function(l){l?(o.Buf8=Uint8Array,o.Buf16=Uint16Array,o.Buf32=Int32Array,o.assign(o,s)):(o.Buf8=Array,o.Buf16=Array,o.Buf32=Array,o.assign(o,a))},o.setTyped(i)},{}],42:[function(n,r,o){var i=n("./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 i.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 u(d,p){if(p<65537&&(d.subarray&&a||!d.subarray&&s))return String.fromCharCode.apply(null,i.shrinkBuf(d,p));for(var f="",h=0;h<p;h++)f+=String.fromCharCode(d[h]);return f}l[254]=l[254]=1,o.string2buf=function(d){var p,f,h,m,y,g=d.length,v=0;for(m=0;m<g;m++)(64512&(f=d.charCodeAt(m)))==55296&&m+1<g&&(64512&(h=d.charCodeAt(m+1)))==56320&&(f=65536+(f-55296<<10)+(h-56320),m++),v+=f<128?1:f<2048?2:f<65536?3:4;for(p=new i.Buf8(v),m=y=0;y<v;m++)(64512&(f=d.charCodeAt(m)))==55296&&m+1<g&&(64512&(h=d.charCodeAt(m+1)))==56320&&(f=65536+(f-55296<<10)+(h-56320),m++),f<128?p[y++]=f:(f<2048?p[y++]=192|f>>>6:(f<65536?p[y++]=224|f>>>12:(p[y++]=240|f>>>18,p[y++]=128|f>>>12&63),p[y++]=128|f>>>6&63),p[y++]=128|63&f);return p},o.buf2binstring=function(d){return u(d,d.length)},o.binstring2buf=function(d){for(var p=new i.Buf8(d.length),f=0,h=p.length;f<h;f++)p[f]=d.charCodeAt(f);return p},o.buf2string=function(d,p){var f,h,m,y,g=p||d.length,v=new Array(2*g);for(f=h=0;f<g;)if((m=d[f++])<128)v[h++]=m;else if(4<(y=l[m]))v[h++]=65533,f+=y-1;else{for(m&=y===2?31:y===3?15:7;1<y&&f<g;)m=m<<6|63&d[f++],y--;1<y?v[h++]=65533:m<65536?v[h++]=m:(m-=65536,v[h++]=55296|m>>10&1023,v[h++]=56320|1023&m)}return u(v,h)},o.utf8border=function(d,p){var f;for((p=p||d.length)>d.length&&(p=d.length),f=p-1;0<=f&&(192&d[f])==128;)f--;return f<0||f===0?p:f+l[d[f]]>p?f:p}},{"./common":41}],43:[function(n,r,o){r.exports=function(i,s,a,l){for(var c=65535&i|0,u=i>>>16&65535|0,d=0;a!==0;){for(a-=d=2e3<a?2e3:a;u=u+(c=c+s[l++]|0)|0,--d;);c%=65521,u%=65521}return c|u<<16|0}},{}],44:[function(n,r,o){r.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(n,r,o){var i=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}();r.exports=function(s,a,l,c){var u=i,d=c+l;s^=-1;for(var p=c;p<d;p++)s=s>>>8^u[255&(s^a[p])];return-1^s}},{}],46:[function(n,r,o){var i,s=n("../utils/common"),a=n("./trees"),l=n("./adler32"),c=n("./crc32"),u=n("./messages"),d=0,p=4,f=0,h=-2,m=-1,y=4,g=2,v=8,k=9,b=286,C=30,D=19,M=2*b+1,I=15,E=3,G=258,oe=G+E+1,N=42,H=113,A=1,J=2,ie=3,W=4;function ce(S,re){return S.msg=u[re],re}function X(S){return(S<<1)-(4<S?9:0)}function ue(S){for(var re=S.length;0<=--re;)S[re]=0}function Z(S){var re=S.state,Q=re.pending;Q>S.avail_out&&(Q=S.avail_out),Q!==0&&(s.arraySet(S.output,re.pending_buf,re.pending_out,Q,S.next_out),S.next_out+=Q,re.pending_out+=Q,S.total_out+=Q,S.avail_out-=Q,re.pending-=Q,re.pending===0&&(re.pending_out=0))}function R(S,re){a._tr_flush_block(S,0<=S.block_start?S.block_start:-1,S.strstart-S.block_start,re),S.block_start=S.strstart,Z(S.strm)}function ee(S,re){S.pending_buf[S.pending++]=re}function ne(S,re){S.pending_buf[S.pending++]=re>>>8&255,S.pending_buf[S.pending++]=255&re}function se(S,re){var Q,z,V=S.max_chain_length,j=S.strstart,de=S.prev_length,fe=S.nice_match,ae=S.strstart>S.w_size-oe?S.strstart-(S.w_size-oe):0,me=S.window,we=S.w_mask,he=S.prev,be=S.strstart+G,ze=me[j+de-1],Ce=me[j+de];S.prev_length>=S.good_match&&(V>>=2),fe>S.lookahead&&(fe=S.lookahead);do if(me[(Q=re)+de]===Ce&&me[Q+de-1]===ze&&me[Q]===me[j]&&me[++Q]===me[j+1]){j+=2,Q++;do;while(me[++j]===me[++Q]&&me[++j]===me[++Q]&&me[++j]===me[++Q]&&me[++j]===me[++Q]&&me[++j]===me[++Q]&&me[++j]===me[++Q]&&me[++j]===me[++Q]&&me[++j]===me[++Q]&&j<be);if(z=G-(be-j),j=be-G,de<z){if(S.match_start=re,fe<=(de=z))break;ze=me[j+de-1],Ce=me[j+de]}}while((re=he[re&we])>ae&&--V!=0);return de<=S.lookahead?de:S.lookahead}function Y(S){var re,Q,z,V,j,de,fe,ae,me,we,he=S.w_size;do{if(V=S.window_size-S.lookahead-S.strstart,S.strstart>=he+(he-oe)){for(s.arraySet(S.window,S.window,he,he,0),S.match_start-=he,S.strstart-=he,S.block_start-=he,re=Q=S.hash_size;z=S.head[--re],S.head[re]=he<=z?z-he:0,--Q;);for(re=Q=he;z=S.prev[--re],S.prev[re]=he<=z?z-he:0,--Q;);V+=he}if(S.strm.avail_in===0)break;if(de=S.strm,fe=S.window,ae=S.strstart+S.lookahead,me=V,we=void 0,we=de.avail_in,me<we&&(we=me),Q=we===0?0:(de.avail_in-=we,s.arraySet(fe,de.input,de.next_in,we,ae),de.state.wrap===1?de.adler=l(de.adler,fe,we,ae):de.state.wrap===2&&(de.adler=c(de.adler,fe,we,ae)),de.next_in+=we,de.total_in+=we,we),S.lookahead+=Q,S.lookahead+S.insert>=E)for(j=S.strstart-S.insert,S.ins_h=S.window[j],S.ins_h=(S.ins_h<<S.hash_shift^S.window[j+1])&S.hash_mask;S.insert&&(S.ins_h=(S.ins_h<<S.hash_shift^S.window[j+E-1])&S.hash_mask,S.prev[j&S.w_mask]=S.head[S.ins_h],S.head[S.ins_h]=j,j++,S.insert--,!(S.lookahead+S.insert<E)););}while(S.lookahead<oe&&S.strm.avail_in!==0)}function $(S,re){for(var Q,z;;){if(S.lookahead<oe){if(Y(S),S.lookahead<oe&&re===d)return A;if(S.lookahead===0)break}if(Q=0,S.lookahead>=E&&(S.ins_h=(S.ins_h<<S.hash_shift^S.window[S.strstart+E-1])&S.hash_mask,Q=S.prev[S.strstart&S.w_mask]=S.head[S.ins_h],S.head[S.ins_h]=S.strstart),Q!==0&&S.strstart-Q<=S.w_size-oe&&(S.match_length=se(S,Q)),S.match_length>=E)if(z=a._tr_tally(S,S.strstart-S.match_start,S.match_length-E),S.lookahead-=S.match_length,S.match_length<=S.max_lazy_match&&S.lookahead>=E){for(S.match_length--;S.strstart++,S.ins_h=(S.ins_h<<S.hash_shift^S.window[S.strstart+E-1])&S.hash_mask,Q=S.prev[S.strstart&S.w_mask]=S.head[S.ins_h],S.head[S.ins_h]=S.strstart,--S.match_length!=0;);S.strstart++}else S.strstart+=S.match_length,S.match_length=0,S.ins_h=S.window[S.strstart],S.ins_h=(S.ins_h<<S.hash_shift^S.window[S.strstart+1])&S.hash_mask;else z=a._tr_tally(S,0,S.window[S.strstart]),S.lookahead--,S.strstart++;if(z&&(R(S,!1),S.strm.avail_out===0))return A}return S.insert=S.strstart<E-1?S.strstart:E-1,re===p?(R(S,!0),S.strm.avail_out===0?ie:W):S.last_lit&&(R(S,!1),S.strm.avail_out===0)?A:J}function T(S,re){for(var Q,z,V;;){if(S.lookahead<oe){if(Y(S),S.lookahead<oe&&re===d)return A;if(S.lookahead===0)break}if(Q=0,S.lookahead>=E&&(S.ins_h=(S.ins_h<<S.hash_shift^S.window[S.strstart+E-1])&S.hash_mask,Q=S.prev[S.strstart&S.w_mask]=S.head[S.ins_h],S.head[S.ins_h]=S.strstart),S.prev_length=S.match_length,S.prev_match=S.match_start,S.match_length=E-1,Q!==0&&S.prev_length<S.max_lazy_match&&S.strstart-Q<=S.w_size-oe&&(S.match_length=se(S,Q),S.match_length<=5&&(S.strategy===1||S.match_length===E&&4096<S.strstart-S.match_start)&&(S.match_length=E-1)),S.prev_length>=E&&S.match_length<=S.prev_length){for(V=S.strstart+S.lookahead-E,z=a._tr_tally(S,S.strstart-1-S.prev_match,S.prev_length-E),S.lookahead-=S.prev_length-1,S.prev_length-=2;++S.strstart<=V&&(S.ins_h=(S.ins_h<<S.hash_shift^S.window[S.strstart+E-1])&S.hash_mask,Q=S.prev[S.strstart&S.w_mask]=S.head[S.ins_h],S.head[S.ins_h]=S.strstart),--S.prev_length!=0;);if(S.match_available=0,S.match_length=E-1,S.strstart++,z&&(R(S,!1),S.strm.avail_out===0))return A}else if(S.match_available){if((z=a._tr_tally(S,0,S.window[S.strstart-1]))&&R(S,!1),S.strstart++,S.lookahead--,S.strm.avail_out===0)return A}else S.match_available=1,S.strstart++,S.lookahead--}return S.match_available&&(z=a._tr_tally(S,0,S.window[S.strstart-1]),S.match_available=0),S.insert=S.strstart<E-1?S.strstart:E-1,re===p?(R(S,!0),S.strm.avail_out===0?ie:W):S.last_lit&&(R(S,!1),S.strm.avail_out===0)?A:J}function K(S,re,Q,z,V){this.good_length=S,this.max_lazy=re,this.nice_length=Q,this.max_chain=z,this.func=V}function q(){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=v,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*M),this.dyn_dtree=new s.Buf16(2*(2*C+1)),this.bl_tree=new s.Buf16(2*(2*D+1)),ue(this.dyn_ltree),ue(this.dyn_dtree),ue(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new s.Buf16(I+1),this.heap=new s.Buf16(2*b+1),ue(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new s.Buf16(2*b+1),ue(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 F(S){var re;return S&&S.state?(S.total_in=S.total_out=0,S.data_type=g,(re=S.state).pending=0,re.pending_out=0,re.wrap<0&&(re.wrap=-re.wrap),re.status=re.wrap?N:H,S.adler=re.wrap===2?0:1,re.last_flush=d,a._tr_init(re),f):ce(S,h)}function L(S){var re=F(S);return re===f&&function(Q){Q.window_size=2*Q.w_size,ue(Q.head),Q.max_lazy_match=i[Q.level].max_lazy,Q.good_match=i[Q.level].good_length,Q.nice_match=i[Q.level].nice_length,Q.max_chain_length=i[Q.level].max_chain,Q.strstart=0,Q.block_start=0,Q.lookahead=0,Q.insert=0,Q.match_length=Q.prev_length=E-1,Q.match_available=0,Q.ins_h=0}(S.state),re}function le(S,re,Q,z,V,j){if(!S)return h;var de=1;if(re===m&&(re=6),z<0?(de=0,z=-z):15<z&&(de=2,z-=16),V<1||k<V||Q!==v||z<8||15<z||re<0||9<re||j<0||y<j)return ce(S,h);z===8&&(z=9);var fe=new q;return(S.state=fe).strm=S,fe.wrap=de,fe.gzhead=null,fe.w_bits=z,fe.w_size=1<<fe.w_bits,fe.w_mask=fe.w_size-1,fe.hash_bits=V+7,fe.hash_size=1<<fe.hash_bits,fe.hash_mask=fe.hash_size-1,fe.hash_shift=~~((fe.hash_bits+E-1)/E),fe.window=new s.Buf8(2*fe.w_size),fe.head=new s.Buf16(fe.hash_size),fe.prev=new s.Buf16(fe.w_size),fe.lit_bufsize=1<<V+6,fe.pending_buf_size=4*fe.lit_bufsize,fe.pending_buf=new s.Buf8(fe.pending_buf_size),fe.d_buf=1*fe.lit_bufsize,fe.l_buf=3*fe.lit_bufsize,fe.level=re,fe.strategy=j,fe.method=Q,L(S)}i=[new K(0,0,0,0,function(S,re){var Q=65535;for(Q>S.pending_buf_size-5&&(Q=S.pending_buf_size-5);;){if(S.lookahead<=1){if(Y(S),S.lookahead===0&&re===d)return A;if(S.lookahead===0)break}S.strstart+=S.lookahead,S.lookahead=0;var z=S.block_start+Q;if((S.strstart===0||S.strstart>=z)&&(S.lookahead=S.strstart-z,S.strstart=z,R(S,!1),S.strm.avail_out===0)||S.strstart-S.block_start>=S.w_size-oe&&(R(S,!1),S.strm.avail_out===0))return A}return S.insert=0,re===p?(R(S,!0),S.strm.avail_out===0?ie:W):(S.strstart>S.block_start&&(R(S,!1),S.strm.avail_out),A)}),new K(4,4,8,4,$),new K(4,5,16,8,$),new K(4,6,32,32,$),new K(4,4,16,16,T),new K(8,16,32,32,T),new K(8,16,128,128,T),new K(8,32,128,256,T),new K(32,128,258,1024,T),new K(32,258,258,4096,T)],o.deflateInit=function(S,re){return le(S,re,v,15,8,0)},o.deflateInit2=le,o.deflateReset=L,o.deflateResetKeep=F,o.deflateSetHeader=function(S,re){return S&&S.state?S.state.wrap!==2?h:(S.state.gzhead=re,f):h},o.deflate=function(S,re){var Q,z,V,j;if(!S||!S.state||5<re||re<0)return S?ce(S,h):h;if(z=S.state,!S.output||!S.input&&S.avail_in!==0||z.status===666&&re!==p)return ce(S,S.avail_out===0?-5:h);if(z.strm=S,Q=z.last_flush,z.last_flush=re,z.status===N)if(z.wrap===2)S.adler=0,ee(z,31),ee(z,139),ee(z,8),z.gzhead?(ee(z,(z.gzhead.text?1:0)+(z.gzhead.hcrc?2:0)+(z.gzhead.extra?4:0)+(z.gzhead.name?8:0)+(z.gzhead.comment?16:0)),ee(z,255&z.gzhead.time),ee(z,z.gzhead.time>>8&255),ee(z,z.gzhead.time>>16&255),ee(z,z.gzhead.time>>24&255),ee(z,z.level===9?2:2<=z.strategy||z.level<2?4:0),ee(z,255&z.gzhead.os),z.gzhead.extra&&z.gzhead.extra.length&&(ee(z,255&z.gzhead.extra.length),ee(z,z.gzhead.extra.length>>8&255)),z.gzhead.hcrc&&(S.adler=c(S.adler,z.pending_buf,z.pending,0)),z.gzindex=0,z.status=69):(ee(z,0),ee(z,0),ee(z,0),ee(z,0),ee(z,0),ee(z,z.level===9?2:2<=z.strategy||z.level<2?4:0),ee(z,3),z.status=H);else{var de=v+(z.w_bits-8<<4)<<8;de|=(2<=z.strategy||z.level<2?0:z.level<6?1:z.level===6?2:3)<<6,z.strstart!==0&&(de|=32),de+=31-de%31,z.status=H,ne(z,de),z.strstart!==0&&(ne(z,S.adler>>>16),ne(z,65535&S.adler)),S.adler=1}if(z.status===69)if(z.gzhead.extra){for(V=z.pending;z.gzindex<(65535&z.gzhead.extra.length)&&(z.pending!==z.pending_buf_size||(z.gzhead.hcrc&&z.pending>V&&(S.adler=c(S.adler,z.pending_buf,z.pending-V,V)),Z(S),V=z.pending,z.pending!==z.pending_buf_size));)ee(z,255&z.gzhead.extra[z.gzindex]),z.gzindex++;z.gzhead.hcrc&&z.pending>V&&(S.adler=c(S.adler,z.pending_buf,z.pending-V,V)),z.gzindex===z.gzhead.extra.length&&(z.gzindex=0,z.status=73)}else z.status=73;if(z.status===73)if(z.gzhead.name){V=z.pending;do{if(z.pending===z.pending_buf_size&&(z.gzhead.hcrc&&z.pending>V&&(S.adler=c(S.adler,z.pending_buf,z.pending-V,V)),Z(S),V=z.pending,z.pending===z.pending_buf_size)){j=1;break}j=z.gzindex<z.gzhead.name.length?255&z.gzhead.name.charCodeAt(z.gzindex++):0,ee(z,j)}while(j!==0);z.gzhead.hcrc&&z.pending>V&&(S.adler=c(S.adler,z.pending_buf,z.pending-V,V)),j===0&&(z.gzindex=0,z.status=91)}else z.status=91;if(z.status===91)if(z.gzhead.comment){V=z.pending;do{if(z.pending===z.pending_buf_size&&(z.gzhead.hcrc&&z.pending>V&&(S.adler=c(S.adler,z.pending_buf,z.pending-V,V)),Z(S),V=z.pending,z.pending===z.pending_buf_size)){j=1;break}j=z.gzindex<z.gzhead.comment.length?255&z.gzhead.comment.charCodeAt(z.gzindex++):0,ee(z,j)}while(j!==0);z.gzhead.hcrc&&z.pending>V&&(S.adler=c(S.adler,z.pending_buf,z.pending-V,V)),j===0&&(z.status=103)}else z.status=103;if(z.status===103&&(z.gzhead.hcrc?(z.pending+2>z.pending_buf_size&&Z(S),z.pending+2<=z.pending_buf_size&&(ee(z,255&S.adler),ee(z,S.adler>>8&255),S.adler=0,z.status=H)):z.status=H),z.pending!==0){if(Z(S),S.avail_out===0)return z.last_flush=-1,f}else if(S.avail_in===0&&X(re)<=X(Q)&&re!==p)return ce(S,-5);if(z.status===666&&S.avail_in!==0)return ce(S,-5);if(S.avail_in!==0||z.lookahead!==0||re!==d&&z.status!==666){var fe=z.strategy===2?function(ae,me){for(var we;;){if(ae.lookahead===0&&(Y(ae),ae.lookahead===0)){if(me===d)return A;break}if(ae.match_length=0,we=a._tr_tally(ae,0,ae.window[ae.strstart]),ae.lookahead--,ae.strstart++,we&&(R(ae,!1),ae.strm.avail_out===0))return A}return ae.insert=0,me===p?(R(ae,!0),ae.strm.avail_out===0?ie:W):ae.last_lit&&(R(ae,!1),ae.strm.avail_out===0)?A:J}(z,re):z.strategy===3?function(ae,me){for(var we,he,be,ze,Ce=ae.window;;){if(ae.lookahead<=G){if(Y(ae),ae.lookahead<=G&&me===d)return A;if(ae.lookahead===0)break}if(ae.match_length=0,ae.lookahead>=E&&0<ae.strstart&&(he=Ce[be=ae.strstart-1])===Ce[++be]&&he===Ce[++be]&&he===Ce[++be]){ze=ae.strstart+G;do;while(he===Ce[++be]&&he===Ce[++be]&&he===Ce[++be]&&he===Ce[++be]&&he===Ce[++be]&&he===Ce[++be]&&he===Ce[++be]&&he===Ce[++be]&&be<ze);ae.match_length=G-(ze-be),ae.match_length>ae.lookahead&&(ae.match_length=ae.lookahead)}if(ae.match_length>=E?(we=a._tr_tally(ae,1,ae.match_length-E),ae.lookahead-=ae.match_length,ae.strstart+=ae.match_length,ae.match_length=0):(we=a._tr_tally(ae,0,ae.window[ae.strstart]),ae.lookahead--,ae.strstart++),we&&(R(ae,!1),ae.strm.avail_out===0))return A}return ae.insert=0,me===p?(R(ae,!0),ae.strm.avail_out===0?ie:W):ae.last_lit&&(R(ae,!1),ae.strm.avail_out===0)?A:J}(z,re):i[z.level].func(z,re);if(fe!==ie&&fe!==W||(z.status=666),fe===A||fe===ie)return S.avail_out===0&&(z.last_flush=-1),f;if(fe===J&&(re===1?a._tr_align(z):re!==5&&(a._tr_stored_block(z,0,0,!1),re===3&&(ue(z.head),z.lookahead===0&&(z.strstart=0,z.block_start=0,z.insert=0))),Z(S),S.avail_out===0))return z.last_flush=-1,f}return re!==p?f:z.wrap<=0?1:(z.wrap===2?(ee(z,255&S.adler),ee(z,S.adler>>8&255),ee(z,S.adler>>16&255),ee(z,S.adler>>24&255),ee(z,255&S.total_in),ee(z,S.total_in>>8&255),ee(z,S.total_in>>16&255),ee(z,S.total_in>>24&255)):(ne(z,S.adler>>>16),ne(z,65535&S.adler)),Z(S),0<z.wrap&&(z.wrap=-z.wrap),z.pending!==0?f:1)},o.deflateEnd=function(S){var re;return S&&S.state?(re=S.state.status)!==N&&re!==69&&re!==73&&re!==91&&re!==103&&re!==H&&re!==666?ce(S,h):(S.state=null,re===H?ce(S,-3):f):h},o.deflateSetDictionary=function(S,re){var Q,z,V,j,de,fe,ae,me,we=re.length;if(!S||!S.state||(j=(Q=S.state).wrap)===2||j===1&&Q.status!==N||Q.lookahead)return h;for(j===1&&(S.adler=l(S.adler,re,we,0)),Q.wrap=0,we>=Q.w_size&&(j===0&&(ue(Q.head),Q.strstart=0,Q.block_start=0,Q.insert=0),me=new s.Buf8(Q.w_size),s.arraySet(me,re,we-Q.w_size,Q.w_size,0),re=me,we=Q.w_size),de=S.avail_in,fe=S.next_in,ae=S.input,S.avail_in=we,S.next_in=0,S.input=re,Y(Q);Q.lookahead>=E;){for(z=Q.strstart,V=Q.lookahead-(E-1);Q.ins_h=(Q.ins_h<<Q.hash_shift^Q.window[z+E-1])&Q.hash_mask,Q.prev[z&Q.w_mask]=Q.head[Q.ins_h],Q.head[Q.ins_h]=z,z++,--V;);Q.strstart=z,Q.lookahead=E-1,Y(Q)}return Q.strstart+=Q.lookahead,Q.block_start=Q.strstart,Q.insert=Q.lookahead,Q.lookahead=0,Q.match_length=Q.prev_length=E-1,Q.match_available=0,S.next_in=fe,S.input=ae,S.avail_in=de,Q.wrap=j,f},o.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(n,r,o){r.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(n,r,o){r.exports=function(i,s){var a,l,c,u,d,p,f,h,m,y,g,v,k,b,C,D,M,I,E,G,oe,N,H,A,J;a=i.state,l=i.next_in,A=i.input,c=l+(i.avail_in-5),u=i.next_out,J=i.output,d=u-(s-i.avail_out),p=u+(i.avail_out-257),f=a.dmax,h=a.wsize,m=a.whave,y=a.wnext,g=a.window,v=a.hold,k=a.bits,b=a.lencode,C=a.distcode,D=(1<<a.lenbits)-1,M=(1<<a.distbits)-1;e:do{k<15&&(v+=A[l++]<<k,k+=8,v+=A[l++]<<k,k+=8),I=b[v&D];t:for(;;){if(v>>>=E=I>>>24,k-=E,(E=I>>>16&255)===0)J[u++]=65535&I;else{if(!(16&E)){if(!(64&E)){I=b[(65535&I)+(v&(1<<E)-1)];continue t}if(32&E){a.mode=12;break e}i.msg="invalid literal/length code",a.mode=30;break e}G=65535&I,(E&=15)&&(k<E&&(v+=A[l++]<<k,k+=8),G+=v&(1<<E)-1,v>>>=E,k-=E),k<15&&(v+=A[l++]<<k,k+=8,v+=A[l++]<<k,k+=8),I=C[v&M];n:for(;;){if(v>>>=E=I>>>24,k-=E,!(16&(E=I>>>16&255))){if(!(64&E)){I=C[(65535&I)+(v&(1<<E)-1)];continue n}i.msg="invalid distance code",a.mode=30;break e}if(oe=65535&I,k<(E&=15)&&(v+=A[l++]<<k,(k+=8)<E&&(v+=A[l++]<<k,k+=8)),f<(oe+=v&(1<<E)-1)){i.msg="invalid distance too far back",a.mode=30;break e}if(v>>>=E,k-=E,(E=u-d)<oe){if(m<(E=oe-E)&&a.sane){i.msg="invalid distance too far back",a.mode=30;break e}if(H=g,(N=0)===y){if(N+=h-E,E<G){for(G-=E;J[u++]=g[N++],--E;);N=u-oe,H=J}}else if(y<E){if(N+=h+y-E,(E-=y)<G){for(G-=E;J[u++]=g[N++],--E;);if(N=0,y<G){for(G-=E=y;J[u++]=g[N++],--E;);N=u-oe,H=J}}}else if(N+=y-E,E<G){for(G-=E;J[u++]=g[N++],--E;);N=u-oe,H=J}for(;2<G;)J[u++]=H[N++],J[u++]=H[N++],J[u++]=H[N++],G-=3;G&&(J[u++]=H[N++],1<G&&(J[u++]=H[N++]))}else{for(N=u-oe;J[u++]=J[N++],J[u++]=J[N++],J[u++]=J[N++],2<(G-=3););G&&(J[u++]=J[N++],1<G&&(J[u++]=J[N++]))}break}}break}}while(l<c&&u<p);l-=G=k>>3,v&=(1<<(k-=G<<3))-1,i.next_in=l,i.next_out=u,i.avail_in=l<c?c-l+5:5-(l-c),i.avail_out=u<p?p-u+257:257-(u-p),a.hold=v,a.bits=k}},{}],49:[function(n,r,o){var i=n("../utils/common"),s=n("./adler32"),a=n("./crc32"),l=n("./inffast"),c=n("./inftrees"),u=1,d=2,p=0,f=-2,h=1,m=852,y=592;function g(N){return(N>>>24&255)+(N>>>8&65280)+((65280&N)<<8)+((255&N)<<24)}function v(){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 i.Buf16(320),this.work=new i.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function k(N){var H;return N&&N.state?(H=N.state,N.total_in=N.total_out=H.total=0,N.msg="",H.wrap&&(N.adler=1&H.wrap),H.mode=h,H.last=0,H.havedict=0,H.dmax=32768,H.head=null,H.hold=0,H.bits=0,H.lencode=H.lendyn=new i.Buf32(m),H.distcode=H.distdyn=new i.Buf32(y),H.sane=1,H.back=-1,p):f}function b(N){var H;return N&&N.state?((H=N.state).wsize=0,H.whave=0,H.wnext=0,k(N)):f}function C(N,H){var A,J;return N&&N.state?(J=N.state,H<0?(A=0,H=-H):(A=1+(H>>4),H<48&&(H&=15)),H&&(H<8||15<H)?f:(J.window!==null&&J.wbits!==H&&(J.window=null),J.wrap=A,J.wbits=H,b(N))):f}function D(N,H){var A,J;return N?(J=new v,(N.state=J).window=null,(A=C(N,H))!==p&&(N.state=null),A):f}var M,I,E=!0;function G(N){if(E){var H;for(M=new i.Buf32(512),I=new i.Buf32(32),H=0;H<144;)N.lens[H++]=8;for(;H<256;)N.lens[H++]=9;for(;H<280;)N.lens[H++]=7;for(;H<288;)N.lens[H++]=8;for(c(u,N.lens,0,288,M,0,N.work,{bits:9}),H=0;H<32;)N.lens[H++]=5;c(d,N.lens,0,32,I,0,N.work,{bits:5}),E=!1}N.lencode=M,N.lenbits=9,N.distcode=I,N.distbits=5}function oe(N,H,A,J){var ie,W=N.state;return W.window===null&&(W.wsize=1<<W.wbits,W.wnext=0,W.whave=0,W.window=new i.Buf8(W.wsize)),J>=W.wsize?(i.arraySet(W.window,H,A-W.wsize,W.wsize,0),W.wnext=0,W.whave=W.wsize):(J<(ie=W.wsize-W.wnext)&&(ie=J),i.arraySet(W.window,H,A-J,ie,W.wnext),(J-=ie)?(i.arraySet(W.window,H,A-J,J,0),W.wnext=J,W.whave=W.wsize):(W.wnext+=ie,W.wnext===W.wsize&&(W.wnext=0),W.whave<W.wsize&&(W.whave+=ie))),0}o.inflateReset=b,o.inflateReset2=C,o.inflateResetKeep=k,o.inflateInit=function(N){return D(N,15)},o.inflateInit2=D,o.inflate=function(N,H){var A,J,ie,W,ce,X,ue,Z,R,ee,ne,se,Y,$,T,K,q,F,L,le,S,re,Q,z,V=0,j=new i.Buf8(4),de=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!N||!N.state||!N.output||!N.input&&N.avail_in!==0)return f;(A=N.state).mode===12&&(A.mode=13),ce=N.next_out,ie=N.output,ue=N.avail_out,W=N.next_in,J=N.input,X=N.avail_in,Z=A.hold,R=A.bits,ee=X,ne=ue,re=p;e:for(;;)switch(A.mode){case h:if(A.wrap===0){A.mode=13;break}for(;R<16;){if(X===0)break e;X--,Z+=J[W++]<<R,R+=8}if(2&A.wrap&&Z===35615){j[A.check=0]=255&Z,j[1]=Z>>>8&255,A.check=a(A.check,j,2,0),R=Z=0,A.mode=2;break}if(A.flags=0,A.head&&(A.head.done=!1),!(1&A.wrap)||(((255&Z)<<8)+(Z>>8))%31){N.msg="incorrect header check",A.mode=30;break}if((15&Z)!=8){N.msg="unknown compression method",A.mode=30;break}if(R-=4,S=8+(15&(Z>>>=4)),A.wbits===0)A.wbits=S;else if(S>A.wbits){N.msg="invalid window size",A.mode=30;break}A.dmax=1<<S,N.adler=A.check=1,A.mode=512&Z?10:12,R=Z=0;break;case 2:for(;R<16;){if(X===0)break e;X--,Z+=J[W++]<<R,R+=8}if(A.flags=Z,(255&A.flags)!=8){N.msg="unknown compression method",A.mode=30;break}if(57344&A.flags){N.msg="unknown header flags set",A.mode=30;break}A.head&&(A.head.text=Z>>8&1),512&A.flags&&(j[0]=255&Z,j[1]=Z>>>8&255,A.check=a(A.check,j,2,0)),R=Z=0,A.mode=3;case 3:for(;R<32;){if(X===0)break e;X--,Z+=J[W++]<<R,R+=8}A.head&&(A.head.time=Z),512&A.flags&&(j[0]=255&Z,j[1]=Z>>>8&255,j[2]=Z>>>16&255,j[3]=Z>>>24&255,A.check=a(A.check,j,4,0)),R=Z=0,A.mode=4;case 4:for(;R<16;){if(X===0)break e;X--,Z+=J[W++]<<R,R+=8}A.head&&(A.head.xflags=255&Z,A.head.os=Z>>8),512&A.flags&&(j[0]=255&Z,j[1]=Z>>>8&255,A.check=a(A.check,j,2,0)),R=Z=0,A.mode=5;case 5:if(1024&A.flags){for(;R<16;){if(X===0)break e;X--,Z+=J[W++]<<R,R+=8}A.length=Z,A.head&&(A.head.extra_len=Z),512&A.flags&&(j[0]=255&Z,j[1]=Z>>>8&255,A.check=a(A.check,j,2,0)),R=Z=0}else A.head&&(A.head.extra=null);A.mode=6;case 6:if(1024&A.flags&&(X<(se=A.length)&&(se=X),se&&(A.head&&(S=A.head.extra_len-A.length,A.head.extra||(A.head.extra=new Array(A.head.extra_len)),i.arraySet(A.head.extra,J,W,se,S)),512&A.flags&&(A.check=a(A.check,J,se,W)),X-=se,W+=se,A.length-=se),A.length))break e;A.length=0,A.mode=7;case 7:if(2048&A.flags){if(X===0)break e;for(se=0;S=J[W+se++],A.head&&S&&A.length<65536&&(A.head.name+=String.fromCharCode(S)),S&&se<X;);if(512&A.flags&&(A.check=a(A.check,J,se,W)),X-=se,W+=se,S)break e}else A.head&&(A.head.name=null);A.length=0,A.mode=8;case 8:if(4096&A.flags){if(X===0)break e;for(se=0;S=J[W+se++],A.head&&S&&A.length<65536&&(A.head.comment+=String.fromCharCode(S)),S&&se<X;);if(512&A.flags&&(A.check=a(A.check,J,se,W)),X-=se,W+=se,S)break e}else A.head&&(A.head.comment=null);A.mode=9;case 9:if(512&A.flags){for(;R<16;){if(X===0)break e;X--,Z+=J[W++]<<R,R+=8}if(Z!==(65535&A.check)){N.msg="header crc mismatch",A.mode=30;break}R=Z=0}A.head&&(A.head.hcrc=A.flags>>9&1,A.head.done=!0),N.adler=A.check=0,A.mode=12;break;case 10:for(;R<32;){if(X===0)break e;X--,Z+=J[W++]<<R,R+=8}N.adler=A.check=g(Z),R=Z=0,A.mode=11;case 11:if(A.havedict===0)return N.next_out=ce,N.avail_out=ue,N.next_in=W,N.avail_in=X,A.hold=Z,A.bits=R,2;N.adler=A.check=1,A.mode=12;case 12:if(H===5||H===6)break e;case 13:if(A.last){Z>>>=7&R,R-=7&R,A.mode=27;break}for(;R<3;){if(X===0)break e;X--,Z+=J[W++]<<R,R+=8}switch(A.last=1&Z,R-=1,3&(Z>>>=1)){case 0:A.mode=14;break;case 1:if(G(A),A.mode=20,H!==6)break;Z>>>=2,R-=2;break e;case 2:A.mode=17;break;case 3:N.msg="invalid block type",A.mode=30}Z>>>=2,R-=2;break;case 14:for(Z>>>=7&R,R-=7&R;R<32;){if(X===0)break e;X--,Z+=J[W++]<<R,R+=8}if((65535&Z)!=(Z>>>16^65535)){N.msg="invalid stored block lengths",A.mode=30;break}if(A.length=65535&Z,R=Z=0,A.mode=15,H===6)break e;case 15:A.mode=16;case 16:if(se=A.length){if(X<se&&(se=X),ue<se&&(se=ue),se===0)break e;i.arraySet(ie,J,W,se,ce),X-=se,W+=se,ue-=se,ce+=se,A.length-=se;break}A.mode=12;break;case 17:for(;R<14;){if(X===0)break e;X--,Z+=J[W++]<<R,R+=8}if(A.nlen=257+(31&Z),Z>>>=5,R-=5,A.ndist=1+(31&Z),Z>>>=5,R-=5,A.ncode=4+(15&Z),Z>>>=4,R-=4,286<A.nlen||30<A.ndist){N.msg="too many length or distance symbols",A.mode=30;break}A.have=0,A.mode=18;case 18:for(;A.have<A.ncode;){for(;R<3;){if(X===0)break e;X--,Z+=J[W++]<<R,R+=8}A.lens[de[A.have++]]=7&Z,Z>>>=3,R-=3}for(;A.have<19;)A.lens[de[A.have++]]=0;if(A.lencode=A.lendyn,A.lenbits=7,Q={bits:A.lenbits},re=c(0,A.lens,0,19,A.lencode,0,A.work,Q),A.lenbits=Q.bits,re){N.msg="invalid code lengths set",A.mode=30;break}A.have=0,A.mode=19;case 19:for(;A.have<A.nlen+A.ndist;){for(;K=(V=A.lencode[Z&(1<<A.lenbits)-1])>>>16&255,q=65535&V,!((T=V>>>24)<=R);){if(X===0)break e;X--,Z+=J[W++]<<R,R+=8}if(q<16)Z>>>=T,R-=T,A.lens[A.have++]=q;else{if(q===16){for(z=T+2;R<z;){if(X===0)break e;X--,Z+=J[W++]<<R,R+=8}if(Z>>>=T,R-=T,A.have===0){N.msg="invalid bit length repeat",A.mode=30;break}S=A.lens[A.have-1],se=3+(3&Z),Z>>>=2,R-=2}else if(q===17){for(z=T+3;R<z;){if(X===0)break e;X--,Z+=J[W++]<<R,R+=8}R-=T,S=0,se=3+(7&(Z>>>=T)),Z>>>=3,R-=3}else{for(z=T+7;R<z;){if(X===0)break e;X--,Z+=J[W++]<<R,R+=8}R-=T,S=0,se=11+(127&(Z>>>=T)),Z>>>=7,R-=7}if(A.have+se>A.nlen+A.ndist){N.msg="invalid bit length repeat",A.mode=30;break}for(;se--;)A.lens[A.have++]=S}}if(A.mode===30)break;if(A.lens[256]===0){N.msg="invalid code -- missing end-of-block",A.mode=30;break}if(A.lenbits=9,Q={bits:A.lenbits},re=c(u,A.lens,0,A.nlen,A.lencode,0,A.work,Q),A.lenbits=Q.bits,re){N.msg="invalid literal/lengths set",A.mode=30;break}if(A.distbits=6,A.distcode=A.distdyn,Q={bits:A.distbits},re=c(d,A.lens,A.nlen,A.ndist,A.distcode,0,A.work,Q),A.distbits=Q.bits,re){N.msg="invalid distances set",A.mode=30;break}if(A.mode=20,H===6)break e;case 20:A.mode=21;case 21:if(6<=X&&258<=ue){N.next_out=ce,N.avail_out=ue,N.next_in=W,N.avail_in=X,A.hold=Z,A.bits=R,l(N,ne),ce=N.next_out,ie=N.output,ue=N.avail_out,W=N.next_in,J=N.input,X=N.avail_in,Z=A.hold,R=A.bits,A.mode===12&&(A.back=-1);break}for(A.back=0;K=(V=A.lencode[Z&(1<<A.lenbits)-1])>>>16&255,q=65535&V,!((T=V>>>24)<=R);){if(X===0)break e;X--,Z+=J[W++]<<R,R+=8}if(K&&!(240&K)){for(F=T,L=K,le=q;K=(V=A.lencode[le+((Z&(1<<F+L)-1)>>F)])>>>16&255,q=65535&V,!(F+(T=V>>>24)<=R);){if(X===0)break e;X--,Z+=J[W++]<<R,R+=8}Z>>>=F,R-=F,A.back+=F}if(Z>>>=T,R-=T,A.back+=T,A.length=q,K===0){A.mode=26;break}if(32&K){A.back=-1,A.mode=12;break}if(64&K){N.msg="invalid literal/length code",A.mode=30;break}A.extra=15&K,A.mode=22;case 22:if(A.extra){for(z=A.extra;R<z;){if(X===0)break e;X--,Z+=J[W++]<<R,R+=8}A.length+=Z&(1<<A.extra)-1,Z>>>=A.extra,R-=A.extra,A.back+=A.extra}A.was=A.length,A.mode=23;case 23:for(;K=(V=A.distcode[Z&(1<<A.distbits)-1])>>>16&255,q=65535&V,!((T=V>>>24)<=R);){if(X===0)break e;X--,Z+=J[W++]<<R,R+=8}if(!(240&K)){for(F=T,L=K,le=q;K=(V=A.distcode[le+((Z&(1<<F+L)-1)>>F)])>>>16&255,q=65535&V,!(F+(T=V>>>24)<=R);){if(X===0)break e;X--,Z+=J[W++]<<R,R+=8}Z>>>=F,R-=F,A.back+=F}if(Z>>>=T,R-=T,A.back+=T,64&K){N.msg="invalid distance code",A.mode=30;break}A.offset=q,A.extra=15&K,A.mode=24;case 24:if(A.extra){for(z=A.extra;R<z;){if(X===0)break e;X--,Z+=J[W++]<<R,R+=8}A.offset+=Z&(1<<A.extra)-1,Z>>>=A.extra,R-=A.extra,A.back+=A.extra}if(A.offset>A.dmax){N.msg="invalid distance too far back",A.mode=30;break}A.mode=25;case 25:if(ue===0)break e;if(se=ne-ue,A.offset>se){if((se=A.offset-se)>A.whave&&A.sane){N.msg="invalid distance too far back",A.mode=30;break}Y=se>A.wnext?(se-=A.wnext,A.wsize-se):A.wnext-se,se>A.length&&(se=A.length),$=A.window}else $=ie,Y=ce-A.offset,se=A.length;for(ue<se&&(se=ue),ue-=se,A.length-=se;ie[ce++]=$[Y++],--se;);A.length===0&&(A.mode=21);break;case 26:if(ue===0)break e;ie[ce++]=A.length,ue--,A.mode=21;break;case 27:if(A.wrap){for(;R<32;){if(X===0)break e;X--,Z|=J[W++]<<R,R+=8}if(ne-=ue,N.total_out+=ne,A.total+=ne,ne&&(N.adler=A.check=A.flags?a(A.check,ie,ne,ce-ne):s(A.check,ie,ne,ce-ne)),ne=ue,(A.flags?Z:g(Z))!==A.check){N.msg="incorrect data check",A.mode=30;break}R=Z=0}A.mode=28;case 28:if(A.wrap&&A.flags){for(;R<32;){if(X===0)break e;X--,Z+=J[W++]<<R,R+=8}if(Z!==(4294967295&A.total)){N.msg="incorrect length check",A.mode=30;break}R=Z=0}A.mode=29;case 29:re=1;break e;case 30:re=-3;break e;case 31:return-4;case 32:default:return f}return N.next_out=ce,N.avail_out=ue,N.next_in=W,N.avail_in=X,A.hold=Z,A.bits=R,(A.wsize||ne!==N.avail_out&&A.mode<30&&(A.mode<27||H!==4))&&oe(N,N.output,N.next_out,ne-N.avail_out)?(A.mode=31,-4):(ee-=N.avail_in,ne-=N.avail_out,N.total_in+=ee,N.total_out+=ne,A.total+=ne,A.wrap&&ne&&(N.adler=A.check=A.flags?a(A.check,ie,ne,N.next_out-ne):s(A.check,ie,ne,N.next_out-ne)),N.data_type=A.bits+(A.last?64:0)+(A.mode===12?128:0)+(A.mode===20||A.mode===15?256:0),(ee==0&&ne===0||H===4)&&re===p&&(re=-5),re)},o.inflateEnd=function(N){if(!N||!N.state)return f;var H=N.state;return H.window&&(H.window=null),N.state=null,p},o.inflateGetHeader=function(N,H){var A;return N&&N.state&&2&(A=N.state).wrap?((A.head=H).done=!1,p):f},o.inflateSetDictionary=function(N,H){var A,J=H.length;return N&&N.state?(A=N.state).wrap!==0&&A.mode!==11?f:A.mode===11&&s(1,H,J,0)!==A.check?-3:oe(N,H,J,J)?(A.mode=31,-4):(A.havedict=1,p):f},o.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(n,r,o){var i=n("../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];r.exports=function(u,d,p,f,h,m,y,g){var v,k,b,C,D,M,I,E,G,oe=g.bits,N=0,H=0,A=0,J=0,ie=0,W=0,ce=0,X=0,ue=0,Z=0,R=null,ee=0,ne=new i.Buf16(16),se=new i.Buf16(16),Y=null,$=0;for(N=0;N<=15;N++)ne[N]=0;for(H=0;H<f;H++)ne[d[p+H]]++;for(ie=oe,J=15;1<=J&&ne[J]===0;J--);if(J<ie&&(ie=J),J===0)return h[m++]=20971520,h[m++]=20971520,g.bits=1,0;for(A=1;A<J&&ne[A]===0;A++);for(ie<A&&(ie=A),N=X=1;N<=15;N++)if(X<<=1,(X-=ne[N])<0)return-1;if(0<X&&(u===0||J!==1))return-1;for(se[1]=0,N=1;N<15;N++)se[N+1]=se[N]+ne[N];for(H=0;H<f;H++)d[p+H]!==0&&(y[se[d[p+H]]++]=H);if(M=u===0?(R=Y=y,19):u===1?(R=s,ee-=257,Y=a,$-=257,256):(R=l,Y=c,-1),N=A,D=m,ce=H=Z=0,b=-1,C=(ue=1<<(W=ie))-1,u===1&&852<ue||u===2&&592<ue)return 1;for(;;){for(I=N-ce,G=y[H]<M?(E=0,y[H]):y[H]>M?(E=Y[$+y[H]],R[ee+y[H]]):(E=96,0),v=1<<N-ce,A=k=1<<W;h[D+(Z>>ce)+(k-=v)]=I<<24|E<<16|G|0,k!==0;);for(v=1<<N-1;Z&v;)v>>=1;if(v!==0?(Z&=v-1,Z+=v):Z=0,H++,--ne[N]==0){if(N===J)break;N=d[p+y[H]]}if(ie<N&&(Z&C)!==b){for(ce===0&&(ce=ie),D+=A,X=1<<(W=N-ce);W+ce<J&&!((X-=ne[W+ce])<=0);)W++,X<<=1;if(ue+=1<<W,u===1&&852<ue||u===2&&592<ue)return 1;h[b=Z&C]=ie<<24|W<<16|D-m|0}}return Z!==0&&(h[D+Z]=N-ce<<24|64<<16|0),g.bits=ie,0}},{"../utils/common":41}],51:[function(n,r,o){r.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(n,r,o){var i=n("../utils/common"),s=0,a=1;function l(V){for(var j=V.length;0<=--j;)V[j]=0}var c=0,u=29,d=256,p=d+1+u,f=30,h=19,m=2*p+1,y=15,g=16,v=7,k=256,b=16,C=17,D=18,M=[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],I=[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],E=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],G=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],oe=new Array(2*(p+2));l(oe);var N=new Array(2*f);l(N);var H=new Array(512);l(H);var A=new Array(256);l(A);var J=new Array(u);l(J);var ie,W,ce,X=new Array(f);function ue(V,j,de,fe,ae){this.static_tree=V,this.extra_bits=j,this.extra_base=de,this.elems=fe,this.max_length=ae,this.has_stree=V&&V.length}function Z(V,j){this.dyn_tree=V,this.max_code=0,this.stat_desc=j}function R(V){return V<256?H[V]:H[256+(V>>>7)]}function ee(V,j){V.pending_buf[V.pending++]=255&j,V.pending_buf[V.pending++]=j>>>8&255}function ne(V,j,de){V.bi_valid>g-de?(V.bi_buf|=j<<V.bi_valid&65535,ee(V,V.bi_buf),V.bi_buf=j>>g-V.bi_valid,V.bi_valid+=de-g):(V.bi_buf|=j<<V.bi_valid&65535,V.bi_valid+=de)}function se(V,j,de){ne(V,de[2*j],de[2*j+1])}function Y(V,j){for(var de=0;de|=1&V,V>>>=1,de<<=1,0<--j;);return de>>>1}function $(V,j,de){var fe,ae,me=new Array(y+1),we=0;for(fe=1;fe<=y;fe++)me[fe]=we=we+de[fe-1]<<1;for(ae=0;ae<=j;ae++){var he=V[2*ae+1];he!==0&&(V[2*ae]=Y(me[he]++,he))}}function T(V){var j;for(j=0;j<p;j++)V.dyn_ltree[2*j]=0;for(j=0;j<f;j++)V.dyn_dtree[2*j]=0;for(j=0;j<h;j++)V.bl_tree[2*j]=0;V.dyn_ltree[2*k]=1,V.opt_len=V.static_len=0,V.last_lit=V.matches=0}function K(V){8<V.bi_valid?ee(V,V.bi_buf):0<V.bi_valid&&(V.pending_buf[V.pending++]=V.bi_buf),V.bi_buf=0,V.bi_valid=0}function q(V,j,de,fe){var ae=2*j,me=2*de;return V[ae]<V[me]||V[ae]===V[me]&&fe[j]<=fe[de]}function F(V,j,de){for(var fe=V.heap[de],ae=de<<1;ae<=V.heap_len&&(ae<V.heap_len&&q(j,V.heap[ae+1],V.heap[ae],V.depth)&&ae++,!q(j,fe,V.heap[ae],V.depth));)V.heap[de]=V.heap[ae],de=ae,ae<<=1;V.heap[de]=fe}function L(V,j,de){var fe,ae,me,we,he=0;if(V.last_lit!==0)for(;fe=V.pending_buf[V.d_buf+2*he]<<8|V.pending_buf[V.d_buf+2*he+1],ae=V.pending_buf[V.l_buf+he],he++,fe===0?se(V,ae,j):(se(V,(me=A[ae])+d+1,j),(we=M[me])!==0&&ne(V,ae-=J[me],we),se(V,me=R(--fe),de),(we=I[me])!==0&&ne(V,fe-=X[me],we)),he<V.last_lit;);se(V,k,j)}function le(V,j){var de,fe,ae,me=j.dyn_tree,we=j.stat_desc.static_tree,he=j.stat_desc.has_stree,be=j.stat_desc.elems,ze=-1;for(V.heap_len=0,V.heap_max=m,de=0;de<be;de++)me[2*de]!==0?(V.heap[++V.heap_len]=ze=de,V.depth[de]=0):me[2*de+1]=0;for(;V.heap_len<2;)me[2*(ae=V.heap[++V.heap_len]=ze<2?++ze:0)]=1,V.depth[ae]=0,V.opt_len--,he&&(V.static_len-=we[2*ae+1]);for(j.max_code=ze,de=V.heap_len>>1;1<=de;de--)F(V,me,de);for(ae=be;de=V.heap[1],V.heap[1]=V.heap[V.heap_len--],F(V,me,1),fe=V.heap[1],V.heap[--V.heap_max]=de,V.heap[--V.heap_max]=fe,me[2*ae]=me[2*de]+me[2*fe],V.depth[ae]=(V.depth[de]>=V.depth[fe]?V.depth[de]:V.depth[fe])+1,me[2*de+1]=me[2*fe+1]=ae,V.heap[1]=ae++,F(V,me,1),2<=V.heap_len;);V.heap[--V.heap_max]=V.heap[1],function(Ce,ct){var x,O,_,P,B,U,te=ct.dyn_tree,ge=ct.max_code,xe=ct.stat_desc.static_tree,ke=ct.stat_desc.has_stree,Oe=ct.stat_desc.extra_bits,Ne=ct.stat_desc.extra_base,Je=ct.stat_desc.max_length,it=0;for(P=0;P<=y;P++)Ce.bl_count[P]=0;for(te[2*Ce.heap[Ce.heap_max]+1]=0,x=Ce.heap_max+1;x<m;x++)Je<(P=te[2*te[2*(O=Ce.heap[x])+1]+1]+1)&&(P=Je,it++),te[2*O+1]=P,ge<O||(Ce.bl_count[P]++,B=0,Ne<=O&&(B=Oe[O-Ne]),U=te[2*O],Ce.opt_len+=U*(P+B),ke&&(Ce.static_len+=U*(xe[2*O+1]+B)));if(it!==0){do{for(P=Je-1;Ce.bl_count[P]===0;)P--;Ce.bl_count[P]--,Ce.bl_count[P+1]+=2,Ce.bl_count[Je]--,it-=2}while(0<it);for(P=Je;P!==0;P--)for(O=Ce.bl_count[P];O!==0;)ge<(_=Ce.heap[--x])||(te[2*_+1]!==P&&(Ce.opt_len+=(P-te[2*_+1])*te[2*_],te[2*_+1]=P),O--)}}(V,j),$(me,ze,V.bl_count)}function S(V,j,de){var fe,ae,me=-1,we=j[1],he=0,be=7,ze=4;for(we===0&&(be=138,ze=3),j[2*(de+1)+1]=65535,fe=0;fe<=de;fe++)ae=we,we=j[2*(fe+1)+1],++he<be&&ae===we||(he<ze?V.bl_tree[2*ae]+=he:ae!==0?(ae!==me&&V.bl_tree[2*ae]++,V.bl_tree[2*b]++):he<=10?V.bl_tree[2*C]++:V.bl_tree[2*D]++,me=ae,ze=(he=0)===we?(be=138,3):ae===we?(be=6,3):(be=7,4))}function re(V,j,de){var fe,ae,me=-1,we=j[1],he=0,be=7,ze=4;for(we===0&&(be=138,ze=3),fe=0;fe<=de;fe++)if(ae=we,we=j[2*(fe+1)+1],!(++he<be&&ae===we)){if(he<ze)for(;se(V,ae,V.bl_tree),--he!=0;);else ae!==0?(ae!==me&&(se(V,ae,V.bl_tree),he--),se(V,b,V.bl_tree),ne(V,he-3,2)):he<=10?(se(V,C,V.bl_tree),ne(V,he-3,3)):(se(V,D,V.bl_tree),ne(V,he-11,7));me=ae,ze=(he=0)===we?(be=138,3):ae===we?(be=6,3):(be=7,4)}}l(X);var Q=!1;function z(V,j,de,fe){ne(V,(c<<1)+(fe?1:0),3),function(ae,me,we,he){K(ae),ee(ae,we),ee(ae,~we),i.arraySet(ae.pending_buf,ae.window,me,we,ae.pending),ae.pending+=we}(V,j,de)}o._tr_init=function(V){Q||(function(){var j,de,fe,ae,me,we=new Array(y+1);for(ae=fe=0;ae<u-1;ae++)for(J[ae]=fe,j=0;j<1<<M[ae];j++)A[fe++]=ae;for(A[fe-1]=ae,ae=me=0;ae<16;ae++)for(X[ae]=me,j=0;j<1<<I[ae];j++)H[me++]=ae;for(me>>=7;ae<f;ae++)for(X[ae]=me<<7,j=0;j<1<<I[ae]-7;j++)H[256+me++]=ae;for(de=0;de<=y;de++)we[de]=0;for(j=0;j<=143;)oe[2*j+1]=8,j++,we[8]++;for(;j<=255;)oe[2*j+1]=9,j++,we[9]++;for(;j<=279;)oe[2*j+1]=7,j++,we[7]++;for(;j<=287;)oe[2*j+1]=8,j++,we[8]++;for($(oe,p+1,we),j=0;j<f;j++)N[2*j+1]=5,N[2*j]=Y(j,5);ie=new ue(oe,M,d+1,p,y),W=new ue(N,I,0,f,y),ce=new ue(new Array(0),E,0,h,v)}(),Q=!0),V.l_desc=new Z(V.dyn_ltree,ie),V.d_desc=new Z(V.dyn_dtree,W),V.bl_desc=new Z(V.bl_tree,ce),V.bi_buf=0,V.bi_valid=0,T(V)},o._tr_stored_block=z,o._tr_flush_block=function(V,j,de,fe){var ae,me,we=0;0<V.level?(V.strm.data_type===2&&(V.strm.data_type=function(he){var be,ze=4093624447;for(be=0;be<=31;be++,ze>>>=1)if(1&ze&&he.dyn_ltree[2*be]!==0)return s;if(he.dyn_ltree[18]!==0||he.dyn_ltree[20]!==0||he.dyn_ltree[26]!==0)return a;for(be=32;be<d;be++)if(he.dyn_ltree[2*be]!==0)return a;return s}(V)),le(V,V.l_desc),le(V,V.d_desc),we=function(he){var be;for(S(he,he.dyn_ltree,he.l_desc.max_code),S(he,he.dyn_dtree,he.d_desc.max_code),le(he,he.bl_desc),be=h-1;3<=be&&he.bl_tree[2*G[be]+1]===0;be--);return he.opt_len+=3*(be+1)+5+5+4,be}(V),ae=V.opt_len+3+7>>>3,(me=V.static_len+3+7>>>3)<=ae&&(ae=me)):ae=me=de+5,de+4<=ae&&j!==-1?z(V,j,de,fe):V.strategy===4||me===ae?(ne(V,2+(fe?1:0),3),L(V,oe,N)):(ne(V,4+(fe?1:0),3),function(he,be,ze,Ce){var ct;for(ne(he,be-257,5),ne(he,ze-1,5),ne(he,Ce-4,4),ct=0;ct<Ce;ct++)ne(he,he.bl_tree[2*G[ct]+1],3);re(he,he.dyn_ltree,be-1),re(he,he.dyn_dtree,ze-1)}(V,V.l_desc.max_code+1,V.d_desc.max_code+1,we+1),L(V,V.dyn_ltree,V.dyn_dtree)),T(V),fe&&K(V)},o._tr_tally=function(V,j,de){return V.pending_buf[V.d_buf+2*V.last_lit]=j>>>8&255,V.pending_buf[V.d_buf+2*V.last_lit+1]=255&j,V.pending_buf[V.l_buf+V.last_lit]=255&de,V.last_lit++,j===0?V.dyn_ltree[2*de]++:(V.matches++,j--,V.dyn_ltree[2*(A[de]+d+1)]++,V.dyn_dtree[2*R(j)]++),V.last_lit===V.lit_bufsize-1},o._tr_align=function(V){ne(V,2,3),se(V,k,oe),function(j){j.bi_valid===16?(ee(j,j.bi_buf),j.bi_buf=0,j.bi_valid=0):8<=j.bi_valid&&(j.pending_buf[j.pending++]=255&j.bi_buf,j.bi_buf>>=8,j.bi_valid-=8)}(V)}},{"../utils/common":41}],53:[function(n,r,o){r.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(n,r,o){(function(i){(function(s,a){if(!s.setImmediate){var l,c,u,d,p=1,f={},h=!1,m=s.document,y=Object.getPrototypeOf&&Object.getPrototypeOf(s);y=y&&y.setTimeout?y:s,l={}.toString.call(s.process)==="[object process]"?function(b){Se.nextTick(function(){v(b)})}:function(){if(s.postMessage&&!s.importScripts){var b=!0,C=s.onmessage;return s.onmessage=function(){b=!1},s.postMessage("","*"),s.onmessage=C,b}}()?(d="setImmediate$"+Math.random()+"$",s.addEventListener?s.addEventListener("message",k,!1):s.attachEvent("onmessage",k),function(b){s.postMessage(d+b,"*")}):s.MessageChannel?((u=new MessageChannel).port1.onmessage=function(b){v(b.data)},function(b){u.port2.postMessage(b)}):m&&"onreadystatechange"in m.createElement("script")?(c=m.documentElement,function(b){var C=m.createElement("script");C.onreadystatechange=function(){v(b),C.onreadystatechange=null,c.removeChild(C),C=null},c.appendChild(C)}):function(b){setTimeout(v,0,b)},y.setImmediate=function(b){typeof b!="function"&&(b=new Function(""+b));for(var C=new Array(arguments.length-1),D=0;D<C.length;D++)C[D]=arguments[D+1];var M={callback:b,args:C};return f[p]=M,l(p),p++},y.clearImmediate=g}function g(b){delete f[b]}function v(b){if(h)setTimeout(v,0,b);else{var C=f[b];if(C){h=!0;try{(function(D){var M=D.callback,I=D.args;switch(I.length){case 0:M();break;case 1:M(I[0]);break;case 2:M(I[0],I[1]);break;case 3:M(I[0],I[1],I[2]);break;default:M.apply(a,I)}})(C)}finally{g(b),h=!1}}}}function k(b){b.source===s&&typeof b.data=="string"&&b.data.indexOf(d)===0&&v(+b.data.slice(d.length))}})(typeof self>"u"?i===void 0?this:i:self)}).call(this,typeof zt<"u"?zt:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(g1);var AT=g1.exports;const Ld=Wl(AT);let Pd=class{constructor(e={}){this.debug=e.debug||!1,this.zip=new Ld,this.files=[],this.media={},this.mediaFiles={},this.fonts={}}async getDocxData(e,n=!1){const r=await this.unzip(e),o=Object.entries(r.files),i={},s=["xml","rels"];for(const a of o){const[l,c]=a;if(s.some(u=>c.name.endsWith(u))){const u=await c.async("string");this.files.push({name:c.name,content:u})}else if(c.name.startsWith("word/media")&&c.name!=="word/media/")if(n){const u=(await c.async("nodebuffer")).toString("base64");i[c.name]=u}else{const u=await c.async("blob"),d=this.getFileExtension(c.name),p=await c.async("base64");this.mediaFiles[c.name]=`data:image/${d};base64,${p}`;const f=new File([u],c.name,{type:u.type}),h=URL.createObjectURL(f);this.media[c.name]=h}else if(c.name.startsWith("word/fonts")&&c.name!=="word/fonts/"){const u=await c.async("uint8array");this.fonts[c.name]=u}}return this.files}getFileExtension(e){return e.split(".").pop()}async updateContentTypes(e,n){const r=Object.keys(n).map(y=>this.getFileExtension(y)),o="[Content_Types].xml",i=await e.file(o).async("string");let s="";const a=IE(i),l=new Set;for(let y of r){if(a.includes(y)||l.has(y))continue;const g=`<Default Extension="${y}" ContentType="image/${y}"/>`;s+=g,l.add(y)}const c=JSON.parse(nf.xml2json(i,null,2)).elements?.find(y=>y.name==="Types")||{},u=c.elements?.some(y=>y.name==="Override"&&y.attributes.PartName==="/word/comments.xml"),d=c.elements?.some(y=>y.name==="Override"&&y.attributes.PartName==="/word/commentsExtended.xml"),p=c.elements?.some(y=>y.name==="Override"&&y.attributes.PartName==="/word/commentsIds.xml"),f=c.elements?.some(y=>y.name==="Override"&&y.attributes.PartName==="/word/commentsExtensible.xml");e.files["word/comments.xml"]&&(u||(s+='<Override PartName="/word/comments.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml" />')),e.files["word/commentsExtended.xml"]&&(d||(s+='<Override PartName="/word/commentsExtended.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtended+xml" />')),e.files["word/commentsIds.xml"]&&(p||(s+='<Override PartName="/word/commentsIds.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.commentsIds+xml" />')),e.files["word/commentsExtensible.xml"]&&(f||(s+='<Override PartName="/word/commentsExtensible.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtensible+xml" />'));const h='<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">',m=i.replace(h,`${h}${s}`);e.file(o,m)}async unzip(e){return await this.zip.loadAsync(e)}async updateZip({docx:e,updatedDocs:n,originalDocxFile:r,media:o,fonts:i,isHeadless:s}){let a;r?a=await this.exportFromOriginalFile(r,n,o):a=await this.exportFromCollaborativeDocx(e,n,o,i);const l=s?"nodebuffer":"blob";return await a.generateAsync({type:l})}async exportFromCollaborativeDocx(e,n,r,o){const i=new Ld;for(const s of e){const a=s.content;i.file(s.name,a)}Object.keys(n).forEach(s=>{const a=n[s];i.file(s,a)}),Object.keys(r).forEach(s=>{const a=mt.from(r[s],"base64");i.file(`word/media/${s}`,a)});for(const[s,a]of Object.entries(o))i.file(s,a);return await this.updateContentTypes(i,r),i}async exportFromOriginalFile(e,n,r){const o=await this.unzip(e),i=[];return o.forEach((s,a)=>{const l=a.async("string").then(c=>{o.file(a.name,c)});i.push(l)}),await Promise.all(i),Object.keys(n).forEach(s=>{o.file(s,n[s])}),Object.keys(r).forEach(s=>{o.file(`word/media/${s}`,r[s])}),await this.updateContentTypes(o,r),o}};var CT=Object.defineProperty,y1=t=>{throw TypeError(t)},ET=(t,e,n)=>e in t?CT(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Re=(t,e,n)=>ET(t,typeof e!="symbol"?e+"":e,n),uf=(t,e,n)=>e.has(t)||y1("Cannot "+n),Xn=(t,e,n)=>(uf(t,e,"read from private field"),n?n.call(t):e.get(t)),$r=(t,e,n)=>e.has(t)?y1("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),w1=(t,e,n,r)=>(uf(t,e,"write to private field"),e.set(t,n),n),Ae=(t,e,n)=>(uf(t,e,"access private method"),n);function Ws(t){const{from:e,to:n,empty:r}=t.selection,o=[];return r?(t.storedMarks&&o.push(...t.storedMarks),o.push(...t.selection.$head.marks())):t.doc.nodesBetween(e,n,i=>{o.push(...i.marks)}),o}const nc=(t,e,n=!1)=>{const{selection:r,doc:o}=t,{$from:i,$to:s}=r,a=i.marks().find(d=>d.type===e),l=s.marks().find(d=>d.type===e);let c;const u=[];return o.nodesBetween(i.pos,s.pos,(d,p)=>{if(d.marks){const f=d.marks.find(h=>h.type===e);f&&(c={from:p,to:p+d.nodeSize,attrs:f.attrs,contained:!a||!l||a===l},u.push(c))}}),n?u:c};function df(t){const{state:e}=t,{selection:n}=e,r=Ws(e),o=n.$head.parent.attrs.marksAttrs,i=r.filter(f=>!["textStyle","link"].includes(f.type.name)).map(f=>({name:f.type.name,attrs:f.attrs})),s=r.filter(f=>f.type.name==="textStyle");if(i.push(...s.flatMap(Vg)),o){const f=o.filter(m=>!["textStyle","link"].includes(m.type)).map(m=>({name:m.type,attrs:m.attrs||{}})),h=o.filter(m=>m.type==="textStyle");i.push(...f),i.push(...h.flatMap(Vg))}const a=e.schema.marks.link,l=nc(e,a);if(l){let{from:f,to:h,attrs:m}=l;n.from>=f&&n.to<=h&&i.push({name:"link",attrs:m})}const c=["paragraphSpacing"],u=TT(e);Object.keys(u).forEach(f=>{if(c.includes(f))return;const h={};h[f]=u[f],i.push({name:f,attrs:h})});const d=i.find(f=>f.name==="textColor"),p=i.find(f=>f.name==="textHighlight");return d&&i.push({name:"color",attrs:{color:d.attrs?.textColor}}),p&&i.push({name:"highlight",attrs:{color:p.attrs?.textHighlight}}),t.storage.formatCommands?.storedStyle&&i.push({name:"copyFormat",attrs:!0}),i}function Vg(t){const e=[],{attrs:n}=t;return Object.keys(n).forEach(r=>{n[r]&&e.push({name:r,attrs:{[r]:n[r]}})}),e}function TT(t){try{const{from:e,to:n,empty:r}=t.selection,o={},i=l=>{Object.keys(l.attrs).forEach(c=>{const u=l.attrs[c];u&&(o[c]=u)})};let s=e,a=n;return r?t.doc.nodesBetween(s,a+1,l=>i(l)):t.doc.nodesBetween(e,n,l=>i(l)),o}catch{return{}}}var hl=200,xt=function(){};xt.prototype.append=function(t){return t.length?(t=xt.from(t),!this.length&&t||t.length<hl&&this.leafAppend(t)||this.length<hl&&t.leafPrepend(this)||this.appendInner(t)):this};xt.prototype.prepend=function(t){return t.length?xt.from(t).append(this):this};xt.prototype.appendInner=function(t){return new $T(this,t)};xt.prototype.slice=function(t,e){return t===void 0&&(t=0),e===void 0&&(e=this.length),t>=e?xt.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))};xt.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};xt.prototype.forEach=function(t,e,n){e===void 0&&(e=0),n===void 0&&(n=this.length),e<=n?this.forEachInner(t,e,n,0):this.forEachInvertedInner(t,e,n,0)};xt.prototype.map=function(t,e,n){e===void 0&&(e=0),n===void 0&&(n=this.length);var r=[];return this.forEach(function(o,i){return r.push(t(o,i))},e,n),r};xt.from=function(t){return t instanceof xt?t:t&&t.length?new b1(t):xt.empty};var b1=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(r,o){return r==0&&o==this.length?this:new e(this.values.slice(r,o))},e.prototype.getInner=function(r){return this.values[r]},e.prototype.forEachInner=function(r,o,i,s){for(var a=o;a<i;a++)if(r(this.values[a],s+a)===!1)return!1},e.prototype.forEachInvertedInner=function(r,o,i,s){for(var a=o-1;a>=i;a--)if(r(this.values[a],s+a)===!1)return!1},e.prototype.leafAppend=function(r){if(this.length+r.length<=hl)return new e(this.values.concat(r.flatten()))},e.prototype.leafPrepend=function(r){if(this.length+r.length<=hl)return new e(r.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(xt);xt.empty=new b1([]);var $T=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(n){return n<this.left.length?this.left.get(n):this.right.get(n-this.left.length)},e.prototype.forEachInner=function(n,r,o,i){var s=this.left.length;if(r<s&&this.left.forEachInner(n,r,Math.min(o,s),i)===!1||o>s&&this.right.forEachInner(n,Math.max(r-s,0),Math.min(this.length,o)-s,i+s)===!1)return!1},e.prototype.forEachInvertedInner=function(n,r,o,i){var s=this.left.length;if(r>s&&this.right.forEachInvertedInner(n,r-s,Math.max(o,s)-s,i+s)===!1||o<s&&this.left.forEachInvertedInner(n,Math.min(r,s),o,i)===!1)return!1},e.prototype.sliceInner=function(n,r){if(n==0&&r==this.length)return this;var o=this.left.length;return r<=o?this.left.slice(n,r):n>=o?this.right.slice(n-o,r-o):this.left.slice(n,o).append(this.right.slice(0,r-o))},e.prototype.leafAppend=function(n){var r=this.right.leafAppend(n);if(r)return new e(this.left,r)},e.prototype.leafPrepend=function(n){var r=this.left.leafPrepend(n);if(r)return new e(r,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}(xt);const OT=500;let ws=class zo{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let o,i;n&&(o=this.remapping(r,this.items.length),i=o.maps.length);let s=e.tr,a,l,c=[],u=[];return this.items.forEach((d,p)=>{if(!d.step){o||(o=this.remapping(r,p+1),i=o.maps.length),i--,u.push(d);return}if(o){u.push(new fr(d.map));let f=d.step.map(o.slice(i)),h;f&&s.maybeStep(f).doc&&(h=s.mapping.maps[s.mapping.maps.length-1],c.push(new fr(h,void 0,void 0,c.length+u.length))),i--,h&&o.appendMap(h,i)}else s.maybeStep(d.step);if(d.selection)return a=o?d.selection.map(o.slice(i)):d.selection,l=new zo(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:s,selection:a}}addTransform(e,n,r,o){let i=[],s=this.eventCount,a=this.items,l=!o&&a.length?a.get(a.length-1):null;for(let u=0;u<e.steps.length;u++){let d=e.steps[u].invert(e.docs[u]),p=new fr(e.mapping.maps[u],d,n),f;(f=l&&l.merge(p))&&(p=f,u?i.pop():a=a.slice(0,a.length-1)),i.push(p),n&&(s++,n=void 0),o||(l=p)}let c=s-r.depth;return c>DT&&(a=MT(a,c),s-=c),new zo(a.append(i),s)}remapping(e,n){let r=new ni;return this.items.forEach((o,i)=>{let s=o.mirrorOffset!=null&&i-o.mirrorOffset>=e?r.maps.length-o.mirrorOffset:void 0;r.appendMap(o.map,s)},e,n),r}addMaps(e){return this.eventCount==0?this:new zo(this.items.append(e.map(n=>new fr(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],o=Math.max(0,this.items.length-n),i=e.mapping,s=e.steps.length,a=this.eventCount;this.items.forEach(p=>{p.selection&&a--},o);let l=n;this.items.forEach(p=>{let f=i.getMirror(--l);if(f==null)return;s=Math.min(s,f);let h=i.maps[f];if(p.step){let m=e.steps[f].invert(e.docs[f]),y=p.selection&&p.selection.map(i.slice(l+1,f));y&&a++,r.push(new fr(h,m,y))}else r.push(new fr(h))},o);let c=[];for(let p=n;p<s;p++)c.push(new fr(i.maps[p]));let u=this.items.slice(0,o).append(c).append(r),d=new zo(u,a);return d.emptyItemCount()>OT&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,o=[],i=0;return this.items.forEach((s,a)=>{if(a>=e)o.push(s),s.selection&&i++;else if(s.step){let l=s.step.map(n.slice(r)),c=l&&l.getMap();if(r--,c&&n.appendMap(c,r),l){let u=s.selection&&s.selection.map(n.slice(r));u&&i++;let d=new fr(c.invert(),l,u),p,f=o.length-1;(p=o.length&&o[f].merge(d))?o[f]=p:o.push(d)}}else s.map&&r--},this.items.length,0),new zo(xt.from(o.reverse()),i)}};ws.empty=new ws(xt.empty,0);function MT(t,e){let n;return t.forEach((r,o)=>{if(r.selection&&e--==0)return n=o,!1}),t.slice(n)}let fr=class v1{constructor(e,n,r,o){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=o}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new v1(n.getMap().invert(),n,this.selection)}}};class vr{constructor(e,n,r,o,i){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=o,this.prevComposition=i}}const DT=20;function _T(t,e,n,r){let o=n.getMeta(rr),i;if(o)return o.historyState;n.getMeta(FT)&&(t=new vr(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta(rr))return s.getMeta(rr).redo?new vr(t.done.addTransform(n,void 0,r,Ua(e)),t.undone,Ug(n.mapping.maps),t.prevTime,t.prevComposition):new vr(t.done,t.undone.addTransform(n,void 0,r,Ua(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=t.prevTime==0||!s&&t.prevComposition!=a&&(t.prevTime<(n.time||0)-r.newGroupDelay||!NT(n,t.prevRanges)),c=s?Eu(t.prevRanges,n.mapping):Ug(n.mapping.maps);return new vr(t.done.addTransform(n,l?e.selection.getBookmark():void 0,r,Ua(e)),ws.empty,c,n.time,a??t.prevComposition)}else return(i=n.getMeta("rebased"))?new vr(t.done.rebased(n,i),t.undone.rebased(n,i),Eu(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new vr(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Eu(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function NT(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,o)=>{for(let i=0;i<e.length;i+=2)r<=e[i+1]&&o>=e[i]&&(n=!0)}),n}function Ug(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,o,i,s)=>e.push(i,s));return e}function Eu(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let o=e.map(t[r],1),i=e.map(t[r+1],-1);o<=i&&n.push(o,i)}return n}function IT(t,e,n){let r=Ua(e),o=rr.get(e).spec.config,i=(n?t.undone:t.done).popEvent(e,r);if(!i)return null;let s=i.selection.resolve(i.transform.doc),a=(n?t.done:t.undone).addTransform(i.transform,e.selection.getBookmark(),o,r),l=new vr(n?a:i.remaining,n?i.remaining:a,null,0,-1);return i.transform.setSelection(s).setMeta(rr,{redo:n,historyState:l})}let Tu=!1,Hg=null;function Ua(t){let e=t.plugins;if(Hg!=e){Tu=!1,Hg=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Tu=!0;break}}return Tu}const rr=new Ge("history"),FT=new Ge("closeHistory");function RT(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Ue({key:rr,state:{init(){return new vr(ws.empty,ws.empty,null,0,-1)},apply(e,n,r){return _T(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,o=r=="historyUndo"?k1:r=="historyRedo"?S1:null;return o?(n.preventDefault(),o(e.state,e.dispatch)):!1}}}})}function x1(t,e){return(n,r)=>{let o=rr.getState(n);if(!o||(t?o.undone:o.done).eventCount==0)return!1;if(r){let i=IT(o,n,t);i&&r(i.scrollIntoView())}return!0}}const k1=x1(!1),S1=x1(!0);function BT(t){let e=rr.getState(t);return e?e.done.eventCount:0}function LT(t){let e=rr.getState(t);return e?e.undone.eventCount:0}function Fe(t,e,n={}){return typeof t.config[e]=="function"?t.config[e].bind({...n}):t.config[e]}class Ye{constructor(e){Re(this,"type","extension"),Re(this,"name","extension"),Re(this,"options"),Re(this,"storage"),Re(this,"config",{name:this.name}),this.config={...this.config,...e},this.name=this.config.name,this.config.addOptions&&(this.options=Ke(Fe(this,"addOptions",{name:this.name}))),this.storage=Ke(Fe(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(...e){return new Ye(...e)}}const A1=Ye.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addPmPlugins(){return[RT(this.options)]},addCommands(){return{undo:()=>({state:t,dispatch:e,tr:n})=>(n.setMeta("inputType","historyUndo"),k1(t,e)),redo:()=>({state:t,dispatch:e,tr:n})=>(n.setMeta("inputType","historyRedo"),S1(t,e))}},addShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-Shift-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo()}}});let He=class C1{constructor(e){Re(this,"type","node"),Re(this,"name","node"),Re(this,"options"),Re(this,"storage"),Re(this,"config",{name:this.name}),this.config={...this.config,...e},this.name=this.config.name,this.config.addOptions&&(this.options=Ke(Fe(this,"addOptions",{name:this.name}))),this.storage=Ke(Fe(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(...e){return new C1(...e)}},tn=class E1{constructor(e){Re(this,"type","mark"),Re(this,"name","mark"),Re(this,"options"),Re(this,"storage"),Re(this,"isExternal"),Re(this,"config",{name:this.name}),this.config={...this.config,...e},this.name=this.config.name,this.isExternal=!!this.config.isExternal,this.config.addOptions&&(this.options=Ke(Fe(this,"addOptions",{name:this.name}))),this.storage=Ke(Fe(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(...e){return new E1(...e)}};function pt(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}' in schema.`);return e.nodes[t]}return t}function cr(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}' in schema.`);return e.marks[t]}return t}function Gs(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}var ml,T1,$1;let Te=class{static getAttributesFromExtensions(e){const n=[],r={default:null,rendered:!0,renderDOM:null,parseDOM:null,keepOnSplit:!0},o=Ae(this,ml,T1).call(this,e,r),i=Ae(this,ml,$1).call(this,e,r);return n.push(...o,...i),n}static insertExtensionAttrsToParseRule(e,n){return"style"in e?e:{...e,getAttrs:r=>{const o=e.getAttrs?e.getAttrs(r):e.attrs;if(o===!1)return!1;const i=a=>typeof a!="string"?a:a.match(/^[+-]?(\d*\.)?\d+$/)?Number(a):a==="true"?!0:a==="false"?!1:a;let s={};for(const a of n){const l=a.attribute.parseDOM?a.attribute.parseDOM(r):i(r.getAttribute(a.name));l!=null&&(s={...s,[a.name]:l})}return{...o,...s}}}}static getAttributesToRender(e,n){const r=n.filter(i=>i.attribute.rendered).map(i=>i.attribute.renderDOM?i.attribute.renderDOM(e.attrs)||{}:{[i.name]:e.attrs[i.name]});let o={};for(const i of r)o=this.mergeAttributes(o,i);return o}static mergeAttributes(...e){const n=e.filter(o=>!!o);let r={};for(const o of n){const i={...r};for(const[s,a]of Object.entries(o)){if(!i[s]){i[s]=a;continue}if(s==="class"){const l=a?a.split(" "):[],c=i[s]?i[s].split(" "):[],u=l.filter(d=>!c.includes(d));i[s]=[...c,...u].join(" ")}else s==="style"?i[s]=[i[s],a].join("; "):i[s]=a}r=i}return r}static getSplittedAttributes(e,n,r){const o=Object.entries(r).filter(([i])=>{const s=e.find(a=>a.type===n&&a.name===i);return s?s.attribute.keepOnSplit:!1});return Object.fromEntries(o)}static getMarkAttributes(e,n){const r=cr(n,e.schema),o=Ws(e).find(i=>i.type.name===r.name);return o?{...o.attrs}:{}}static getNodeAttributes(e,n){const r=pt(n,e.schema),{from:o,to:i}=e.selection,s=[];e.doc.nodesBetween(o,i,l=>{s.push(l)});const a=s.reverse().find(l=>l.type.name===r.name);return a?{...a.attrs}:{}}static getAttributes(e,n){const r=Gs(typeof n=="string"?n:n.name,e.schema);return r==="node"?this.getNodeAttributes(e,n):r==="mark"?this.getMarkAttributes(e,n):{}}};ml=new WeakSet,T1=function(t,e){const n=[],r=o=>{for(const i of o.types){const s=Object.entries(o.attributes);for(const[a,l]of s)n.push({type:i,name:a,attribute:{...e,...l}})}};for(const o of t){const i={name:o.name,options:o.options,storage:o.storage},s=Fe(o,"addGlobalAttributes",i);if(!s)continue;const a=s();for(const l of a)r(l)}return n},$1=function(t,e){const n=[],r=t.filter(o=>o.type==="node"||o.type==="mark");for(const o of r){const i={name:o.name,options:o.options,storage:o.storage},s=Fe(o,"addAttributes",i);if(!s)continue;const a=s();for(const[l,c]of Object.entries(a)){const u={...e,...c};typeof u.default=="function"&&(u.default=u.default()),n.push({type:o.name,name:l,attribute:u})}}return n},$r(Te,ml);function zd(t){const e=Object.entries(t).filter(([n,r])=>n==="attrs"&&EE(r)?!1:r!=null);return Object.fromEntries(e)}var gl,O1,M1;const D1=class jd{static createSchemaByExtensions(e,n){var r,o;const i=e.filter(d=>d.type==="node"),s=e.filter(d=>d.type==="mark"),a=i.find(d=>Fe(d,"topNode"))?.name,l=Te.getAttributesFromExtensions(e),c=Ae(r=jd,gl,O1).call(r,i,l,n),u=Ae(o=jd,gl,M1).call(o,s,l,n);return new sv({topNode:a,nodes:c,marks:u})}};gl=new WeakSet,O1=function(t,e,n){const r=t.map(o=>{const i=e.filter(f=>f.type===o.name),s={name:o.name,options:o.options,storage:o.storage,editor:n},a=Object.fromEntries(i.map(f=>[f.name,{default:f?.attribute?.default}])),l=t.reduce((f,h)=>{const m=Fe(h,"extendNodeSchema",s);return{...f,...m?m(o):{}}},{}),c=zd({content:Ke(Fe(o,"content",s)),group:Ke(Fe(o,"group",s)),marks:Ke(Fe(o,"marks",s)),inline:Ke(Fe(o,"inline",s)),atom:Ke(Fe(o,"atom",s)),selectable:Ke(Fe(o,"selectable",s)),draggable:Ke(Fe(o,"draggable",s)),code:Ke(Fe(o,"code",s)),defining:Ke(Fe(o,"defining",s)),isolating:Ke(Fe(o,"isolating",s)),attrs:a,...l}),u=Ke(Fe(o,"parseDOM",s));u&&(c.parseDOM=u.map(f=>Te.insertExtensionAttrsToParseRule(f,i)));const d=Fe(o,"renderDOM",s);d&&(c.toDOM=f=>d({node:f,htmlAttributes:Te.getAttributesToRender(f,i)}));const p=Fe(o,"renderText",s);return p&&(c.toText=p),[o.name,c]});return Object.fromEntries(r)},M1=function(t,e,n){const r=t.map(o=>{const i=e.filter(d=>d.type===o.name),s={name:o.name,options:o.options,storage:o.storage,editor:n},a=Object.fromEntries(i.map(d=>[d.name,{default:d?.attribute?.default}])),l=zd({group:Ke(Fe(o,"group",s)),inclusive:Ke(Fe(o,"inclusive",s)),excludes:Ke(Fe(o,"excludes",s)),spanning:Ke(Fe(o,"spanning",s)),code:Ke(Fe(o,"code",s)),attrs:a}),c=Ke(Fe(o,"parseDOM",s));c&&(l.parseDOM=c.map(d=>Te.insertExtensionAttrsToParseRule(d,i)));const u=Fe(o,"renderDOM",s);return u&&(l.toDOM=d=>u({mark:d,htmlAttributes:Te.getAttributesToRender(d,i)})),[o.name,l]});return Object.fromEntries(r)},$r(D1,gl);let PT=D1;function pf(t,e){let{selection:n,doc:r,storedMarks:o}=t;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 r},get tr(){return n=t.selection,r=t.doc,o=t.storedMarks,t}}}let _1=class N1{constructor(e){Re(this,"editor"),Re(this,"rawCommands"),this.editor=e.editor,this.rawCommands=this.editor.extensionService.commands}static create(...e){return new N1(...e)}get state(){return this.editor.state}get commands(){const{editor:e,state:n}=this,{view:r}=e,{tr:o}=n,i=this.createProps(o),s=Object.entries(this.rawCommands).map(([a,l])=>[a,(...c)=>{const u=l(...c)(i);return o.getMeta("preventDispatch")||r.dispatch(o),u}]);return Object.fromEntries(s)}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){const{editor:r,state:o,rawCommands:i}=this,{view:s}=r,a=[],l=!!e,c=e||o.tr,u=()=>(!l&&n&&!c.getMeta("preventDispatch")&&s.dispatch(c),a.every(f=>f===!0)),d=Object.entries(i).map(([f,h])=>[f,(...m)=>{const y=this.createProps(c,n),g=h(...m)(y);return a.push(g),p}]),p={...Object.fromEntries(d),run:u};return p}createCan(e){const{rawCommands:n,state:r}=this,o=!1,i=e||r.tr,s=this.createProps(i,o);return{...Object.fromEntries(Object.entries(n).map(([a,l])=>[a,(...c)=>l(...c)({...s,dispatch:void 0})])),chain:()=>this.createChain(i,o)}}createProps(e,n=!0){const{editor:r,state:o,rawCommands:i}=this,{view:s}=r,a={tr:e,editor:r,view:s,state:pf(e,o),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(i).map(([l,c])=>[l,(...u)=>c(...u)(a)]))}};return a}};const zT=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1},jT=t=>e=>t(e),qT=()=>({tr:t})=>(t.insertText(" ",t.selection.from,t.selection.to),!0),I1=({tr:t,state:e,dispatch:n})=>{const{from:r}=t.selection,o=e.schema.text(" ");return t=t.replaceSelectionWith(o),t=t.setSelection(Pe.create(t.doc,r+1)),n&&n(t),!0},VT=()=>({tr:t,state:e,dispatch:n})=>{const r=t.selection.from,o=e.schema?.nodes?.tab?.create();return o?(t.insert(r,o),n&&n(t),!0):I1({tr:t,state:e,dispatch:n})},UT=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),ff=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function HT(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const F1=(t,e,n)=>{let r=HT(t,n);if(!r)return!1;let o=B1(r);if(!o){let s=r.blockRange(),a=s&&Us(s);return a==null?!1:(e&&e(t.tr.lift(s,a).scrollIntoView()),!0)}let i=o.nodeBefore;if(U1(t,o,e,-1))return!0;if(r.parent.content.size==0&&(li(i,"end")||_e.isSelectable(i)))for(let s=r.depth;;s--){let a=af(t.doc,r.before(s),r.after(s),ve.empty);if(a&&a.slice.size<a.to-a.from){if(e){let l=t.tr.step(a);l.setSelection(li(i,"end")?je.findFrom(l.doc.resolve(l.mapping.map(o.pos,-1)),-1):_e.create(l.doc,o.pos-i.nodeSize)),e(l.scrollIntoView())}return!0}if(s==1||r.node(s-1).childCount>1)break}return i.isAtom&&o.depth==r.depth-1?(e&&e(t.tr.delete(o.pos-i.nodeSize,o.pos).scrollIntoView()),!0):!1};function li(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const R1=(t,e,n)=>{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;i=B1(r)}let s=i&&i.nodeBefore;return!s||!_e.isSelectable(s)?!1:(e&&e(t.tr.setSelection(_e.create(t.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)};function B1(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 WT(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const L1=(t,e,n)=>{let r=WT(t,n);if(!r)return!1;let o=z1(r);if(!o)return!1;let i=o.nodeAfter;if(U1(t,o,e,1))return!0;if(r.parent.content.size==0&&(li(i,"start")||_e.isSelectable(i))){let s=af(t.doc,r.before(),r.after(),ve.empty);if(s&&s.slice.size<s.to-s.from){if(e){let a=t.tr.step(s);a.setSelection(li(i,"start")?je.findFrom(a.doc.resolve(a.mapping.map(o.pos)),1):_e.create(a.doc,a.mapping.map(o.pos))),e(a.scrollIntoView())}return!0}}return i.isAtom&&o.depth==r.depth-1?(e&&e(t.tr.delete(o.pos,o.pos+i.nodeSize).scrollIntoView()),!0):!1},P1=(t,e,n)=>{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;i=z1(r)}let s=i&&i.nodeAfter;return!s||!_e.isSelectable(s)?!1:(e&&e(t.tr.setSelection(_e.create(t.doc,i.pos)).scrollIntoView()),!0)};function z1(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const GT=(t,e)=>{let n=t.selection,r=n instanceof _e,o;if(r){if(n.node.isTextblock||!Pr(t.doc,n.from))return!1;o=n.from}else if(o=bv(t.doc,n.from,-1),o==null)return!1;if(e){let i=t.tr.join(o);r&&i.setSelection(_e.create(i.doc,o-t.doc.resolve(o).nodeBefore.nodeSize)),e(i.scrollIntoView())}return!0},KT=(t,e)=>{let n=t.selection,r;if(n instanceof _e){if(n.node.isTextblock||!Pr(t.doc,n.to))return!1;r=n.to}else if(r=bv(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},j1=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
40
+ `).scrollIntoView()),!0)};function hf(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const JT=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),i=n.indexAfter(-1),s=hf(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(e){let a=n.after(),l=t.tr.replaceWith(a,a,s.createAndFill());l.setSelection(je.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},q1=(t,e)=>{let n=t.selection,{$from:r,$to:o}=n;if(n instanceof Nn||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=hf(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){let s=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,a=t.tr.insert(s,i.createAndFill());a.setSelection(Pe.create(a.doc,s+1)),e(a.scrollIntoView())}return!0},V1=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let i=n.before();if(tr(t.doc,i))return e&&e(t.tr.split(i).scrollIntoView()),!0}let r=n.blockRange(),o=r&&Us(r);return o==null?!1:(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)};function XT(t){return(e,n)=>{let{$from:r,$to:o}=e.selection;if(e.selection instanceof _e&&e.selection.node.isBlock)return!r.parentOffset||!tr(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let i=[],s,a,l=!1,c=!1;for(let f=r.depth;;f--)if(r.node(f).isBlock){l=r.end(f)==r.pos+(r.depth-f),c=r.start(f)==r.pos-(r.depth-f),a=hf(r.node(f-1).contentMatchAt(r.indexAfter(f-1))),i.unshift(l&&a?{type:a}:null),s=f;break}else{if(f==1)return!1;i.unshift(null)}let u=e.tr;(e.selection instanceof Pe||e.selection instanceof Nn)&&u.deleteSelection();let d=u.mapping.map(r.pos),p=tr(u.doc,d,i.length,i);if(p||(i[0]=a?{type:a}:null,p=tr(u.doc,d,i.length,i)),!p)return!1;if(u.split(d,i.length,i),!l&&c&&r.node(s).type!=a){let f=u.mapping.map(r.before(s)),h=u.doc.resolve(f);a&&r.node(s-1).canReplaceWith(h.index(),h.index()+1,a)&&u.setNodeMarkup(u.mapping.map(r.before(s)),a)}return n&&n(u.scrollIntoView()),!0}}const YT=XT(),ZT=(t,e)=>(e&&e(t.tr.setSelection(new Nn(t.doc))),!0);function QT(t,e,n){let r=e.nodeBefore,o=e.nodeAfter,i=e.index();return!r||!o||!r.type.compatibleContent(o.type)?!1:!r.content.size&&e.parent.canReplace(i-1,i)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(i,i+1)||!(o.isTextblock||Pr(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function U1(t,e,n,r){let o=e.nodeBefore,i=e.nodeAfter,s,a,l=o.type.spec.isolating||i.type.spec.isolating;if(!l&&QT(t,e,n))return!0;let c=!l&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(s=(a=o.contentMatchAt(o.childCount)).findWrapping(i.type))&&a.matchType(s[0]||i.type).validEnd){if(n){let f=e.pos+i.nodeSize,h=ye.empty;for(let g=s.length-1;g>=0;g--)h=ye.from(s[g].create(null,h));h=ye.from(o.copy(h));let m=t.tr.step(new Zt(e.pos-1,f,e.pos,f,new ve(h,1,0),s.length,!0)),y=m.doc.resolve(f+2*s.length);y.nodeAfter&&y.nodeAfter.type==o.type&&Pr(m.doc,y.pos)&&m.join(y.pos),n(m.scrollIntoView())}return!0}let u=i.type.spec.isolating||r>0&&l?null:je.findFrom(e,1),d=u&&u.$from.blockRange(u.$to),p=d&&Us(d);if(p!=null&&p>=e.depth)return n&&n(t.tr.lift(d,p).scrollIntoView()),!0;if(c&&li(i,"start",!0)&&li(o,"end")){let f=o,h=[];for(;h.push(f),!f.isTextblock;)f=f.lastChild;let m=i,y=1;for(;!m.isTextblock;m=m.firstChild)y++;if(f.canReplace(f.childCount,f.childCount,m.content)){if(n){let g=ye.empty;for(let k=h.length-1;k>=0;k--)g=ye.from(h[k].copy(g));let v=t.tr.step(new Zt(e.pos-h.length,e.pos+i.nodeSize,e.pos+y,e.pos+i.nodeSize-y,new ve(g,h.length,0),0,!0));n(v.scrollIntoView())}return!0}}return!1}function H1(t){return function(e,n){let r=e.selection,o=t<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return o.node(i).isTextblock?(n&&n(e.tr.setSelection(Pe.create(e.doc,t<0?o.start(i):o.end(i)))),!0):!1}}const e$=H1(-1),t$=H1(1);function Wg(t,e=null){return function(n,r){let o=!1;for(let i=0;i<n.selection.ranges.length&&!o;i++){let{$from:{pos:s},$to:{pos:a}}=n.selection.ranges[i];n.doc.nodesBetween(s,a,(l,c)=>{if(o)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)o=!0;else{let u=n.doc.resolve(c),d=u.index();o=u.parent.canReplaceWith(d,d+1,t)}})}if(!o)return!1;if(r){let i=n.tr;for(let s=0;s<n.selection.ranges.length;s++){let{$from:{pos:a},$to:{pos:l}}=n.selection.ranges[s];i.setBlockType(a,l,t,e)}r(i.scrollIntoView())}return!0}}function mf(...t){return function(e,n,r){for(let o=0;o<t.length;o++)if(t[o](e,n,r))return!0;return!1}}mf(ff,F1,R1);mf(ff,L1,P1);mf(j1,q1,V1,YT);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function W1(t){for(let e=0;e<t.edgeCount;e++){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const Gg=(t,e)=>{const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(o=>e?.includes(o.type.name));t.tr.ensureMarks(r)}},n$=({keepMarks:t=!0}={})=>e=>{const{tr:n,state:r,dispatch:o,editor:i}=e,{selection:s,doc:a}=n,{$from:l,$to:c}=s,u=i.extensionService.attributes,d=Te.getSplittedAttributes(u,l.node().type.name,l.node().attrs);if(s instanceof _e&&s.node.isBlock)return!l.parentOffset||!tr(a,l.pos)?!1:(o&&(t&&Gg(r,i.extensionService.splittableMarks),n.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;if(o){const p=c.parentOffset===c.parent.content.size;s instanceof Pe&&n.deleteSelection();const f=l.depth===0?null:W1(l.node(-1).contentMatchAt(l.indexAfter(-1)));let h=p&&f?[{type:f,attrs:d}]:void 0,m=tr(n.doc,n.mapping.map(l.pos),1,h);if(!h&&!m&&tr(n.doc,n.mapping.map(l.pos),1,f?[{type:f}]:void 0)&&(m=!0,h=f?[{type:f,attrs:d}]:void 0),m&&(n.split(n.mapping.map(l.pos),1,h),f&&!p&&!l.parentOffset&&l.parent.type!==f)){const y=n.mapping.map(l.before()),g=n.doc.resolve(y);l.node(-1).canReplaceWith(g.index(),g.index()+1,f)&&n.setNodeMarkup(n.mapping.map(l.before()),f)}t&&Gg(r,i.extensionService.splittableMarks),n.scrollIntoView()}return!0},r$=()=>({state:t,dispatch:e})=>V1(t,e),o$=()=>({state:t,dispatch:e})=>q1(t,e),i$=()=>({state:t,dispatch:e})=>j1(t,e),s$=()=>({state:t,dispatch:e})=>JT(t,e),G1=t=>{};function a$(t,e,n,r){let{selection:o}=n;t.options.isHeaderOrFooter&&(o=t.options.lastSelection);let i=null;if(G1()&&(i=o.$cursor),i){const s=e.storedMarks??i.marks();return!!r.isInSet(s)||!s.some(a=>a.type.excludes(r))}return o.ranges.some(({$from:s,$to:a})=>{let l=s.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(r):!1;return e.doc.nodesBetween(s.pos,a.pos,(c,u,d)=>{if(l)return!1;if(c.isInline){const p=!d||d.type.allowsMarkType(r),f=!!r.isInSet(c.marks)||!c.marks.some(h=>h.type.excludes(r));l=p&&f}return!l}),l})}const l$=(t,e={})=>({tr:n,state:r,dispatch:o,editor:i})=>{let{selection:s}=n;i.options.isHeaderOrFooter&&(s=i.options.lastSelection);const{empty:a,ranges:l}=s,c=cr(t,r.schema);if(o)if(a){const u=Te.getMarkAttributes(r,c);n.addStoredMark(c.create({...u,...e}))}else l.forEach(u=>{const d=u.$from.pos,p=u.$to.pos;r.doc.nodesBetween(d,p,(f,h)=>{const m=Math.max(h,d),y=Math.min(h+f.nodeSize,p);f.marks.find(g=>g.type===c)?f.marks.forEach(g=>{c===g.type&&n.addMark(m,y,c.create({...g.attrs,...e}))}):n.addMark(m,y,c.create(e))})});return a$(i,r,n,c)};function qd(t,e,n={}){return t.find(r=>r.type===e&&oi(r.attrs,n))}function c$(t,e,n={}){return!!qd(t,e,n)}function gf(t,e,n={}){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if(t.parentOffset===r.offset&&r.offset!==0&&(r=t.parent.childBefore(t.parentOffset)),!r.node)return;const o=qd([...r.node.marks],e,n);if(!o)return;let i=r.index,s=t.start()+r.offset,a=i+1,l=s+r.node.nodeSize;for(qd([...r.node.marks],e,n);i>0&&o.isInSet(t.parent.child(i-1).marks);)i-=1,s-=t.parent.child(i).nodeSize;for(;a<t.parent.childCount&&c$([...t.parent.child(a).marks],e,n);)l+=t.parent.child(a).nodeSize,a+=1;return{from:s,to:l}}const u$=(t,e={})=>({tr:n,state:r,dispatch:o,editor:i})=>{const{extendEmptyMarkRange:s=!1}=e;let{selection:a}=n;i.options.isHeaderOrFooter&&(a=i.options.lastSelection);const l=cr(t,r.schema),{$from:c,empty:u,ranges:d}=a;if(!o)return!0;if(u&&s){let{from:p,to:f}=a;const h=c.marks().find(y=>y.type===l)?.attrs,m=gf(c,l,h);m&&(p=m.from,f=m.to),n.removeMark(p,f,l)}else d.forEach(p=>{n.removeMark(p.$from.pos,p.$to.pos,l)});return n.removeStoredMark(l),!0},d$=()=>({tr:t,dispatch:e,editor:n})=>{let{selection:r}=t;n.options.isHeaderOrFooter&&(r=n.options.lastSelection);const{empty:o,ranges:i}=r;return o||e&&i.forEach(s=>{t.removeMark(s.$from.pos,s.$to.pos)}),!0};function yl(t,e,n={}){const{empty:r,ranges:o}=t.selection,i=e?cr(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(u=>i?i.name===u.type.name:!0).find(u=>oi(u.attrs,n,{strict:!1}));let s=0;const a=[];if(o.forEach(({$from:u,$to:d})=>{const p=u.pos,f=d.pos;t.doc.nodesBetween(p,f,(h,m)=>{if(!h.isText&&!h.marks.length)return;const y=Math.max(p,m),g=Math.min(f,m+h.nodeSize),v=g-y;s+=v,a.push(...h.marks.map(k=>({mark:k,from:y,to:g})))})}),s===0)return!1;const l=a.filter(u=>i?i.name===u.mark.type.name:!0).filter(u=>oi(u.mark.attrs,n,{strict:!1})).reduce((u,d)=>u+d.to-d.from,0),c=a.filter(u=>i?u.mark.type!==i&&u.mark.type.excludes(i):!0).reduce((u,d)=>u+d.to-d.from,0);return(l>0?l+c:l)>=s}const p$=(t,e={},n={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:i=!1}=n,s=cr(t,r.schema);return yl(r,s,e)?o.unsetMark(s,{extendEmptyMarkRange:i}):o.setMark(s,e)},f$=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:o}=r;return n&&o.forEach(({$from:i,$to:s})=>{t.doc.nodesBetween(i.pos,s.pos,(a,l)=>{if(a.type.isText)return;const{doc:c,mapping:u}=e,d=c.resolve(u.map(l)),p=c.resolve(u.map(l+a.nodeSize)),f=d.blockRange(p);if(!f)return;const h=Us(f);if(a.type.isTextblock){const{defaultType:m}=d.parent.contentMatchAt(d.index());e.setNodeMarkup(f.start,m)}(h||h===0)&&e.lift(f,h)})}),!0},h$=(t,e={})=>({state:n,dispatch:r,chain:o})=>{const i=pt(t,n.schema);return i.isTextblock?o().command(({commands:s})=>Wg(i,e)(n)?!0:s.clearNodes()).command(({state:s})=>Wg(i,e)(s,r)).run():!1};function wl(t,e,n={}){const{from:r,to:o,empty:i}=t.selection,s=e?pt(e,t.schema):null,a=[];t.doc.nodesBetween(r,o,(u,d)=>{if(u.isText)return;const p=Math.max(r,d),f=Math.min(o,d+u.nodeSize);a.push({node:u,from:p,to:f})});const l=o-r,c=a.filter(u=>s?s.name===u.node.type.name:!0).filter(u=>oi(u.node.attrs,n,{strict:!1}));return i?!!c.length:c.reduce((u,d)=>u+d.to-d.from,0)>=l}const m$=(t,e,n={})=>({state:r,commands:o})=>{const i=pt(t,r.schema),s=pt(e,r.schema);return wl(r,i,n)?o.setNode(s):o.setNode(i,n)},g$=()=>({state:t,dispatch:e})=>ZT(t,e),y$=()=>({state:t,dispatch:e})=>ff(t,e),w$=(t,e={})=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const a=Gs(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(i=pt(t,r.schema)),a==="mark"&&(s=cr(t,r.schema)),o&&n.selection.ranges.forEach(l=>{const c=l.$from.pos,u=l.$to.pos;r.doc.nodesBetween(c,u,(d,p)=>{i&&i===d.type&&n.setNodeMarkup(p,void 0,{...d.attrs,...e}),s&&d.marks.length&&d.marks.forEach(f=>{if(s===f.type){const h=Math.max(p,c),m=Math.min(p+d.nodeSize,u);n.addMark(h,m,s.create({...f.attrs,...e}))}})})}),!0):!1},b$=(t,e)=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const a=Gs(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(i=pt(t,r.schema)),a==="mark"&&(s=cr(t,r.schema)),o&&n.selection.ranges.forEach(l=>{r.doc.nodesBetween(l.$from.pos,l.$to.pos,(c,u)=>{i&&i===c.type&&n.setNodeMarkup(u,void 0,Og(c.attrs,e)),s&&c.marks.length&&c.marks.forEach(d=>{s===d.type&&n.addMark(u,u+c.nodeSize,s.create(Og(d.attrs,e)))})})}),!0):!1},v$=()=>({state:t,dispatch:e})=>GT(t,e),x$=()=>({state:t,dispatch:e})=>KT(t,e),k$=()=>({state:t,dispatch:e})=>F1(t,e),S$=()=>({state:t,dispatch:e})=>L1(t,e),A$=()=>({state:t,dispatch:e})=>R1(t,e),C$=()=>({state:t,dispatch:e})=>P1(t,e),E$=()=>({state:t,dispatch:e})=>e$(t,e),T$=()=>({state:t,dispatch:e})=>t$(t,e),$$=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),K1=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&K1(r)}return t};function ca(t){const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return K1(n)}function Vd(t,e,n){n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,o=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return ye.fromArray(t.map(s=>e.nodeFromJSON(s)));const i=e.nodeFromJSON(t);return n.errorOnInvalidContent&&i.check(),i}catch(i){if(n.errorOnInvalidContent)throw new Error("[super-editor error]: Invalid JSON content",{cause:i});return console.warn("[super-editor warn]: Invalid content.","Passed value:",t,"Error:",i),Vd("",e,n)}if(o){if(n.errorOnInvalidContent){let s=!1,a="";const l=new sv({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__supereditor__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(s=!0,a=typeof c=="string"?c:c.outerHTML,null)}]}})});if(n.slice?er.fromSchema(l).parseSlice(ca(t),n.parseOptions):er.fromSchema(l).parse(ca(t),n.parseOptions),n.errorOnInvalidContent&&s)throw new Error("[super-editor error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const i=er.fromSchema(e);return n.slice?i.parseSlice(ca(t),n.parseOptions).content:i.parse(ca(t),n.parseOptions)}return Vd("",e,n)}function O$(t,e,n){const r=t.steps.length-1;if(r<e)return;const o=t.steps[r];if(!(o instanceof Tt||o instanceof Zt))return;const i=t.mapping.maps[r];let s=0;i.forEach((a,l,c,u)=>{s===0&&(s=u)}),t.setSelection(je.near(t.doc.resolve(s),n))}const M$=t=>!("type"in t),D$=(t,e,n)=>({tr:r,dispatch:o,editor:i})=>{if(o){n={parseOptions:{},updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let s;try{s=Vd(e,i.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:n.errorOnInvalidContent??i.options.enableContentCheck})}catch(p){return i.emit("contentError",{editor:i,error:p,disableCollaboration:()=>{console.error("[super-editor error]: Unable to disable collaboration at this point in time")}}),!1}let{from:a,to:l}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},c=!0,u=!0;if((M$(s)?s:[s]).forEach(p=>{p.check(),c=c?p.isText&&p.marks.length===0:!1,u=u?p.isBlock:!1}),a===l&&u){const{parent:p}=r.doc.resolve(a);p.isTextblock&&!p.type.spec.code&&!p.childCount&&(a-=1,l+=1)}let d;c?(Array.isArray(e)?d=e.map(p=>p.text||"").join(""):typeof e=="object"&&e&&e.text?d=e.text:d=e,r.insertText(d,a,l)):(d=s,r.replaceWith(a,l,d)),n.updateSelection&&O$(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:a,text:d}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:a,text:d})}return!0},_$=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const o=n[r];let i;if(o.spec.isInputRules&&(i=o.getState(t))){if(e){const s=t.tr,a=i.transform;for(let l=a.steps.length-1;l>=0;l-=1)s.step(a.steps[l].invert(a.docs[l]));if(i.text){const l=s.doc.resolve(i.from).marks();s.replaceWith(i.from,i.to,t.schema.text(i.text,l))}else s.delete(i.from,i.to)}return!0}}return!1};function N$(t,e=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i);if(!s)return!1;let a=r?n.tr:null;return I$(a,s,t,e)?(r&&r(a.scrollIntoView()),!0):!1}}function I$(t,e,n,r=null){let o=!1,i=e,s=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let l=s.resolve(e.start-2);i=new cl(l,l,e.depth),e.endIndex<e.parent.childCount&&(e=new cl(e.$from,s.resolve(e.$to.end(e.depth)),e.depth)),o=!0}let a=mv(i,n,r,e);return a?(t&&F$(t,e,a,o,n),!0):!1}function F$(t,e,n,r,o){let i=ye.empty;for(let u=n.length-1;u>=0;u--)i=ye.from(n[u].type.create(n[u].attrs,i));t.step(new Zt(e.start-(r?2:0),e.end,e.start,e.end,new ve(i,0,0),n.length,!0));let s=0;for(let u=0;u<n.length;u++)n[u].type==o&&(s=u+1);let a=n.length-s,l=e.start+n.length-(r?2:0),c=e.parent;for(let u=e.startIndex,d=e.endIndex,p=!0;u<d;u++,p=!1)!p&&tr(t.doc,l,a)&&(t.split(l,a),l+=2*a),l+=c.child(u).nodeSize;return t}function R$(t){return function(e,n){let{$from:r,$to:o}=e.selection,i=r.blockRange(o,s=>s.childCount>0&&s.firstChild.type==t);return i?n?r.node(i.depth-1).type==t?B$(e,n,t,i):L$(e,n,i):!0:!1}}function B$(t,e,n,r){let o=t.tr,i=r.end,s=r.$to.end(r.depth);i<s&&(o.step(new Zt(i-1,s,i,s,new ve(ye.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new cl(o.doc.resolve(r.$from.pos),o.doc.resolve(s),r.depth));const a=Us(r);if(a==null)return!1;o.lift(r,a);let l=o.doc.resolve(o.mapping.map(i,-1)-1);return Pr(o.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&o.join(l.pos),e(o.scrollIntoView()),!0}function L$(t,e,n){let r=t.tr,o=n.parent;for(let f=n.end,h=n.endIndex-1,m=n.startIndex;h>m;h--)f-=o.child(h).nodeSize,r.delete(f-1,f+1);let i=r.doc.resolve(n.start),s=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==o.childCount,c=i.node(-1),u=i.index(-1);if(!c.canReplace(u+(a?0:1),u+1,s.content.append(l?ye.empty:ye.from(o))))return!1;let d=i.pos,p=d+s.nodeSize;return r.step(new Zt(d-(a?1:0),p+(l?1:0),d+1,p-1,new ve((a?ye.empty:ye.from(o.copy(ye.empty))).append(l?ye.empty:ye.from(o.copy(ye.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}function P$(t){return function(e,n){let{$from:r,$to:o}=e.selection,i=r.blockRange(o,c=>c.childCount>0&&c.firstChild.type==t);if(!i)return!1;let s=i.startIndex;if(s==0)return!1;let a=i.parent,l=a.child(s-1);if(l.type!=t)return!1;if(n){let c=l.lastChild&&l.lastChild.type==a.type,u=ye.from(c?t.create():null),d=new ve(ye.from(t.create(null,ye.from(a.type.create(null,u)))),c?3:1,0),p=i.start,f=i.end;n(e.tr.step(new Zt(p-(c?3:1),f,p,f,d,1,!0)).scrollIntoView())}return!0}}const z$=(t,e={})=>({state:n,dispatch:r})=>{const o=pt(t,n.schema);return N$(o,e)(n,r)},rc=(t,e)=>{for(let n=t.depth;n>0;n--){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}},Kt=t=>({$from:e})=>rc(e,t),Ud=(t,e)=>{const n=e.filter(i=>i.type==="node").find(i=>i.name===t);if(!n)return!1;const r={name:n.name,options:n.options,storage:n.storage},o=Ke(Fe(n,"group",r));return typeof o!="string"?!1:o.split(" ").includes("list")},j$={type:"element",name:"w:abstractNum",attributes:{"w:abstractNumId":"1","w15:restartNumberingAfterBreak":"0"},elements:[{type:"element",name:"w:multiLevelType",attributes:{"w:val":"hybridMultilevel"}},{type:"element",name:"w:tmpl",attributes:{"w:val":"EE6417C4"}},{type:"element",name:"w:lvl",attributes:{"w:ilvl":"0","w:tplc":"0409000F"},elements:[{type:"element",name:"w:start",attributes:{"w:val":"1"}},{type:"element",name:"w:numFmt",attributes:{"w:val":"decimal"}},{type:"element",name:"w:lvlText",attributes:{"w:val":"%1."}},{type:"element",name:"w:lvlJc",attributes:{"w:val":"left"}},{type:"element",name:"w:pPr",elements:[{type:"element",name:"w:ind",attributes:{"w:left":"720","w:hanging":"360"}}]}]},{type:"element",name:"w:lvl",attributes:{"w:ilvl":"1","w:tplc":"04090019","w:tentative":"1"},elements:[{type:"element",name:"w:start",attributes:{"w:val":"1"}},{type:"element",name:"w:numFmt",attributes:{"w:val":"lowerLetter"}},{type:"element",name:"w:lvlText",attributes:{"w:val":"%2."}},{type:"element",name:"w:lvlJc",attributes:{"w:val":"left"}},{type:"element",name:"w:pPr",elements:[{type:"element",name:"w:ind",attributes:{"w:left":"1440","w:hanging":"360"}}]}]},{type:"element",name:"w:lvl",attributes:{"w:ilvl":"2","w:tplc":"0409001B","w:tentative":"1"},elements:[{type:"element",name:"w:start",attributes:{"w:val":"1"}},{type:"element",name:"w:numFmt",attributes:{"w:val":"lowerRoman"}},{type:"element",name:"w:lvlText",attributes:{"w:val":"%3."}},{type:"element",name:"w:lvlJc",attributes:{"w:val":"right"}},{type:"element",name:"w:pPr",elements:[{type:"element",name:"w:ind",attributes:{"w:left":"2160","w:hanging":"180"}}]}]},{type:"element",name:"w:lvl",attributes:{"w:ilvl":"3","w:tplc":"0409000F","w:tentative":"1"},elements:[{type:"element",name:"w:start",attributes:{"w:val":"1"}},{type:"element",name:"w:numFmt",attributes:{"w:val":"decimal"}},{type:"element",name:"w:lvlText",attributes:{"w:val":"%4."}},{type:"element",name:"w:lvlJc",attributes:{"w:val":"left"}},{type:"element",name:"w:pPr",elements:[{type:"element",name:"w:ind",attributes:{"w:left":"2880","w:hanging":"360"}}]}]},{type:"element",name:"w:lvl",attributes:{"w:ilvl":"4","w:tplc":"04090019","w:tentative":"1"},elements:[{type:"element",name:"w:start",attributes:{"w:val":"1"}},{type:"element",name:"w:numFmt",attributes:{"w:val":"lowerLetter"}},{type:"element",name:"w:lvlText",attributes:{"w:val":"%5."}},{type:"element",name:"w:lvlJc",attributes:{"w:val":"left"}},{type:"element",name:"w:pPr",elements:[{type:"element",name:"w:ind",attributes:{"w:left":"3600","w:hanging":"360"}}]}]},{type:"element",name:"w:lvl",attributes:{"w:ilvl":"5","w:tplc":"0409001B","w:tentative":"1"},elements:[{type:"element",name:"w:start",attributes:{"w:val":"1"}},{type:"element",name:"w:numFmt",attributes:{"w:val":"lowerRoman"}},{type:"element",name:"w:lvlText",attributes:{"w:val":"%6."}},{type:"element",name:"w:lvlJc",attributes:{"w:val":"right"}},{type:"element",name:"w:pPr",elements:[{type:"element",name:"w:ind",attributes:{"w:left":"4320","w:hanging":"180"}}]}]},{type:"element",name:"w:lvl",attributes:{"w:ilvl":"6","w:tplc":"0409000F","w:tentative":"1"},elements:[{type:"element",name:"w:start",attributes:{"w:val":"1"}},{type:"element",name:"w:numFmt",attributes:{"w:val":"decimal"}},{type:"element",name:"w:lvlText",attributes:{"w:val":"%7."}},{type:"element",name:"w:lvlJc",attributes:{"w:val":"left"}},{type:"element",name:"w:pPr",elements:[{type:"element",name:"w:ind",attributes:{"w:left":"5040","w:hanging":"360"}}]}]},{type:"element",name:"w:lvl",attributes:{"w:ilvl":"7","w:tplc":"04090019","w:tentative":"1"},elements:[{type:"element",name:"w:start",attributes:{"w:val":"1"}},{type:"element",name:"w:numFmt",attributes:{"w:val":"lowerLetter"}},{type:"element",name:"w:lvlText",attributes:{"w:val":"%8."}},{type:"element",name:"w:lvlJc",attributes:{"w:val":"left"}},{type:"element",name:"w:pPr",elements:[{type:"element",name:"w:ind",attributes:{"w:left":"5760","w:hanging":"360"}}]}]},{type:"element",name:"w:lvl",attributes:{"w:ilvl":"8","w:tplc":"0409001B","w:tentative":"1"},elements:[{type:"element",name:"w:start",attributes:{"w:val":"1"}},{type:"element",name:"w:numFmt",attributes:{"w:val":"lowerRoman"}},{type:"element",name:"w:lvlText",attributes:{"w:val":"%9."}},{type:"element",name:"w:lvlJc",attributes:{"w:val":"right"}},{type:"element",name:"w:pPr",elements:[{type:"element",name:"w:ind",attributes:{"w:left":"6480","w:hanging":"180"}}]}]}]},q$={type:"element",name:"w:abstractNum",attributes:{"w:abstractNumId":"0","w15:restartNumberingAfterBreak":"0"},elements:[{type:"element",name:"w:nsid",attributes:{"w:val":"16126B07"}},{type:"element",name:"w:multiLevelType",attributes:{"w:val":"hybridMultilevel"}},{type:"element",name:"w:tmpl",attributes:{"w:val":"51EC4E08"}},{type:"element",name:"w:lvl",attributes:{"w:ilvl":"0","w:tplc":"04090001"},elements:[{type:"element",name:"w:start",attributes:{"w:val":"1"}},{type:"element",name:"w:numFmt",attributes:{"w:val":"bullet"}},{type:"element",name:"w:lvlText",attributes:{"w:val":""}},{type:"element",name:"w:lvlJc",attributes:{"w:val":"left"}},{type:"element",name:"w:pPr",elements:[{type:"element",name:"w:ind",attributes:{"w:left":"720","w:hanging":"360"}}]},{type:"element",name:"w:rPr",elements:[{type:"element",name:"w:rFonts",attributes:{"w:ascii":"Symbol","w:hAnsi":"Symbol","w:hint":"default"}}]}]},{type:"element",name:"w:lvl",attributes:{"w:ilvl":"1","w:tplc":"04090003","w:tentative":"1"},elements:[{type:"element",name:"w:start",attributes:{"w:val":"1"}},{type:"element",name:"w:numFmt",attributes:{"w:val":"bullet"}},{type:"element",name:"w:lvlText",attributes:{"w:val":"o"}},{type:"element",name:"w:lvlJc",attributes:{"w:val":"left"}},{type:"element",name:"w:pPr",elements:[{type:"element",name:"w:ind",attributes:{"w:left":"1440","w:hanging":"360"}}]},{type:"element",name:"w:rPr",elements:[{type:"element",name:"w:rFonts",attributes:{"w:ascii":"Courier New","w:hAnsi":"Courier New","w:cs":"Courier New","w:hint":"default"}}]}]},{type:"element",name:"w:lvl",attributes:{"w:ilvl":"2","w:tplc":"04090005","w:tentative":"1"},elements:[{type:"element",name:"w:start",attributes:{"w:val":"1"}},{type:"element",name:"w:numFmt",attributes:{"w:val":"bullet"}},{type:"element",name:"w:lvlText",attributes:{"w:val":""}},{type:"element",name:"w:lvlJc",attributes:{"w:val":"left"}},{type:"element",name:"w:pPr",elements:[{type:"element",name:"w:ind",attributes:{"w:left":"2160","w:hanging":"360"}}]},{type:"element",name:"w:rPr",elements:[{type:"element",name:"w:rFonts",attributes:{"w:ascii":"Wingdings","w:hAnsi":"Wingdings","w:hint":"default"}}]}]},{type:"element",name:"w:lvl",attributes:{"w:ilvl":"3","w:tplc":"04090001","w:tentative":"1"},elements:[{type:"element",name:"w:start",attributes:{"w:val":"1"}},{type:"element",name:"w:numFmt",attributes:{"w:val":"bullet"}},{type:"element",name:"w:lvlText",attributes:{"w:val":""}},{type:"element",name:"w:lvlJc",attributes:{"w:val":"left"}},{type:"element",name:"w:pPr",elements:[{type:"element",name:"w:ind",attributes:{"w:left":"2880","w:hanging":"360"}}]},{type:"element",name:"w:rPr",elements:[{type:"element",name:"w:rFonts",attributes:{"w:ascii":"Symbol","w:hAnsi":"Symbol","w:hint":"default"}}]}]},{type:"element",name:"w:lvl",attributes:{"w:ilvl":"4","w:tplc":"04090003","w:tentative":"1"},elements:[{type:"element",name:"w:start",attributes:{"w:val":"1"}},{type:"element",name:"w:numFmt",attributes:{"w:val":"bullet"}},{type:"element",name:"w:lvlText",attributes:{"w:val":"o"}},{type:"element",name:"w:lvlJc",attributes:{"w:val":"left"}},{type:"element",name:"w:pPr",elements:[{type:"element",name:"w:ind",attributes:{"w:left":"3600","w:hanging":"360"}}]},{type:"element",name:"w:rPr",elements:[{type:"element",name:"w:rFonts",attributes:{"w:ascii":"Courier New","w:hAnsi":"Courier New","w:cs":"Courier New","w:hint":"default"}}]}]},{type:"element",name:"w:lvl",attributes:{"w:ilvl":"5","w:tplc":"04090005","w:tentative":"1"},elements:[{type:"element",name:"w:start",attributes:{"w:val":"1"}},{type:"element",name:"w:numFmt",attributes:{"w:val":"bullet"}},{type:"element",name:"w:lvlText",attributes:{"w:val":""}},{type:"element",name:"w:lvlJc",attributes:{"w:val":"left"}},{type:"element",name:"w:pPr",elements:[{type:"element",name:"w:ind",attributes:{"w:left":"4320","w:hanging":"360"}}]},{type:"element",name:"w:rPr",elements:[{type:"element",name:"w:rFonts",attributes:{"w:ascii":"Wingdings","w:hAnsi":"Wingdings","w:hint":"default"}}]}]},{type:"element",name:"w:lvl",attributes:{"w:ilvl":"6","w:tplc":"04090001","w:tentative":"1"},elements:[{type:"element",name:"w:start",attributes:{"w:val":"1"}},{type:"element",name:"w:numFmt",attributes:{"w:val":"bullet"}},{type:"element",name:"w:lvlText",attributes:{"w:val":""}},{type:"element",name:"w:lvlJc",attributes:{"w:val":"left"}},{type:"element",name:"w:pPr",elements:[{type:"element",name:"w:ind",attributes:{"w:left":"5040","w:hanging":"360"}}]},{type:"element",name:"w:rPr",elements:[{type:"element",name:"w:rFonts",attributes:{"w:ascii":"Symbol","w:hAnsi":"Symbol","w:hint":"default"}}]}]},{type:"element",name:"w:lvl",attributes:{"w:ilvl":"7","w:tplc":"04090003","w:tentative":"1"},elements:[{type:"element",name:"w:start",attributes:{"w:val":"1"}},{type:"element",name:"w:numFmt",attributes:{"w:val":"bullet"}},{type:"element",name:"w:lvlText",attributes:{"w:val":"o"}},{type:"element",name:"w:lvlJc",attributes:{"w:val":"left"}},{type:"element",name:"w:pPr",elements:[{type:"element",name:"w:ind",attributes:{"w:left":"5760","w:hanging":"360"}}]},{type:"element",name:"w:rPr",elements:[{type:"element",name:"w:rFonts",attributes:{"w:ascii":"Courier New","w:hAnsi":"Courier New","w:cs":"Courier New","w:hint":"default"}}]}]},{type:"element",name:"w:lvl",attributes:{"w:ilvl":"8","w:tplc":"04090005","w:tentative":"1"},elements:[{type:"element",name:"w:start",attributes:{"w:val":"1"}},{type:"element",name:"w:numFmt",attributes:{"w:val":"bullet"}},{type:"element",name:"w:lvlText",attributes:{"w:val":""}},{type:"element",name:"w:lvlJc",attributes:{"w:val":"left"}},{type:"element",name:"w:pPr",elements:[{type:"element",name:"w:ind",attributes:{"w:left":"6480","w:hanging":"360"}}]},{type:"element",name:"w:rPr",elements:[{type:"element",name:"w:rFonts",attributes:{"w:ascii":"Wingdings","w:hAnsi":"Wingdings","w:hint":"default"}}]}]}]},$u=(t,e)=>{const n=Kt(i=>i.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const o=t.doc.nodeAt(r);return n.node.type===o?.type&&Pr(t.doc,n.pos)&&t.join(n.pos),!0},Ou=(t,e)=>{const n=Kt(i=>i.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const o=t.doc.nodeAt(r);return n.node.type===o?.type&&Pr(t.doc,r)&&t.join(r),!0},V$=(t,e,n,r={})=>o=>{const{editor:i,tr:s,state:a,dispatch:l,chain:c,can:u,commands:d}=o,{extensions:p,splittableMarks:f}=i.extensionService,h=pt(t,a.schema),m=pt(e,a.schema),{selection:y,storedMarks:g}=a,{$from:v,$to:k}=y,b=v.blockRange(k),C=g||y.$to.parentOffset&&y.$from.marks();if(!b)return!1;const D=Kt(G=>Ud(G.type.name,p))(y),M=i.converter?.numbering??null;if(b.depth>=1&&D&&b.depth-D.depth<=1){if(D.node.type===h){const{listId:G}=D.node.attrs;return i.converter&&(i.converter.numbering=H$(G,M)),d.liftListItem(m)}if(Ud(D.node.type.name,p)&&h.validContent(D.node.content)&&l)return c().command(()=>(s.setNodeMarkup(D.pos,h),!0)).command(()=>$u(s,h)).command(()=>Ou(s,h)).run()}const I=({ensureMarks:G=!1})=>()=>{const oe=u().wrapInList(h,r);if(G){const N=C.filter(H=>f.includes(H.type.name));s.ensureMarks(N)}return oe?!0:d.clearNodes()},E=M?.definitions?J1(M.definitions):null;return i.converter&&(i.converter.numbering=U$(E,M,h)),r.listId=E,!n||!C||!l?c().command(I({ensureMarks:!1})).wrapInList(h,r).command(()=>$u(s,h)).command(()=>Ou(s,h)).run():c().command(I({ensureMarks:!0})).wrapInList(h,r).command(()=>$u(s,h)).command(()=>Ou(s,h)).run()},J1=t=>Math.max(...Object.keys(t).map(Number))+1,U$=(t,e,n)=>{const r=n.name==="orderedList"?j$:q$,o={...e},i=J1(o.abstracts),s={...r,attributes:{...r.attributes,"w:abstractNumId":String(i)}};o.abstracts[i]=s;const a={type:"element",name:"w:num",attributes:{"w:numId":String(t),"w16cid:durableId":"485517411"},elements:[{name:"w:abstractNumId",attributes:{"w:val":String(i)}}]};return o.definitions[t]=a,o},H$=(t,e)=>{const{definitions:n,abstracts:r}=e,o=n[t].elements[0].attributes["w:val"];return delete n[t],delete r[o],e},W$=t=>e=>{const{tr:n,state:r,dispatch:o,editor:i}=e,s=pt(t,r.schema),{$from:a,$to:l,node:c}=r.selection;if(c&&c.isBlock||a.depth<2||!a.sameParent(l))return!1;const u=a.node(-1);if(u.type!==s)return!1;const d=i.extensionService.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==s||a.index(-2)!==a.node(-2).childCount-1)return!1;if(o){let y=ye.empty;const g=a.index(-1)?1:a.index(-2)?2:3;for(let M=a.depth-g;M>=a.depth-3;M--)y=ye.from(a.node(M).copy(y));const v=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,k=Te.getSplittedAttributes(d,a.node().type.name,a.node().attrs),b=s.contentMatch.defaultType?.createAndFill(k)||void 0;y=y.append(ye.from(s.createAndFill(null,b)||void 0));const C=a.before(a.depth-(g-1));n.replace(C,a.after(-v),new ve(y,4-g,0));let D=-1;n.doc.nodesBetween(C,n.doc.content.size,(M,I)=>{if(D>-1)return!1;M.isTextblock&&M.content.size===0&&(D=I+1)}),D>-1&&n.setSelection(Pe.near(n.doc.resolve(D))),n.scrollIntoView()}return!0}const p=l.pos===a.end()?u.contentMatchAt(0).defaultType:null,f=Te.getSplittedAttributes(d,u.type.name,u.attrs),h=Te.getSplittedAttributes(d,a.node().type.name,a.node().attrs);n.delete(a.pos,l.pos);const m=p?[{type:s,attrs:f},{type:p,attrs:h}]:[{type:s,attrs:f}];if(!tr(n.doc,a.pos,2))return!1;if(o){const{selection:y,storedMarks:g}=r,{splittableMarks:v}=i.extensionService,k=g||y.$to.parentOffset&&y.$from.marks();if(n.split(a.pos,2,m).scrollIntoView(),!k||!o)return!0;const b=k.filter(C=>v.includes(C.type.name));n.ensureMarks(b),n.setMeta("splitListItem",b)}return!0},G$=t=>({state:e,dispatch:n})=>{const r=pt(t,e.schema);return P$(r)(e,n)},K$=t=>({state:e,dispatch:n})=>{const r=pt(t,e.schema);return R$(r)(e,n)},J$=Object.freeze(Object.defineProperty({__proto__:null,clearNodes:f$,command:jT,createParagraphNear:o$,deleteSelection:y$,exitCode:s$,first:zT,insertContent:$$,insertContentAt:D$,insertTabChar:qT,insertTabCharacter:I1,insertTabNode:VT,joinBackward:k$,joinDown:x$,joinForward:S$,joinUp:v$,liftEmptyBlock:r$,liftListItem:K$,newlineInCode:i$,resetAttributes:b$,selectAll:g$,selectNodeBackward:A$,selectNodeForward:C$,selectTextblockEnd:T$,selectTextblockStart:E$,setMark:l$,setMeta:UT,setNode:h$,sinkListItem:G$,splitBlock:n$,splitListItem:W$,toggleList:V$,toggleMark:p$,toggleNode:m$,undoInputRule:_$,unsetAllMarks:d$,unsetMark:u$,updateAttributes:w$,wrapInList:z$},Symbol.toStringTag,{value:"Module"})),X$=Ye.create({name:"commands",addCommands(){return{...J$}}}),Y$=t=>t.commands.first(({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()]),$i=t=>t.commands.first(({commands:e,tr:n})=>[()=>e.undoInputRule(),()=>(n.setMeta("inputType","deleteContentBackward"),!1),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()]),$o=t=>t.commands.first(({commands:e})=>[()=>e.deleteSelection(),()=>e.joinForward(),()=>e.selectNodeForward()]),Z$=Ye.create({name:"keymap",addShortcuts(){const t={Enter:()=>Y$(this.editor),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:()=>$i(this.editor),"Mod-Backspace":()=>$i(this.editor),"Shift-Backspace":()=>$i(this.editor),Delete:()=>$o(this.editor),"Mod-Delete":()=>$o(this.editor),"Mod-a":()=>this.editor.commands.selectAll(),Tab:()=>this.editor.commands.insertTabNode()},e={...t},n={...t,"Ctrl-h":()=>$i(this.editor),"Alt-Backspace":()=>$i(this.editor),"Ctrl-d":()=>$o(this.editor),"Ctrl-Alt-Backspace":()=>$o(this.editor),"Alt-Delete":()=>$o(this.editor),"Alt-d":()=>$o(this.editor),"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd(),"Ctrl-t":()=>this.editor.commands.insertTabChar()};return TE()||$E()?n:e}}),Q$=Ye.create({name:"editable",addPmPlugins(){return[new Ue({key:new Ge("editable"),props:{editable:()=>this.editor.options.editable}})]}}),eO=Ye.create({name:"editorFocus",addPmPlugins(){const t=this.editor;return[new Ue({key:new Ge("editorFocus"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}});function X1(t,e,n,{check:r=!1}={}){const o=t.getSchema(n);if(o){const i=e.nodeFromJSON(o);return r&&i.check(),i}return e.topNodeType.createAndFill()}function bs(t,e){return e.nodes[t]||e.marks[t]||null}function tO(t){const e={bulletList:1,orderedList:2};return{attributes:{parentAttributes:{"w14:paraId":Yn(),"w14:textId":Yn(),"w:rsidR":Yn(),"w:rsidRDefault":Yn(),"w:rsidP":Yn(),paragraphProperties:{type:"element",name:"w:pPr",elements:[{type:"element",name:"w:pStyle",attributes:{"w:val":"ListParagraph"}},{type:"element",name:"w:numPr",elements:[{type:"element",name:"w:ilvl",attributes:{"w:val":"0"}},{type:"element",name:"w:numId",attributes:{"w:val":e[t]||0}}]}]}}}}}function nO(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(o=>{const i=n.resolve(t-1),s=gf(i,o.type);s&&r.push({mark:o,...s})}):n.nodesBetween(t,e,(o,i)=>{!o||o?.nodeSize===void 0||r.push(...o.marks.map(s=>({from:i,to:i+o.nodeSize,mark:s})))}),r}function Y1(t,e,n={}){if(!e)return wl(t,null,n)||yl(t,null,n);const r=Gs(e,t.schema);return r==="node"?wl(t,e,n):r==="mark"?yl(t,e,n):!1}function yf(t,e){const n=[];return t.descendants((r,o)=>{e(r)&&n.push({node:r,pos:o})}),n}function Z1(t,e,n){const r=t.state.doc.content.size,o=pl(e,0,r),i=pl(n,0,r),s=t.coordsAtPos(o),a=t.coordsAtPos(i,-1),l=Math.min(s.top,a.top),c=Math.max(s.bottom,a.bottom),u=Math.min(s.left,a.left),d=Math.max(s.right,a.right),p=d-u,f=c-l,h={top:l,bottom:c,left:u,right:d,width:p,height:f,x:u,y:l};return{...h,toJSON:()=>h}}const wf=t=>{const{$head:e}=t.selection;for(let n=e.depth;n>0;n-=1)if(e.node(n).type?.spec?.tableRole==="row")return!0;return!1},oc=Object.freeze(Object.defineProperty({__proto__:null,chainableEditorState:pf,cleanSchemaItem:zd,createDocument:X1,defaultBlockAt:W1,findChildren:yf,findMark:nc,findParentNode:Kt,findParentNodeClosestToPos:rc,generateDocxListAttributes:tO,generateDocxRandomId:Yn,generateRandom32BitHex:lf,getActiveFormatting:df,getExtensionConfigField:Fe,getMarkRange:gf,getMarkType:cr,getMarksBetween:nO,getMarksFromSelection:Ws,getNodeType:pt,getSchemaTypeByName:bs,getSchemaTypeNameByName:Gs,isActive:Y1,isInTable:wf,isList:Ud,isMarkActive:yl,isNodeActive:wl,isTextSelection:G1,posToDOMRect:Z1},Symbol.toStringTag,{value:"Module"})),Qr=globalThis||void 0||self,Ct=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},ci=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let Hd=null;const Kn=function(t,e,n){let r=Hd||(Hd=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},rO=function(){Hd=null},yo=function(t,e,n,r){return n&&(Kg(t,e,n,r,-1)||Kg(t,e,n,r,1))},oO=/^(img|br|input|textarea|hr)$/i;function Kg(t,e,n,r,o){for(;;){if(t==n&&e==r)return!0;if(e==(o<0?0:hn(t))){let i=t.parentNode;if(!i||i.nodeType!=1||Ks(t)||oO.test(t.nodeName)||t.contentEditable=="false")return!1;e=Ct(t)+(o<0?0:1),t=i}else if(t.nodeType==1){if(t=t.childNodes[e+(o<0?-1:0)],t.contentEditable=="false")return!1;e=o<0?hn(t):0}else return!1}}function hn(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function iO(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=hn(t)}else if(t.parentNode&&!Ks(t))e=Ct(t),t=t.parentNode;else return null}}function sO(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&&!Ks(t))e=Ct(t)+1,t=t.parentNode;else return null}}function aO(t,e,n){for(let r=e==0,o=e==hn(t);r||o;){if(t==n)return!0;let i=Ct(t);if(t=t.parentNode,!t)return!1;r=r&&i==0,o=o&&i==hn(t)}}function Ks(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const ic=function(t){return t.focusNode&&yo(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Xr(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function lO(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function cO(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(hn(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(hn(r.startContainer),r.startOffset)}}}const Bn=typeof navigator<"u"?navigator:null,Jg=typeof document<"u"?document:null,zr=Bn&&Bn.userAgent||"",Wd=/Edge\/(\d+)/.exec(zr),Q1=/MSIE \d/.exec(zr),Gd=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(zr),Jt=!!(Q1||Gd||Wd),Or=Q1?document.documentMode:Gd?+Gd[1]:Wd?+Wd[1]:0,xn=!Jt&&/gecko\/(\d+)/i.test(zr);xn&&+(/Firefox\/(\d+)/.exec(zr)||[0,0])[1];const Kd=!Jt&&/Chrome\/(\d+)/.exec(zr),Dt=!!Kd,e2=Kd?+Kd[1]:0,qt=!Jt&&!!Bn&&/Apple Computer/.test(Bn.vendor),ui=qt&&(/Mobile\/\w+/.test(zr)||!!Bn&&Bn.maxTouchPoints>2),fn=ui||(Bn?/Mac/.test(Bn.platform):!1),uO=Bn?/Win/.test(Bn.platform):!1,Qn=/Android \d/.test(zr),Js=!!Jg&&"webkitFontSmoothing"in Jg.documentElement.style,dO=Js?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function pO(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 Un(t,e){return typeof t=="number"?t:t[e]}function fO(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function Xg(t,e,n){let r=t.someProp("scrollThreshold")||0,o=t.someProp("scrollMargin")||5,i=t.dom.ownerDocument;for(let s=n||t.dom;s;){if(s.nodeType!=1){s=ci(s);continue}let a=s,l=a==i.body,c=l?pO(i):fO(a),u=0,d=0;if(e.top<c.top+Un(r,"top")?d=-(c.top-e.top+Un(o,"top")):e.bottom>c.bottom-Un(r,"bottom")&&(d=e.bottom-e.top>c.bottom-c.top?e.top+Un(o,"top")-c.top:e.bottom-c.bottom+Un(o,"bottom")),e.left<c.left+Un(r,"left")?u=-(c.left-e.left+Un(o,"left")):e.right>c.right-Un(r,"right")&&(u=e.right-c.right+Un(o,"right")),u||d)if(l)i.defaultView.scrollBy(u,d);else{let f=a.scrollLeft,h=a.scrollTop;d&&(a.scrollTop+=d),u&&(a.scrollLeft+=u);let m=a.scrollLeft-f,y=a.scrollTop-h;e={left:e.left-m,top:e.top-y,right:e.right-m,bottom:e.bottom-y}}let p=l?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(p))break;s=p=="absolute"?s.offsetParent:ci(s)}}function hO(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,o;for(let i=(e.left+e.right)/2,s=n+1;s<Math.min(innerHeight,e.bottom);s+=5){let a=t.root.elementFromPoint(i,s);if(!a||a==t.dom||!t.dom.contains(a))continue;let l=a.getBoundingClientRect();if(l.top>=n-20){r=a,o=l.top;break}}return{refDOM:r,refTop:o,stack:t2(t.dom)}}function t2(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=ci(r));return e}function mO({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;n2(n,r==0?0:r-e)}function n2(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:o,left:i}=t[n];r.scrollTop!=o+e&&(r.scrollTop=o+e),r.scrollLeft!=i&&(r.scrollLeft=i)}}let Oo=null;function gO(t){if(t.setActive)return t.setActive();if(Oo)return t.focus(Oo);let e=t2(t);t.focus(Oo==null?{get preventScroll(){return Oo={preventScroll:!0},!0}}:void 0),Oo||(Oo=!1,n2(e,0))}function r2(t,e){let n,r=2e8,o,i=0,s=e.top,a=e.top,l,c;for(let u=t.firstChild,d=0;u;u=u.nextSibling,d++){let p;if(u.nodeType==1)p=u.getClientRects();else if(u.nodeType==3)p=Kn(u).getClientRects();else continue;for(let f=0;f<p.length;f++){let h=p[f];if(h.top<=s&&h.bottom>=a){s=Math.max(h.bottom,s),a=Math.min(h.top,a);let m=h.left>e.left?h.left-e.left:h.right<e.left?e.left-h.right:0;if(m<r){n=u,r=m,o=m&&n.nodeType==3?{left:h.right<e.left?h.right:h.left,top:e.top}:e,u.nodeType==1&&m&&(i=d+(e.left>=(h.left+h.right)/2?1:0));continue}}else h.top>e.top&&!l&&h.left<=e.left&&h.right>=e.left&&(l=u,c={left:Math.max(h.left,Math.min(h.right,e.left)),top:h.top});!n&&(e.left>=h.right&&e.top>=h.top||e.left>=h.left&&e.top>=h.bottom)&&(i=d+1)}}return!n&&l&&(n=l,o=c,r=0),n&&n.nodeType==3?yO(n,o):!n||r&&n.nodeType==1?{node:t,offset:i}:r2(n,o)}function yO(t,e){let n=t.nodeValue.length,r=document.createRange();for(let o=0;o<n;o++){r.setEnd(t,o+1),r.setStart(t,o);let i=gr(r,1);if(i.top!=i.bottom&&bf(e,i))return{node:t,offset:o+(e.left>=(i.left+i.right)/2?1:0)}}return{node:t,offset:0}}function bf(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function wO(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function bO(t,e,n){let{node:r,offset:o}=r2(e,n),i=-1;if(r.nodeType==1&&!r.firstChild){let s=r.getBoundingClientRect();i=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(r,o,i)}function vO(t,e,n,r){let o=-1;for(let i=e,s=!1;i!=t.dom;){let a=t.docView.nearestDesc(i,!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>r.left||l.top>r.top?o=a.posBefore:(!s&&l.right<r.left||l.bottom<r.top)&&(o=a.posAfter),s=!0),!a.contentDOM&&o<0&&!a.node.isText))return(a.node.isBlock?r.top<(l.top+l.bottom)/2:r.left<(l.left+l.right)/2)?a.posBefore:a.posAfter;i=a.dom.parentNode}return o>-1?o:t.docView.posFromDOM(e,n,-1)}function o2(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let o=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),i=o;;){let s=t.childNodes[i];if(s.nodeType==1){let a=s.getClientRects();for(let l=0;l<a.length;l++){let c=a[l];if(bf(e,c))return o2(s,e,c)}}if((i=(i+1)%r)==o)break}return t}function xO(t,e){let n=t.dom.ownerDocument,r,o=0,i=cO(n,e.left,e.top);i&&({node:r,offset:o}=i);let s=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),a;if(!s||!t.dom.contains(s.nodeType!=1?s.parentNode:s)){let c=t.dom.getBoundingClientRect();if(!bf(e,c)||(s=o2(t.dom,e,c),!s))return null}if(qt)for(let c=s;r&&c;c=ci(c))c.draggable&&(r=void 0);if(s=wO(s,e),r){if(xn&&r.nodeType==1&&(o=Math.min(o,r.childNodes.length),o<r.childNodes.length)){let u=r.childNodes[o],d;u.nodeName=="IMG"&&(d=u.getBoundingClientRect()).right<=e.left&&d.bottom>e.top&&o++}let c;Js&&o&&r.nodeType==1&&(c=r.childNodes[o-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&o--,r==t.dom&&o==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(o==0||r.nodeType!=1||r.childNodes[o-1].nodeName!="BR")&&(a=vO(t,r,o,e))}a==null&&(a=bO(t,s,e));let l=t.docView.nearestDesc(s,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function Yg(t){return t.top<t.bottom||t.left<t.right}function gr(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(Yg(r))return r}return Array.prototype.find.call(n,Yg)||t.getBoundingClientRect()}const kO=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function i2(t,e,n){let{node:r,offset:o,atom:i}=t.docView.domFromPos(e,n<0?-1:1),s=Js||xn;if(r.nodeType==3)if(s&&(kO.test(r.nodeValue)||(n<0?!o:o==r.nodeValue.length))){let a=gr(Kn(r,o,o),n);if(xn&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let l=gr(Kn(r,o-1,o-1),-1);if(l.top==a.top){let c=gr(Kn(r,o,o+1),-1);if(c.top!=a.top)return Oi(c,c.left<l.left)}}return a}else{let a=o,l=o,c=n<0?1:-1;return n<0&&!o?(l++,c=-1):n>=0&&o==r.nodeValue.length?(a--,c=1):n<0?a--:l++,Oi(gr(Kn(r,a,l),c),c<0)}if(!t.state.doc.resolve(e-(i||0)).parent.inlineContent){if(i==null&&o&&(n<0||o==hn(r))){let a=r.childNodes[o-1];if(a.nodeType==1)return Mu(a.getBoundingClientRect(),!1)}if(i==null&&o<hn(r)){let a=r.childNodes[o];if(a.nodeType==1)return Mu(a.getBoundingClientRect(),!0)}return Mu(r.getBoundingClientRect(),n>=0)}if(i==null&&o&&(n<0||o==hn(r))){let a=r.childNodes[o-1],l=a.nodeType==3?Kn(a,hn(a)-(s?0:1)):a.nodeType==1&&(a.nodeName!="BR"||!a.nextSibling)?a:null;if(l)return Oi(gr(l,1),!1)}if(i==null&&o<hn(r)){let a=r.childNodes[o];for(;a.pmViewDesc&&a.pmViewDesc.ignoreForCoords;)a=a.nextSibling;let l=a?a.nodeType==3?Kn(a,0,s?0:1):a.nodeType==1?a:null:null;if(l)return Oi(gr(l,-1),!0)}return Oi(gr(r.nodeType==3?Kn(r):r,-n),n>=0)}function Oi(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function Mu(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function s2(t,e,n){let r=t.state,o=t.root.activeElement;r!=e&&t.updateState(e),o!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),o!=t.dom&&o&&o.focus()}}function SO(t,e,n){let r=e.selection,o=n=="up"?r.$from:r.$to;return s2(t,e,()=>{let{node:i}=t.docView.domFromPos(o.pos,n=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(i,!0);if(!a)break;if(a.node.isBlock){i=a.contentDOM||a.dom;break}i=a.dom.parentNode}let s=i2(t,o.pos,1);for(let a=i.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=Kn(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;c<l.length;c++){let u=l[c];if(u.bottom>u.top+1&&(n=="up"?s.top-u.top>(u.bottom-s.top)*2:u.bottom-s.bottom>(s.bottom-u.top)*2))return!1}}return!0})}const AO=/[\u0590-\u08ac]/;function CO(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=!o,s=o==r.parent.content.size,a=t.domSelection();return a?!AO.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?i:s:s2(t,e,()=>{let{focusNode:l,focusOffset:c,anchorNode:u,anchorOffset:d}=t.domSelectionRange(),p=a.caretBidiLevel;a.modify("move",n,"character");let f=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:h,focusOffset:m}=t.domSelectionRange(),y=h&&!f.contains(h.nodeType==1?h:h.parentNode)||l==h&&c==m;try{a.collapse(u,d),l&&(l!=u||c!=d)&&a.extend&&a.extend(l,c)}catch{}return p!=null&&(a.caretBidiLevel=p),y}):r.pos==r.start()||r.pos==r.end()}let Zg=null,Qg=null,ey=!1;function EO(t,e,n){return Zg==e&&Qg==n?ey:(Zg=e,Qg=n,ey=n=="up"||n=="down"?SO(t,e,n):CO(t,e,n))}const mn=0,ty=1,eo=2,Ln=3;let Xs=class{constructor(e,n,r,o){this.parent=e,this.children=n,this.dom=r,this.contentDOM=o,this.dirty=mn,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].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 n=0,r=this.posAtStart;;n++){let o=this.children[n];if(o==e)return r;r+=o.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,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let i,s;if(e==this.contentDOM)i=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.previousSibling}for(;i&&!((s=i.pmViewDesc)&&s.parent==this);)i=i.previousSibling;return i?this.posBeforeChild(s)+s.size:this.posAtStart}else{let i,s;if(e==this.contentDOM)i=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.nextSibling}for(;i&&!((s=i.pmViewDesc)&&s.parent==this);)i=i.nextSibling;return i?this.posBeforeChild(s):this.posAtEnd}let o;if(e==this.dom&&this.contentDOM)o=n>Ct(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))o=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let i=e;;i=i.parentNode){if(i==this.dom){o=!1;break}if(i.previousSibling)break}if(o==null&&n==e.childNodes.length)for(let i=e;;i=i.parentNode){if(i==this.dom){o=!0;break}if(i.nextSibling)break}}return o??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,o=e;o;o=o.parentNode){let i=this.getDesc(o),s;if(i&&(!n||i.node))if(r&&(s=i.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return i}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let o=e;o;o=o.parentNode){let i=this.getDesc(o);if(i)return i.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let o=this.children[n],i=r+o.size;if(r==e&&i!=r){for(;!o.border&&o.children.length;)for(let s=0;s<o.children.length;s++){let a=o.children[s];if(a.size){o=a;break}}return o}if(e<i)return o.descAt(e-r-o.border);r=i}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,o=0;for(let i=0;r<this.children.length;r++){let s=this.children[r],a=i+s.size;if(a>e||s instanceof d2){o=e-i;break}i=a}if(o)return this.children[r].domFromPos(o-this.children[r].border,n);for(let i;r&&!(i=this.children[r-1]).size&&i instanceof a2&&i.side>=0;r--);if(n<=0){let i,s=!0;for(;i=r?this.children[r-1]:null,!(!i||i.dom.parentNode==this.contentDOM);r--,s=!1);return i&&n&&s&&!i.border&&!i.domAtom?i.domFromPos(i.size,n):{node:this.contentDOM,offset:i?Ct(i.dom)+1:0}}else{let i,s=!0;for(;i=r<this.children.length?this.children[r]:null,!(!i||i.dom.parentNode==this.contentDOM);r++,s=!1);return i&&s&&!i.border&&!i.domAtom?i.domFromPos(0,n):{node:this.contentDOM,offset:i?Ct(i.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let o=-1,i=-1;for(let s=r,a=0;;a++){let l=this.children[a],c=s+l.size;if(o==-1&&e<=c){let u=s+l.border;if(e>=u&&n<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,n,u);e=s;for(let d=a;d>0;d--){let p=this.children[d-1];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(1)){o=Ct(p.dom)+1;break}e-=p.size}o==-1&&(o=0)}if(o>-1&&(c>n||a==this.children.length-1)){n=c;for(let u=a+1;u<this.children.length;u++){let d=this.children[u];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(-1)){i=Ct(d.dom);break}n+=d.size}i==-1&&(i=this.contentDOM.childNodes.length);break}s=c}return{node:this.contentDOM,from:e,to:n,fromOffset:o,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,o=!1){let i=Math.min(e,n),s=Math.max(e,n);for(let f=0,h=0;f<this.children.length;f++){let m=this.children[f],y=h+m.size;if(i>h&&s<y)return m.setSelection(e-h-m.border,n-h-m.border,r,o);h=y}let a=this.domFromPos(e,e?-1:1),l=n==e?a:this.domFromPos(n,n?-1:1),c=r.root.getSelection(),u=r.domSelectionRange(),d=!1;if((xn||qt)&&e==n){let{node:f,offset:h}=a;if(f.nodeType==3){if(d=!!(h&&f.nodeValue[h-1]==`
41
+ `),d&&h==f.nodeValue.length)for(let m=f,y;m;m=m.parentNode){if(y=m.nextSibling){y.nodeName=="BR"&&(a=l={node:y.parentNode,offset:Ct(y)+1});break}let g=m.pmViewDesc;if(g&&g.node&&g.node.isBlock)break}}else{let m=f.childNodes[h-1];d=m&&(m.nodeName=="BR"||m.contentEditable=="false")}}if(xn&&u.focusNode&&u.focusNode!=l.node&&u.focusNode.nodeType==1){let f=u.focusNode.childNodes[u.focusOffset];f&&f.contentEditable=="false"&&(o=!0)}if(!(o||d&&qt)&&yo(a.node,a.offset,u.anchorNode,u.anchorOffset)&&yo(l.node,l.offset,u.focusNode,u.focusOffset))return;let p=!1;if((c.extend||e==n)&&!d){c.collapse(a.node,a.offset);try{e!=n&&c.extend(l.node,l.offset),p=!0}catch{}}if(!p){if(e>n){let h=a;a=l,l=h}let f=document.createRange();f.setEnd(l.node,l.offset),f.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(f)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,o=0;o<this.children.length;o++){let i=this.children[o],s=r+i.size;if(r==s?e<=s&&n>=r:e<s&&n>r){let a=r+i.border,l=s-i.border;if(e>=a&&n<=l){this.dirty=e==r||n==s?eo:ty,e==a&&n==l&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=Ln:i.markDirty(e-a,n-a);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?eo:Ln}r=s}this.dirty=eo}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?eo:ty;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(e){return!1}},a2=class extends Xs{constructor(e,n,r,o){let i,s=n.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>{if(!i)return o;if(i.parent)return i.parent.posBeforeChild(i)})),!n.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=n,this.widget=n,i=this}matchesWidget(e){return this.dirty==mn&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(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 TO extends Xs{constructor(e,n,r,o){super(e,[],n,null),this.textDOM=r,this.text=o}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}let bl=class Jd extends Xs{constructor(e,n,r,o,i){super(e,[],r,o),this.mark=n,this.spec=i}static create(e,n,r,o){let i=o.nodeViews[n.type.name],s=i&&i(n,o,r);return(!s||!s.dom)&&(s=xi.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new Jd(e,n,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&Ln||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Ln&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=mn){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=mn}}slice(e,n,r){let o=Jd.create(this.parent,this.mark,!0,r),i=this.children,s=this.size;n<s&&(i=Yd(i,n,s,r)),e>0&&(i=Yd(i,0,e,r));for(let a=0;a<i.length;a++)i[a].parent=o;return o.children=i,o}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}},Xo=class l2 extends Xs{constructor(e,n,r,o,i,s,a,l,c){super(e,[],i,s),this.node=n,this.outerDeco=r,this.innerDeco=o,this.nodeDOM=a}static create(e,n,r,o,i,s){let a=i.nodeViews[n.type.name],l,c=a&&a(n,i,()=>{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},r,o),u=c&&c.dom,d=c&&c.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:d}=xi.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!d&&!n.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),n.type.spec.draggable&&(u.draggable=!0));let p=u;return u=h2(u,r,n),c?l=new $O(e,n,r,o,u,d||null,p,c,i,s+1):n.isText?new c2(e,n,r,o,u,p,i):new l2(e,n,r,o,u,d||null,p,i,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 n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>ye.empty)}return e}matchesNode(e,n,r){return this.dirty==mn&&e.eq(this.node)&&vl(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,o=n,i=e.composing?this.localCompositionInfo(e,n):null,s=i&&i.pos>-1?i:null,a=i&&i.pos<0,l=new MO(this,s&&s.node,e);NO(this.node,this.innerDeco,(c,u,d)=>{c.spec.marks?l.syncToMarks(c.spec.marks,r,e):c.type.side>=0&&!d&&l.syncToMarks(u==this.node.childCount?Xe.none:this.node.child(u).marks,r,e),l.placeWidget(c,e,o)},(c,u,d,p)=>{l.syncToMarks(c.marks,r,e);let f;l.findNodeMatch(c,u,d,p)||a&&e.state.selection.from>o&&e.state.selection.to<o+c.nodeSize&&(f=l.findIndexWithChild(i.node))>-1&&l.updateNodeAt(c,u,d,f,e)||l.updateNextNode(c,u,d,e,p,o)||l.addNode(c,u,d,e,o),o+=c.nodeSize}),l.syncToMarks([],r,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==eo)&&(s&&this.protectLocalComposition(e,s),p2(this.contentDOM,this.children,e),ui&&IO(this.dom))}localCompositionInfo(e,n){let{from:r,to:o}=e.state.selection;if(!(e.state.selection instanceof Pe)||r<n||o>n+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let s=i.nodeValue,a=FO(this.node.content,s,r-n,o-n);return a<0?null:{node:i,pos:a,text:s}}else return{node:i,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:o}){if(this.getDesc(n))return;let i=n;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let s=new TO(this,i,n,o);e.input.compositionNodes.push(s),this.children=Yd(this.children,r,r+o.length,e,s)}update(e,n,r,o){return this.dirty==Ln||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,o),!0)}updateInner(e,n,r,o){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=mn}updateOuterDeco(e){if(vl(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=f2(this.dom,this.nodeDOM,Xd(this.outerDeco,this.node,n),Xd(e,this.node,n)),this.dom!=r&&(r.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 ny(t,e,n,r,o){h2(r,e,t);let i=new Xo(void 0,t,e,n,r,r,r,o,0);return i.contentDOM&&i.updateChildren(o,0),i}let c2=class u2 extends Xo{constructor(e,n,r,o,i,s,a){super(e,n,r,o,i,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,n,r,o){return this.dirty==Ln||this.dirty!=mn&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=mn||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,o.trackWrites==this.nodeDOM&&(o.trackWrites=null)),this.node=e,this.dirty=mn,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let o=this.node.cut(e,n),i=document.createTextNode(o.text);return new u2(this.parent,o,this.outerDeco,this.innerDeco,i,i,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=Ln)}get domAtom(){return!1}isText(e){return this.node.text==e}},d2=class extends Xs{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==mn&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}};class $O extends Xo{constructor(e,n,r,o,i,s,a,l,c,u){super(e,n,r,o,i,s,a,c,u),this.spec=l}update(e,n,r,o){if(this.dirty==Ln)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,n,r);return i&&this.updateInner(e,n,r,o),i}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,o){this.spec.setSelection?this.spec.setSelection(e,n,r.root):super.setSelection(e,n,r,o)}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 p2(t,e,n){let r=t.firstChild,o=!1;for(let i=0;i<e.length;i++){let s=e[i],a=s.dom;if(a.parentNode==t){for(;a!=r;)r=ry(r),o=!0;r=r.nextSibling}else o=!0,t.insertBefore(a,r);if(s instanceof bl){let l=r?r.previousSibling:t.lastChild;p2(s.contentDOM,s.children,n),r=l?l.nextSibling:t.firstChild}}for(;r;)r=ry(r),o=!0;o&&n.trackWrites==t&&(n.trackWrites=null)}const Qi=function(t){t&&(this.nodeName=t)};Qi.prototype=Object.create(null);const to=[new Qi];function Xd(t,e,n){if(t.length==0)return to;let r=n?to[0]:new Qi,o=[r];for(let i=0;i<t.length;i++){let s=t[i].type.attrs;if(s){s.nodeName&&o.push(r=new Qi(s.nodeName));for(let a in s){let l=s[a];l!=null&&(n&&o.length==1&&o.push(r=new Qi(e.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+l:a=="style"?r.style=(r.style?r.style+";":"")+l:a!="nodeName"&&(r[a]=l))}}}return o}function f2(t,e,n,r){if(n==to&&r==to)return e;let o=e;for(let i=0;i<r.length;i++){let s=r[i],a=n[i];if(i){let l;a&&a.nodeName==s.nodeName&&o!=t&&(l=o.parentNode)&&l.nodeName.toLowerCase()==s.nodeName||(l=document.createElement(s.nodeName),l.pmIsDeco=!0,l.appendChild(o),a=to[0]),o=l}OO(o,a||to[0],s)}return o}function OO(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],o=n.class?n.class.split(" ").filter(Boolean):[];for(let i=0;i<r.length;i++)o.indexOf(r[i])==-1&&t.classList.remove(r[i]);for(let i=0;i<o.length;i++)r.indexOf(o[i])==-1&&t.classList.add(o[i]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,o;for(;o=r.exec(e.style);)t.style.removeProperty(o[1])}n.style&&(t.style.cssText+=n.style)}}function h2(t,e,n){return f2(t,t,to,Xd(e,n,t.nodeType!=1))}function vl(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function ry(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class MO{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=DO(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r){let o=0,i=this.stack.length>>1,s=Math.min(i,e.length);for(;o<s&&(o==i-1?this.top:this.stack[o+1<<1]).matchesMark(e[o])&&e[o].type.spec.spanning!==!1;)o++;for(;o<i;)this.destroyRest(),this.top.dirty=mn,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<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[i])&&!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=bl.create(this.top,e[i],n,r);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,i++}}findNodeMatch(e,n,r,o){let i=-1,s;if(o>=this.preMatch.index&&(s=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&s.matchesNode(e,n,r))i=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,n,r)&&!this.preMatch.matched.has(c)){i=a;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,n,r,o,i){let s=this.top.children[o];return s.dirty==Ln&&s.dom==s.contentDOM&&(s.dirty=eo),s.update(e,n,r,i)?(this.destroyBetween(this.index,o),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let o=this.index;o<this.top.children.length;o++)if(this.top.children[o]==r)return o}return-1}e=n}}updateNextNode(e,n,r,o,i,s){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof Xo){let c=this.preMatch.matched.get(l);if(c!=null&&c!=i)return!1;let u=l.dom,d,p=this.isLocked(u)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=Ln&&vl(n,l.outerDeco));if(!p&&l.update(e,n,r,o))return this.destroyBetween(this.index,a),l.dom!=u&&(this.changed=!0),this.index++,!0;if(!p&&(d=this.recreateWrapper(l,e,n,r,o,s)))return this.destroyBetween(this.index,a),this.top.children[this.index]=d,d.contentDOM&&(d.dirty=eo,d.updateChildren(o,s+1),d.dirty=mn),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,o,i,s){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!vl(r,e.outerDeco)||!o.eq(e.innerDeco))return null;let a=Xo.create(this.top,n,r,o,i,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,n,r,o,i){let s=Xo.create(this.top,e,n,r,o,i);s.contentDOM&&s.updateChildren(o,i+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(e,n,r){let o=this.index<this.top.children.length?this.top.children[this.index]:null;if(o&&o.matchesWidget(e)&&(e==o.widget||!o.widget.type.toDOM.parentNode))this.index++;else{let i=new a2(this.top,e,n,r);this.top.children.splice(this.index++,0,i),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof bl;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof c2)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((qt||Dt)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let o=new d2(this.top,[],r,null);n!=this.top?n.children.push(o):n.children.splice(this.index++,0,o),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function DO(t,e){let n=e,r=n.children.length,o=t.childCount,i=new Map,s=[];e:for(;o>0;){let a;for(;;)if(r){let c=n.children[r-1];if(c instanceof bl)n=c,r=c.children.length;else{a=c,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=t.child(o-1))break;--o,i.set(a,o),s.push(a)}}return{index:o,matched:i,matches:s.reverse()}}function _O(t,e){return t.type.side-e.type.side}function NO(t,e,n,r){let o=e.locals(t),i=0;if(o.length==0){for(let c=0;c<t.childCount;c++){let u=t.child(c);r(u,o,e.forChild(i,u),c),i+=u.nodeSize}return}let s=0,a=[],l=null;for(let c=0;;){let u,d;for(;s<o.length&&o[s].to==i;){let y=o[s++];y.widget&&(u?(d||(d=[u])).push(y):u=y)}if(u)if(d){d.sort(_O);for(let y=0;y<d.length;y++)n(d[y],c,!!l)}else n(u,c,!!l);let p,f;if(l)f=-1,p=l,l=null;else if(c<t.childCount)f=c,p=t.child(c++);else break;for(let y=0;y<a.length;y++)a[y].to<=i&&a.splice(y--,1);for(;s<o.length&&o[s].from<=i&&o[s].to>i;)a.push(o[s++]);let h=i+p.nodeSize;if(p.isText){let y=h;s<o.length&&o[s].from<y&&(y=o[s].from);for(let g=0;g<a.length;g++)a[g].to<y&&(y=a[g].to);y<h&&(l=p.cut(y-i),p=p.cut(0,y-i),h=y,f=-1)}else for(;s<o.length&&o[s].to<h;)s++;let m=p.isInline&&!p.isLeaf?a.filter(y=>!y.inline):a.slice();r(p,m,e.forChild(i,p),f),i=h}}function IO(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 FO(t,e,n,r){for(let o=0,i=0;o<t.childCount&&i<=r;){let s=t.child(o++),a=i;if(i+=s.nodeSize,!s.isText)continue;let l=s.text;for(;o<t.childCount;){let c=t.child(o++);if(i+=c.nodeSize,!c.isText)break;l+=c.text}if(i>=n){if(i>=r&&l.slice(r-e.length-a,r-a)==e)return r-e.length;let c=a<r?l.lastIndexOf(e,r-a-1):-1;if(c>=0&&c+e.length+a>=n)return a+c;if(n==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}function Yd(t,e,n,r,o){let i=[];for(let s=0,a=0;s<t.length;s++){let l=t[s],c=a,u=a+=l.size;c>=n||u<=e?i.push(l):(c<e&&i.push(l.slice(0,e-c,r)),o&&(i.push(o),o=void 0),u>n&&i.push(l.slice(n-c,l.size,r)))}return i}function vf(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let o=t.docView.nearestDesc(n.focusNode),i=o&&o.size==0,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a=r.resolve(s),l,c;if(ic(n)){for(l=s;o&&!o.node;)o=o.parent;let d=o.node;if(o&&d.isAtom&&_e.isSelectable(d)&&o.parent&&!(d.isInline&&aO(n.focusNode,n.focusOffset,o.dom))){let p=o.posBefore;c=new _e(s==p?a:r.resolve(p))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let d=s,p=s;for(let f=0;f<n.rangeCount;f++){let h=n.getRangeAt(f);d=Math.min(d,t.docView.posFromDOM(h.startContainer,h.startOffset,1)),p=Math.max(p,t.docView.posFromDOM(h.endContainer,h.endOffset,-1))}if(d<0)return null;[l,s]=p==t.state.selection.anchor?[p,d]:[d,p],a=r.resolve(s)}else l=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null}let u=r.resolve(l);if(!c){let d=e=="pointer"||t.state.selection.head<a.pos&&!i?1:-1;c=xf(t,u,a,d)}return c}function m2(t){return t.editable?t.hasFocus():y2(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function or(t,e=!1){let n=t.state.selection;if(g2(t,n),!!m2(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&Dt){let r=t.domSelectionRange(),o=t.domObserver.currentSelection;if(r.anchorNode&&o.anchorNode&&yo(r.anchorNode,r.anchorOffset,o.anchorNode,o.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)BO(t);else{let{anchor:r,head:o}=n,i,s;oy&&!(n instanceof Pe)&&(n.$from.parent.inlineContent||(i=iy(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(s=iy(t,n.to))),t.docView.setSelection(r,o,t,e),oy&&(i&&sy(i),s&&sy(s)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&RO(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const oy=qt||Dt&&e2<63;function iy(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),o=r<n.childNodes.length?n.childNodes[r]:null,i=r?n.childNodes[r-1]:null;if(qt&&o&&o.contentEditable=="false")return Du(o);if((!o||o.contentEditable=="false")&&(!i||i.contentEditable=="false")){if(o)return Du(o);if(i)return Du(i)}}function Du(t){return t.contentEditable="true",qt&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function sy(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function RO(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,o=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=o)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!m2(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function BO(t){let e=t.domSelection(),n=document.createRange();if(!e)return;let r=t.cursorWrapper.dom,o=r.nodeName=="IMG";o?n.setStart(r.parentNode,Ct(r)+1):n.setStart(r,0),n.collapse(!0),e.removeAllRanges(),e.addRange(n),!o&&!t.state.selection.visible&&Jt&&Or<=11&&(r.disabled=!0,r.disabled=!1)}function g2(t,e){if(e instanceof _e){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(ay(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else ay(t)}function ay(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function xf(t,e,n,r){return t.someProp("createSelectionBetween",o=>o(t,e,n))||Pe.between(e,n,r)}function ly(t){return t.editable&&!t.hasFocus()?!1:y2(t)}function y2(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 LO(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return yo(e.node,e.offset,n.anchorNode,n.anchorOffset)}function Zd(t,e){let{$anchor:n,$head:r}=t.selection,o=e>0?n.max(r):n.min(r),i=o.parent.inlineContent?o.depth?t.doc.resolve(e>0?o.after():o.before()):null:o;return i&&je.findFrom(i,e)}function xr(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function cy(t,e,n){let r=t.state.selection;if(r instanceof Pe)if(n.indexOf("s")>-1){let{$head:o}=r,i=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let s=t.state.doc.resolve(o.pos+i.nodeSize*(e<0?-1:1));return xr(t,new Pe(r.$anchor,s))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let o=Zd(t.state,e);return o&&o instanceof _e?xr(t,o):!1}else if(!(fn&&n.indexOf("m")>-1)){let o=r.$head,i=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter,s;if(!i||i.isText)return!1;let a=e<0?o.pos-i.nodeSize:o.pos;return i.isAtom||(s=t.docView.descAt(a))&&!s.contentDOM?_e.isSelectable(i)?xr(t,new _e(e<0?t.state.doc.resolve(o.pos-i.nodeSize):o)):Js?xr(t,new Pe(t.state.doc.resolve(e<0?a:a+i.nodeSize))):!1:!1}}else return!1;else{if(r instanceof _e&&r.node.isInline)return xr(t,new Pe(e>0?r.$to:r.$from));{let o=Zd(t.state,e);return o?xr(t,o):!1}}}function xl(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function es(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function Mo(t,e){return e<0?PO(t):zO(t)}function PO(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,i,s=!1;for(xn&&n.nodeType==1&&r<xl(n)&&es(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(es(a,-1))o=n,i=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(w2(n))break;{let a=n.previousSibling;for(;a&&es(a,-1);)o=n.parentNode,i=Ct(a),a=a.previousSibling;if(a)n=a,r=xl(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?Qd(t,n,r):o&&Qd(t,o,i)}function zO(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o=xl(n),i,s;for(;;)if(r<o){if(n.nodeType!=1)break;let a=n.childNodes[r];if(es(a,1))i=n,s=++r;else break}else{if(w2(n))break;{let a=n.nextSibling;for(;a&&es(a,1);)i=a.parentNode,s=Ct(a)+1,a=a.nextSibling;if(a)n=a,r=0,o=xl(n);else{if(n=n.parentNode,n==t.dom)break;r=o=0}}}i&&Qd(t,i,s)}function w2(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function jO(t,e){for(;t&&e==t.childNodes.length&&!Ks(t);)e=Ct(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=0}}function qO(t,e){for(;t&&!e&&!Ks(t);)e=Ct(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=t.childNodes.length}}function Qd(t,e,n){if(e.nodeType!=3){let i,s;(s=jO(e,n))?(e=s,n=0):(i=qO(e,n))&&(e=i,n=i.nodeValue.length)}let r=t.domSelection();if(!r)return;if(ic(r)){let i=document.createRange();i.setEnd(e,n),i.setStart(e,n),r.removeAllRanges(),r.addRange(i)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:o}=t;setTimeout(()=>{t.state==o&&or(t)},50)}function uy(t,e){let n=t.state.doc.resolve(e);if(!(Dt||uO)&&n.parent.inlineContent){let r=t.coordsAtPos(e);if(e>n.start()){let o=t.coordsAtPos(e-1),i=(o.top+o.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(o.left-r.left)>1)return o.left<r.left?"ltr":"rtl"}if(e<n.end()){let o=t.coordsAtPos(e+1),i=(o.top+o.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(o.left-r.left)>1)return o.left>r.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function dy(t,e,n){let r=t.state.selection;if(r instanceof Pe&&!r.empty||n.indexOf("s")>-1||fn&&n.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=Zd(t.state,e);if(s&&s instanceof _e)return xr(t,s)}if(!o.parent.inlineContent){let s=e<0?o:i,a=r instanceof Nn?je.near(s,e):je.findFrom(s,e);return a?xr(t,a):!1}return!1}function py(t,e){if(!(t.state.selection instanceof Pe))return!0;let{$head:n,$anchor:r,empty:o}=t.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let i=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let s=t.state.tr;return e<0?s.delete(n.pos-i.nodeSize,n.pos):s.delete(n.pos,n.pos+i.nodeSize),t.dispatch(s),!0}return!1}function fy(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function VO(t){if(!qt||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;fy(t,r,"true"),setTimeout(()=>fy(t,r,"false"),20)}return!1}function UO(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function HO(t,e){let n=e.keyCode,r=UO(e);if(n==8||fn&&n==72&&r=="c")return py(t,-1)||Mo(t,-1);if(n==46&&!e.shiftKey||fn&&n==68&&r=="c")return py(t,1)||Mo(t,1);if(n==13||n==27)return!0;if(n==37||fn&&n==66&&r=="c"){let o=n==37?uy(t,t.state.selection.from)=="ltr"?-1:1:-1;return cy(t,o,r)||Mo(t,o)}else if(n==39||fn&&n==70&&r=="c"){let o=n==39?uy(t,t.state.selection.from)=="ltr"?1:-1:1;return cy(t,o,r)||Mo(t,o)}else{if(n==38||fn&&n==80&&r=="c")return dy(t,-1,r)||Mo(t,-1);if(n==40||fn&&n==78&&r=="c")return VO(t)||dy(t,1,r)||Mo(t,1);if(r==(fn?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function kf(t,e){t.someProp("transformCopied",f=>{e=f(e,t)});let n=[],{content:r,openStart:o,openEnd:i}=e;for(;o>1&&i>1&&r.childCount==1&&r.firstChild.childCount==1;){o--,i--;let f=r.firstChild;n.push(f.type.name,f.attrs!=f.type.defaultAttrs?f.attrs:null),r=f.content}let s=t.someProp("clipboardSerializer")||xi.fromSchema(t.state.schema),a=A2(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let c=l.firstChild,u,d=0;for(;c&&c.nodeType==1&&(u=S2[c.nodeName.toLowerCase()]);){for(let f=u.length-1;f>=0;f--){let h=a.createElement(u[f]);for(;l.firstChild;)h.appendChild(l.firstChild);l.appendChild(h),d++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${o} ${i}${d?` -${d}`:""} ${JSON.stringify(n)}`);let p=t.someProp("clipboardTextSerializer",f=>f(e,t))||e.content.textBetween(0,e.content.size,`
42
+
43
+ `);return{dom:l,text:p,slice:e}}function b2(t,e,n,r,o){let i=o.parent.type.spec.code,s,a;if(!n&&!e)return null;let l=e&&(r||i||!n);if(l){if(t.someProp("transformPastedText",p=>{e=p(e,i||r,t)}),i)return e?new ve(ye.from(t.state.schema.text(e.replace(/\r\n?/g,`
44
+ `))),0,0):ve.empty;let d=t.someProp("clipboardTextParser",p=>p(e,o,r,t));if(d)a=d;else{let p=o.marks(),{schema:f}=t.state,h=xi.fromSchema(f);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let y=s.appendChild(document.createElement("p"));m&&y.appendChild(h.serializeNode(f.text(m,p)))})}}else t.someProp("transformPastedHTML",d=>{n=d(n,t)}),s=JO(n),Js&&XO(s);let c=s&&s.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let d=+u[3];d>0;d--){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")||er.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||u),context:o,ruleFromNode(d){return d.nodeName=="BR"&&!d.nextSibling&&d.parentNode&&!WO.test(d.parentNode.nodeName)?{ignore:!0}:null}})),u)a=YO(hy(a,+u[1],+u[2]),u[4]);else if(a=ve.maxOpen(GO(a.content,o),!0),a.openStart||a.openEnd){let d=0,p=0;for(let f=a.content.firstChild;d<a.openStart&&!f.type.spec.isolating;d++,f=f.firstChild);for(let f=a.content.lastChild;p<a.openEnd&&!f.type.spec.isolating;p++,f=f.lastChild);a=hy(a,d,p)}return t.someProp("transformPasted",d=>{a=d(a,t)}),a}const WO=/^(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 GO(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.index(n)),o,i=[];if(t.forEach(s=>{if(!i)return;let a=r.findWrapping(s.type),l;if(!a)return i=null;if(l=i.length&&o.length&&x2(a,o,s,i[i.length-1],0))i[i.length-1]=l;else{i.length&&(i[i.length-1]=k2(i[i.length-1],o.length));let c=v2(s,a);i.push(c),r=r.matchType(c.type),o=a}}),i)return ye.from(i)}return t}function v2(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,ye.from(t));return t}function x2(t,e,n,r,o){if(o<t.length&&o<e.length&&t[o]==e[o]){let i=x2(t,e,n,r.lastChild,o+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(o==t.length-1?n.type:t[o+1]))return r.copy(r.content.append(ye.from(v2(n,t,o+1))))}}function k2(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,k2(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(ye.empty,!0);return t.copy(n.append(r))}function ep(t,e,n,r,o,i){let s=e<0?t.firstChild:t.lastChild,a=s.content;return t.childCount>1&&(i=0),o<r-1&&(a=ep(a,e,n,r,o+1,i)),o>=n&&(a=e<0?s.contentMatchAt(0).fillBefore(a,i<=o).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(ye.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(a))}function hy(t,e,n){return e<t.openStart&&(t=new ve(ep(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new ve(ep(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const S2={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 my=null;function A2(){return my||(my=document.implementation.createHTMLDocument("title"))}let _u=null;function KO(t){let e=window.trustedTypes;return e?(_u||(_u=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),_u.createHTML(t)):t}function JO(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=A2().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),o;if((o=r&&S2[r[1].toLowerCase()])&&(t=o.map(i=>"<"+i+">").join("")+t+o.map(i=>"</"+i+">").reverse().join("")),n.innerHTML=KO(t),o)for(let i=0;i<o.length;i++)n=n.querySelector(o[i])||n;return n}function XO(t){let e=t.querySelectorAll(Dt?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function YO(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:o,openStart:i,openEnd:s}=t;for(let a=r.length-2;a>=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;o=ye.from(l.create(r[a+1],o)),i++,s++}return new ve(o,i,s)}const Vt={},Ut={},ZO={touchstart:!0,touchmove:!0};class QO{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},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 e5(t){for(let e in Vt){let n=Vt[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{n5(t,r)&&!Sf(t,r)&&(t.editable||!(r.type in Ut))&&n(t,r)},ZO[e]?{passive:!0}:void 0)}qt&&t.dom.addEventListener("input",()=>null),tp(t)}function Ar(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function t5(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 tp(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>Sf(t,r))})}function Sf(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function n5(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function r5(t,e){!Sf(t,e)&&Vt[e.type]&&(t.editable||!(e.type in Ut))&&Vt[e.type](t,e)}Ut.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!E2(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Qn&&Dt&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),ui&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",o=>o(t,Xr(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||HO(t,n)?n.preventDefault():Ar(t,"key")};Ut.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};Ut.keypress=(t,e)=>{let n=e;if(E2(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||fn&&n.metaKey)return;if(t.someProp("handleKeyPress",o=>o(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof Pe)||!r.$from.sameParent(r.$to)){let o=String.fromCharCode(n.charCode);!/[\r\n]/.test(o)&&!t.someProp("handleTextInput",i=>i(t,r.$from.pos,r.$to.pos,o))&&t.dispatch(t.state.tr.insertText(o).scrollIntoView()),n.preventDefault()}};function sc(t){return{left:t.clientX,top:t.clientY}}function o5(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function Af(t,e,n,r,o){if(r==-1)return!1;let i=t.state.doc.resolve(r);for(let s=i.depth+1;s>0;s--)if(t.someProp(e,a=>s>i.depth?a(t,n,i.nodeAfter,i.before(s),o,!0):a(t,n,i.node(s),i.before(s),o,!1)))return!0;return!1}function Yo(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function i5(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&_e.isSelectable(r)?(Yo(t,new _e(n)),!0):!1}function s5(t,e){if(e==-1)return!1;let n=t.state.selection,r,o;n instanceof _e&&(r=n.node);let i=t.state.doc.resolve(e);for(let s=i.depth+1;s>0;s--){let a=s>i.depth?i.nodeAfter:i.node(s);if(_e.isSelectable(a)){r&&n.$from.depth>0&&s>=n.$from.depth&&i.before(n.$from.depth+1)==n.$from.pos?o=i.before(n.$from.depth):o=i.before(s);break}}return o!=null?(Yo(t,_e.create(t.state.doc,o)),!0):!1}function a5(t,e,n,r,o){return Af(t,"handleClickOn",e,n,r)||t.someProp("handleClick",i=>i(t,e,r))||(o?s5(t,n):i5(t,n))}function l5(t,e,n,r){return Af(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",o=>o(t,e,r))}function c5(t,e,n,r){return Af(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",o=>o(t,e,r))||u5(t,n,r)}function u5(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(Yo(t,Pe.create(r,0,r.content.size)),!0):!1;let o=r.resolve(e);for(let i=o.depth+1;i>0;i--){let s=i>o.depth?o.nodeAfter:o.node(i),a=o.before(i);if(s.inlineContent)Yo(t,Pe.create(r,a+1,a+1+s.content.size));else if(_e.isSelectable(s))Yo(t,_e.create(r,a));else continue;return!0}}function Cf(t){return kl(t)}const C2=fn?"metaKey":"ctrlKey";Vt.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Cf(t),o=Date.now(),i="singleClick";o-t.input.lastClick.time<500&&o5(n,t.input.lastClick)&&!n[C2]&&t.input.lastClick.button==n.button&&(t.input.lastClick.type=="singleClick"?i="doubleClick":t.input.lastClick.type=="doubleClick"&&(i="tripleClick")),t.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i,button:n.button};let s=t.posAtCoords(sc(n));s&&(i=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new d5(t,s,n,!!r)):(i=="doubleClick"?l5:c5)(t,s.pos,s.inside,n)?n.preventDefault():Ar(t,"pointer"))};class d5{constructor(e,n,r,o){this.view=e,this.pos=n,this.event=r,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[C2],this.allowDefault=r.shiftKey;let i,s;if(n.inside>-1)i=e.state.doc.nodeAt(n.inside),s=n.inside;else{let u=e.state.doc.resolve(n.pos);i=u.parent,s=u.depth?u.before():0}const a=o?null:r.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l&&l.dom.nodeType==1?l.dom:null;let{selection:c}=e.state;(r.button==0&&i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof _e&&c.from<=s&&c.to>s)&&(this.mightDrag={node:i,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&xn&&!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)),Ar(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(()=>or(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(sc(e))),this.updateAllowDefault(e),this.allowDefault||!n?Ar(this.view,"pointer"):a5(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||qt&&this.mightDrag&&!this.mightDrag.node.isAtom||Dt&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(Yo(this.view,je.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):Ar(this.view,"pointer")}move(e){this.updateAllowDefault(e),Ar(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)}}Vt.touchstart=t=>{t.input.lastTouch=Date.now(),Cf(t),Ar(t,"pointer")};Vt.touchmove=t=>{t.input.lastTouch=Date.now(),Ar(t,"pointer")};Vt.contextmenu=t=>Cf(t);function E2(t,e){return t.composing?!0:qt&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const p5=Qn?5e3:-1;Ut.compositionstart=Ut.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof Pe&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),kl(t,!0),t.markCursor=null;else if(kl(t,!e.selection.empty),xn&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let o=r.focusNode,i=r.focusOffset;o&&o.nodeType==1&&i!=0;){let s=i<0?o.lastChild:o.childNodes[i-1];if(!s)break;if(s.nodeType==3){let a=t.domSelection();a&&a.collapse(s,s.nodeValue.length);break}else o=s,i=-1}}t.input.composing=!0}T2(t,p5)};Ut.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++,T2(t,20))};function T2(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>kl(t),e))}function $2(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=h5());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function f5(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=iO(e.focusNode,e.focusOffset),r=sO(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let o=r.pmViewDesc,i=t.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!o||!o.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let s=n.pmViewDesc;if(!(!s||!s.isText(n.nodeValue)))return r}}return n||r}function h5(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function kl(t,e=!1){if(!(Qn&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),$2(t),e||t.docView&&t.docView.dirty){let n=vf(t),r=t.state.selection;return n&&!n.eq(r)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function m5(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const vs=Jt&&Or<15||ui&&dO<604;Vt.copy=Ut.cut=(t,e)=>{let n=e,r=t.state.selection,o=n.type=="cut";if(r.empty)return;let i=vs?null:n.clipboardData,s=r.content(),{dom:a,text:l}=kf(t,s);i?(n.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",l)):m5(t,a),o&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function g5(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function y5(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let o=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?xs(t,r.value,null,o,e):xs(t,r.textContent,r.innerHTML,o,e)},50)}function xs(t,e,n,r,o){let i=b2(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,o,i||ve.empty)))return!0;if(!i)return!1;let s=g5(i),a=s?t.state.tr.replaceSelectionWith(s,r):t.state.tr.replaceSelection(i);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function O2(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Ut.paste=(t,e)=>{let n=e;if(t.composing&&!Qn)return;let r=vs?null:n.clipboardData,o=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&xs(t,O2(r),r.getData("text/html"),o,n)?n.preventDefault():y5(t,n)};let M2=class{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}};const w5=fn?"altKey":"ctrlKey";function D2(t,e){return t.someProp("dragCopies",r=>!r(e))??!e[w5]}Vt.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o=t.state.selection,i=o.empty?null:t.posAtCoords(sc(n)),s;if(!(i&&i.pos>=o.from&&i.pos<=(o instanceof _e?o.to-1:o.to))){if(r&&r.mightDrag)s=_e.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let d=t.docView.nearestDesc(n.target,!0);d&&d.node.type.spec.draggable&&d!=t.docView&&(s=_e.create(t.state.doc,d.posBefore))}}let a=(s||t.state.selection).content(),{dom:l,text:c,slice:u}=kf(t,a);(!n.dataTransfer.files.length||!Dt||e2>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(vs?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",vs||n.dataTransfer.setData("text/plain",c),t.dragging=new M2(u,D2(t,n),s)};Vt.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};Ut.dragover=Ut.dragenter=(t,e)=>e.preventDefault();Ut.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let o=t.posAtCoords(sc(n));if(!o)return;let i=t.state.doc.resolve(o.pos),s=r&&r.slice;s?t.someProp("transformPasted",h=>{s=h(s,t)}):s=b2(t,O2(n.dataTransfer),vs?null:n.dataTransfer.getData("text/html"),!1,i);let a=!!(r&&D2(t,n));if(t.someProp("handleDrop",h=>h(t,n,s||ve.empty,a))){n.preventDefault();return}if(!s)return;n.preventDefault();let l=s?vv(t.state.doc,i.pos,s):i.pos;l==null&&(l=i.pos);let c=t.state.tr;if(a){let{node:h}=r;h?h.replace(c):c.deleteSelection()}let u=c.mapping.map(l),d=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,p=c.doc;if(d?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(p))return;let f=c.doc.resolve(u);if(d&&_e.isSelectable(s.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new _e(f));else{let h=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((m,y,g,v)=>h=v),c.setSelection(xf(t,f,c.doc.resolve(h)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))};Vt.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())&&or(t)},20))};Vt.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};Vt.beforeinput=(t,e)=>{if(Dt&&Qn&&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,Xr(8,"Backspace")))))return;let{$cursor:r}=t.state.selection;r&&r.pos>0&&t.dispatch(t.state.tr.delete(r.pos-1,r.pos).scrollIntoView())},50)}};for(let t in Ut)Vt[t]=Ut[t];function ks(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}let gy=class _2{constructor(e,n){this.toDOM=e,this.spec=n||ao,this.side=this.spec.side||0}map(e,n,r,o){let{pos:i,deleted:s}=e.mapResult(n.from+o,this.side<0?-1:1);return s?null:new Le(i-r,i-r,this)}valid(){return!0}eq(e){return this==e||e instanceof _2&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&ks(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},ts=class np{constructor(e,n){this.attrs=e,this.spec=n||ao}map(e,n,r,o){let i=e.map(n.from+o,this.spec.inclusiveStart?-1:1)-r,s=e.map(n.to+o,this.spec.inclusiveEnd?1:-1)-r;return i>=s?null:new Le(i,s,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof np&&ks(this.attrs,e.attrs)&&ks(this.spec,e.spec)}static is(e){return e.type instanceof np}destroy(){}};class Ef{constructor(e,n){this.attrs=e,this.spec=n||ao}map(e,n,r,o){let i=e.mapResult(n.from+o,1);if(i.deleted)return null;let s=e.mapResult(n.to+o,-1);return s.deleted||s.pos<=i.pos?null:new Le(i.pos-r,s.pos-r,this)}valid(e,n){let{index:r,offset:o}=e.content.findIndex(n.from),i;return o==n.from&&!(i=e.child(r)).isText&&o+i.nodeSize==n.to}eq(e){return this==e||e instanceof Ef&&ks(this.attrs,e.attrs)&&ks(this.spec,e.spec)}destroy(){}}class Le{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new Le(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new Le(e,e,new gy(n,r))}static inline(e,n,r,o){return new Le(e,n,new ts(r,o))}static node(e,n,r,o){return new Le(e,n,new Ef(r,o))}get spec(){return this.type.spec}get inline(){return this.type instanceof ts}get widget(){return this.type instanceof gy}}const jo=[],ao={};class De{constructor(e,n){this.local=e.length?e:jo,this.children=n.length?n:jo}static create(e,n){return n.length?Sl(n,e,0,ao):Ot}find(e,n,r){let o=[];return this.findInner(e??0,n??1e9,o,0,r),o}findInner(e,n,r,o,i){for(let s=0;s<this.local.length;s++){let a=this.local[s];a.from<=n&&a.to>=e&&(!i||i(a.spec))&&r.push(a.copy(a.from+o,a.to+o))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<n&&this.children[s+1]>e){let a=this.children[s]+1;this.children[s+2].findInner(e-a,n-a,r,o+a,i)}}map(e,n,r){return this==Ot||e.maps.length==0?this:this.mapInner(e,n,0,0,r||ao)}mapInner(e,n,r,o,i){let s;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(e,r,o);l&&l.type.valid(n,l)?(s||(s=[])).push(l):i.onRemove&&i.onRemove(this.local[a].spec)}return this.children.length?b5(this.children,s||[],e,n,r,o,i):s?new De(s.sort(lo),jo):Ot}add(e,n){return n.length?this==Ot?De.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let o,i=0;e.forEach((a,l)=>{let c=l+r,u;if(u=F2(n,a,c)){for(o||(o=this.children.slice());i<o.length&&o[i]<l;)i+=3;o[i]==l?o[i+2]=o[i+2].addInner(a,u,c+1):o.splice(i,0,l,l+a.nodeSize,Sl(u,a,c+1,ao)),i+=3}});let s=I2(i?R2(n):n,-r);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||s.splice(a--,1);return new De(s.length?this.local.concat(s).sort(lo):this.local,o||this.children)}remove(e){return e.length==0||this==Ot?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,o=this.local;for(let i=0;i<r.length;i+=3){let s,a=r[i]+n,l=r[i+1]+n;for(let u=0,d;u<e.length;u++)(d=e[u])&&d.from>a&&d.to<l&&(e[u]=null,(s||(s=[])).push(d));if(!s)continue;r==this.children&&(r=this.children.slice());let c=r[i+2].removeInner(s,a+1);c!=Ot?r[i+2]=c:(r.splice(i,3),i-=3)}if(o.length){for(let i=0,s;i<e.length;i++)if(s=e[i])for(let a=0;a<o.length;a++)o[a].eq(s,n)&&(o==this.local&&(o=this.local.slice()),o.splice(a--,1))}return r==this.children&&o==this.local?this:o.length||r.length?new De(o,r):Ot}forChild(e,n){if(this==Ot)return this;if(n.isLeaf)return De.empty;let r,o;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(r=this.children[a+2]);break}let i=e+1,s=i+n.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<s&&l.to>i&&l.type instanceof ts){let c=Math.max(i,l.from)-i,u=Math.min(s,l.to)-i;c<u&&(o||(o=[])).push(l.copy(c,u))}}if(o){let a=new De(o.sort(lo),jo);return r?new N2([a,r]):a}return r||Ot}eq(e){if(this==e)return!0;if(!(e instanceof De)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return Tf(this.localsInner(e))}localsInner(e){if(this==Ot)return jo;if(e.inlineContent||!this.local.some(ts.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof ts||n.push(this.local[r]);return n}forEachSet(e){e(this)}}De.empty=new De([],[]);De.removeOverlap=Tf;const Ot=De.empty;let N2=class qo{constructor(e){this.members=e}map(e,n){const r=this.members.map(o=>o.map(e,n,ao));return qo.from(r)}forChild(e,n){if(n.isLeaf)return De.empty;let r=[];for(let o=0;o<this.members.length;o++){let i=this.members[o].forChild(e,n);i!=Ot&&(i instanceof qo?r=r.concat(i.members):r.push(i))}return qo.from(r)}eq(e){if(!(e instanceof qo)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let o=0;o<this.members.length;o++){let i=this.members[o].localsInner(e);if(i.length)if(!n)n=i;else{r&&(n=n.slice(),r=!1);for(let s=0;s<i.length;s++)n.push(i[s])}}return n?Tf(r?n:n.sort(lo)):jo}static from(e){switch(e.length){case 0:return Ot;case 1:return e[0];default:return new qo(e.every(n=>n instanceof De)?e:e.reduce((n,r)=>n.concat(r instanceof De?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}};function b5(t,e,n,r,o,i,s){let a=t.slice();for(let c=0,u=i;c<n.maps.length;c++){let d=0;n.maps[c].forEach((p,f,h,m)=>{let y=m-h-(f-p);for(let g=0;g<a.length;g+=3){let v=a[g+1];if(v<0||p>v+u-d)continue;let k=a[g]+u-d;f>=k?a[g+1]=p<=k?-2:-1:p>=u&&y&&(a[g]+=y,a[g+1]+=y)}d+=y}),u=n.maps[c].map(u,-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 u=n.map(t[c]+i),d=u-o;if(d<0||d>=r.content.size){l=!0;continue}let p=n.map(t[c+1]+i,-1),f=p-o,{index:h,offset:m}=r.content.findIndex(d),y=r.maybeChild(h);if(y&&m==d&&m+y.nodeSize==f){let g=a[c+2].mapInner(n,y,u+1,t[c]+i+1,s);g!=Ot?(a[c]=d,a[c+1]=f,a[c+2]=g):(a[c+1]=-2,l=!0)}else l=!0}if(l){let c=v5(a,t,e,n,o,i,s),u=Sl(c,r,0,s);e=u.local;for(let d=0;d<a.length;d+=3)a[d+1]<0&&(a.splice(d,3),d-=3);for(let d=0,p=0;d<u.children.length;d+=3){let f=u.children[d];for(;p<a.length&&a[p]<f;)p+=3;a.splice(p,0,u.children[d],u.children[d+1],u.children[d+2])}}return new De(e.sort(lo),a)}function I2(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let o=t[r];n.push(new Le(o.from+e,o.to+e,o.type))}return n}function v5(t,e,n,r,o,i,s){function a(l,c){for(let u=0;u<l.local.length;u++){let d=l.local[u].map(r,o,c);d?n.push(d):s.onRemove&&s.onRemove(l.local[u].spec)}for(let u=0;u<l.children.length;u+=3)a(l.children[u+2],l.children[u]+c+1)}for(let l=0;l<t.length;l+=3)t[l+1]==-1&&a(t[l+2],e[l]+i+1);return n}function F2(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,o=null;for(let i=0,s;i<t.length;i++)(s=t[i])&&s.from>n&&s.to<r&&((o||(o=[])).push(s),t[i]=null);return o}function R2(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function Sl(t,e,n,r){let o=[],i=!1;e.forEach((a,l)=>{let c=F2(t,a,l+n);if(c){i=!0;let u=Sl(c,a,n+l+1,r);u!=Ot&&o.push(l,l+a.nodeSize,u)}});let s=I2(i?R2(t):t,-n).sort(lo);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||(r.onRemove&&r.onRemove(s[a].spec),s.splice(a--,1));return s.length||o.length?new De(s,o):Ot}function lo(t,e){return t.from-e.from||t.to-e.to}function Tf(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let o=n+1;o<e.length;o++){let i=e[o];if(i.from==r.from){i.to!=r.to&&(e==t&&(e=t.slice()),e[o]=i.copy(i.from,r.to),yy(e,o+1,i.copy(r.to,i.to)));continue}else{i.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,i.from),yy(e,o,r.copy(i.from,r.to)));break}}}return e}function yy(t,e,n){for(;e<t.length&&lo(n,t[e])>0;)e++;t.splice(e,0,n)}function Nu(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=Ot&&e.push(r)}),t.cursorWrapper&&e.push(De.create(t.state.doc,[t.cursorWrapper.deco])),N2.from(e)}const x5={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},k5=Jt&&Or<=11;class S5{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 A5{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new S5,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let o=0;o<r.length;o++)this.queue.push(r[o]);Jt&&Or<=11&&r.some(o=>o.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():this.flush()}),k5&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.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,x5)),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 n=0;n<e.length;n++)this.queue.push(e[n]);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(ly(this.view)){if(this.suppressingSelectionUpdates)return or(this.view);if(Jt&&Or<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&yo(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 n=new Set,r;for(let i=e.focusNode;i;i=ci(i))n.add(i);for(let i=e.anchorNode;i;i=ci(i))if(n.has(i)){r=i;break}let o=r&&this.view.docView.nearestDesc(r);if(o&&o.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))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 n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&ly(e)&&!this.ignoreSelectionChange(r),i=-1,s=-1,a=!1,l=[];if(e.editable)for(let u=0;u<n.length;u++){let d=this.registerMutation(n[u],l);d&&(i=i<0?d.from:Math.min(d.from,i),s=s<0?d.to:Math.max(d.to,s),d.typeOver&&(a=!0))}if(xn&&l.length){let u=l.filter(d=>d.nodeName=="BR");if(u.length==2){let[d,p]=u;d.parentNode&&d.parentNode.parentNode==p.parentNode?p.remove():d.remove()}else{let{focusNode:d}=this.currentSelection;for(let p of u){let f=p.parentNode;f&&f.nodeName=="LI"&&(!d||T5(e,d)!=f)&&p.remove()}}}let c=null;i<0&&o&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&ic(r)&&(c=vf(e))&&c.eq(je.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,or(e),this.currentSelection.set(r),e.scrollToSelection()):(i>-1||o)&&(i>-1&&(e.docView.markDirty(i,s),C5(e)),this.handleDOMChange(i,s,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||or(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;u<e.addedNodes.length;u++){let d=e.addedNodes[u];n.push(d),d.nodeType==3&&(this.lastChangedTextNode=d)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let o=e.previousSibling,i=e.nextSibling;if(Jt&&Or<=11&&e.addedNodes.length)for(let u=0;u<e.addedNodes.length;u++){let{previousSibling:d,nextSibling:p}=e.addedNodes[u];(!d||Array.prototype.indexOf.call(e.addedNodes,d)<0)&&(o=d),(!p||Array.prototype.indexOf.call(e.addedNodes,p)<0)&&(i=p)}let s=o&&o.parentNode==e.target?Ct(o)+1:0,a=r.localPosFromDOM(e.target,s,-1),l=i&&i.parentNode==e.target?Ct(i):e.target.childNodes.length,c=r.localPosFromDOM(e.target,l,1);return{from:a,to:c}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let wy=new WeakMap,by=!1;function C5(t){if(!wy.has(t)&&(wy.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=xn,by)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."),by=!0}}function vy(t,e){let n=e.startContainer,r=e.startOffset,o=e.endContainer,i=e.endOffset,s=t.domAtPos(t.state.selection.anchor);return yo(s.node,s.offset,o,i)&&([n,r,o,i]=[o,i,n,r]),{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:i}}function E5(t,e){if(e.getComposedRanges){let o=e.getComposedRanges(t.root)[0];if(o)return vy(t,o)}let n;function r(o){o.preventDefault(),o.stopImmediatePropagation(),n=o.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?vy(t,n):null}function T5(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let r=t.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function $5(t,e,n){let{node:r,fromOffset:o,toOffset:i,from:s,to:a}=t.docView.parseRange(e,n),l=t.domSelectionRange(),c,u=l.anchorNode;if(u&&t.dom.contains(u.nodeType==1?u:u.parentNode)&&(c=[{node:u,offset:l.anchorOffset}],ic(l)||c.push({node:l.focusNode,offset:l.focusOffset})),Dt&&t.input.lastKeyCode===8)for(let y=i;y>o;y--){let g=r.childNodes[y-1],v=g.pmViewDesc;if(g.nodeName=="BR"&&!v){i=y;break}if(!v||v.size)break}let d=t.state.doc,p=t.someProp("domParser")||er.fromSchema(t.state.schema),f=d.resolve(s),h=null,m=p.parse(r,{topNode:f.parent,topMatch:f.parent.contentMatchAt(f.index()),topOpen:!0,from:o,to:i,preserveWhitespace:f.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:O5,context:f});if(c&&c[0].pos!=null){let y=c[0].pos,g=c[1]&&c[1].pos;g==null&&(g=y),h={anchor:y+s,head:g+s}}return{doc:m,sel:h,from:s,to:a}}function O5(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(qt&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||qt&&/^(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 M5=/^(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 D5(t,e,n,r,o){let i=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let E=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,G=vf(t,E);if(G&&!t.state.selection.eq(G)){if(Dt&&Qn&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",N=>N(t,Xr(13,"Enter"))))return;let oe=t.state.tr.setSelection(G);E=="pointer"?oe.setMeta("pointer",!0):E=="key"&&oe.scrollIntoView(),i&&oe.setMeta("composition",i),t.dispatch(oe)}return}let s=t.state.doc.resolve(e),a=s.sharedDepth(n);e=s.before(a+1),n=t.state.doc.resolve(n).after(a+1);let l=t.state.selection,c=$5(t,e,n),u=t.state.doc,d=u.slice(c.from,c.to),p,f;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(p=t.state.selection.to,f="end"):(p=t.state.selection.from,f="start"),t.input.lastKeyCode=null;let h=I5(d.content,c.doc.content,c.from,p,f);if(h&&t.input.domChangeCount++,(ui&&t.input.lastIOSEnter>Date.now()-225||Qn)&&o.some(E=>E.nodeType==1&&!M5.test(E.nodeName))&&(!h||h.endA>=h.endB)&&t.someProp("handleKeyDown",E=>E(t,Xr(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!h)if(r&&l instanceof Pe&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))h={start:l.from,endA:l.to,endB:l.to};else{if(c.sel){let E=xy(t,t.state.doc,c.sel);if(E&&!E.eq(t.state.selection)){let G=t.state.tr.setSelection(E);i&&G.setMeta("composition",i),t.dispatch(G)}}return}t.state.selection.from<t.state.selection.to&&h.start==h.endB&&t.state.selection instanceof Pe&&(h.start>t.state.selection.from&&h.start<=t.state.selection.from+2&&t.state.selection.from>=c.from?h.start=t.state.selection.from:h.endA<t.state.selection.to&&h.endA>=t.state.selection.to-2&&t.state.selection.to<=c.to&&(h.endB+=t.state.selection.to-h.endA,h.endA=t.state.selection.to)),Jt&&Or<=11&&h.endB==h.start+1&&h.endA==h.start&&h.start>c.from&&c.doc.textBetween(h.start-c.from-1,h.start-c.from+1)=="  "&&(h.start--,h.endA--,h.endB--);let m=c.doc.resolveNoCache(h.start-c.from),y=c.doc.resolveNoCache(h.endB-c.from),g=u.resolve(h.start),v=m.sameParent(y)&&m.parent.inlineContent&&g.end()>=h.endA,k;if((ui&&t.input.lastIOSEnter>Date.now()-225&&(!v||o.some(E=>E.nodeName=="DIV"||E.nodeName=="P"))||!v&&m.pos<c.doc.content.size&&(!m.sameParent(y)||!m.parent.inlineContent)&&!/\S/.test(c.doc.textBetween(m.pos,y.pos,"",""))&&(k=je.findFrom(c.doc.resolve(m.pos+1),1,!0))&&k.head>m.pos)&&t.someProp("handleKeyDown",E=>E(t,Xr(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>h.start&&N5(u,h.start,h.endA,m,y)&&t.someProp("handleKeyDown",E=>E(t,Xr(8,"Backspace")))){Qn&&Dt&&t.domObserver.suppressSelectionUpdates();return}Dt&&h.endB==h.start&&(t.input.lastChromeDelete=Date.now()),Qn&&!v&&m.start()!=y.start()&&y.parentOffset==0&&m.depth==y.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==h.endA&&(h.endB-=2,y=c.doc.resolveNoCache(h.endB-c.from),setTimeout(()=>{t.someProp("handleKeyDown",function(E){return E(t,Xr(13,"Enter"))})},20));let b=h.start,C=h.endA,D,M,I;if(v){if(m.pos==y.pos)Jt&&Or<=11&&m.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>or(t),20)),D=t.state.tr.delete(b,C),M=u.resolve(h.start).marksAcross(u.resolve(h.endA));else if(h.endA==h.endB&&(I=_5(m.parent.content.cut(m.parentOffset,y.parentOffset),g.parent.content.cut(g.parentOffset,h.endA-g.start()))))D=t.state.tr,I.type=="add"?D.addMark(b,C,I.mark):D.removeMark(b,C,I.mark);else if(m.parent.child(m.index()).isText&&m.index()==y.index()-(y.textOffset?0:1)){let E=m.parent.textBetween(m.parentOffset,y.parentOffset);if(t.someProp("handleTextInput",G=>G(t,b,C,E)))return;D=t.state.tr.insertText(E,b,C)}}if(D||(D=t.state.tr.replace(b,C,c.doc.slice(h.start-c.from,h.endB-c.from))),c.sel){let E=xy(t,D.doc,c.sel);E&&!(Dt&&t.composing&&E.empty&&(h.start!=h.endB||t.input.lastChromeDelete<Date.now()-100)&&(E.head==b||E.head==D.mapping.map(C)-1)||Jt&&E.empty&&E.head==b)&&D.setSelection(E)}M&&D.ensureMarks(M),i&&D.setMeta("composition",i),t.dispatch(D.scrollIntoView())}function xy(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:xf(t,e.resolve(n.anchor),e.resolve(n.head))}function _5(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,o=n,i=r,s,a,l;for(let u=0;u<r.length;u++)o=r[u].removeFromSet(o);for(let u=0;u<n.length;u++)i=n[u].removeFromSet(i);if(o.length==1&&i.length==0)a=o[0],s="add",l=u=>u.mark(a.addToSet(u.marks));else if(o.length==0&&i.length==1)a=i[0],s="remove",l=u=>u.mark(a.removeFromSet(u.marks));else return null;let c=[];for(let u=0;u<e.childCount;u++)c.push(l(e.child(u)));if(ye.from(c).eq(t))return{mark:a,type:s}}function N5(t,e,n,r,o){if(n-e<=o.pos-r.pos||Iu(r,!0,!1)<o.pos)return!1;let i=t.resolve(e);if(!r.parent.isTextblock){let a=i.nodeAfter;return a!=null&&n==e+a.nodeSize}if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let s=t.resolve(Iu(i,!0,!0));return!s.parent.isTextblock||s.pos>n||Iu(s,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function Iu(t,e,n){let r=t.depth,o=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,o++,e=!1;if(n){let i=t.node(r).maybeChild(t.indexAfter(r));for(;i&&!i.isLeaf;)i=i.firstChild,o++}return o}function I5(t,e,n,r,o){let i=t.findDiffStart(e,n);if(i==null)return null;let{a:s,b:a}=t.findDiffEnd(e,n+t.size,n+e.size);if(o=="end"){let l=Math.max(0,i-Math.min(s,a));r-=s+l-i}if(s<i&&t.size<e.size){let l=r<=i&&r>=s?i-r:0;i-=l,i&&i<e.size&&ky(e.textBetween(i-1,i+1))&&(i+=l?1:-1),a=i+(a-s),s=i}else if(a<i){let l=r<=i&&r>=a?i-r:0;i-=l,i&&i<t.size&&ky(t.textBetween(i-1,i+1))&&(i+=l?1:-1),s=i+(s-a),a=i}return{start:i,endA:s,endB:a}}function ky(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}let B2=class{constructor(e,n){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 QO,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(Ty),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=Cy(this),Ay(this),this.nodeViews=Ey(this),this.docView=ny(this.state.doc,Sy(this),Nu(this),this.dom,this),this.domObserver=new A5(this,(r,o,i,s)=>D5(this,r,o,i,s)),this.domObserver.start(),e5(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 n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&tp(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Ty),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let o=this.state,i=!1,s=!1;e.storedMarks&&this.composing&&($2(this),s=!0),this.state=e;let a=o.plugins!=e.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let f=Ey(this);R5(f,this.nodeViews)&&(this.nodeViews=f,i=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&tp(this),this.editable=Cy(this),Ay(this);let l=Nu(this),c=Sy(this),u=o.plugins!=e.plugins&&!o.doc.eq(e.doc)?"reset":e.scrollToSelection>o.scrollToSelection?"to selection":"preserve",d=i||!this.docView.matchesNode(e.doc,c,l);(d||!e.selection.eq(o.selection))&&(s=!0);let p=u=="preserve"&&s&&this.dom.style.overflowAnchor==null&&hO(this);if(s){this.domObserver.stop();let f=d&&(Jt||Dt)&&!this.composing&&!o.selection.empty&&!e.selection.empty&&F5(o.selection,e.selection);if(d){let h=Dt?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=f5(this)),(i||!this.docView.update(e.doc,c,l,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=ny(e.doc,c,l,this.dom,this)),h&&!this.trackWrites&&(f=!0)}f||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&LO(this))?or(this,f):(g2(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(o),!((r=this.dragging)===null||r===void 0)&&r.node&&!o.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,o),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():p&&mO(p)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))&&!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof _e){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&Xg(this,n.getBoundingClientRect(),e)}else Xg(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 n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e)}}updateDraggedNode(e,n){let r=e.node,o=-1;if(this.state.doc.nodeAt(r.from)==r.node)o=r.from;else{let i=r.from+(this.state.doc.content.size-n.doc.content.size);(i>0&&this.state.doc.nodeAt(i))==r.node&&(o=i)}this.dragging=new M2(e.slice,e.move,o<0?void 0:_e.create(this.state.doc,o))}someProp(e,n){let r=this._props&&this._props[e],o;if(r!=null&&(o=n?n(r):r))return o;for(let s=0;s<this.directPlugins.length;s++){let a=this.directPlugins[s].props[e];if(a!=null&&(o=n?n(a):a))return o}let i=this.state.plugins;if(i)for(let s=0;s<i.length;s++){let a=i[s].props[e];if(a!=null&&(o=n?n(a):a))return o}}hasFocus(){if(Jt){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&&gO(this.dom),or(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return xO(this,e)}coordsAtPos(e,n=1){return i2(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let o=this.docView.posFromDOM(e,n,r);if(o==null)throw new RangeError("DOM position not inside the editor");return o}endOfTextblock(e,n){return EO(this,n||this.state,e)}pasteHTML(e,n){return xs(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return xs(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return kf(this,e)}destroy(){this.docView&&(t5(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Nu(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,rO())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return r5(this,e)}dispatch(e){let n=this._props.dispatchTransaction;n?n.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){let e=this.domSelection();return e?qt&&this.root.nodeType===11&&lO(this.dom.ownerDocument)==this.dom&&E5(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};function Sy(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[Le.node(0,t.state.doc.content.size,e)]}function Ay(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:Le.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function Cy(t){return!t.someProp("editable",e=>e(t.state)===!1)}function F5(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function Ey(t){let e=Object.create(null);function n(r){for(let o in r)Object.prototype.hasOwnProperty.call(e,o)||(e[o]=r[o])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function R5(t,e){let n=0,r=0;for(let o in t){if(t[o]!=e[o])return!0;n++}for(let o in e)r++;return n!=r}function Ty(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")}const Ss=Math.floor,B5=Math.abs,Mr=(t,e)=>t<e?t:e,di=(t,e)=>t>e?t:e,L5=t=>t!==0?t<0:1/t<0,P5=64,As=128,z5=1<<29,$y=63,ns=127,j5=2147483647,q5=Number.isInteger||(t=>typeof t=="number"&&isFinite(t)&&Ss(t)===t),V5=()=>new Set,U5=Array.isArray,H5=String.fromCharCode,W5=t=>t.toLowerCase(),G5=/^\s*/g,K5=t=>t.replace(G5,""),J5=/([A-Z])/g,Oy=(t,e)=>K5(t.replace(J5,n=>`${e}${W5(n)}`)),X5=t=>{const e=unescape(encodeURIComponent(t)),n=e.length,r=new Uint8Array(n);for(let o=0;o<n;o++)r[o]=e.codePointAt(o);return r},Cs=typeof TextEncoder<"u"?new TextEncoder:null,Y5=t=>Cs.encode(t),Z5=Cs?Y5:X5;let Fu=typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});Fu&&Fu.decode(new Uint8Array).length===1&&(Fu=null);class Q5{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}const eM=()=>new Q5,tM=t=>{const e=eM();return t(e),rM(e)},nM=t=>{let e=t.cpos;for(let n=0;n<t.bufs.length;n++)e+=t.bufs[n].length;return e},rM=t=>{const e=new Uint8Array(nM(t));let n=0;for(let r=0;r<t.bufs.length;r++){const o=t.bufs[r];e.set(o,n),n+=o.length}return e.set(new Uint8Array(t.cbuf.buffer,0,t.cpos),n),e},oM=(t,e)=>{const n=t.cbuf.length;n-t.cpos<e&&(t.bufs.push(new Uint8Array(t.cbuf.buffer,0,t.cpos)),t.cbuf=new Uint8Array(di(n,e)*2),t.cpos=0)},At=(t,e)=>{const n=t.cbuf.length;t.cpos===n&&(t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(n*2),t.cpos=0),t.cbuf[t.cpos++]=e},Es=(t,e)=>{for(;e>ns;)At(t,As|ns&e),e=Ss(e/128);At(t,ns&e)},iM=(t,e)=>{const n=L5(e);for(n&&(e=-e),At(t,(e>$y?As:0)|(n?P5:0)|$y&e),e=Ss(e/64);e>0;)At(t,(e>ns?As:0)|ns&e),e=Ss(e/128)},rp=new Uint8Array(3e4),sM=rp.length/3,aM=(t,e)=>{if(e.length<sM){const n=Cs.encodeInto(e,rp).written||0;Es(t,n);for(let r=0;r<n;r++)At(t,rp[r])}else L2(t,Z5(e))},lM=(t,e)=>{const n=unescape(encodeURIComponent(e)),r=n.length;Es(t,r);for(let o=0;o<r;o++)At(t,n.codePointAt(o))},My=Cs&&Cs.encodeInto?aM:lM,cM=(t,e)=>{const n=t.cbuf.length,r=t.cpos,o=Mr(n-r,e.length),i=e.length-o;t.cbuf.set(e.subarray(0,o),r),t.cpos+=o,i>0&&(t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(di(n*2,i)),t.cbuf.set(e.subarray(o)),t.cpos=i)},L2=(t,e)=>{Es(t,e.byteLength),cM(t,e)},$f=(t,e)=>{oM(t,e);const n=new DataView(t.cbuf.buffer,t.cpos,e);return t.cpos+=e,n},uM=(t,e)=>$f(t,4).setFloat32(0,e,!1),dM=(t,e)=>$f(t,8).setFloat64(0,e,!1),pM=(t,e)=>$f(t,8).setBigInt64(0,e,!1),Dy=new DataView(new ArrayBuffer(4)),fM=t=>(Dy.setFloat32(0,t),Dy.getFloat32(0)===t),op=(t,e)=>{switch(typeof e){case"string":At(t,119),My(t,e);break;case"number":q5(e)&&B5(e)<=j5?(At(t,125),iM(t,e)):fM(e)?(At(t,124),uM(t,e)):(At(t,123),dM(t,e));break;case"bigint":At(t,122),pM(t,e);break;case"object":if(e===null)At(t,126);else if(U5(e)){At(t,117),Es(t,e.length);for(let n=0;n<e.length;n++)op(t,e[n])}else if(e instanceof Uint8Array)At(t,116),L2(t,e);else{At(t,118);const n=Object.keys(e);Es(t,n.length);for(let r=0;r<n.length;r++){const o=n[r];My(t,o),op(t,e[o])}}break;case"boolean":At(t,e?120:121);break;default:At(t,127)}},P2=t=>new Error(t),hM=()=>{throw P2("Method unimplemented")},z2=()=>{throw P2("Unexpected case")},Ha=()=>new Map,j2=(t,e,n)=>{let r=t.get(e);return r===void 0&&t.set(e,r=n()),r},mM=Object.keys,gM=(t,e)=>{for(const n in t)if(!e(t[n],n))return!1;return!0},yM=(t,e)=>e.includes(t),wM=()=>{let t=!0;return(e,n)=>{if(t){t=!1;try{e()}finally{t=!0}}else n!==void 0&&n()}},bM=/[\uD800-\uDBFF]/,vM=/[\uDC00-\uDFFF]/,xM=(t,e)=>{let n=0,r=0;for(;n<t.length&&n<e.length&&t[n]===e[n];)n++;for(n>0&&bM.test(t[n-1])&&n--;r+n<t.length&&r+n<e.length&&t[t.length-r-1]===e[e.length-r-1];)r++;return r>0&&vM.test(t[t.length-r])&&r--,{index:n,remove:t.length-n-r,insert:e.slice(n,e.length-r)}},kM=xM,rt=new Ge("y-sync"),Dr=new Ge("y-undo"),ua=new Ge("yjs-cursor"),SM=Math.random,AM=t=>t[Ss(SM()*t.length)],CM=t=>t===void 0?null:t;class EM{constructor(){this.map=new Map}setItem(e,n){this.map.set(e,n)}getItem(e){return this.map.get(e)}}let q2=new EM,TM=!0;try{typeof localStorage<"u"&&localStorage&&(q2=localStorage,TM=!1)}catch{}const $M=q2,pi=typeof Se<"u"&&Se.release&&/node|io\.js/.test(Se.release.name)&&Object.prototype.toString.call(typeof Se<"u"?Se:0)==="[object process]",V2=typeof window<"u"&&typeof document<"u"&&!pi;let An;const OM=()=>{if(An===void 0)if(pi){An=Ha();const t=Se.argv;let e=null;for(let n=0;n<t.length;n++){const r=t[n];r[0]==="-"?(e!==null&&An.set(e,""),e=r):e!==null&&(An.set(e,r),e=null)}e!==null&&An.set(e,"")}else typeof location=="object"?(An=Ha(),(location.search||"?").slice(1).split("&").forEach(t=>{if(t.length!==0){const[e,n]=t.split("=");An.set(`--${Oy(e,"-")}`,n),An.set(`-${Oy(e,"-")}`,n)}})):An=Ha();return An},ip=t=>OM().has(t),sp=t=>CM(pi?Se.env[t.toUpperCase().replaceAll("-","_")]:$M.getItem(t)),U2=t=>ip("--"+t)||sp(t)!==null;U2("production");const MM=pi&&yM(Se.env.FORCE_COLOR,["true","1","2"]);MM||!ip("--no-colors")&&!U2("no-color")&&(!pi||Se.stdout.isTTY)&&(!pi||ip("--color")||sp("COLORTERM")!==null||(sp("TERM")||"").includes("color"));const DM=typeof document<"u"?document:{};typeof DOMParser<"u"&&new DOMParser;const _M=t=>class{constructor(e){this._=e}destroy(){t(this._)}},NM=_M(clearTimeout),Of=(t,e)=>new NM(setTimeout(e,t)),In=(t,e)=>t>>>e|t<<32-e,IM=t=>In(t,2)^In(t,13)^In(t,22),FM=t=>In(t,6)^In(t,11)^In(t,25),RM=t=>In(t,7)^In(t,18)^t>>>3,BM=t=>In(t,17)^In(t,19)^t>>>10,LM=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),PM=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);class zM{constructor(){const e=new ArrayBuffer(320);this._H=new Uint32Array(e,0,8),this._H.set(PM),this._W=new Uint32Array(e,64,64)}_updateHash(){const e=this._H,n=this._W;for(let d=16;d<64;d++)n[d]=BM(n[d-2])+n[d-7]+RM(n[d-15])+n[d-16];let r=e[0],o=e[1],i=e[2],s=e[3],a=e[4],l=e[5],c=e[6],u=e[7];for(let d=0,p,f;d<64;d++)p=u+FM(a)+(a&l^~a&c)+LM[d]+n[d]>>>0,f=IM(r)+(r&o^r&i^o&i)>>>0,u=c,c=l,l=a,a=s+p>>>0,s=i,i=o,o=r,r=p+f>>>0;e[0]+=r,e[1]+=o,e[2]+=i,e[3]+=s,e[4]+=a,e[5]+=l,e[6]+=c,e[7]+=u}digest(e){let n=0;for(;n+56<=e.length;){let s=0;for(;s<16&&n+3<e.length;s++)this._W[s]=e[n++]<<24|e[n++]<<16|e[n++]<<8|e[n++];if(n%64!==0){for(this._W.fill(0,s,16);n<e.length;)this._W[s]|=e[n]<<(3-n%4)*8,n++;this._W[s]|=As<<(3-n%4)*8}this._updateHash()}const r=n%64!==0;this._W.fill(0,0,16);let o=0;for(;n<e.length;o++)for(let s=3;s>=0&&n<e.length;s--)this._W[o]|=e[n++]<<s*8;r||(this._W[o-(n%4===0?0:1)]|=As<<(3-n%4)*8),this._W[14]=e.byteLength/z5,this._W[15]=e.byteLength*8,this._updateHash();const i=new Uint8Array(32);for(let s=0;s<this._H.length;s++)for(let a=0;a<4;a++)i[s*4+a]=this._H[s]>>>(3-a)*8;return i}}const jM=t=>new zM().digest(t),qM=t=>{let e="";for(let n=0;n<t.byteLength;n++)e+=H5(t[n]);return btoa(e)},VM=t=>mt.from(t.buffer,t.byteOffset,t.byteLength).toString("base64"),UM=V2?qM:VM,HM=t=>tM(e=>op(e,t)),WM=t=>{for(let e=6;e<t.length;e++)t[e%6]=t[e%6]^t[e];return t.slice(0,6)},GM=t=>UM(WM(jM(HM(t)))),KM=()=>({mapping:new Map,isOMark:new Map}),Al=(t,e)=>e===void 0?!t.deleted:e.sv.has(t.id.client)&&e.sv.get(t.id.client)>t.id.clock&&!Ee.isDeleted(e.ds,t.id),JM=[{light:"#ecd44433",dark:"#ecd444"}],XM=(t,e,n)=>{if(!t.has(n)){if(t.size<e.length){const r=V5();t.forEach(o=>r.add(o)),e=e.filter(o=>!r.has(o))}t.set(n,AM(e))}return t.get(n)},YM=(t,{colors:e=JM,colorMapping:n=new Map,permanentUserData:r=null,onFirstRender:o=()=>{},mapping:i}={})=>{let s=!1;const a=new QM(t,i),l=new Ue({props:{editable:c=>{const u=rt.getState(c);return u.snapshot==null&&u.prevSnapshot==null}},key:rt,state:{init:(c,u)=>({type:t,doc:t.doc,binding:a,snapshot:null,prevSnapshot:null,isChangeOrigin:!1,isUndoRedoOperation:!1,addToHistory:!0,colors:e,colorMapping:n,permanentUserData:r}),apply:(c,u)=>{const d=c.getMeta(rt);if(d!==void 0){u=Object.assign({},u);for(const p in d)u[p]=d[p]}return u.addToHistory=c.getMeta("addToHistory")!==!1,u.isChangeOrigin=d!==void 0&&!!d.isChangeOrigin,u.isUndoRedoOperation=d!==void 0&&!!d.isChangeOrigin&&!!d.isUndoRedoOperation,a.prosemirrorView!==null&&d!==void 0&&(d.snapshot!=null||d.prevSnapshot!=null)&&Of(0,()=>{a.prosemirrorView!=null&&(d.restore==null?a._renderSnapshot(d.snapshot,d.prevSnapshot,u):(a._renderSnapshot(d.snapshot,d.snapshot,u),delete u.restore,delete u.snapshot,delete u.prevSnapshot,a.mux(()=>{a._prosemirrorChanged(a.prosemirrorView.state.doc)})))}),u}},view:c=>(a.initView(c),i==null&&a._forceRerender(),o(),{update:()=>{const u=l.getState(c.state);if(u.snapshot==null&&u.prevSnapshot==null&&(s||c.state.doc.content.findDiffStart(c.state.doc.type.createAndFill().content)!==null)){if(s=!0,u.addToHistory===!1&&!u.isChangeOrigin){const d=Dr.getState(c.state),p=d&&d.undoManager;p&&p.stopCapturing()}a.mux(()=>{u.doc.transact(d=>{d.meta.set("addToHistory",u.addToHistory),a._prosemirrorChanged(c.state.doc)},rt)})}},destroy:()=>{a.destroy()}})});return l},ZM=(t,e,n)=>{if(e!==null&&e.anchor!==null&&e.head!==null)if(e.type==="all")t.setSelection(new Nn(t.doc));else if(e.type==="node"){const r=Zo(n.doc,n.type,e.anchor,n.mapping);t.setSelection(_e.create(t.doc,r))}else{const r=Zo(n.doc,n.type,e.anchor,n.mapping),o=Zo(n.doc,n.type,e.head,n.mapping);r!==null&&o!==null&&t.setSelection(Pe.between(t.doc.resolve(r),t.doc.resolve(o)))}},ap=(t,e)=>({type:e.selection.jsonID,anchor:Tl(e.selection.anchor,t.type,t.mapping),head:Tl(e.selection.head,t.type,t.mapping)});class QM{constructor(e,n=new Map){this.type=e,this.prosemirrorView=null,this.mux=wM(),this.mapping=n,this.isOMark=new Map,this._observeFunction=this._typeChanged.bind(this),this.doc=e.doc,this.beforeTransactionSelection=null,this.beforeAllTransactions=()=>{this.beforeTransactionSelection===null&&this.prosemirrorView!=null&&(this.beforeTransactionSelection=ap(this,this.prosemirrorView.state))},this.afterAllTransactions=()=>{this.beforeTransactionSelection=null},this._domSelectionInView=null}get _tr(){return this.prosemirrorView.state.tr.setMeta("addToHistory",!1)}_isLocalCursorInView(){return this.prosemirrorView.hasFocus()?(V2&&this._domSelectionInView===null&&(Of(0,()=>{this._domSelectionInView=null}),this._domSelectionInView=this._isDomSelectionInView()),this._domSelectionInView):!1}_isDomSelectionInView(){const e=this.prosemirrorView._root.getSelection();if(e==null||e.anchorNode==null)return!1;const n=this.prosemirrorView._root.createRange();n.setStart(e.anchorNode,e.anchorOffset),n.setEnd(e.focusNode,e.focusOffset),n.getClientRects().length===0&&n.startContainer&&n.collapsed&&n.selectNodeContents(n.startContainer);const r=n.getBoundingClientRect(),o=DM.documentElement;return r.bottom>=0&&r.right>=0&&r.left<=(window.innerWidth||o.clientWidth||0)&&r.top<=(window.innerHeight||o.clientHeight||0)}renderSnapshot(e,n){n||(n=Ee.createSnapshot(Ee.createDeleteSet(),new Map)),this.prosemirrorView.dispatch(this._tr.setMeta(rt,{snapshot:e,prevSnapshot:n}))}unrenderSnapshot(){this.mapping.clear(),this.mux(()=>{const e=this.type.toArray().map(r=>rs(r,this.prosemirrorView.state.schema,this)).filter(r=>r!==null),n=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new ve(ye.from(e),0,0));n.setMeta(rt,{snapshot:null,prevSnapshot:null}),this.prosemirrorView.dispatch(n)})}_forceRerender(){this.mapping.clear(),this.mux(()=>{const e=this.beforeTransactionSelection!==null?null:this.prosemirrorView.state.selection,n=this.type.toArray().map(o=>rs(o,this.prosemirrorView.state.schema,this)).filter(o=>o!==null),r=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new ve(ye.from(n),0,0));if(e){const o=Mr(di(e.anchor,0),r.doc.content.size),i=Mr(di(e.head,0),r.doc.content.size);r.setSelection(Pe.create(r.doc,o,i))}this.prosemirrorView.dispatch(r.setMeta(rt,{isChangeOrigin:!0,binding:this}))})}_renderSnapshot(e,n,r){let o=this.doc,i=this.type;if(e||(e=Ee.snapshot(this.doc)),e instanceof Uint8Array||n instanceof Uint8Array)if((!(e instanceof Uint8Array)||!(n instanceof Uint8Array))&&z2(),o=new Ee.Doc({gc:!1}),Ee.applyUpdateV2(o,n),n=Ee.snapshot(o),Ee.applyUpdateV2(o,e),e=Ee.snapshot(o),i._item===null){const s=Array.from(this.doc.share.keys()).find(a=>this.doc.share.get(a)===this.type);i=o.getXmlFragment(s)}else{const s=o.store.clients.get(i._item.id.client)??[],a=Ee.findIndexSS(s,i._item.id.clock);i=s[a].content.type}this.mapping.clear(),this.mux(()=>{o.transact(s=>{const a=r.permanentUserData;a&&a.dss.forEach(d=>{Ee.iterateDeletedStructs(s,d,p=>{})});const l=(d,p)=>{const f=d==="added"?a.getUserByClientId(p.client):a.getUserByDeletedId(p);return{user:f,type:d,color:XM(r.colorMapping,r.colors,f)}},c=Ee.typeListToArraySnapshot(i,new Ee.Snapshot(n.ds,e.sv)).map(d=>!d._item.deleted||Al(d._item,e)||Al(d._item,n)?rs(d,this.prosemirrorView.state.schema,{mapping:new Map,isOMark:new Map},e,n,l):null).filter(d=>d!==null),u=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new ve(ye.from(c),0,0));this.prosemirrorView.dispatch(u.setMeta(rt,{isChangeOrigin:!0}))},rt)})}_typeChanged(e,n){if(this.prosemirrorView==null)return;const r=rt.getState(this.prosemirrorView.state);if(e.length===0||r.snapshot!=null||r.prevSnapshot!=null){this.renderSnapshot(r.snapshot,r.prevSnapshot);return}this.mux(()=>{const o=(a,l)=>this.mapping.delete(l);Ee.iterateDeletedStructs(n,n.deleteSet,a=>{if(a.constructor===Ee.Item){const l=a.content.type;l&&this.mapping.delete(l)}}),n.changed.forEach(o),n.changedParentTypes.forEach(o);const i=this.type.toArray().map(a=>H2(a,this.prosemirrorView.state.schema,this)).filter(a=>a!==null);let s=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new ve(ye.from(i),0,0));ZM(s,this.beforeTransactionSelection,this),s=s.setMeta(rt,{isChangeOrigin:!0,isUndoRedoOperation:n.origin instanceof Ee.UndoManager}),this.beforeTransactionSelection!==null&&this._isLocalCursorInView()&&s.scrollIntoView(),this.prosemirrorView.dispatch(s)})}_prosemirrorChanged(e){this.doc.transact(()=>{El(this.doc,this.type,e,this),this.beforeTransactionSelection=ap(this,this.prosemirrorView.state)},rt)}initView(e){this.prosemirrorView!=null&&this.destroy(),this.prosemirrorView=e,this.doc.on("beforeAllTransactions",this.beforeAllTransactions),this.doc.on("afterAllTransactions",this.afterAllTransactions),this.type.observeDeep(this._observeFunction)}destroy(){this.prosemirrorView!=null&&(this.prosemirrorView=null,this.type.unobserveDeep(this._observeFunction),this.doc.off("beforeAllTransactions",this.beforeAllTransactions),this.doc.off("afterAllTransactions",this.afterAllTransactions))}}const H2=(t,e,n,r,o,i)=>{const s=n.mapping.get(t);if(s===void 0){if(t instanceof Ee.XmlElement)return rs(t,e,n,r,o,i);throw hM()}return s},rs=(t,e,n,r,o,i)=>{const s=[],a=l=>{if(l instanceof Ee.XmlElement){const c=H2(l,e,n,r,o,i);c!==null&&s.push(c)}else{const c=l._item.right?.content?.type;c instanceof Ee.Text&&!c._item.deleted&&c._item.id.client===c.doc.clientID&&(l.applyDelta([{retain:l.length},...c.toDelta()]),c.doc.transact(d=>{c._item.delete(d)}));const u=eD(l,e,n,r,o,i);u!==null&&u.forEach(d=>{d!==null&&s.push(d)})}};r===void 0||o===void 0?t.toArray().forEach(a):Ee.typeListToArraySnapshot(t,new Ee.Snapshot(o.ds,r.sv)).forEach(a);try{const l=t.getAttributes(r);r!==void 0&&(Al(t._item,r)?Al(t._item,o)||(l.ychange=i?i("added",t._item.id):{type:"added"}):l.ychange=i?i("removed",t._item.id):{type:"removed"});const c=e.node(t.nodeName,l,s);return n.mapping.set(t,c),c}catch{return t.doc.transact(l=>{t._item.delete(l)},rt),n.mapping.delete(t),null}},eD=(t,e,n,r,o,i)=>{const s=[],a=t.toDelta(r,o,i);try{for(let l=0;l<a.length;l++){const c=a[l];s.push(e.text(c.insert,sD(c.attributes,e)))}}catch{return t.doc.transact(l=>{t._item.delete(l)},rt),null}return s},tD=(t,e)=>{const n=new Ee.XmlText,r=t.map(o=>({insert:o.text,attributes:K2(o.marks,e)}));return n.applyDelta(r),e.mapping.set(n,t),n},nD=(t,e)=>{const n=new Ee.XmlElement(t.type.name);for(const r in t.attrs){const o=t.attrs[r];o!==null&&r!=="ychange"&&n.setAttribute(r,o)}return n.insert(0,ac(t).map(r=>lp(r,e))),e.mapping.set(n,t),n},lp=(t,e)=>t instanceof Array?tD(t,e):nD(t,e),_y=t=>typeof t=="object"&&t!==null,Mf=(t,e)=>{const n=Object.keys(t).filter(o=>t[o]!==null);let r=n.length===(e==null?0:Object.keys(e).filter(o=>e[o]!==null).length);for(let o=0;o<n.length&&r;o++){const i=n[o],s=t[i],a=e[i];r=i==="ychange"||s===a||_y(s)&&_y(a)&&Mf(s,a)}return r},ac=t=>{const e=t.content.content,n=[];for(let r=0;r<e.length;r++){const o=e[r];if(o.isText){const i=[];for(let s=e[r];r<e.length&&s.isText;s=e[++r])i.push(s);r--,n.push(i)}else n.push(o)}return n},W2=(t,e)=>{const n=t.toDelta();return n.length===e.length&&n.every((r,o)=>r.insert===e[o].text&&mM(r.attributes||{}).length===e[o].marks.length&&gM(r.attributes,(i,s)=>{const a=G2(s),l=e[o].marks;return Mf(i,l.find(c=>c.type.name===a)?.attrs)}))},Ts=(t,e)=>{if(t instanceof Ee.XmlElement&&!(e instanceof Array)&&cp(t,e)){const n=ac(e);return t._length===n.length&&Mf(t.getAttributes(),e.attrs)&&t.toArray().every((r,o)=>Ts(r,n[o]))}return t instanceof Ee.XmlText&&e instanceof Array&&W2(t,e)},Cl=(t,e)=>t===e||t instanceof Array&&e instanceof Array&&t.length===e.length&&t.every((n,r)=>e[r]===n),Ny=(t,e,n)=>{const r=t.toArray(),o=ac(e),i=o.length,s=r.length,a=Mr(s,i);let l=0,c=0,u=!1;for(;l<a;l++){const d=r[l],p=o[l];if(Cl(n.mapping.get(d),p))u=!0;else if(!Ts(d,p))break}for(;l+c<a;c++){const d=r[s-c-1],p=o[i-c-1];if(Cl(n.mapping.get(d),p))u=!0;else if(!Ts(d,p))break}return{equalityFactor:l+c,foundMappedChild:u}},rD=t=>{let e="",n=t._start;const r={};for(;n!==null;)n.deleted||(n.countable&&n.content instanceof Ee.ContentString?e+=n.content.str:n.content instanceof Ee.ContentFormat&&(r[n.content.key]=null)),n=n.right;return{str:e,nAttrs:r}},oD=(t,e,n)=>{n.mapping.set(t,e);const{nAttrs:r,str:o}=rD(t),i=e.map(c=>({insert:c.text,attributes:Object.assign({},r,K2(c.marks,n))})),{insert:s,remove:a,index:l}=kM(o,i.map(c=>c.insert).join(""));t.delete(l,a),t.insert(l,s),t.applyDelta(i.map(c=>({retain:c.insert.length,attributes:c.attributes})))},iD=/(.*)(--[a-zA-Z0-9+/=]{8})$/,G2=t=>iD.exec(t)?.[1]??t,sD=(t,e)=>{const n=[];for(const r in t)n.push(e.mark(G2(r),t[r]));return n},K2=(t,e)=>{const n={};return t.forEach(r=>{if(r.type.name!=="ychange"){const o=j2(e.isOMark,r.type,()=>!r.type.excludes(r.type));n[o?`${r.type.name}--${GM(r.toJSON())}`:r.type.name]=r.attrs}}),n},El=(t,e,n,r)=>{if(e instanceof Ee.XmlElement&&e.nodeName!==n.type.name)throw new Error("node name mismatch!");if(r.mapping.set(e,n),e instanceof Ee.XmlElement){const d=e.getAttributes(),p=n.attrs;for(const f in p)p[f]!==null?d[f]!==p[f]&&f!=="ychange"&&e.setAttribute(f,p[f]):e.removeAttribute(f);for(const f in d)p[f]===void 0&&e.removeAttribute(f)}const o=ac(n),i=o.length,s=e.toArray(),a=s.length,l=Mr(i,a);let c=0,u=0;for(;c<l;c++){const d=s[c],p=o[c];if(!Cl(r.mapping.get(d),p))if(Ts(d,p))r.mapping.set(d,p);else break}for(;u+c+1<l;u++){const d=s[a-u-1],p=o[i-u-1];if(!Cl(r.mapping.get(d),p))if(Ts(d,p))r.mapping.set(d,p);else break}t.transact(()=>{for(;a-c-u>0&&i-c-u>0;){const p=s[c],f=o[c],h=s[a-u-1],m=o[i-u-1];if(p instanceof Ee.XmlText&&f instanceof Array)W2(p,f)||oD(p,f,r),c+=1;else{let y=p instanceof Ee.XmlElement&&cp(p,f),g=h instanceof Ee.XmlElement&&cp(h,m);if(y&&g){const v=Ny(p,f,r),k=Ny(h,m,r);v.foundMappedChild&&!k.foundMappedChild?g=!1:!v.foundMappedChild&&k.foundMappedChild||v.equalityFactor<k.equalityFactor?y=!1:g=!1}y?(El(t,p,f,r),c+=1):g?(El(t,h,m,r),u+=1):(r.mapping.delete(e.get(c)),e.delete(c,1),e.insert(c,[lp(f,r)]),c+=1)}}const d=a-c-u;if(a===1&&i===0&&s[0]instanceof Ee.XmlText?(r.mapping.delete(s[0]),s[0].delete(0,s[0].length)):d>0&&(e.slice(c,c+d).forEach(p=>r.mapping.delete(p)),e.delete(c,d)),c+u<i){const p=[];for(let f=c;f<i-u;f++)p.push(lp(o[f],r));e.insert(c,p)}},rt)},cp=(t,e)=>!(e instanceof Array)&&t.nodeName===e.type.name;let is=null;const aD=()=>{const t=is;is=null,t.forEach((e,n)=>{const r=n.state.tr,o=rt.getState(n.state);o&&o.binding&&!o.binding.isDestroyed&&(e.forEach((i,s)=>{r.setMeta(s,i)}),n.dispatch(r))})},lD=(t,e,n)=>{is||(is=new Map,Of(0,aD)),j2(is,t,Ha).set(e,n)},Tl=(t,e,n)=>{if(t===0)return Ee.createRelativePositionFromTypeIndex(e,0,-1);let r=e._first===null?null:e._first.content.type;for(;r!==null&&e!==r;){if(r instanceof Ee.XmlText){if(r._length>=t)return Ee.createRelativePositionFromTypeIndex(r,t,-1);if(t-=r._length,r._item!==null&&r._item.next!==null)r=r._item.next.content.type;else{do r=r._item===null?null:r._item.parent,t--;while(r!==e&&r!==null&&r._item!==null&&r._item.next===null);r!==null&&r!==e&&(r=r._item===null?null:r._item.next.content.type)}}else{const o=(n.get(r)||{nodeSize:0}).nodeSize;if(r._first!==null&&t<o)r=r._first.content.type,t--;else{if(t===1&&r._length===0&&o>1)return new Ee.RelativePosition(r._item===null?null:r._item.id,r._item===null?Ee.findRootTypeKey(r):null,null);if(t-=o,r._item!==null&&r._item.next!==null)r=r._item.next.content.type;else{if(t===0)return r=r._item===null?r:r._item.parent,new Ee.RelativePosition(r._item===null?null:r._item.id,r._item===null?Ee.findRootTypeKey(r):null,null);do r=r._item.parent,t--;while(r!==e&&r._item.next===null);r!==e&&(r=r._item.next.content.type)}}}if(r===null)throw z2();if(t===0&&r.constructor!==Ee.XmlText&&r!==e)return cD(r._item.parent,r._item)}return Ee.createRelativePositionFromTypeIndex(e,e._length,-1)},cD=(t,e)=>{let n=null,r=null;return t._item===null?r=Ee.findRootTypeKey(t):n=Ee.createID(t._item.id.client,t._item.id.clock),new Ee.RelativePosition(n,r,e.id)},Zo=(t,e,n,r)=>{const o=Ee.createAbsolutePositionFromRelativePosition(n,t);if(o===null||o.type!==e&&!Ee.isParentOf(e,o.type._item))return null;let i=o.type,s=0;if(i.constructor===Ee.XmlText)s=o.index;else if(i._item===null||!i._item.deleted){let a=i._first,l=0;for(;l<i._length&&l<o.index&&a!==null;){if(!a.deleted){const c=a.content.type;l++,c instanceof Ee.XmlText?s+=c._length:s+=r.get(c).nodeSize}a=a.right}s+=1}for(;i!==e&&i._item!==null;){const a=i._item.parent;if(a._item===null||!a._item.deleted){s+=1;let l=a._first;for(;l!==null;){const c=l.content.type;if(c===i)break;l.deleted||(c instanceof Ee.XmlText?s+=c._length:s+=r.get(c).nodeSize),l=l.right}}i=a}return s-1},uD=(t,e)=>{const n=t.toArray().map(r=>rs(r,e,KM())).filter(r=>r!==null);return ye.fromArray(n)},dD=(t,e)=>e.topNodeType.create(null,uD(t,e));function pD(t,e="prosemirror"){const n=new Ee.Doc,r=n.get(e,Ee.XmlFragment);return r.doc?(fD(t,r),r.doc):n}function fD(t,e){const n=e||new Ee.XmlFragment,r=n.doc?n.doc:{transact:o=>o(void 0)};return El(r,n,t,{mapping:new Map,isOMark:new Map}),n}const hD=(t,e,n)=>t!==e,mD=t=>{const e=document.createElement("span");e.classList.add("ProseMirror-yjs-cursor"),e.setAttribute("style",`border-color: ${t.color}`);const n=document.createElement("div");n.setAttribute("style",`background-color: ${t.color}`),n.insertBefore(document.createTextNode(t.name),null);const r=document.createTextNode("⁠"),o=document.createTextNode("⁠");return e.insertBefore(r,null),e.insertBefore(n,null),e.insertBefore(o,null),e},gD=t=>({style:`background-color: ${t.color}70`,class:"ProseMirror-yjs-selection"}),yD=/^#[0-9a-fA-F]{6}$/,Iy=(t,e,n,r,o)=>{const i=rt.getState(t),s=i.doc,a=[];return i.snapshot!=null||i.prevSnapshot!=null||i.binding.mapping.size===0?De.create(t.doc,[]):(e.getStates().forEach((l,c)=>{if(n(s.clientID,c,l)&&l.cursor!=null){const u=l.user||{};u.color==null?u.color="#ffa500":yD.test(u.color)||console.warn("A user uses an unsupported color format",u),u.name==null&&(u.name=`User: ${c}`);let d=Zo(s,i.type,Ee.createRelativePositionFromJSON(l.cursor.anchor),i.binding.mapping),p=Zo(s,i.type,Ee.createRelativePositionFromJSON(l.cursor.head),i.binding.mapping);if(d!==null&&p!==null){const f=di(t.doc.content.size-1,0);d=Mr(d,f),p=Mr(p,f),a.push(Le.widget(p,()=>r(u,c),{key:c+"",side:10}));const h=Mr(d,p),m=di(d,p);a.push(Le.inline(h,m,o(u,c),{inclusiveEnd:!0,inclusiveStart:!1}))}}}),De.create(t.doc,a))},wD=(t,{awarenessStateFilter:e=hD,cursorBuilder:n=mD,selectionBuilder:r=gD,getSelection:o=s=>s.selection}={},i="cursor")=>new Ue({key:ua,state:{init(s,a){return Iy(a,t,e,n,r)},apply(s,a,l,c){const u=rt.getState(c),d=s.getMeta(ua);return u&&u.isChangeOrigin||d&&d.awarenessUpdated?Iy(c,t,e,n,r):a.map(s.mapping,s.doc)}},props:{decorations:s=>ua.getState(s)},view:s=>{const a=()=>{s.docView&&lD(s,ua,{awarenessUpdated:!0})},l=()=>{const c=rt.getState(s.state),u=t.getLocalState()||{};if(s.hasFocus()){const d=o(s.state),p=Tl(d.anchor,c.type,c.binding.mapping),f=Tl(d.head,c.type,c.binding.mapping);(u.cursor==null||!Ee.compareRelativePositions(Ee.createRelativePositionFromJSON(u.cursor.anchor),p)||!Ee.compareRelativePositions(Ee.createRelativePositionFromJSON(u.cursor.head),f))&&t.setLocalStateField(i,{anchor:p,head:f})}else u.cursor!=null&&Zo(c.doc,c.type,Ee.createRelativePositionFromJSON(u.cursor.anchor),c.binding.mapping)!==null&&t.setLocalStateField(i,null)};return t.on("change",a),s.dom.addEventListener("focusin",l),s.dom.addEventListener("focusout",l),{update:l,destroy:()=>{s.dom.removeEventListener("focusin",l),s.dom.removeEventListener("focusout",l),t.off("change",a),t.setLocalStateField(i,null)}}}}),bD=t=>Dr.getState(t)?.undoManager?.undo()!=null,vD=t=>Dr.getState(t)?.undoManager?.redo()!=null,xD=new Set(["paragraph"]),kD=(t,e)=>!(t instanceof Yr.Item)||!(t.content instanceof Yr.ContentType)||!(t.content.type instanceof Yr.Text||t.content.type instanceof Yr.XmlElement&&e.has(t.content.type.nodeName))||t.content.type._length===0,SD=({protectedNodes:t=xD,trackedOrigins:e=[],undoManager:n=null}={})=>new Ue({key:Dr,state:{init:(r,o)=>{const i=rt.getState(o),s=n||new Yr.UndoManager(i.type,{trackedOrigins:new Set([rt].concat(e)),deleteFilter:a=>kD(a,t),captureTransaction:a=>a.meta.get("addToHistory")!==!1});return{undoManager:s,prevSel:null,hasUndoOps:s.undoStack.length>0,hasRedoOps:s.redoStack.length>0}},apply:(r,o,i,s)=>{const a=rt.getState(s).binding,l=o.undoManager,c=l.undoStack.length>0,u=l.redoStack.length>0;return a?{undoManager:l,prevSel:ap(a,i),hasUndoOps:c,hasRedoOps:u}:c!==o.hasUndoOps||u!==o.hasRedoOps?Object.assign({},o,{hasUndoOps:l.undoStack.length>0,hasRedoOps:l.redoStack.length>0}):o}},view:r=>{const o=rt.getState(r.state),i=Dr.getState(r.state).undoManager;return i.on("stack-item-added",({stackItem:s})=>{const a=o.binding;a&&s.meta.set(a,Dr.getState(r.state).prevSel)}),i.on("stack-item-popped",({stackItem:s})=>{const a=o.binding;a&&(a.beforeTransactionSelection=s.meta.get(a)||a.beforeTransactionSelection)}),{destroy:()=>{i.destroy()}}}});var Wn;class AD{constructor(){$r(this,Wn,new Map)}on(e,n){const r=Xn(this,Wn).get(e);r?r.push(n):Xn(this,Wn).set(e,[n])}emit(e,...n){const r=Xn(this,Wn).get(e);if(r)for(const o of r)o.apply(this,n)}off(e,n){const r=Xn(this,Wn).get(e);r&&(n?Xn(this,Wn).set(e,r.filter(o=>o!==n)):Xn(this,Wn).delete(e))}removeAllListeners(){w1(this,Wn,new Map)}}Wn=new WeakMap;var Ir={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:"'"},$l={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},CD=typeof navigator<"u"&&/Mac/.test(navigator.platform),ED=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Et=0;Et<10;Et++)Ir[48+Et]=Ir[96+Et]=String(Et);for(var Et=1;Et<=24;Et++)Ir[Et+111]="F"+Et;for(var Et=65;Et<=90;Et++)Ir[Et]=String.fromCharCode(Et+32),$l[Et]=String.fromCharCode(Et);for(var Ru in Ir)$l.hasOwnProperty(Ru)||($l[Ru]=Ir[Ru]);function TD(t){var e=CD&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||ED&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?$l:Ir)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const $D=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),OD=typeof navigator<"u"&&/Win/.test(navigator.platform);function MD(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,o,i,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))r=!0;else if(/^(c|ctrl|control)$/i.test(l))o=!0;else if(/^s(hift)?$/i.test(l))i=!0;else if(/^mod$/i.test(l))$D?s=!0:o=!0;else throw new Error("Unrecognized modifier name: "+l)}return r&&(n="Alt-"+n),o&&(n="Ctrl-"+n),s&&(n="Meta-"+n),i&&(n="Shift-"+n),n}function DD(t){let e=Object.create(null);for(let n in t)e[MD(n)]=t[n];return e}function Bu(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function _D(t){return new Ue({props:{handleKeyDown:Df(t)}})}function Df(t){let e=DD(t);return function(n,r){let o=TD(r),i,s=e[Bu(o,r)];if(s&&s(n.state,n.dispatch,n))return!0;if(o.length==1&&o!=" "){if(r.shiftKey){let a=e[Bu(o,r,!1)];if(a&&a(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(OD&&r.ctrlKey&&r.altKey)&&(i=Ir[r.keyCode])&&i!=o){let a=e[Bu(i,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}function ND(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function ID(t,e){const n=xi.fromSchema(e).serializeFragment(t),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}const FD=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(o,i,s,a)=>{const l=o.type.spec.toText?.({node:o,pos:i,parent:s,index:a})||o.textContent||"%leaf%";n+=o.isAtom&&!o.isText?l:l.slice(0,Math.max(0,r-i))}),n},RD=(t,e,n,r)=>{const{converter:o}=e;if(!o||!o.convertedXml)return handleHtmlPaste(t,e,n,r);const i=J2(t),s=document.createElement("div");s.innerHTML=i,s.querySelectorAll("p").forEach(c=>{if(!c.innerHTML.includes("<!--[if !supportLists]"))return;const u=(c.getAttribute("style")||"").match(/mso-list:\s*l(\d+)\s+level(\d+)/);if(u){const[,d,p]=u,f=LD(d,e);if(!f)return;const h=PD(d,e),{lvlText:m,start:y,numFmt:g}=BD(h,p-1);c.setAttribute("data-num-id",f),c.setAttribute("data-list-level",p-1),c.setAttribute("data-start",y),c.setAttribute("data-lvl-text",m),c.setAttribute("data-num-fmt",g)}qD(c)}),zD(s);const a=er.fromSchema(e.schema).parse(s);s.remove();const{dispatch:l}=e.view;return l?(l(n.state.tr.replaceSelectionWith(a,!0)),!0):!1},BD=(t,e)=>{if(!t||!t.elements)return null;const n=t.elements.find(a=>a.name==="w:lvl"&&a.attributes?.["w:ilvl"]==e);if(!n)return null;const{elements:r}=n,o=r.find(a=>a.name==="w:lvlText")?.attributes?.["w:val"],i=r.find(a=>a.name==="w:start")?.attributes?.["w:val"],s=r.find(a=>a.name==="w:numFmt")?.attributes?.["w:val"];return{lvlText:o,start:i,numFmt:s,elements:r}},LD=(t,e)=>{const{definitions:n}=e?.converter?.numbering;return n?Object.values(n).find(r=>r.elements.some(o=>o.name==="w:abstractNumId"&&o.attributes?.["w:val"]==t))?.attributes?.["w:numId"]:null},PD=(t,e)=>{const{abstracts:n={}}=e?.converter?.numbering;return n[t]||null},zD=t=>{const e=Array.from(t.querySelectorAll("p[data-num-id]")),n=new Map,r={};for(const o of e){const i=o.getAttribute("data-num-id"),s=parseInt(o.getAttribute("data-list-level")),a=o.getAttribute("data-num-fmt"),l=o.getAttribute("data-start"),c=o.getAttribute("data-lvl-text");n.has(i)||n.set(i,[]),n.get(i).push({p:o,level:s,numFmt:a,start:l,lvlText:c})}for(const[o,i]of n.entries()){r[o]||(r[o]={stack:[],counts:{},prevLevel:null});const s=[];i.forEach(({p:a,level:l,numFmt:c,start:u,lvlText:d},p)=>{const f=jD(r,o,l),h=document.createElement("li");h.innerHTML=a.innerHTML,h.setAttribute("data-list-level",JSON.stringify(f)),h.setAttribute("data-num-id",o),h.setAttribute("data-lvl-text",d),h.setAttribute("data-num-fmt",c),a.hasAttribute("data-font-family")&&h.setAttribute("data-font-family",a.getAttribute("data-font-family")),a.hasAttribute("data-font-size")&&h.setAttribute("data-font-size",a.getAttribute("data-font-size"));const m=a.parentNode;let y=s[l];if(!y){const g=document.createElement("ol");if(g.setAttribute("data-list-id",o),g.level=l,l>0){const v=s[l-1]?.querySelector("li:last-child");v&&v.appendChild(g)}else m.insertBefore(g,a);s[l]=g,s.length=l+1,y=g}y.appendChild(h),a.remove()})}};function jD(t,e,n){const r=t[e];return r.stack||(r.stack=[]),r.prevLevel===void 0&&(r.prevLevel=null),r.prevLevel===null?r.stack=Array(n).fill(1).concat(1):n>r.prevLevel?r.stack.push(1):n===r.prevLevel?r.stack[r.stack.length-1]++:(r.stack=r.stack.slice(0,n+1),r.stack[n]=(r.stack[n]||1)+1),r.prevLevel=n,[...r.stack]}function qD(t){const e=Array.from(t.childNodes);let n=null,r=null,o=-1,i=-1;if(e.forEach((s,a)=>{s.nodeType===Node.COMMENT_NODE&&s.nodeValue.includes("[if !supportLists]")&&(o=a),o!==-1&&s.nodeType===Node.COMMENT_NODE&&s.nodeValue.includes("[endif]")&&(i=a)}),o!==-1&&i!==-1){for(let s=o+1;s<i;s++){const a=e[s];a.nodeType===Node.ELEMENT_NODE&&a.style&&(n=n||a.style.fontFamily,r=r||a.style.fontSize)}for(let s=i;s>=o;s--)t.removeChild(t.childNodes[s]);n&&t.setAttribute("data-font-family",n),r&&t.setAttribute("data-font-size",r)}}class VD{constructor(e){Re(this,"match"),Re(this,"handler"),this.match=e.match,this.handler=e.handler}}const UD=(t,e)=>{if(Iv(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[super-editor warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r},Lu=t=>{const{editor:e,from:n,to:r,text:o,rules:i,plugin:s}=t,{view:a}=e;if(a.composing)return!1;const l=a.state.doc.resolve(n);if(l.parent.type.spec.code||(l.nodeBefore||l.nodeAfter)?.marks.find(d=>d.type.spec.code))return!1;let c=!1;const u=FD(l)+o;return i.forEach(d=>{if(c)return;const p=UD(u,d.match);if(!p)return;const f=a.state.tr,h=pf(f,a.state),m={from:n-(p[0].length-o.length),to:r},{commands:y,chain:g,can:v}=new _1({editor:e,state:h});d.handler({state:h,range:m,match:p,commands:y,chain:g,can:v})===null||!f.steps.length||(f.setMeta(s,{transform:f,from:n,to:r,text:o}),a.dispatch(f),c=!0)}),c},HD=({editor:t,rules:e})=>{const n=new Ue({key:new Ge("inputRulesPlugin"),state:{init(){return null},apply(r,o,i){const s=r.getMeta(n);if(s)return s;const a=r.getMeta("applyInputRules");return a&&setTimeout(()=>{let{text:l}=a;typeof l!="string"&&(l=ID(ye.from(l),i.schema));const{from:c}=a,u=c+l.length;Lu({editor:t,from:c,to:u,text:l,rules:e,plugin:n})}),r.selectionSet||r.docChanged?null:o}},props:{handleTextInput(r,o,i,s){return Lu({editor:t,from:o,to:i,text:s,rules:e,plugin:n})},handleKeyDown(r,o){if(o.key!=="Enter")return!1;const{$cursor:i}=r.state.selection;return i?Lu({editor:t,from:i.pos,to:i.pos,text:`
45
+ `,rules:e,plugin:n}):!1},handlePaste(r,o,i){const s=o.clipboardData,a=s.getData("text/html");s.getData("text/plain");let l;switch(a?WD(a)?l="word-html":l="browser-html":l="plain-text",l){case"plain-text":break;case"word-html":if(t.options.mode==="docx")return RD(a,t,r,n);case"browser-html":return GD(a,t)}return!1}},isInputRules:!0});return n};function WD(t){return/class=["']?Mso|xmlns:o=["']?urn:schemas-microsoft-com|<!--\[if gte mso|<meta[^>]+name=["']?Generator["']?[^>]+Word/i.test(t)}const GD=(t,e,n)=>{const r=J2(t),o=document.createElement("div");o.innerHTML=r;const i=er.fromSchema(e.schema).parse(o);o.remove();const{dispatch:s}=e.view;return s?(s(e.view.state.tr.replaceSelectionWith(i,!0)),!0):!1},J2=t=>t.replace(/font-size\s*:\s*([\d.]+)em/gi,(e,n)=>{const r=parseFloat(n);return`font-size: ${Math.round(r*12*100)/100}pt`});var Ol,X2,Fy;const KD=class Hi{constructor(e,n,r){$r(this,Ol),Re(this,"editor"),Re(this,"schema"),Re(this,"extensions"),Re(this,"externalExtensions",[]),Re(this,"splittableMarks",[]),this.editor=r,this.externalExtensions=n||[],this.externalExtensions=this.externalExtensions.map(o=>({...o,isExternal:!0})),this.extensions=Hi.getResolvedExtensions([...e,...this.externalExtensions]),this.schema=PT.createSchemaByExtensions(this.extensions,r),Ae(this,Ol,X2).call(this)}static create(...e){return new Hi(...e)}static getResolvedExtensions(e){return Hi.sortByPriority(e)}static sortByPriority(e){return e.sort((n,r)=>{const o=Fe(n,"priority")||100,i=Fe(r,"priority")||100;return o>i?-1:o<i?1:0})}get attributes(){return Te.getAttributesFromExtensions(this.extensions)}get commands(){let e={};for(const n of this.extensions){const r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:bs(n.name,this.schema)},o=Fe(n,"addCommands",r);o&&(e={...e,...o()})}return e}get plugins(){const e=this.editor,n=Hi.sortByPriority([...this.extensions].reverse()),r=[],o=n.map(i=>{const s={name:i.name,options:i.options,storage:i.storage,editor:e,type:bs(i.name,this.schema)},a=[],l=Fe(i,"addShortcuts",s);let c={};if(l){const p=Object.entries(l()).map(([f,h])=>[f,(...m)=>h({editor:e,keymapArgs:m})]);c={...Object.fromEntries(p)}}a.push(_D(c));const u=Fe(i,"addInputRules",s);ND(i,e.options.enableInputRules)&&u&&r.push(...u());const d=Fe(i,"addPmPlugins",s);if(d){const p=d();a.push(...p)}return a}).flat();return[HD({editor:e,rules:r}),...o]}get nodeViews(){const{editor:e}=this,n=this.extensions.filter(r=>r.type==="node").filter(r=>!!Fe(r,"addNodeView")).map(r=>{const o=this.attributes.filter(l=>l.type===r.name),i={name:r.name,options:r.options,storage:r.storage,editor:e,type:pt(r.name,this.schema)},s=Fe(r,"addNodeView",i);if(!s)return[];const a=(l,c,u,d)=>{const p=Te.getAttributesToRender(l,o);return s()({editor:e,node:l,getPos:u,decorations:d,htmlAttributes:p,extension:r})};return[r.name,a]});return Object.fromEntries(n)}};Ol=new WeakSet,X2=function(){for(const t of this.extensions){this.editor.extensionStorage[t.name]=t.storage;const e={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:bs(t.name,this.schema)};t.type==="mark"&&(Ke(Fe(t,"keepOnSplit",e))??!0)&&this.splittableMarks.push(t.name),Ae(this,Ol,Fy).call(this,t)}},Fy=function(t){const e={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:bs(t.name,this.schema)},n=Fe(t,"onBeforeCreate",e),r=Fe(t,"onCreate",e),o=Fe(t,"onUpdate",e),i=Fe(t,"onSelectionUpdate",e),s=Fe(t,"onTransaction",e),a=Fe(t,"onFocus",e),l=Fe(t,"onBlur",e),c=Fe(t,"onDestroy",e);n&&this.editor.on("beforeCreate",n),r&&this.editor.on("create",r),o&&this.editor.on("update",o),i&&this.editor.on("selectionUpdate",i),s&&this.editor.on("transaction",s),a&&this.editor.on("focus",a),l&&this.editor.on("blur",l),c&&this.editor.on("destroy",c)};let JD=KD;const _f=({tr:t,from:e,to:n,markName:r,attrs:o={},offset:i=1})=>{const{doc:s}=t,a=Math.max(e-i,0),l=Math.min(n+i,s.content.size);let c;return s.nodesBetween(a,l,(u,d)=>{if(!u||u?.nodeSize===void 0)return;const p=u.marks.find(f=>f.type.name===r&&Object.keys(o).every(h=>f.attrs[h]===o[h]));p&&!c&&(c={from:d,to:d+u.nodeSize,mark:p})}),c},Y2=({tr:t,from:e,to:n,user:r,date:o})=>{t.removeMark(e,n,t.doc.type.schema.marks[ut]),t.removeMark(e,n,t.doc.type.schema.marks[It]);let i=_f({tr:t,from:e,to:n,markName:It,attrs:{authorEmail:r.email}}),s;i?s=i.mark.attrs.id:s=Lr();const a=t.doc.type.schema.marks[It].create({id:s,author:r.name,authorEmail:r.email,date:o});return t.addMark(e,n,a),t.doc.nodesBetween(e,n,(l,c)=>{if(c<e||["bulletList","orderedList"].includes(l.type.name))return!0;if(l.isInline||["tableRow","tableCell"].includes(l.type.name)||(l.attrs.track,l.type.name==="table"))return!1}),a},Z2=({tr:t,from:e,to:n,user:r,date:o})=>{let i=_f({tr:t,from:e,to:n,markName:ut,attrs:{authorEmail:r.email}}),s;i?s=i.mark.attrs.id:s=Lr();const a=t.doc.type.schema.marks[ut].create({id:s,author:r.name,authorEmail:r.email,date:o}),l=new ni;let c=[];return t.doc.nodesBetween(e,n,(u,d)=>{if(!u.type.name.includes("table"))if(u.isInline&&u.marks.find(p=>p.type.name===It&&p.attrs.authorEmail===r.email)){const p=new Tt(l.map(Math.max(e,d)),l.map(Math.min(n,d+u.nodeSize)),ve.empty);t.maybeStep(p).failed||l.appendMap(p.getMap())}else u.isInline&&!u.marks.find(p=>p.type.name===ut)?(c.push(u),t.addMark(l.map(Math.max(e,d)),l.map(Math.min(n,d+u.nodeSize)),a)):u.attrs.track&&!u.attrs.track.find(p=>p.type===ut)&&["bulletList","orderedList"].includes(u.type.name)}),{deletionMark:a,deletionMap:l,nodes:c}},XD=(t,e,n)=>{const r=t.resolve(e),o=r.parent,i=o.childAfter(r.parentOffset);if(!i.node)return null;const s=i.node.marks.find(d=>d.type.name===n);let a=r.index(),l=r.start()+i.offset;for(;a>0&&s.isInSet(o.child(a-1).marks);)l-=o.child(--a).nodeSize;let c=r.index()+1,u=r.start()+i.offset+i.node.nodeSize;for(;c<o.childCount&&s.isInSet(o.child(c).marks);)u+=o.child(c++).nodeSize;return{from:l,to:u,attrs:s.attrs}},Q2=(t,e=!0)=>{if(!t)throw new Error('Invalid "node" parameter');const n=[];return t.descendants((r,o)=>{if(n.push({node:r,pos:o}),!e)return!1}),n},ex=(t,e,n)=>{if(t){if(!e)throw new Error('Invalid "predicate" parameter')}else throw new Error('Invalid "node" parameter');return Q2(t,n).filter(r=>e(r.node))},tx=(t,e)=>ex(t,n=>n.isInline,e),YD=Object.freeze(Object.defineProperty({__proto__:null,findChildren:ex,findInlineNodes:tx,findMarkPosition:XD,flatten:Q2},Symbol.toStringTag,{value:"Module"})),Nf=(t,e=null)=>{const n=[],r=tx(t.doc);return r.length?(r.forEach(({node:o,pos:i})=>{const{marks:s}=o,a=[It,ut,vt];s.length>0&&s.forEach(l=>{a.includes(l.type.name)&&n.push({mark:l,from:i,to:i+o.nodeSize})})}),e?n.filter(({mark:o})=>o.attrs.id===e):n):n},gt=new Ge("TrackChangesBase"),ZD=(t={})=>new Ue({key:gt,state:{init(e,n){return{isTrackChangesActive:!1,onlyOriginalShown:!1,onlyModifiedShown:!1,decorations:Do(n,!1,!1)}},apply(e,n,r,o){const i=e.getMeta(gt);return i?i.type==="TRACK_CHANGES_ENABLE"?{...n,isTrackChangesActive:i.value===!0,decorations:Do(o,n.onlyOriginalShown,n.onlyModifiedShown)}:i.type==="SHOW_ONLY_ORIGINAL"?{...n,onlyOriginalShown:i.value===!0,onlyModifiedShown:!1,decorations:Do(o,i.value===!0,!1)}:i.type==="SHOW_ONLY_MODIFIED"?{...n,onlyOriginalShown:!1,onlyModifiedShown:i.value===!0,decorations:Do(o,!1,i.value===!0)}:{...n,decorations:Do(o,n.onlyOriginalShown,n.onlyModifiedShown)}:{...n,decorations:Do(o,n.onlyOriginalShown,n.onlyModifiedShown)}}},props:{decorations(e){return this.getState(e)?.decorations}}}),Do=(t,e,n)=>{if(!t.doc||!t.doc.nodeSize||n&&e)return De.empty;const r=[],o=Nf(t);return o.length?(o.forEach(({mark:i,from:s,to:a})=>{if(i.type.name===It)if(e){const l=Le.inline(s,a,{class:"track-insert-dec hidden"});r.push(l)}else if(n){const l=Le.inline(s,a,{class:"track-insert-dec normal"});r.push(l)}else{const l=Le.inline(s,a,{class:"track-insert-dec highlighted"});r.push(l)}if(i.type.name===ut)if(e){const l=Le.inline(s,a,{class:"track-delete-dec normal"});r.push(l)}else if(n){const l=Le.inline(s,a,{class:"track-delete-dec hidden"});r.push(l)}else{const l=Le.inline(s,a,{class:"track-delete-dec highlighted"});r.push(l);const c=Le.widget(s,()=>{const u=document.createElement("span");return u.classList.add("track-delete-widget"),u.contentEditable=!1,u},{ignoreSelection:!0});r.push(c)}if(i.type.name===vt)if(e){const l=Le.inline(s,a,{class:"track-format-dec before"});r.push(l)}else if(n){const l=Le.inline(s,a,{class:"track-format-dec normal"});r.push(l)}else{const l=Le.inline(s,a,{class:"track-format-dec highlighted"});r.push(l)}}),De.create(t.doc,r)):De.empty},an="commentMark",Ry=({commentId:t,state:e,tr:n,dispatch:r})=>{QD(t,e.doc).forEach(({from:o,to:i})=>{n.removeMark(o,i,e.schema.marks[an])}),r(n)},QD=(t,e)=>{const n=[];return e.descendants((r,o)=>{const{marks:i}=r,s=i.find(a=>a.type.name===an);if(s){const{attrs:a}=s,{commentId:l}=a;t===l&&n.push({from:o,to:o+r.nodeSize})}}),n},e_=(t,e,n,r=[])=>{const o=[],i=[],s=new Set;return t.descendants((a,l)=>{(a.marks?.filter(c=>c.type.name===an)).forEach(c=>{if(c){const{attrs:u={}}=c,{commentId:d}=u;if(d==="pending"||s.has(d))return;s.add(d);const p=By(c.attrs),f=n.nodes.commentRangeStart.create(p);o.push({pos:l,node:f});const h=n.nodes.commentRangeEnd.create(p);i.push({pos:l+a.nodeSize,node:h});const m=d;m&&r.filter(y=>y.parentCommentId===m).sort((y,g)=>y.createdTime-g.createdTime).forEach(y=>{const g=By(y),v=n.nodes.commentRangeStart.create(g);s.add(y.commentId),o.push({pos:l,node:v});const k=n.nodes.commentRangeEnd.create(g);i.push({pos:l+a.nodeSize,node:k})})}})}),o.forEach(a=>{const{pos:l,node:c}=a,u=e.mapping.map(l);e.insert(u,c)}),i.forEach(a=>{const{pos:l,node:c}=a,u=e.mapping.map(l);e.insert(u,c)}),e},By=t=>{const{commentId:e,internal:n}=t;return{"w:id":e,internal:n}},t_=(t,e,n,r)=>{const o=[],i=[];t.descendants((s,a)=>{const{type:l}=s;if(!["commentRangeStart","commentRangeEnd","commentReference"].includes(l.name))return;const c=r.comments?.find(d=>d.importedId==s.attrs["w:id"])||{},{commentId:u}=c;if(u)if(l.name==="commentRangeStart")o.push({"w:id":u,importedId:s.attrs["w:id"],internal:!1,start:a}),i.push({start:a,end:a+1});else if(l.name==="commentRangeEnd"){const d=o.find(h=>h.importedId===s.attrs["w:id"]);if(!d)return;const{start:p}=d,f={commentId:u,importedId:s.attrs["w:id"],internal:d.internal};e.addMark(p,a+1,n.marks[an].create(f)),i.push({start:a,end:a+1})}else l.name==="commentReference"&&i.push({start:a,end:a+1})}),i.sort((s,a)=>a.start-s.start).forEach(({start:s,end:a})=>{e.delete(s,a)})},n_=(t={})=>{const{before:e=[],after:n=[]}=t,r=new Set(e.map(h=>h.type)),o=new Set(n.map(h=>h.type)),i=[...o].filter(h=>!r.has(h)),s=[...r].filter(h=>!o.has(h)),a=[],l=i.filter(h=>!["textStyle","commentMark"].includes(h));l.length&&a.push(`Added formatting: ${l.join(", ")}`);const c=s.filter(h=>!["textStyle","commentMark"].includes(h));c.length&&a.push(`Removed formatting: ${c.join(", ")}`);const u=e.find(h=>h.type==="textStyle")?.attrs||{},d=n.find(h=>h.type==="textStyle")?.attrs||{},p=[],f=h=>h.replace(/([a-z])([A-Z])/g,"$1 $2").toLowerCase();return Object.keys({...u,...d}).forEach(h=>{const m=u[h],y=d[h];if(m!==y){if(y===null)return;if(h==="color")p.push("Changed color");else{const g=f(h);m==null?p.push(`Set ${g} to ${y}`):p.push(`Changed ${g} from ${m} to ${y}`)}}}),p.length&&a.push(`Modified text style: ${p.join(", ")}`),a.length?a.join(". "):"No formatting changes."},r_=({activeThreadId:t,threadId:e,isInternal:n,editor:r})=>{if(!r.options.isInternal&&n)return"transparent";const o=bt.getState(r.state),i=n?o.internalColor:o.externalColor,s=t==e?"44":"22";return`${i}${s}`},_r=new Ge("paginationPlugin"),o_=async t=>{if(!t.converter)return;const e={headers:{},footers:{}},n=t.converter.headerIds.ids,r=t.converter.footerIds.ids;for(let o in n){const i=n[o];if(!i)continue;const s=t.converter.headers[i];e.headers[i]||(e.headers[i]={}),e.headers[i].data=s;const{height:a,sectionEditor:l,sectionContainer:c}=await Ly(t,s);e.headers[i].height=a,e.headers[i].sectionEditor=l,e.headers[i].sectionContainer=c}for(let o in r){const i=r[o];if(!i)continue;const s=t.converter.footers[i];e.headers[i]||(e.footers[i]={}),e.footers[i].data=s;const{height:a,sectionEditor:l,sectionContainer:c}=await Ly(t,s);e.footers[i].height=a,e.footers[i].sectionEditor=l,e.footers[i].sectionContainer=c}return e},Ly=async(t,e)=>e?new Promise(n=>{const r=document.createElement("div");r.className="super-editor",r.style.padding="0",r.style.margin="0";const o=lc({editor:t,data:e,editorContainer:r});o.on("create",()=>{o.setEditable(!1,!1),requestAnimationFrame(()=>{const i=r.offsetHeight;document.body.removeChild(r),n({height:i,sectionEditor:o,sectionContainer:r})})})}):{},lc=({editor:t,data:e,editorContainer:n,appendToBody:r=!0,sectionId:o,type:i,availableHeight:s})=>{const a=t.converter.getDocumentDefaultStyles(),{fontSizePt:l,typeface:c}=a,u=l*1.3333,d=u*1.2;Object.assign(n.style,{padding:"0",margin:"0",border:"none",boxSizing:"border-box",position:"absolute",top:"0",left:"0",width:"auto",maxWidth:"none",fontFamily:c,fontSize:`${u}px`,lineHeight:`${d}px`}),Object.assign(n.style,{padding:"0",margin:"0",border:"none",boxSizing:"border-box",height:s+"px",overflow:"hidden"}),r&&document.body.appendChild(n);const p=new $s({loadFromSchema:!0,mode:"docx",element:n,content:e,extensions:Gf(),documentId:o||"sectionId",media:t.options.media,mediaFiles:t.options.mediaFiles,fonts:t.options.fonts,isHeaderOrFooter:!0,onCreate:h=>i_(h,t),onBlur:h=>rx(h,t,o,i)}),f=n.querySelector(".ProseMirror");return f.style.maxHeight="100%",f.style.minHeight="100%",f.style.overflow="auto",f.style.outline="none",f.style.border="none",p},nx=(t,e)=>{["fieldAnnotationDropped","fieldAnnotationPaste","fieldAnnotationSelected","fieldAnnotationClicked","fieldAnnotationDoubleClicked","fieldAnnotationDeleted"].forEach(n=>{e.on(n,(...r)=>{t.emit(n,...r),console.debug("broadcastEditorEvents",{eventName:n,args:r})})})},Ml=(t,e,n)=>{t.converter.headerEditors.forEach(r=>{r.editor.setEditable(n,!1)}),t.converter.footerEditors.forEach(r=>{r.editor.setEditable(n,!1)}),n&&document.querySelector(".ProseMirror").classList.add("header-footer-edit"),e&&e.view.focus()},rx=async({editor:t,transaction:e},n,r,o)=>{if(!o||!r)return;const i=t.getUpdatedJson();n.converter[`${o}Editors`].forEach(s=>{s.id===r&&(s.editor.setOptions({media:t.options.media,mediaFiles:t.options.mediaFiles}),s.editor.replaceContent(i)),s.editor.setOptions({lastSelection:e?.selection})}),n.converter[`${o}s`][r]=i,await s_(n)},i_=({editor:t},e)=>{t.setToolbar(e.toolbar)},s_=async t=>{if(!t.options.ydoc)return;const e=t.options.ydoc.getMap("meta"),n=[...e.get("docx")],r=await t.exportDocx({getUpdatedDocs:!0});Object.keys(r).forEach(o=>{if(o.includes("header")||o.includes("footer")){const i=n.findIndex(s=>s.name===o);if(i===-1)return;n.splice(i,1),n.push({name:o,content:r[o]})}}),t.options.ydoc.transact(()=>{e.set("docx",n)})},If=[It,ut,vt],bt=new Ge("comments"),a_=Ye.create({name:"comments",addCommands(){return{insertComment:t=>({tr:e,dispatch:n,state:r})=>{const{selection:o}=e,{$from:i,$to:s}=o,{commentId:a,isInternal:l}=t;return e.setMeta(bt,{event:"add"}),e.addMark(i.pos,s.pos,this.editor.schema.marks[an].create({commentId:a,internal:l})),n(e),!0},removeComment:({commentId:t,importedId:e})=>({tr:n,dispatch:r,state:o})=>{n.setMeta(bt,{event:"deleted"}),Ry({commentId:t,state:o,tr:n,dispatch:r})},setActiveComment:({commentId:t})=>({tr:e,dispatch:n})=>{let r=t;return e.setMeta(bt,{type:"setActiveComment",activeThreadId:r}),!0},setCommentInternal:({commentId:t,isInternal:e})=>({tr:n,dispatch:r,state:o})=>{const{doc:i}=o;let s,a;return n.setMeta(bt,{event:"update"}),i.descendants((l,c)=>{if(s)return;const{marks:u=[]}=l,d=u.find(p=>p.type.name===an);if(d){const{attrs:p}=d;p.commentId===t&&(s=l,a=c)}}),s?(n.addMark(a,a+s.nodeSize,this.editor.schema.marks[an].create({commentId:t,internal:e})),n.setMeta(bt,{type:"setCommentInternal"}),r(n),!0):!1},resolveComment:({commentId:t})=>({tr:e,dispatch:n,state:r})=>{e.setMeta(bt,{event:"update"}),Ry({commentId:t,state:r,tr:e,dispatch:n})}}},addPmPlugins(){const t=this.editor;let e,n;return t.options.isHeadless?[]:[new Ue({key:bt,state:{init(){return{activeThreadId:null,externalColor:"#B1124B",internalColor:"#078383",decorations:De.empty,allCommentPositions:{},allCommentIds:[],changedActiveThread:!1,trackedChanges:{}}},apply(r,o,i,s){const a=r.getMeta(_r)?.isReadyToInit;a&&(e=!0);const l=r.getMeta(bt),{type:c}=l||{};if(c==="force"&&(e=!0),!a&&!e&&l&&l.decorations)return{...o,decorations:l.decorations,allCommentPositions:l.allCommentPositions};const u=r.getMeta(gt),d=o.trackedChanges;u&&(o.trackedChanges=c_(u,d,s,t));const p=l?.type==="setActiveComment";if(!r.docChanged&&r.selectionSet||p){const{selection:f}=r;let h=l_(s.doc,f);if(p&&(h=l.activeThreadId),n!==h){n=h;const m={type:qa.SELECTED,activeCommentId:n||null};e=!0,t.emit("commentsUpdate",m);const{tr:y}=t.view.state,{dispatch:g}=t.view;y.setMeta(bt,{type:"force"}),g(y)}}return o}},props:{decorations(r){return this.getState(r).decorations}},view(r){let o;return{update(i,s){const{state:a}=i,{doc:l,tr:c}=a;if(o&&!o.eq(l)&&(e=!0),!e)return;o=l,e=!1;const u=[],d={};l.descendants((f,h)=>{const{marks:m=[]}=f,y=m.filter(k=>k.type.name===an);let g=!1;y.forEach(k=>{const{attrs:b}=k,C=b.commentId||b.importedId,D=i.coordsAtPos(h);Py({allCommentPositions:d,threadId:C,pos:h,currentBounds:D,node:f});const M=b.internal;g||(g=n===C);let I=r_({activeThreadId:n,threadId:C,isInternal:M,editor:t});const E=Le.inline(h,h+f.nodeSize,{style:`background-color: ${I};`,"data-thread-id":C,class:"sd-editor-comment-highlight"});g&&n!==C||u.push(E)});const v=ox({doc:l,from:h,to:h+f.nodeSize});if(v){const k=i.coordsAtPos(h),{id:b}=v.mark.attrs;Py({allCommentPositions:d,threadId:b,pos:h,currentBounds:k,node:f})}});const p=De.create(l,u);if(!bt.getState(a).decorations.eq(p)){const f=a.tr.setMeta(bt,{decorations:p,allCommentPositions:d});i.dispatch(f)}t.emit("comment-positions",{allCommentPositions:d})}}}})]}}),Py=({allCommentPositions:t,threadId:e,pos:n,currentBounds:r,node:o})=>{let i={};if(r instanceof DOMRect?i={top:r.top,bottom:r.bottom,left:r.left,right:r.right}:i={...r},!t[e])t[e]={threadId:e,start:n,end:n+o.nodeSize,bounds:i};else{const s=t[e];s.start=Math.min(s.start,n),s.end=Math.max(s.end,n+o.nodeSize),s.bounds.top=Math.min(s.bounds.top,r.top),s.bounds.bottom=Math.max(s.bounds.bottom,r.bottom)}},l_=(t,e)=>{if(!e)return;const{$from:n,$to:r}=e;if(n.pos!==r.pos||!t.nodeAt(n.pos))return;const o=ox({doc:t,from:n.pos,to:r.pos});if(o)return o.mark.attrs.id;const i=[];let s=!1;t.descendants((d,p)=>{if(s)return;const f=p+d.nodeSize;if(n.pos<p||n.pos>=f)return;const{marks:h=[]}=d;h.find(m=>m.type.name===an)&&i.push({node:d,pos:p,size:d.nodeSize}),p>n.pos&&(s=!0)});let a=null,l=null;i.forEach(({pos:d,node:p})=>{a||(a=n.pos-d);const f=n.pos-d;f>=0&&f<=a&&(l=p,a=f)});const{marks:c=[]}=l||{},u=c.find(d=>d.type.name===an);return u?.attrs?.commentId||u?.attrs?.importedId},ox=({doc:t,from:e,to:n,offset:r=1})=>{const o=Math.max(e-r,0),i=Math.min(n+r,t.content.size);let s;return t.nodesBetween(o,i,(a,l)=>{if(!a||a?.nodeSize===void 0)return;const c=a.marks.find(u=>If.includes(u.type.name));c&&!s&&(s={from:l,to:l+a.nodeSize,mark:c})}),s},c_=(t,e,n,r)=>{const{insertedMark:o,deletionMark:i,formatMark:s,deletionNodes:a}=t;if(!o&&!i&&!s)return;const l={...e};let c=o?.attrs?.id||i?.attrs?.id||s?.attrs?.id;if(!c)return e;let u=!1;l[c]||(l[c]={},u=!0),o&&(l[c].insertion=c),i&&(l[c].deletion=i.attrs?.id),s&&(l[c].format=s.attrs?.id);const{step:d}=t;let p=d?.slice?.content?.content||[];p.length||n.doc.descendants((h,m)=>{if(h.marks.find(y=>y.type.name===vt))return p=[h],!1});const f=d_({documentId:r.options.documentId,event:u?"add":"update",marks:{insertedMark:o,deletionMark:i,formatMark:s},deletionNodes:a,nodes:p,newEditorState:n});return f&&r.emit("commentsUpdate",f),l},u_=({state:t,node:e,mark:n,marks:r,trackedChangeType:o,isDeletionInsertion:i,deletionNodes:s=[]})=>{let a="",l="";if(o===It&&(a=e?.text??""),o===vt&&(a=n_(n.attrs)),(o===ut||i)&&(l=e?.text??"",i)){let{id:c}=r.deletionMark.attrs;l=p_(t.doc,u=>{const{marks:d=[]}=u,p=d.filter(f=>If.includes(f.type.name));if(!p.length)return!1;if(p.find(f=>f.attrs.id===c))return!0})?.node.text??""}return{deletionText:l,trackedChangeText:a}},d_=({event:t,marks:e,deletionNodes:n,nodes:r,newEditorState:o,documentId:i})=>{const s=e.insertedMark||e.deletionMark||e.formatMark,{type:a,attrs:l}=s,{name:c}=a,{author:u,authorEmail:d,date:p}=l,f=l.id,h=r[0],m=!!(e.insertedMark&&e.deletionMark);let y;o.doc.descendants((b,C)=>{const{marks:D=[]}=b,M=D.filter(I=>If.includes(I.type.name));if(M.length&&(M.find(I=>I.attrs.id===f)&&(y=b),y))return!1});const{deletionText:g,trackedChangeText:v}=u_({state:o,node:y||h,mark:s,marks:e,trackedChangeType:c,isDeletionInsertion:m,deletionNodes:n});if(!g&&!v)return;const k={event:qa.ADD,type:"trackedChange",documentId:i,changeId:f,trackedChangeType:m?"both":c,trackedChangeText:v,deletedText:e.deletionMark?g:null,author:u,authorEmail:d,date:p};return t==="add"?k.event=qa.ADD:t==="update"&&(k.event=qa.UPDATE),k};function p_(t,e){let n=null;return t.descendants((r,o)=>{if(e(r)&&(n={node:r,pos:o}),n)return!1}),n}const ix=({state:t,tr:e,step:n,newTr:r,map:o,doc:i,user:s,date:a,originalStep:l,originalStepIndex:c})=>{const u=t.schema.marks[ut],d=nc(t,u,!1),p=d?d.to:n.to,f=new Tt(p,p,n.slice,n.structure),h=l.invert(e.docs[c]).map(o);o.appendMap(h.getMap());const m={};if(f){const y=t.apply(r).tr;if(y.maybeStep(f).failed)return;const g=f.getMap().map(f.to),v=Y2({tr:y,from:f.from,to:g,user:s,date:a}),k=new Tt(f.from,f.to,y.doc.slice(f.from,g));r.step(k);const b=o.maps.length-1;o.appendMap(k.getMap(),b),f.from!==g&&(m.insertedMark=v,m.step=k),r.selection.eq(y.selection)||r.setSelection(y.selection)}if(n.from!==n.to){const{deletionMark:y,deletionMap:g,nodes:v}=Z2({tr:r,from:n.from,to:n.to,user:s,date:a});m.deletionNodes=v,m.deletionMark=y,o.appendMapping(g)}r.setMeta(gt,m),r.setMeta(bt,{type:"force"})},f_=()=>{},h_=()=>{},sx=({state:t,tr:e,step:n,newTr:r,map:o,doc:i,user:s,date:a})=>{const l={};i.nodesBetween(n.from,n.to,(c,u)=>{if(!c.isInline)return;if(c.marks.find(f=>f.type.name===ut))return!1;const d=c.marks.find(f=>[ut,vt].includes(f.type.name)),p=d?d.attrs.id:Lr();if(r.addMark(Math.max(n.from,u),Math.min(n.to,u+c.nodeSize),n.mark),["bold","italic","strike","underline","textStyle"].includes(n.mark.type.name)&&!c.marks.find(f=>f.type===n.mark.type)){const f=c.marks.find(y=>y.type.name===vt);let h=[],m=[];if(f?f.attrs.before.find(y=>y.type==="textStyle"?y.type===n.mark.type.name&&oi(y.attrs,n.mark.attrs):y.type===n.mark.type.name)?(m=[...f.attrs.before.filter(y=>y.type!==n.mark.type.name)],h=[...f.attrs.after]):(m=[...f.attrs.before],h=[...f.attrs.after,{type:n.mark.type.name,attrs:{...n.mark.attrs}}]):(m=c.marks.map(y=>({type:y.type.name,attrs:{...y.attrs}})),h=[{type:n.mark.type.name,attrs:{...n.mark.attrs}}]),h.length||m.length){const y=t.schema.marks[vt].create({id:p,author:s.name,authorEmail:s.email,date:a,before:m,after:h});r.addMark(n.from,n.to,y),l.formatMark=y,l.step=n,r.setMeta(gt,l),r.setMeta(bt,{type:"force"})}else f&&r.removeMark(Math.max(n.from,u),Math.min(n.to,u+c.nodeSize),f)}})},ax=({state:t,tr:e,step:n,newTr:r,map:o,doc:i,user:s,date:a})=>{const l={};i.nodesBetween(n.from,n.to,(c,u)=>{if(!c.isInline)return!0;if(c.marks.find(d=>d.type.name===ut))return!1;if(r.removeMark(Math.max(n.from,u),Math.min(n.to,u+c.nodeSize),n.mark),["bold","italic","strike","underline","textStyle"].includes(n.mark.type.name)&&c.marks.find(d=>d.type===n.mark.type)){const d=c.marks.find(h=>h.type.name===vt);let p=[],f=[];if(d?d.attrs.after.find(h=>h.type===n.mark.type.name)?(p=[...d.attrs.after.filter(h=>h.type!==n.mark.type.name)],f=[...d.attrs.before]):(p=[...d.attrs.after],f=[...d.attrs.before,{type:n.mark.type.name,attrs:{...n.mark.attrs}}]):(p=[],f=[{type:n.mark.type.name,attrs:{...n.mark.attrs}}]),p.length||f.length){const h=t.schema.marks[vt].create({id:Lr(),author:s.name,authorEmail:s.email,date:a,before:f,after:p});r.addMark(Math.max(n.from,u),Math.min(n.to,u+c.nodeSize),h),l.formatMark=h,l.step=n,r.setMeta(gt,l),r.setMeta(bt,{type:"force"})}else d&&r.removeMark(Math.max(n.from,u),Math.min(n.to,u+c.nodeSize),d)}})},lx=({tr:t,state:e,user:n})=>{const r=["inputType","uiEvent","paste","pointer"],o=["historyUndo","historyRedo","acceptReject"];if(!t.steps.length||t.meta&&!Object.keys(t.meta).every(c=>r.includes(c))||o.includes(t.getMeta("inputType"))||t.getMeta(bt))return t;const i=e.tr,s=new ni,a=Math.floor(Date.now()/6e5)*6e5,l=new Date(a).toISOString();if(t.steps.forEach((c,u)=>{const d=c.map(s),{doc:p}=i;d&&(d instanceof Tt?(ix({state:e,tr:t,step:d,newTr:i,map:s,doc:p,user:n,date:l,originalStep:c,originalStepIndex:u}),console.debug("[track-changes]: replaceStep")):d instanceof Vs?(sx({state:e,tr:t,step:d,newTr:i,map:s,doc:p,user:n,date:l}),console.debug("[track-changes]: addMarkStep")):d instanceof vn?(ax({state:e,tr:t,step:d,newTr:i,map:s,doc:p,user:n,date:l}),console.debug("[track-changes]: removeMarkStep")):(i.step(d),console.log("[track-changes]: otherStep")))}),t.getMeta("inputType")&&i.setMeta(t.getMeta("inputType")),t.getMeta("uiEvent")&&i.setMeta(t.getMeta("uiEvent")),t.selectionSet){const c=e.schema.marks[ut],u=nc(e,c,!1);if(t.selection instanceof Pe&&(t.selection.from<e.selection.from||t.getMeta("inputType")==="deleteContentBackward")){const d=s.map(t.selection.from,-1);i.setSelection(new Pe(i.doc.resolve(d)))}else if(t.selection.from>e.selection.from&&u){const d=s.map(u.to+1,1);i.setSelection(new Pe(i.doc.resolve(d)))}else i.setSelection(t.selection.map(i.doc,s))}else if(e.selection.from-t.selection.from>1&&t.selection.$head.depth>1){const c=s.map(t.selection.from-2,-1);i.setSelection(new Pe(i.doc.resolve(c)))}return t.storedMarksSet&&i.setStoredMarks(t.storedMarks),t.scrolledIntoView&&i.scrollIntoView(),i},m_=t=>{const{state:e}=t,{dispatch:n}=t.view,{tr:r}=e;if(n)return e.doc.descendants((o,i)=>{if(o.type.name==="paragraph"){const{attrs:s}=o,{spacing:a}=s;if(!a)return;const l={line:Jo(at(a.line)),lineSpaceBefore:Jo(at(a.lineSpaceBefore)),lineSpaceAfter:Jo(at(a.lineSpaceAfter))};r.setNodeMarkup(i,void 0,{...s,spacing:{...a,...l}})}}),n(r),!0},g_={initial:m_},zy=t=>{if(t==="initial"||t==="0.4.14")return Object.values(g_)},Ff=(t,e,n)=>{const{type:r}=t.attrs,o={html:y_,text:w_,checkbox:v_,image:b_,link:k_,yesno:S_,date:x_}[r];return o?o(e,n):{}},y_=t=>({rawHtml:t}),w_=t=>({displayLabel:t}),b_=t=>({imageSrc:t}),v_=t=>({displayLabel:t}),x_=(t,e)=>({displayLabel:T_(t,e.input_format)}),k_=t=>(t.startsWith("http")||(t=`http://${t}`),{linkUrl:t}),S_=t=>({displayLabel:{YES:"Yes",NO:"No"}[t[0].toUpperCase()]}),A_=({editor:t,tr:e,annotationValues:n})=>{const{state:r}=t,{doc:o}=r,i=[];return o.descendants((s,a)=>{s.type.name==="table"&&i.push({node:s,pos:a})}),i.reverse().forEach(s=>{C_({tableNode:s,annotationValues:n,tr:e,editor:t})}),e},C_=({tableNode:t,annotationValues:e,tr:n,editor:r})=>{let o=null,i=null;const{tableRow:s,tableCell:a,fieldAnnotation:l,paragraph:c}=r.schema.nodes;if(t.node.descendants((v,k)=>{if(o)return!0;if(v.type===s&&(i={node:v,pos:k}),v.type===l){const b=Pu(v.attrs.fieldId,e);Array.isArray(b)&&(o=i)}}),!o)return;const{node:u,pos:d}=o,p=n.mapping.map(t.pos+d),f=p+u.nodeSize;let h=0;if(u.descendants((v,k)=>{if(v.type===l){const b=Pu(v.attrs.fieldId,e);Array.isArray(b)&&(h=Math.max(h,b.length))}}),h<=1)return;const m=(v,k)=>{const b=v.content.content.map(C=>{if(C.type!==c)return C;const D=C.content.content.map(M=>{if(M.type!==l)return M;let I=Pu(M.attrs.fieldId,e);Array.isArray(I)||(I=[I]);const E=I?.[k],G=Ff(M,E);return l.create({...M.attrs,...G,generatorIndex:k},M.content,M.marks)});return c.create(C.attrs,ye.from(D),C.marks)});return a.create(v.attrs,ye.from(b),v.marks)};for(let v=h-1;v>=0;v--){const k=n.mapping.map(f)+1,b=u.content.content.map(D=>m(D,v)),C=s.create(u.attrs,ye.from(b),u.marks);n.insert(k,ye.from(C))}const y=n.mapping.map(p),g=y+u.nodeSize;n.delete(y-1,g+1)},Pu=(t,e)=>e.find(n=>n.input_id===t)?.input_value||null,cx=({editor:t,annotationValues:e=[],hiddenFieldIds:n=[]})=>{const r={header:t.converter.headers||{},footer:t.converter.footers||{}};Object.entries(r).forEach(([o,i])=>{const s=`${o}Editors`;Object.entries(i).forEach(([a,l])=>{let c=t.converter[s][a];c||(c={id:a,editor:lc({editor:t,data:l,editorContainer:document.createElement("div"),appendToBody:!1,sectionId:a,type:o})},t.converter[s].push(c)),c.editor.annotate(e,n),rx({editor:c.editor},t,a,o)})})},E_=({annotationValues:t=[],hiddenFieldIds:e=[],schema:n,tr:r,editor:o})=>{cx({editor:o,annotationValues:t,hiddenFieldIds:e});const i=[],s=n.nodes.fieldAnnotation;r.doc.descendants((l,c)=>{l.type===s&&i.push({node:l,pos:c,size:l.nodeSize})});const a=new Set;if(e.length)for(const{node:l,pos:c}of i)e.includes(l.attrs.fieldId)&&a.add(c);for(const{node:l,pos:c}of i){const{type:u,fieldType:d,fieldId:p}=l.attrs;if(a.has(c))continue;let f=null;const h=t.find(m=>m.input_id===p);if(!h){const m=t.filter(y=>y.input_field_type==="CHECKBOXINPUT");e:for(const y of m)for(const g of y.input_options)if(g.itemid===p){f=y.input_link_value[g.itemid]||" ";break e}}if(f=f||h?.input_value||null,!(Array.isArray(f)&&l.attrs.generatorIndex!=null))if((u==="checkbox"||d==="CHECKBOXINPUT")&&(!f||typeof f=="string"&&f.codePointAt(0)===9744)&&(f=" "),!f)a.add(c);else{const m=Ff(l,f,h);r=r.setNodeMarkup(c,void 0,{...l.attrs,...m})}}return Array.from(a).sort((l,c)=>c-l).forEach(l=>{const c=i.find(u=>u.pos===l);c&&(r=r.delete(l,l+c.node.nodeSize))}),r},T_=(t=null,e="")=>{const n=t?new Date(t):new Date;return isNaN(n.getTime())?t:e?dateFormat(n,e):n.toLocaleDateString("en-US",{month:"short",day:"2-digit",year:"numeric"})},da={getFieldAttrs:Ff,processTables:A_,annotateDocument:E_,annotateHeadersAndFooters:cx},$_=new Ge("collaboration"),O_=Ye.create({name:"collaboration",priority:1e3,addOptions(){return{ydoc:null,field:"supereditor",fragment:null,isReady:!1}},addPmPlugins(){if(!this.editor.options.ydoc)return[];this.options.ydoc=this.editor.options.ydoc;const t=D_();__(this.options.ydoc,this.editor),N_(this.options.ydoc,this.editor,this);const[e,n]=M_(this.options.ydoc,this.editor);this.options.fragment=n;const r=this.options.ydoc.getMap("media");return r.observe(o=>{o.changes.keys.forEach((i,s)=>{if(!(s in this.editor.storage.image.media)){const a=r.get(s);this.editor.storage.image.media[s]=a}})}),[e,t]},addCommands(){return{undo:()=>({tr:t,state:e,dispatch:n})=>(t.setMeta("preventDispatch",!0),t.setMeta("inputType","historyUndo"),Dr.getState(e).undoManager.undoStack.length===0?!1:n?bD(e):!0),redo:()=>({tr:t,state:e,dispatch:n})=>(t.setMeta("preventDispatch",!0),t.setMeta("inputType","historyRedo"),Dr.getState(e).undoManager.redoStack.length===0?!1:n?vD(e):!0),addImageToCollaboration:({mediaPath:t,fileData:e})=>()=>{this.options.ydoc&&this.options.ydoc.getMap("media").set(t,e)}}},addShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-Shift-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo()}}}),M_=(t,e)=>{const n=t.getXmlFragment("supereditor");return[YM(n,{onFirstRender:()=>{e.options.isNewFile&&ux(t,e)}}),n]},ux=(t,e)=>{const n=t.getMap("meta");n.set("docx",e.options.content),n.set("fonts",e.options.fonts)},D_=()=>SD(),__=(t,e)=>{const n=t.getMap("meta");n.observe(r=>{const o=n.get("lockedBy"),i=n.get("locked");if(!e.options.user||!o)return;const s=o?.email!==e.options.user?.email,a=e.options.editable!==!i;!s||!a||(i?console.debug("--- Locking editor ---",o,e.options.user):console.debug("--- Unlocking editor ---",o),e.setEditable(!i),e.emit("locked",{editor:e,isLocked:i,lockedBy:o}))})},N_=(t,e,n)=>{const r=e.options.collaborationProvider;if(!r)return;const o=()=>{n.options.isReady=!0,r.off("synced",o),e.emit("collaborationReady",{editor:e,ydoc:t})};if(r.synced){setTimeout(()=>{o()},250);return}r.on("synced",o)},I_=t=>{const e=pD(t.state.doc,"supereditor");return ux(e,t),Yr.encodeStateAsUpdate(e)};var Wo,dx,Ie,px,fx,up,zu,hx,Wa,dp,ju,qu,ss,Dl,jy,Vu,Ga,Ka,Uu,qy,Wi,Gi,Vy,Hu,pp,mx;const F_=class gx extends AD{constructor(e){super(),$r(this,Ie),$r(this,Wo),Re(this,"extensionService"),Re(this,"extensionStorage",{}),Re(this,"schema"),Re(this,"view"),Re(this,"isFocused",!1),$r(this,dx),Re(this,"options",{element:null,selector:null,isHeadless:!1,mockDocument:null,mockWindow:null,content:"",user:null,users:[],media:{},mediaFiles:{},fonts:{},documentMode:"editing",mode:"docx",role:"editor",colors:[],converter:null,fileSource:null,initialState:null,documentId:null,extensions:[],editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,isCommentsEnabled:!1,isNewFile:!1,scale:1,annotations:!1,isInternal:!1,externalExtensions:[],numbering:{},isHeaderOrFooter:!1,lastSelection:null,htmlOverride:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:r})=>{throw r},onTrackedChangesUpdate:()=>null,onCommentsUpdate:()=>null,onCommentsLoaded:()=>null,onCommentClicked:()=>null,onCommentLocationsUpdate:()=>null,onDocumentLocked:()=>null,onFirstRender:()=>null,onCollaborationReady:()=>null,onPaginationUpdate:()=>null,onException:()=>null,handleImageUpload:null,telemetry:null}),Ae(this,Ie,px).call(this,e),Ae(this,Ie,hx).call(this,e),this.setOptions(e);let n={docx:()=>Ae(this,Ie,fx).call(this,this.options),text:()=>Ae(this,Ie,up).call(this,this.options),html:()=>Ae(this,Ie,up).call(this,this.options),default:()=>{console.log("Not implemented.")}};(n[this.options.mode]??n.default)()}setToolbar(e){this.toolbar=e}focus(){this.view?.focus()}get state(){return this.view?.state}get storage(){return this.extensionStorage}get commands(){return Xn(this,Wo)?.commands}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get isDestroyed(){return this.view.isDestroyed}get element(){return this.options.element}get users(){return this.options.users}chain(){return Xn(this,Wo).chain()}can(){return Xn(this,Wo).can()}setDocumentMode(e){let n=e?.toLowerCase()||"editing";this.extensionService&&(this.options.role==="viewer"&&(n="viewing"),this.options.role==="suggester"&&n==="editing"&&(n="suggesting"),n==="viewing"?(this.commands.toggleTrackChangesShowOriginal(),this.setEditable(!1,!1),this.setOptions({documentMode:"viewing"}),Ml(this,null,!1)):n==="suggesting"?(Ae(this,Ie,dp).call(this,"TrackChangesBase"),this.commands.disableTrackChangesShowOriginal(),this.commands.enableTrackChanges(),this.setOptions({documentMode:"suggesting"}),this.setEditable(!0,!1)):n==="editing"&&(Ae(this,Ie,dp).call(this,"TrackChangesBase"),this.commands.disableTrackChangesShowOriginal(),this.commands.disableTrackChanges(),this.setEditable(!0,!1),this.setOptions({documentMode:"editing"}),Ml(this,null,!1)))}generateCollaborationUpdate(){return I_(this)}initializeCollaborationData(){if(!this.options.isNewFile||!this.options.collaborationProvider)return;const{collaborationProvider:e}=this.options,n=()=>{e.off("synced",n),Ae(this,Ie,Wa).call(this)};e.synced?Ae(this,Ie,Wa).call(this):e.on("synced",n)}replaceContent(e){this.setOptions({content:e}),Ae(this,Ie,ss).call(this),this.initDefaultStyles(),Ae(this,Ie,ss).call(this),Ae(this,Ie,Dl).call(this);const n=Ae(this,Ie,Ga).call(this),r=this.state.tr.replaceWith(0,this.state.doc.content.size,n);this.view.dispatch(r)}setOptions(e={}){if(this.options={...this.options,...e},this.options.collaborationProvider&&this.options.ydoc){const n=this.options.extensions.findIndex(r=>r.name==="history");n!==-1&&this.options.extensions.splice(n,1)}(this.options.isNewFile||!this.options.ydoc)&&this.options.isCommentsEnabled&&(this.options.shouldLoadComments=!0),!(!this.view||!this.state||this.ifsDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e=!0,n=!0){this.setOptions({editable:e}),n&&this.emit("update",{editor:this,transaction:this.state.tr})}registerPlugin(e,n){const r=typeof n=="function"?n(e,[...this.state.plugins]):[...this.state.plugins,e],o=this.state.reconfigure({plugins:r});this.view.updateState(o)}unregisterPlugin(e){if(this.isDestroyed)return;const n=typeof nameOrPluginKey=="string"?`${nameOrPluginKey}$`:nameOrPluginKey.key,r=this.state.reconfigure({plugins:this.state.plugins.filter(o=>!o.key.startsWith(n))});this.view.updateState(r)}static async loadXmlData(e,n=!1){if(!e)return;const r=new Pd,o=await r.getDocxData(e,n),i=r.media;return[o,i,r.mediaFiles,r.fonts]}static getDocumentVersion(e){return Nr.getStoredSuperdocVersion(e)}static updateDocumentVersion(e,n){return Nr.updateDocumentVersion(e,n)}createNodeViews(){this.view.setProps({nodeViews:this.extensionService.nodeViews})}getMaxContentSize(){if(!this.converter)return{};const{pageSize:e={},pageMargins:n={}}=this.converter.pageStyles??{},{width:r,height:o}=e,{top:i=0,bottom:s=0,left:a=0,right:l=0}=n;if(!r||!o)return{};const c=o*96-i*96-s*96-50;return{width:r*96-a*96-l*96-20,height:c}}initDefaultStyles(e=this.element){if(this.options.isHeadless||this.options.htmlOverride)return;const n=e?.querySelector(".ProseMirror"),{pageSize:r,pageMargins:o}=this.converter.pageStyles??{};if(!n||!r||!o)return;e.style.width=r.width+"in",e.style.minWidth=r.width+"in",e.style.minHeight=r.height+"in",e.style.paddingLeft=o.left+"in",e.style.paddingRight=o.right+"in",e.style.boxSizing="border-box",e.style.isolation="isolate",n.style.outline="none",n.style.border="none";const{typeface:i,fontSizePt:s}=this.converter.getDocumentDefaultStyles()??{};i&&(e.style.fontFamily=i),s&&(e.style.fontSize=`${s}pt`),e.style.transformOrigin="top left",e.style.touchAction="auto",e.style.webkitOverflowScrolling="touch";const a=1.2;n.style.lineHeight=a,this.options.extensions.find(l=>l.name==="pagination")||(n.style.paddingTop="1in",n.style.paddingBottom="1in"),this.initMobileStyles(e)}initMobileStyles(e){if(!e)return;const n=e.offsetWidth,r=()=>{const i=n,s=document.documentElement.clientWidth-10;this.options.scale=Math.min(1,s/i);const a=e.closest(".super-editor"),l=e.closest(".super-editor-container");!a||!l||(this.options.scale<1?(a.style.maxWidth=`${i*this.options.scale}px`,l.style.minWidth="0px",e.style.transform=`scale(${this.options.scale})`):(a.style.maxWidth="",l.style.minWidth="",e.style.transform="none"))};r();const o=()=>{setTimeout(()=>{r()},150)};"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",o):window.matchMedia("(orientation: portrait)").addEventListener("change",o),window.addEventListener("resize",()=>o)}getAttributes(e){return Te.getAttributes(this.state,e)}isActive(e,n){const r=typeof e=="string"?e:null,o=typeof e=="string"?n:e;return Y1(this.state,r,o)}getJSON(){return this.state.doc.toJSON()}getHTML(){const e=document.createElement("div"),n=xi.fromSchema(this.schema).serializeFragment(this.state.doc.content);return e.appendChild(n),e.innerHTML}getPageStyles(){return this.converter?.pageStyles||{}}updatePageStyle({pageMargins:e}){if(!this.converter)return;let n=!1;if(e&&(this.converter.pageStyles.pageMargins=e,this.initDefaultStyles(),n=!0),n){const r=this.view.state.tr;r.setMeta("forceUpdatePagination",!0),this.view.dispatch(r)}}getUpdatedJson(){return Ae(this,Ie,pp).call(this)}async exportDocx({isFinalDoc:e=!1,commentsType:n="external",comments:r=[],getUpdatedDocs:o=!1}={}){const i=Ae(this,Ie,pp).call(this,r),s=await this.converter.exportToDocx(i,this.schema,this.storage.image.media,e,n,r,this),a=this.converter.schemaToXml(this.converter.convertedXml["docProps/custom.xml"].elements[0]),l=this.converter.schemaToXml(this.converter.convertedXml["word/styles.xml"].elements[0]),c=this.converter.schemaToXml(this.converter.convertedXml["word/settings.xml"].elements[0]),u=this.converter.schemaToXml(this.converter.convertedXml["word/_rels/document.xml.rels"].elements[0]),d=this.converter.addedMedia,p={};Object.entries(this.converter.convertedXml).forEach(([g,v])=>{if(g.includes("header")||g.includes("footer")){const k=this.converter.schemaToXml(v.elements[0]);p[g]=String(k)}});const f=this.converter.convertedXml["word/numbering.xml"],h=this.converter.schemaToXml(f.elements[0]),m={"word/document.xml":String(s),"docProps/custom.xml":String(a),"word/settings.xml":String(c),"word/_rels/document.xml.rels":String(u),"word/numbering.xml":String(h),"word/styles.xml":String(l).replace(/&/gi,"&amp;"),...p};if(r.length){const g=this.converter.schemaToXml(this.converter.convertedXml["word/comments.xml"].elements[0]),v=this.converter.schemaToXml(this.converter.convertedXml["word/commentsExtended.xml"].elements[0]),k=this.converter.schemaToXml(this.converter.convertedXml["word/commentsExtensible.xml"].elements[0]),b=this.converter.schemaToXml(this.converter.convertedXml["word/commentsIds.xml"].elements[0]);m["word/comments.xml"]=String(g),m["word/commentsExtended.xml"]=String(v),m["word/commentsExtensible.xml"]=String(k),m["word/commentsIds.xml"]=String(b)}if(o)return m;const y=await new Pd().updateZip({docx:this.options.content,updatedDocs:m,originalDocxFile:this.options.fileSource,media:d,fonts:this.options.fonts,isHeadless:this.options.isHeadless});return this.options.telemetry?.trackUsage("document_export",{documentType:"docx",timestamp:new Date().toISOString()}),y}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),Ae(this,Ie,mx).call(this),this.removeAllListeners()}static checkIfMigrationsNeeded(e){version||(version="initial");const n=zy(version)||[];return console.debug("[checkVersionMigrations] Migrations needed:",version,n.length),n.length>0}processCollaborationMigrations(){if(console.debug("[checkVersionMigrations] Current editor version","0.12.7"),!this.options.ydoc)return;let e=this.options.ydoc.getMap("meta").get("version");e||(e="initial"),console.debug("[checkVersionMigrations] Document version",e);const n=zy(e)||[],r=this.state.plugins.find(i=>i.key.startsWith("y-sync"));if(!r)return this.options.ydoc;let o=!1;for(let i of n)if(console.debug("🏃‍♂️ Running migration",i.name),i(this))o=!0;else throw new Error("Migration failed at "+i.name);return o?(r?.getState(this.state)).doc:void 0}async replaceFile(e){this.setOptions({annotations:!0});const[n,r,o,i]=await gx.loadXmlData(newFile);this.setOptions({fileSource:newFile,content:n,media:r,mediaFiles:o,fonts:i,isNewFile:!0,shouldLoadComments:!0,replacedFile:!0}),Ae(this,Ie,ss).call(this),Ae(this,Ie,Dl).call(this),this.initDefaultStyles(),this.options.ydoc&&this.options.collaborationProvider?this.initializeCollaborationData(!0):Ae(this,Ie,Wa).call(this),this.options.ydoc||(Ae(this,Ie,Gi).call(this),Ae(this,Ie,Wi).call(this))}getNodesOfType(e){const{findChildren:n}=oc;return n(this.state.doc,r=>r.type.name===e)}replaceNodeWithHTML(e,n){const{tr:r}=this.state,{dispatch:o}=this.view;if(!e||!n)return;const i=e.pos,s=i+e.node.nodeSize,a=Ae(this,Ie,Ka).call(this,n);r.replaceWith(i,s,a),o(r)}prepareForAnnotations(e=[]){const{tr:n}=this.state,{dispatch:r}=this.view,o=da.processTables({editor:this,tr:n,annotationValues:e});this.view.dispatch(o),da.annotateHeadersAndFooters({editor:this,annotationValues:e})}annotate(e=[],n=[]){const{state:r,view:o,schema:i}=this;let s=r.tr;s=da.processTables({editor:this,tr:s,annotationValues:e}),s=da.annotateDocument({tr:s,schema:i,annotationValues:e,hiddenFieldIds:n,editor:this}),s.docChanged&&o.dispatch(s.scrollIntoView())}};Wo=new WeakMap,dx=new WeakMap,Ie=new WeakSet,px=function(t){if(!t.element&&t.selector){const{selector:e}=t;e.startsWith("#")||e.startsWith(".")?t.element=document.querySelector(e):t.element=document.getElementById(e),["text","html"].includes(t.mode)&&t.element&&t.element.classList.add("sd-super-editor-html")}t.element=t.isHeadless?null:t.element||document.createElement("div")},fx=function(t){Ae(this,Ie,ju).call(this),Ae(this,Ie,qu).call(this),Ae(this,Ie,Vu).call(this),Ae(this,Ie,ss).call(this),Ae(this,Ie,Dl).call(this),this.options.isHeadless||Ae(this,Ie,jy).call(this),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),this.on("exception",this.options.onException),Ae(this,Ie,Uu).call(this),this.initDefaultStyles(),this.setDocumentMode(t.documentMode),!this.options.isHeadless&&(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",Ae(this,Ie,zu)),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("trackedChangesUpdate",this.options.onTrackedChangesUpdate),this.on("commentsLoaded",this.options.onCommentsLoaded),this.on("commentClick",this.options.onCommentClicked),this.on("commentsUpdate",this.options.onCommentsUpdate),this.on("locked",this.options.onDocumentLocked),this.on("collaborationReady",Ae(this,Ie,qy)),this.on("paginationUpdate",this.options.onPaginationUpdate),this.on("comment-positions",this.options.onCommentLocationsUpdate),this.initializeCollaborationData(),this.options.ydoc||(Ae(this,Ie,Gi).call(this),Ae(this,Ie,Wi).call(this)),window.setTimeout(()=>{this.isDestroyed||this.emit("create",{editor:this})},0))},up=function(t){(!t.extensions||!t.extensions.length)&&(this.options.extensions=Wf()),Ae(this,Ie,ju).call(this),Ae(this,Ie,qu).call(this),Ae(this,Ie,Vu).call(this),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),Ae(this,Ie,Uu).call(this),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",Ae(this,Ie,zu)),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("commentsLoaded",this.options.onCommentsLoaded),this.on("commentClick",this.options.onCommentClicked),this.on("locked",this.options.onDocumentLocked),window.setTimeout(()=>{this.isDestroyed||this.emit("create",{editor:this})},0)},zu=function({editor:t,event:e}){this.toolbar?.setActiveEditor(t),this.options.onFocus({editor:t,event:e})},hx=function(t){t.isHeadless&&(typeof navigator>"u"&&(Qr.navigator={isHeadless:!0}),t.mockDocument&&(Qr.document=t.mockDocument,Qr.window=t.mockWindow))},Wa=function(){if(!this.options.isNewFile)return;this.options.isNewFile=!1;const t=Ae(this,Ie,Ga).call(this),e=this.state.tr.replaceWith(0,this.state.doc.content.size,t);this.view.dispatch(e),setTimeout(()=>{Ae(this,Ie,Gi).call(this),Ae(this,Ie,Wi).call(this)},50)},dp=function(t){const e=this.extensionService?.plugins.find(r=>r.key.startsWith(t)),n=this.state.plugins.find(r=>r.key.startsWith(t));return e&&!n&&this.registerPlugin(e),e?.key},ju=function(){const t=["extension","node","mark"],e=[Q$,X$,eO,Z$],n=this.options.externalExtensions||[],r=[...e,...this.options.extensions].filter(o=>t.includes(o?.type));this.extensionService=JD.create(r,n,this)},qu=function(){w1(this,Wo,_1.create({editor:this}))},ss=function(){this.options.converter?this.converter=this.options.converter:this.converter=new Nr({docx:this.options.content,media:this.options.mediaFiles,fonts:this.options.fonts,debug:!0,telemetry:this.options.telemetry,fileSource:this.options.fileSource,documentId:this.options.documentId})},Dl=function(){if(!this.options.ydoc)return this.storage.image.media=this.options.mediaFiles;const t=this.options.ydoc.getMap("media");this.options.isNewFile?(Object.entries(this.options.mediaFiles).forEach(([e,n])=>{t.set(e,n)}),this.storage.image.media=this.options.mediaFiles):this.storage.image.media=Object.fromEntries(t.entries())},jy=function(){const t=this.converter.getDocumentFonts();if(t?.length){const e=document.createElement("style");e.textContent=t,document.head.appendChild(e)}},Vu=function(){this.schema=this.extensionService.schema},Ga=function(){let t;try{const{mode:e,fragment:n,isHeadless:r,content:o,loadFromSchema:i}=this.options;e==="docx"?i?(t=this.schema.nodeFromJSON(o),t=Ae(this,Ie,Hu).call(this,t)):(t=X1(this.converter,this.schema,this),t=Ae(this,Ie,Hu).call(this,t),this.options.html&&(t=Ae(this,Ie,Ka).call(this,this.options.html)),n&&(t=dD(n,this.schema))):(e==="text"||e==="html")&&(i?t=this.schema.nodeFromJSON(o):o?t=Ae(this,Ie,Ka).call(this,o):t=this.schema.topNodeType.createAndFill())}catch(e){console.error(e),this.emit("contentError",{editor:this,error:e})}return t},Ka=function(t){let e=t;if(typeof t=="string"){const n=document.createElement("div");n.innerHTML=t,e=n,n.remove()}return er.fromSchema(this.schema).parse(e)},Uu=function(){let t=Ae(this,Ie,Ga).call(this);const e={schema:this.schema};this.options.ydoc||(e.doc=t),this.view=new B2(this.options.element,{...this.options.editorProps,dispatchTransaction:Ae(this,Ie,Vy).bind(this),state:Zi.create(e),handleDoubleClick:async(o,i,s)=>{if(this.options.documentMode!=="editing")return;const a=Id(s.target,"pagination-section-header"),l=Id(s.target,"pagination-section-footer");if(a||l){const c=new s.constructor(s.type);s.target.dispatchEvent(c);return}s.stopPropagation(),this.options.editable||(this.setEditable(!0,!1),Ml(this,null,!1),document.querySelector(".ProseMirror").classList.remove("header-footer-edit"))}});const n=this.state.reconfigure({plugins:[...this.extensionService.plugins]});this.view.updateState(n),this.createNodeViews();const r=this.view.dom;r.editor=this,this.options.telemetry?.sendReport()},qy=function({editor:t,ydoc:e}){this.options.collaborationIsReady||(console.debug("🔗 [super-editor] Collaboration ready"),this.options.onCollaborationReady({editor:t,ydoc:e}),this.options.collaborationIsReady=!0,this.options.isNewFile||(Ae(this,Ie,Gi).call(this),Ae(this,Ie,Wi).call(this)))},Wi=function(){if(!this.options.isCommentsEnabled||this.options.isHeadless||!this.options.shouldLoadComments)return;const t=this.options.replacedFile;this.emit("commentsLoaded",{editor:this,replacedFile:t,comments:this.converter.comments||[]}),setTimeout(()=>{this.options.replacedFile=!1;const{state:e,dispatch:n}=this.view,r=e.tr.setMeta(bt,{type:"force"});n(r)},50)},Gi=async function(){if(!(this.options.isHeadless||!this.extensionService)&&this.options.extensions.find(t=>t.name==="pagination")&&this.options.pagination){console.debug("🔗 [super-editor] Initializing pagination");const t=await o_(this);this.storage.pagination.sectionData=t;const{state:e,dispatch:n}=this.view,r=e.tr.setMeta(_r,{isReadyToInit:!0});n(r)}},Vy=function(t){if(this.view.isDestroyed)return;let e;try{const i=gt.getState(this.view.state)?.isTrackChangesActive??!1?lx({tr:t,state:this.state,user:this.options.user}):t,{state:s}=this.view.state.applyTransaction(i);e=s}catch(i){e=this.state.apply(t),console.log(i)}const n=!this.state.selection.eq(e.selection);this.view.updateState(e),this.emit("transaction",{editor:this,transaction:t}),n&&this.emit("selectionUpdate",{editor:this,transaction:t});const r=t.getMeta("focus");r&&this.emit("focus",{editor:this,event:r.event,transaction:t});const o=t.getMeta("blur");o&&this.emit("blur",{editor:this,event:o.event,transaction:t}),t.docChanged&&this.emit("update",{editor:this,transaction:t})},Hu=function(t){const e=Zi.create({schema:this.schema,doc:t}),{tr:n,doc:r}=e;return t_(r,n,this.schema,this.converter),e.apply(n).doc},pp=function(t=[]){const e=Zi.create({schema:this.schema,doc:this.state.doc,plugins:this.state.plugins}),{tr:n,doc:r}=e;return e_(r,n,this.schema,t),e.apply(n).doc.toJSON()},mx=function(){if(this.options.ydoc)try{console.debug("🔗 [super-editor] Ending collaboration"),this.options.collaborationProvider&&this.options.collaborationProvider.disconnect(),this.options.ydoc&&this.options.ydoc.destroy()}catch{}};let $s=F_;const yx=Ye.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseDOM:t=>t.style.color?.replace(/['"]+/g,""),renderDOM: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()}}}),wx=Ye.create({name:"fontFamily",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseDOM:t=>t.style.fontFamily?.replace(/['"]+/g,""),renderDOM: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()}}}),bx=Ye.create({name:"fontSize",addOptions(){return{types:["textStyle","tableCell"],defaults:{value:12,unit:"pt",min:8,max:96}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseDOM:t=>t.style.fontSize,renderDOM:t=>{if(!t.fontSize)return{};let[e,n]=nr(t.fontSize);return Number.isNaN(e)?{}:(n=n||this.options.defaults.unit,{style:`font-size: ${e}${n}`})}}}}]},addCommands(){return{setFontSize:t=>({chain:e})=>{let[n,r]=nr(t);if(Number.isNaN(n))return!1;let{min:o,max:i,unit:s}=this.options.defaults;return n=pl(n,o,i),r=r||s,e().setMark("textStyle",{fontSize:`${n}${r}`}).run()},unsetFontSize:()=>({chain:t})=>t().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}}),vx=Ye.create({name:"textAlign",addOptions(){return{types:["heading","paragraph"],alignments:["left","center","right","justify"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseDOM:t=>{const e=t.style.textAlign||this.options.defaultAlignment;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderDOM:t=>{if(t.textAlign===this.options.defaultAlignment)return{};const e=t.textAlign==="both"?"justify":t.textAlign;return e?{style:`text-align: ${e}`}:{}}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.map(n=>e.updateAttributes(n,{textAlign:t})).every(n=>n):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.map(e=>t.resetAttributes(e,"textAlign")).every(e=>e)}},addShortcuts(){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")}}}),xx=Ye.create({name:"textIndent",addOptions(){return{types:["heading","paragraph"],defaults:{unit:"in",increment:.125}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textIndent:{default:null,parseDOM:t=>t.style.textIndent,renderDOM:t=>{if(!t.textIndent)return{};let[e,n]=nr(t.textIndent);return Number.isNaN(e)||!e?{}:(n=n||this.options.defaults.unit,{style:`margin-left: ${e}${n}`})}}}}]},addCommands(){return{setTextIndent:t=>({commands:e})=>t?this.options.types.map(n=>e.updateAttributes(n,{textIndent:t})).every(n=>n):!1,unsetTextIndent:()=>({commands:t})=>this.options.types.map(e=>t.resetAttributes(e,"textIndent")).every(e=>e),increaseTextIndent:()=>({commands:t})=>this.options.types.map(e=>{let{textIndent:n}=this.editor.getAttributes(e);if(!n){let{increment:i,unit:s}=this.options.defaults;return t.updateAttributes(e,{textIndent:`${i}${s}`})}let[r,o]=nr(n);return r=r+this.options.defaults.increment,o=o||this.options.defaults.unit,Number.isNaN(r)?!1:t.updateAttributes(e,{textIndent:`${r}${o}`})}).every(e=>e),decreaseTextIndent:()=>({commands:t})=>this.options.types.map(e=>{let{textIndent:n}=this.editor.getAttributes(e);if(!n)return!1;let[r,o]=nr(n);return r=r-this.options.defaults.increment,o=o||this.options.defaults.unit,Number.isNaN(r)?!1:r<=0?t.unsetTextIndent():t.updateAttributes(e,{textIndent:`${r}${o}`})}).every(e=>e)}}}),kx=Ye.create({name:"lineHeight",addOptions(){return{types:["heading","paragraph"],defaults:{unit:""}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseDOM:t=>t.style.lineHeight,renderDOM:t=>t.lineHeight?{style:Zl(t.lineHeight,this.options.defaults.unit,t.spacing?.lineRule)}:{}}}}]},addCommands(){return{setLineHeight:t=>({commands:e})=>t?this.options.types.map(n=>e.updateAttributes(n,{lineHeight:t})).every(n=>n):!1,unsetLineHeight:()=>({commands:t})=>this.options.types.map(e=>t.resetAttributes(e,"lineHeight")).every(e=>e)}}}),Sx=Ye.create({name:"formatCommands",addOptions(){return{}},addStorage(){return{storedStyle:null}},addCommands(){return{clearFormat:()=>({chain:t})=>t().clearNodes().unsetAllMarks().run(),clearMarksFormat:()=>({chain:t})=>t().unsetAllMarks().run(),clearNodesFormat:()=>({chain:t})=>t().clearNodes().run(),copyFormat:()=>({chain:t})=>{if(!this.storage.storedStyle){const i=Ws(this.editor.state);return this.storage.storedStyle=i,!0}if(!this.storage.storedStyle.length)return this.storage.storedStyle=null,t().clearFormat().run();const e=this.storage.storedStyle,n=[];e.forEach(i=>{const{type:s,attrs:a}=i,{name:l}=s;l==="textStyle"?Object.keys(a).forEach(c=>{if(!a[c])return;const u={};u[c]=a[c],n.push({name:c,attrs:u})}):n.push({name:l,attrs:a})});const r={bold:["setBold","unsetBold"],italic:["setItalic","unsetItalic"],underline:["setUnderline","unsetUnderline"],color:["setColor","setColor",null],fontSize:["setFontSize","unsetFontSize"],fontFamily:["setFontFamily","unsetFontFamily"]};let o=t();return Object.keys(r).forEach(i=>{const[s,a,l]=r[i],c=n.find(p=>p.name===i),u=c?.attrs&&c?.attrs[i];let d={};!c&&!u?d={command:a,argument:l}:d={command:s,argument:c.attrs[i]||l},o=o[d.command](d.argument)}),this.storage.storedStyle=null,o}}},addShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.clearFormat()}}});function R_(t={}){return new Ue({view(e){return new B_(e,t)}})}let B_=class{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(o=>{let i=s=>{this[o](s)};return e.dom.addEventListener(o,i),{name:o,handler:i}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r,o=this.editorView.dom,i=o.getBoundingClientRect(),s=i.width/o.offsetWidth,a=i.height/o.offsetHeight;if(n){let d=e.nodeBefore,p=e.nodeAfter;if(d||p){let f=this.editorView.nodeDOM(this.cursorPos-(d?d.nodeSize:0));if(f){let h=f.getBoundingClientRect(),m=d?h.bottom:h.top;d&&p&&(m=(m+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let y=this.width/2*a;r={left:h.left,right:h.right,top:m-y,bottom:m+y}}}}if(!r){let d=this.editorView.coordsAtPos(this.cursorPos),p=this.width/2*s;r={left:d.left-p,right:d.left+p,top:d.top,bottom:d.bottom}}let l=this.editorView.dom.offsetParent;this.element||(this.element=l.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let c,u;if(!l||l==document.body&&getComputedStyle(l).position=="static")c=-pageXOffset,u=-pageYOffset;else{let d=l.getBoundingClientRect(),p=d.width/l.offsetWidth,f=d.height/l.offsetHeight;c=d.left-l.scrollLeft*p,u=d.top-l.scrollTop*f}this.element.style.left=(r.left-c)/s+"px",this.element.style.top=(r.top-u)/a+"px",this.element.style.width=(r.right-r.left)/s+"px",this.element.style.height=(r.bottom-r.top)/a+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),o=r&&r.type.spec.disableDropCursor,i=typeof o=="function"?o(this.editorView,n,e):o;if(n&&!i){let s=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=vv(this.editorView.state.doc,s,this.editorView.dragging.slice);a!=null&&(s=a)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}};const Ax=Ye.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:2,class:void 0}},addPmPlugins(){return[R_(this.options)]}});let en=class yr extends je{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return yr.valid(r)?new yr(r):je.near(r)}content(){return ve.empty}eq(e){return e instanceof yr&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new yr(e.resolve(n.pos))}getBookmark(){return new L_(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!P_(e)||!z_(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let o=n.contentMatchAt(e.index()).defaultType;return o&&o.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&yr.valid(e))return e;let o=e.pos,i=null;for(let s=e.depth;;s--){let a=e.node(s);if(n>0?e.indexAfter(s)<a.childCount:e.index(s)>0){i=a.child(n>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;o+=n;let l=e.doc.resolve(o);if(yr.valid(l))return l}for(;;){let s=n>0?i.firstChild:i.lastChild;if(!s){if(i.isAtom&&!i.isText&&!_e.isSelectable(i)){e=e.doc.resolve(o+i.nodeSize*n),r=!1;continue e}break}i=s,o+=n;let a=e.doc.resolve(o);if(yr.valid(a))return a}return null}}};en.prototype.visible=!1;en.findFrom=en.findGapCursorFrom;je.jsonID("gapcursor",en);let L_=class Cx{constructor(e){this.pos=e}map(e){return new Cx(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return en.valid(n)?new en(n):je.near(n)}};function P_(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n-1);;o=o.lastChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function z_(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n);;o=o.firstChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function j_(){return new Ue({props:{decorations:H_,createSelectionBetween(t,e,n){return e.pos==n.pos&&en.valid(n)?new en(n):null},handleClick:V_,handleKeyDown:q_,handleDOMEvents:{beforeinput:U_}}})}const q_=Df({ArrowLeft:pa("horiz",-1),ArrowRight:pa("horiz",1),ArrowUp:pa("vert",-1),ArrowDown:pa("vert",1)});function pa(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,o,i){let s=r.selection,a=e>0?s.$to:s.$from,l=s.empty;if(s instanceof Pe){if(!i.endOfTextblock(n)||a.depth==0)return!1;l=!1,a=r.doc.resolve(e>0?a.after():a.before())}let c=en.findGapCursorFrom(a,e,l);return c?(o&&o(r.tr.setSelection(new en(c))),!0):!1}}function V_(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!en.valid(r))return!1;let o=t.posAtCoords({left:n.clientX,top:n.clientY});return o&&o.inside>-1&&_e.isSelectable(t.state.doc.nodeAt(o.inside))?!1:(t.dispatch(t.state.tr.setSelection(new en(r))),!0)}function U_(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof en))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let o=ye.empty;for(let s=r.length-1;s>=0;s--)o=ye.from(r[s].createAndFill(null,o));let i=t.state.tr.replace(n.pos,n.pos,new ve(o,0,0));return i.setSelection(Pe.near(i.doc.resolve(n.pos+1))),t.dispatch(i),!1}function H_(t){if(!(t.selection instanceof en))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",De.create(t.doc,[Le.widget(t.selection.head,e,{key:"gapcursor"})])}const W_=Ye.create({name:"gapCursor",addPmPlugins(){return[j_()]},extendNodeSchema(t){return{allowGapCursor:Ke(Fe(t,"allowGapCursor",{name:t.name,options:t.options,storage:t.storage}))??null}}}),G_=Ye.create({name:"collaborationCursor",priority:999,addOptions(){return{provider:null,user:{name:null,color:null}}},addStorage(){return{users:[]}},addPmPlugins(){const{collaborationProvider:t=null}=this.editor.options;return t?[wD(t.awareness,{cursorBuilder:K_})]:[]}}),K_=t=>{const e=document.createElement("span");e.classList.add("ProseMirror-yjs-cursor"),e.setAttribute("style",`border-color: ${t.color}`);const n=document.createElement("div");return n.setAttribute("style",`background-color: ${t.color}`),n.insertBefore(document.createTextNode(t.name||t.email),null),e.insertBefore(n,null),e},Qo="aiMark",fa="aiAnimationMark",Ex="aiLoaderNode",J_=tn.create({name:Qo,group:"ai",inclusive:!1,addOptions(){return{htmlAttributes:{class:"sd-ai-highlight"}}},addAttributes(){return{id:{default:null,rendered:!1}}},parseDOM(){return[{tag:Qo}]},renderDOM({htmlAttributes:t}){return[Qo,Te.mergeAttributes(this.options.htmlAttributes,t)]}}),X_=tn.create({name:fa,group:"ai",inclusive:!1,spanning:!1,excludes:fa,addOptions(){return{htmlAttributes:{}}},addAttributes(){return{id:{default:null,rendered:!1},class:{default:null,rendered:!0},dataMarkId:{default:null,rendered:!0}}},parseDOM(){return[{tag:fa}]},renderDOM({htmlAttributes:t}){return[fa,Te.mergeAttributes(this.options.htmlAttributes,t)]}}),Y_="data:image/svg+xml,%3csvg%20fill='hsla(278,%2077.40%25,%2020.80%25,%200.65)'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='4'%20cy='12'%20r='0'%3e%3canimate%20begin='0;spinner_z0Or.end'%20attributeName='r'%20calcMode='spline'%20dur='0.5s'%20keySplines='.36,.6,.31,1'%20values='0;3'%20fill='freeze'/%3e%3canimate%20begin='spinner_OLMs.end'%20attributeName='cx'%20calcMode='spline'%20dur='0.5s'%20keySplines='.36,.6,.31,1'%20values='4;12'%20fill='freeze'/%3e%3canimate%20begin='spinner_UHR2.end'%20attributeName='cx'%20calcMode='spline'%20dur='0.5s'%20keySplines='.36,.6,.31,1'%20values='12;20'%20fill='freeze'/%3e%3canimate%20id='spinner_lo66'%20begin='spinner_Aguh.end'%20attributeName='r'%20calcMode='spline'%20dur='0.5s'%20keySplines='.36,.6,.31,1'%20values='3;0'%20fill='freeze'/%3e%3canimate%20id='spinner_z0Or'%20begin='spinner_lo66.end'%20attributeName='cx'%20dur='0.001s'%20values='20;4'%20fill='freeze'/%3e%3c/circle%3e%3ccircle%20cx='4'%20cy='12'%20r='3'%3e%3canimate%20begin='0;spinner_z0Or.end'%20attributeName='cx'%20calcMode='spline'%20dur='0.5s'%20keySplines='.36,.6,.31,1'%20values='4;12'%20fill='freeze'/%3e%3canimate%20begin='spinner_OLMs.end'%20attributeName='cx'%20calcMode='spline'%20dur='0.5s'%20keySplines='.36,.6,.31,1'%20values='12;20'%20fill='freeze'/%3e%3canimate%20id='spinner_JsnR'%20begin='spinner_UHR2.end'%20attributeName='r'%20calcMode='spline'%20dur='0.5s'%20keySplines='.36,.6,.31,1'%20values='3;0'%20fill='freeze'/%3e%3canimate%20id='spinner_Aguh'%20begin='spinner_JsnR.end'%20attributeName='cx'%20dur='0.001s'%20values='20;4'%20fill='freeze'/%3e%3canimate%20begin='spinner_Aguh.end'%20attributeName='r'%20calcMode='spline'%20dur='0.5s'%20keySplines='.36,.6,.31,1'%20values='0;3'%20fill='freeze'/%3e%3c/circle%3e%3ccircle%20cx='12'%20cy='12'%20r='3'%3e%3canimate%20begin='0;spinner_z0Or.end'%20attributeName='cx'%20calcMode='spline'%20dur='0.5s'%20keySplines='.36,.6,.31,1'%20values='12;20'%20fill='freeze'/%3e%3canimate%20id='spinner_hSjk'%20begin='spinner_OLMs.end'%20attributeName='r'%20calcMode='spline'%20dur='0.5s'%20keySplines='.36,.6,.31,1'%20values='3;0'%20fill='freeze'/%3e%3canimate%20id='spinner_UHR2'%20begin='spinner_hSjk.end'%20attributeName='cx'%20dur='0.001s'%20values='20;4'%20fill='freeze'/%3e%3canimate%20begin='spinner_UHR2.end'%20attributeName='r'%20calcMode='spline'%20dur='0.5s'%20keySplines='.36,.6,.31,1'%20values='0;3'%20fill='freeze'/%3e%3canimate%20begin='spinner_Aguh.end'%20attributeName='cx'%20calcMode='spline'%20dur='0.5s'%20keySplines='.36,.6,.31,1'%20values='4;12'%20fill='freeze'/%3e%3c/circle%3e%3ccircle%20cx='20'%20cy='12'%20r='3'%3e%3canimate%20id='spinner_4v5M'%20begin='0;spinner_z0Or.end'%20attributeName='r'%20calcMode='spline'%20dur='0.5s'%20keySplines='.36,.6,.31,1'%20values='3;0'%20fill='freeze'/%3e%3canimate%20id='spinner_OLMs'%20begin='spinner_4v5M.end'%20attributeName='cx'%20dur='0.001s'%20values='20;4'%20fill='freeze'/%3e%3canimate%20begin='spinner_OLMs.end'%20attributeName='r'%20calcMode='spline'%20dur='0.5s'%20keySplines='.36,.6,.31,1'%20values='0;3'%20fill='freeze'/%3e%3canimate%20begin='spinner_UHR2.end'%20attributeName='cx'%20calcMode='spline'%20dur='0.5s'%20keySplines='.36,.6,.31,1'%20values='4;12'%20fill='freeze'/%3e%3canimate%20begin='spinner_Aguh.end'%20attributeName='cx'%20calcMode='spline'%20dur='0.5s'%20keySplines='.36,.6,.31,1'%20values='12;20'%20fill='freeze'/%3e%3c/circle%3e%3c/svg%3e",Z_=He.create({name:Ex,group:"inline",inline:!0,atom:!0,selectable:!1,draggable:!1,addOptions(){return{htmlAttributes:{class:"sd-ai-loader",contentEditable:"false"}}},parseDOM(){return[{tag:"span.sd-ai-loader"}]},renderDOM({htmlAttributes:t}){const e=document.createElement("span");Object.entries(Te.mergeAttributes(this.options.htmlAttributes,t)).forEach(([r,o])=>e.setAttribute(r,o));const n=document.createElement("img");return n.src=Y_,n.alt="loading...",n.width=100,n.height=50,e.appendChild(n),e}}),ha=new Ge("ai"),Tx=Ye.create({name:"ai",addCommands(){return{insertAiMark:()=>({tr:t,dispatch:e,state:n})=>{const{selection:r}=t,{$from:o,$to:i}=r;return o.pos===i.pos?!1:(t.addMark(o.pos,i.pos,this.editor.schema.marks[Qo].create({id:"ai-highlight"})),e&&e(t),!0)},updateAiHighlightStyle:t=>({tr:e,dispatch:n})=>(e.setMeta(ha,{type:"updateStyle",className:t}),n&&n(e),!0),clearAiHighlightStyle:()=>({tr:t,dispatch:e})=>(t.setMeta(ha,{type:"updateStyle",className:null}),e&&e(t),!0),removeAiMark:(t=Qo)=>({tr:e,dispatch:n,state:r})=>{const{doc:o}=r;let i=!1;return o.descendants((s,a)=>{const{marks:l=[]}=s;l.find(c=>c.type.name===t)&&(i=!0,e.removeMark(a,a+s.nodeSize,r.schema.marks[t]))}),i?(n&&n(e),!0):!1},removeAiNode:(t=Ex)=>({tr:e,dispatch:n,state:r})=>{const{doc:o}=r,i=[];return o.descendants((s,a)=>{s.type.name===t&&i.push(a)}),i.length===0?!1:(i.sort((s,a)=>a-s),i.forEach(s=>{const a=o.nodeAt(s);a&&e.delete(s,s+a.nodeSize)}),n&&n(e),!0)}}},addPmPlugins(){const t=this.editor;return[new Ue({key:ha,state:{init(){return{decorations:De.empty,highlightColor:"#6366f1",customClass:null}},apply(e,n,r,o){const i=e.getMeta(ha);let s=n.customClass;if(i&&i.type==="updateStyle"&&(s=i.className),e.docChanged&&s==="sd-ai-highlight-pulse"){let c=!1;e.steps.forEach(u=>{u.slice&&u.slice.content.size>0&&(c=!0)}),c&&(s=null)}if(!e.docChanged&&!i)return n;const{decorations:a}=Q_(t,o.doc,n.highlightColor,s)||{},l=De.create(o.doc,a);return{...n,decorations:l,customClass:s}}},props:{decorations(e){return this.getState(e).decorations}}})]}}),Q_=(t,e,n,r=null)=>{const o=[];return e.descendants((i,s)=>{const{marks:a=[]}=i;if(a.find(l=>l.type.name===Qo)){const l={style:`background-color: ${n}33; border-radius: 4px; transition: background-color 250ms ease;`,class:"sd-ai-highlight-element"};r&&(l.class+=` ${r}`);const c=Le.inline(s,s+i.nodeSize,l);o.push(c)}}),{decorations:o}},$x=He.create({name:"doc",topNode:!0,content:"block+",parseDOM(){return[{tag:"doc"}]},renderDOM(){return["doc",0]},addAttributes(){return{attributes:{rendered:!1}}}}),Ox=He.create({name:"text",group:"inline",inline:!0}),eN=He.create({name:"run",group:"inline",content:"text*",inline:!0,parseDOM(){return[{tag:"run"}]},renderDOM(){return["run",0]},addAttributes(){return{attributes:{rendered:!1}}}});function _l(t){return new VD({match:t.match,handler:({state:e,range:n,match:r,chain:o})=>{const i=Ke(t.getAttributes,null,r)||{},s=e.tr.delete(n.from,n.to),a=s.doc.resolve(n.from).blockRange(),l=a&&mv(a,t.type,i);if(!l)return null;if(s.wrap(a,l),t.keepMarks&&t.editor){const{selection:u,storedMarks:d}=e,{splittableMarks:p}=t.editor.extensionService,f=d||u.$to.parentOffset&&u.$from.marks();if(f){const h=f.filter(m=>p.includes(m.type.name));s.ensureMarks(h)}}if(t.keepAttributes){const u=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":t.type.name;o().updateAttributes(u,i).run()}const c=s.doc.resolve(n.from-1).nodeBefore;c&&c.type===t.type&&Pr(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,c))&&s.join(n.from-1)}})}const Uy=/^\s*([-+*])\s$/,Mx=He.create({name:"bulletList",group:"block list",content(){return`${this.options.itemTypeName}+`},addOptions(){return{itemTypeName:"listItem",htmlAttributes:{},keepMarks:!0,keepAttributes:!1}},parseDOM(){return[{tag:"ul"}]},renderDOM({htmlAttributes:t}){return["ul",Te.mergeAttributes(this.options.htmlAttributes,t),0]},addAttributes(){return{"list-style-type":{default:"bullet",rendered:!1},listId:{rendered:!1},attributes:{rendered:!1,keepOnSplit:!0}}},addCommands(){return{toggleBulletList:()=>t=>{const{commands:e,chain:n}=t;return e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}}},addShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=_l({match:Uy,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=_l({match:Uy,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes("textStyle"),editor:this.editor})),[t]}});function tN(t={}){return new Ue({key:new Ge("orderedListSync"),appendTransaction:(e,n,r)=>{if(!(e.some(l=>l.docChanged)&&!n.doc.eq(r.doc)))return;let{doc:o,tr:i}=r,s={};if(o.descendants((l,c)=>{if(l.type.name==="orderedList"&&l.attrs.syncId){let u=l.attrs.syncId;s[u]||(s[u]=[]),s[u].push({node:l,pos:c})}}),!Object.keys(s).length)return;let a=!1;return Object.entries(s).forEach(([l,c])=>{if(c.length<1){let[p]=c;i.setNodeMarkup(p.pos,void 0,{...p.node.attrs,syncId:null}),a=!0;return}let[u]=c,d=u.node.attrs.order;c.forEach((p,f)=>{if(f===0)return;let{node:h,pos:m}=p,y=c[f-1],g=d+y.node.childCount;h.attrs.order!==g&&(i.setNodeMarkup(m,void 0,{...h.attrs,order:g}),a=!0),d=g})}),a?i:null}})}function nN(){return Math.floor(Math.random()*4294967295).toString()}function rN(t){return new Ue({key:new Ge("orderedListMarker"),appendTransaction:(e,n,r)=>{if(!(e.some(l=>l.docChanged)&&!n.doc.eq(r.doc)))return;let{doc:o,tr:i}=r,s=oN(r);if(!s.size)return;let a=!1;return Array.from(s).forEach(([l,c])=>{const u=c[0];let d=c,p=u.node.type.name==="bulletList";u.node.attrs.syncId;let f=u.node.childCount!==d.length;if(p){d.forEach(v=>sN(i,v)),a=!0;return}if(f){let v=iN({state:r,list:u});v.length&&(d=v)}let h=d[0],m=aN({state:r,listItems:d}),y=Dx(),g={lvlText:h.node.attrs.lvlText??y.lvlText,listLevel:h.node.attrs.listLevel??y.listLevel,listNumberingType:h.node.attrs.listNumberingType??y.listNumberingType};g.lvlText===m.lvlText&&g.listNumberingType===m.listNumberingType&&Hy(g.listLevel,m.listLevel)||(i.setNodeMarkup(h.pos,void 0,{...h.node.attrs,...m}),a=!0,g=m),d.forEach((v,k)=>{if(k===0)return;let{node:b,pos:C}=v,{lvlText:D,listLevel:M,listNumberingType:I}=b.attrs;Array.isArray(g.listLevel)||(g.listLevel=JSON.parse(g.listLevel));let E=[...g.listLevel.slice(0,-1),g.listLevel.at(-1)+1];if(!(D===g.lvlText&&I===g.listNumberingType&&Hy(M,E))){let{selection:G,storedMarks:oe}=r,N=oe||G.$to.parentOffset&&G.$from.marks();i.setNodeMarkup(C,void 0,{...b.attrs,listLevel:E,lvlText:g.lvlText,listNumberingType:g.listNumberingType}),N&&i.ensureMarks(N),a=!0}g={...g,listLevel:E}})}),i.setMeta("orderedListMarker",!0),a?i:null}})}function oN(t){let{doc:e}=t,n=new Map;return e.descendants((r,o)=>{let{attrs:i}=r,s=r.type.name==="listItem",a=!!i.listLevel?.length,l=!!i.lvlText,c=i.listNumberingType&&i.listNumberingType!=="bullet";if(s&&a&&l&&c){const u=`${e.resolve(o).parent.attrs.listId}, ${r.attrs.listLevel.slice(0,-1)}`;n.get(u)||n.set(u,[]),n.get(u).push({node:r,pos:o})}}),n}function iN({state:t,list:e}){let{doc:n}=t,r=[];return n.descendants((o,i)=>{let s=o.type.name==="listItem",a=n.resolve(i);s&&a.parent===e&&r.push({node:o,pos:i})}),r}function Dx({lvlText:t="",listLevel:e=[],listNumberingType:n="decimal"}={}){return{lvlText:t,listLevel:e,listNumberingType:n}}function sN(t,e){let{pos:n,node:r}=e;t.setNodeMarkup(n,void 0,{...r.attrs,lvlText:null,listLevel:null,listNumberingType:null})}function Hy(t,e){return t.length===e.length&&t.every((n,r)=>n===e[r])}function aN({state:t,listItems:e}){let{doc:n}=t,r=e[0],{lvlText:o,listLevel:i,listNumberingType:s}=r.node.attrs,a=Dx({lvlText:"%1.",listLevel:[1],listNumberingType:"decimal"}),l=(n.resolve(r.pos).depth-1)/2;if(!(o&&i?.length&&s))({lvlText:o,listLevel:i,listNumberingType:s}=a);else{let c=l>0;c&&l>=3?{lvlText:o,listLevel:i,listNumberingType:s}=a:c&&l<3&&(i=[...i.slice(0,-1),1])}return{lvlText:o,listLevel:i,listNumberingType:s}}const Wy=/^(\d+)\.\s$/,_x=He.create({name:"orderedList",group:"block list",content(){return`${this.options.itemTypeName}+`},addOptions(){return{itemTypeName:"listItem",htmlAttributes:{},keepMarks:!0,keepAttributes:!1,listStyleTypes:["decimal","lowerAlpha","lowerRoman"]}},addAttributes(){return{order:{default:1,parseDOM:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1,renderDOM:t=>({start:t.order})},syncId:{default:null,parseDOM:t=>t.getAttribute("data-sync-id"),renderDOM:t=>t.syncId?{"data-sync-id":t.syncId}:{}},listId:{default:null,parseDOM:t=>t.getAttribute("data-list-id"),renderDOM:t=>t.listId?{"data-list-id":t.listId}:{}},"list-style-type":{default:"decimal",renderDOM:t=>{let e=t["list-style-type"];return e?(e==="lowerLetter"&&(e="lowerAlpha"),{style:`list-style-type: ${AE(e)};`}):{}}},attributes:{rendered:!1,keepOnSplit:!0}}},parseDOM(){return[{tag:"ol"}]},renderDOM({htmlAttributes:t}){const{start:e,...n}=t;return e===1?["ol",Te.mergeAttributes(this.options.htmlAttributes,n),0]:["ol",Te.mergeAttributes(this.options.htmlAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks),getCurrentList:()=>({state:t})=>Kt(e=>e.type.name===this.name)(t.selection),restartListNodes:(t,e)=>({tr:n,state:r})=>{let o=e;return t.map(i=>{const s={node:i,pos:o};return o+=i.nodeSize,s}).forEach(i=>{const{pos:s}=i,a=n.mapping.map(s);n.setNodeMarkup(a,void 0,{})}),!0},updateOrderedListStyleType:()=>({dispatch:t,state:e,tr:n})=>{let r=Kt(o=>o.type.name===this.name)(n.selection);if(!r)return!0;if(t){let o=(r.depth-1)/2,i=this.options.listStyleTypes,s=i[o%i.length],a=r.node.attrs["list-style-type"],l=n.doc.nodeAt(r.pos);a!==s&&l.eq(r.node)&&n.setNodeMarkup(r.pos,void 0,{...r.node.attrs,"list-style-type":s})}return!0},liftEmptyBlockAndContinueListOrder:()=>({editor:t,dispatch:e,state:n,tr:r,commands:o})=>{let i=Kt(d=>d.type.name===this.name)(n.selection);if(!i)return!1;let s=t.can().liftEmptyBlock(),a=i.depth===1,l=i.node.childCount===1,c=n.selection.$from.node(-1),u=i.node.lastChild.eq(c);if(!(s&&a&&!l&&!u))return!1;if(e){let d=i.pos;if(!o.liftEmptyBlock(n,e))return!1;let{$from:p}=r.selection,f=r.doc.nodeAt(d),h=p.after(),m=r.doc.nodeAt(h),y=f?.type.name===this.name,g=m?.type.name===this.name;if(y&&g){let v=f.attrs.order||1,k=f.childCount,b=f.attrs.syncId,C=k+v,D=b||nN();r.setNodeMarkup(h,void 0,{...m.attrs,order:C,syncId:D}),b||r.setNodeMarkup(d,void 0,{...f.attrs,syncId:D})}}return!0}}},addShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList(),Enter:()=>this.editor.commands.liftEmptyBlockAndContinueListOrder()}},addPmPlugins(){return[rN(this.editor),tN()]},addInputRules(){let t=_l({match:Wy,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=_l({match:Wy,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes("textStyle")}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),lN=({listLevel:t,lvlText:e,listNumberingType:n})=>{const r=pN[n];return r?r(t,e):null},cN=(t,e)=>Rf(t,e,String),Nx=(t,e)=>Rf(t,e,hN),uN=(t,e)=>Nx(t,e).toLowerCase(),dN=(t,e)=>Ix(t,e).toLowerCase(),Ix=(t,e)=>Rf(t,e,n=>mN(n)),pN={decimal:cN,lowerRoman:uN,upperRoman:Nx,lowerLetter:dN,upperLetter:Ix},fN=(t,e)=>t.reduce((n,r,o)=>n.replace(`%${o+1}`,r),e),Rf=(t,e,n)=>{const r=t.map(n);return fN(r,e)},hN=t=>{const e=[{value:1e3,numeral:"M"},{value:900,numeral:"CM"},{value:500,numeral:"D"},{value:400,numeral:"CD"},{value:100,numeral:"C"},{value:90,numeral:"XC"},{value:50,numeral:"L"},{value:40,numeral:"XL"},{value:10,numeral:"X"},{value:9,numeral:"IX"},{value:5,numeral:"V"},{value:4,numeral:"IV"},{value:1,numeral:"I"}];let n="";for(const{value:r,numeral:o}of e)for(;t>=r;)n+=o,t-=r;return n},mN=t=>{let e="";const n="ABCDEFGHIJKLMNOPQRSTUVWXYZ";for(;t>0;){let r=(t-1)%26;e=n[r]+e,t=Math.floor((t-1)/26)}return e};function gN(t={}){return new Ue({key:new Ge("styledListMarker"),state:{init(e,n){const r=[...Gy(n),...Ky(n)];return De.create(n.doc,r)},apply(e,n,r,o){if(!e.docChanged||e.getMeta("orderedListMarker"))return n;const i=e.getMeta("splitListItem"),s=[...Gy(o,i),...Ky(o)];return De.create(o.doc,s)}},props:{decorations(e){return this.getState(e)}}})}function Gy(t,e=[]){let{doc:n,storedMarks:r}=t,o=[];Array.isArray(r)&&e.push(...r);let i=yf(n,s=>s.type.name==="listItem");return i.length&&i.forEach(({node:s,pos:a})=>{let l=cr("textStyle",n.type.schema),c=[...e.filter(y=>y.type===l)];if(wN(s)&&e.length){const y=e.filter(g=>g.type===l);c.push(...y)}else{const y=yN(s,n,l);c.push(...y)}let u=null,d=null;c.forEach(y=>{let{attrs:g}=y;if(g.fontSize&&!u){let[v,k]=nr(g.fontSize);Number.isNaN(v)||(k=k??"pt",u=`${v}${k}`)}g.fontFamily&&!d&&(d=g.fontFamily)});let p={style:`--marker-font-size: ${u??"initial"}`},f={style:`--marker-font-family: ${d??"initial"}`},h=Te.mergeAttributes(p,f),m=Le.node(a,a+s.nodeSize,h);o.push(m)}),o}function Ky(t){let{doc:e}=t,n=[],r=yf(e,o=>o.type.name==="listItem");return r.length&&r.forEach(({node:o,pos:i})=>{let s={};if(o.attrs.spacing){const{lineSpaceBefore:l,lineSpaceAfter:c,line:u}=o.attrs.spacing;s={style:`
46
+ ${l?`margin-top: ${l}px;`:""}
47
+ ${c?`margin-bottom: ${c}px;`:""}
48
+ ${u?Zl(u,""):""}
49
+ `.trim()}}let a=Le.node(i,i+o.nodeSize,s);n.push(a)}),n}function yN(t,e,n){let r=[];return t.forEach(o=>{o.type.name==="paragraph"&&o.forEach(i=>{let s=i.type.name==="text",a=n.isInSet(i.marks);if(s&&a){let l=i.marks.filter(c=>c.type===n);r.push(...l)}})}),r}function wN(t){return t.childCount===1&&t.firstChild?.type.name==="paragraph"&&t.firstChild?.content.size===0}const Fx=He.create({name:"listItem",content:"paragraph* block*",defining:!0,priority:101,addOptions(){return{htmlAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},parseDOM(){return[{tag:"li"}]},renderDOM({htmlAttributes:t}){return["li",Te.mergeAttributes(this.options.htmlAttributes,t),0]},addAttributes(){return{markerType:{default:null,renderDOM:t=>{let{listLevel:e,listNumberingType:n,lvlText:r}=t;if(!e?.length||!r)return{};let o=lN({listLevel:e,lvlText:r,listNumberingType:n});return o?{"data-marker-type":o}:{}}},lvlText:{default:null,parseDOM:t=>t.getAttribute("data-lvl-text"),renderDOM:t=>t.lvlText?{"data-lvl-text":t.lvlText}:{}},listNumberingType:{default:null,parseDOM:t=>t.getAttribute("data-num-fmt"),renderDOM:t=>t.listNumberingType?{"data-num-fmt":t.listNumberingType}:{}},listLevel:{default:null,parseDOM:t=>{let e=t.getAttribute("data-list-level");try{e=JSON.parse(e)}catch{}return e},renderDOM:t=>t.listLevel?{"data-list-level":JSON.stringify(t.listLevel)}:{}},lvlJc:{default:null,rendered:!1},listParagraphProperties:{default:null,rendered:!1},listRunProperties:{default:null,rendered:!1},numId:{default:null,parseDOM:t=>t.getAttribute("data-num-id")},attributes:{rendered:!1},importedFontSize:{parseDOM:t=>t.getAttribute("data-font-size"),renderDOM:t=>t.importedFontSize?{"data-font-size":t.importedFontSize}:{}},importedFontFamily:{parseDOM:t=>t.getAttribute("data-font-family"),renderDOM:t=>t.importedFontFamily?{"data-font-family":t.importedFontFamily}:{}},spacing:{default:null,rendered:!1},indent:{default:null,rendered:!1}}},addCommands(){return{getCurrentListNode:()=>({state:t})=>Kt(e=>e.type.name===this.name)(t.selection),increaseListIndent:()=>({commands:t})=>t.sinkListItem(this.name)?(t.updateNodeStyle(),t.updateOrderedListStyleType(),!0):!1,decreaseListIndent:()=>({commands:t})=>{const e=t.getCurrentList();if(e?.depth===1)return!1;if(!t.liftListItem(this.name))return!0;if(!t.updateNodeStyle())return!1;const n=t.getCurrentListNode(),r=e?.node?.children.findIndex(s=>s===n.node),o=n?.pos+n?.node.nodeSize,i=e?.node?.children.slice(r+1)||[];return t.updateOrderedListStyleType(),t.restartListNodes(i,o),!0},updateNodeStyle:()=>({tr:t,state:e})=>{let n=Kt(s=>s.type.name==="orderedList")(t.selection);const r=Kt(s=>s.type.name===this.name)(e.selection);if(!n)return!1;const o=n?.node.children[0]?.attrs,i=t.mapping.map(r.pos);return t.setNodeMarkup(i,void 0,{...o}),!0}}},addShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Enter":()=>this.editor.commands.first(({commands:t})=>[()=>t.createParagraphNear(),()=>t.splitBlock()]),Tab:()=>this.editor.commands.increaseListIndent(),"Shift-Tab":()=>this.editor.commands.decreaseListIndent()}},addPmPlugins(){return[gN()]}}),Ja=new Ge("linkedStyles"),bN=Ye.create({name:"linkedStyles",addPmPlugins(){return[vN(this.editor)]},addCommands(){return{setLinkedStyle:t=>e=>{if(!t)return;const{tr:n}=e,r=n.selection,{from:o,to:i}=r;if(o===i)return;let s=o,a=n.doc.nodeAt(o);if(a.type.name!=="paragraph"){const l=Kt(c=>c.type.name==="paragraph")(n.selection)||{};s=l.pos,a=l.node}n.setNodeMarkup(s,void 0,{...a.attrs,styleId:t.id})}}}}),vN=t=>new Ue({key:Ja,state:{init(e,{doc:n,selection:r}){if(!t.converter||t.options.mode!=="docx")return{};const o=t.converter?.linkedStyles||[];return{styles:o,decorations:Jy(t.state,o)}},apply(e,n,r,o){if(!t.converter||t.options.mode!=="docx")return{...n};let i=n.decorations||De.empty;if(e.docChanged){const s=Ja.getState(t.state).styles;i=Jy(o,s)}return{...n,decorations:i}}},props:{decorations(e){return Ja.getState(e)?.decorations}}}),Jy=(t,e)=>{const n=[];let r=null;const o=t?.doc;return o.descendants((i,s)=>{const{name:a}=i.type;if(i?.attrs?.styleId&&(r=i.attrs.styleId),a==="paragraph"&&!i.attrs?.styleId&&(r=null),a!=="text")return;const l=xN(r,e);if(!l)return;const c=t.doc.resolve(s).parent,u=Rx(l,i,c);if(!u)return;const d=Le.inline(s,s+i.nodeSize,{style:u});n.push(d)}),De.create(o,n)},Rx=(t,e,n,r=!0)=>{if(!t?.definition?.styles)return"";const o={};return Object.entries(t.definition.styles).forEach(([i,s])=>{const a=dl(i),l=[];e?.marks?.forEach(p=>{if(p.type.name==="textStyle"){Object.entries(p.attrs).forEach(([f,h])=>{const m=dl(f);h&&l.push({key:m,value:h})});return}l.push({key:p.type.name,value:p.attrs[a]})});const c=l.find(p=>p.key===a),u=Object.keys(n?.attrs?.indent||{}),d=Object.keys(n?.attrs?.spacing||{});if(!c)if(a==="spacing"&&r&&!d){const p=kN(s);Object.entries(p).forEach(([f,h])=>{o[f]=h})}else if(a==="indent"&&r&&!u){const{leftIndent:p,rightIndent:f,firstLine:h}=s;p&&(o["margin-left"]=p+"px"),f&&(o["margin-right"]=f+"px"),h&&(o["text-indent"]=h+"px")}else a==="bold"?o["font-weight"]="bold":o[a]=s}),Object.entries(o).map(([i,s])=>`${i}: ${s}`).join(";")},xN=(t,e=[])=>e.find(n=>n.id===t),kN=t=>{const{lineSpaceBefore:e,lineSpaceAfter:n,line:r,lineRule:o}=t;return{"margin-top":e+"px","margin-bottom":n+"px",...Zl(r,"",o,!0)}},SN=t=>{const{lineSpaceBefore:e,lineSpaceAfter:n,line:r}=t;return`
50
+ ${e?`margin-top: ${e}px;`:""}
51
+ ${n?`margin-bottom: ${n}px;`:""}
52
+ ${r?Zl(r,""):""}
53
+ `.trim()},AN=t=>{let e="";for(const n of t)switch(n.type){case"bold":e+="font-weight: bold; ";break;case"italic":e+="font-style: italic; ";break;case"underline":e+="text-decoration: underline; ";break;case"highlight":e+=`background-color: ${n.attrs.color}; `;break;case"textStyle":const{fontFamily:r,fontSize:o}=n.attrs;e+=`${r?`font-family: ${r};`:""} ${o?`font-size: ${o};`:""}`}return e.trim()},Bx=t=>t?.converter?(t.converter.linkedStyles||[]).filter(e=>e.type==="paragraph"&&e.definition.attrs).sort((e,n)=>e.definition.attrs?.name.localeCompare(n.definition.attrs?.name)):[],Lx=He.create({name:"paragraph",priority:1e3,group:"block",content:"inline*",inline:!1,addOptions(){return{htmlAttributes:{}}},addAttributes(){return{spacing:{renderDOM:t=>{const{spacing:e}=t;if(!e)return{};const n=SN(e);return n?{style:n}:{}}},extraAttrs:{default:{},parseDOM:t=>{const e={};return Array.from(t.attributes).forEach(n=>{e[n.name]=n.value}),e},renderDOM:t=>t.extraAttrs||{}},marksAttrs:{renderDOM:t=>{const{marksAttrs:e}=t;if(!e?.length)return{};const n=AN(e);return n?{style:n}:{}}},indent:{renderDOM:({indent:t})=>{if(!t)return{};const{left:e,right:n,firstLine:r,hanging:o}=t;let i="";return e&&(i+=`margin-left: ${e}px;`),n&&(i+=`margin-right: ${n}px;`),r&&!o&&(i+=`text-indent: ${r}px;`),r&&o&&(i+=`text-indent: ${r-o}px;`),!r&&o&&(i+=`text-indent: ${-o}px;`),{style:i}}},class:{renderDOM:t=>t.dropcap?{class:"sd-editor-dropcap"}:null},styleId:{},attributes:{rendered:!1},filename:{rendered:!1},rsidRDefault:{rendered:!1},keepLines:{rendered:!1},keepNext:{rendered:!1},paragraphProperties:{rendered:!1},dropcap:{rendered:!1},pageBreakSource:{rendered:!1},justify:{renderDOM:({justify:t})=>{const{val:e}=t||{};if(!e)return{};let n="";return e==="left"?n+="text-align: left;":e==="right"?n+="text-align: right;":e==="center"?n+="text-align: center;":e==="both"&&(n+="text-align: justify;"),{style:n}}}}},parseDOM(){return[{tag:"p",getAttrs:t=>{let e={};return Array.from(t.attributes).forEach(n=>{e[n.name]=n.value}),{extraAttrs:e}}}]},renderDOM({htmlAttributes:t}){return["p",Te.mergeAttributes(this.options.htmlAttributes,t),0]},addPmPlugins(){const{view:t}=this.editor;return[new Ue({name:"dropcapPlugin",key:new Ge("dropcapPlugin"),state:{init(e,n){let r=Xy(n,t);return De.create(n.doc,r)},apply(e,n,r,o){const i=Xy(o,t);return De.create(o.doc,i)}},props:{decorations(e){return this.getState(e)}}})]}}),Xy=(t,e)=>{let n=[];return t.doc.descendants((r,o)=>{if(r.attrs.dropcap?.type==="margin"){const i=CN(e,o);n.push(Le.inline(o,o+r.nodeSize,{style:`margin-left: -${i}px;`}))}}),n};function CN(t,e){const n=t.nodeDOM(e);if(n){const r=document.createRange();return r.selectNodeContents(n),r.getBoundingClientRect().width}return 0}const Px=He.create({name:"heading",group:"block",content:"inline*",defining:!0,addOptions(){return{levels:[1,2,3,4,5,6],htmlAttributes:{}}},addAttributes(){return{level:{default:1,rendered:!1}}},parseDOM(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderDOM({node:t,htmlAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,Te.mergeAttributes(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}},addShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})}}),EN=He.create({name:"commentRangeStart",group:"inline",inline:!0,atom:!0,selectable:!1,draggable:!1,parseDOM(){return[{tag:"commentRangeStart"}]},addOptions(){return{htmlAttributes:{contentEditable:"false"}}},renderDOM({htmlAttributes:t}){return["commentRangeStart",Te.mergeAttributes(this.options.htmlAttributes,t)]},addAttributes(){return{"w:id":{rendered:!1},internal:{default:!0,rendered:!1}}}}),TN=He.create({name:"commentRangeEnd",group:"inline",inline:!0,atom:!0,selectable:!1,draggable:!1,addOptions(){return{htmlAttributes:{contentEditable:"false"}}},parseDOM(){return[{tag:"commentRangeEnd"}]},renderDOM({htmlAttributes:t}){return["commentRangeEnd",Te.mergeAttributes(this.options.htmlAttributes,t)]},addAttributes(){return{"w:id":{rendered:!1}}}}),$N=He.create({name:"commentReference",group:"inline",inline:!0,atom:!0,selectable:!1,draggable:!1,addOptions(){return{htmlAttributes:{contentEditable:"false"}}},parseDOM(){return[{tag:"commentReference"}]},renderDOM({htmlAttributes:t}){return["commentReference",Te.mergeAttributes(this.options.htmlAttributes,t)]},addAttributes(){return{attributes:{rendered:!1}}}}),ON=tn.create({name:an,group:"comments",excludes:"",addOptions(){return{htmlAttributes:{class:"sd-editor-comment"}}},addAttributes(){return{commentId:{},importedId:{},internal:{default:!0,rendered:!1}}},parseDOM(){return[{tag:an}]},renderDOM({htmlAttributes:t}){return[an,Te.mergeAttributes(this.options.htmlAttributes,t)]}}),MN=He.create({name:"tab",group:"inline",inline:!0,content:"inline*",selectable:!1,atom:!0,addOptions(){return{htmlAttributes:{class:"sd-editor-tab",contentEditable:!1}}},parseDOM(){return[{tag:"span.sd-editor-tab"}]},renderDOM({htmlAttributes:t}){return["span",Te.mergeAttributes(this.options.htmlAttributes,t),0]},addAttributes(){return{tabSize:{renderDOM:({tabSize:t})=>t?{style:`width: ${t}px; min-width: ${t}px;`}:{}}}},addPmPlugins(){const{view:t}=this.editor;return[new Ue({name:"tabPlugin",key:new Ge("tabPlugin"),state:{init(e,n){let r=Yy(n,t);return De.create(n.doc,r)},apply(e,n,r,o){const i=Yy(o,t);return De.create(o.doc,i)}},props:{decorations(e){return this.getState(e)}}})]}}),Wu=48,Yy=(t,e)=>{let n=[];return t.doc.descendants((r,o)=>{if(r.type.name==="tab"){let i=t.doc.resolve(o);const s=i.nodeBefore?.nodeSize||0;let a=0;try{t.doc.nodesBetween(o-s-1,o-1,(u,d)=>{if(u.isText&&u.textContent!==" "){const p=DN(e,d);a+=p}})}catch{return}const l=i.nodeBefore?.type.name==="tab"?Wu:Wu-a%Wu,c=_N(i);n.push(Le.node(o,o+r.nodeSize,{style:`width: ${l}px; height: ${c};`}))}}),n};function DN(t,e){const n=t.nodeDOM(e);if(n){const r=document.createRange();return r.selectNodeContents(n),r.getBoundingClientRect().width}return 0}function _N(t){const e=t.node(1).firstChild.marks.find(n=>n.type.name==="textStyle");return`${(parseInt(e?.attrs.fontSize)*1.333||16)*1.1}px`}const NN=He.create({name:"lineBreak",group:"inline",inline:!0,marks:"",defining:!0,selectable:!1,content:"",atom:!0,parseDOM(){return[{tag:"br"}]},renderDOM(){return["br",{}]}}),IN=He.create({name:"hardBreak",group:"inline",inline:!0,selectable:!1,atom:!0,addOptions(){return{htmlAttributes:{contentEditable:"false",lineBreakType:"page"}}},addAttributes(){return{pageBreakSource:{rendered:!1,default:null},pageBreakType:{default:null,rendered:!1}}},parseDOM(){return[{tag:"span"}]},renderDOM({htmlAttributes:t}){return["span",Te.mergeAttributes(this.options.htmlAttributes,t)]}}),FN=({editor:t})=>class{constructor(e,n){Re(this,"editor"),Re(this,"node"),Re(this,"dom"),Re(this,"table"),Re(this,"colgroup"),Re(this,"contentDOM"),Re(this,"cellMinWidth"),this.editor=t,this.node=e,this.cellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),Qy(this.editor,this.node,this.table),Zy(e,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody")),setTimeout(()=>{ew(this.dom,this.table)},0)}update(e){return e.type!==this.node.type?!1:(this.node=e,Qy(this.editor,e,this.table),Zy(e,this.colgroup,this.table,this.cellMinWidth),ew(this.dom,this.table),!0)}ignoreMutation(e){const n=this.dom;return e.target===n&&e.type==="attributes"&&e.attributeName==="style"?!0:e.type==="attributes"&&(e.target===this.table||this.colgroup.contains(e.target))}};function Zy(t,e,n,r,o,i){let s=0,a=!0,l=e.firstChild;const c=t.firstChild;if(c!==null)for(let u=0,d=0;u<c.childCount;u++){const{colspan:p,colwidth:f}=c.child(u).attrs;for(let h=0;h<p;h++,d++){const m=o===d?i:f&&f[h],y=m?`${m}px`:"";if(s+=m||r,m||(a=!1),l){if(l.style.width!==y){const[g,v]=Fd(r,m);l.style.setProperty(g,v)}l=l.nextSibling}else{const g=document.createElement("col"),[v,k]=Fd(r,m);g.style.setProperty(v,k),e.appendChild(g)}}}for(;l;){const u=l.nextSibling;l.parentNode?.removeChild(l),l=u}a?(n.style.width=`${s}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${s}px`)}function Qy(t,e,n){const r=t.extensionService.attributes.filter(i=>i.type==="table"),o=Te.getAttributesToRender(e,r);Object.entries(o).forEach(([i,s])=>{n.setAttribute(i,s)})}function ew(t,e){let n=1,r;if(!e)return;let o=parseFloat(e.style.borderLeftWidth||0),i=parseFloat(e.style.borderRightWidth)||0,s=[...e.querySelectorAll(":scope > tbody > tr > td:first-child")],a=[...e.querySelectorAll(":scope > tbody > tr > td:last-child")];for(let l of s){let c=parseFloat(l.style.borderLeftWidth)||0;o=Math.max(o,c)}for(let l of a){let c=parseFloat(l.style.borderRightWidth)||0;i=Math.max(i,c)}r=Math.ceil(Math.max(o,i)),t.style.setProperty("--table-border-width",`${r||n}px`)}const tw=(t,e=null)=>e?t.createChecked(null,e):t.createAndFill(),zx=({size:t=.66665,color:e="#000000"}={})=>({top:{size:t,color:e},left:{size:t,color:e},bottom:{size:t,color:e},right:{size:t,color:e},insideH:{size:t,color:e},insideV:{size:t,color:e}}),RN=(t,e,n,r,o=null)=>{const i={table:pt("table",t),tableRow:pt("tableRow",t),tableCell:pt("tableCell",t),tableHeader:pt("tableHeader",t)},s=[],a=[];for(let u=0;u<n;u++){const d=tw(i.tableCell,o);if(d&&a.push(d),r){const p=tw(i.tableHeader,o);p&&s.push(p)}}const l=[];for(let u=0;u<e;u++){const d=r&&u===0?s:a;l.push(i.tableRow.createChecked(null,d))}const c=zx();return i.table.createChecked({borders:c},l)};var fp,hp;if(typeof WeakMap<"u"){let t=new WeakMap;fp=e=>t.get(e),hp=(e,n)=>(t.set(e,n),n)}else{const t=[];let e=0;fp=n=>{for(let r=0;r<t.length;r+=2)if(t[r]==n)return t[r+1]},hp=(n,r)=>(e==10&&(e=0),t[e++]=n,t[e++]=r)}var lt=class{constructor(e,n,r,o){this.width=e,this.height=n,this.map=r,this.problems=o}findCell(e){for(let n=0;n<this.map.length;n++){const r=this.map[n];if(r!=e)continue;const o=n%this.width,i=n/this.width|0;let s=o+1,a=i+1;for(let l=1;s<this.width&&this.map[n+l]==r;l++)s++;for(let l=1;a<this.height&&this.map[n+this.width*l]==r;l++)a++;return{left:o,top:i,right:s,bottom:a}}throw new RangeError(`No cell with offset ${e} found`)}colCount(e){for(let n=0;n<this.map.length;n++)if(this.map[n]==e)return n%this.width;throw new RangeError(`No cell with offset ${e} found`)}nextCell(e,n,r){const{left:o,right:i,top:s,bottom:a}=this.findCell(e);return n=="horiz"?(r<0?o==0:i==this.width)?null:this.map[s*this.width+(r<0?o-1:i)]:(r<0?s==0:a==this.height)?null:this.map[o+this.width*(r<0?s-1:a)]}rectBetween(e,n){const{left:r,right:o,top:i,bottom:s}=this.findCell(e),{left:a,right:l,top:c,bottom:u}=this.findCell(n);return{left:Math.min(r,a),top:Math.min(i,c),right:Math.max(o,l),bottom:Math.max(s,u)}}cellsInRect(e){const n=[],r={};for(let o=e.top;o<e.bottom;o++)for(let i=e.left;i<e.right;i++){const s=o*this.width+i,a=this.map[s];r[a]||(r[a]=!0,!(i==e.left&&i&&this.map[s-1]==a||o==e.top&&o&&this.map[s-this.width]==a)&&n.push(a))}return n}positionAt(e,n,r){for(let o=0,i=0;;o++){const s=i+r.child(o).nodeSize;if(o==e){let a=n+e*this.width;const l=(e+1)*this.width;for(;a<l&&this.map[a]<i;)a++;return a==l?s-1:this.map[a]}i=s}}static get(e){return fp(e)||hp(e,BN(e))}};function BN(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);const e=LN(t),n=t.childCount,r=[];let o=0,i=null;const s=[];for(let c=0,u=e*n;c<u;c++)r[c]=0;for(let c=0,u=0;c<n;c++){const d=t.child(c);u++;for(let h=0;;h++){for(;o<r.length&&r[o]!=0;)o++;if(h==d.childCount)break;const m=d.child(h),{colspan:y,rowspan:g,colwidth:v}=m.attrs;for(let k=0;k<g;k++){if(k+c>=n){(i||(i=[])).push({type:"overlong_rowspan",pos:u,n:g-k});break}const b=o+k*e;for(let C=0;C<y;C++){r[b+C]==0?r[b+C]=u:(i||(i=[])).push({type:"collision",row:c,pos:u,n:y-C});const D=v&&v[C];if(D){const M=(b+C)%e*2,I=s[M];I==null||I!=D&&s[M+1]==1?(s[M]=D,s[M+1]=1):I==D&&s[M+1]++}}}o+=y,u+=m.nodeSize}const p=(c+1)*e;let f=0;for(;o<p;)r[o++]==0&&f++;f&&(i||(i=[])).push({type:"missing",row:c,n:f}),u++}(e===0||n===0)&&(i||(i=[])).push({type:"zero_sized"});const a=new lt(e,n,r,i);let l=!1;for(let c=0;!l&&c<s.length;c+=2)s[c]!=null&&s[c+1]<n&&(l=!0);return l&&PN(a,s,t),a}function LN(t){let e=-1,n=!1;for(let r=0;r<t.childCount;r++){const o=t.child(r);let i=0;if(n)for(let s=0;s<r;s++){const a=t.child(s);for(let l=0;l<a.childCount;l++){const c=a.child(l);s+c.attrs.rowspan>r&&(i+=c.attrs.colspan)}}for(let s=0;s<o.childCount;s++){const a=o.child(s);i+=a.attrs.colspan,a.attrs.rowspan>1&&(n=!0)}e==-1?e=i:e!=i&&(e=Math.max(e,i))}return e}function PN(t,e,n){t.problems||(t.problems=[]);const r={};for(let o=0;o<t.map.length;o++){const i=t.map[o];if(r[i])continue;r[i]=!0;const s=n.nodeAt(i);if(!s)throw new RangeError(`No cell with offset ${i} found`);let a=null;const l=s.attrs;for(let c=0;c<l.colspan;c++){const u=(o+c)%t.width,d=e[u*2];d!=null&&(!l.colwidth||l.colwidth[c]!=d)&&((a||(a=zN(l)))[c]=d)}a&&t.problems.unshift({type:"colwidth mismatch",pos:i,colwidth:a})}}function zN(t){if(t.colwidth)return t.colwidth.slice();const e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}function Ft(t){let e=t.cached.tableNodeTypes;if(!e){e=t.cached.tableNodeTypes={};for(const n in t.nodes){const r=t.nodes[n],o=r.spec.tableRole;o&&(e[o]=r)}}return e}var Sr=new Ge("selectingCells");function Si(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 jN(t){for(let e=t.depth;e>0;e--){const n=t.node(e).type.spec.tableRole;if(n==="cell"||n==="header_cell")return t.node(e)}return null}function kn(t){const e=t.selection.$head;for(let n=e.depth;n>0;n--)if(e.node(n).type.spec.tableRole=="row")return!0;return!1}function cc(t){const e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const n=Si(e.$head)||qN(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function qN(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n-e.nodeSize)}}function mp(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function VN(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function Bf(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function jx(t,e,n){const r=t.node(-1),o=lt.get(r),i=t.start(-1),s=o.nextCell(t.pos-i,e,n);return s==null?null:t.node(0).resolve(i+s)}function wo(t,e,n=1){const r={...t,colspan:t.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some(o=>o>0)||(r.colwidth=null)),r}function qx(t,e,n=1){const r={...t,colspan:t.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let o=0;o<n;o++)r.colwidth.splice(e,0,0)}return r}function UN(t,e,n){const r=Ft(e.type.schema).header_cell;for(let o=0;o<t.height;o++)if(e.nodeAt(t.map[n+o*t.width]).type!=r)return!1;return!0}var et=class Gn extends je{constructor(e,n=e){const r=e.node(-1),o=lt.get(r),i=e.start(-1),s=o.rectBetween(e.pos-i,n.pos-i),a=e.node(0),l=o.cellsInRect(s).filter(u=>u!=n.pos-i);l.unshift(n.pos-i);const c=l.map(u=>{const d=r.nodeAt(u);if(!d)throw RangeError(`No cell with offset ${u} found`);const p=i+u+1;return new $v(a.resolve(p),a.resolve(p+d.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=n}map(e,n){const r=e.resolve(n.map(this.$anchorCell.pos)),o=e.resolve(n.map(this.$headCell.pos));if(mp(r)&&mp(o)&&Bf(r,o)){const i=this.$anchorCell.node(-1)!=r.node(-1);return i&&this.isRowSelection()?Gn.rowSelection(r,o):i&&this.isColSelection()?Gn.colSelection(r,o):new Gn(r,o)}return Pe.between(r,o)}content(){const e=this.$anchorCell.node(-1),n=lt.get(e),r=this.$anchorCell.start(-1),o=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),i={},s=[];for(let l=o.top;l<o.bottom;l++){const c=[];for(let u=l*n.width+o.left,d=o.left;d<o.right;d++,u++){const p=n.map[u];if(i[p])continue;i[p]=!0;const f=n.findCell(p);let h=e.nodeAt(p);if(!h)throw RangeError(`No cell with offset ${p} found`);const m=o.left-f.left,y=f.right-o.right;if(m>0||y>0){let g=h.attrs;if(m>0&&(g=wo(g,0,m)),y>0&&(g=wo(g,g.colspan-y,y)),f.left<o.left){if(h=h.type.createAndFill(g),!h)throw RangeError(`Could not create cell with attrs ${JSON.stringify(g)}`)}else h=h.type.create(g,h.content)}if(f.top<o.top||f.bottom>o.bottom){const g={...h.attrs,rowspan:Math.min(f.bottom,o.bottom)-Math.max(f.top,o.top)};f.top<o.top?h=h.type.createAndFill(g):h=h.type.create(g,h.content)}c.push(h)}s.push(e.child(l).copy(ye.from(c)))}const a=this.isColSelection()&&this.isRowSelection()?e:s;return new ve(ye.from(a),1,1)}replace(e,n=ve.empty){const r=e.steps.length,o=this.ranges;for(let s=0;s<o.length;s++){const{$from:a,$to:l}=o[s],c=e.mapping.slice(r);e.replace(c.map(a.pos),c.map(l.pos),s?ve.empty:n)}const i=je.findFrom(e.doc.resolve(e.mapping.slice(r).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,n){this.replace(e,new ve(ye.from(n),0,0))}forEachCell(e){const n=this.$anchorCell.node(-1),r=lt.get(n),o=this.$anchorCell.start(-1),i=r.cellsInRect(r.rectBetween(this.$anchorCell.pos-o,this.$headCell.pos-o));for(let s=0;s<i.length;s++)e(n.nodeAt(i[s]),o+i[s])}isColSelection(){const e=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(e,n)>0)return!1;const r=e+this.$anchorCell.nodeAfter.attrs.rowspan,o=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,o)==this.$headCell.node(-1).childCount}static colSelection(e,n=e){const r=e.node(-1),o=lt.get(r),i=e.start(-1),s=o.findCell(e.pos-i),a=o.findCell(n.pos-i),l=e.node(0);return s.top<=a.top?(s.top>0&&(e=l.resolve(i+o.map[s.left])),a.bottom<o.height&&(n=l.resolve(i+o.map[o.width*(o.height-1)+a.right-1]))):(a.top>0&&(n=l.resolve(i+o.map[a.left])),s.bottom<o.height&&(e=l.resolve(i+o.map[o.width*(o.height-1)+s.right-1]))),new Gn(e,n)}isRowSelection(){const e=this.$anchorCell.node(-1),n=lt.get(e),r=this.$anchorCell.start(-1),o=n.colCount(this.$anchorCell.pos-r),i=n.colCount(this.$headCell.pos-r);if(Math.min(o,i)>0)return!1;const s=o+this.$anchorCell.nodeAfter.attrs.colspan,a=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(s,a)==n.width}eq(e){return e instanceof Gn&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){const r=e.node(-1),o=lt.get(r),i=e.start(-1),s=o.findCell(e.pos-i),a=o.findCell(n.pos-i),l=e.node(0);return s.left<=a.left?(s.left>0&&(e=l.resolve(i+o.map[s.top*o.width])),a.right<o.width&&(n=l.resolve(i+o.map[o.width*(a.top+1)-1]))):(a.left>0&&(n=l.resolve(i+o.map[a.top*o.width])),s.right<o.width&&(e=l.resolve(i+o.map[o.width*(s.top+1)-1]))),new Gn(e,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,n){return new Gn(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){return new Gn(e.resolve(n),e.resolve(r))}getBookmark(){return new HN(this.$anchorCell.pos,this.$headCell.pos)}};et.prototype.visible=!1;je.jsonID("cell",et);var HN=class Vx{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Vx(e.map(this.anchor),e.map(this.head))}resolve(e){const n=e.resolve(this.anchor),r=e.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&r.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&r.index()<r.parent.childCount&&Bf(n,r)?new et(n,r):je.near(r,1)}};function WN(t){if(!(t.selection instanceof et))return null;const e=[];return t.selection.forEachCell((n,r)=>{e.push(Le.node(r,r+n.nodeSize,{class:"selectedCell"}))}),De.create(t.doc,e)}function GN({$from:t,$to:e}){if(t.pos==e.pos||t.pos<e.pos-6)return!1;let n=t.pos,r=e.pos,o=t.depth;for(;o>=0&&!(t.after(o+1)<t.end(o));o--,n++);for(let i=e.depth;i>=0&&!(e.before(i+1)>e.start(i));i--,r--);return n==r&&/row|table/.test(t.node(o).type.spec.tableRole)}function KN({$from:t,$to:e}){let n,r;for(let o=t.depth;o>0;o--){const i=t.node(o);if(i.type.spec.tableRole==="cell"||i.type.spec.tableRole==="header_cell"){n=i;break}}for(let o=e.depth;o>0;o--){const i=e.node(o);if(i.type.spec.tableRole==="cell"||i.type.spec.tableRole==="header_cell"){r=i;break}}return n!==r&&e.parentOffset===0}function JN(t,e,n){const r=(e||t).selection,o=(e||t).doc;let i,s;if(r instanceof _e&&(s=r.node.type.spec.tableRole)){if(s=="cell"||s=="header_cell")i=et.create(o,r.from);else if(s=="row"){const a=o.resolve(r.from+1);i=et.rowSelection(a,a)}else if(!n){const a=lt.get(r.node),l=r.from+1,c=l+a.map[a.width*a.height-1];i=et.create(o,l+1,c)}}else r instanceof Pe&&GN(r)?i=Pe.create(o,r.from):r instanceof Pe&&KN(r)&&(i=Pe.create(o,r.$from.start(),r.$from.end()));return i&&(e||(e=t.tr)).setSelection(i),e}var XN=new Ge("fix-tables");function Ux(t,e,n,r){const o=t.childCount,i=e.childCount;e:for(let s=0,a=0;s<i;s++){const l=e.child(s);for(let c=a,u=Math.min(o,s+3);c<u;c++)if(t.child(c)==l){a=c+1,n+=l.nodeSize;continue e}r(l,n),a<o&&t.child(a).sameMarkup(l)?Ux(t.child(a),l,n+1,r):l.nodesBetween(0,l.content.size,r,n+1),n+=l.nodeSize}}function Hx(t,e){let n;const r=(o,i)=>{o.type.spec.tableRole=="table"&&(n=YN(t,o,i,n))};return e?e.doc!=t.doc&&Ux(e.doc,t.doc,0,r):t.doc.descendants(r),n}function YN(t,e,n,r){const o=lt.get(e);if(!o.problems)return r;r||(r=t.tr);const i=[];for(let l=0;l<o.height;l++)i.push(0);for(let l=0;l<o.problems.length;l++){const c=o.problems[l];if(c.type=="collision"){const u=e.nodeAt(c.pos);if(!u)continue;const d=u.attrs;for(let p=0;p<d.rowspan;p++)i[c.row+p]+=c.n;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,wo(d,d.colspan-c.n,c.n))}else if(c.type=="missing")i[c.row]+=c.n;else if(c.type=="overlong_rowspan"){const u=e.nodeAt(c.pos);if(!u)continue;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,{...u.attrs,rowspan:u.attrs.rowspan-c.n})}else if(c.type=="colwidth mismatch"){const u=e.nodeAt(c.pos);if(!u)continue;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,{...u.attrs,colwidth:c.colwidth})}else if(c.type=="zero_sized"){const u=r.mapping.map(n);r.delete(u,u+e.nodeSize)}}let s,a;for(let l=0;l<i.length;l++)i[l]&&(s==null&&(s=l),a=l);for(let l=0,c=n+1;l<o.height;l++){const u=e.child(l),d=c+u.nodeSize,p=i[l];if(p>0){let f="cell";u.firstChild&&(f=u.firstChild.type.spec.tableRole);const h=[];for(let y=0;y<p;y++){const g=Ft(t.schema)[f].createAndFill();g&&h.push(g)}const m=(l==0||s==l-1)&&a==l?c+1:d-1;r.insert(r.mapping.map(m),h)}c=d}return r.setMeta(XN,{fixTables:!0})}function zn(t){const e=t.selection,n=cc(t),r=n.node(-1),o=n.start(-1),i=lt.get(r);return{...e instanceof et?i.rectBetween(e.$anchorCell.pos-o,e.$headCell.pos-o):i.findCell(n.pos-o),tableStart:o,map:i,table:r}}function Wx(t,{map:e,tableStart:n,table:r},o){let i=o>0?-1:0;UN(e,r,o+i)&&(i=o==0||o==e.width?null:0);for(let s=0;s<e.height;s++){const a=s*e.width+o;if(o>0&&o<e.width&&e.map[a-1]==e.map[a]){const l=e.map[a],c=r.nodeAt(l);t.setNodeMarkup(t.mapping.map(n+l),null,qx(c.attrs,o-e.colCount(l))),s+=c.attrs.rowspan-1}else{const l=i==null?Ft(r.type.schema).cell:r.nodeAt(e.map[a+i]).type,c=e.positionAt(s,o,r);t.insert(t.mapping.map(n+c),l.createAndFill())}}return t}function ZN(t,e){if(!kn(t))return!1;if(e){const n=zn(t);e(Wx(t.tr,n,n.left))}return!0}function QN(t,e){if(!kn(t))return!1;if(e){const n=zn(t);e(Wx(t.tr,n,n.right))}return!0}function e8(t,{map:e,table:n,tableStart:r},o){const i=t.mapping.maps.length;for(let s=0;s<e.height;){const a=s*e.width+o,l=e.map[a],c=n.nodeAt(l),u=c.attrs;if(o>0&&e.map[a-1]==l||o<e.width-1&&e.map[a+1]==l)t.setNodeMarkup(t.mapping.slice(i).map(r+l),null,wo(u,o-e.colCount(l)));else{const d=t.mapping.slice(i).map(r+l);t.delete(d,d+c.nodeSize)}s+=u.rowspan}}function t8(t,e){if(!kn(t))return!1;if(e){const n=zn(t),r=t.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let o=n.right-1;e8(r,n,o),o!=n.left;o--){const i=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!i)throw RangeError("No table found");n.table=i,n.map=lt.get(i)}e(r)}return!0}function n8(t,e,n){var r;const o=Ft(e.type.schema).header_cell;for(let i=0;i<t.width;i++)if(((r=e.nodeAt(t.map[i+n*t.width]))==null?void 0:r.type)!=o)return!1;return!0}function Gx(t,{map:e,tableStart:n,table:r},o){var i;let s=n;for(let c=0;c<o;c++)s+=r.child(c).nodeSize;const a=[];let l=o>0?-1:0;n8(e,r,o+l)&&(l=o==0||o==e.height?null:0);for(let c=0,u=e.width*o;c<e.width;c++,u++)if(o>0&&o<e.height&&e.map[u]==e.map[u-e.width]){const d=e.map[u],p=r.nodeAt(d).attrs;t.setNodeMarkup(n+d,null,{...p,rowspan:p.rowspan+1}),c+=p.colspan-1}else{const d=l==null?Ft(r.type.schema).cell:(i=r.nodeAt(e.map[u+l*e.width]))==null?void 0:i.type,p=d?.createAndFill();p&&a.push(p)}return t.insert(s,Ft(r.type.schema).row.create(null,a)),t}function r8(t,e){if(!kn(t))return!1;if(e){const n=zn(t);e(Gx(t.tr,n,n.top))}return!0}function o8(t,e){if(!kn(t))return!1;if(e){const n=zn(t);e(Gx(t.tr,n,n.bottom))}return!0}function i8(t,{map:e,table:n,tableStart:r},o){let i=0;for(let c=0;c<o;c++)i+=n.child(c).nodeSize;const s=i+n.child(o).nodeSize,a=t.mapping.maps.length;t.delete(i+r,s+r);const l=new Set;for(let c=0,u=o*e.width;c<e.width;c++,u++){const d=e.map[u];if(!l.has(d)){if(l.add(d),o>0&&d==e.map[u-e.width]){const p=n.nodeAt(d).attrs;t.setNodeMarkup(t.mapping.slice(a).map(d+r),null,{...p,rowspan:p.rowspan-1}),c+=p.colspan-1}else if(o<e.height&&d==e.map[u+e.width]){const p=n.nodeAt(d),f=p.attrs,h=p.type.create({...f,rowspan:p.attrs.rowspan-1},p.content),m=e.positionAt(o+1,c,n);t.insert(t.mapping.slice(a).map(r+m),h),c+=f.colspan-1}}}}function s8(t,e){if(!kn(t))return!1;if(e){const n=zn(t),r=t.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let o=n.bottom-1;i8(r,n,o),o!=n.top;o--){const i=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!i)throw RangeError("No table found");n.table=i,n.map=lt.get(n.table)}e(r)}return!0}function nw(t){const e=t.content;return e.childCount==1&&e.child(0).isTextblock&&e.child(0).childCount==0}function a8({width:t,height:e,map:n},r){let o=r.top*t+r.left,i=o,s=(r.bottom-1)*t+r.left,a=o+(r.right-r.left-1);for(let l=r.top;l<r.bottom;l++){if(r.left>0&&n[i]==n[i-1]||r.right<t&&n[a]==n[a+1])return!0;i+=t,a+=t}for(let l=r.left;l<r.right;l++){if(r.top>0&&n[o]==n[o-t]||r.bottom<e&&n[s]==n[s+t])return!0;o++,s++}return!1}function rw(t,e){const n=t.selection;if(!(n instanceof et)||n.$anchorCell.pos==n.$headCell.pos)return!1;const r=zn(t),{map:o}=r;if(a8(o,r))return!1;if(e){const i=t.tr,s={};let a=ye.empty,l,c;for(let u=r.top;u<r.bottom;u++)for(let d=r.left;d<r.right;d++){const p=o.map[u*o.width+d],f=r.table.nodeAt(p);if(!(s[p]||!f))if(s[p]=!0,l==null)l=p,c=f;else{nw(f)||(a=a.append(f.content));const h=i.mapping.map(p+r.tableStart);i.delete(h,h+f.nodeSize)}}if(l==null||c==null)return!0;if(i.setNodeMarkup(l+r.tableStart,null,{...qx(c.attrs,c.attrs.colspan,r.right-r.left-c.attrs.colspan),rowspan:r.bottom-r.top}),a.size){const u=l+1+c.content.size,d=nw(c)?l+1:u;i.replaceWith(d+r.tableStart,u+r.tableStart,a)}i.setSelection(new et(i.doc.resolve(l+r.tableStart))),e(i)}return!0}function ow(t,e){const n=Ft(t.schema);return l8(({node:r})=>n[r.type.spec.tableRole])(t,e)}function l8(t){return(e,n)=>{var r;const o=e.selection;let i,s;if(o instanceof et){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;i=o.$anchorCell.nodeAfter,s=o.$anchorCell.pos}else{if(i=jN(o.$from),!i)return!1;s=(r=Si(o.$from))==null?void 0:r.pos}if(i==null||s==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let a=i.attrs;const l=[],c=a.colwidth;a.rowspan>1&&(a={...a,rowspan:1}),a.colspan>1&&(a={...a,colspan:1});const u=zn(e),d=e.tr;for(let f=0;f<u.right-u.left;f++)l.push(c?{...a,colwidth:c&&c[f]?[c[f]]:null}:a);let p;for(let f=u.top;f<u.bottom;f++){let h=u.map.positionAt(f,u.left,u.table);f==u.top&&(h+=i.nodeSize);for(let m=u.left,y=0;m<u.right;m++,y++)m==u.left&&f==u.top||d.insert(p=d.mapping.map(h+u.tableStart,1),t({node:i,row:f,col:m}).createAndFill(l[y]))}d.setNodeMarkup(s,t({node:i,row:u.top,col:u.left}),l[0]),o instanceof et&&d.setSelection(new et(d.doc.resolve(o.$anchorCell.pos),p?d.doc.resolve(p):void 0)),n(d)}return!0}}function c8(t,e){return function(n,r){if(!kn(n))return!1;const o=cc(n);if(o.nodeAfter.attrs[t]===e)return!1;if(r){const i=n.tr;n.selection instanceof et?n.selection.forEachCell((s,a)=>{s.attrs[t]!==e&&i.setNodeMarkup(a,null,{...s.attrs,[t]:e})}):i.setNodeMarkup(o.pos,null,{...o.nodeAfter.attrs,[t]:e}),r(i)}return!0}}function u8(t){return function(e,n){if(!kn(e))return!1;if(n){const r=Ft(e.schema),o=zn(e),i=e.tr,s=o.map.cellsInRect(t=="column"?{left:o.left,top:0,right:o.right,bottom:o.map.height}:t=="row"?{left:0,top:o.top,right:o.map.width,bottom:o.bottom}:o),a=s.map(l=>o.table.nodeAt(l));for(let l=0;l<s.length;l++)a[l].type==r.header_cell&&i.setNodeMarkup(o.tableStart+s[l],r.cell,a[l].attrs);if(i.steps.length==0)for(let l=0;l<s.length;l++)i.setNodeMarkup(o.tableStart+s[l],r.header_cell,a[l].attrs);n(i)}return!0}}function iw(t,e,n){const r=e.map.cellsInRect({left:0,top:0,right:t=="row"?e.map.width:1,bottom:t=="column"?e.map.height:1});for(let o=0;o<r.length;o++){const i=e.table.nodeAt(r[o]);if(i&&i.type!==n.header_cell)return!1}return!0}function Os(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?u8(t):function(n,r){if(!kn(n))return!1;if(r){const o=Ft(n.schema),i=zn(n),s=n.tr,a=iw("row",i,o),l=iw("column",i,o),c=(t==="column"?a:t==="row"&&l)?1:0,u=t=="column"?{left:0,top:c,right:1,bottom:i.map.height}:t=="row"?{left:c,top:0,right:i.map.width,bottom:1}:i,d=t=="column"?l?o.cell:o.header_cell:t=="row"?a?o.cell:o.header_cell:o.cell;i.map.cellsInRect(u).forEach(p=>{const f=p+i.tableStart,h=s.doc.nodeAt(f);h&&s.setNodeMarkup(f,d,h.attrs)}),r(s)}return!0}}Os("row",{useDeprecatedLogic:!0});Os("column",{useDeprecatedLogic:!0});var d8=Os("cell",{useDeprecatedLogic:!0});function p8(t,e){if(e<0){const n=t.nodeBefore;if(n)return t.pos-n.nodeSize;for(let r=t.index(-1)-1,o=t.before();r>=0;r--){const i=t.node(-1).child(r),s=i.lastChild;if(s)return o-1-s.nodeSize;o-=i.nodeSize}}else{if(t.index()<t.parent.childCount-1)return t.pos+t.nodeAfter.nodeSize;const n=t.node(-1);for(let r=t.indexAfter(-1),o=t.after();r<n.childCount;r++){const i=n.child(r);if(i.childCount)return o+1;o+=i.nodeSize}}return null}function sw(t){return function(e,n){if(!kn(e))return!1;const r=p8(cc(e),t);if(r==null)return!1;if(n){const o=e.doc.resolve(r);n(e.tr.setSelection(Pe.between(o,VN(o))).scrollIntoView())}return!0}}function f8(t,e){const n=t.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole=="table")return e&&e(t.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function ma(t,e){const n=t.selection;if(!(n instanceof et))return!1;if(e){const r=t.tr,o=Ft(t.schema).cell.createAndFill().content;n.forEachCell((i,s)=>{i.content.eq(o)||r.replace(r.mapping.map(s+1),r.mapping.map(s+i.nodeSize-1),new ve(o,0,0))}),r.docChanged&&e(r)}return!0}function h8(t){if(!t.size)return null;let{content:e,openStart:n,openEnd:r}=t;for(;e.childCount==1&&(n>0&&r>0||e.child(0).type.spec.tableRole=="table");)n--,r--,e=e.child(0).content;const o=e.child(0),i=o.type.spec.tableRole,s=o.type.schema,a=[];if(i=="row")for(let l=0;l<e.childCount;l++){let c=e.child(l).content;const u=l?0:Math.max(0,n-1),d=l<e.childCount-1?0:Math.max(0,r-1);(u||d)&&(c=gp(Ft(s).row,new ve(c,u,d)).content),a.push(c)}else if(i=="cell"||i=="header_cell")a.push(n||r?gp(Ft(s).row,new ve(e,n,r)).content:e);else return null;return m8(s,a)}function m8(t,e){const n=[];for(let o=0;o<e.length;o++){const i=e[o];for(let s=i.childCount-1;s>=0;s--){const{rowspan:a,colspan:l}=i.child(s).attrs;for(let c=o;c<o+a;c++)n[c]=(n[c]||0)+l}}let r=0;for(let o=0;o<n.length;o++)r=Math.max(r,n[o]);for(let o=0;o<n.length;o++)if(o>=e.length&&e.push(ye.empty),n[o]<r){const i=Ft(t).cell.createAndFill(),s=[];for(let a=n[o];a<r;a++)s.push(i);e[o]=e[o].append(ye.from(s))}return{height:e.length,width:r,rows:e}}function gp(t,e){const n=t.createAndFill();return new Tv(n).replace(0,n.content.size,e).doc}function g8({width:t,height:e,rows:n},r,o){if(t!=r){const i=[],s=[];for(let a=0;a<n.length;a++){const l=n[a],c=[];for(let u=i[a]||0,d=0;u<r;d++){let p=l.child(d%l.childCount);u+p.attrs.colspan>r&&(p=p.type.createChecked(wo(p.attrs,p.attrs.colspan,u+p.attrs.colspan-r),p.content)),c.push(p),u+=p.attrs.colspan;for(let f=1;f<p.attrs.rowspan;f++)i[a+f]=(i[a+f]||0)+p.attrs.colspan}s.push(ye.from(c))}n=s,t=r}if(e!=o){const i=[];for(let s=0,a=0;s<o;s++,a++){const l=[],c=n[a%e];for(let u=0;u<c.childCount;u++){let d=c.child(u);s+d.attrs.rowspan>o&&(d=d.type.create({...d.attrs,rowspan:Math.max(1,o-d.attrs.rowspan)},d.content)),l.push(d)}i.push(ye.from(l))}n=i,e=o}return{width:t,height:e,rows:n}}function y8(t,e,n,r,o,i,s){const a=t.doc.type.schema,l=Ft(a);let c,u;if(o>e.width)for(let d=0,p=0;d<e.height;d++){const f=n.child(d);p+=f.nodeSize;const h=[];let m;f.lastChild==null||f.lastChild.type==l.cell?m=c||(c=l.cell.createAndFill()):m=u||(u=l.header_cell.createAndFill());for(let y=e.width;y<o;y++)h.push(m);t.insert(t.mapping.slice(s).map(p-1+r),h)}if(i>e.height){const d=[];for(let h=0,m=(e.height-1)*e.width;h<Math.max(e.width,o);h++){const y=h>=e.width?!1:n.nodeAt(e.map[m+h]).type==l.header_cell;d.push(y?u||(u=l.header_cell.createAndFill()):c||(c=l.cell.createAndFill()))}const p=l.row.create(null,ye.from(d)),f=[];for(let h=e.height;h<i;h++)f.push(p);t.insert(t.mapping.slice(s).map(r+n.nodeSize-2),f)}return!!(c||u)}function aw(t,e,n,r,o,i,s,a){if(s==0||s==e.height)return!1;let l=!1;for(let c=o;c<i;c++){const u=s*e.width+c,d=e.map[u];if(e.map[u-e.width]==d){l=!0;const p=n.nodeAt(d),{top:f,left:h}=e.findCell(d);t.setNodeMarkup(t.mapping.slice(a).map(d+r),null,{...p.attrs,rowspan:s-f}),t.insert(t.mapping.slice(a).map(e.positionAt(s,h,n)),p.type.createAndFill({...p.attrs,rowspan:f+p.attrs.rowspan-s})),c+=p.attrs.colspan-1}}return l}function lw(t,e,n,r,o,i,s,a){if(s==0||s==e.width)return!1;let l=!1;for(let c=o;c<i;c++){const u=c*e.width+s,d=e.map[u];if(e.map[u-1]==d){l=!0;const p=n.nodeAt(d),f=e.colCount(d),h=t.mapping.slice(a).map(d+r);t.setNodeMarkup(h,null,wo(p.attrs,s-f,p.attrs.colspan-(s-f))),t.insert(h+p.nodeSize,p.type.createAndFill(wo(p.attrs,0,s-f))),c+=p.attrs.rowspan-1}}return l}function cw(t,e,n,r,o){let i=n?t.doc.nodeAt(n-1):t.doc;if(!i)throw new Error("No table found");let s=lt.get(i);const{top:a,left:l}=r,c=l+o.width,u=a+o.height,d=t.tr;let p=0;function f(){if(i=n?d.doc.nodeAt(n-1):d.doc,!i)throw new Error("No table found");s=lt.get(i),p=d.mapping.maps.length}y8(d,s,i,n,c,u,p)&&f(),aw(d,s,i,n,l,c,a,p)&&f(),aw(d,s,i,n,l,c,u,p)&&f(),lw(d,s,i,n,a,u,l,p)&&f(),lw(d,s,i,n,a,u,c,p)&&f();for(let h=a;h<u;h++){const m=s.positionAt(h,l,i),y=s.positionAt(h,c,i);d.replace(d.mapping.slice(p).map(m+n),d.mapping.slice(p).map(y+n),new ve(o.rows[h-a],0,0))}f(),d.setSelection(new et(d.doc.resolve(n+s.positionAt(a,l,i)),d.doc.resolve(n+s.positionAt(u-1,c-1,i)))),e(d)}var w8=Df({ArrowLeft:ga("horiz",-1),ArrowRight:ga("horiz",1),ArrowUp:ga("vert",-1),ArrowDown:ga("vert",1),"Shift-ArrowLeft":ya("horiz",-1),"Shift-ArrowRight":ya("horiz",1),"Shift-ArrowUp":ya("vert",-1),"Shift-ArrowDown":ya("vert",1),Backspace:ma,"Mod-Backspace":ma,Delete:ma,"Mod-Delete":ma});function Xa(t,e,n){return n.eq(t.selection)?!1:(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function ga(t,e){return(n,r,o)=>{if(!o)return!1;const i=n.selection;if(i instanceof et)return Xa(n,r,je.near(i.$headCell,e));if(t!="horiz"&&!i.empty)return!1;const s=Kx(o,t,e);if(s==null)return!1;if(t=="horiz")return Xa(n,r,je.near(n.doc.resolve(i.head+e),e));{const a=n.doc.resolve(s),l=jx(a,t,e);let c;return l?c=je.near(l,1):e<0?c=je.near(n.doc.resolve(a.before(-1)),-1):c=je.near(n.doc.resolve(a.after(-1)),1),Xa(n,r,c)}}}function ya(t,e){return(n,r,o)=>{if(!o)return!1;const i=n.selection;let s;if(i instanceof et)s=i;else{const l=Kx(o,t,e);if(l==null)return!1;s=new et(n.doc.resolve(l))}const a=jx(s.$headCell,t,e);return a?Xa(n,r,new et(s.$anchorCell,a)):!1}}function b8(t,e){const n=t.state.doc,r=Si(n.resolve(e));return r?(t.dispatch(t.state.tr.setSelection(new et(r))),!0):!1}function v8(t,e,n){if(!kn(t.state))return!1;let r=h8(n);const o=t.state.selection;if(o instanceof et){r||(r={width:1,height:1,rows:[ye.from(gp(Ft(t.state.schema).cell,n))]});const i=o.$anchorCell.node(-1),s=o.$anchorCell.start(-1),a=lt.get(i).rectBetween(o.$anchorCell.pos-s,o.$headCell.pos-s);return r=g8(r,a.right-a.left,a.bottom-a.top),cw(t.state,t.dispatch,s,a,r),!0}else if(r){const i=cc(t.state),s=i.start(-1);return cw(t.state,t.dispatch,s,lt.get(i.node(-1)).findCell(i.pos-s),r),!0}else return!1}function x8(t,e){var n;if(e.ctrlKey||e.metaKey)return;const r=uw(t,e.target);let o;if(e.shiftKey&&t.state.selection instanceof et)i(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&r&&(o=Si(t.state.selection.$anchor))!=null&&((n=Gu(t,e))==null?void 0:n.pos)!=o.pos)i(o,e),e.preventDefault();else if(!r)return;function i(l,c){let u=Gu(t,c);const d=Sr.getState(t.state)==null;if(!u||!Bf(l,u))if(d)u=l;else return;const p=new et(l,u);if(d||!t.state.selection.eq(p)){const f=t.state.tr.setSelection(p);d&&f.setMeta(Sr,l.pos),t.dispatch(f)}}function s(){t.root.removeEventListener("mouseup",s),t.root.removeEventListener("dragstart",s),t.root.removeEventListener("mousemove",a),Sr.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(Sr,-1))}function a(l){const c=l,u=Sr.getState(t.state);let d;if(u!=null)d=t.state.doc.resolve(u);else if(uw(t,c.target)!=r&&(d=Gu(t,e),!d))return s();d&&i(d,c)}t.root.addEventListener("mouseup",s),t.root.addEventListener("dragstart",s),t.root.addEventListener("mousemove",a)}function Kx(t,e,n){if(!(t.state.selection instanceof Pe))return null;const{$head:r}=t.state.selection;for(let o=r.depth-1;o>=0;o--){const i=r.node(o);if((n<0?r.index(o):r.indexAfter(o))!=(n<0?0:i.childCount))return null;if(i.type.spec.tableRole=="cell"||i.type.spec.tableRole=="header_cell"){const s=r.before(o),a=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(a)?s:null}}return null}function uw(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function Gu(t,e){const n=t.posAtCoords({left:e.clientX,top:e.clientY});return n&&n?Si(t.state.doc.resolve(n.pos)):null}var k8=class{constructor(t,e){this.node=t,this.defaultCellMinWidth=e,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",`${e}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),yp(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!=this.node.type?!1:(this.node=t,yp(t,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(t){return t.type=="attributes"&&(t.target==this.table||this.colgroup.contains(t.target))}};function yp(t,e,n,r,o,i){var s;let a=0,l=!0,c=e.firstChild;const u=t.firstChild;if(u){for(let d=0,p=0;d<u.childCount;d++){const{colspan:f,colwidth:h}=u.child(d).attrs;for(let m=0;m<f;m++,p++){const y=o==p?i:h&&h[m],g=y?y+"px":"";if(a+=y||r,y||(l=!1),c)c.style.width!=g&&(c.style.width=g),c=c.nextSibling;else{const v=document.createElement("col");v.style.width=g,e.appendChild(v)}}}for(;c;){const d=c.nextSibling;(s=c.parentNode)==null||s.removeChild(c),c=d}l?(n.style.width=a+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=a+"px")}}var on=new Ge("tableColumnResizing");function S8({handleWidth:t=5,cellMinWidth:e=25,defaultCellMinWidth:n=100,View:r=k8,lastColumnResizable:o=!0}={}){const i=new Ue({key:on,state:{init(s,a){var l,c;const u=(c=(l=i.spec)==null?void 0:l.props)==null?void 0:c.nodeViews,d=Ft(a.schema).table.name;return r&&u&&(u[d]=(p,f)=>new r(p,n,f)),new A8(-1,!1)},apply(s,a){return a.apply(s)}},props:{attributes:s=>{const a=on.getState(s);return a&&a.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(s,a)=>{C8(s,a,t,o)},mouseleave:s=>{E8(s)},mousedown:(s,a)=>{T8(s,a,e,n)}},decorations:s=>{const a=on.getState(s);if(a&&a.activeHandle>-1)return _8(s,a.activeHandle)},nodeViews:{}}});return i}var A8=class Ya{constructor(e,n){this.activeHandle=e,this.dragging=n}apply(e){const n=this,r=e.getMeta(on);if(r&&r.setHandle!=null)return new Ya(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new Ya(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&e.docChanged){let o=e.mapping.map(n.activeHandle,-1);return mp(e.doc.resolve(o))||(o=-1),new Ya(o,n.dragging)}return n}};function C8(t,e,n,r){if(!t.editable)return;const o=on.getState(t.state);if(o&&!o.dragging){const i=O8(e.target);let s=-1;if(i){const{left:a,right:l}=i.getBoundingClientRect();e.clientX-a<=n?s=dw(t,e,"left",n):l-e.clientX<=n&&(s=dw(t,e,"right",n))}if(s!=o.activeHandle){if(!r&&s!==-1){const a=t.state.doc.resolve(s),l=a.node(-1),c=lt.get(l),u=a.start(-1);if(c.colCount(a.pos-u)+a.nodeAfter.attrs.colspan-1==c.width-1)return}Jx(t,s)}}}function E8(t){if(!t.editable)return;const e=on.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&Jx(t,-1)}function T8(t,e,n,r){var o;if(!t.editable)return!1;const i=(o=t.dom.ownerDocument.defaultView)!=null?o:window,s=on.getState(t.state);if(!s||s.activeHandle==-1||s.dragging)return!1;const a=t.state.doc.nodeAt(s.activeHandle),l=$8(t,s.activeHandle,a.attrs);t.dispatch(t.state.tr.setMeta(on,{setDragging:{startX:e.clientX,startWidth:l}}));function c(d){i.removeEventListener("mouseup",c),i.removeEventListener("mousemove",u);const p=on.getState(t.state);p?.dragging&&(M8(t,p.activeHandle,pw(p.dragging,d,n)),t.dispatch(t.state.tr.setMeta(on,{setDragging:null})))}function u(d){if(!d.which)return c(d);const p=on.getState(t.state);if(p&&p.dragging){const f=pw(p.dragging,d,n);fw(t,p.activeHandle,f,r)}}return fw(t,s.activeHandle,l,r),i.addEventListener("mouseup",c),i.addEventListener("mousemove",u),e.preventDefault(),!0}function $8(t,e,{colspan:n,colwidth:r}){const o=r&&r[r.length-1];if(o)return o;const i=t.domAtPos(e);let s=i.node.childNodes[i.offset].offsetWidth,a=n;if(r)for(let l=0;l<n;l++)r[l]&&(s-=r[l],a--);return s/a}function O8(t){for(;t&&t.nodeName!="TD"&&t.nodeName!="TH";)t=t.classList&&t.classList.contains("ProseMirror")?null:t.parentNode;return t}function dw(t,e,n,r){const o=n=="right"?-r:r,i=t.posAtCoords({left:e.clientX+o,top:e.clientY});if(!i)return-1;const{pos:s}=i,a=Si(t.state.doc.resolve(s));if(!a)return-1;if(n=="right")return a.pos;const l=lt.get(a.node(-1)),c=a.start(-1),u=l.map.indexOf(a.pos-c);return u%l.width==0?-1:c+l.map[u-1]}function pw(t,e,n){const r=e.clientX-t.startX;return Math.max(n,t.startWidth+r)}function Jx(t,e){t.dispatch(t.state.tr.setMeta(on,{setHandle:e}))}function M8(t,e,n){const r=t.state.doc.resolve(e),o=r.node(-1),i=lt.get(o),s=r.start(-1),a=i.colCount(r.pos-s)+r.nodeAfter.attrs.colspan-1,l=t.state.tr;for(let c=0;c<i.height;c++){const u=c*i.width+a;if(c&&i.map[u]==i.map[u-i.width])continue;const d=i.map[u],p=o.nodeAt(d).attrs,f=p.colspan==1?0:a-i.colCount(d);if(p.colwidth&&p.colwidth[f]==n)continue;const h=p.colwidth?p.colwidth.slice():D8(p.colspan);h[f]=n,l.setNodeMarkup(s+d,null,{...p,colwidth:h})}l.docChanged&&t.dispatch(l)}function fw(t,e,n,r){const o=t.state.doc.resolve(e),i=o.node(-1),s=o.start(-1),a=lt.get(i).colCount(o.pos-s)+o.nodeAfter.attrs.colspan-1;let l=t.domAtPos(o.start(-1)).node;for(;l&&l.nodeName!="TABLE";)l=l.parentNode;l&&yp(i,l.firstChild,l,r,a,n)}function D8(t){return Array(t).fill(0)}function _8(t,e){var n;const r=[],o=t.doc.resolve(e),i=o.node(-1);if(!i)return De.empty;const s=lt.get(i),a=o.start(-1),l=s.colCount(o.pos-a)+o.nodeAfter.attrs.colspan-1;for(let c=0;c<s.height;c++){const u=l+c*s.width;if((l==s.width-1||s.map[u]!=s.map[u+1])&&(c==0||s.map[u]!=s.map[u-s.width])){const d=s.map[u],p=a+d+i.nodeAt(d).nodeSize-1,f=document.createElement("div");f.className="column-resize-handle",(n=on.getState(t))!=null&&n.dragging&&r.push(Le.node(a+d,a+d+i.nodeAt(d).nodeSize,{class:"column-resize-dragging"})),r.push(Le.widget(p,f))}}return De.create(t.doc,r)}function N8({allowTableNodeSelection:t=!1}={}){return new Ue({key:Sr,state:{init(){return null},apply(e,n){const r=e.getMeta(Sr);if(r!=null)return r==-1?null:r;if(n==null||!e.docChanged)return n;const{deleted:o,pos:i}=e.mapping.mapResult(n);return o?null:i}},props:{decorations:WN,handleDOMEvents:{mousedown:x8},createSelectionBetween(e){return Sr.getState(e.state)!=null?e.state.selection:null},handleTripleClick:b8,handleKeyDown:w8,handlePaste:v8},appendTransaction(e,n,r){return JN(r,Hx(r,n),t)}})}const Xx=t=>t instanceof et,wa=({editor:t})=>{const{selection:e}=t.state;if(!Xx(e))return!1;let n=0;return rc(e.ranges[0].$from,r=>r.type.name==="table")?.node.descendants(r=>{if(r.type.name==="table")return!1;["tableCell","tableHeader"].includes(r.type.name)&&(n+=1)}),n===e.ranges.length?(t.commands.deleteTable(),!0):!1},Yx=({size:t=.66665,color:e="#000000"}={})=>({top:{size:t,color:e},left:{size:t,color:e},bottom:{size:t,color:e},right:{size:t,color:e}}),Zx=He.create({name:"table",content:"tableRow+",group:"block",isolating:!0,tableRole:"table",addOptions(){return{htmlAttributes:{},resizable:!0,handleWidth:5,cellMinWidth:25,lastColumnResizable:!0,allowTableNodeSelection:!1}},addAttributes(){return{tableIndent:{renderDOM:({tableIndent:t})=>{if(!t)return{};const{width:e,type:n="dxa"}=t;let r="";return e&&(r+=`margin-left: ${e}px`),{style:r}}},borders:{default:{},renderDOM({borders:t}){return t?{style:Object.entries(t).reduce((e,[n,{size:r,color:o}])=>`${e}border-${n}: ${r}px solid ${o||"black"};`,"")}:{}}},borderCollapse:{default:null,renderDOM({borderCollapse:t}){return{style:`border-collapse: ${t||"collapse"}`}}},tableStyleId:{rendered:!1},tableLayout:{rendered:!1},tableCellSpacing:{default:null,rendered:!1}}},parseDOM(){return[{tag:"table"}]},renderDOM({node:t,htmlAttributes:e}){const{colgroup:n,tableWidth:r,tableMinWidth:o}=zv(t,this.options.cellMinWidth);return["table",Te.mergeAttributes(this.options.htmlAttributes,e,{style:r?`width: ${r}`:`min-width: ${o}`}),n,["tbody",0]]},addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!1}={})=>({tr:r,dispatch:o,editor:i})=>{const s=i.schema.text("​"),a=pt("paragraph",i.schema).create(null,s),l=RN(i.schema,t,e,n,a);if(o){const c=r.selection.from+1;r.replaceSelectionWith(l).scrollIntoView().setSelection(Pe.near(r.doc.resolve(c)))}return!0},deleteTable:()=>({state:t,dispatch:e})=>f8(t,e),addColumnBefore:()=>({state:t,dispatch:e})=>ZN(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>QN(t,e),deleteColumn:()=>({state:t,dispatch:e})=>t8(t,e),addRowBefore:()=>({state:t,dispatch:e})=>r8(t,e),addRowAfter:()=>({state:t,dispatch:e})=>o8(t,e),deleteRow:()=>({state:t,dispatch:e})=>s8(t,e),mergeCells:()=>({state:t,dispatch:e})=>rw(t,e),splitCell:()=>({state:t,dispatch:e})=>ow(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>rw(t,e)?!0:ow(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>Os("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>Os("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>d8(t,e),setCellAttr:(t,e)=>({state:n,dispatch:r})=>c8(t,e)(n,r),goToNextCell:()=>({state:t,dispatch:e})=>sw(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>sw(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&Hx(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>(n&&e.setSelection(et.create(e.doc,t.anchorCell,t.headCell)),!0),setCellBackground:t=>({editor:e,commands:n,dispatch:r})=>{const{selection:o}=e.state;if(!Xx(o))return!1;const i=t?.startsWith("#")?t.slice(1):t;return r?n.setCellAttr("background",{color:i}):!0},deleteCellAndTableBorders:()=>({chain:t,state:e,tr:n})=>{if(!wf(e))return!1;const r=Kt(s=>s.type.name===this.name)(e.selection);if(!r)return!1;const o=r.pos,i=r.pos+r.node.nodeSize;return e.doc.nodesBetween(o,i,(s,a)=>{["tableCell","tableHeader"].includes(s.type.name)&&n.setNodeMarkup(a,void 0,{...s.attrs,borders:Yx({size:0})})}),n.setNodeMarkup(r.pos,void 0,{...r.node.attrs,borders:zx({size:0})}),!0}}},addShortcuts(){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:wa,"Mod-Backspace":wa,Delete:wa,"Mod-Delete":wa}},addPmPlugins(){return[...this.options.resizable&&this.editor.isEditable?[S8({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,lastColumnResizable:this.options.lastColumnResizable,View:FN({editor:this.editor})})]:[],N8({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(t){return{tableRole:Ke(Fe(t,"tableRole",{name:t.name,options:t.options,storage:t.storage}))}}}),Qx=He.create({name:"tableHeader",content:"block+",tableRole:"header_cell",isolating:!0,addOptions(){return{htmlAttributes:{}}},addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseDOM:t=>{const e=t.getAttribute("data-colwidth");return e?e.split(",").map(n=>parseInt(n,10)):null},renderDOM:t=>t.colwidth?{"data-colwidth":t.colwidth.join(",")}:{}}}},parseDOM(){return[{tag:"th"}]},renderDOM({htmlAttributes:t}){return["th",Te.mergeAttributes(this.options.htmlAttributes,t),0]}}),ek=He.create({name:"tableRow",content:"(tableCell | tableHeader)*",tableRole:"row",addOptions(){return{htmlAttributes:{}}},addAttributes(){return{rowHeight:{renderDOM({rowHeight:t}){return t?{style:`height: ${t}px`}:{}}}}},parseDOM(){return[{tag:"tr"}]},renderDOM({htmlAttributes:t}){return["tr",Te.mergeAttributes(this.options.htmlAttributes,t),0]}}),tk=He.create({name:"tableCell",content:"block+",tableRole:"cell",isolating:!0,addOptions(){return{htmlAttributes:{}}},addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:[100],parseDOM:t=>{const e=t.getAttribute("data-colwidth");return e?e.split(",").map(n=>parseInt(n,10)):null},renderDOM:t=>t.colwidth?{"data-colwidth":t.colwidth.join(",")}:{}},background:{renderDOM({background:t}){if(!t)return{};const{color:e}=t||{};return{style:`background-color: ${e?`#${e}`:"transparent"}`}}},verticalAlign:{renderDOM({verticalAlign:t}){return t?{style:`vertical-align: ${t}`}:{}}},cellMargins:{renderDOM({cellMargins:t}){return t?{style:["top","right","bottom","left"].map(e=>{const n=t?.[e];return n?`padding-${e}: ${n}px;`:""}).join(" ")}:{}}},borders:{default:()=>Yx(),renderDOM({borders:t}){return t?{style:["top","right","bottom","left"].map(e=>{const n=t?.[e];return n&&n.val==="none"?`border-${e}: ${n.val};`:n?`border-${e}: ${n.size}px solid ${n.color||"black"};`:""}).join(" ")}:{}}},widthType:{default:"auto",rendered:!1},widthUnit:{default:"px",rendered:!1}}},parseDOM(){return[{tag:"td"}]},renderDOM({htmlAttributes:t}){return["td",Te.mergeAttributes(this.options.htmlAttributes,t),0]}});var wr,Gr;class I8{constructor(e){$r(this,wr),Re(this,"editor"),Re(this,"node"),Re(this,"decorations"),Re(this,"getPos"),Re(this,"htmlAttributes"),Re(this,"dom"),Re(this,"annotationClass"),Re(this,"annotationContentClass"),Re(this,"borderColor"),this.editor=e.editor,this.node=e.node,this.decorations=e.decorations,this.getPos=e.getPos,this.htmlAttributes=e.htmlAttributes,this.annotationClass=e.annotationClass,this.annotationContentClass=e.annotationContentClass,this.borderColor=e.borderColor,this.handleAnnotationClick=this.handleAnnotationClick.bind(this),this.handleAnnotationDoubleClick=this.handleAnnotationDoubleClick.bind(this),this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.buildView(),this.attachEventListeners()}buildView(){let{type:e}=this.node.attrs,n={text:(...r)=>this.buildTextView(...r),image:(...r)=>this.buildImageView(...r),signature:(...r)=>this.buildSignatureView(...r),checkbox:(...r)=>this.buildCheckboxView(...r),html:(...r)=>this.buildHTMLView(...r),link:(...r)=>this.buildLinkView(...r),default:(...r)=>this.buildTextView(...r)};(n[e]??n.default)()}buildTextView(){let{displayLabel:e}=this.node.attrs,{annotation:n}=Ae(this,wr,Gr).call(this,{displayLabel:e});this.dom=n}buildImageView(){let{displayLabel:e,imageSrc:n}=this.node.attrs,{annotation:r,content:o}=Ae(this,wr,Gr).call(this);if(n){let i=document.createElement("img");i.src=n,i.alt=e,i.style.height="auto",i.style.maxWidth="100%",i.style.pointerEvents="none",i.style.verticalAlign="middle",o.append(i),r.style.display="inline-block",o.style.display="inline-block"}else o.textContent=e;this.dom=r}buildSignatureView(){let{displayLabel:e,imageSrc:n}=this.node.attrs;e=e||"Signature";let{annotation:r,content:o}=Ae(this,wr,Gr).call(this);if(n){let i=document.createElement("img");i.src=n,i.alt=e,i.style.height="auto",i.style.maxWidth="100%",i.style.maxHeight="28px",i.style.pointerEvents="none",i.style.verticalAlign="middle",o.append(i),r.style.display="inline-block",o.style.display="inline-block"}else o.textContent=e;this.dom=r}buildCheckboxView(){let{displayLabel:e}=this.node.attrs,{annotation:n}=Ae(this,wr,Gr).call(this,{displayLabel:e});this.dom=n}buildHTMLView(){let{displayLabel:e,rawHtml:n}=this.node.attrs,{annotation:r,content:o}=Ae(this,wr,Gr).call(this);n?(o.innerHTML=n.trim(),r.style.display="inline-block",o.style.display="inline-block"):o.textContent=e,this.dom=r}buildLinkView(){let{displayLabel:e,linkUrl:n}=this.node.attrs,{annotation:r,content:o}=Ae(this,wr,Gr).call(this);if(n){let i=document.createElement("a");i.href=n,i.target="_blank",i.textContent=n,i.style.textDecoration="none",o.append(i),o.style.pointerEvents="all"}else o.textContent=e;this.dom=r}attachEventListeners(){this.dom.addEventListener("click",this.handleAnnotationClick),this.dom.addEventListener("dblclick",this.handleAnnotationDoubleClick),this.editor.on("selectionUpdate",this.handleSelectionUpdate)}removeEventListeners(){this.dom.removeEventListener("click",this.handleAnnotationClick),this.dom.removeEventListener("dblclick",this.handleAnnotationDoubleClick),this.editor.off("selectionUpdate",this.handleSelectionUpdate)}handleSelectionUpdate({editor:e,transaction:n}){if(!this.editor.isEditable)return;let{selection:r}=e.state;if(r instanceof _e){let o=r.node;this.node.eq(o)&&this.editor.emit("fieldAnnotationSelected",{editor:this.editor,node:this.node,nodePos:this.getPos(),target:this.dom})}}handleAnnotationClick(e){this.editor.isEditable&&this.editor.emit("fieldAnnotationClicked",{editor:this.editor,node:this.node,nodePos:this.getPos(),event:e,currentTarget:e.currentTarget})}handleAnnotationDoubleClick(e){this.editor.isEditable&&this.editor.emit("fieldAnnotationDoubleClicked",{editor:this.editor,node:this.node,nodePos:this.getPos(),event:e,currentTarget:e.currentTarget})}stopEvent(e){return this.editor.isEditable?!1:(e.preventDefault(),!0)}update(e){return!1}ignoreMutation(e){return!0}destroy(){this.removeEventListeners()}updateAttributes(e){this.editor.commands.command(({tr:n})=>(n.setNodeMarkup(this.getPos(),void 0,{...this.node.attrs,...e}),!0))}}wr=new WeakSet,Gr=function({displayLabel:t}={}){let{highlighted:e}=this.node.attrs,n=document.createElement("span");n.classList.add(this.annotationClass);let r=document.createElement("span");r.classList.add(this.annotationContentClass),r.style.pointerEvents="none",r.contentEditable="false",t&&(r.textContent=t),n.append(r);let o=e===!1,i=[`border: 2px solid ${this.borderColor}`,"border-radius: 2px","padding: 1px 2px","box-sizing: border-box"].join("; "),s=Te.mergeAttributes(this.htmlAttributes,{style:o?"":i});for(let[a,l]of Object.entries(s))n.setAttribute(a,l);return{annotation:n,content:r}};function nk(t){let e=[];return!t.steps.length||t.meta&&!Object.keys(t.meta).every(n=>["inputType","uiEvent","paste"].includes(n))||["historyUndo","historyRedo"].includes(t.getMeta("inputType"))||["drop"].includes(t.getMeta("uiEvent"))||t.getMeta("fieldAnnotationUpdate")===!0||t.steps.forEach((n,r)=>{if(n instanceof Tt&&n.from!==n.to){let o=t.mapping.maps[r];t.before.nodesBetween(n.from,n.to,(i,s)=>{i.type.name==="fieldAnnotation"&&o.mapResult(s).deleted&&e.push({node:i,pos:s})})}}),e}function rk(t,e){let n=[];try{n=nk(e)}catch{}n.length>0&&setTimeout(()=>{t.emit("fieldAnnotationDeleted",{editor:t,removedNodes:n})},0)}const{findChildren:F8}=oc;function Cr(t){return F8(t.doc,e=>e.type.name==="fieldAnnotation")}const R8=(t={})=>{let{editor:e,annotationClass:n}=t;return new Ue({key:new Ge("fieldAnnotation"),state:{init(){return null},apply(r,o){return rk(e,r),o}},props:{handleDrop(r,o,i,s){if(s)return!1;let a=o?.dataTransfer.getData("fieldAnnotation");if(a){if(t.handleDropOutside)B8({fieldAnnotation:a,editor:e,view:r,event:o});else{let l;try{l=JSON.parse(a).attributes}catch{return!1}const c=r.posAtCoords({left:o.clientX,top:o.clientY});c&&e.commands.addFieldAnnotation(c.pos,{...l})}return!0}return!1},handlePaste(r,o,i){const s=i.content.content.filter(a=>a.type.name==="fieldAnnotation");return s.length&&e.emit("fieldAnnotationPaste",{content:s,editor:e}),!1},handleDOMEvents:{dragstart:(r,o)=>{if(!o.target)return!1;let{target:i}=o;return i.classList?.contains(n)&&o.dataTransfer?.setDragImage(i,0,0),!1}}},appendTransaction:(r,o,i)=>{if(!(r.some(u=>u.docChanged)&&!o.doc.eq(i.doc)))return;let{tr:s,doc:a}=i,l=!1,c=Cr(i);if(c.length)return c.forEach(({node:u,pos:d})=>{let{marks:p}=u,f=s.doc.nodeAt(d);p.length>0&&u.eq(f)&&(s.removeMark(d,d+u.nodeSize,null),l=!0)}),l?s:null}})};function B8({fieldAnnotation:t,editor:e,view:n,event:r}){let o;try{o=JSON.parse(t).sourceField}catch{return}let i=n.posAtCoords({left:r.clientX,top:r.clientY});i&&e.emit("fieldAnnotationDropped",{sourceField:o,editor:e,coordinates:i,pos:i.pos})}function L8(t,e){return Cr(e).map(({node:n,pos:r})=>{let o=Z1(t,r,r+n.nodeSize);return{node:n,pos:r,rect:o}})}function P8(t,e){let n=Cr(e),r=[];return n.forEach(o=>{t(o.node)&&r.push(o)}),r}const{findChildren:z8}=oc;function Za(t,e){return z8(e.doc,n=>{let r=n.type.name==="fieldAnnotation";return Array.isArray(t)?r&&t.includes(n.attrs.fieldId):r&&n.attrs.fieldId===t})}function j8(t,e){return q8(e.doc,n=>n.type.name==="fieldAnnotation"&&n.attrs.fieldId===t)}function q8(t,e){let n=null;return t.descendants((r,o)=>{if(e(r)&&(n={node:r,pos:o}),n)return!1}),n}function Vo(t,e,n){let r=[];return n.nodesBetween(t,e,(o,i)=>{!o||o?.nodeSize===void 0||o.type.name==="fieldAnnotation"&&r.push({node:o,pos:i})}),r}const V8=Object.freeze(Object.defineProperty({__proto__:null,findFieldAnnotations:P8,findFieldAnnotationsBetween:Vo,findFieldAnnotationsByFieldId:Za,findFirstFieldAnnotationByFieldId:j8,findRemovedFieldAnnotations:nk,getAllFieldAnnotations:Cr,getAllFieldAnnotationsWithRect:L8,trackFieldAnnotationsDeletion:rk},Symbol.toStringTag,{value:"Module"}));function wp(t,e,n){return Math.min(Math.max(t,n),e)}class U8 extends Error{constructor(e){super(`Failed to parse color: "${e}"`)}}var Ki=U8;function H8(t){if(typeof t!="string")throw new Ki(t);if(t.trim().toLowerCase()==="transparent")return[0,0,0,0];let e=t.trim();e=Q8.test(t)?K8(t):t;const n=J8.exec(e);if(n){const s=Array.from(n).slice(1);return[...s.slice(0,3).map(a=>parseInt(Ms(a,2),16)),parseInt(Ms(s[3]||"f",2),16)/255]}const r=X8.exec(e);if(r){const s=Array.from(r).slice(1);return[...s.slice(0,3).map(a=>parseInt(a,16)),parseInt(s[3]||"ff",16)/255]}const o=Y8.exec(e);if(o){const s=Array.from(o).slice(1);return[...s.slice(0,3).map(a=>parseInt(a,10)),parseFloat(s[3]||"1")]}const i=Z8.exec(e);if(i){const[s,a,l,c]=Array.from(i).slice(1).map(parseFloat);if(wp(0,100,a)!==a)throw new Ki(t);if(wp(0,100,l)!==l)throw new Ki(t);return[...eI(s,a,l),Number.isNaN(c)?1:c]}throw new Ki(t)}function W8(t){let e=5381,n=t.length;for(;n;)e=e*33^t.charCodeAt(--n);return(e>>>0)%2341}const hw=t=>parseInt(t.replace(/_/g,""),36),G8="1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((t,e)=>{const n=hw(e.substring(0,3)),r=hw(e.substring(3)).toString(16);let o="";for(let i=0;i<6-r.length;i++)o+="0";return t[n]=`${o}${r}`,t},{});function K8(t){const e=t.toLowerCase().trim(),n=G8[W8(e)];if(!n)throw new Ki(t);return`#${n}`}const Ms=(t,e)=>Array.from(Array(e)).map(()=>t).join(""),J8=new RegExp(`^#${Ms("([a-f0-9])",3)}([a-f0-9])?$`,"i"),X8=new RegExp(`^#${Ms("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),Y8=new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${Ms(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),Z8=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,Q8=/^[a-z]+$/i,mw=t=>Math.round(t*255),eI=(t,e,n)=>{let r=n/100;if(e===0)return[r,r,r].map(mw);const o=(t%360+360)%360/60,i=(1-Math.abs(2*r-1))*(e/100),s=i*(1-Math.abs(o%2-1));let a=0,l=0,c=0;o>=0&&o<1?(a=i,l=s):o>=1&&o<2?(a=s,l=i):o>=2&&o<3?(l=i,c=s):o>=3&&o<4?(l=s,c=i):o>=4&&o<5?(a=s,c=i):o>=5&&o<6&&(a=i,c=s);const u=r-i/2,d=a+u,p=l+u,f=c+u;return[d,p,f].map(mw)};function tI(t){const[e,n,r,o]=H8(t);let i=s=>{const a=wp(0,255,s).toString(16);return a.length===1?`0${a}`:a};return`#${i(e)}${i(n)}${i(r)}${o<1?i(Math.round(o*255)):""}`}const bp="annotation",ok="annotation-content",ik=He.create({name:"fieldAnnotation",group:"inline",inline:!0,atom:!0,draggable:!0,selectable:!0,addOptions(){return{htmlAttributes:{class:bp},annotationClass:bp,annotationContentClass:ok,types:["text","image","signature","checkbox","html","link"],defaultType:"text",borderColor:"#b015b3",visibilityOptions:["visible","hidden"],handleDropOutside:!0,toggleFormatNames:["bold","italic","underline"]}},addAttributes(){return{type:{default:this.options.defaultType,parseDOM:t=>t.getAttribute("data-type"),renderDOM:t=>t.type?{"data-type":t.type}:{}},displayLabel:{default:"Text field",parseDOM:t=>t.getAttribute("data-display-label"),renderDOM:t=>t.displayLabel?{"data-display-label":t.displayLabel}:{}},imageSrc:{default:null,rendered:!1,parseDOM:t=>t.querySelector("img")?.getAttribute("src")||null},rawHtml:{default:null,parseDOM:t=>{try{return JSON.parse(t.getAttribute("data-raw-html"))}catch(e){console.warn("Paste parse error",e)}return null},renderDOM:t=>t.rawHtml?{"data-raw-html":JSON.stringify(t.rawHtml)}:{}},linkUrl:{default:null,rendered:!1,parseDOM:t=>t.querySelector("a")?.getAttribute("href")||null},fieldId:{default:null,parseDOM:t=>t.getAttribute("data-field-id"),renderDOM:t=>t.fieldId?{"data-field-id":t.fieldId}:{}},fieldType:{default:null,parseDOM:t=>t.getAttribute("data-field-type"),renderDOM:t=>t.fieldType?{"data-field-type":t.fieldType}:{}},fieldColor:{default:"#980043",parseDOM:t=>t.getAttribute("data-field-color")||t.style.backgroundColor||null,renderDOM:t=>{if(!t.fieldColor)return{};let e=tI(t.fieldColor);return e.slice(1).length===6&&(e=`${e}33`),t.highlighted===!1?{"data-field-color":e}:{"data-field-color":e,style:`background-color: ${e}`}}},hidden:{default:!1,parseDOM:t=>{let e=t.hasAttribute("hidden"),n=t.style.display==="none";return e||n},renderDOM:t=>t.hidden?{style:"display: none"}:{}},visibility:{default:"visible",parseDOM:t=>{let e=t.style.visibility||"visible";return this.options.visibilityOptions.includes(e)?e:"visible"},renderDOM:t=>!t.visibility||t.visibility==="visible"?{}:{style:`visibility: ${t.visibility}`}},highlighted:{default:!0,rendered:!1},multipleImage:{default:!1,parseDOM:t=>t.getAttribute("data-multiple-image"),renderDOM:t=>t.multipleImage?{"data-multiple-image":t.multipleImage}:{}},size:{default:null,renderDOM:({size:t})=>!t||!t.width?{}:{style:`width: ${t.width}px; height: ${t.height}px; overflow: hidden;`}},extras:{default:{},rendered:!1},bold:{default:!1,parseDOM:t=>t.getAttribute("data-bold")==="true",renderDOM:t=>t.bold?{"data-bold":"true",style:"font-weight: bold"}:{}},italic:{default:!1,parseDOM:t=>t.getAttribute("data-italic")==="true",renderDOM:t=>t.italic?{"data-italic":"true",style:"font-style: italic"}:{}},underline:{default:!1,parseDOM:t=>t.getAttribute("data-underline")==="true",renderDOM:t=>t.underline?{"data-underline":"true",style:"text-decoration: underline"}:{}},fontFamily:{default:null,parseDOM:t=>t.getAttribute("data-font-family")||t.style.fontFamily||null,renderDOM:t=>t.fontFamily?{"data-font-family":t.fontFamily,style:`font-family: ${t.fontFamily}`}:{}},fontSize:{default:null,parseDOM:t=>t.getAttribute("data-font-size")||t.style.fontSize||null,renderDOM:t=>{if(!t.fontSize)return{};let[e,n]=nr(t.fontSize);if(Number.isNaN(e))return{};n=n||"pt";let r=`${e}${n}`;return{"data-font-size":r,style:`font-size: ${r}`}}},textHighlight:{default:null,parseDOM:t=>t.getAttribute("data-text-highlight"),renderDOM:t=>t.textHighlight?{"data-text-highlight":t.textHighlight,style:`background-color: ${t.textHighlight} !important`}:{}},textColor:{default:null,parseDOM:t=>t.getAttribute("data-text-color"),renderDOM:t=>t.textColor?{"data-text-color":t.textColor,style:`color: ${t.textColor}`}:{}},generatorIndex:{rendered:!1,default:null}}},parseDOM(){return[{tag:`span.${this.options.annotationClass}`,priority:60}]},renderDOM({node:t,htmlAttributes:e}){let{type:n,displayLabel:r,imageSrc:o,rawHtml:i,linkUrl:s}=t.attrs,a=()=>["span",Te.mergeAttributes(this.options.htmlAttributes,e),["span",{class:`${this.options.annotationContentClass}`},r]],l=()=>{let d=()=>o?["img",{src:o,alt:r}]:r;return["span",Te.mergeAttributes(this.options.htmlAttributes,e),["span",{class:`${this.options.annotationContentClass}`},d()]]},c=()=>{let d=()=>s?["a",{href:s,target:"_blank"},s]:r;return["span",Te.mergeAttributes(this.options.htmlAttributes,e),["span",{class:`${this.options.annotationContentClass}`},d()]]},u={text:()=>a(),image:()=>l(),signature:()=>l(),checkbox:()=>a(),html:()=>a(),link:()=>c(),default:()=>a()};return(u[n]??u.default)()},addCommands(){return{addFieldAnnotation:(t,e={},n=!1)=>({editor:r,dispatch:o,state:i,tr:s})=>{if(o){let{schema:a}=r,l=s.mapping.map(t),c=i.doc.resolve(l).marks();c=c.length?[...c]:null;let u=nI(c),d=a.nodes[this.name].create({...e,...u},null,null);i.tr.insert(l,d).setSelection(je.near(s.doc.resolve(l+d.nodeSize))),n&&this.editor.view.focus()}return!0},addFieldAnnotationAtSelection:(t={},e=!1)=>({editor:n,dispatch:r,state:o,tr:i,commands:s})=>{const{from:a}=o.selection;s.addFieldAnnotation(a,t,e)},replaceWithFieldAnnotation:t=>({editor:e,dispatch:n,state:r,tr:o})=>(n&&(o.setMeta("fieldAnnotationReplace",!0),t.forEach(i=>{let{from:s,to:a,attrs:l}=i,{schema:c}=e,u=o.mapping.map(s),d=o.mapping.map(a),p=c.nodes[this.name].create({...l},null,null);o.replaceWith(u,d,p)})),!0),updateFieldAnnotations:(t,e={})=>({dispatch:n,state:r,commands:o})=>{let i=Za(t,r);return i.length&&n?o.updateFieldAnnotationsAttributes(i,e):!0},updateFieldAnnotation:(t,e={})=>({dispatch:n,commands:r})=>(t&&n&&(r.updateFieldAnnotationsAttributes([t],e),this.editor.options.pagination&&setTimeout(()=>{const o=this.editor.view.state.tr;o.setMeta("forceUpdatePagination",!0),this.editor.view.dispatch(o)},50)),!0),updateFieldAnnotationsAttributes:(t,e={})=>({dispatch:n,tr:r})=>(n&&(r.setMeta("fieldAnnotationUpdate",!0),t.forEach(o=>{let{pos:i,node:s}=o,a=r.mapping.map(i),l=r.doc.nodeAt(a);s.attrs.fieldId===l?.attrs?.fieldId&&r.setNodeMarkup(a,void 0,{...s.attrs,...e})})),!0),deleteFieldAnnotations:t=>({dispatch:e,state:n,tr:r})=>{let o=Za(t,n);return o.length&&e&&o.forEach(i=>{let{pos:s,node:a}=i,l=r.mapping.map(s),c=r.mapping.map(s+a.nodeSize),u=r.doc.nodeAt(l);a.eq(u)&&r.delete(l,c)}),!0},deleteFieldAnnotationsByNode:t=>({dispatch:e,state:n,tr:r})=>(t.length&&e&&t.forEach(o=>{let{pos:i,node:s}=o,a=r.mapping.map(i),l=r.mapping.map(i+s.nodeSize),c=r.doc.nodeAt(a);s.eq(c)&&r.delete(a,l)}),!0),deleteFieldAnnotation:t=>({dispatch:e,state:n,tr:r})=>{if(!t)return!0;if(e){let{pos:o,node:i}=t,s=r.mapping.map(o),a=r.mapping.map(o+i.nodeSize),l=r.doc.nodeAt(s);i.eq(l)&&r.delete(s,a)}return!0},sliceFieldAnnotations:(t,e)=>({dispatch:n,state:r,tr:o})=>{let i=Za(t,r);return i.length&&n&&i.forEach((s,a)=>{if(a>=e){let{pos:l,node:c}=s,u=o.mapping.map(l),d=o.mapping.map(l+c.nodeSize),p=o.doc.nodeAt(u);c.eq(p)&&o.delete(u,d)}}),!0},setFieldAnnotationsHiddenByCondition:(t=()=>!1,e=!1)=>({dispatch:n,state:r,chain:o})=>{let i=Cr(r);if(!i.length)return!0;if(n){let s=[],a=i.filter(l=>{if(t(l.node))return l;s.push(l)});return e?o().updateFieldAnnotationsAttributes(a,{hidden:!0}).updateFieldAnnotationsAttributes(s,{hidden:!1}).run():o().updateFieldAnnotationsAttributes(a,{hidden:!0}).run()}return!0},unsetFieldAnnotationsHidden:()=>({dispatch:t,state:e,commands:n})=>{let r=Cr(e);return r.length&&t?n.updateFieldAnnotationsAttributes(r,{hidden:!1}):!0},setFieldAnnotationsVisibility:(t="visible")=>({dispatch:e,state:n,commands:r})=>{let o=Cr(n);return o.length?this.options.visibilityOptions.includes(t)?e?r.updateFieldAnnotationsAttributes(o,{visibility:t}):!0:!1:!0},setFieldAnnotationsHighlighted:(t=()=>!1,e=!0)=>({dispatch:n,state:r,commands:o})=>{let i=Cr(r);if(!i.length)return!0;if(n){let s=i.filter(a=>{if(t(a.node))return a});return o.updateFieldAnnotationsAttributes(s,{highlighted:e})}return!0},toggleFieldAnnotationsFormat:(t,e=!1)=>({dispatch:n,tr:r,state:o,commands:i})=>{if(!this.options.toggleFormatNames.includes(t))return!1;let{from:s,to:a,node:l}=o.selection,c=Vo(s,a,o.doc);return c.length&&n&&(c.forEach(u=>{i.updateFieldAnnotationsAttributes([u],{[t]:!u.node.attrs[t]})}),e&&l?.type.name===this.name&&r.setSelection(_e.create(r.doc,s))),!0},setFieldAnnotationsFontFamily:(t,e=!1)=>({dispatch:n,tr:r,state:o,commands:i})=>{let{from:s,to:a,node:l}=o.selection,c=Vo(s,a,o.doc);return c.length&&n&&(c.forEach(u=>{i.updateFieldAnnotationsAttributes([u],{fontFamily:t})}),e&&l?.type.name===this.name&&r.setSelection(_e.create(r.doc,s))),!0},setFieldAnnotationsFontSize:(t,e=!1)=>({dispatch:n,tr:r,state:o,commands:i})=>{let{from:s,to:a,node:l}=o.selection,c=Vo(s,a,o.doc);if(!c.length)return!0;let[u,d]=nr(t);return Number.isNaN(u)?!1:(u=pl(u,8,96),d=d||"pt",n&&(c.forEach(m=>{i.updateFieldAnnotationsAttributes([m],{fontSize:`${u}${d}`})}),e&&l?.type.name===this.name&&r.setSelection(_e.create(r.doc,s))),!0)},setFieldAnnotationsTextHighlight:(t,e=!1)=>({dispatch:n,tr:r,state:o,commands:i})=>{let{from:s,to:a,node:l}=o.selection,c=Vo(s,a,o.doc);return c.length&&n&&(c.forEach(u=>{i.updateFieldAnnotationsAttributes([u],{textHighlight:t})}),e&&l?.type.name===this.name&&r.setSelection(_e.create(r.doc,s))),!0},setFieldAnnotationsTextColor:(t,e=!1)=>({dispatch:n,tr:r,state:o,commands:i})=>{let{from:s,to:a,node:l}=o.selection,c=Vo(s,a,o.doc);return c.length&&n&&(c.forEach(u=>{i.updateFieldAnnotationsAttributes([u],{textColor:t})}),e&&l?.type.name===this.name&&r.setSelection(_e.create(r.doc,s))),!0}}},addNodeView(){return t=>new I8({...t,annotationClass:this.options.annotationClass,annotationContentClass:this.options.annotationContentClass,borderColor:this.options.borderColor})},addPmPlugins(){return[R8({editor:this.editor,annotationClass:this.options.annotationClass,handleDropOutside:this.options.handleDropOutside})]}});function nI(t){if(!t)return{};let e={bold:!1,italic:!1,underline:!1,fontFamily:null,fontSize:null};if(t&&t.length){e.bold=t.some(r=>r.type.name==="bold"),e.italic=t.some(r=>r.type.name==="italic"),e.underline=t.some(r=>r.type.name==="underline");let n=t.find(r=>r.type.name==="textStyle");n&&(e.fontFamily=n.attrs.fontFamily??null,e.fontSize=n.attrs.fontSize??null)}return e}const co=new Ge("ImagePlaceholder"),rI=(t={})=>new Ue({key:co,state:{init(){return De.empty},apply(e,n,r,o){n=n.map(e.mapping,e.doc);let i=e.getMeta(co);if(i?.type==="add"){let s=document.createElement("placeholder"),a=Le.widget(i.pos,s,{id:i.id});n=n.add(e.doc,[a])}else i?.type==="remove"&&(n=n.remove(n.find(null,null,s=>s.id==i.id)));return n}},props:{decorations(e){return this.getState(e)}}}),oI=(t,e)=>{let n=co.getState(t)?.find(null,null,r=>r.id===e);return n?.length?n[0].from:null},gw=new Ge("ImagePosition"),iI=({editor:t})=>{const{view:e}=t;let n=!1;return new Ue({name:"ImagePositionPlugin",key:gw,state:{init(r,o){return De.empty},apply(r,o,i,s){const a=yw(s,e);return De.create(s.doc,a)}},view:r=>({update:(o,i)=>{const s=_r.getState(i);if(n){n=!1;const a=yw(i,o),l=o.state.tr.setMeta(gw,{decorations:a});o.dispatch(l)}s?.isReadyToInit&&(n=!0)}}),props:{decorations(r){return this.getState(r)}}})},yw=(t,e)=>{let n=[];return t.doc.descendants((r,o)=>{if(r.attrs.anchorData){let i="",s="";const{vRelativeFrom:a,alignH:l}=r.attrs.anchorData,{size:c,padding:u}=r.attrs,d=sI(e,o,"pagination-break-wrapper");if(d){switch(l){case"left":i+="float: left; left: 0; margin-left: 0; ";break;case"right":i+="float: right; right: 0; margin-right: 0; ";break;case"center":i+="display: block; margin-left: auto; margin-right: auto; ";break}if(i+=a==="margin"?`position: absolute; top: ${d?.offsetTop+d?.offsetHeight}px; `:"",a==="margin"){const p=e.posAtDOM(d,1),f=document.createElement("div");f.className="anchor-image-placeholder",f.style.float=l,f.style.width=c.width+parseInt(u[l])+"px",f.style.height=c.height+parseInt(u.top)+parseInt(u.bottom)+"px",n.push(Le.widget(p,f,{key:"stable-key"}))}}n.push(Le.inline(o,o+r.nodeSize,{style:i,class:s}))}}),n},sI=(t,e,n)=>{let{node:r}=t.domAtPos(e);for(r.nodeType===3&&(r=r.parentNode);r;){if(r.classList&&r.classList.contains(n))return r;if(r.previousSibling)for(r=r.previousSibling;r&&r.lastChild;)r=r.lastChild;else r=r.parentNode}return null},sk=He.create({name:"image",group:"inline",inline:!0,draggable:!0,addOptions(){return{allowBase64:!0,htmlAttributes:{style:"display: inline-block;"}}},addStorage(){return{media:{}}},addAttributes(){return{src:{default:null,renderDOM:({src:t})=>({src:this.storage.media[t]??t})},alt:{default:null},id:{rendered:!1},title:{default:null},rId:{default:null,rendered:!1},originalPadding:{default:null,rendered:!1},originalAttributes:{rendered:!1},wrapTopAndBottom:{rendered:!1},anchorData:{default:null,rendered:!1},isAnchor:{rendered:!1},simplePos:{rendered:!1},wrapText:{rendered:!1},size:{default:{},renderDOM:({size:t})=>{let e="",{width:n,height:r}=t??{};return n&&(e+=`width: ${n}px;`),r&&(e+="height: auto;"),{style:e}}},padding:{default:{},renderDOM:({padding:t,marginOffset:e})=>{let{left:n=0,top:r=0,bottom:o=0,right:i=0}=t??{},s="";return n&&!e?.left&&(s+=`margin-left: ${n}px;`),r&&!e?.top&&(s+=`margin-top: ${r}px;`),o&&(s+=`margin-bottom: ${o}px;`),i&&(s+=`margin-right: ${i}px;`),{style:s}}},marginOffset:{default:{},renderDOM:({marginOffset:t})=>{let{left:e=0,top:n=0}=t??{},r="";return e&&(r+=`margin-left: ${e}px;`),n&&(r+=`margin-top: ${n}px;`),{style:r}}},style:{default:null,rendered:!0,renderDOM:({style:t})=>t?{style:t}:{}}}},parseDOM(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderDOM({htmlAttributes:t}){return["img",Te.mergeAttributes(this.options.htmlAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addPmPlugins(){return[rI(),iI({editor:this.editor})]}}),aI=He.create({name:"bookmarkStart",group:"inline",content:"inline*",inline:!0,addOptions(){return{htmlAttributes:{style:"height: 0; width: 0;"}}},addAttributes(){return{name:{default:null,renderDOM:({name:t})=>t?{name:t}:{}},id:{default:null,renderDOM:({id:t})=>t?{id:t}:{}}}},renderDOM({htmlAttributes:t}){return["a",Te.mergeAttributes(this.options.htmlAttributes,t)]}}),ak=He.create({name:"mention",group:"inline",inline:!0,selectable:!1,atom:!0,addOptions(){return{htmlAttributes:{class:"sd-editor-mention"}}},parseDOM(){return[{tag:`span[data-type="${this.name||this.email}"]`,getAttrs:t=>({name:t.getAttribute("name")||null,email:t.getAttribute("email")||null})}]},renderDOM({node:t,htmlAttributes:e}){const{name:n,email:r}=t.attrs;return["span",Te.mergeAttributes({"data-type":this.name||this.email},this.options.htmlAttributes,e),`@${n||r}`]},addAttributes(){return{name:{default:null},email:{default:null}}}}),lI=He.create({name:"page-number",group:"inline",inline:!0,content:"text*",addOptions(){return{htmlAttributes:{"data-id":"auto-page-number"}}},parseDOM(){return[{tag:'span[data-id="auto-page-number"'}]},renderDOM({htmlAttributes:t}){return["span",Te.mergeAttributes(this.options.htmlAttributes,t),0]}}),cI=He.create({name:"total-page-number",group:"inline",inline:!0,content:"text*",addOptions(){return{htmlAttributes:{"data-id":"auto-total-pages"}}},parseDOM(){return[{tag:'span[data-id="auto-total-pages"'}]},renderDOM({htmlAttributes:t}){return["span",Te.mergeAttributes(this.options.htmlAttributes,t),0]}}),uI=He.create({name:"shapeContainer",group:"block",content:"block+",isolating:!0,addOptions(){return{htmlAttributes:{class:"sd-editor-shape-container"}}},addAttributes(){return{fillcolor:{renderDOM:t=>t.fillcolor?{style:`background-color: ${t.fillcolor}`}:{}},style:{renderDOM:t=>t.style?{style:t.style}:{}},wrapAttributes:{rendered:!1},attributes:{rendered:!1}}},parseDOM(){return[{tag:`div[data-type="${this.name}"]`}]},renderDOM({htmlAttributes:t}){return["div",Te.mergeAttributes(this.options.htmlAttributes,t,{"data-type":this.name}),0]}}),dI=He.create({name:"shapeTextbox",group:"block",content:"paragraph* block*",isolating:!0,addOptions(){return{htmlAttributes:{class:"sd-editor-shape-textbox"}}},addAttributes(){return{attributes:{rendered:!1}}},parseDOM(){return[{tag:`div[data-type="${this.name}"]`}]},renderDOM({htmlAttributes:t}){return["div",Te.mergeAttributes(this.options.htmlAttributes,t,{"data-type":this.name}),0]}}),pI=He.create({name:"contentBlock",group:"block",content:"",isolating:!0,addOptions(){return{htmlAttributes:{contenteditable:!1}}},addAttributes(){return{size:{default:null,renderDOM:({size:t})=>{if(!t)return{};let e="";return t.top&&(e+=`top: ${t.top}px; `),t.left&&(e+=`left: ${t.left}px; `),t.width&&(e+=`width: ${t.width}px; `),t.height&&(e+=`height: ${t.height}px; `),{style:e}}},background:{default:null,renderDOM:t=>t.background?{style:`background-color: ${t.background}`}:{}},drawingContent:{rendered:!1},attributes:{rendered:!1}}},parseDOM(){return[{tag:`div[data-type="${this.name}"]`}]},renderDOM({htmlAttributes:t}){return["div",Te.mergeAttributes(this.options.htmlAttributes,t,{"data-type":this.name}),0]}}),fI=He.create({name:"structuredContent",group:"inline",inline:!0,content:"inline*",addOptions(){return{annotationClass:"sd-structured-content-tag",htmlAttributes:{}}},parseDOM(){return[{tag:`span.${this.options.annotationClass}`,priority:60}]},renderDOM({htmlAttributes:t}){return["span",Te.mergeAttributes(this.options.htmlAttributes,t),0]},addAttributes(){return{sdtPr:{rendered:!1}}}}),lk=tn.create({name:"textStyle",addOptions(){return{htmlAttributes:{}}},parseDOM(){return[{tag:"span",getAttrs:t=>{const e=t.hasAttribute("style"),n=t.classList.contains(bp)||t.classList.contains(ok);return!e||n?!1:{}}}]},renderDOM({htmlAttributes:t}){return["span",Te.mergeAttributes(this.options.htmlAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=Te.getMarkAttributes(t,this.type);return Object.entries(n).some(([,r])=>!!r)?!0:e.unsetMark(this.name)}}}}),ck=tn.create({name:"bold",addOptions(){return{htmlAttributes:{}}},parseDOM(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name=="strong"},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderDOM({htmlAttributes:t}){return["strong",Te.mergeAttributes(this.options.htmlAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name)}},addShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}}}),uk=tn.create({name:"italic",addOptions(){return{htmlAttributes:{}}},parseDOM(){return[{tag:"i"},{tag:"em"},{style:"font-style=italic"},{style:"font-style=normal",clearMark:t=>t.type.name=="em"}]},renderDOM({htmlAttributes:t}){return["em",Te.mergeAttributes(this.options.htmlAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name)}},addShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}}}),dk=tn.create({name:"underline",addOptions(){return{htmlAttributes:{}}},parseDOM(){return[{tag:"u"},{style:"text-decoration=underline"},{style:"text-decoration=auto",clearMark:t=>t.type.name=="u"}]},renderDOM({htmlAttributes:t}){return["u",Te.mergeAttributes(this.options.htmlAttributes,t),0]},addAttributes(){return{underlineType:{default:"single"}}},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name)}},addShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),pk=tn.create({name:"highlight",addOptions(){return{htmlAttributes:{}}},addAttributes(){return{color:{default:null,parseDOM:t=>t.getAttribute("data-color")||t.style.backgroundColor,renderDOM:t=>t.color?{"data-color":t.color,style:`background-color: ${t.color}; color: inherit`}:{}}}},parseDOM(){return[{tag:"mark"}]},renderDOM({htmlAttributes:t}){return["mark",Te.mergeAttributes(this.options.htmlAttributes,t),0]},addCommands(){return{setHighlight:t=>({commands:e})=>e.setMark(this.name,{color:t}),unsetHighlight:()=>({commands:t})=>t.unsetMark(this.name),toggleHighlight:()=>({commands:t})=>t.toggleMark(this.name)}},addShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}}}),fk=tn.create({name:"strike",addOptions(){return{htmlAttributes:{}}},parseDOM(){return[{tag:"s"},{style:"text-decoration=line-through"},{style:"text-decoration=auto",clearMark:t=>t.type.name=="s"}]},renderDOM({htmlAttributes:t}){return["s",Te.mergeAttributes(this.options.htmlAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name)}},addShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}}}),hk=tn.create({name:"link",priority:1e3,keepOnSplit:!1,inclusive:!1,addOptions(){return{protocols:["http","https"],htmlAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null}}},parseDOM(){return[{tag:"a"}]},renderDOM({htmlAttributes:t}){return ww(t.href,this.options.protocols)?["a",Te.mergeAttributes(this.options.htmlAttributes,t),0]:["a",mergeAttributes(this.options.htmlAttributes,{...t,href:""}),0]},addAttributes(){return{href:{default:null,renderDOM:({href:t,name:e})=>t&&ww(t,this.options.protocols)?{href:t}:e?{href:`#${e}`}:{}},target:{default:this.options.htmlAttributes.target},rel:{default:this.options.htmlAttributes.rel},rId:{default:this.options.htmlAttributes.rId||null},text:{default:null},name:{default:null}}},addCommands(){return{setLink:({href:t})=>({chain:e})=>e().setMark(this.name,{href:t}).run(),unsetLink:()=>({chain:t})=>t().unsetMark("underline").unsetColor().unsetMark(this.name,{extendEmptyMarkRange:!0}).run(),toggleLink:({href:t})=>({commands:e})=>t?e.setLink({href:t}):e.unsetLink()}}}),hI=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function ww(t,e){const n=["http","https","mailto"];return e&&e.forEach(r=>{const o=typeof r=="string"?r:r.scheme;o&&n.push(o)}),!t||t.replace(hI,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z+.-]+(?:[^a-z+.-:]|$))`,"i"))}const mI="track-insert",mk=tn.create({name:It,group:"track",inclusive:!1,addOptions(){return{htmlAttributes:{class:mI}}},addAttributes(){return{id:{default:"",parseDOM:t=>t.getAttribute("data-id"),renderDOM:t=>t.id?{"data-id":t.id}:{}},author:{default:"",parseDOM:t=>t.getAttribute("data-author"),renderDOM:t=>t.author?{"data-author":t.author}:{}},authorEmail:{default:"",parseDOM:t=>t.getAttribute("data-authoremail"),renderDOM:t=>t.authorEmail?{"data-authoremail":t.authorEmail}:{}},date:{default:"",parseDOM:t=>t.getAttribute("data-date"),renderDOM:t=>t.date?{"data-date":t.date}:{}}}},parseDOM(){return!1},renderDOM({htmlAttributes:t}){return["span",Te.mergeAttributes(this.options.htmlAttributes,t),0]}}),gI="track-delete",gk=tn.create({name:ut,group:"track",inclusive:!1,addOptions(){return{htmlAttributes:{class:gI}}},addAttributes(){return{id:{default:"",parseDOM:t=>t.getAttribute("data-id"),renderDOM:t=>t.id?{"data-id":t.id}:{}},author:{default:"",parseDOM:t=>t.getAttribute("data-author"),renderDOM:t=>t.author?{"data-author":t.author}:{}},authorEmail:{default:"",parseDOM:t=>t.getAttribute("data-authoremail"),renderDOM:t=>t.authorEmail?{"data-authoremail":t.authorEmail}:{}},date:{default:"",parseDOM:t=>t.getAttribute("data-date"),renderDOM:t=>t.date?{"data-date":t.date}:{}}}},parseDOM(){return!1},renderDOM({htmlAttributes:t}){return["span",Te.mergeAttributes(this.options.htmlAttributes,t),0]}}),vp=t=>{if(!t)return[];let e;try{e=JSON.parse(t)}catch{return[]}return Array.isArray(e)?e.filter(n=>Object.hasOwn(n,"type")&&Object.hasOwn(n,"attrs")):[]},yI=Object.freeze(Object.defineProperty({__proto__:null,addMarkStep:sx,documentHelpers:YD,findTrackedMarkBetween:_f,getTrackChanges:Nf,markDeletion:Z2,markInsertion:Y2,markWrapping:f_,parseFormatList:vp,removeMarkStep:ax,replaceAroundStep:h_,replaceStep:ix,trackedTransaction:lx},Symbol.toStringTag,{value:"Module"})),wI="track-format",yk=tn.create({name:vt,group:"track",inclusive:!1,addOptions(){return{htmlAttributes:{class:wI}}},addAttributes(){return{id:{default:"",parseDOM:t=>t.getAttribute("data-id"),renderDOM:t=>t.id?{"data-id":t.id}:{}},author:{default:"",parseDOM:t=>t.getAttribute("data-author"),renderDOM:t=>t.author?{"data-author":t.author}:{}},authorEmail:{default:"",parseDOM:t=>t.getAttribute("data-authoremail"),renderDOM:t=>t.authorEmail?{"data-authoremail":t.authorEmail}:{}},date:{default:"",parseDOM:t=>t.getAttribute("data-date"),renderDOM:t=>t.date?{"data-date":t.date}:{}},before:{default:[],parseDOM:t=>vp(t.getAttribute("data-before")),renderDOM:t=>t.before?{"data-before":JSON.stringify(t.before)}:{}},after:{default:[],parseDOM:t=>vp(t.getAttribute("data-after")),renderDOM:t=>t.after?{"data-after":JSON.stringify(t.after)}:{}}}},parseDOM(){return!1},renderDOM({htmlAttributes:t}){return["span",Te.mergeAttributes(this.options.htmlAttributes,t),0]}}),bI=Ye.create({name:"trackChanges",addCommands(){return{acceptTrackedChangesBetween:(t,e)=>({state:n,dispatch:r})=>{let{tr:o,doc:i}=n;o.setMeta("acceptReject",!0);const s=new ni;return i.nodesBetween(t,e,(a,l)=>{if(a.marks&&a.marks.find(c=>c.type.name===ut)){const c=new Tt(s.map(Math.max(l,t)),s.map(Math.min(l+a.nodeSize,e)),ve.empty);o.step(c),s.appendMap(c.getMap())}else if(a.marks&&a.marks.find(c=>c.type.name===It)){const c=a.marks.find(u=>u.type.name===It);o.step(new vn(s.map(Math.max(l,t)),s.map(Math.min(l+a.nodeSize,e)),c))}else if(a.marks&&a.marks.find(c=>c.type.name===vt)){const c=a.marks.find(u=>u.type.name===vt);o.step(new vn(s.map(Math.max(l,t)),s.map(Math.min(l+a.nodeSize,e)),c))}}),o.steps.length&&r(o),!0},rejectTrackedChangesBetween:(t,e)=>({state:n,dispatch:r})=>{const{tr:o,doc:i}=n;o.setMeta("acceptReject",!0);const s=new ni;return i.nodesBetween(t,e,(a,l)=>{if(a.marks&&a.marks.find(c=>c.type.name===ut)){const c=a.marks.find(u=>u.type.name===ut);o.step(new vn(s.map(Math.max(l,t)),s.map(Math.min(l+a.nodeSize,e)),c))}else if(a.marks&&a.marks.find(c=>c.type.name===It)){const c=new Tt(s.map(Math.max(l,t)),s.map(Math.min(l+a.nodeSize,e)),ve.empty);o.step(c),s.appendMap(c.getMap())}else if(a.marks&&a.marks.find(c=>c.type.name===vt)){const c=a.marks.find(u=>u.type.name===vt);c.attrs.before.forEach(u=>{o.step(new Vs(s.map(Math.max(l,t)),s.map(Math.min(l+a.nodeSize,e)),n.schema.marks[u.type].create(u.attrs)))}),c.attrs.after.forEach(u=>{o.step(new vn(s.map(Math.max(l,t)),s.map(Math.min(l+a.nodeSize,e)),a.marks.find(d=>d.type.name===u.type)))}),o.step(new vn(s.map(Math.max(l,t)),s.map(Math.min(l+a.nodeSize,e)),c))}}),o.steps.length&&r(o),!0},acceptTrackedChange:({trackedChange:t})=>({commands:e})=>{const{start:n,end:r}=t;return e.acceptTrackedChangesBetween(n,r)},acceptTrackedChangeBySelection:()=>({state:t,commands:e})=>{const{from:n,to:r}=t.selection;return e.acceptTrackedChangesBetween(n,r)},acceptTrackedChangeById:t=>({state:e,tr:n,commands:r})=>(bw(e,t)||[]).map(({from:o,to:i})=>{let s=n.mapping.map(o),a=n.mapping.map(i);return r.acceptTrackedChangesBetween(s,a)}).every(o=>o),acceptAllTrackedChanges:()=>({state:t,commands:e})=>{const n=t.doc.content.size;return e.acceptTrackedChangesBetween(0,n)},rejectTrackedChangeById:t=>({state:e,tr:n,commands:r})=>(bw(e,t)||[]).map(({from:o,to:i})=>{let s=n.mapping.map(o),a=n.mapping.map(i);return r.rejectTrackedChangesBetween(s,a)}).every(o=>o),rejectTrackedChange:({trackedChange:t})=>({commands:e})=>{const{start:n,end:r}=t;return e.rejectTrackedChangesBetween(n,r)},rejectTrackedChangeOnSelection:()=>({state:t,commands:e})=>{const{from:n,to:r}=t.selection;return e.rejectTrackedChangesBetween(n,r)},rejectAllTrackedChanges:()=>({state:t,commands:e})=>{const n=t.doc.content.size;return e.rejectTrackedChangesBetween(0,n)},toggleTrackChanges:()=>({state:t})=>{const e=gt.getState(t);return e===void 0?!1:(t.tr.setMeta(gt,{type:"TRACK_CHANGES_ENABLE",value:!e.isTrackChangesActive}),!0)},enableTrackChanges:()=>({state:t})=>(t.tr.setMeta(gt,{type:"TRACK_CHANGES_ENABLE",value:!0}),!0),disableTrackChanges:()=>({state:t})=>(t.tr.setMeta(gt,{type:"TRACK_CHANGES_ENABLE",value:!1}),!0),toggleTrackChangesShowOriginal:()=>({state:t})=>{const e=gt.getState(t);return e===void 0?!1:(t.tr.setMeta(gt,{type:"SHOW_ONLY_ORIGINAL",value:!e.onlyOriginalShown}),!0)},enableTrackChangesShowOriginal:()=>({state:t})=>(t.tr.setMeta(gt,{type:"SHOW_ONLY_ORIGINAL",value:!0}),!0),disableTrackChangesShowOriginal:()=>({state:t})=>(t.tr.setMeta(gt,{type:"SHOW_ONLY_ORIGINAL",value:!1}),!0),toggleTrackChangesShowFinal:()=>({state:t,dispatch:e})=>{const n=gt.getState(t);return n===void 0?!1:(t.tr.setMeta(gt,{type:"SHOW_ONLY_MODIFIED",value:!n.onlyModifiedShown}),!0)},enableTrackChangesShowFinal:()=>({state:t})=>(t.tr.setMeta(gt,{type:"SHOW_ONLY_MODIFIED",value:!0}),!0)}},addPmPlugins(){return[ZD()]}}),bw=(t,e)=>{const n=Nf(t),r=n.findIndex(({mark:l})=>l.attrs.id===e);if(r===-1)return;const o=n[r],i=n[r-1],s=n[r+1];let a;return i&&o.start===i.end?a=i:s&&o.end===s.start&&(a=s),[o,a].filter(Boolean)},wk=Ye.create({name:"placeholder",addOptions(){return{placeholder:"Type something..."}},addPmPlugins(){const t=e=>{if(e.doc.textBetween(0,e.doc.content.size," "," ")!=="")return De.empty;const{$from:n}=e.selection,r=Le.node(n.before(),n.after(),{"data-placeholder":this.options.placeholder,class:"sd-editor-placeholder"});return De.create(e.doc,[r])};return[new Ue({key:new Ge("placeholder"),state:{init:(e,n)=>t(n),apply:(e,n,r,o)=>t(o)},props:{decorations(e){return this.getState(e)}}})]}});var Xt="top",yn="bottom",wn="right",Yt="left",Lf="auto",Ys=[Xt,yn,wn,Yt],fi="start",Ds="end",vI="clippingParents",bk="viewport",Mi="popper",xI="reference",vw=Ys.reduce(function(t,e){return t.concat([e+"-"+fi,e+"-"+Ds])},[]),vk=[].concat(Ys,[Lf]).reduce(function(t,e){return t.concat([e,e+"-"+fi,e+"-"+Ds])},[]),kI="beforeRead",SI="read",AI="afterRead",CI="beforeMain",EI="main",TI="afterMain",$I="beforeWrite",OI="write",MI="afterWrite",DI=[kI,SI,AI,CI,EI,TI,$I,OI,MI];function Pn(t){return t?(t.nodeName||"").toLowerCase():null}function un(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function bo(t){var e=un(t).Element;return t instanceof e||t instanceof Element}function gn(t){var e=un(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function Pf(t){if(typeof ShadowRoot>"u")return!1;var e=un(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function _I(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},o=e.attributes[n]||{},i=e.elements[n];!gn(i)||!Pn(i)||(Object.assign(i.style,r),Object.keys(o).forEach(function(s){var a=o[s];a===!1?i.removeAttribute(s):i.setAttribute(s,a===!0?"":a)}))})}function NI(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var o=e.elements[r],i=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),a=s.reduce(function(l,c){return l[c]="",l},{});!gn(o)||!Pn(o)||(Object.assign(o.style,a),Object.keys(i).forEach(function(l){o.removeAttribute(l)}))})}}const xk={name:"applyStyles",enabled:!0,phase:"write",fn:_I,effect:NI,requires:["computeStyles"]};function Fn(t){return t.split("-")[0]}var uo=Math.max,Nl=Math.min,hi=Math.round;function xp(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function kk(){return!/^((?!chrome|android).)*safari/i.test(xp())}function mi(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),o=1,i=1;e&&gn(t)&&(o=t.offsetWidth>0&&hi(r.width)/t.offsetWidth||1,i=t.offsetHeight>0&&hi(r.height)/t.offsetHeight||1);var s=bo(t)?un(t):window,a=s.visualViewport,l=!kk()&&n,c=(r.left+(l&&a?a.offsetLeft:0))/o,u=(r.top+(l&&a?a.offsetTop:0))/i,d=r.width/o,p=r.height/i;return{width:d,height:p,top:u,right:c+d,bottom:u+p,left:c,x:c,y:u}}function zf(t){var e=mi(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function Sk(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&Pf(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function sr(t){return un(t).getComputedStyle(t)}function II(t){return["table","td","th"].indexOf(Pn(t))>=0}function jr(t){return((bo(t)?t.ownerDocument:t.document)||window.document).documentElement}function uc(t){return Pn(t)==="html"?t:t.assignedSlot||t.parentNode||(Pf(t)?t.host:null)||jr(t)}function xw(t){return!gn(t)||sr(t).position==="fixed"?null:t.offsetParent}function FI(t){var e=/firefox/i.test(xp()),n=/Trident/i.test(xp());if(n&&gn(t)){var r=sr(t);if(r.position==="fixed")return null}var o=uc(t);for(Pf(o)&&(o=o.host);gn(o)&&["html","body"].indexOf(Pn(o))<0;){var i=sr(o);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||e&&i.willChange==="filter"||e&&i.filter&&i.filter!=="none")return o;o=o.parentNode}return null}function Zs(t){for(var e=un(t),n=xw(t);n&&II(n)&&sr(n).position==="static";)n=xw(n);return n&&(Pn(n)==="html"||Pn(n)==="body"&&sr(n).position==="static")?e:n||FI(t)||e}function jf(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function as(t,e,n){return uo(t,Nl(e,n))}function RI(t,e,n){var r=as(t,e,n);return r>n?n:r}function Ak(){return{top:0,right:0,bottom:0,left:0}}function Ck(t){return Object.assign({},Ak(),t)}function Ek(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var BI=function(t,e){return t=typeof t=="function"?t(Object.assign({},e.rects,{placement:e.placement})):t,Ck(typeof t!="number"?t:Ek(t,Ys))};function LI(t){var e,n=t.state,r=t.name,o=t.options,i=n.elements.arrow,s=n.modifiersData.popperOffsets,a=Fn(n.placement),l=jf(a),c=[Yt,wn].indexOf(a)>=0,u=c?"height":"width";if(!(!i||!s)){var d=BI(o.padding,n),p=zf(i),f=l==="y"?Xt:Yt,h=l==="y"?yn:wn,m=n.rects.reference[u]+n.rects.reference[l]-s[l]-n.rects.popper[u],y=s[l]-n.rects.reference[l],g=Zs(i),v=g?l==="y"?g.clientHeight||0:g.clientWidth||0:0,k=m/2-y/2,b=d[f],C=v-p[u]-d[h],D=v/2-p[u]/2+k,M=as(b,D,C),I=l;n.modifiersData[r]=(e={},e[I]=M,e.centerOffset=M-D,e)}}function PI(t){var e=t.state,n=t.options,r=n.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=e.elements.popper.querySelector(o),!o)||Sk(e.elements.popper,o)&&(e.elements.arrow=o))}const zI={name:"arrow",enabled:!0,phase:"main",fn:LI,effect:PI,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function gi(t){return t.split("-")[1]}var jI={top:"auto",right:"auto",bottom:"auto",left:"auto"};function qI(t,e){var n=t.x,r=t.y,o=e.devicePixelRatio||1;return{x:hi(n*o)/o||0,y:hi(r*o)/o||0}}function kw(t){var e,n=t.popper,r=t.popperRect,o=t.placement,i=t.variation,s=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,u=t.roundOffsets,d=t.isFixed,p=s.x,f=p===void 0?0:p,h=s.y,m=h===void 0?0:h,y=typeof u=="function"?u({x:f,y:m}):{x:f,y:m};f=y.x,m=y.y;var g=s.hasOwnProperty("x"),v=s.hasOwnProperty("y"),k=Yt,b=Xt,C=window;if(c){var D=Zs(n),M="clientHeight",I="clientWidth";if(D===un(n)&&(D=jr(n),sr(D).position!=="static"&&a==="absolute"&&(M="scrollHeight",I="scrollWidth")),D=D,o===Xt||(o===Yt||o===wn)&&i===Ds){b=yn;var E=d&&D===C&&C.visualViewport?C.visualViewport.height:D[M];m-=E-r.height,m*=l?1:-1}if(o===Yt||(o===Xt||o===yn)&&i===Ds){k=wn;var G=d&&D===C&&C.visualViewport?C.visualViewport.width:D[I];f-=G-r.width,f*=l?1:-1}}var oe=Object.assign({position:a},c&&jI),N=u===!0?qI({x:f,y:m},un(n)):{x:f,y:m};if(f=N.x,m=N.y,l){var H;return Object.assign({},oe,(H={},H[b]=v?"0":"",H[k]=g?"0":"",H.transform=(C.devicePixelRatio||1)<=1?"translate("+f+"px, "+m+"px)":"translate3d("+f+"px, "+m+"px, 0)",H))}return Object.assign({},oe,(e={},e[b]=v?m+"px":"",e[k]=g?f+"px":"",e.transform="",e))}function VI(t){var e=t.state,n=t.options,r=n.gpuAcceleration,o=r===void 0?!0:r,i=n.adaptive,s=i===void 0?!0:i,a=n.roundOffsets,l=a===void 0?!0:a,c={placement:Fn(e.placement),variation:gi(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:o,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,kw(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,kw(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const UI={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:VI,data:{}};var ba={passive:!0};function HI(t){var e=t.state,n=t.instance,r=t.options,o=r.scroll,i=o===void 0?!0:o,s=r.resize,a=s===void 0?!0:s,l=un(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return i&&c.forEach(function(u){u.addEventListener("scroll",n.update,ba)}),a&&l.addEventListener("resize",n.update,ba),function(){i&&c.forEach(function(u){u.removeEventListener("scroll",n.update,ba)}),a&&l.removeEventListener("resize",n.update,ba)}}const WI={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:HI,data:{}};var GI={left:"right",right:"left",bottom:"top",top:"bottom"};function Qa(t){return t.replace(/left|right|bottom|top/g,function(e){return GI[e]})}var KI={start:"end",end:"start"};function Sw(t){return t.replace(/start|end/g,function(e){return KI[e]})}function qf(t){var e=un(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Vf(t){return mi(jr(t)).left+qf(t).scrollLeft}function JI(t,e){var n=un(t),r=jr(t),o=n.visualViewport,i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;var c=kk();(c||!c&&e==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a+Vf(t),y:l}}function XI(t){var e,n=jr(t),r=qf(t),o=(e=t.ownerDocument)==null?void 0:e.body,i=uo(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=uo(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-r.scrollLeft+Vf(t),l=-r.scrollTop;return sr(o||n).direction==="rtl"&&(a+=uo(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:s,x:a,y:l}}function Uf(t){var e=sr(t),n=e.overflow,r=e.overflowX,o=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function Tk(t){return["html","body","#document"].indexOf(Pn(t))>=0?t.ownerDocument.body:gn(t)&&Uf(t)?t:Tk(uc(t))}function ls(t,e){var n;e===void 0&&(e=[]);var r=Tk(t),o=r===((n=t.ownerDocument)==null?void 0:n.body),i=un(r),s=o?[i].concat(i.visualViewport||[],Uf(r)?r:[]):r,a=e.concat(s);return o?a:a.concat(ls(uc(s)))}function kp(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function YI(t,e){var n=mi(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function Aw(t,e,n){return e===bk?kp(JI(t,n)):bo(e)?YI(e,n):kp(XI(jr(t)))}function ZI(t){var e=ls(uc(t)),n=["absolute","fixed"].indexOf(sr(t).position)>=0,r=n&&gn(t)?Zs(t):t;return bo(r)?e.filter(function(o){return bo(o)&&Sk(o,r)&&Pn(o)!=="body"}):[]}function QI(t,e,n,r){var o=e==="clippingParents"?ZI(t):[].concat(e),i=[].concat(o,[n]),s=i[0],a=i.reduce(function(l,c){var u=Aw(t,c,r);return l.top=uo(u.top,l.top),l.right=Nl(u.right,l.right),l.bottom=Nl(u.bottom,l.bottom),l.left=uo(u.left,l.left),l},Aw(t,s,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function $k(t){var e=t.reference,n=t.element,r=t.placement,o=r?Fn(r):null,i=r?gi(r):null,s=e.x+e.width/2-n.width/2,a=e.y+e.height/2-n.height/2,l;switch(o){case Xt:l={x:s,y:e.y-n.height};break;case yn:l={x:s,y:e.y+e.height};break;case wn:l={x:e.x+e.width,y:a};break;case Yt:l={x:e.x-n.width,y:a};break;default:l={x:e.x,y:e.y}}var c=o?jf(o):null;if(c!=null){var u=c==="y"?"height":"width";switch(i){case fi:l[c]=l[c]-(e[u]/2-n[u]/2);break;case Ds:l[c]=l[c]+(e[u]/2-n[u]/2);break}}return l}function _s(t,e){e===void 0&&(e={});var n=e,r=n.placement,o=r===void 0?t.placement:r,i=n.strategy,s=i===void 0?t.strategy:i,a=n.boundary,l=a===void 0?vI:a,c=n.rootBoundary,u=c===void 0?bk:c,d=n.elementContext,p=d===void 0?Mi:d,f=n.altBoundary,h=f===void 0?!1:f,m=n.padding,y=m===void 0?0:m,g=Ck(typeof y!="number"?y:Ek(y,Ys)),v=p===Mi?xI:Mi,k=t.rects.popper,b=t.elements[h?v:p],C=QI(bo(b)?b:b.contextElement||jr(t.elements.popper),l,u,s),D=mi(t.elements.reference),M=$k({reference:D,element:k,placement:o}),I=kp(Object.assign({},k,M)),E=p===Mi?I:D,G={top:C.top-E.top+g.top,bottom:E.bottom-C.bottom+g.bottom,left:C.left-E.left+g.left,right:E.right-C.right+g.right},oe=t.modifiersData.offset;if(p===Mi&&oe){var N=oe[o];Object.keys(G).forEach(function(H){var A=[wn,yn].indexOf(H)>=0?1:-1,J=[Xt,yn].indexOf(H)>=0?"y":"x";G[H]+=N[J]*A})}return G}function eF(t,e){e===void 0&&(e={});var n=e,r=n.placement,o=n.boundary,i=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=l===void 0?vk:l,u=gi(r),d=u?a?vw:vw.filter(function(h){return gi(h)===u}):Ys,p=d.filter(function(h){return c.indexOf(h)>=0});p.length===0&&(p=d);var f=p.reduce(function(h,m){return h[m]=_s(t,{placement:m,boundary:o,rootBoundary:i,padding:s})[Fn(m)],h},{});return Object.keys(f).sort(function(h,m){return f[h]-f[m]})}function tF(t){if(Fn(t)===Lf)return[];var e=Qa(t);return[Sw(t),e,Sw(e)]}function nF(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var o=n.mainAxis,i=o===void 0?!0:o,s=n.altAxis,a=s===void 0?!0:s,l=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,p=n.altBoundary,f=n.flipVariations,h=f===void 0?!0:f,m=n.allowedAutoPlacements,y=e.options.placement,g=Fn(y),v=g===y,k=l||(v||!h?[Qa(y)]:tF(y)),b=[y].concat(k).reduce(function(ne,se){return ne.concat(Fn(se)===Lf?eF(e,{placement:se,boundary:u,rootBoundary:d,padding:c,flipVariations:h,allowedAutoPlacements:m}):se)},[]),C=e.rects.reference,D=e.rects.popper,M=new Map,I=!0,E=b[0],G=0;G<b.length;G++){var oe=b[G],N=Fn(oe),H=gi(oe)===fi,A=[Xt,yn].indexOf(N)>=0,J=A?"width":"height",ie=_s(e,{placement:oe,boundary:u,rootBoundary:d,altBoundary:p,padding:c}),W=A?H?wn:Yt:H?yn:Xt;C[J]>D[J]&&(W=Qa(W));var ce=Qa(W),X=[];if(i&&X.push(ie[N]<=0),a&&X.push(ie[W]<=0,ie[ce]<=0),X.every(function(ne){return ne})){E=oe,I=!1;break}M.set(oe,X)}if(I)for(var ue=h?3:1,Z=function(ne){var se=b.find(function(Y){var $=M.get(Y);if($)return $.slice(0,ne).every(function(T){return T})});if(se)return E=se,"break"},R=ue;R>0;R--){var ee=Z(R);if(ee==="break")break}e.placement!==E&&(e.modifiersData[r]._skip=!0,e.placement=E,e.reset=!0)}}const rF={name:"flip",enabled:!0,phase:"main",fn:nF,requiresIfExists:["offset"],data:{_skip:!1}};function Cw(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function Ew(t){return[Xt,wn,yn,Yt].some(function(e){return t[e]>=0})}function oF(t){var e=t.state,n=t.name,r=e.rects.reference,o=e.rects.popper,i=e.modifiersData.preventOverflow,s=_s(e,{elementContext:"reference"}),a=_s(e,{altBoundary:!0}),l=Cw(s,r),c=Cw(a,o,i),u=Ew(l),d=Ew(c);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}const iF={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:oF};function sF(t,e,n){var r=Fn(t),o=[Yt,Xt].indexOf(r)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=i[0],a=i[1];return s=s||0,a=(a||0)*o,[Yt,wn].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}function aF(t){var e=t.state,n=t.options,r=t.name,o=n.offset,i=o===void 0?[0,0]:o,s=vk.reduce(function(u,d){return u[d]=sF(d,e.rects,i),u},{}),a=s[e.placement],l=a.x,c=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=s}const lF={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:aF};function cF(t){var e=t.state,n=t.name;e.modifiersData[n]=$k({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})}const uF={name:"popperOffsets",enabled:!0,phase:"read",fn:cF,data:{}};function dF(t){return t==="x"?"y":"x"}function pF(t){var e=t.state,n=t.options,r=t.name,o=n.mainAxis,i=o===void 0?!0:o,s=n.altAxis,a=s===void 0?!1:s,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,d=n.padding,p=n.tether,f=p===void 0?!0:p,h=n.tetherOffset,m=h===void 0?0:h,y=_s(e,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),g=Fn(e.placement),v=gi(e.placement),k=!v,b=jf(g),C=dF(b),D=e.modifiersData.popperOffsets,M=e.rects.reference,I=e.rects.popper,E=typeof m=="function"?m(Object.assign({},e.rects,{placement:e.placement})):m,G=typeof E=="number"?{mainAxis:E,altAxis:E}:Object.assign({mainAxis:0,altAxis:0},E),oe=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,N={x:0,y:0};if(D){if(i){var H,A=b==="y"?Xt:Yt,J=b==="y"?yn:wn,ie=b==="y"?"height":"width",W=D[b],ce=W+y[A],X=W-y[J],ue=f?-I[ie]/2:0,Z=v===fi?M[ie]:I[ie],R=v===fi?-I[ie]:-M[ie],ee=e.elements.arrow,ne=f&&ee?zf(ee):{width:0,height:0},se=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Ak(),Y=se[A],$=se[J],T=as(0,M[ie],ne[ie]),K=k?M[ie]/2-ue-T-Y-G.mainAxis:Z-T-Y-G.mainAxis,q=k?-M[ie]/2+ue+T+$+G.mainAxis:R+T+$+G.mainAxis,F=e.elements.arrow&&Zs(e.elements.arrow),L=F?b==="y"?F.clientTop||0:F.clientLeft||0:0,le=(H=oe?.[b])!=null?H:0,S=W+K-le-L,re=W+q-le,Q=as(f?Nl(ce,S):ce,W,f?uo(X,re):X);D[b]=Q,N[b]=Q-W}if(a){var z,V=b==="x"?Xt:Yt,j=b==="x"?yn:wn,de=D[C],fe=C==="y"?"height":"width",ae=de+y[V],me=de-y[j],we=[Xt,Yt].indexOf(g)!==-1,he=(z=oe?.[C])!=null?z:0,be=we?ae:de-M[fe]-I[fe]-he+G.altAxis,ze=we?de+M[fe]+I[fe]-he-G.altAxis:me,Ce=f&&we?RI(be,de,ze):as(f?be:ae,de,f?ze:me);D[C]=Ce,N[C]=Ce-de}e.modifiersData[r]=N}}const fF={name:"preventOverflow",enabled:!0,phase:"main",fn:pF,requiresIfExists:["offset"]};function hF(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function mF(t){return t===un(t)||!gn(t)?qf(t):hF(t)}function gF(t){var e=t.getBoundingClientRect(),n=hi(e.width)/t.offsetWidth||1,r=hi(e.height)/t.offsetHeight||1;return n!==1||r!==1}function yF(t,e,n){n===void 0&&(n=!1);var r=gn(e),o=gn(e)&&gF(e),i=jr(e),s=mi(t,o,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((Pn(e)!=="body"||Uf(i))&&(a=mF(e)),gn(e)?(l=mi(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):i&&(l.x=Vf(i))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function wF(t){var e=new Map,n=new Set,r=[];t.forEach(function(i){e.set(i.name,i)});function o(i){n.add(i.name);var s=[].concat(i.requires||[],i.requiresIfExists||[]);s.forEach(function(a){if(!n.has(a)){var l=e.get(a);l&&o(l)}}),r.push(i)}return t.forEach(function(i){n.has(i.name)||o(i)}),r}function bF(t){var e=wF(t);return DI.reduce(function(n,r){return n.concat(e.filter(function(o){return o.phase===r}))},[])}function vF(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function xF(t){var e=t.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var Tw={placement:"bottom",modifiers:[],strategy:"absolute"};function $w(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function kF(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,o=e.defaultOptions,i=o===void 0?Tw:o;return function(s,a,l){l===void 0&&(l=i);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},Tw,i),modifiersData:{},elements:{reference:s,popper:a},attributes:{},styles:{}},u=[],d=!1,p={state:c,setOptions:function(m){var y=typeof m=="function"?m(c.options):m;h(),c.options=Object.assign({},i,c.options,y),c.scrollParents={reference:bo(s)?ls(s):s.contextElement?ls(s.contextElement):[],popper:ls(a)};var g=bF(xF([].concat(r,c.options.modifiers)));return c.orderedModifiers=g.filter(function(v){return v.enabled}),f(),p.update()},forceUpdate:function(){if(!d){var m=c.elements,y=m.reference,g=m.popper;if($w(y,g)){c.rects={reference:yF(y,Zs(g),c.options.strategy==="fixed"),popper:zf(g)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(I){return c.modifiersData[I.name]=Object.assign({},I.data)});for(var v=0;v<c.orderedModifiers.length;v++){if(c.reset===!0){c.reset=!1,v=-1;continue}var k=c.orderedModifiers[v],b=k.fn,C=k.options,D=C===void 0?{}:C,M=k.name;typeof b=="function"&&(c=b({state:c,options:D,name:M,instance:p})||c)}}}},update:vF(function(){return new Promise(function(m){p.forceUpdate(),m(c)})}),destroy:function(){h(),d=!0}};if(!$w(s,a))return p;p.setOptions(l).then(function(m){!d&&l.onFirstUpdate&&l.onFirstUpdate(m)});function f(){c.orderedModifiers.forEach(function(m){var y=m.name,g=m.options,v=g===void 0?{}:g,k=m.effect;if(typeof k=="function"){var b=k({state:c,name:y,instance:p,options:v}),C=function(){};u.push(b||C)}})}function h(){u.forEach(function(m){return m()}),u=[]}return p}}var SF=[WI,uF,UI,xk,lF,rF,fF,zI,iF],AF=kF({defaultModifiers:SF}),CF="tippy-box",Ok="tippy-content",EF="tippy-backdrop",Mk="tippy-arrow",Dk="tippy-svg-arrow",Kr={passive:!0,capture:!0},_k=function(){return document.body};function TF(t,e){return{}.hasOwnProperty.call(t,e)}function Ku(t,e,n){if(Array.isArray(t)){var r=t[e];return r??(Array.isArray(n)?n[e]:n)}return t}function Hf(t,e){var n={}.toString.call(t);return n.indexOf("[object")===0&&n.indexOf(e+"]")>-1}function Nk(t,e){return typeof t=="function"?t.apply(void 0,e):t}function Ow(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function $F(t,e){var n=Object.assign({},t);return e.forEach(function(r){delete n[r]}),n}function OF(t){return t.split(/\s+/).filter(Boolean)}function Uo(t){return[].concat(t)}function Mw(t,e){t.indexOf(e)===-1&&t.push(e)}function MF(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function DF(t){return t.split("-")[0]}function Il(t){return[].slice.call(t)}function Dw(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function cs(){return document.createElement("div")}function Ns(t){return["Element","Fragment"].some(function(e){return Hf(t,e)})}function _F(t){return Hf(t,"NodeList")}function NF(t){return Hf(t,"MouseEvent")}function IF(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function FF(t){return Ns(t)?[t]:_F(t)?Il(t):Array.isArray(t)?t:Il(document.querySelectorAll(t))}function Ju(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function _w(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function RF(t){var e,n=Uo(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function BF(t,e){var n=e.clientX,r=e.clientY;return t.every(function(o){var i=o.popperRect,s=o.popperState,a=o.props,l=a.interactiveBorder,c=DF(s.placement),u=s.modifiersData.offset;if(!u)return!0;var d=c==="bottom"?u.top.y:0,p=c==="top"?u.bottom.y:0,f=c==="right"?u.left.x:0,h=c==="left"?u.right.x:0,m=i.top-r+d>l,y=r-i.bottom-p>l,g=i.left-n+f>l,v=n-i.right-h>l;return m||y||g||v})}function Xu(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(o){t[r](o,n)})}function Nw(t,e){for(var n=e;n;){var r;if(t.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var Mn={isTouch:!1},Iw=0;function LF(){Mn.isTouch||(Mn.isTouch=!0,window.performance&&document.addEventListener("mousemove",Ik))}function Ik(){var t=performance.now();t-Iw<20&&(Mn.isTouch=!1,document.removeEventListener("mousemove",Ik)),Iw=t}function PF(){var t=document.activeElement;if(IF(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function zF(){document.addEventListener("touchstart",LF,Kr),window.addEventListener("blur",PF)}var jF=typeof window<"u"&&typeof document<"u",qF=jF?!!window.msCrypto:!1;function _o(t){var e=t==="destroy"?"n already-":" ";return[t+"() was called on a"+e+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function Fw(t){var e=/[ \t]{2,}/g,n=/^[ \t]*/gm;return t.replace(e," ").replace(n,"").trim()}function VF(t){return Fw(`
54
+ %ctippy.js
55
+
56
+ %c`+Fw(t)+`
57
+
58
+ %c👷‍ This is a development-only message. It will be removed in production.
59
+ `)}function Fk(t){return[VF(t),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var Is;Se.env.NODE_ENV!=="production"&&UF();function UF(){Is=new Set}function Jn(t,e){if(t&&!Is.has(e)){var n;Is.add(e),(n=console).warn.apply(n,Fk(e))}}function Sp(t,e){if(t&&!Is.has(e)){var n;Is.add(e),(n=console).error.apply(n,Fk(e))}}function HF(t){var e=!t,n=Object.prototype.toString.call(t)==="[object Object]"&&!t.addEventListener;Sp(e,["tippy() was passed","`"+String(t)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),Sp(n,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var Rk={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},WF={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},sn=Object.assign({appendTo:_k,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Rk,WF),GF=Object.keys(sn),KF=function(t){Se.env.NODE_ENV!=="production"&&Lk(t,[]);var e=Object.keys(t);e.forEach(function(n){sn[n]=t[n]})};function Bk(t){var e=t.plugins||[],n=e.reduce(function(r,o){var i=o.name,s=o.defaultValue;if(i){var a;r[i]=t[i]!==void 0?t[i]:(a=sn[i])!=null?a:s}return r},{});return Object.assign({},t,n)}function JF(t,e){var n=e?Object.keys(Bk(Object.assign({},sn,{plugins:e}))):GF,r=n.reduce(function(o,i){var s=(t.getAttribute("data-tippy-"+i)||"").trim();if(!s)return o;if(i==="content")o[i]=s;else try{o[i]=JSON.parse(s)}catch{o[i]=s}return o},{});return r}function Rw(t,e){var n=Object.assign({},e,{content:Nk(e.content,[t])},e.ignoreAttributes?{}:JF(t,e.plugins));return n.aria=Object.assign({},sn.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?e.interactive:n.aria.expanded,content:n.aria.content==="auto"?e.interactive?null:"describedby":n.aria.content},n}function Lk(t,e){t===void 0&&(t={}),e===void 0&&(e=[]);var n=Object.keys(t);n.forEach(function(r){var o=$F(sn,Object.keys(Rk)),i=!TF(o,r);i&&(i=e.filter(function(s){return s.name===r}).length===0),Jn(i,["`"+r+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.",`
60
+
61
+ `,`All props: https://atomiks.github.io/tippyjs/v6/all-props/
62
+ `,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var XF=function(){return"innerHTML"};function Ap(t,e){t[XF()]=e}function Bw(t){var e=cs();return t===!0?e.className=Mk:(e.className=Dk,Ns(t)?e.appendChild(t):Ap(e,t)),e}function Lw(t,e){Ns(e.content)?(Ap(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?Ap(t,e.content):t.textContent=e.content)}function Cp(t){var e=t.firstElementChild,n=Il(e.children);return{box:e,content:n.find(function(r){return r.classList.contains(Ok)}),arrow:n.find(function(r){return r.classList.contains(Mk)||r.classList.contains(Dk)}),backdrop:n.find(function(r){return r.classList.contains(EF)})}}function Pk(t){var e=cs(),n=cs();n.className=CF,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=cs();r.className=Ok,r.setAttribute("data-state","hidden"),Lw(r,t.props),e.appendChild(n),n.appendChild(r),o(t.props,t.props);function o(i,s){var a=Cp(e),l=a.box,c=a.content,u=a.arrow;s.theme?l.setAttribute("data-theme",s.theme):l.removeAttribute("data-theme"),typeof s.animation=="string"?l.setAttribute("data-animation",s.animation):l.removeAttribute("data-animation"),s.inertia?l.setAttribute("data-inertia",""):l.removeAttribute("data-inertia"),l.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?l.setAttribute("role",s.role):l.removeAttribute("role"),(i.content!==s.content||i.allowHTML!==s.allowHTML)&&Lw(c,t.props),s.arrow?u?i.arrow!==s.arrow&&(l.removeChild(u),l.appendChild(Bw(s.arrow))):l.appendChild(Bw(s.arrow)):u&&l.removeChild(u)}return{popper:e,onUpdate:o}}Pk.$$tippy=!0;var YF=1,va=[],Yu=[];function ZF(t,e){var n=Rw(t,Object.assign({},sn,Bk(Dw(e)))),r,o,i,s=!1,a=!1,l=!1,c=!1,u,d,p,f=[],h=Ow(S,n.interactiveDebounce),m,y=YF++,g=null,v=MF(n.plugins),k={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},b={id:y,reference:t,popper:cs(),popperInstance:g,props:n,state:k,plugins:v,clearDelayTimeouts:be,setProps:ze,setContent:Ce,show:ct,hide:x,hideWithInteractivity:O,enable:we,disable:he,unmount:_,destroy:P};if(!n.render)return Se.env.NODE_ENV!=="production"&&Sp(!0,"render() function has not been supplied."),b;var C=n.render(b),D=C.popper,M=C.onUpdate;D.setAttribute("data-tippy-root",""),D.id="tippy-"+b.id,b.popper=D,t._tippy=b,D._tippy=b;var I=v.map(function(B){return B.fn(b)}),E=t.hasAttribute("aria-expanded");return F(),ue(),W(),ce("onCreate",[b]),n.showOnCreate&&ae(),D.addEventListener("mouseenter",function(){b.props.interactive&&b.state.isVisible&&b.clearDelayTimeouts()}),D.addEventListener("mouseleave",function(){b.props.interactive&&b.props.trigger.indexOf("mouseenter")>=0&&A().addEventListener("mousemove",h)}),b;function G(){var B=b.props.touch;return Array.isArray(B)?B:[B,0]}function oe(){return G()[0]==="hold"}function N(){var B;return!!((B=b.props.render)!=null&&B.$$tippy)}function H(){return m||t}function A(){var B=H().parentNode;return B?RF(B):document}function J(){return Cp(D)}function ie(B){return b.state.isMounted&&!b.state.isVisible||Mn.isTouch||u&&u.type==="focus"?0:Ku(b.props.delay,B?0:1,sn.delay)}function W(B){B===void 0&&(B=!1),D.style.pointerEvents=b.props.interactive&&!B?"":"none",D.style.zIndex=""+b.props.zIndex}function ce(B,U,te){if(te===void 0&&(te=!0),I.forEach(function(xe){xe[B]&&xe[B].apply(xe,U)}),te){var ge;(ge=b.props)[B].apply(ge,U)}}function X(){var B=b.props.aria;if(B.content){var U="aria-"+B.content,te=D.id,ge=Uo(b.props.triggerTarget||t);ge.forEach(function(xe){var ke=xe.getAttribute(U);if(b.state.isVisible)xe.setAttribute(U,ke?ke+" "+te:te);else{var Oe=ke&&ke.replace(te,"").trim();Oe?xe.setAttribute(U,Oe):xe.removeAttribute(U)}})}}function ue(){if(!(E||!b.props.aria.expanded)){var B=Uo(b.props.triggerTarget||t);B.forEach(function(U){b.props.interactive?U.setAttribute("aria-expanded",b.state.isVisible&&U===H()?"true":"false"):U.removeAttribute("aria-expanded")})}}function Z(){A().removeEventListener("mousemove",h),va=va.filter(function(B){return B!==h})}function R(B){if(!(Mn.isTouch&&(l||B.type==="mousedown"))){var U=B.composedPath&&B.composedPath()[0]||B.target;if(!(b.props.interactive&&Nw(D,U))){if(Uo(b.props.triggerTarget||t).some(function(te){return Nw(te,U)})){if(Mn.isTouch||b.state.isVisible&&b.props.trigger.indexOf("click")>=0)return}else ce("onClickOutside",[b,B]);b.props.hideOnClick===!0&&(b.clearDelayTimeouts(),b.hide(),a=!0,setTimeout(function(){a=!1}),b.state.isMounted||Y())}}}function ee(){l=!0}function ne(){l=!1}function se(){var B=A();B.addEventListener("mousedown",R,!0),B.addEventListener("touchend",R,Kr),B.addEventListener("touchstart",ne,Kr),B.addEventListener("touchmove",ee,Kr)}function Y(){var B=A();B.removeEventListener("mousedown",R,!0),B.removeEventListener("touchend",R,Kr),B.removeEventListener("touchstart",ne,Kr),B.removeEventListener("touchmove",ee,Kr)}function $(B,U){K(B,function(){!b.state.isVisible&&D.parentNode&&D.parentNode.contains(D)&&U()})}function T(B,U){K(B,U)}function K(B,U){var te=J().box;function ge(xe){xe.target===te&&(Xu(te,"remove",ge),U())}if(B===0)return U();Xu(te,"remove",d),Xu(te,"add",ge),d=ge}function q(B,U,te){te===void 0&&(te=!1);var ge=Uo(b.props.triggerTarget||t);ge.forEach(function(xe){xe.addEventListener(B,U,te),f.push({node:xe,eventType:B,handler:U,options:te})})}function F(){oe()&&(q("touchstart",le,{passive:!0}),q("touchend",re,{passive:!0})),OF(b.props.trigger).forEach(function(B){if(B!=="manual")switch(q(B,le),B){case"mouseenter":q("mouseleave",re);break;case"focus":q(qF?"focusout":"blur",Q);break;case"focusin":q("focusout",Q);break}})}function L(){f.forEach(function(B){var U=B.node,te=B.eventType,ge=B.handler,xe=B.options;U.removeEventListener(te,ge,xe)}),f=[]}function le(B){var U,te=!1;if(!(!b.state.isEnabled||z(B)||a)){var ge=((U=u)==null?void 0:U.type)==="focus";u=B,m=B.currentTarget,ue(),!b.state.isVisible&&NF(B)&&va.forEach(function(xe){return xe(B)}),B.type==="click"&&(b.props.trigger.indexOf("mouseenter")<0||s)&&b.props.hideOnClick!==!1&&b.state.isVisible?te=!0:ae(B),B.type==="click"&&(s=!te),te&&!ge&&me(B)}}function S(B){var U=B.target,te=H().contains(U)||D.contains(U);if(!(B.type==="mousemove"&&te)){var ge=fe().concat(D).map(function(xe){var ke,Oe=xe._tippy,Ne=(ke=Oe.popperInstance)==null?void 0:ke.state;return Ne?{popperRect:xe.getBoundingClientRect(),popperState:Ne,props:n}:null}).filter(Boolean);BF(ge,B)&&(Z(),me(B))}}function re(B){var U=z(B)||b.props.trigger.indexOf("click")>=0&&s;if(!U){if(b.props.interactive){b.hideWithInteractivity(B);return}me(B)}}function Q(B){b.props.trigger.indexOf("focusin")<0&&B.target!==H()||b.props.interactive&&B.relatedTarget&&D.contains(B.relatedTarget)||me(B)}function z(B){return Mn.isTouch?oe()!==B.type.indexOf("touch")>=0:!1}function V(){j();var B=b.props,U=B.popperOptions,te=B.placement,ge=B.offset,xe=B.getReferenceClientRect,ke=B.moveTransition,Oe=N()?Cp(D).arrow:null,Ne=xe?{getBoundingClientRect:xe,contextElement:xe.contextElement||H()}:t,Je={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Sn){var pr=Sn.state;if(N()){var kc=J(),Ti=kc.box;["placement","reference-hidden","escaped"].forEach(function(Eo){Eo==="placement"?Ti.setAttribute("data-placement",pr.placement):pr.attributes.popper["data-popper-"+Eo]?Ti.setAttribute("data-"+Eo,""):Ti.removeAttribute("data-"+Eo)}),pr.attributes.popper={}}}},it=[{name:"offset",options:{offset:ge}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!ke}},Je];N()&&Oe&&it.push({name:"arrow",options:{element:Oe,padding:3}}),it.push.apply(it,U?.modifiers||[]),b.popperInstance=AF(Ne,D,Object.assign({},U,{placement:te,onFirstUpdate:p,modifiers:it}))}function j(){b.popperInstance&&(b.popperInstance.destroy(),b.popperInstance=null)}function de(){var B=b.props.appendTo,U,te=H();b.props.interactive&&B===_k||B==="parent"?U=te.parentNode:U=Nk(B,[te]),U.contains(D)||U.appendChild(D),b.state.isMounted=!0,V(),Se.env.NODE_ENV!=="production"&&Jn(b.props.interactive&&B===sn.appendTo&&te.nextElementSibling!==D,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.",`
63
+
64
+ `,"Using a wrapper <div> or <span> tag around the reference element","solves this by creating a new parentNode context.",`
65
+
66
+ `,"Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.",`
67
+
68
+ `,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function fe(){return Il(D.querySelectorAll("[data-tippy-root]"))}function ae(B){b.clearDelayTimeouts(),B&&ce("onTrigger",[b,B]),se();var U=ie(!0),te=G(),ge=te[0],xe=te[1];Mn.isTouch&&ge==="hold"&&xe&&(U=xe),U?r=setTimeout(function(){b.show()},U):b.show()}function me(B){if(b.clearDelayTimeouts(),ce("onUntrigger",[b,B]),!b.state.isVisible){Y();return}if(!(b.props.trigger.indexOf("mouseenter")>=0&&b.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(B.type)>=0&&s)){var U=ie(!1);U?o=setTimeout(function(){b.state.isVisible&&b.hide()},U):i=requestAnimationFrame(function(){b.hide()})}}function we(){b.state.isEnabled=!0}function he(){b.hide(),b.state.isEnabled=!1}function be(){clearTimeout(r),clearTimeout(o),cancelAnimationFrame(i)}function ze(B){if(Se.env.NODE_ENV!=="production"&&Jn(b.state.isDestroyed,_o("setProps")),!b.state.isDestroyed){ce("onBeforeUpdate",[b,B]),L();var U=b.props,te=Rw(t,Object.assign({},U,Dw(B),{ignoreAttributes:!0}));b.props=te,F(),U.interactiveDebounce!==te.interactiveDebounce&&(Z(),h=Ow(S,te.interactiveDebounce)),U.triggerTarget&&!te.triggerTarget?Uo(U.triggerTarget).forEach(function(ge){ge.removeAttribute("aria-expanded")}):te.triggerTarget&&t.removeAttribute("aria-expanded"),ue(),W(),M&&M(U,te),b.popperInstance&&(V(),fe().forEach(function(ge){requestAnimationFrame(ge._tippy.popperInstance.forceUpdate)})),ce("onAfterUpdate",[b,B])}}function Ce(B){b.setProps({content:B})}function ct(){Se.env.NODE_ENV!=="production"&&Jn(b.state.isDestroyed,_o("show"));var B=b.state.isVisible,U=b.state.isDestroyed,te=!b.state.isEnabled,ge=Mn.isTouch&&!b.props.touch,xe=Ku(b.props.duration,0,sn.duration);if(!(B||U||te||ge)&&!H().hasAttribute("disabled")&&(ce("onShow",[b],!1),b.props.onShow(b)!==!1)){if(b.state.isVisible=!0,N()&&(D.style.visibility="visible"),W(),se(),b.state.isMounted||(D.style.transition="none"),N()){var ke=J(),Oe=ke.box,Ne=ke.content;Ju([Oe,Ne],0)}p=function(){var Je;if(!(!b.state.isVisible||c)){if(c=!0,D.offsetHeight,D.style.transition=b.props.moveTransition,N()&&b.props.animation){var it=J(),Sn=it.box,pr=it.content;Ju([Sn,pr],xe),_w([Sn,pr],"visible")}X(),ue(),Mw(Yu,b),(Je=b.popperInstance)==null||Je.forceUpdate(),ce("onMount",[b]),b.props.animation&&N()&&T(xe,function(){b.state.isShown=!0,ce("onShown",[b])})}},de()}}function x(){Se.env.NODE_ENV!=="production"&&Jn(b.state.isDestroyed,_o("hide"));var B=!b.state.isVisible,U=b.state.isDestroyed,te=!b.state.isEnabled,ge=Ku(b.props.duration,1,sn.duration);if(!(B||U||te)&&(ce("onHide",[b],!1),b.props.onHide(b)!==!1)){if(b.state.isVisible=!1,b.state.isShown=!1,c=!1,s=!1,N()&&(D.style.visibility="hidden"),Z(),Y(),W(!0),N()){var xe=J(),ke=xe.box,Oe=xe.content;b.props.animation&&(Ju([ke,Oe],ge),_w([ke,Oe],"hidden"))}X(),ue(),b.props.animation?N()&&$(ge,b.unmount):b.unmount()}}function O(B){Se.env.NODE_ENV!=="production"&&Jn(b.state.isDestroyed,_o("hideWithInteractivity")),A().addEventListener("mousemove",h),Mw(va,h),h(B)}function _(){Se.env.NODE_ENV!=="production"&&Jn(b.state.isDestroyed,_o("unmount")),b.state.isVisible&&b.hide(),b.state.isMounted&&(j(),fe().forEach(function(B){B._tippy.unmount()}),D.parentNode&&D.parentNode.removeChild(D),Yu=Yu.filter(function(B){return B!==b}),b.state.isMounted=!1,ce("onHidden",[b]))}function P(){Se.env.NODE_ENV!=="production"&&Jn(b.state.isDestroyed,_o("destroy")),!b.state.isDestroyed&&(b.clearDelayTimeouts(),b.unmount(),L(),delete t._tippy,b.state.isDestroyed=!0,ce("onDestroy",[b]))}}function Qs(t,e){e===void 0&&(e={});var n=sn.plugins.concat(e.plugins||[]);Se.env.NODE_ENV!=="production"&&(HF(t),Lk(e,n)),zF();var r=Object.assign({},e,{plugins:n}),o=FF(t);if(Se.env.NODE_ENV!=="production"){var i=Ns(r.content),s=o.length>1;Jn(i&&s,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.",`
69
+
70
+ `,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",`
71
+
72
+ `,`1) content: element.innerHTML
73
+ `,"2) content: () => element.cloneNode(true)"].join(" "))}var a=o.reduce(function(l,c){var u=c&&ZF(c,r);return u&&l.push(u),l},[]);return Ns(t)?a[0]:a}Qs.defaultProps=sn;Qs.setDefaultProps=KF;Qs.currentInput=Mn;Object.assign({},xk,{effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow)}});Qs.setDefaultProps({render:Pk});const ft=(t,e)=>{const n=t.__vccOpts||t;for(const[r,o]of e)n[r]=o;return n},QF=["onClick","onMouseenter"],eR={key:0},tR={key:0},nR={key:1},rR={key:1},oR={__name:"Mentions",props:{users:{type:Array,required:!0},mention:{type:String,default:""},inserMention:{type:Function,required:!0}},setup(t){const e=t,n=w.ref(null),r=w.ref(null),o=w.computed(()=>{const l=e.mention.slice(1)?.toLowerCase();return e.users.filter(c=>{const u=c.role==="viewer",d=c.name?.toLowerCase().startsWith(l),p=c.email?.toLowerCase().startsWith(l);return!u&&(d||p)})||[]}),i=l=>{e.inserMention(l)},s=l=>{if(l.key==="ArrowDown")r.value+=1,r.value===o.value.length&&(r.value=0);else if(l.key==="ArrowUp")r.value-=1,r.value<0&&(r.value=o.value.length-1);else if(l.key==="Enter"){const c=o.value[r.value];c&&e.inserMention(c)}},a=()=>{r.value=0};return(l,c)=>(w.openBlock(),w.createElementBlock("div",{class:"mentions-container",ref_key:"container",ref:n,onKeydown:w.withModifiers(s,["prevent"]),onFocus:w.withModifiers(a,["stop","prevent"]),tabindex:"0"},[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(o.value,(u,d)=>(w.openBlock(),w.createElementBlock("div",{onClick:w.withModifiers(p=>i(u),["stop","prevent"]),onMouseenter:p=>r.value=d,onMouseleave:c[0]||(c[0]=p=>r.value=null),key:u.email,class:w.normalizeClass(["user-row",{selected:r.value===d}])},[u.name?(w.openBlock(),w.createElementBlock("div",eR,[u.name?(w.openBlock(),w.createElementBlock("span",tR,w.toDisplayString(u.name),1)):w.createCommentVNode("",!0),u.name&&u.email?(w.openBlock(),w.createElementBlock("span",nR," ("+w.toDisplayString(u.email)+")",1)):w.createCommentVNode("",!0)])):(w.openBlock(),w.createElementBlock("div",rR,[w.createBaseVNode("span",null,w.toDisplayString(u.email),1)]))],42,QF))),128))],544))}},iR=ft(oR,[["__scopeId","data-v-0a2a8b4e"]]),Pw=new Ge("popoverPlugin"),sR=Ye.create({name:"popoverPlugin",addPmPlugins(){return[new Ue({key:Pw,state:{init:()=>({}),apply:(t,e,n,r)=>{let o={...e};return t.docChanged?o.shouldUpdate=!0:o.shouldUpdate=!1,o}},view:t=>{const e=new aR(t,this.editor);return{update:(n,r)=>{Pw.getState(n.state).shouldUpdate&&e.update(n,r)},destroy:()=>{e.destroy()}}}})]}});class aR{constructor(e,n){Re(this,"handleKeyDown",r=>{const o=r.key==="ArrowDown"||r.key==="ArrowUp";this.tippyInstance.state.isVisible&&o&&(r.preventDefault(),this.popover.firstChild.focus())}),this.editor=n,this.view=e,this.popover=document.createElement("div"),this.popover.className="sd-editor-popover",document.body.appendChild(this.popover),this.tippyInstance=Qs(this.popover,{trigger:"manual",placement:"bottom-start",interactive:!0,appendTo:document.body,arrow:!1,onShow:r=>{r.setProps({getReferenceClientRect:()=>this.popoverRect}),this.bindKeyDownEvents()},onHide:()=>{this.unbindKeyDownEvents()},theme:"sd-editor-popover"})}bindKeyDownEvents(){this.view.dom.addEventListener("keydown",this.handleKeyDown)}unbindKeyDownEvents(){this.view.dom.removeEventListener("keydown",this.handleKeyDown)}mountVueComponent(e,n={}){this.app&&this.app.unmount(),this.app=w.createApp(e,n),this.app.mount(this.popover),this.tippyInstance.setContent(this.popover)}update(e,n){this.state=e.state;const r=this.isShowMentions;let o={component:null,props:null};if(this.isShowMentions){const{from:i}=this.state.selection,s=this.getMentionText(i);o={component:iR,props:{users:this.editor.users,mention:s,inserMention:a=>{const{$from:l}=this.state.selection,c=s.length,u={...a},d=this.editor.schema.nodes.mention.create(u),p=this.state.tr.replaceWith(l.pos-c,l.pos,d);this.editor.view.dispatch(p),this.editor.view.focus()}}}}if(r&&o.component){const{to:i}=this.state.selection,{component:s,props:a}=o;this.mountVueComponent(s,a),this.showPopoverAtPosition(i)}else this.tippyInstance.hide()}showPopoverAtPosition(e){const n=this.view.coordsAtPos(e);this.popoverRect={width:0,height:0,top:n.bottom,left:n.left,bottom:n.bottom,right:n.left},this.tippyInstance.show()}getMentionText(e){const n=Math.max(0,e-20),r=this.state.doc.textBetween(n,e,`
74
+ `,"\0"),o=r.lastIndexOf("@");return o!==-1?r.substring(o):""}get isShowMentions(){const{from:e}=this.state.selection;if(e<1)return!1;const n=this.getMentionText(e),r=/(?:^|\s)@[\w]*$/;return n.match(r)&&this.state.selection.empty}destroy(){this.tippyInstance.destroy(),this.popover.remove()}}const lR=!1,cR=Ye.create({name:"pagination",addStorage(){return{height:0,sectionData:null}},addCommands(){return{insertPageBreak:()=>({commands:t})=>t.insertContent({type:"hardBreak"})}},addShortcuts(){return{"Mod-Enter":()=>this.editor.commands.insertPageBreak()}},addPmPlugins(){const t=this.editor;let e=!1,n=!1,r=!1,o=!1;return[new Ue({key:_r,state:{isReadyToInit:!1,init(i,s){return{isReadyToInit:!1,decorations:De.empty,isDebugging:lR}},apply(i,s,a,l){const c=i.getMeta(_r);c&&c.isReadyToInit&&(n=!0,o=c.isReadyToInit);const u=i.getMeta(co);if(u){if(u.type==="remove"){const p=u.pos,f=t.view.domAtPos(p).node.querySelector("img");f.complete?jw(t):f.onload=()=>jw(t)}return{...s}}if(i.getMeta("fieldAnnotationUpdate"))return{...s};if(!o&&!s.isReadyToInit)return{...s};if(c&&c.decorations)return n=!0,{...s,decorations:c.decorations.map(i.mapping,i.doc)};const d=i.getMeta("forceUpdatePagination");return!d&&a.doc.eq(l.doc)&&r?(n=!1,{...s}):(n=!0,d&&(n=!0),{...s,isReadyToInit:o})}},view:i=>{let s=De.empty;return{update:a=>{!n||e||(e=!0,r=!0,uR(t,a,s),e=!1,n=!1)}}},props:{decorations(i){return _r.getState(i).decorations}}})]}}),Ur=(t,e,n,r=null)=>{const{alternateHeaders:o}=n.converter.pageStyles,i=n.converter[e];if(r&&r.attrs?.paragraphProperties?.sectPr){const d=r.attrs?.paragraphProperties?.sectPr;if(t===1){if(e==="headerIds")return d?.elements?.find(p=>p.name==="w:headerReference"&&p.attributes?.["w:type"]==="first")?.attributes?.["r:id"];if(e==="footerIds")return d?.elements?.find(p=>p.name==="w:footerReference"&&p.attributes?.["w:type"]==="first")?.attributes?.["r:id"]}}if(i?.titlePg&&!i.first&&t===1)return null;const s=i.even,a=i.odd,l=i.first,c=i.default;if(i?.titlePg&&l&&t===1)return l;let u=i.default;return t===1&&(u=c),o&&(t===1&&(u=l),t%2===0?u=s||c:u=a||c),u},uR=(t,e,n)=>{const r=t.storage.pagination.sectionData,o=dR(e,t,r);if(!n.eq(o)){const i=e.state.tr.setMeta(_r,{decorations:o});e.dispatch(i)}t.emit("paginationUpdate")},dR=(t,e,n)=>{if(!e.converter)return De.empty;const r=e.converter.pageStyles?.pageSize,{width:o,height:i}=r;if(!o||!i)return De.empty;const s=[$_,_r],{state:a}=t,l=Zi.create({schema:a.schema,doc:a.doc,plugins:a.plugins.filter(h=>s.includes(h.key))}),c=e.options.element.cloneNode();if(!c)return[];c.className="temp-container super-editor";const u=0,d=0;c.style.left=u+"px",c.style.top=d+"px",c.style.position="fixed",c.style.visibility="hidden",document.body.appendChild(c);const p=new B2(c,{state:l,dispatchTransaction:()=>{}});e.initDefaultStyles(c);const f=pR(l.doc,p,e,n);return p.destroy(),document.body.removeChild(c),De.create(t.state.doc,f)};function pR(t,e,n,r){const o=[],{pageSize:i,pageMargins:s}=n.converter.pageStyles,a=i.height*96;n.options.scale;let l=1,c=a,u=null,d=null;const p=Ur(l,"headerIds",n),f=xa(s,i,r,p,n),h=ka({editor:n,header:f,isFirstHeader:!0});o.push(Le.widget(0,h,{key:"stable-key"}));const m=Ur(l,"footerIds",n),y=Zu(s,i,r,m,n);c-=f.headerHeight+y.footerHeight;let g=e?.coordsAtPos(t.content.size);if(!g)return[];t.descendants((G,oe)=>{let N=G,H=oe;if(g=e?.coordsAtPos(H),!g)return;let A=g.bottom>c,J=N.type.name==="hardBreak";if(N.attrs?.pageBreakSource==="sectPr"&&(t.nodeAt(H+N.nodeSize)?.attrs?.pageBreakSource==="sectPr"||(J=!0),l===1)){const ie=Ur(l,"headerIds",n,N);o.pop();const W=xa(s,i,r,ie),ce=ka({editor:n,header:W,isFirstHeader:!0});o.push(Le.widget(0,ce,{key:"stable-key"}))}if(N.type.name==="paragraph"&&N.attrs.styleId){const ie=Ja.getState(n.state)?.styles?.find(W=>W.id===N.attrs.styleId);if(ie){const{definition:W={}}=ie,{pageBreakBefore:ce,pageBreakAfter:X}=W.attrs||{};(ce||X)&&(A=!0)}}if(J||A){const ie=e.state.doc.resolve(H),W=rc(ie,$=>$.type.name==="tableRow");W&&(N=W.node,H=W.pos);const{top:ce,bottom:X,pos:ue}=fR(e,H,c),Z=Ur(l,"footerIds",n,N);l++;const R=Ur(l,"headerIds",n);d=xa(s,i,r,R,n),u=Zu(s,i,r,Z,n);const ee=c-X,{node:ne}=zw(ee),se=Le.widget(ue,ne,{key:"stable-key"});o.push(se);const Y=ka({editor:n,header:d,footer:u});o.push(Le.widget(ue,Y,{key:"stable-key"})),c=X+(a-d.headerHeight-u.footerHeight)}});let v=t.content.size;const k=e.coordsAtPos(v),b=Ur(l,"headerIds",n),C=Ur(l,"footerIds",n);d=xa(s,i,r,b,n),u=Zu(s,i,r,C,n);const D=c-k.bottom,{node:M}=zw(D),I=Le.widget(t.content.size,M,{key:"stable-key"});o.push(I);const E=ka({editor:n,footer:u,isLastFooter:!0});return o.push(Le.widget(t.content.size,E,{key:"stable-key"})),o.forEach(G=>{const oe=G.type.toDOM?.querySelector('span[data-id="auto-total-pages"]');if(oe){const N=oe.previousElementSibling?.style?.fontSize||oe.nextElementSibling?.style?.fontSize;N&&(oe.style.fontSize=N),oe.innerText=l}}),o}function zw(t){const e=document.createElement("div");return e.className="pagination-page-spacer",e.style.userSelect="none",e.style.pointerEvents="none",e.style.height=t+"px",{nodeHeight:t,node:e}}function xa(t,e,n,r,o){const i=n.headers?.[r],s=t.top*96,a=t.header*96,l=i?.height>s-a?a:0,c=Math.max(i?.height||0,s)+l,u=c-a,d=document.createElement("div");o.converter.headers[r]||(o.converter.headers[r]={type:"doc",content:[{type:"paragraph",content:[]}]});const p=o.converter.headers[r];let f;return p&&(f=lc({editor:o,data:p,editorContainer:d,appendToBody:!1,sectionId:r,type:"header",availableHeight:u}),f.setEditable(!1,!1),o.converter.headerEditors.push({id:r,editor:f}),nx(o,f)),d.className="pagination-section-header",d.style.paddingTop=a+"px",d.style.paddingLeft=t.left*96+"px",d.style.paddingRight=t.right*96+"px",d.style.height=c+"px",d.style.width=e.width*96+"px",d.style.position="static",d.addEventListener("dblclick",()=>zk(o,f)),{section:d,headerHeight:c}}function Zu(t,e,n,r,o,i){const s=n.footers?.[r],a=t.bottom*96,l=t.footer*96,c=Math.max(s?.height||0,a-l),u=document.createElement("div"),d=o.converter.footers[r];let p;return d&&(p=lc({editor:o,data:d,editorContainer:u,appendToBody:!1,sectionId:r,type:"footer",availableHeight:c}),o.converter.footerEditors.push({id:r,editor:p}),p.setEditable(!1,!1),nx(o,p)),u.className="pagination-section-footer",u.style.height=c+"px",u.style.marginBottom=l+"px",u.style.paddingLeft=t.left*96+"px",u.style.paddingRight=t.right*96+"px",u.style.width=e.width*96+"px",u.style.position="static",u.addEventListener("dblclick",()=>zk(o,p)),{section:u,footerHeight:c+l}}const zk=(t,e)=>{t.options.documentMode==="editing"&&(t.setEditable(!1,!1),Ml(t,e,!0))};function ka({editor:t,header:e,footer:n,footerBottom:r=null,isFirstHeader:o,isLastFooter:i}){const{pageSize:s,pageMargins:a}=t.converter.pageStyles;let l=0;const c=document.createElement("div");c.className="pagination-break-wrapper";const u=document.createElement("div");if(u.className="pagination-inner",u.style.width=s.width*96-1+"px",o?u.style.borderRadius="8px 8px 0 0":i&&(u.style.borderRadius="0 0 8px 8px"),c.appendChild(u),n&&(u.appendChild(n.section),l+=n.footerHeight),e&&n){l+=20;const d=document.createElement("div");d.className="pagination-separator",u.appendChild(d)}return e&&(u.appendChild(e.section),l+=e.headerHeight),c.style.height=l+"px",c.style.minHeight=l+"px",c.style.maxHeight=l+"px",u.style.height=l+"px",c.style.width="100px",c.style.marginLeft=a.left*-96+"px",r!==null&&(c.style.position="absolute",c.style.bottom=r+"px"),c}function fR(t,e,n){let r=e-1;const o={top:0,bottom:0,pos:0};for(;r>0;){const{top:i,bottom:s}=t.coordsAtPos(r);if(s<n){Object.assign(o,{top:i,bottom:s,pos:r+1});break}r--}return o}const jw=t=>{requestAnimationFrame(()=>{const e=t.view.state.tr;e.setMeta("forceUpdatePagination",!0),t.view.dispatch(e)})};let jk=class{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&!(this.regexp&&!bR(this.search)),this.wholeWord=!!e.wholeWord,this.filter=e.filter||null,this.impl=this.valid?this.regexp?new gR(this):new mR(this):hR}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}findNext(e,n=0,r=e.doc.content.size){for(;;){if(n>=r)return null;let o=this.impl.findNext(e,n,r);if(!o||this.checkResult(e,o))return o;n=o.from+1}}findPrev(e,n=e.doc.content.size,r=0){for(;;){if(n<=r)return null;let o=this.impl.findPrev(e,n,r);if(!o||this.checkResult(e,o))return o;n=o.to-1}}checkResult(e,n){return(!this.wholeWord||Vw(e,n.from)&&Vw(e,n.to))&&(!this.filter||this.filter(e,n))}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(n,r)=>r=="n"?`
75
+ `:r=="r"?"\r":r=="t"?" ":"\\")}getReplacements(e,n){let r=e.doc.resolve(n.from).marksAcross(e.doc.resolve(n.to)),o=[],i=ye.empty,s=n.from,{match:a}=n,l=a?yR(a):[[0,n.to-n.from]],c=wR(this.unquote(this.replace)),u;for(let d of c)if(typeof d=="string")i=i.addToEnd(e.schema.text(d,r));else if(u=l[d.group]){let p=n.matchStart+u[0],f=n.matchStart+u[1];d.copy?i=i.append(e.doc.slice(p,f).content):((i!=ye.empty||p>s)&&(o.push({from:s,to:p,insert:new ve(i,0,0)}),i=ye.empty),s=f)}return(i!=ye.empty||s<n.to)&&o.push({from:s,to:n.to,insert:new ve(i,0,0)}),o}};const hR=new class{findNext(){return null}findPrev(){return null}};class mR{constructor(e){this.query=e;let n=e.unquote(e.search);e.caseSensitive||(n=n.toLowerCase()),this.string=n}findNext(e,n,r){return yi(e.doc,n,r,(o,i)=>{let s=Math.max(n,i),a=Fs(o).slice(s-i,Math.min(o.content.size,r-i)),l=(this.query.caseSensitive?a:a.toLowerCase()).indexOf(this.string);return l<0?null:{from:s+l,to:s+l+this.string.length,match:null,matchStart:i}})}findPrev(e,n,r){return yi(e.doc,n,r,(o,i)=>{let s=Math.max(i,r),a=Fs(o).slice(s-i,Math.min(o.content.size,n-i));this.query.caseSensitive||(a=a.toLowerCase());let l=a.lastIndexOf(this.string);return l<0?null:{from:s+l,to:s+l+this.string.length,match:null,matchStart:i}})}}const qk="g"+(/x/.unicode==null?"":"u")+(/x/.hasIndices==null?"":"d");class gR{constructor(e){this.query=e,this.regexp=new RegExp(e.search,qk+(e.caseSensitive?"":"i"))}findNext(e,n,r){return yi(e.doc,n,r,(o,i)=>{let s=Fs(o).slice(0,Math.min(o.content.size,r-i));this.regexp.lastIndex=n-i;let a=this.regexp.exec(s);return a?{from:i+a.index,to:i+a.index+a[0].length,match:a,matchStart:i}:null})}findPrev(e,n,r){return yi(e.doc,n,r,(o,i)=>{let s=Fs(o).slice(0,Math.min(o.content.size,n-i)),a;for(let l=0;;){this.regexp.lastIndex=l;let c=this.regexp.exec(s);if(!c)break;a=c,l=c.index+1}return a?{from:i+a.index,to:i+a.index+a[0].length,match:a,matchStart:i}:null})}}function yR(t){if(t.indices)return t.indices;let e=[[0,t[0].length]];for(let n=1,r=0;n<t.length;n++){let o=t[n]?t[0].indexOf(t[n],r):-1;e.push(o<0?void 0:[o,r=o+t[n].length])}return e}function wR(t){let e=[],n=-1;function r(o){let i=e.length-1;i>-1&&typeof e[i]=="string"?e[i]+=o:e.push(o)}for(;t.length;){let o=/\$([$&\d+])/.exec(t);if(!o)return r(t),e;if(o.index>0&&r(t.slice(0,o.index+(o[1]=="$"?1:0))),o[1]!="$"){let i=o[1]=="&"?0:+o[1];n>=i?e.push({group:i,copy:!0}):(n=i||1e3,e.push({group:i,copy:!1}))}t=t.slice(o.index+o[0].length)}return e}function bR(t){try{return new RegExp(t,qk),!0}catch{return!1}}const qw=new WeakMap;function Fs(t){let e=qw.get(t);if(e)return e;let n="";for(let r=0;r<t.childCount;r++){let o=t.child(r);o.isText?n+=o.text:o.isLeaf?n+="":n+=" "+Fs(o)+" "}return qw.set(t,n),n}function yi(t,e,n,r,o=0){if(t.inlineContent)return r(t,o);if(!t.isLeaf)if(e>n)for(let i=t.childCount-1,s=o+t.content.size;i>=0&&s>n;i--){let a=t.child(i);if(s-=a.nodeSize,s<e){let l=yi(a,e,n,r,s+1);if(l!=null)return l}}else for(let i=0,s=o;i<t.childCount&&s<n;i++){let a=t.child(i),l=s;if(s+=a.nodeSize,s>e){let c=yi(a,e,n,r,l+1);if(c!=null)return c}}return null}function Vw(t,e){let n=t.doc.resolve(e),r=n.nodeBefore,o=n.nodeAfter;return!r||!o||!r.isText||!o.isText?!0:!/\p{L}$/u.test(r.text)||!/^\p{L}/u.test(o.text)}let Qu=class{constructor(e,n,r){this.query=e,this.range=n,this.deco=r}};function ed(t,e,n){if(!e.valid)return De.empty;let r=[],o=t.selection;for(let i=n?n.from:0,s=n?n.to:t.doc.content.size;;){let a=e.findNext(t,i,s);if(!a)break;let l=a.from==o.from&&a.to==o.to?"ProseMirror-active-search-match":"ProseMirror-search-match";r.push(Le.inline(a.from,a.to,{class:l})),i=a.to}return De.create(t.doc,r)}const us=new Ge("search");function vR(t={}){return new Ue({key:us,state:{init(e,n){let r=t.initialQuery||new jk({search:""}),o=t.initialRange||null;return new Qu(r,o,ed(n,r,o))},apply(e,n,r,o){let i=e.getMeta(us);if(i)return new Qu(i.query,i.range,ed(o,i.query,i.range));if(e.docChanged||e.selectionSet){let s=n.range;if(s){let a=e.mapping.map(s.from,1),l=e.mapping.map(s.to,-1);s=a<l?{from:a,to:l}:null}n=new Qu(n.query,s,ed(o,n.query,s))}return n}},props:{decorations:e=>us.getState(e).deco}})}function Uw(t){let e=us.getState(t);return e?e.deco:De.empty}function xR(t,e,n=null){return t.setMeta(us,{query:e,range:n})}const kR=Ye.create({addStorage(){return{searchResults:[]}},addPmPlugins(){const t=this.editor,e=this.storage,n=new Ue({key:new Ge("customSearchHighlights"),props:{decorations(r){if(!t)return null;const o=e?.searchResults;if(!o?.length)return null;const i=o.map((s,a)=>Le.inline(s.from,s.to,{id:`search-match-${s.id}`}));return De.create(r.doc,i)}}});return[vR(),n]},addCommands(){return{goToFirstMatch:()=>({state:t,editor:e,dispatch:n})=>{const r=Uw(t);if(!r||!r.children?.length)return;const o=r.children.find(s=>s.local),i=r.children[0]+o.local[0].from+1;e.view.domAtPos(i)?.node?.scrollIntoView(!0)},search:t=>({state:e,editor:n,dispatch:r})=>{let o,i=!1,s=!1;const a=!1;if(t instanceof RegExp)s=!0,o=t.source,i=!t.flags.includes("i");else if(typeof t=="string"&&/^\/(.+)\/([gimsuy]*)$/.test(t)){const[,f,h]=t.match(/^\/(.+)\/([gimsuy]*)$/);s=!0,o=f,i=!h.includes("i")}else o=String(t);const l=new jk({search:o,caseSensitive:i,regexp:s,wholeWord:a}),c=xR(e.tr,l);r(c);const u=e.apply(c),d=Uw(u),p=(d?d.find():[]).map(f=>({from:f.from,to:f.to,text:u.doc.textBetween(f.from,f.to),id:Lr()}));return this.storage.searchResults=p,p},goToSearchResult:t=>({state:e,dispatch:n,editor:r})=>{const{from:o,to:i}=t;r.view.focus();const s=e.tr.setSelection(Pe.create(e.doc,o,i)).scrollIntoView();n(s);const{node:a}=r.view.domAtPos(o);return a?.scrollIntoView&&a.scrollIntoView({block:"center",inline:"nearest"}),!0}}}}),Wf=()=>[ck,Mx,yx,$x,wx,bx,A1,Px,uk,Fx,kx,hk,_x,Lx,fk,Ox,vx,xx,lk,dk,wk,sR,ak,pk,Sx,Zx,ek,tk,Qx,ik,Ax,mk,gk,yk,Tx,sk],Gf=()=>[ck,Mx,yx,EN,TN,$N,$x,wx,bx,A1,Px,uk,Fx,kx,hk,_x,Lx,NN,IN,eN,fk,MN,Ox,vx,xx,lk,dk,Sx,a_,W_,Zx,ek,tk,Qx,ik,Ax,sk,aI,ak,O_,G_,bI,mk,gk,yk,ON,cR,pk,bN,Tx,J_,X_,Z_,lI,cI,uI,dI,pI,kR,fI],SR=(t,e)=>{let n=t.replace(/[^0-9.]/g,"");return n=parseFloat(n),isNaN(n)&&(n=e),n=parseFloat(n),n},AR=(t,e,n)=>{let r,o,i,s,a=0;n||(n={});const l=function(){a=n.leading===!1?0:Date.now(),r=null,s=t.apply(o,i),r||(o=i=null)},c=function(){const u=Date.now();!a&&n.leading===!1&&(a=u);const d=e-(u-a);return o=this,i=arguments,d<=0||d>e?(r&&(clearTimeout(r),r=null),a=u,s=t.apply(o,i),r||(o=i=null)):!r&&n.trailing!==!1&&(r=setTimeout(l,d)),s};return c.cancel=function(){clearTimeout(r),a=0,r=o=i=null},c},CR='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M0 64C0 46.3 14.3 32 32 32l48 0 16 0 128 0c70.7 0 128 57.3 128 128c0 31.3-11.3 60.1-30 82.3c37.1 22.4 62 63.1 62 109.7c0 70.7-57.3 128-128 128L96 480l-16 0-48 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l16 0 0-160L48 96 32 96C14.3 96 0 81.7 0 64zM224 224c35.3 0 64-28.7 64-64s-28.7-64-64-64L112 96l0 128 112 0zM112 288l0 128 144 0c35.3 0 64-28.7 64-64s-28.7-64-64-64l-32 0-112 0z"/></svg>',ER='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M128 64c0-17.7 14.3-32 32-32l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-58.7 0L160 416l64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l58.7 0L224 96l-64 0c-17.7 0-32-14.3-32-32z"/></svg>',TR='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M16 64c0-17.7 14.3-32 32-32l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-16 0 0 128c0 53 43 96 96 96s96-43 96-96l0-128-16 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-16 0 0 128c0 88.4-71.6 160-160 160s-160-71.6-160-160L64 96 48 96C30.3 96 16 81.7 16 64zM0 448c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32z"/></svg>',$R='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M40 48C26.7 48 16 58.7 16 72l0 48c0 13.3 10.7 24 24 24l48 0c13.3 0 24-10.7 24-24l0-48c0-13.3-10.7-24-24-24L40 48zM192 64c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L192 64zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-288 0zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-288 0zM16 232l0 48c0 13.3 10.7 24 24 24l48 0c13.3 0 24-10.7 24-24l0-48c0-13.3-10.7-24-24-24l-48 0c-13.3 0-24 10.7-24 24zM40 368c-13.3 0-24 10.7-24 24l0 48c0 13.3 10.7 24 24 24l48 0c13.3 0 24-10.7 24-24l0-48c0-13.3-10.7-24-24-24l-48 0z"/></svg>',OR='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M24 56c0-13.3 10.7-24 24-24l32 0c13.3 0 24 10.7 24 24l0 120 16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l16 0 0-96-8 0C34.7 80 24 69.3 24 56zM86.7 341.2c-6.5-7.4-18.3-6.9-24 1.2L51.5 357.9c-7.7 10.8-22.7 13.3-33.5 5.6s-13.3-22.7-5.6-33.5l11.1-15.6c23.7-33.2 72.3-35.6 99.2-4.9c21.3 24.4 20.8 60.9-1.1 84.7L86.8 432l33.2 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-88 0c-9.5 0-18.2-5.6-22-14.4s-2.1-18.9 4.3-25.9l72-78c5.3-5.8 5.4-14.6 .3-20.5zM224 64l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 160l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 160l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32z"/></svg>',MR='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M0 96C0 60.7 28.7 32 64 32l384 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zM323.8 202.5c-4.5-6.6-11.9-10.5-19.8-10.5s-15.4 3.9-19.8 10.5l-87 127.6L170.7 297c-4.6-5.7-11.5-9-18.7-9s-14.2 3.3-18.7 9l-64 80c-5.8 7.2-6.9 17.1-2.9 25.4s12.4 13.6 21.6 13.6l96 0 32 0 208 0c8.9 0 17.1-4.9 21.2-12.8s3.6-17.4-1.4-24.7l-120-176zM112 192a48 48 0 1 0 0-96 48 48 0 1 0 0 96z"/></svg>',Hw='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M579.8 267.7c56.5-56.5 56.5-148 0-204.5c-50-50-128.8-56.5-186.3-15.4l-1.6 1.1c-14.4 10.3-17.7 30.3-7.4 44.6s30.3 17.7 44.6 7.4l1.6-1.1c32.1-22.9 76-19.3 103.8 8.6c31.5 31.5 31.5 82.5 0 114L422.3 334.8c-31.5 31.5-82.5 31.5-114 0c-27.9-27.9-31.5-71.8-8.6-103.8l1.1-1.6c10.3-14.4 6.9-34.4-7.4-44.6s-34.4-6.9-44.6 7.4l-1.1 1.6C206.5 251.2 213 330 263 380c56.5 56.5 148 56.5 204.5 0L579.8 267.7zM60.2 244.3c-56.5 56.5-56.5 148 0 204.5c50 50 128.8 56.5 186.3 15.4l1.6-1.1c14.4-10.3 17.7-30.3 7.4-44.6s-30.3-17.7-44.6-7.4l-1.6 1.1c-32.1 22.9-76 19.3-103.8-8.6C74 372 74 321 105.5 289.5L217.7 177.2c31.5-31.5 82.5-31.5 114 0c27.9 27.9 31.5 71.8 8.6 103.9l-1.1 1.6c-10.3 14.4-6.9 34.4 7.4 44.6s34.4 6.9 44.6-7.4l1.1-1.6C433.5 260.8 427 182 377 132c-56.5-56.5-148-56.5-204.5 0L60.2 244.3z"/></svg>',DR='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M288 64c0 17.7-14.3 32-32 32L32 96C14.3 96 0 81.7 0 64S14.3 32 32 32l224 0c17.7 0 32 14.3 32 32zm0 256c0 17.7-14.3 32-32 32L32 352c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32zM0 192c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 224c-17.7 0-32-14.3-32-32zM448 448c0 17.7-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z"/></svg>',_R='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M352 64c0-17.7-14.3-32-32-32L128 32c-17.7 0-32 14.3-32 32s14.3 32 32 32l192 0c17.7 0 32-14.3 32-32zm96 128c0-17.7-14.3-32-32-32L32 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32-14.3 32-32zM0 448c0 17.7 14.3 32 32 32l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 416c-17.7 0-32 14.3-32 32zM352 320c0-17.7-14.3-32-32-32l-192 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l192 0c17.7 0 32-14.3 32-32z"/></svg>',NR='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M448 64c0 17.7-14.3 32-32 32L192 96c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32zm0 256c0 17.7-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32zM0 192c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 224c-17.7 0-32-14.3-32-32zM448 448c0 17.7-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z"/></svg>',IR='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M448 64c0-17.7-14.3-32-32-32L32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l384 0c17.7 0 32-14.3 32-32zm0 256c0-17.7-14.3-32-32-32L32 288c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32-14.3 32-32zM0 192c0 17.7 14.3 32 32 32l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 160c-17.7 0-32 14.3-32 32zM448 448c0-17.7-14.3-32-32-32L32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32-14.3 32-32z"/></svg>',FR='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M0 64C0 46.3 14.3 32 32 32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 96C14.3 96 0 81.7 0 64zM192 192c0-17.7 14.3-32 32-32l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32zm32 96l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zM0 448c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32zM127.8 268.6L25.8 347.9C15.3 356.1 0 348.6 0 335.3L0 176.7c0-13.3 15.3-20.8 25.8-12.6l101.9 79.3c8.2 6.4 8.2 18.9 0 25.3z"/></svg>',RR='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M0 64C0 46.3 14.3 32 32 32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 96C14.3 96 0 81.7 0 64zM192 192c0-17.7 14.3-32 32-32l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32zm32 96l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zM0 448c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32zM.2 268.6c-8.2-6.4-8.2-18.9 0-25.3l101.9-79.3c10.5-8.2 25.8-.7 25.8 12.6l0 158.6c0 13.3-15.3 20.8-25.8 12.6L.2 268.6z"/></svg>',BR='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M0 64C0 28.7 28.7 0 64 0L352 0c35.3 0 64 28.7 64 64l0 64c0 35.3-28.7 64-64 64L64 192c-35.3 0-64-28.7-64-64L0 64zM160 352c0-17.7 14.3-32 32-32l0-16c0-44.2 35.8-80 80-80l144 0c17.7 0 32-14.3 32-32l0-32 0-90.5c37.3 13.2 64 48.7 64 90.5l0 32c0 53-43 96-96 96l-144 0c-8.8 0-16 7.2-16 16l0 16c17.7 0 32 14.3 32 32l0 128c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32l0-128z"/></svg>',LR='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L355.7 253.5 400.2 96 503 96 497 120.2c-4.3 17.1 6.1 34.5 23.3 38.8s34.5-6.1 38.8-23.3l11-44.1C577.6 61.3 554.7 32 523.5 32L376.1 32l-.3 0L204.5 32c-22 0-41.2 15-46.6 36.4l-6.3 25.2L38.8 5.1zm168 131.7c.1-.3 .2-.7 .3-1L217 96l116.7 0L301.3 210.8l-94.5-74.1zM243.3 416L192 416c-17.7 0-32 14.3-32 32s14.3 32 32 32l160 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-42.2 0 17.6-62.1L272.9 311 243.3 416z"/></svg>',PR='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M48.5 224L40 224c-13.3 0-24-10.7-24-24L16 72c0-9.7 5.8-18.5 14.8-22.2s19.3-1.7 26.2 5.2L98.6 96.6c87.6-86.5 228.7-86.2 315.8 1c87.5 87.5 87.5 229.3 0 316.8s-229.3 87.5-316.8 0c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0c62.5 62.5 163.8 62.5 226.3 0s62.5-163.8 0-226.3c-62.2-62.2-162.7-62.5-225.3-1L185 183c6.9 6.9 8.9 17.2 5.2 26.2s-12.5 14.8-22.2 14.8L48.5 224z"/></svg>',zR='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M463.5 224l8.5 0c13.3 0 24-10.7 24-24l0-128c0-9.7-5.8-18.5-14.8-22.2s-19.3-1.7-26.2 5.2L413.4 96.6c-87.6-86.5-228.7-86.2-315.8 1c-87.5 87.5-87.5 229.3 0 316.8s229.3 87.5 316.8 0c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0c-62.5 62.5-163.8 62.5-226.3 0s-62.5-163.8 0-226.3c62.2-62.2 162.7-62.5 225.3-1L327 183c-6.9 6.9-8.9 17.2-5.2 26.2s12.5 14.8 22.2 14.8l119.5 0z"/></svg>',jR='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M128 0c17.7 0 32 14.3 32 32l0 32 128 0 0-32c0-17.7 14.3-32 32-32s32 14.3 32 32l0 32 48 0c26.5 0 48 21.5 48 48l0 48L0 160l0-48C0 85.5 21.5 64 48 64l48 0 0-32c0-17.7 14.3-32 32-32zM0 192l448 0 0 272c0 26.5-21.5 48-48 48L48 512c-26.5 0-48-21.5-48-48L0 192zM329 305c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-95 95-47-47c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l64 64c9.4 9.4 24.6 9.4 33.9 0L329 305z"/></svg>',qR='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M128 0c17.7 0 32 14.3 32 32l0 32 128 0 0-32c0-17.7 14.3-32 32-32s32 14.3 32 32l0 32 48 0c26.5 0 48 21.5 48 48l0 48L0 160l0-48C0 85.5 21.5 64 48 64l48 0 0-32c0-17.7 14.3-32 32-32zM0 192l448 0 0 272c0 26.5-21.5 48-48 48L48 512c-26.5 0-48-21.5-48-48L0 192zM305 305c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-47 47-47-47c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l47 47-47 47c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l47-47 47 47c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-47-47 47-47z"/></svg>',VR='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M152.1 38.2c9.9 8.9 10.7 24 1.8 33.9l-72 80c-4.4 4.9-10.6 7.8-17.2 7.9s-12.9-2.4-17.6-7L7 113C-2.3 103.6-2.3 88.4 7 79s24.6-9.4 33.9 0l22.1 22.1 55.1-61.2c8.9-9.9 24-10.7 33.9-1.8zm0 160c9.9 8.9 10.7 24 1.8 33.9l-72 80c-4.4 4.9-10.6 7.8-17.2 7.9s-12.9-2.4-17.6-7L7 273c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l22.1 22.1 55.1-61.2c8.9-9.9 24-10.7 33.9-1.8zM224 96c0-17.7 14.3-32 32-32l224 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32zm0 160c0-17.7 14.3-32 32-32l224 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32zM160 416c0-17.7 14.3-32 32-32l288 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-288 0c-17.7 0-32-14.3-32-32zM48 368a48 48 0 1 1 0 96 48 48 0 1 1 0-96z"/></svg>',Ww='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M224 256A128 128 0 1 0 224 0a128 128 0 1 0 0 256zm-45.7 48C79.8 304 0 383.8 0 482.3C0 498.7 13.3 512 29.7 512l293.1 0c-3.1-8.8-3.7-18.4-1.4-27.8l15-60.1c2.8-11.3 8.6-21.5 16.8-29.7l40.3-40.3c-32.1-31-75.7-50.1-123.9-50.1l-91.4 0zm435.5-68.3c-15.6-15.6-40.9-15.6-56.6 0l-29.4 29.4 71 71 29.4-29.4c15.6-15.6 15.6-40.9 0-56.6l-14.4-14.4zM375.9 417c-4.1 4.1-7 9.2-8.4 14.9l-15 60.1c-1.4 5.5 .2 11.2 4.2 15.2s9.7 5.6 15.2 4.2l60.1-15c5.6-1.4 10.8-4.3 14.9-8.4L576.1 358.7l-71-71L375.9 417z"/></svg>',Gw='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M288 32c-80.8 0-145.5 36.8-192.6 80.6C48.6 156 17.3 208 2.5 243.7c-3.3 7.9-3.3 16.7 0 24.6C17.3 304 48.6 356 95.4 399.4C142.5 443.2 207.2 480 288 480s145.5-36.8 192.6-80.6c46.8-43.5 78.1-95.4 93-131.1c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C433.5 68.8 368.8 32 288 32zM144 256a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm144-64c0 35.3-28.7 64-64 64c-7.1 0-13.9-1.2-20.3-3.3c-5.5-1.8-11.9 1.6-11.7 7.4c.3 6.9 1.3 13.8 3.2 20.7c13.7 51.2 66.4 81.6 117.6 67.9s81.6-66.4 67.9-117.6c-11.1-41.5-47.8-69.4-88.6-71.1c-5.8-.2-9.2 6.1-7.4 11.7c2.1 6.4 3.3 13.2 3.3 20.3z"/></svg>',UR='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M0 64C0 28.7 28.7 0 64 0L224 0l0 128c0 17.7 14.3 32 32 32l128 0 0 288c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64zm384 64l-128 0L256 0 384 128z"/></svg>',HR='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M254 52.8C249.3 40.3 237.3 32 224 32s-25.3 8.3-30 20.8L57.8 416 32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-1.8 0 18-48 159.6 0 18 48-1.8 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-25.8 0L254 52.8zM279.8 304l-111.6 0L224 155.1 279.8 304z"/></svg>',WR='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M64 0C28.7 0 0 28.7 0 64L0 320l384 0 0-160-128 0c-17.7 0-32-14.3-32-32L224 0 64 0zM256 0l0 128 128 0L256 0zM0 416l64 0 0-64L0 352l0 64zm288 32l-80 0 0 64 80 0 0-64zm-112 0l-80 0 0 64 80 0 0-64zM64 448L0 448c0 35.3 28.7 64 64 64l0-64zm256 0l0 64c35.3 0 64-28.7 64-64l-64 0zm64-32l0-64-64 0 0 64 64 0z"/></svg>',GR='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M512 240c0 114.9-114.6 208-256 208c-37.1 0-72.3-6.4-104.1-17.9c-11.9 8.7-31.3 20.6-54.3 30.6C73.6 471.1 44.7 480 16 480c-6.5 0-12.3-3.9-14.8-9.9c-2.5-6-1.1-12.8 3.4-17.4c0 0 0 0 0 0s0 0 0 0s0 0 0 0c0 0 0 0 0 0l.3-.3c.3-.3 .7-.7 1.3-1.4c1.1-1.2 2.8-3.1 4.9-5.7c4.1-5 9.6-12.4 15.2-21.6c10-16.6 19.5-38.4 21.4-62.9C17.7 326.8 0 285.1 0 240C0 125.1 114.6 32 256 32s256 93.1 256 208z"/></svg>',KR='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512z"/></svg>',JR='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"/></svg>',XR='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"/></svg>',YR='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M352 0c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9L370.7 96 201.4 265.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L416 141.3l41.4 41.4c9.2 9.2 22.9 11.9 34.9 6.9s19.8-16.6 19.8-29.6l0-128c0-17.7-14.3-32-32-32L352 0zM80 32C35.8 32 0 67.8 0 112L0 432c0 44.2 35.8 80 80 80l320 0c44.2 0 80-35.8 80-80l0-112c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 112c0 8.8-7.2 16-16 16L80 448c-8.8 0-16-7.2-16-16l0-320c0-8.8 7.2-16 16-16l112 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L80 32z"/></svg>',ZR='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M64 360a56 56 0 1 0 0 112 56 56 0 1 0 0-112zm0-160a56 56 0 1 0 0 112 56 56 0 1 0 0-112zM120 96A56 56 0 1 0 8 96a56 56 0 1 0 112 0z"/></svg>',QR='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M182.6 137.4c-12.5-12.5-32.8-12.5-45.3 0l-128 128c-9.2 9.2-11.9 22.9-6.9 34.9s16.6 19.8 29.6 19.8l256 0c12.9 0 24.6-7.8 29.6-19.8s2.2-25.7-6.9-34.9l-128-128z"/></svg>',eB='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M137.4 374.6c12.5 12.5 32.8 12.5 45.3 0l128-128c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8L32 192c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l128 128z"/></svg>',tB='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M177.9 494.1c-18.7 18.7-49.1 18.7-67.9 0L17.9 401.9c-18.7-18.7-18.7-49.1 0-67.9l50.7-50.7 48 48c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-48-48 41.4-41.4 48 48c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-48-48 41.4-41.4 48 48c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-48-48 41.4-41.4 48 48c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-48-48 50.7-50.7c18.7-18.7 49.1-18.7 67.9 0l92.1 92.1c18.7 18.7 18.7 49.1 0 67.9L177.9 494.1z"/></svg>',nB='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M339.3 367.1c27.3-3.9 51.9-19.4 67.2-42.9L568.2 74.1c12.6-19.5 9.4-45.3-7.6-61.2S517.7-4.4 499.1 9.6L262.4 187.2c-24 18-38.2 46.1-38.4 76.1L339.3 367.1zm-19.6 25.4l-116-104.4C143.9 290.3 96 339.6 96 400c0 3.9 .2 7.8 .6 11.6C98.4 429.1 86.4 448 68.8 448L64 448c-17.7 0-32 14.3-32 32s14.3 32 32 32l144 0c61.9 0 112-50.1 112-112c0-2.5-.1-5-.2-7.5z"/></svg>',rB=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M315 315l158.4-215L444.1 70.6 229 229 315 315zm-187 5s0 0 0 0l0-71.7c0-15.3 7.2-29.6 19.5-38.6L420.6 8.4C428 2.9 437 0 446.2 0c11.4 0 22.4 4.5 30.5 12.6l54.8 54.8c8.1 8.1 12.6 19 12.6 30.5c0 9.2-2.9 18.2-8.4 25.6L334.4 396.5c-9 12.3-23.4 19.5-38.6 19.5L224 416l-25.4 25.4c-12.5 12.5-32.8 12.5-45.3 0l-50.7-50.7c-12.5-12.5-12.5-32.8 0-45.3L128 320zM7 466.3l63-63 70.6 70.6-31 31c-4.5 4.5-10.6 7-17 7L24 512c-13.3 0-24-10.7-24-24l0-4.7c0-6.4 2.5-12.5 7-17z"/></svg>
76
+ `,oB='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M224 96l16-32 32-16-32-16-16-32-16 32-32 16 32 16 16 32zM80 160l26.7-53.3L160 80l-53.3-26.7L80 0 53.3 53.3 0 80l53.3 26.7L80 160zm352 128l-26.7 53.3L352 368l53.3 26.7L432 448l26.7-53.3L512 368l-53.3-26.7L432 288zm70.6-193.8L417.8 9.4C411.5 3.1 403.3 0 395.2 0c-8.2 0-16.4 3.1-22.6 9.4L9.4 372.5c-12.5 12.5-12.5 32.8 0 45.3l84.9 84.9c6.3 6.3 14.4 9.4 22.6 9.4 8.2 0 16.4-3.1 22.6-9.4l363.1-363.2c12.5-12.5 12.5-32.8 0-45.2zM359.5 203.5l-50.9-50.9 86.6-86.6 50.9 50.9-86.6 86.6z"/></svg>',iB='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M64 256l0-96 160 0 0 96L64 256zm0 64l160 0 0 96L64 416l0-96zm224 96l0-96 160 0 0 96-160 0zM448 256l-160 0 0-96 160 0 0 96zM64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32z"/></svg>',sB='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M0 96C0 60.7 28.7 32 64 32l384 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zm64 64l0 256 160 0 0-256L64 160zm384 0l-160 0 0 256 160 0 0-256z"/></svg>',aB='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M406.6 374.6l96-96c12.5-12.5 12.5-32.8 0-45.3l-96-96c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 224l-293.5 0 41.4-41.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-96 96c-12.5 12.5-12.5 32.8 0 45.3l96 96c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 288l293.5 0-41.4 41.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0z"/></svg>',lB='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M256 0c17.7 0 32 14.3 32 32l0 32 32 0c12.9 0 24.6 7.8 29.6 19.8s2.2 25.7-6.9 34.9l-64 64c-12.5 12.5-32.8 12.5-45.3 0l-64-64c-9.2-9.2-11.9-22.9-6.9-34.9s16.6-19.8 29.6-19.8l32 0 0-32c0-17.7 14.3-32 32-32zM169.4 393.4l64-64c12.5-12.5 32.8-12.5 45.3 0l64 64c9.2 9.2 11.9 22.9 6.9 34.9s-16.6 19.8-29.6 19.8l-32 0 0 32c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-32-32 0c-12.9 0-24.6-7.8-29.6-19.8s-2.2-25.7 6.9-34.9zM32 224l32 0 0-32c0-12.9 7.8-24.6 19.8-29.6s25.7-2.2 34.9 6.9l64 64c12.5 12.5 12.5 32.8 0 45.3l-64 64c-9.2 9.2-22.9 11.9-34.9 6.9s-19.8-16.6-19.8-29.6l0-32-32 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm297.4 54.6c-12.5-12.5-12.5-32.8 0-45.3l64-64c9.2-9.2 22.9-11.9 34.9-6.9s19.8 16.6 19.8 29.6l0 32 32 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0 0 32c0 12.9-7.8 24.6-19.8 29.6s-25.7 2.2-34.9-6.9l-64-64zM256 224a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"/></svg>',Sa='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M256 80c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 144L48 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l144 0 0 144c0 17.7 14.3 32 32 32s32-14.3 32-32l0-144 144 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-144 0 0-144z"/></svg>',td='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M135.2 17.7C140.6 6.8 151.7 0 163.8 0L284.2 0c12.1 0 23.2 6.8 28.6 17.7L320 32l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 96C14.3 96 0 81.7 0 64S14.3 32 32 32l96 0 7.2-14.3zM32 128l384 0 0 320c0 35.3-28.7 64-64 64L96 512c-35.3 0-64-28.7-64-64l0-320zm96 64c-8.8 0-16 7.2-16 16l0 224c0 8.8 7.2 16 16 16s16-7.2 16-16l0-224c0-8.8-7.2-16-16-16zm96 0c-8.8 0-16 7.2-16 16l0 224c0 8.8 7.2 16 16 16s16-7.2 16-16l0-224c0-8.8-7.2-16-16-16zm96 0c-8.8 0-16 7.2-16 16l0 224c0 8.8 7.2 16 16 16s16-7.2 16-16l0-224c0-8.8-7.2-16-16-16z"/></svg>',cB='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M352 320c88.4 0 160-71.6 160-160c0-15.3-2.2-30.1-6.2-44.2c-3.1-10.8-16.4-13.2-24.3-5.3l-76.8 76.8c-3 3-7.1 4.7-11.3 4.7L336 192c-8.8 0-16-7.2-16-16l0-57.4c0-4.2 1.7-8.3 4.7-11.3l76.8-76.8c7.9-7.9 5.4-21.2-5.3-24.3C382.1 2.2 367.3 0 352 0C263.6 0 192 71.6 192 160c0 19.1 3.4 37.5 9.5 54.5L19.9 396.1C7.2 408.8 0 426.1 0 444.1C0 481.6 30.4 512 67.9 512c18 0 35.3-7.2 48-19.9L297.5 310.5c17 6.2 35.4 9.5 54.5 9.5zM80 408a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"/></svg>',uB='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M32 480a32 32 0 1 1 0-64 32 32 0 1 1 0 64zm96-64a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm0-384a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm0 256a32 32 0 1 1 0-64 32 32 0 1 1 0 64zM320 416a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm0-320a32 32 0 1 1 0-64 32 32 0 1 1 0 64zm0 128a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM224 480a32 32 0 1 1 0-64 32 32 0 1 1 0 64zm0-448a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm0 256a32 32 0 1 1 0-64 32 32 0 1 1 0 64zM416 416a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm0-384a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM32 96a32 32 0 1 1 0-64 32 32 0 1 1 0 64zM416 224a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM32 288a32 32 0 1 1 0-64 32 32 0 1 1 0 64zm192 32a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm192 64a32 32 0 1 1 0-64 32 32 0 1 1 0 64zM32 320a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM416 192a32 32 0 1 1 0-64 32 32 0 1 1 0 64zM32 128a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm192 64a32 32 0 1 1 0-64 32 32 0 1 1 0 64z"/></svg>',dB=`<svg xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" viewBox="3 4 18 16"><path stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 10V5m0 0L4 7m2-2 2 2m-2 7v5m0 0 2-2m-2 2-2-2m8-10h8m0 5h-8m0 5h8"></path></svg>
77
+ `,pB=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z"/></svg>
78
+ `,ln={undo:PR,redo:zR,bold:CR,italic:ER,underline:TR,color:HR,link:Hw,image:MR,alignLeft:DR,alignRight:NR,alignCenter:_R,alignJustify:IR,bulletList:$R,numberedList:OR,indentLeft:RR,indentRight:FR,pageBreak:WR,copyFormat:BR,clearFormatting:LR,trackChanges:VR,trackChangesFinal:UR,trackChangesOriginal:Gw,trackChangesAccept:jR,trackChangesReject:qR,documentMode:Ww,documentEditingMode:Ww,documentSuggestingMode:GR,documentViewingMode:Gw,colorOption:KR,colorOptionCheck:JR,linkInput:Hw,removeLink:XR,openLink:YR,overflow:ZR,dropdownCaretUp:QR,dropdownCaretDown:eB,ruler:tB,paintbrush:nB,highlight:rB,ai:oB,table:iB,tableActions:sB,splitCell:aB,mergeCells:lB,addRowBefore:Sa,addRowAfter:Sa,addColumnBefore:Sa,addColumnAfter:Sa,deleteRow:td,deleteColumn:td,deleteTable:td,deleteBorders:uB,fixTables:cB,lineHeight:dB,search:pB},fB={class:"toolbar-icon"},hB=["innerHTML"],mB={__name:"ToolbarButtonIcon",props:{name:{type:String,required:!0},color:{type:String,default:null},icon:{type:String,default:null}},setup(t){const e=t,n=w.computed(()=>{if(e.name==="color")return{backgroundColor:e.color||"#111111"};if(e.name==="highlight")return{backgroundColor:e.color||"#D6D6D6"}}),r=w.computed(()=>["color","highlight"].includes(e.name));return(o,i)=>(w.openBlock(),w.createElementBlock("div",fB,[w.createBaseVNode("div",{class:w.normalizeClass(["toolbar-icon__icon",[`toolbar-icon__icon--${e.name}`]]),innerHTML:t.icon},null,10,hB),r.value?(w.openBlock(),w.createElementBlock("div",{key:0,class:"color-bar",style:w.normalizeStyle(n.value)},null,4)):w.createCommentVNode("",!0)]))}},gB=ft(mB,[["__scopeId","data-v-6d7523ab"]]),yB=["data-item"],wB={key:1,class:"button-label"},bB={key:2},vB=["placeholder","onKeydown","id"],xB=["placeholder","onKeydown","id"],kB=["innerHTML"],SB={__name:"ToolbarButton",props:{iconColor:{type:String,default:null},active:{type:Boolean,default:!1},isNarrow:{type:Boolean,default:!1},isWide:{type:Boolean,default:!1},toolbarItem:{type:Object,required:!0},defaultLabel:{type:String,default:null}},emits:["buttonClick","textSubmit"],setup(t,{emit:e}){const n=e,r=t,{name:o,active:i,icon:s,label:a,hideLabel:l,iconColor:c,hasCaret:u,disabled:d,inlineTextInputVisible:p,hasInlineTextInput:f,minWidth:h,style:m,attributes:y}=r.toolbarItem,g=w.ref(r.defaultLabel),v=w.ref(null),k=()=>{f&&(v.value?.focus(),v.value?.select()),n("buttonClick")},b=()=>{n("textSubmit",g.value),g.value=""},C=w.computed(()=>m.value?m.value:{minWidth:r.minWidth}),D=I=>{let{value:E}=I.target;g.value=E.replace(/[^0-9]/g,"")},M=w.computed(()=>i.value?ln.dropdownCaretUp:ln.dropdownCaretDown);return(I,E)=>(w.openBlock(),w.createElementBlock("div",{class:w.normalizeClass(["toolbar-item",w.unref(y).className]),style:w.normalizeStyle(C.value)},[w.createBaseVNode("div",{onClick:k,class:w.normalizeClass(["toolbar-button",{active:w.unref(i),disabled:w.unref(d),narrow:t.isNarrow,wide:t.isWide,"has-inline-text-input":w.unref(f)}]),"data-item":`btn-${w.unref(o)||""}`},[w.unref(s)?(w.openBlock(),w.createBlock(gB,{key:0,color:w.unref(c),class:"toolbar-icon",icon:w.unref(s),name:w.unref(o)},null,8,["color","icon","name"])):w.createCommentVNode("",!0),w.unref(a)&&!w.unref(l)&&!w.unref(p)?(w.openBlock(),w.createElementBlock("div",wB,w.toDisplayString(w.unref(a)),1)):w.createCommentVNode("",!0),w.unref(p)?(w.openBlock(),w.createElementBlock("span",bB,[w.unref(o)==="fontSize"?w.withDirectives((w.openBlock(),w.createElementBlock("input",{key:0,"onUpdate:modelValue":E[0]||(E[0]=G=>g.value=G),onInput:D,placeholder:w.unref(a),onKeydown:w.withKeys(w.withModifiers(b,["prevent"]),["enter"]),type:"text",class:"button-text-input",id:"inlineTextInput-"+w.unref(o),autoccomplete:"off",ref_key:"inlineInput",ref:v},null,40,vB)),[[w.vModelText,g.value]]):w.withDirectives((w.openBlock(),w.createElementBlock("input",{key:1,"onUpdate:modelValue":E[1]||(E[1]=G=>g.value=G),placeholder:w.unref(a),onKeydown:w.withKeys(w.withModifiers(b,["prevent"]),["enter"]),type:"text",class:"button-text-input",id:"inlineTextInput-"+w.unref(o),autoccomplete:"off",ref_key:"inlineInput",ref:v},null,40,xB)),[[w.vModelText,g.value]])])):w.createCommentVNode("",!0),w.unref(u)?(w.openBlock(),w.createElementBlock("div",{key:3,class:"dropdown-caret",innerHTML:M.value,style:w.normalizeStyle({opacity:w.unref(d)?.6:1})},null,12,kB)):w.createCommentVNode("",!0)],10,yB)],6))}},Ep=ft(SB,[["__scopeId","data-v-62bb3747"]]),AB={class:"toolbar-separator"},CB={__name:"ToolbarSeparator",props:{active:{type:Boolean,default:!1}},emits:["command"],setup(t,{emit:e}){return(n,r)=>(w.openBlock(),w.createElementBlock("div",AB,r[0]||(r[0]=[w.createBaseVNode("div",{class:"separator-inner"},null,-1)])))}},EB=ft(CB,[["__scopeId","data-v-ac2ee4f9"]]),TB={class:"overflow-menu"},$B={class:"overflow-menu-trigger"},OB={key:0,class:"overflow-menu_items"},MB={__name:"OverflowMenu",props:{toolbarItem:{type:Object,required:!0},overflowItems:{type:Array,required:!0}},setup(t){const{proxy:e}=w.getCurrentInstance(),n=t,r=w.ref(!1),o=w.computed(()=>({...n.toolbarItem,active:r})),i=()=>{r.value=!r.value},s=({item:a,argument:l})=>{e.$toolbar.emitCommand({item:a,argument:l})};return(a,l)=>(w.openBlock(),w.createElementBlock("div",TB,[w.createBaseVNode("div",$B,[w.createVNode(Ep,{"toolbar-item":o.value,onButtonClick:i},null,8,["toolbar-item"])]),r.value?(w.openBlock(),w.createElementBlock("div",OB,[w.createVNode(ol,{"toolbar-items":t.overflowItems,onCommand:s,class:"superdoc-toolbar-overflow"},null,8,["toolbar-items"])])):w.createCommentVNode("",!0)]))}},DB=ft(MB,[["__scopeId","data-v-ca29bf1d"]]);function _B(t){let e=".",n="__",r="--",o;if(t){let u=t.blockPrefix;u&&(e=u),u=t.elementPrefix,u&&(n=u),u=t.modifierPrefix,u&&(r=u)}const i={install(u){o=u.c;const d=u.context;d.bem={},d.bem.b=null,d.bem.els=null}};function s(u){let d,p;return{before(f){d=f.bem.b,p=f.bem.els,f.bem.els=null},after(f){f.bem.b=d,f.bem.els=p},$({context:f,props:h}){return u=typeof u=="string"?u:u({context:f,props:h}),f.bem.b=u,`${h?.bPrefix||e}${f.bem.b}`}}}function a(u){let d;return{before(p){d=p.bem.els},after(p){p.bem.els=d},$({context:p,props:f}){return u=typeof u=="string"?u:u({context:p,props:f}),p.bem.els=u.split(",").map(h=>h.trim()),p.bem.els.map(h=>`${f?.bPrefix||e}${p.bem.b}${n}${h}`).join(", ")}}}function l(u){return{$({context:d,props:p}){u=typeof u=="string"?u:u({context:d,props:p});const f=u.split(",").map(y=>y.trim());function h(y){return f.map(g=>`&${p?.bPrefix||e}${d.bem.b}${y!==void 0?`${n}${y}`:""}${r}${g}`).join(", ")}const m=d.bem.els;if(m!==null){if(Se.env.NODE_ENV!=="production"&&m.length>=2)throw Error(`[css-render/plugin-bem]: m(${u}) is invalid, using modifier inside multiple elements is not allowed`);return h(m[0])}else return h()}}}function c(u){return{$({context:d,props:p}){u=typeof u=="string"?u:u({context:d,props:p});const f=d.bem.els;if(Se.env.NODE_ENV!=="production"&&f!==null&&f.length>=2)throw Error(`[css-render/plugin-bem]: notM(${u}) is invalid, using modifier inside multiple elements is not allowed`);return`&:not(${p?.bPrefix||e}${d.bem.b}${f!==null&&f.length>0?`${n}${f[0]}`:""}${r}${u})`}}}return Object.assign(i,{cB:(...u)=>o(s(u[0]),u[1],u[2]),cE:(...u)=>o(a(u[0]),u[1],u[2]),cM:(...u)=>o(l(u[0]),u[1],u[2]),cNotM:(...u)=>o(c(u[0]),u[1],u[2])}),i}function NB(t){let e=0;for(let n=0;n<t.length;++n)t[n]==="&"&&++e;return e}const Vk=/\s*,(?![^(]*\))\s*/g,IB=/\s+/g;function FB(t,e){const n=[];return e.split(Vk).forEach(r=>{let o=NB(r);if(o){if(o===1){t.forEach(s=>{n.push(r.replace("&",s))});return}}else{t.forEach(s=>{n.push((s&&s+" ")+r)});return}let i=[r];for(;o--;){const s=[];i.forEach(a=>{t.forEach(l=>{s.push(a.replace("&",l))})}),i=s}i.forEach(s=>n.push(s))}),n}function RB(t,e){const n=[];return e.split(Vk).forEach(r=>{t.forEach(o=>{n.push((o&&o+" ")+r)})}),n}function BB(t){let e=[""];return t.forEach(n=>{n=n&&n.trim(),n&&(n.includes("&")?e=FB(e,n):e=RB(e,n))}),e.join(", ").replace(IB," ")}function Kw(t){if(!t)return;const e=t.parentElement;e&&e.removeChild(t)}function dc(t,e){return(e??document.head).querySelector(`style[cssr-id="${t}"]`)}function LB(t){const e=document.createElement("style");return e.setAttribute("cssr-id",t),e}function Aa(t){return t?/^\s*@(s|m)/.test(t):!1}const PB=/[A-Z]/g;function Uk(t){return t.replace(PB,e=>"-"+e.toLowerCase())}function zB(t,e=" "){return typeof t=="object"&&t!==null?` {
79
+ `+Object.entries(t).map(n=>e+` ${Uk(n[0])}: ${n[1]};`).join(`
80
+ `)+`
81
+ `+e+"}":`: ${t};`}function jB(t,e,n){return typeof t=="function"?t({context:e.context,props:n}):t}function Jw(t,e,n,r){if(!e)return"";const o=jB(e,n,r);if(!o)return"";if(typeof o=="string")return`${t} {
82
+ ${o}
83
+ }`;const i=Object.keys(o);if(i.length===0)return n.config.keepEmptyBlock?t+` {
84
+ }`:"";const s=t?[t+" {"]:[];return i.forEach(a=>{const l=o[a];if(a==="raw"){s.push(`
85
+ `+l+`
86
+ `);return}a=Uk(a),l!=null&&s.push(` ${a}${zB(l)}`)}),t&&s.push("}"),s.join(`
87
+ `)}function Tp(t,e,n){t&&t.forEach(r=>{if(Array.isArray(r))Tp(r,e,n);else if(typeof r=="function"){const o=r(e);Array.isArray(o)?Tp(o,e,n):o&&n(o)}else r&&n(r)})}function Hk(t,e,n,r,o){const i=t.$;let s="";if(!i||typeof i=="string")Aa(i)?s=i:e.push(i);else if(typeof i=="function"){const c=i({context:r.context,props:o});Aa(c)?s=c:e.push(c)}else if(i.before&&i.before(r.context),!i.$||typeof i.$=="string")Aa(i.$)?s=i.$:e.push(i.$);else if(i.$){const c=i.$({context:r.context,props:o});Aa(c)?s=c:e.push(c)}const a=BB(e),l=Jw(a,t.props,r,o);s?n.push(`${s} {`):l.length&&n.push(l),t.children&&Tp(t.children,{context:r.context,props:o},c=>{if(typeof c=="string"){const u=Jw(a,{raw:c},r,o);n.push(u)}else Hk(c,e,n,r,o)}),e.pop(),s&&n.push("}"),i&&i.after&&i.after(r.context)}function qB(t,e,n){const r=[];return Hk(t,[],r,e,n),r.join(`
88
+
89
+ `)}function $p(t){for(var e=0,n,r=0,o=t.length;o>=4;++r,o-=4)n=t.charCodeAt(r)&255|(t.charCodeAt(++r)&255)<<8|(t.charCodeAt(++r)&255)<<16|(t.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(o){case 3:e^=(t.charCodeAt(r+2)&255)<<16;case 2:e^=(t.charCodeAt(r+1)&255)<<8;case 1:e^=t.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}typeof window<"u"&&(window.__cssrContext={});function VB(t,e,n,r){const{els:o}=e;if(n===void 0)o.forEach(Kw),e.els=[];else{const i=dc(n,r);i&&o.includes(i)&&(Kw(i),e.els=o.filter(s=>s!==i))}}function Xw(t,e){t.push(e)}function UB(t,e,n,r,o,i,s,a,l){let c;if(n===void 0&&(c=e.render(r),n=$p(c)),l){l.adapter(n,c??e.render(r));return}a===void 0&&(a=document.head);const u=dc(n,a);if(u!==null&&!i)return u;const d=u??LB(n);if(c===void 0&&(c=e.render(r)),d.textContent=c,u!==null)return u;if(s){const p=a.querySelector(`meta[name="${s}"]`);if(p)return a.insertBefore(d,p),Xw(e.els,d),d}return o?a.insertBefore(d,a.querySelector("style, link")):a.appendChild(d),Xw(e.els,d),d}function HB(t){return qB(this,this.instance,t)}function WB(t={}){const{id:e,ssr:n,props:r,head:o=!1,force:i=!1,anchorMetaName:s,parent:a}=t;return UB(this.instance,this,e,r,o,i,s,a,n)}function GB(t={}){const{id:e,parent:n}=t;VB(this.instance,this,e,n)}const Ca=function(t,e,n,r){return{instance:t,$:e,props:n,children:r,els:[],render:HB,mount:WB,unmount:GB}},KB=function(t,e,n,r){return Array.isArray(e)?Ca(t,{$:null},null,e):Array.isArray(n)?Ca(t,e,null,n):Array.isArray(r)?Ca(t,e,n,r):Ca(t,e,n,null)};function Wk(t={}){const e={c:(...n)=>KB(e,...n),use:(n,...r)=>n.install(e,...r),find:dc,context:{},config:t};return e}function JB(t,e){if(t===void 0)return!1;if(e){const{context:{ids:n}}=e;return n.has(t)}return dc(t)!==null}const XB="n",YB=`.${XB}-`,ZB="__",QB="--",Gk=Wk(),Kk=_B({blockPrefix:YB,elementPrefix:ZB,modifierPrefix:QB});Gk.use(Kk);const{c:qe,find:MH}=Gk,{cB:Qe,cE:Pt,cM:st,cNotM:ds}=Kk,eL=(...t)=>qe(">",[Qe(...t)]);function br(t,e){return t+(e==="default"?"":e.replace(/^[a-z]/,n=>n.toUpperCase()))}let Fl=[];const Jk=new WeakMap;function tL(){Fl.forEach(t=>t(...Jk.get(t))),Fl=[]}function nL(t,...e){Jk.set(t,e),!Fl.includes(t)&&Fl.push(t)===1&&requestAnimationFrame(tL)}function Yw(t,e){let{target:n}=t;for(;n;){if(n.dataset&&n.dataset[e]!==void 0)return!0;n=n.parentElement}return!1}function Rl(t){return t.composedPath()[0]||null}function Zw(t){return typeof t=="string"?t.endsWith("px")?Number(t.slice(0,t.length-2)):Number(t):t}function Qw(t){if(t!=null)return typeof t=="number"?`${t}px`:t.endsWith("px")?t:`${t}px`}function Ji(t,e){const n=t.trim().split(/\s+/g),r={top:n[0]};switch(n.length){case 1:r.right=n[0],r.bottom=n[0],r.left=n[0];break;case 2:r.right=n[1],r.left=n[1],r.bottom=n[0];break;case 3:r.right=n[1],r.bottom=n[2],r.left=n[1];break;case 4:r.right=n[1],r.bottom=n[2],r.left=n[3];break;default:throw new Error("[seemly/getMargin]:"+t+" is not a valid value.")}return r}const e0={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#0FF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000",blanchedalmond:"#FFEBCD",blue:"#00F",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#0FF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",darkgreen:"#006400",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#F0F",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",lightgreen:"#90EE90",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#0F0",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#F0F",maroon:"#800000",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navy:"#000080",oldlace:"#FDF5E6",olive:"#808000",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",purple:"#800080",rebeccapurple:"#663399",red:"#F00",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",silver:"#C0C0C0",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",white:"#FFF",whitesmoke:"#F5F5F5",yellow:"#FF0",yellowgreen:"#9ACD32",transparent:"#0000"};function rL(t,e,n){e/=100,n/=100;let r=(o,i=(o+t/60)%6)=>n-n*e*Math.max(Math.min(i,4-i,1),0);return[r(5)*255,r(3)*255,r(1)*255]}function oL(t,e,n){e/=100,n/=100;let r=e*Math.min(n,1-n),o=(i,s=(i+t/30)%12)=>n-r*Math.max(Math.min(s-3,9-s,1),-1);return[o(0)*255,o(8)*255,o(4)*255]}const jn="^\\s*",qn="\\s*$",Fr="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))%\\s*",cn="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*",no="([0-9A-Fa-f])",ro="([0-9A-Fa-f]{2})",Xk=new RegExp(`${jn}hsl\\s*\\(${cn},${Fr},${Fr}\\)${qn}`),Yk=new RegExp(`${jn}hsv\\s*\\(${cn},${Fr},${Fr}\\)${qn}`),Zk=new RegExp(`${jn}hsla\\s*\\(${cn},${Fr},${Fr},${cn}\\)${qn}`),Qk=new RegExp(`${jn}hsva\\s*\\(${cn},${Fr},${Fr},${cn}\\)${qn}`),iL=new RegExp(`${jn}rgb\\s*\\(${cn},${cn},${cn}\\)${qn}`),sL=new RegExp(`${jn}rgba\\s*\\(${cn},${cn},${cn},${cn}\\)${qn}`),aL=new RegExp(`${jn}#${no}${no}${no}${qn}`),lL=new RegExp(`${jn}#${ro}${ro}${ro}${qn}`),cL=new RegExp(`${jn}#${no}${no}${no}${no}${qn}`),uL=new RegExp(`${jn}#${ro}${ro}${ro}${ro}${qn}`);function Ht(t){return parseInt(t,16)}function dL(t){try{let e;if(e=Zk.exec(t))return[Bl(e[1]),Er(e[5]),Er(e[9]),po(e[13])];if(e=Xk.exec(t))return[Bl(e[1]),Er(e[5]),Er(e[9]),1];throw new Error(`[seemly/hsla]: Invalid color value ${t}.`)}catch(e){throw e}}function pL(t){try{let e;if(e=Qk.exec(t))return[Bl(e[1]),Er(e[5]),Er(e[9]),po(e[13])];if(e=Yk.exec(t))return[Bl(e[1]),Er(e[5]),Er(e[9]),1];throw new Error(`[seemly/hsva]: Invalid color value ${t}.`)}catch(e){throw e}}function vo(t){try{let e;if(e=lL.exec(t))return[Ht(e[1]),Ht(e[2]),Ht(e[3]),1];if(e=iL.exec(t))return[Mt(e[1]),Mt(e[5]),Mt(e[9]),1];if(e=sL.exec(t))return[Mt(e[1]),Mt(e[5]),Mt(e[9]),po(e[13])];if(e=aL.exec(t))return[Ht(e[1]+e[1]),Ht(e[2]+e[2]),Ht(e[3]+e[3]),1];if(e=uL.exec(t))return[Ht(e[1]),Ht(e[2]),Ht(e[3]),po(Ht(e[4])/255)];if(e=cL.exec(t))return[Ht(e[1]+e[1]),Ht(e[2]+e[2]),Ht(e[3]+e[3]),po(Ht(e[4]+e[4])/255)];if(t in e0)return vo(e0[t]);if(Xk.test(t)||Zk.test(t)){const[n,r,o,i]=dL(t);return[...oL(n,r,o),i]}else if(Yk.test(t)||Qk.test(t)){const[n,r,o,i]=pL(t);return[...rL(n,r,o),i]}throw new Error(`[seemly/rgba]: Invalid color value ${t}.`)}catch(e){throw e}}function fL(t){return t>1?1:t<0?0:t}function Op(t,e,n,r){return`rgba(${Mt(t)}, ${Mt(e)}, ${Mt(n)}, ${fL(r)})`}function nd(t,e,n,r,o){return Mt((t*e*(1-r)+n*r)/o)}function e3(t,e){Array.isArray(t)||(t=vo(t)),Array.isArray(e)||(e=vo(e));const n=t[3],r=e[3],o=po(n+r-n*r);return Op(nd(t[0],n,e[0],r,o),nd(t[1],n,e[1],r,o),nd(t[2],n,e[2],r,o),o)}function hL(t,e){const[n,r,o,i=1]=Array.isArray(t)?t:vo(t);return typeof e.alpha=="number"?Op(n,r,o,e.alpha):Op(n,r,o,i)}function Ea(t,e){const[n,r,o,i=1]=Array.isArray(t)?t:vo(t),{lightness:s=1,alpha:a=1}=e;return mL([n*s,r*s,o*s,i*a])}function po(t){const e=Math.round(Number(t)*100)/100;return e>1?1:e<0?0:e}function Bl(t){const e=Math.round(Number(t));return e>=360||e<0?0:e}function Mt(t){const e=Math.round(Number(t));return e>255?255:e<0?0:e}function Er(t){const e=Math.round(Number(t));return e>100?100:e<0?0:e}function mL(t){const[e,n,r]=t;return 3 in t?`rgba(${Mt(e)}, ${Mt(n)}, ${Mt(r)}, ${po(t[3])})`:`rgba(${Mt(e)}, ${Mt(n)}, ${Mt(r)}, 1)`}function gL(t=8){return Math.random().toString(16).slice(2,2+t)}function yL(t,e){const n=[];for(let r=0;r<t;++r)n.push(e);return n}function el(t){return t.composedPath()[0]}const wL={mousemoveoutside:new WeakMap,clickoutside:new WeakMap};function bL(t,e,n){if(t==="mousemoveoutside"){const r=o=>{e.contains(el(o))||n(o)};return{mousemove:r,touchstart:r}}else if(t==="clickoutside"){let r=!1;const o=s=>{r=!e.contains(el(s))},i=s=>{r&&(e.contains(el(s))||n(s))};return{mousedown:o,mouseup:i,touchstart:o,touchend:i}}return console.error(`[evtd/create-trap-handler]: name \`${t}\` is invalid. This could be a bug of evtd.`),{}}function t3(t,e,n){const r=wL[t];let o=r.get(e);o===void 0&&r.set(e,o=new WeakMap);let i=o.get(n);return i===void 0&&o.set(n,i=bL(t,e,n)),i}function vL(t,e,n,r){if(t==="mousemoveoutside"||t==="clickoutside"){const o=t3(t,e,n);return Object.keys(o).forEach(i=>{yt(i,document,o[i],r)}),!0}return!1}function xL(t,e,n,r){if(t==="mousemoveoutside"||t==="clickoutside"){const o=t3(t,e,n);return Object.keys(o).forEach(i=>{ot(i,document,o[i],r)}),!0}return!1}function kL(){if(typeof window>"u")return{on:()=>{},off:()=>{}};const t=new WeakMap,e=new WeakMap;function n(){t.set(this,!0)}function r(){t.set(this,!0),e.set(this,!0)}function o(M,I,E){const G=M[I];return M[I]=function(){return E.apply(M,arguments),G.apply(M,arguments)},M}function i(M,I){M[I]=Event.prototype[I]}const s=new WeakMap,a=Object.getOwnPropertyDescriptor(Event.prototype,"currentTarget");function l(){var M;return(M=s.get(this))!==null&&M!==void 0?M:null}function c(M,I){a!==void 0&&Object.defineProperty(M,"currentTarget",{configurable:!0,enumerable:!0,get:I??a.get})}const u={bubble:{},capture:{}},d={};function p(){const M=function(I){const{type:E,eventPhase:G,bubbles:oe}=I,N=el(I);if(G===2)return;const H=G===1?"capture":"bubble";let A=N;const J=[];for(;A===null&&(A=window),J.push(A),A!==window;)A=A.parentNode||null;const ie=u.capture[E],W=u.bubble[E];if(o(I,"stopPropagation",n),o(I,"stopImmediatePropagation",r),c(I,l),H==="capture"){if(ie===void 0)return;for(let ce=J.length-1;ce>=0&&!t.has(I);--ce){const X=J[ce],ue=ie.get(X);if(ue!==void 0){s.set(I,X);for(const Z of ue){if(e.has(I))break;Z(I)}}if(ce===0&&!oe&&W!==void 0){const Z=W.get(X);if(Z!==void 0)for(const R of Z){if(e.has(I))break;R(I)}}}}else if(H==="bubble"){if(W===void 0)return;for(let ce=0;ce<J.length&&!t.has(I);++ce){const X=J[ce],ue=W.get(X);if(ue!==void 0){s.set(I,X);for(const Z of ue){if(e.has(I))break;Z(I)}}}}i(I,"stopPropagation"),i(I,"stopImmediatePropagation"),c(I)};return M.displayName="evtdUnifiedHandler",M}function f(){const M=function(I){const{type:E,eventPhase:G}=I;if(G!==2)return;const oe=d[E];oe!==void 0&&oe.forEach(N=>N(I))};return M.displayName="evtdUnifiedWindowEventHandler",M}const h=p(),m=f();function y(M,I){const E=u[M];return E[I]===void 0&&(E[I]=new Map,window.addEventListener(I,h,M==="capture")),E[I]}function g(M){return d[M]===void 0&&(d[M]=new Set,window.addEventListener(M,m)),d[M]}function v(M,I){let E=M.get(I);return E===void 0&&M.set(I,E=new Set),E}function k(M,I,E,G){const oe=u[I][E];if(oe!==void 0){const N=oe.get(M);if(N!==void 0&&N.has(G))return!0}return!1}function b(M,I){const E=d[M];return!!(E!==void 0&&E.has(I))}function C(M,I,E,G){let oe;if(typeof G=="object"&&G.once===!0?oe=J=>{D(M,I,oe,G),E(J)}:oe=E,vL(M,I,oe,G))return;const N=G===!0||typeof G=="object"&&G.capture===!0?"capture":"bubble",H=y(N,M),A=v(H,I);if(A.has(oe)||A.add(oe),I===window){const J=g(M);J.has(oe)||J.add(oe)}}function D(M,I,E,G){if(xL(M,I,E,G))return;const oe=G===!0||typeof G=="object"&&G.capture===!0,N=oe?"capture":"bubble",H=y(N,M),A=v(H,I);if(I===window&&!k(I,oe?"bubble":"capture",M,E)&&b(M,E)){const J=d[M];J.delete(E),J.size===0&&(window.removeEventListener(M,m),d[M]=void 0)}A.has(E)&&A.delete(E),A.size===0&&H.delete(I),H.size===0&&(window.removeEventListener(M,h,N==="capture"),u[N][M]=void 0)}return{on:C,off:D}}const{on:yt,off:ot}=kL();function SL(t){const e=w.ref(!!t.value);if(e.value)return w.readonly(e);const n=w.watch(t,r=>{r&&(e.value=!0,n())});return w.readonly(e)}function ir(t){const e=w.computed(t),n=w.ref(e.value);return w.watch(e,r=>{n.value=r}),typeof t=="function"?n:{__v_isRef:!0,get value(){return n.value},set value(r){t.set(r)}}}function AL(){return w.getCurrentInstance()!==null}const CL=typeof window<"u";let tl,ps;const EL=()=>{var t,e;tl=CL?(e=(t=document)===null||t===void 0?void 0:t.fonts)===null||e===void 0?void 0:e.ready:void 0,ps=!1,tl!==void 0?tl.then(()=>{ps=!0}):ps=!0};EL();function TL(t){if(ps)return;let e=!1;w.onMounted(()=>{ps||tl?.then(()=>{e||t()})}),w.onBeforeUnmount(()=>{e=!0})}function n3(t,e){return w.watch(t,n=>{n!==void 0&&(e.value=n)}),w.computed(()=>t.value===void 0?e.value:t.value)}function r3(){const t=w.ref(!1);return w.onMounted(()=>{t.value=!0}),w.readonly(t)}function $L(t,e){return w.computed(()=>{for(const n of e)if(t[n]!==void 0)return t[n];return t[e[e.length-1]]})}const OL=(typeof window>"u"?!1:/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream;function ML(){return OL}function DL(t={},e){const n=w.reactive({ctrl:!1,command:!1,win:!1,shift:!1,tab:!1}),{keydown:r,keyup:o}=t,i=l=>{switch(l.key){case"Control":n.ctrl=!0;break;case"Meta":n.command=!0,n.win=!0;break;case"Shift":n.shift=!0;break;case"Tab":n.tab=!0;break}r!==void 0&&Object.keys(r).forEach(c=>{if(c!==l.key)return;const u=r[c];if(typeof u=="function")u(l);else{const{stop:d=!1,prevent:p=!1}=u;d&&l.stopPropagation(),p&&l.preventDefault(),u.handler(l)}})},s=l=>{switch(l.key){case"Control":n.ctrl=!1;break;case"Meta":n.command=!1,n.win=!1;break;case"Shift":n.shift=!1;break;case"Tab":n.tab=!1;break}o!==void 0&&Object.keys(o).forEach(c=>{if(c!==l.key)return;const u=o[c];if(typeof u=="function")u(l);else{const{stop:d=!1,prevent:p=!1}=u;d&&l.stopPropagation(),p&&l.preventDefault(),u.handler(l)}})},a=()=>{(e===void 0||e.value)&&(yt("keydown",document,i),yt("keyup",document,s)),e!==void 0&&w.watch(e,l=>{l?(yt("keydown",document,i),yt("keyup",document,s)):(ot("keydown",document,i),ot("keyup",document,s))})};return AL()?(w.onBeforeMount(a),w.onBeforeUnmount(()=>{(e===void 0||e.value)&&(ot("keydown",document,i),ot("keyup",document,s))})):a(),w.readonly(n)}const _L="n-internal-select-menu-body",Kf="n-drawer-body",Jf="n-modal-body",pc="n-popover-body",o3="__disabled__";function wi(t){const e=w.inject(Jf,null),n=w.inject(Kf,null),r=w.inject(pc,null),o=w.inject(_L,null),i=w.ref();if(typeof document<"u"){i.value=document.fullscreenElement;const s=()=>{i.value=document.fullscreenElement};w.onMounted(()=>{yt("fullscreenchange",document,s)}),w.onBeforeUnmount(()=>{ot("fullscreenchange",document,s)})}return ir(()=>{var s;const{to:a}=t;return a!==void 0?a===!1?o3:a===!0?i.value||"body":a:e?.value?(s=e.value.$el)!==null&&s!==void 0?s:e.value:n?.value?n.value:r?.value?r.value:o?.value?o.value:a??(i.value||"body")})}wi.tdkey=o3;wi.propTo={type:[String,Object,Boolean],default:void 0};function NL(t,e,n){const r=w.ref(t.value);let o=null;return w.watch(t,i=>{o!==null&&window.clearTimeout(o),i===!0?n&&!n.value?r.value=!0:o=window.setTimeout(()=>{r.value=!0},e):r.value=!1}),r}const IL=typeof document<"u"&&typeof window<"u";let t0=!1;function FL(){if(IL&&window.CSS&&!t0&&(t0=!0,"registerProperty"in window?.CSS))try{CSS.registerProperty({name:"--n-color-start",syntax:"<color>",inherits:!1,initialValue:"#0000"}),CSS.registerProperty({name:"--n-color-end",syntax:"<color>",inherits:!1,initialValue:"#0000"})}catch{}}function RL(t){const e={isDeactivated:!1};let n=!1;return w.onActivated(()=>{if(e.isDeactivated=!1,!n){n=!0;return}t()}),w.onDeactivated(()=>{e.isDeactivated=!0,n||(n=!0)}),e}function Mp(t,e,n="default"){const r=e[n];if(r===void 0)throw new Error(`[vueuc/${t}]: slot[${n}] is empty.`);return r()}function Dp(t,e=!0,n=[]){return t.forEach(r=>{if(r!==null){if(typeof r!="object"){(typeof r=="string"||typeof r=="number")&&n.push(w.createTextVNode(String(r)));return}if(Array.isArray(r)){Dp(r,e,n);return}if(r.type===w.Fragment){if(r.children===null)return;Array.isArray(r.children)&&Dp(r.children,e,n)}else r.type!==w.Comment&&n.push(r)}}),n}function n0(t,e,n="default"){const r=e[n];if(r===void 0)throw new Error(`[vueuc/${t}]: slot[${n}] is empty.`);const o=Dp(r());if(o.length===1)return o[0];throw new Error(`[vueuc/${t}]: slot[${n}] should have exactly one child.`)}let hr=null;function i3(){if(hr===null&&(hr=document.getElementById("v-binder-view-measurer"),hr===null)){hr=document.createElement("div"),hr.id="v-binder-view-measurer";const{style:t}=hr;t.position="fixed",t.left="0",t.right="0",t.top="0",t.bottom="0",t.pointerEvents="none",t.visibility="hidden",document.body.appendChild(hr)}return hr.getBoundingClientRect()}function BL(t,e){const n=i3();return{top:e,left:t,height:0,width:0,right:n.width-t,bottom:n.height-e}}function rd(t){const e=t.getBoundingClientRect(),n=i3();return{left:e.left-n.left,top:e.top-n.top,bottom:n.height+n.top-e.bottom,right:n.width+n.left-e.right,width:e.width,height:e.height}}function LL(t){return t.nodeType===9?null:t.parentNode}function s3(t){if(t===null)return null;const e=LL(t);if(e===null)return null;if(e.nodeType===9)return document;if(e.nodeType===1){const{overflow:n,overflowX:r,overflowY:o}=getComputedStyle(e);if(/(auto|scroll|overlay)/.test(n+o+r))return e}return s3(e)}const a3=w.defineComponent({name:"Binder",props:{syncTargetWithParent:Boolean,syncTarget:{type:Boolean,default:!0}},setup(t){var e;w.provide("VBinder",(e=w.getCurrentInstance())===null||e===void 0?void 0:e.proxy);const n=w.inject("VBinder",null),r=w.ref(null),o=g=>{r.value=g,n&&t.syncTargetWithParent&&n.setTargetRef(g)};let i=[];const s=()=>{let g=r.value;for(;g=s3(g),g!==null;)i.push(g);for(const v of i)yt("scroll",v,d,!0)},a=()=>{for(const g of i)ot("scroll",g,d,!0);i=[]},l=new Set,c=g=>{l.size===0&&s(),l.has(g)||l.add(g)},u=g=>{l.has(g)&&l.delete(g),l.size===0&&a()},d=()=>{nL(p)},p=()=>{l.forEach(g=>g())},f=new Set,h=g=>{f.size===0&&yt("resize",window,y),f.has(g)||f.add(g)},m=g=>{f.has(g)&&f.delete(g),f.size===0&&ot("resize",window,y)},y=()=>{f.forEach(g=>g())};return w.onBeforeUnmount(()=>{ot("resize",window,y),a()}),{targetRef:r,setTargetRef:o,addScrollListener:c,removeScrollListener:u,addResizeListener:h,removeResizeListener:m}},render(){return Mp("binder",this.$slots)}}),l3=w.defineComponent({name:"Target",setup(){const{setTargetRef:t,syncTarget:e}=w.inject("VBinder");return{syncTarget:e,setTargetDirective:{mounted:t,updated:t}}},render(){const{syncTarget:t,setTargetDirective:e}=this;return t?w.withDirectives(n0("follower",this.$slots),[[e]]):n0("follower",this.$slots)}}),No="@@mmoContext",PL={mounted(t,{value:e}){t[No]={handler:void 0},typeof e=="function"&&(t[No].handler=e,yt("mousemoveoutside",t,e))},updated(t,{value:e}){const n=t[No];typeof e=="function"?n.handler?n.handler!==e&&(ot("mousemoveoutside",t,n.handler),n.handler=e,yt("mousemoveoutside",t,e)):(t[No].handler=e,yt("mousemoveoutside",t,e)):n.handler&&(ot("mousemoveoutside",t,n.handler),n.handler=void 0)},unmounted(t){const{handler:e}=t[No];e&&ot("mousemoveoutside",t,e),t[No].handler=void 0}},Io="@@coContext",r0={mounted(t,{value:e,modifiers:n}){t[Io]={handler:void 0},typeof e=="function"&&(t[Io].handler=e,yt("clickoutside",t,e,{capture:n.capture}))},updated(t,{value:e,modifiers:n}){const r=t[Io];typeof e=="function"?r.handler?r.handler!==e&&(ot("clickoutside",t,r.handler,{capture:n.capture}),r.handler=e,yt("clickoutside",t,e,{capture:n.capture})):(t[Io].handler=e,yt("clickoutside",t,e,{capture:n.capture})):r.handler&&(ot("clickoutside",t,r.handler,{capture:n.capture}),r.handler=void 0)},unmounted(t,{modifiers:e}){const{handler:n}=t[Io];n&&ot("clickoutside",t,n,{capture:e.capture}),t[Io].handler=void 0}};function zL(t,e){console.error(`[vdirs/${t}]: ${e}`)}class jL{constructor(){this.elementZIndex=new Map,this.nextZIndex=2e3}get elementCount(){return this.elementZIndex.size}ensureZIndex(e,n){const{elementZIndex:r}=this;if(n!==void 0){e.style.zIndex=`${n}`,r.delete(e);return}const{nextZIndex:o}=this;r.has(e)&&r.get(e)+1===this.nextZIndex||(e.style.zIndex=`${o}`,r.set(e,o),this.nextZIndex=o+1,this.squashState())}unregister(e,n){const{elementZIndex:r}=this;r.has(e)?r.delete(e):n===void 0&&zL("z-index-manager/unregister-element","Element not found when unregistering."),this.squashState()}squashState(){const{elementCount:e}=this;e||(this.nextZIndex=2e3),this.nextZIndex-e>2500&&this.rearrange()}rearrange(){const e=Array.from(this.elementZIndex.entries());e.sort((n,r)=>n[1]-r[1]),this.nextZIndex=2e3,e.forEach(n=>{const r=n[0],o=this.nextZIndex++;`${o}`!==r.style.zIndex&&(r.style.zIndex=`${o}`)})}}const od=new jL,Fo="@@ziContext",c3={mounted(t,e){const{value:n={}}=e,{zIndex:r,enabled:o}=n;t[Fo]={enabled:!!o,initialized:!1},o&&(od.ensureZIndex(t,r),t[Fo].initialized=!0)},updated(t,e){const{value:n={}}=e,{zIndex:r,enabled:o}=n,i=t[Fo].enabled;o&&!i&&(od.ensureZIndex(t,r),t[Fo].initialized=!0),t[Fo].enabled=!!o},unmounted(t,e){if(!t[Fo].initialized)return;const{value:n={}}=e,{zIndex:r}=n;od.unregister(t,r)}},qL="@css-render/vue3-ssr";function VL(t,e){return`<style cssr-id="${t}">
90
+ ${e}
91
+ </style>`}function UL(t,e,n){const{styles:r,ids:o}=n;o.has(t)||r!==null&&(o.add(t),r.push(VL(t,e)))}const HL=typeof document<"u";function fc(){if(HL)return;const t=w.inject(qL,null);if(t!==null)return{adapter:(e,n)=>UL(e,n,t),context:t}}function o0(t,e){console.error(`[vueuc/${t}]: ${e}`)}const{c:Ta}=Wk(),WL="vueuc-style";function i0(t){return typeof t=="string"?document.querySelector(t):t()}const GL=w.defineComponent({name:"LazyTeleport",props:{to:{type:[String,Object],default:void 0},disabled:Boolean,show:{type:Boolean,required:!0}},setup(t){return{showTeleport:SL(w.toRef(t,"show")),mergedTo:w.computed(()=>{const{to:e}=t;return e??"body"})}},render(){return this.showTeleport?this.disabled?Mp("lazy-teleport",this.$slots):w.h(w.Teleport,{disabled:this.disabled,to:this.mergedTo},Mp("lazy-teleport",this.$slots)):null}}),$a={top:"bottom",bottom:"top",left:"right",right:"left"},s0={start:"end",center:"center",end:"start"},id={top:"height",bottom:"height",left:"width",right:"width"},KL={"bottom-start":"top left",bottom:"top center","bottom-end":"top right","top-start":"bottom left",top:"bottom center","top-end":"bottom right","right-start":"top left",right:"center left","right-end":"bottom left","left-start":"top right",left:"center right","left-end":"bottom right"},JL={"bottom-start":"bottom left",bottom:"bottom center","bottom-end":"bottom right","top-start":"top left",top:"top center","top-end":"top right","right-start":"top right",right:"center right","right-end":"bottom right","left-start":"top left",left:"center left","left-end":"bottom left"},XL={"bottom-start":"right","bottom-end":"left","top-start":"right","top-end":"left","right-start":"bottom","right-end":"top","left-start":"bottom","left-end":"top"},a0={top:!0,bottom:!1,left:!0,right:!1},l0={top:"end",bottom:"start",left:"end",right:"start"};function YL(t,e,n,r,o,i){if(!o||i)return{placement:t,top:0,left:0};const[s,a]=t.split("-");let l=a??"center",c={top:0,left:0};const u=(f,h,m)=>{let y=0,g=0;const v=n[f]-e[h]-e[f];return v>0&&r&&(m?g=a0[h]?v:-v:y=a0[h]?v:-v),{left:y,top:g}},d=s==="left"||s==="right";if(l!=="center"){const f=XL[t],h=$a[f],m=id[f];if(n[m]>e[m]){if(e[f]+e[m]<n[m]){const y=(n[m]-e[m])/2;e[f]<y||e[h]<y?e[f]<e[h]?(l=s0[a],c=u(m,h,d)):c=u(m,f,d):l="center"}}else n[m]<e[m]&&e[h]<0&&e[f]>e[h]&&(l=s0[a])}else{const f=s==="bottom"||s==="top"?"left":"top",h=$a[f],m=id[f],y=(n[m]-e[m])/2;(e[f]<y||e[h]<y)&&(e[f]>e[h]?(l=l0[f],c=u(m,f,d)):(l=l0[h],c=u(m,h,d)))}let p=s;return e[s]<n[id[s]]&&e[s]<e[$a[s]]&&(p=$a[s]),{placement:l!=="center"?`${p}-${l}`:p,left:c.left,top:c.top}}function ZL(t,e){return e?JL[t]:KL[t]}function QL(t,e,n,r,o,i){if(i)switch(t){case"bottom-start":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left)}px`,transform:"translateY(-100%)"};case"bottom-end":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top-start":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left)}px`,transform:""};case"top-end":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%)"};case"right-start":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%)"};case"right-end":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"left-start":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left)}px`,transform:""};case"left-end":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left)}px`,transform:"translateY(-100%)"};case"top":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left+n.width/2)}px`,transform:"translateX(-50%)"};case"right":return{top:`${Math.round(n.top-e.top+n.height/2)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%) translateY(-50%)"};case"left":return{top:`${Math.round(n.top-e.top+n.height/2)}px`,left:`${Math.round(n.left-e.left)}px`,transform:"translateY(-50%)"};case"bottom":default:return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left+n.width/2)}px`,transform:"translateX(-50%) translateY(-100%)"}}switch(t){case"bottom-start":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+o)}px`,transform:""};case"bottom-end":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+n.width+o)}px`,transform:"translateX(-100%)"};case"top-start":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+o)}px`,transform:"translateY(-100%)"};case"top-end":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+n.width+o)}px`,transform:"translateX(-100%) translateY(-100%)"};case"right-start":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+n.width+o)}px`,transform:""};case"right-end":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+n.width+o)}px`,transform:"translateY(-100%)"};case"left-start":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+o)}px`,transform:"translateX(-100%)"};case"left-end":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+o)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+n.width/2+o)}px`,transform:"translateY(-100%) translateX(-50%)"};case"right":return{top:`${Math.round(n.top-e.top+n.height/2+r)}px`,left:`${Math.round(n.left-e.left+n.width+o)}px`,transform:"translateY(-50%)"};case"left":return{top:`${Math.round(n.top-e.top+n.height/2+r)}px`,left:`${Math.round(n.left-e.left+o)}px`,transform:"translateY(-50%) translateX(-100%)"};case"bottom":default:return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+n.width/2+o)}px`,transform:"translateX(-50%)"}}}const eP=Ta([Ta(".v-binder-follower-container",{position:"absolute",left:"0",right:"0",top:"0",height:"0",pointerEvents:"none",zIndex:"auto"}),Ta(".v-binder-follower-content",{position:"absolute",zIndex:"auto"},[Ta("> *",{pointerEvents:"all"})])]),u3=w.defineComponent({name:"Follower",inheritAttrs:!1,props:{show:Boolean,enabled:{type:Boolean,default:void 0},placement:{type:String,default:"bottom"},syncTrigger:{type:Array,default:["resize","scroll"]},to:[String,Object],flip:{type:Boolean,default:!0},internalShift:Boolean,x:Number,y:Number,width:String,minWidth:String,containerClass:String,teleportDisabled:Boolean,zindexable:{type:Boolean,default:!0},zIndex:Number,overlap:Boolean},setup(t){const e=w.inject("VBinder"),n=ir(()=>t.enabled!==void 0?t.enabled:t.show),r=w.ref(null),o=w.ref(null),i=()=>{const{syncTrigger:p}=t;p.includes("scroll")&&e.addScrollListener(l),p.includes("resize")&&e.addResizeListener(l)},s=()=>{e.removeScrollListener(l),e.removeResizeListener(l)};w.onMounted(()=>{n.value&&(l(),i())});const a=fc();eP.mount({id:"vueuc/binder",head:!0,anchorMetaName:WL,ssr:a}),w.onBeforeUnmount(()=>{s()}),TL(()=>{n.value&&l()});const l=()=>{if(!n.value)return;const p=r.value;if(p===null)return;const f=e.targetRef,{x:h,y:m,overlap:y}=t,g=h!==void 0&&m!==void 0?BL(h,m):rd(f);p.style.setProperty("--v-target-width",`${Math.round(g.width)}px`),p.style.setProperty("--v-target-height",`${Math.round(g.height)}px`);const{width:v,minWidth:k,placement:b,internalShift:C,flip:D}=t;p.setAttribute("v-placement",b),y?p.setAttribute("v-overlap",""):p.removeAttribute("v-overlap");const{style:M}=p;v==="target"?M.width=`${g.width}px`:v!==void 0?M.width=v:M.width="",k==="target"?M.minWidth=`${g.width}px`:k!==void 0?M.minWidth=k:M.minWidth="";const I=rd(p),E=rd(o.value),{left:G,top:oe,placement:N}=YL(b,g,I,C,D,y),H=ZL(N,y),{left:A,top:J,transform:ie}=QL(N,E,g,oe,G,y);p.setAttribute("v-placement",N),p.style.setProperty("--v-offset-left",`${Math.round(G)}px`),p.style.setProperty("--v-offset-top",`${Math.round(oe)}px`),p.style.transform=`translateX(${A}) translateY(${J}) ${ie}`,p.style.setProperty("--v-transform-origin",H),p.style.transformOrigin=H};w.watch(n,p=>{p?(i(),c()):s()});const c=()=>{w.nextTick().then(l).catch(p=>console.error(p))};["placement","x","y","internalShift","flip","width","overlap","minWidth"].forEach(p=>{w.watch(w.toRef(t,p),l)}),["teleportDisabled"].forEach(p=>{w.watch(w.toRef(t,p),c)}),w.watch(w.toRef(t,"syncTrigger"),p=>{p.includes("resize")?e.addResizeListener(l):e.removeResizeListener(l),p.includes("scroll")?e.addScrollListener(l):e.removeScrollListener(l)});const u=r3(),d=ir(()=>{const{to:p}=t;if(p!==void 0)return p;u.value});return{VBinder:e,mergedEnabled:n,offsetContainerRef:o,followerRef:r,mergedTo:d,syncPosition:l}},render(){return w.h(GL,{show:this.show,to:this.mergedTo,disabled:this.teleportDisabled},{default:()=>{var t,e;const n=w.h("div",{class:["v-binder-follower-container",this.containerClass],ref:"offsetContainerRef"},[w.h("div",{class:"v-binder-follower-content",ref:"followerRef"},(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t))]);return this.zindexable?w.withDirectives(n,[[c3,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):n}})}});var fo=[],tP=function(){return fo.some(function(t){return t.activeTargets.length>0})},nP=function(){return fo.some(function(t){return t.skippedTargets.length>0})},c0="ResizeObserver loop completed with undelivered notifications.",rP=function(){var t;typeof ErrorEvent=="function"?t=new ErrorEvent("error",{message:c0}):(t=document.createEvent("Event"),t.initEvent("error",!1,!1),t.message=c0),window.dispatchEvent(t)},Rs;(function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(Rs||(Rs={}));var ho=function(t){return Object.freeze(t)},oP=function(){function t(e,n){this.inlineSize=e,this.blockSize=n,ho(this)}return t}(),d3=function(){function t(e,n,r,o){return this.x=e,this.y=n,this.width=r,this.height=o,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,ho(this)}return t.prototype.toJSON=function(){var e=this,n=e.x,r=e.y,o=e.top,i=e.right,s=e.bottom,a=e.left,l=e.width,c=e.height;return{x:n,y:r,top:o,right:i,bottom:s,left:a,width:l,height:c}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t}(),Xf=function(t){return t instanceof SVGElement&&"getBBox"in t},p3=function(t){if(Xf(t)){var e=t.getBBox(),n=e.width,r=e.height;return!n&&!r}var o=t,i=o.offsetWidth,s=o.offsetHeight;return!(i||s||t.getClientRects().length)},u0=function(t){var e;if(t instanceof Element)return!0;var n=(e=t?.ownerDocument)===null||e===void 0?void 0:e.defaultView;return!!(n&&t instanceof n.Element)},iP=function(t){switch(t.tagName){case"INPUT":if(t.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},fs=typeof window<"u"?window:{},Oa=new WeakMap,d0=/auto|scroll/,sP=/^tb|vertical/,aP=/msie|trident/i.test(fs.navigator&&fs.navigator.userAgent),Cn=function(t){return parseFloat(t||"0")},ei=function(t,e,n){return t===void 0&&(t=0),e===void 0&&(e=0),n===void 0&&(n=!1),new oP((n?e:t)||0,(n?t:e)||0)},p0=ho({devicePixelContentBoxSize:ei(),borderBoxSize:ei(),contentBoxSize:ei(),contentRect:new d3(0,0,0,0)}),f3=function(t,e){if(e===void 0&&(e=!1),Oa.has(t)&&!e)return Oa.get(t);if(p3(t))return Oa.set(t,p0),p0;var n=getComputedStyle(t),r=Xf(t)&&t.ownerSVGElement&&t.getBBox(),o=!aP&&n.boxSizing==="border-box",i=sP.test(n.writingMode||""),s=!r&&d0.test(n.overflowY||""),a=!r&&d0.test(n.overflowX||""),l=r?0:Cn(n.paddingTop),c=r?0:Cn(n.paddingRight),u=r?0:Cn(n.paddingBottom),d=r?0:Cn(n.paddingLeft),p=r?0:Cn(n.borderTopWidth),f=r?0:Cn(n.borderRightWidth),h=r?0:Cn(n.borderBottomWidth),m=r?0:Cn(n.borderLeftWidth),y=d+c,g=l+u,v=m+f,k=p+h,b=a?t.offsetHeight-k-t.clientHeight:0,C=s?t.offsetWidth-v-t.clientWidth:0,D=o?y+v:0,M=o?g+k:0,I=r?r.width:Cn(n.width)-D-C,E=r?r.height:Cn(n.height)-M-b,G=I+y+C+v,oe=E+g+b+k,N=ho({devicePixelContentBoxSize:ei(Math.round(I*devicePixelRatio),Math.round(E*devicePixelRatio),i),borderBoxSize:ei(G,oe,i),contentBoxSize:ei(I,E,i),contentRect:new d3(d,l,I,E)});return Oa.set(t,N),N},h3=function(t,e,n){var r=f3(t,n),o=r.borderBoxSize,i=r.contentBoxSize,s=r.devicePixelContentBoxSize;switch(e){case Rs.DEVICE_PIXEL_CONTENT_BOX:return s;case Rs.BORDER_BOX:return o;default:return i}},lP=function(){function t(e){var n=f3(e);this.target=e,this.contentRect=n.contentRect,this.borderBoxSize=ho([n.borderBoxSize]),this.contentBoxSize=ho([n.contentBoxSize]),this.devicePixelContentBoxSize=ho([n.devicePixelContentBoxSize])}return t}(),m3=function(t){if(p3(t))return 1/0;for(var e=0,n=t.parentNode;n;)e+=1,n=n.parentNode;return e},cP=function(){var t=1/0,e=[];fo.forEach(function(i){if(i.activeTargets.length!==0){var s=[];i.activeTargets.forEach(function(a){var l=new lP(a.target),c=m3(a.target);s.push(l),a.lastReportedSize=h3(a.target,a.observedBox),c<t&&(t=c)}),e.push(function(){i.callback.call(i.observer,s,i.observer)}),i.activeTargets.splice(0,i.activeTargets.length)}});for(var n=0,r=e;n<r.length;n++){var o=r[n];o()}return t},f0=function(t){fo.forEach(function(e){e.activeTargets.splice(0,e.activeTargets.length),e.skippedTargets.splice(0,e.skippedTargets.length),e.observationTargets.forEach(function(n){n.isActive()&&(m3(n.target)>t?e.activeTargets.push(n):e.skippedTargets.push(n))})})},uP=function(){var t=0;for(f0(t);tP();)t=cP(),f0(t);return nP()&&rP(),t>0},sd,g3=[],dP=function(){return g3.splice(0).forEach(function(t){return t()})},pP=function(t){if(!sd){var e=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return dP()}).observe(n,r),sd=function(){n.textContent="".concat(e?e--:e++)}}g3.push(t),sd()},fP=function(t){pP(function(){requestAnimationFrame(t)})},nl=0,hP=function(){return!!nl},mP=250,gP={attributes:!0,characterData:!0,childList:!0,subtree:!0},h0=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],m0=function(t){return t===void 0&&(t=0),Date.now()+t},ad=!1,yP=function(){function t(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return t.prototype.run=function(e){var n=this;if(e===void 0&&(e=mP),!ad){ad=!0;var r=m0(e);fP(function(){var o=!1;try{o=uP()}finally{if(ad=!1,e=r-m0(),!hP())return;o?n.run(1e3):e>0?n.run(e):n.start()}})}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var e=this,n=function(){return e.observer&&e.observer.observe(document.body,gP)};document.body?n():fs.addEventListener("DOMContentLoaded",n)},t.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),h0.forEach(function(n){return fs.addEventListener(n,e.listener,!0)}))},t.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),h0.forEach(function(n){return fs.removeEventListener(n,e.listener,!0)}),this.stopped=!0)},t}(),_p=new yP,g0=function(t){!nl&&t>0&&_p.start(),nl+=t,!nl&&_p.stop()},wP=function(t){return!Xf(t)&&!iP(t)&&getComputedStyle(t).display==="inline"},bP=function(){function t(e,n){this.target=e,this.observedBox=n||Rs.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var e=h3(this.target,this.observedBox,!0);return wP(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t}(),vP=function(){function t(e,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=n}return t}(),Ma=new WeakMap,y0=function(t,e){for(var n=0;n<t.length;n+=1)if(t[n].target===e)return n;return-1},Da=function(){function t(){}return t.connect=function(e,n){var r=new vP(e,n);Ma.set(e,r)},t.observe=function(e,n,r){var o=Ma.get(e),i=o.observationTargets.length===0;y0(o.observationTargets,n)<0&&(i&&fo.push(o),o.observationTargets.push(new bP(n,r&&r.box)),g0(1),_p.schedule())},t.unobserve=function(e,n){var r=Ma.get(e),o=y0(r.observationTargets,n),i=r.observationTargets.length===1;o>=0&&(i&&fo.splice(fo.indexOf(r),1),r.observationTargets.splice(o,1),g0(-1))},t.disconnect=function(e){var n=this,r=Ma.get(e);r.observationTargets.slice().forEach(function(o){return n.unobserve(e,o.target)}),r.activeTargets.splice(0,r.activeTargets.length)},t}(),xP=function(){function t(e){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof e!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Da.connect(this,e)}return t.prototype.observe=function(e,n){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!u0(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Da.observe(this,e,n)},t.prototype.unobserve=function(e){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!u0(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Da.unobserve(this,e)},t.prototype.disconnect=function(){Da.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t}();class kP{constructor(){this.handleResize=this.handleResize.bind(this),this.observer=new(typeof window<"u"&&window.ResizeObserver||xP)(this.handleResize),this.elHandlersMap=new Map}handleResize(e){for(const n of e){const r=this.elHandlersMap.get(n.target);r!==void 0&&r(n)}}registerHandler(e,n){this.elHandlersMap.set(e,n),this.observer.observe(e)}unregisterHandler(e){this.elHandlersMap.has(e)&&(this.elHandlersMap.delete(e),this.observer.unobserve(e))}}const w0=new kP,b0=w.defineComponent({name:"ResizeObserver",props:{onResize:Function},setup(t){let e=!1;const n=w.getCurrentInstance().proxy;function r(o){const{onResize:i}=t;i!==void 0&&i(o)}w.onMounted(()=>{const o=n.$el;if(o===void 0){o0("resize-observer","$el does not exist.");return}if(o.nextElementSibling!==o.nextSibling&&o.nodeType===3&&o.nodeValue!==""){o0("resize-observer","$el can not be observed (it may be a text node).");return}o.nextElementSibling!==null&&(w0.registerHandler(o.nextElementSibling,r),e=!0)}),w.onBeforeUnmount(()=>{e&&w0.unregisterHandler(n.$el.nextElementSibling)})},render(){return w.renderSlot(this.$slots,"default")}});function y3(t){return t instanceof HTMLElement}function w3(t){for(let e=0;e<t.childNodes.length;e++){const n=t.childNodes[e];if(y3(n)&&(v3(n)||w3(n)))return!0}return!1}function b3(t){for(let e=t.childNodes.length-1;e>=0;e--){const n=t.childNodes[e];if(y3(n)&&(v3(n)||b3(n)))return!0}return!1}function v3(t){if(!SP(t))return!1;try{t.focus({preventScroll:!0})}catch{}return document.activeElement===t}function SP(t){if(t.tabIndex>0||t.tabIndex===0&&t.getAttribute("tabIndex")!==null)return!0;if(t.getAttribute("disabled"))return!1;switch(t.nodeName){case"A":return!!t.href&&t.rel!=="ignore";case"INPUT":return t.type!=="hidden"&&t.type!=="file";case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1}}let Di=[];const AP=w.defineComponent({name:"FocusTrap",props:{disabled:Boolean,active:Boolean,autoFocus:{type:Boolean,default:!0},onEsc:Function,initialFocusTo:String,finalFocusTo:String,returnFocusOnDeactivated:{type:Boolean,default:!0}},setup(t){const e=gL(),n=w.ref(null),r=w.ref(null);let o=!1,i=!1;const s=typeof document>"u"?null:document.activeElement;function a(){return Di[Di.length-1]===e}function l(y){var g;y.code==="Escape"&&a()&&((g=t.onEsc)===null||g===void 0||g.call(t,y))}w.onMounted(()=>{w.watch(()=>t.active,y=>{y?(d(),yt("keydown",document,l)):(ot("keydown",document,l),o&&p())},{immediate:!0})}),w.onBeforeUnmount(()=>{ot("keydown",document,l),o&&p()});function c(y){if(!i&&a()){const g=u();if(g===null||g.contains(Rl(y)))return;f("first")}}function u(){const y=n.value;if(y===null)return null;let g=y;for(;g=g.nextSibling,!(g===null||g instanceof Element&&g.tagName==="DIV"););return g}function d(){var y;if(!t.disabled){if(Di.push(e),t.autoFocus){const{initialFocusTo:g}=t;g===void 0?f("first"):(y=i0(g))===null||y===void 0||y.focus({preventScroll:!0})}o=!0,document.addEventListener("focus",c,!0)}}function p(){var y;if(t.disabled||(document.removeEventListener("focus",c,!0),Di=Di.filter(v=>v!==e),a()))return;const{finalFocusTo:g}=t;g!==void 0?(y=i0(g))===null||y===void 0||y.focus({preventScroll:!0}):t.returnFocusOnDeactivated&&s instanceof HTMLElement&&(i=!0,s.focus({preventScroll:!0}),i=!1)}function f(y){if(a()&&t.active){const g=n.value,v=r.value;if(g!==null&&v!==null){const k=u();if(k==null||k===v){i=!0,g.focus({preventScroll:!0}),i=!1;return}i=!0;const b=y==="first"?w3(k):b3(k);i=!1,b||(i=!0,g.focus({preventScroll:!0}),i=!1)}}}function h(y){if(i)return;const g=u();g!==null&&(y.relatedTarget!==null&&g.contains(y.relatedTarget)?f("last"):f("first"))}function m(y){i||(y.relatedTarget!==null&&y.relatedTarget===n.value?f("last"):f("first"))}return{focusableStartRef:n,focusableEndRef:r,focusableStyle:"position: absolute; height: 0; width: 0;",handleStartFocus:h,handleEndFocus:m}},render(){const{default:t}=this.$slots;if(t===void 0)return null;if(this.disabled)return t();const{active:e,focusableStyle:n}=this;return w.h(w.Fragment,null,[w.h("div",{"aria-hidden":"true",tabindex:e?"0":"-1",ref:"focusableStartRef",style:n,onFocus:this.handleStartFocus}),t(),w.h("div",{"aria-hidden":"true",style:n,ref:"focusableEndRef",tabindex:e?"0":"-1",onFocus:this.handleEndFocus})])}}),CP=/^(\d|\.)+$/,v0=/(\d|\.)+/;function rl(t,{c:e=1,offset:n=0,attachPx:r=!0}={}){if(typeof t=="number"){const o=(t+n)*e;return o===0?"0":`${o}px`}else if(typeof t=="string")if(CP.test(t)){const o=(Number(t)+n)*e;return r?o===0?"0":`${o}px`:`${o}`}else{const o=v0.exec(t);return o?t.replace(v0,String((Number(o[0])+n)*e)):t}return t}function x0(t){const{left:e,right:n,top:r,bottom:o}=Ji(t);return`${r} ${e} ${o} ${n}`}let ld;function EP(){return ld===void 0&&(ld=navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),ld}const k0=new Set;function _i(t,e){const n=`[naive/${t}]: ${e}`;k0.has(n)||(k0.add(n),console.error(n))}function Ll(t,e){console.error(`[naive/${t}]: ${e}`)}function TP(t,e){throw new Error(`[naive/${t}]: ${e}`)}function Tr(t,...e){if(Array.isArray(t))t.forEach(n=>Tr(n,...e));else return t(...e)}function $P(t){return e=>{e?t.value=e.$el:t.value=null}}function Np(t,e=!0,n=[]){return t.forEach(r=>{if(r!==null){if(typeof r!="object"){(typeof r=="string"||typeof r=="number")&&n.push(w.createTextVNode(String(r)));return}if(Array.isArray(r)){Np(r,e,n);return}if(r.type===w.Fragment){if(r.children===null)return;Array.isArray(r.children)&&Np(r.children,e,n)}else{if(r.type===w.Comment&&e)return;n.push(r)}}}),n}function OP(t,e="default",n=void 0){const r=t[e];if(!r)return Ll("getFirstSlotVNode",`slot[${e}] is empty`),null;const o=Np(r(n));return o.length===1?o[0]:(Ll("getFirstSlotVNode",`slot[${e}] should have exactly one child`),null)}function x3(t,e=[],n){const r={};return e.forEach(o=>{r[o]=t[o]}),Object.assign(r,n)}function Pl(t,...e){return typeof t=="function"?t(...e):typeof t=="string"?w.createTextVNode(t):typeof t=="number"?w.createTextVNode(String(t)):null}function Yf(t){return t.some(e=>w.isVNode(e)?!(e.type===w.Comment||e.type===w.Fragment&&!Yf(e.children)):!0)?t:null}function cd(t,e){const n=t&&Yf(t());return e(n||null)}function S0(t){return!(t&&Yf(t()))}const A0=w.defineComponent({render(){var t,e;return(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t)}}),hc="n-config-provider",MP="n";function Ai(t={},e={defaultBordered:!0}){const n=w.inject(hc,null);return{inlineThemeDisabled:n?.inlineThemeDisabled,mergedRtlRef:n?.mergedRtlRef,mergedComponentPropsRef:n?.mergedComponentPropsRef,mergedBreakpointsRef:n?.mergedBreakpointsRef,mergedBorderedRef:w.computed(()=>{var r,o;const{bordered:i}=t;return i!==void 0?i:(o=(r=n?.mergedBorderedRef.value)!==null&&r!==void 0?r:e.defaultBordered)!==null&&o!==void 0?o:!0}),mergedClsPrefixRef:n?n.mergedClsPrefixRef:w.shallowRef(MP),namespaceRef:w.computed(()=>n?.mergedNamespaceRef.value)}}function mc(t,e,n,r){n||TP("useThemeClass","cssVarsRef is not passed");const o=w.inject(hc,null),i=o?.mergedThemeHashRef,s=o?.styleMountTarget,a=w.ref(""),l=fc();let c;const u=`__${t}`,d=()=>{let p=u;const f=e?e.value:void 0,h=i?.value;h&&(p+=`-${h}`),f&&(p+=`-${f}`);const{themeOverrides:m,builtinThemeOverrides:y}=r;m&&(p+=`-${$p(JSON.stringify(m))}`),y&&(p+=`-${$p(JSON.stringify(y))}`),a.value=p,c=()=>{const g=n.value;let v="";for(const k in g)v+=`${k}: ${g[k]};`;qe(`.${p}`,v).mount({id:p,ssr:l,parent:s}),c=void 0}};return w.watchEffect(()=>{d()}),{themeClass:a,onRender:()=>{c?.()}}}var k3=typeof Qr=="object"&&Qr&&Qr.Object===Object&&Qr,DP=typeof self=="object"&&self&&self.Object===Object&&self,Vn=k3||DP||Function("return this")(),Rr=Vn.Symbol,S3=Object.prototype,_P=S3.hasOwnProperty,NP=S3.toString,Ni=Rr?Rr.toStringTag:void 0;function IP(t){var e=_P.call(t,Ni),n=t[Ni];try{t[Ni]=void 0;var r=!0}catch{}var o=NP.call(t);return r&&(e?t[Ni]=n:delete t[Ni]),o}var FP=Object.prototype,RP=FP.toString;function BP(t){return RP.call(t)}var LP="[object Null]",PP="[object Undefined]",C0=Rr?Rr.toStringTag:void 0;function So(t){return t==null?t===void 0?PP:LP:C0&&C0 in Object(t)?IP(t):BP(t)}function Br(t){return t!=null&&typeof t=="object"}var zP="[object Symbol]";function Zf(t){return typeof t=="symbol"||Br(t)&&So(t)==zP}function A3(t,e){for(var n=-1,r=t==null?0:t.length,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o}var bn=Array.isArray,E0=Rr?Rr.prototype:void 0,T0=E0?E0.toString:void 0;function C3(t){if(typeof t=="string")return t;if(bn(t))return A3(t,C3)+"";if(Zf(t))return T0?T0.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function qr(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function Qf(t){return t}var jP="[object AsyncFunction]",qP="[object Function]",VP="[object GeneratorFunction]",UP="[object Proxy]";function eh(t){if(!qr(t))return!1;var e=So(t);return e==qP||e==VP||e==jP||e==UP}var ud=Vn["__core-js_shared__"],$0=function(){var t=/[^.]+$/.exec(ud&&ud.keys&&ud.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function HP(t){return!!$0&&$0 in t}var WP=Function.prototype,GP=WP.toString;function Ao(t){if(t!=null){try{return GP.call(t)}catch{}try{return t+""}catch{}}return""}var KP=/[\\^$.*+?()[\]{}|]/g,JP=/^\[object .+?Constructor\]$/,XP=Function.prototype,YP=Object.prototype,ZP=XP.toString,QP=YP.hasOwnProperty,ez=RegExp("^"+ZP.call(QP).replace(KP,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function tz(t){if(!qr(t)||HP(t))return!1;var e=eh(t)?ez:JP;return e.test(Ao(t))}function nz(t,e){return t?.[e]}function Co(t,e){var n=nz(t,e);return tz(n)?n:void 0}var Ip=Co(Vn,"WeakMap"),O0=Object.create,rz=function(){function t(){}return function(e){if(!qr(e))return{};if(O0)return O0(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function oz(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function iz(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}var sz=800,az=16,lz=Date.now;function cz(t){var e=0,n=0;return function(){var r=lz(),o=az-(r-n);if(n=r,o>0){if(++e>=sz)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function uz(t){return function(){return t}}var zl=function(){try{var t=Co(Object,"defineProperty");return t({},"",{}),t}catch{}}(),dz=zl?function(t,e){return zl(t,"toString",{configurable:!0,enumerable:!1,value:uz(e),writable:!0})}:Qf,pz=cz(dz),fz=9007199254740991,hz=/^(?:0|[1-9]\d*)$/;function th(t,e){var n=typeof t;return e=e??fz,!!e&&(n=="number"||n!="symbol"&&hz.test(t))&&t>-1&&t%1==0&&t<e}function nh(t,e,n){e=="__proto__"&&zl?zl(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function ea(t,e){return t===e||t!==t&&e!==e}var mz=Object.prototype,gz=mz.hasOwnProperty;function yz(t,e,n){var r=t[e];(!(gz.call(t,e)&&ea(r,n))||n===void 0&&!(e in t))&&nh(t,e,n)}function wz(t,e,n,r){var o=!n;n||(n={});for(var i=-1,s=e.length;++i<s;){var a=e[i],l=void 0;l===void 0&&(l=t[a]),o?nh(n,a,l):yz(n,a,l)}return n}var M0=Math.max;function bz(t,e,n){return e=M0(e===void 0?t.length-1:e,0),function(){for(var r=arguments,o=-1,i=M0(r.length-e,0),s=Array(i);++o<i;)s[o]=r[e+o];o=-1;for(var a=Array(e+1);++o<e;)a[o]=r[o];return a[e]=n(s),oz(t,this,a)}}function vz(t,e){return pz(bz(t,e,Qf),t+"")}var xz=9007199254740991;function rh(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=xz}function Ci(t){return t!=null&&rh(t.length)&&!eh(t)}function kz(t,e,n){if(!qr(n))return!1;var r=typeof e;return(r=="number"?Ci(n)&&th(e,n.length):r=="string"&&e in n)?ea(n[e],t):!1}function Sz(t){return vz(function(e,n){var r=-1,o=n.length,i=o>1?n[o-1]:void 0,s=o>2?n[2]:void 0;for(i=t.length>3&&typeof i=="function"?(o--,i):void 0,s&&kz(n[0],n[1],s)&&(i=o<3?void 0:i,o=1),e=Object(e);++r<o;){var a=n[r];a&&t(e,a,r,i)}return e})}var Az=Object.prototype;function oh(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||Az;return t===n}function Cz(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var Ez="[object Arguments]";function D0(t){return Br(t)&&So(t)==Ez}var E3=Object.prototype,Tz=E3.hasOwnProperty,$z=E3.propertyIsEnumerable,jl=D0(function(){return arguments}())?D0:function(t){return Br(t)&&Tz.call(t,"callee")&&!$z.call(t,"callee")};function Oz(){return!1}var T3=typeof exports=="object"&&exports&&!exports.nodeType&&exports,_0=T3&&typeof module=="object"&&module&&!module.nodeType&&module,Mz=_0&&_0.exports===T3,N0=Mz?Vn.Buffer:void 0,Dz=N0?N0.isBuffer:void 0,ql=Dz||Oz,_z="[object Arguments]",Nz="[object Array]",Iz="[object Boolean]",Fz="[object Date]",Rz="[object Error]",Bz="[object Function]",Lz="[object Map]",Pz="[object Number]",zz="[object Object]",jz="[object RegExp]",qz="[object Set]",Vz="[object String]",Uz="[object WeakMap]",Hz="[object ArrayBuffer]",Wz="[object DataView]",Gz="[object Float32Array]",Kz="[object Float64Array]",Jz="[object Int8Array]",Xz="[object Int16Array]",Yz="[object Int32Array]",Zz="[object Uint8Array]",Qz="[object Uint8ClampedArray]",e9="[object Uint16Array]",t9="[object Uint32Array]",tt={};tt[Gz]=tt[Kz]=tt[Jz]=tt[Xz]=tt[Yz]=tt[Zz]=tt[Qz]=tt[e9]=tt[t9]=!0;tt[_z]=tt[Nz]=tt[Hz]=tt[Iz]=tt[Wz]=tt[Fz]=tt[Rz]=tt[Bz]=tt[Lz]=tt[Pz]=tt[zz]=tt[jz]=tt[qz]=tt[Vz]=tt[Uz]=!1;function n9(t){return Br(t)&&rh(t.length)&&!!tt[So(t)]}function r9(t){return function(e){return t(e)}}var $3=typeof exports=="object"&&exports&&!exports.nodeType&&exports,hs=$3&&typeof module=="object"&&module&&!module.nodeType&&module,o9=hs&&hs.exports===$3,dd=o9&&k3.process,I0=function(){try{var t=hs&&hs.require&&hs.require("util").types;return t||dd&&dd.binding&&dd.binding("util")}catch{}}(),F0=I0&&I0.isTypedArray,ih=F0?r9(F0):n9,i9=Object.prototype,s9=i9.hasOwnProperty;function O3(t,e){var n=bn(t),r=!n&&jl(t),o=!n&&!r&&ql(t),i=!n&&!r&&!o&&ih(t),s=n||r||o||i,a=s?Cz(t.length,String):[],l=a.length;for(var c in t)(e||s9.call(t,c))&&!(s&&(c=="length"||o&&(c=="offset"||c=="parent")||i&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||th(c,l)))&&a.push(c);return a}function M3(t,e){return function(n){return t(e(n))}}var a9=M3(Object.keys,Object),l9=Object.prototype,c9=l9.hasOwnProperty;function u9(t){if(!oh(t))return a9(t);var e=[];for(var n in Object(t))c9.call(t,n)&&n!="constructor"&&e.push(n);return e}function sh(t){return Ci(t)?O3(t):u9(t)}function d9(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}var p9=Object.prototype,f9=p9.hasOwnProperty;function h9(t){if(!qr(t))return d9(t);var e=oh(t),n=[];for(var r in t)r=="constructor"&&(e||!f9.call(t,r))||n.push(r);return n}function D3(t){return Ci(t)?O3(t,!0):h9(t)}var m9=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,g9=/^\w*$/;function ah(t,e){if(bn(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||Zf(t)?!0:g9.test(t)||!m9.test(t)||e!=null&&t in Object(e)}var Bs=Co(Object,"create");function y9(){this.__data__=Bs?Bs(null):{},this.size=0}function w9(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var b9="__lodash_hash_undefined__",v9=Object.prototype,x9=v9.hasOwnProperty;function k9(t){var e=this.__data__;if(Bs){var n=e[t];return n===b9?void 0:n}return x9.call(e,t)?e[t]:void 0}var S9=Object.prototype,A9=S9.hasOwnProperty;function C9(t){var e=this.__data__;return Bs?e[t]!==void 0:A9.call(e,t)}var E9="__lodash_hash_undefined__";function T9(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Bs&&e===void 0?E9:e,this}function xo(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}xo.prototype.clear=y9;xo.prototype.delete=w9;xo.prototype.get=k9;xo.prototype.has=C9;xo.prototype.set=T9;function $9(){this.__data__=[],this.size=0}function gc(t,e){for(var n=t.length;n--;)if(ea(t[n][0],e))return n;return-1}var O9=Array.prototype,M9=O9.splice;function D9(t){var e=this.__data__,n=gc(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():M9.call(e,n,1),--this.size,!0}function _9(t){var e=this.__data__,n=gc(e,t);return n<0?void 0:e[n][1]}function N9(t){return gc(this.__data__,t)>-1}function I9(t,e){var n=this.__data__,r=gc(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function ur(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}ur.prototype.clear=$9;ur.prototype.delete=D9;ur.prototype.get=_9;ur.prototype.has=N9;ur.prototype.set=I9;var Ls=Co(Vn,"Map");function F9(){this.size=0,this.__data__={hash:new xo,map:new(Ls||ur),string:new xo}}function R9(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function yc(t,e){var n=t.__data__;return R9(e)?n[typeof e=="string"?"string":"hash"]:n.map}function B9(t){var e=yc(this,t).delete(t);return this.size-=e?1:0,e}function L9(t){return yc(this,t).get(t)}function P9(t){return yc(this,t).has(t)}function z9(t,e){var n=yc(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function dr(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}dr.prototype.clear=F9;dr.prototype.delete=B9;dr.prototype.get=L9;dr.prototype.has=P9;dr.prototype.set=z9;var j9="Expected a function";function lh(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(j9);var n=function(){var r=arguments,o=e?e.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var s=t.apply(this,r);return n.cache=i.set(o,s)||i,s};return n.cache=new(lh.Cache||dr),n}lh.Cache=dr;var q9=500;function V9(t){var e=lh(t,function(r){return n.size===q9&&n.clear(),r}),n=e.cache;return e}var U9=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,H9=/\\(\\)?/g,W9=V9(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(U9,function(n,r,o,i){e.push(o?i.replace(H9,"$1"):r||n)}),e});function G9(t){return t==null?"":C3(t)}function _3(t,e){return bn(t)?t:ah(t,e)?[t]:W9(G9(t))}function wc(t){if(typeof t=="string"||Zf(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function N3(t,e){e=_3(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[wc(e[n++])];return n&&n==r?t:void 0}function K9(t,e,n){var r=t==null?void 0:N3(t,e);return r===void 0?n:r}function J9(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t}var I3=M3(Object.getPrototypeOf,Object),X9="[object Object]",Y9=Function.prototype,Z9=Object.prototype,F3=Y9.toString,Q9=Z9.hasOwnProperty,e7=F3.call(Object);function t7(t){if(!Br(t)||So(t)!=X9)return!1;var e=I3(t);if(e===null)return!0;var n=Q9.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&F3.call(n)==e7}function n7(){this.__data__=new ur,this.size=0}function r7(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function o7(t){return this.__data__.get(t)}function i7(t){return this.__data__.has(t)}var s7=200;function a7(t,e){var n=this.__data__;if(n instanceof ur){var r=n.__data__;if(!Ls||r.length<s7-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new dr(r)}return n.set(t,e),this.size=n.size,this}function Rn(t){var e=this.__data__=new ur(t);this.size=e.size}Rn.prototype.clear=n7;Rn.prototype.delete=r7;Rn.prototype.get=o7;Rn.prototype.has=i7;Rn.prototype.set=a7;var R3=typeof exports=="object"&&exports&&!exports.nodeType&&exports,R0=R3&&typeof module=="object"&&module&&!module.nodeType&&module,l7=R0&&R0.exports===R3,B0=l7?Vn.Buffer:void 0;B0&&B0.allocUnsafe;function c7(t,e){return t.slice()}function u7(t,e){for(var n=-1,r=t==null?0:t.length,o=0,i=[];++n<r;){var s=t[n];e(s,n,t)&&(i[o++]=s)}return i}function d7(){return[]}var p7=Object.prototype,f7=p7.propertyIsEnumerable,L0=Object.getOwnPropertySymbols,h7=L0?function(t){return t==null?[]:(t=Object(t),u7(L0(t),function(e){return f7.call(t,e)}))}:d7;function m7(t,e,n){var r=e(t);return bn(t)?r:J9(r,n(t))}function P0(t){return m7(t,sh,h7)}var Fp=Co(Vn,"DataView"),Rp=Co(Vn,"Promise"),Bp=Co(Vn,"Set"),z0="[object Map]",g7="[object Object]",j0="[object Promise]",q0="[object Set]",V0="[object WeakMap]",U0="[object DataView]",y7=Ao(Fp),w7=Ao(Ls),b7=Ao(Rp),v7=Ao(Bp),x7=Ao(Ip),kr=So;(Fp&&kr(new Fp(new ArrayBuffer(1)))!=U0||Ls&&kr(new Ls)!=z0||Rp&&kr(Rp.resolve())!=j0||Bp&&kr(new Bp)!=q0||Ip&&kr(new Ip)!=V0)&&(kr=function(t){var e=So(t),n=e==g7?t.constructor:void 0,r=n?Ao(n):"";if(r)switch(r){case y7:return U0;case w7:return z0;case b7:return j0;case v7:return q0;case x7:return V0}return e});var Vl=Vn.Uint8Array;function k7(t){var e=new t.constructor(t.byteLength);return new Vl(e).set(new Vl(t)),e}function S7(t,e){var n=k7(t.buffer);return new t.constructor(n,t.byteOffset,t.length)}function A7(t){return typeof t.constructor=="function"&&!oh(t)?rz(I3(t)):{}}var C7="__lodash_hash_undefined__";function E7(t){return this.__data__.set(t,C7),this}function T7(t){return this.__data__.has(t)}function Ul(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new dr;++e<n;)this.add(t[e])}Ul.prototype.add=Ul.prototype.push=E7;Ul.prototype.has=T7;function $7(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function O7(t,e){return t.has(e)}var M7=1,D7=2;function B3(t,e,n,r,o,i){var s=n&M7,a=t.length,l=e.length;if(a!=l&&!(s&&l>a))return!1;var c=i.get(t),u=i.get(e);if(c&&u)return c==e&&u==t;var d=-1,p=!0,f=n&D7?new Ul:void 0;for(i.set(t,e),i.set(e,t);++d<a;){var h=t[d],m=e[d];if(r)var y=s?r(m,h,d,e,t,i):r(h,m,d,t,e,i);if(y!==void 0){if(y)continue;p=!1;break}if(f){if(!$7(e,function(g,v){if(!O7(f,v)&&(h===g||o(h,g,n,r,i)))return f.push(v)})){p=!1;break}}else if(!(h===m||o(h,m,n,r,i))){p=!1;break}}return i.delete(t),i.delete(e),p}function _7(t){var e=-1,n=Array(t.size);return t.forEach(function(r,o){n[++e]=[o,r]}),n}function N7(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var I7=1,F7=2,R7="[object Boolean]",B7="[object Date]",L7="[object Error]",P7="[object Map]",z7="[object Number]",j7="[object RegExp]",q7="[object Set]",V7="[object String]",U7="[object Symbol]",H7="[object ArrayBuffer]",W7="[object DataView]",H0=Rr?Rr.prototype:void 0,pd=H0?H0.valueOf:void 0;function G7(t,e,n,r,o,i,s){switch(n){case W7:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case H7:return!(t.byteLength!=e.byteLength||!i(new Vl(t),new Vl(e)));case R7:case B7:case z7:return ea(+t,+e);case L7:return t.name==e.name&&t.message==e.message;case j7:case V7:return t==e+"";case P7:var a=_7;case q7:var l=r&I7;if(a||(a=N7),t.size!=e.size&&!l)return!1;var c=s.get(t);if(c)return c==e;r|=F7,s.set(t,e);var u=B3(a(t),a(e),r,o,i,s);return s.delete(t),u;case U7:if(pd)return pd.call(t)==pd.call(e)}return!1}var K7=1,J7=Object.prototype,X7=J7.hasOwnProperty;function Y7(t,e,n,r,o,i){var s=n&K7,a=P0(t),l=a.length,c=P0(e),u=c.length;if(l!=u&&!s)return!1;for(var d=l;d--;){var p=a[d];if(!(s?p in e:X7.call(e,p)))return!1}var f=i.get(t),h=i.get(e);if(f&&h)return f==e&&h==t;var m=!0;i.set(t,e),i.set(e,t);for(var y=s;++d<l;){p=a[d];var g=t[p],v=e[p];if(r)var k=s?r(v,g,p,e,t,i):r(g,v,p,t,e,i);if(!(k===void 0?g===v||o(g,v,n,r,i):k)){m=!1;break}y||(y=p=="constructor")}if(m&&!y){var b=t.constructor,C=e.constructor;b!=C&&"constructor"in t&&"constructor"in e&&!(typeof b=="function"&&b instanceof b&&typeof C=="function"&&C instanceof C)&&(m=!1)}return i.delete(t),i.delete(e),m}var Z7=1,W0="[object Arguments]",G0="[object Array]",_a="[object Object]",Q7=Object.prototype,K0=Q7.hasOwnProperty;function ej(t,e,n,r,o,i){var s=bn(t),a=bn(e),l=s?G0:kr(t),c=a?G0:kr(e);l=l==W0?_a:l,c=c==W0?_a:c;var u=l==_a,d=c==_a,p=l==c;if(p&&ql(t)){if(!ql(e))return!1;s=!0,u=!1}if(p&&!u)return i||(i=new Rn),s||ih(t)?B3(t,e,n,r,o,i):G7(t,e,l,n,r,o,i);if(!(n&Z7)){var f=u&&K0.call(t,"__wrapped__"),h=d&&K0.call(e,"__wrapped__");if(f||h){var m=f?t.value():t,y=h?e.value():e;return i||(i=new Rn),o(m,y,n,r,i)}}return p?(i||(i=new Rn),Y7(t,e,n,r,o,i)):!1}function ch(t,e,n,r,o){return t===e?!0:t==null||e==null||!Br(t)&&!Br(e)?t!==t&&e!==e:ej(t,e,n,r,ch,o)}var tj=1,nj=2;function rj(t,e,n,r){var o=n.length,i=o;if(t==null)return!i;for(t=Object(t);o--;){var s=n[o];if(s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++o<i;){s=n[o];var a=s[0],l=t[a],c=s[1];if(s[2]){if(l===void 0&&!(a in t))return!1}else{var u=new Rn,d;if(!(d===void 0?ch(c,l,tj|nj,r,u):d))return!1}}return!0}function L3(t){return t===t&&!qr(t)}function oj(t){for(var e=sh(t),n=e.length;n--;){var r=e[n],o=t[r];e[n]=[r,o,L3(o)]}return e}function P3(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}function ij(t){var e=oj(t);return e.length==1&&e[0][2]?P3(e[0][0],e[0][1]):function(n){return n===t||rj(n,t,e)}}function sj(t,e){return t!=null&&e in Object(t)}function aj(t,e,n){e=_3(e,t);for(var r=-1,o=e.length,i=!1;++r<o;){var s=wc(e[r]);if(!(i=t!=null&&n(t,s)))break;t=t[s]}return i||++r!=o?i:(o=t==null?0:t.length,!!o&&rh(o)&&th(s,o)&&(bn(t)||jl(t)))}function lj(t,e){return t!=null&&aj(t,e,sj)}var cj=1,uj=2;function dj(t,e){return ah(t)&&L3(e)?P3(wc(t),e):function(n){var r=K9(n,t);return r===void 0&&r===e?lj(n,t):ch(e,r,cj|uj)}}function pj(t){return function(e){return e?.[t]}}function fj(t){return function(e){return N3(e,t)}}function hj(t){return ah(t)?pj(wc(t)):fj(t)}function mj(t){return typeof t=="function"?t:t==null?Qf:typeof t=="object"?bn(t)?dj(t[0],t[1]):ij(t):hj(t)}function gj(t){return function(e,n,r){for(var o=-1,i=Object(e),s=r(e),a=s.length;a--;){var l=s[++o];if(n(i[l],l,i)===!1)break}return e}}var z3=gj();function yj(t,e){return t&&z3(t,e,sh)}function wj(t,e){return function(n,r){if(n==null)return n;if(!Ci(n))return t(n,r);for(var o=n.length,i=-1,s=Object(n);++i<o&&r(s[i],i,s)!==!1;);return n}}var bj=wj(yj);function Lp(t,e,n){(n!==void 0&&!ea(t[e],n)||n===void 0&&!(e in t))&&nh(t,e,n)}function vj(t){return Br(t)&&Ci(t)}function Pp(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function xj(t){return wz(t,D3(t))}function kj(t,e,n,r,o,i,s){var a=Pp(t,n),l=Pp(e,n),c=s.get(l);if(c){Lp(t,n,c);return}var u=i?i(a,l,n+"",t,e,s):void 0,d=u===void 0;if(d){var p=bn(l),f=!p&&ql(l),h=!p&&!f&&ih(l);u=l,p||f||h?bn(a)?u=a:vj(a)?u=iz(a):f?(d=!1,u=c7(l)):h?(d=!1,u=S7(l)):u=[]:t7(l)||jl(l)?(u=a,jl(a)?u=xj(a):(!qr(a)||eh(a))&&(u=A7(l))):d=!1}d&&(s.set(l,u),o(u,l,r,i,s),s.delete(l)),Lp(t,n,u)}function j3(t,e,n,r,o){t!==e&&z3(e,function(i,s){if(o||(o=new Rn),qr(i))kj(t,e,s,n,j3,r,o);else{var a=r?r(Pp(t,s),i,s+"",t,e,o):void 0;a===void 0&&(a=i),Lp(t,s,a)}},D3)}function Sj(t,e){var n=-1,r=Ci(t)?Array(t.length):[];return bj(t,function(o,i,s){r[++n]=e(o,i,s)}),r}function Aj(t,e){var n=bn(t)?A3:Sj;return n(t,mj(e))}var Na=Sz(function(t,e,n){j3(t,e,n)});const zp="naive-ui-style";function Cj(t,e,n){if(!e)return;const r=fc(),o=w.computed(()=>{const{value:a}=e;if(!a)return;const l=a[t];if(l)return l}),i=w.inject(hc,null),s=()=>{w.watchEffect(()=>{const{value:a}=n,l=`${a}${t}Rtl`;if(JB(l,r))return;const{value:c}=o;c&&c.style.mount({id:l,head:!0,anchorMetaName:zp,props:{bPrefix:a?`.${a}-`:void 0},ssr:r,parent:i?.styleMountTarget})})};return r?s():w.onBeforeMount(s),o}const bc={fontFamily:'v-sans, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',fontFamilyMono:"v-mono, SFMono-Regular, Menlo, Consolas, Courier, monospace",fontWeight:"400",fontWeightStrong:"500",cubicBezierEaseInOut:"cubic-bezier(.4, 0, .2, 1)",cubicBezierEaseOut:"cubic-bezier(0, 0, .2, 1)",cubicBezierEaseIn:"cubic-bezier(.4, 0, 1, 1)",borderRadius:"3px",borderRadiusSmall:"2px",fontSize:"14px",fontSizeMini:"12px",fontSizeTiny:"12px",fontSizeSmall:"14px",fontSizeMedium:"14px",fontSizeLarge:"15px",fontSizeHuge:"16px",lineHeight:"1.6",heightMini:"16px",heightTiny:"22px",heightSmall:"28px",heightMedium:"34px",heightLarge:"40px",heightHuge:"46px"},{fontSize:Ej,fontFamily:Tj,lineHeight:$j}=bc,Oj=qe("body",`
92
+ margin: 0;
93
+ font-size: ${Ej};
94
+ font-family: ${Tj};
95
+ line-height: ${$j};
96
+ -webkit-text-size-adjust: 100%;
97
+ -webkit-tap-highlight-color: transparent;
98
+ `,[qe("input",`
99
+ font-family: inherit;
100
+ font-size: inherit;
101
+ `)]);function nn(t,e,n,r,o,i){const s=fc(),a=w.inject(hc,null);if(n){const l=()=>{const c=i?.value;n.mount({id:c===void 0?e:c+e,head:!0,props:{bPrefix:c?`.${c}-`:void 0},anchorMetaName:zp,ssr:s,parent:a?.styleMountTarget}),a?.preflightStyleDisabled||Oj.mount({id:"n-global",head:!0,anchorMetaName:zp,ssr:s,parent:a?.styleMountTarget})};s?l():w.onBeforeMount(l)}return w.computed(()=>{var l;const{theme:{common:c,self:u,peers:d={}}={},themeOverrides:p={},builtinThemeOverrides:f={}}=o,{common:h,peers:m}=p,{common:y=void 0,[t]:{common:g=void 0,self:v=void 0,peers:k={}}={}}=a?.mergedThemeRef.value||{},{common:b=void 0,[t]:C={}}=a?.mergedThemeOverridesRef.value||{},{common:D,peers:M={}}=C,I=Na({},c||g||y||r.common,b,D,h),E=Na((l=u||v||r.self)===null||l===void 0?void 0:l(I),f,C,p);return{common:I,self:E,peers:Na({},r.peers,k,d),peerOverrides:Na({},f.peers,M,m)}})}nn.props={theme:Object,themeOverrides:Object,builtinThemeOverrides:Object};const Mj=w.defineComponent({name:"ChevronRight",render(){return w.h("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},w.h("path",{d:"M5.64645 3.14645C5.45118 3.34171 5.45118 3.65829 5.64645 3.85355L9.79289 8L5.64645 12.1464C5.45118 12.3417 5.45118 12.6583 5.64645 12.8536C5.84171 13.0488 6.15829 13.0488 6.35355 12.8536L10.8536 8.35355C11.0488 8.15829 11.0488 7.84171 10.8536 7.64645L6.35355 3.14645C6.15829 2.95118 5.84171 2.95118 5.64645 3.14645Z",fill:"currentColor"}))}}),{cubicBezierEaseInOut:J0}=bc;function Dj({name:t="fade-in",enterDuration:e="0.2s",leaveDuration:n="0.2s",enterCubicBezier:r=J0,leaveCubicBezier:o=J0}={}){return[qe(`&.${t}-transition-enter-active`,{transition:`all ${e} ${r}!important`}),qe(`&.${t}-transition-leave-active`,{transition:`all ${n} ${o}!important`}),qe(`&.${t}-transition-enter-from, &.${t}-transition-leave-to`,{opacity:0}),qe(`&.${t}-transition-leave-from, &.${t}-transition-enter-to`,{opacity:1})]}const Me={neutralBase:"#FFF",neutralInvertBase:"#000",neutralTextBase:"#000",neutralPopover:"#fff",neutralCard:"#fff",neutralModal:"#fff",neutralBody:"#fff",alpha1:"0.82",alpha2:"0.72",alpha3:"0.38",alpha4:"0.24",alpha5:"0.18",alphaClose:"0.6",alphaDisabled:"0.5",alphaAvatar:"0.2",alphaProgressRail:".08",alphaInput:"0",alphaScrollbar:"0.25",alphaScrollbarHover:"0.4",primaryHover:"#36ad6a",primaryDefault:"#18a058",primaryActive:"#0c7a43",primarySuppl:"#36ad6a",infoHover:"#4098fc",infoDefault:"#2080f0",infoActive:"#1060c9",infoSuppl:"#4098fc",errorHover:"#de576d",errorDefault:"#d03050",errorActive:"#ab1f3f",errorSuppl:"#de576d",warningHover:"#fcb040",warningDefault:"#f0a020",warningActive:"#c97c10",warningSuppl:"#fcb040",successHover:"#36ad6a",successDefault:"#18a058",successActive:"#0c7a43",successSuppl:"#36ad6a"},_j=vo(Me.neutralBase),q3=vo(Me.neutralInvertBase),Nj=`rgba(${q3.slice(0,3).join(", ")}, `;function X0(t){return`${Nj+String(t)})`}function $t(t){const e=Array.from(q3);return e[3]=Number(t),e3(_j,e)}const Ei=Object.assign(Object.assign({name:"common"},bc),{baseColor:Me.neutralBase,primaryColor:Me.primaryDefault,primaryColorHover:Me.primaryHover,primaryColorPressed:Me.primaryActive,primaryColorSuppl:Me.primarySuppl,infoColor:Me.infoDefault,infoColorHover:Me.infoHover,infoColorPressed:Me.infoActive,infoColorSuppl:Me.infoSuppl,successColor:Me.successDefault,successColorHover:Me.successHover,successColorPressed:Me.successActive,successColorSuppl:Me.successSuppl,warningColor:Me.warningDefault,warningColorHover:Me.warningHover,warningColorPressed:Me.warningActive,warningColorSuppl:Me.warningSuppl,errorColor:Me.errorDefault,errorColorHover:Me.errorHover,errorColorPressed:Me.errorActive,errorColorSuppl:Me.errorSuppl,textColorBase:Me.neutralTextBase,textColor1:"rgb(31, 34, 37)",textColor2:"rgb(51, 54, 57)",textColor3:"rgb(118, 124, 130)",textColorDisabled:$t(Me.alpha4),placeholderColor:$t(Me.alpha4),placeholderColorDisabled:$t(Me.alpha5),iconColor:$t(Me.alpha4),iconColorHover:Ea($t(Me.alpha4),{lightness:.75}),iconColorPressed:Ea($t(Me.alpha4),{lightness:.9}),iconColorDisabled:$t(Me.alpha5),opacity1:Me.alpha1,opacity2:Me.alpha2,opacity3:Me.alpha3,opacity4:Me.alpha4,opacity5:Me.alpha5,dividerColor:"rgb(239, 239, 245)",borderColor:"rgb(224, 224, 230)",closeIconColor:$t(Number(Me.alphaClose)),closeIconColorHover:$t(Number(Me.alphaClose)),closeIconColorPressed:$t(Number(Me.alphaClose)),closeColorHover:"rgba(0, 0, 0, .09)",closeColorPressed:"rgba(0, 0, 0, .13)",clearColor:$t(Me.alpha4),clearColorHover:Ea($t(Me.alpha4),{lightness:.75}),clearColorPressed:Ea($t(Me.alpha4),{lightness:.9}),scrollbarColor:X0(Me.alphaScrollbar),scrollbarColorHover:X0(Me.alphaScrollbarHover),scrollbarWidth:"5px",scrollbarHeight:"5px",scrollbarBorderRadius:"5px",progressRailColor:$t(Me.alphaProgressRail),railColor:"rgb(219, 219, 223)",popoverColor:Me.neutralPopover,tableColor:Me.neutralCard,cardColor:Me.neutralCard,modalColor:Me.neutralModal,bodyColor:Me.neutralBody,tagColor:"#eee",avatarColor:$t(Me.alphaAvatar),invertedColor:"rgb(0, 20, 40)",inputColor:$t(Me.alphaInput),codeColor:"rgb(244, 244, 248)",tabColor:"rgb(247, 247, 250)",actionColor:"rgb(250, 250, 252)",tableHeaderColor:"rgb(250, 250, 252)",hoverColor:"rgb(243, 243, 245)",tableColorHover:"rgba(0, 0, 100, 0.03)",tableColorStriped:"rgba(0, 0, 100, 0.02)",pressedColor:"rgb(237, 237, 239)",opacityDisabled:Me.alphaDisabled,inputColorDisabled:"rgb(250, 250, 252)",buttonColor2:"rgba(46, 51, 56, .05)",buttonColor2Hover:"rgba(46, 51, 56, .09)",buttonColor2Pressed:"rgba(46, 51, 56, .13)",boxShadow1:"0 1px 2px -2px rgba(0, 0, 0, .08), 0 3px 6px 0 rgba(0, 0, 0, .06), 0 5px 12px 4px rgba(0, 0, 0, .04)",boxShadow2:"0 3px 6px -4px rgba(0, 0, 0, .12), 0 6px 16px 0 rgba(0, 0, 0, .08), 0 9px 28px 8px rgba(0, 0, 0, .05)",boxShadow3:"0 6px 16px -9px rgba(0, 0, 0, .08), 0 9px 28px 0 rgba(0, 0, 0, .05), 0 12px 48px 16px rgba(0, 0, 0, .03)"}),Ij={railInsetHorizontalBottom:"auto 2px 4px 2px",railInsetHorizontalTop:"4px 2px auto 2px",railInsetVerticalRight:"2px 4px 2px auto",railInsetVerticalLeft:"2px auto 2px 4px",railColor:"transparent"};function Fj(t){const{scrollbarColor:e,scrollbarColorHover:n,scrollbarHeight:r,scrollbarWidth:o,scrollbarBorderRadius:i}=t;return Object.assign(Object.assign({},Ij),{height:r,width:o,borderRadius:i,color:e,colorHover:n})}const Rj={common:Ei,self:Fj},Bj=Qe("scrollbar",`
102
+ overflow: hidden;
103
+ position: relative;
104
+ z-index: auto;
105
+ height: 100%;
106
+ width: 100%;
107
+ `,[qe(">",[Qe("scrollbar-container",`
108
+ width: 100%;
109
+ overflow: scroll;
110
+ height: 100%;
111
+ min-height: inherit;
112
+ max-height: inherit;
113
+ scrollbar-width: none;
114
+ `,[qe("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",`
115
+ width: 0;
116
+ height: 0;
117
+ display: none;
118
+ `),qe(">",[Qe("scrollbar-content",`
119
+ box-sizing: border-box;
120
+ min-width: 100%;
121
+ `)])])]),qe(">, +",[Qe("scrollbar-rail",`
122
+ position: absolute;
123
+ pointer-events: none;
124
+ user-select: none;
125
+ background: var(--n-scrollbar-rail-color);
126
+ -webkit-user-select: none;
127
+ `,[st("horizontal",`
128
+ height: var(--n-scrollbar-height);
129
+ `,[qe(">",[Pt("scrollbar",`
130
+ height: var(--n-scrollbar-height);
131
+ border-radius: var(--n-scrollbar-border-radius);
132
+ right: 0;
133
+ `)])]),st("horizontal--top",`
134
+ top: var(--n-scrollbar-rail-top-horizontal-top);
135
+ right: var(--n-scrollbar-rail-right-horizontal-top);
136
+ bottom: var(--n-scrollbar-rail-bottom-horizontal-top);
137
+ left: var(--n-scrollbar-rail-left-horizontal-top);
138
+ `),st("horizontal--bottom",`
139
+ top: var(--n-scrollbar-rail-top-horizontal-bottom);
140
+ right: var(--n-scrollbar-rail-right-horizontal-bottom);
141
+ bottom: var(--n-scrollbar-rail-bottom-horizontal-bottom);
142
+ left: var(--n-scrollbar-rail-left-horizontal-bottom);
143
+ `),st("vertical",`
144
+ width: var(--n-scrollbar-width);
145
+ `,[qe(">",[Pt("scrollbar",`
146
+ width: var(--n-scrollbar-width);
147
+ border-radius: var(--n-scrollbar-border-radius);
148
+ bottom: 0;
149
+ `)])]),st("vertical--left",`
150
+ top: var(--n-scrollbar-rail-top-vertical-left);
151
+ right: var(--n-scrollbar-rail-right-vertical-left);
152
+ bottom: var(--n-scrollbar-rail-bottom-vertical-left);
153
+ left: var(--n-scrollbar-rail-left-vertical-left);
154
+ `),st("vertical--right",`
155
+ top: var(--n-scrollbar-rail-top-vertical-right);
156
+ right: var(--n-scrollbar-rail-right-vertical-right);
157
+ bottom: var(--n-scrollbar-rail-bottom-vertical-right);
158
+ left: var(--n-scrollbar-rail-left-vertical-right);
159
+ `),st("disabled",[qe(">",[Pt("scrollbar","pointer-events: none;")])]),qe(">",[Pt("scrollbar",`
160
+ z-index: 1;
161
+ position: absolute;
162
+ cursor: pointer;
163
+ pointer-events: all;
164
+ background-color: var(--n-scrollbar-color);
165
+ transition: background-color .2s var(--n-scrollbar-bezier);
166
+ `,[Dj(),qe("&:hover","background-color: var(--n-scrollbar-color-hover);")])])])])]),Lj=Object.assign(Object.assign({},nn.props),{duration:{type:Number,default:0},scrollable:{type:Boolean,default:!0},xScrollable:Boolean,trigger:{type:String,default:"hover"},useUnifiedContainer:Boolean,triggerDisplayManually:Boolean,container:Function,content:Function,containerClass:String,containerStyle:[String,Object],contentClass:[String,Array],contentStyle:[String,Object],horizontalRailStyle:[String,Object],verticalRailStyle:[String,Object],onScroll:Function,onWheel:Function,onResize:Function,internalOnUpdateScrollLeft:Function,internalHoistYRail:Boolean,yPlacement:{type:String,default:"right"},xPlacement:{type:String,default:"bottom"}}),Pj=w.defineComponent({name:"Scrollbar",props:Lj,inheritAttrs:!1,setup(t){const{mergedClsPrefixRef:e,inlineThemeDisabled:n,mergedRtlRef:r}=Ai(t),o=Cj("Scrollbar",r,e),i=w.ref(null),s=w.ref(null),a=w.ref(null),l=w.ref(null),c=w.ref(null),u=w.ref(null),d=w.ref(null),p=w.ref(null),f=w.ref(null),h=w.ref(null),m=w.ref(null),y=w.ref(0),g=w.ref(0),v=w.ref(!1),k=w.ref(!1);let b=!1,C=!1,D,M,I=0,E=0,G=0,oe=0;const N=ML(),H=nn("Scrollbar","-scrollbar",Bj,Rj,t,e),A=w.computed(()=>{const{value:U}=p,{value:te}=u,{value:ge}=h;return U===null||te===null||ge===null?0:Math.min(U,ge*U/te+Zw(H.value.self.width)*1.5)}),J=w.computed(()=>`${A.value}px`),ie=w.computed(()=>{const{value:U}=f,{value:te}=d,{value:ge}=m;return U===null||te===null||ge===null?0:ge*U/te+Zw(H.value.self.height)*1.5}),W=w.computed(()=>`${ie.value}px`),ce=w.computed(()=>{const{value:U}=p,{value:te}=y,{value:ge}=u,{value:xe}=h;if(U===null||ge===null||xe===null)return 0;{const ke=ge-U;return ke?te/ke*(xe-A.value):0}}),X=w.computed(()=>`${ce.value}px`),ue=w.computed(()=>{const{value:U}=f,{value:te}=g,{value:ge}=d,{value:xe}=m;if(U===null||ge===null||xe===null)return 0;{const ke=ge-U;return ke?te/ke*(xe-ie.value):0}}),Z=w.computed(()=>`${ue.value}px`),R=w.computed(()=>{const{value:U}=p,{value:te}=u;return U!==null&&te!==null&&te>U}),ee=w.computed(()=>{const{value:U}=f,{value:te}=d;return U!==null&&te!==null&&te>U}),ne=w.computed(()=>{const{trigger:U}=t;return U==="none"||v.value}),se=w.computed(()=>{const{trigger:U}=t;return U==="none"||k.value}),Y=w.computed(()=>{const{container:U}=t;return U?U():s.value}),$=w.computed(()=>{const{content:U}=t;return U?U():a.value}),T=(U,te)=>{if(!t.scrollable)return;if(typeof U=="number"){le(U,te??0,0,!1,"auto");return}const{left:ge,top:xe,index:ke,elSize:Oe,position:Ne,behavior:Je,el:it,debounce:Sn=!0}=U;(ge!==void 0||xe!==void 0)&&le(ge??0,xe??0,0,!1,Je),it!==void 0?le(0,it.offsetTop,it.offsetHeight,Sn,Je):ke!==void 0&&Oe!==void 0?le(0,ke*Oe,Oe,Sn,Je):Ne==="bottom"?le(0,Number.MAX_SAFE_INTEGER,0,!1,Je):Ne==="top"&&le(0,0,0,!1,Je)},K=RL(()=>{t.container||T({top:y.value,left:g.value})}),q=()=>{K.isDeactivated||he()},F=U=>{if(K.isDeactivated)return;const{onResize:te}=t;te&&te(U),he()},L=(U,te)=>{if(!t.scrollable)return;const{value:ge}=Y;ge&&(typeof U=="object"?ge.scrollBy(U):ge.scrollBy(U,te||0))};function le(U,te,ge,xe,ke){const{value:Oe}=Y;if(Oe){if(xe){const{scrollTop:Ne,offsetHeight:Je}=Oe;if(te>Ne){te+ge<=Ne+Je||Oe.scrollTo({left:U,top:te+ge-Je,behavior:ke});return}}Oe.scrollTo({left:U,top:te,behavior:ke})}}function S(){j(),de(),he()}function re(){Q()}function Q(){z(),V()}function z(){M!==void 0&&window.clearTimeout(M),M=window.setTimeout(()=>{k.value=!1},t.duration)}function V(){D!==void 0&&window.clearTimeout(D),D=window.setTimeout(()=>{v.value=!1},t.duration)}function j(){D!==void 0&&window.clearTimeout(D),v.value=!0}function de(){M!==void 0&&window.clearTimeout(M),k.value=!0}function fe(U){const{onScroll:te}=t;te&&te(U),ae()}function ae(){const{value:U}=Y;U&&(y.value=U.scrollTop,g.value=U.scrollLeft*(o?.value?-1:1))}function me(){const{value:U}=$;U&&(u.value=U.offsetHeight,d.value=U.offsetWidth);const{value:te}=Y;te&&(p.value=te.offsetHeight,f.value=te.offsetWidth);const{value:ge}=c,{value:xe}=l;ge&&(m.value=ge.offsetWidth),xe&&(h.value=xe.offsetHeight)}function we(){const{value:U}=Y;U&&(y.value=U.scrollTop,g.value=U.scrollLeft*(o?.value?-1:1),p.value=U.offsetHeight,f.value=U.offsetWidth,u.value=U.scrollHeight,d.value=U.scrollWidth);const{value:te}=c,{value:ge}=l;te&&(m.value=te.offsetWidth),ge&&(h.value=ge.offsetHeight)}function he(){t.scrollable&&(t.useUnifiedContainer?we():(me(),ae()))}function be(U){var te;return!(!((te=i.value)===null||te===void 0)&&te.contains(Rl(U)))}function ze(U){U.preventDefault(),U.stopPropagation(),C=!0,yt("mousemove",window,Ce,!0),yt("mouseup",window,ct,!0),E=g.value,G=o?.value?window.innerWidth-U.clientX:U.clientX}function Ce(U){if(!C)return;D!==void 0&&window.clearTimeout(D),M!==void 0&&window.clearTimeout(M);const{value:te}=f,{value:ge}=d,{value:xe}=ie;if(te===null||ge===null)return;const ke=(o?.value?window.innerWidth-U.clientX-G:U.clientX-G)*(ge-te)/(te-xe),Oe=ge-te;let Ne=E+ke;Ne=Math.min(Oe,Ne),Ne=Math.max(Ne,0);const{value:Je}=Y;if(Je){Je.scrollLeft=Ne*(o?.value?-1:1);const{internalOnUpdateScrollLeft:it}=t;it&&it(Ne)}}function ct(U){U.preventDefault(),U.stopPropagation(),ot("mousemove",window,Ce,!0),ot("mouseup",window,ct,!0),C=!1,he(),be(U)&&Q()}function x(U){U.preventDefault(),U.stopPropagation(),b=!0,yt("mousemove",window,O,!0),yt("mouseup",window,_,!0),I=y.value,oe=U.clientY}function O(U){if(!b)return;D!==void 0&&window.clearTimeout(D),M!==void 0&&window.clearTimeout(M);const{value:te}=p,{value:ge}=u,{value:xe}=A;if(te===null||ge===null)return;const ke=(U.clientY-oe)*(ge-te)/(te-xe),Oe=ge-te;let Ne=I+ke;Ne=Math.min(Oe,Ne),Ne=Math.max(Ne,0);const{value:Je}=Y;Je&&(Je.scrollTop=Ne)}function _(U){U.preventDefault(),U.stopPropagation(),ot("mousemove",window,O,!0),ot("mouseup",window,_,!0),b=!1,he(),be(U)&&Q()}w.watchEffect(()=>{const{value:U}=ee,{value:te}=R,{value:ge}=e,{value:xe}=c,{value:ke}=l;xe&&(U?xe.classList.remove(`${ge}-scrollbar-rail--disabled`):xe.classList.add(`${ge}-scrollbar-rail--disabled`)),ke&&(te?ke.classList.remove(`${ge}-scrollbar-rail--disabled`):ke.classList.add(`${ge}-scrollbar-rail--disabled`))}),w.onMounted(()=>{t.container||he()}),w.onBeforeUnmount(()=>{D!==void 0&&window.clearTimeout(D),M!==void 0&&window.clearTimeout(M),ot("mousemove",window,O,!0),ot("mouseup",window,_,!0)});const P=w.computed(()=>{const{common:{cubicBezierEaseInOut:U},self:{color:te,colorHover:ge,height:xe,width:ke,borderRadius:Oe,railInsetHorizontalTop:Ne,railInsetHorizontalBottom:Je,railInsetVerticalRight:it,railInsetVerticalLeft:Sn,railColor:pr}}=H.value,{top:kc,right:Ti,bottom:Eo,left:fS}=Ji(Ne),{top:hS,right:mS,bottom:gS,left:yS}=Ji(Je),{top:wS,right:bS,bottom:vS,left:xS}=Ji(o?.value?x0(it):it),{top:kS,right:SS,bottom:AS,left:CS}=Ji(o?.value?x0(Sn):Sn);return{"--n-scrollbar-bezier":U,"--n-scrollbar-color":te,"--n-scrollbar-color-hover":ge,"--n-scrollbar-border-radius":Oe,"--n-scrollbar-width":ke,"--n-scrollbar-height":xe,"--n-scrollbar-rail-top-horizontal-top":kc,"--n-scrollbar-rail-right-horizontal-top":Ti,"--n-scrollbar-rail-bottom-horizontal-top":Eo,"--n-scrollbar-rail-left-horizontal-top":fS,"--n-scrollbar-rail-top-horizontal-bottom":hS,"--n-scrollbar-rail-right-horizontal-bottom":mS,"--n-scrollbar-rail-bottom-horizontal-bottom":gS,"--n-scrollbar-rail-left-horizontal-bottom":yS,"--n-scrollbar-rail-top-vertical-right":wS,"--n-scrollbar-rail-right-vertical-right":bS,"--n-scrollbar-rail-bottom-vertical-right":vS,"--n-scrollbar-rail-left-vertical-right":xS,"--n-scrollbar-rail-top-vertical-left":kS,"--n-scrollbar-rail-right-vertical-left":SS,"--n-scrollbar-rail-bottom-vertical-left":AS,"--n-scrollbar-rail-left-vertical-left":CS,"--n-scrollbar-rail-color":pr}}),B=n?mc("scrollbar",void 0,P,t):void 0;return Object.assign(Object.assign({},{scrollTo:T,scrollBy:L,sync:he,syncUnifiedContainer:we,handleMouseEnterWrapper:S,handleMouseLeaveWrapper:re}),{mergedClsPrefix:e,rtlEnabled:o,containerScrollTop:y,wrapperRef:i,containerRef:s,contentRef:a,yRailRef:l,xRailRef:c,needYBar:R,needXBar:ee,yBarSizePx:J,xBarSizePx:W,yBarTopPx:X,xBarLeftPx:Z,isShowXBar:ne,isShowYBar:se,isIos:N,handleScroll:fe,handleContentResize:q,handleContainerResize:F,handleYScrollMouseDown:x,handleXScrollMouseDown:ze,cssVars:n?void 0:P,themeClass:B?.themeClass,onRender:B?.onRender})},render(){var t;const{$slots:e,mergedClsPrefix:n,triggerDisplayManually:r,rtlEnabled:o,internalHoistYRail:i,yPlacement:s,xPlacement:a,xScrollable:l}=this;if(!this.scrollable)return(t=e.default)===null||t===void 0?void 0:t.call(e);const c=this.trigger==="none",u=(f,h)=>w.h("div",{ref:"yRailRef",class:[`${n}-scrollbar-rail`,`${n}-scrollbar-rail--vertical`,`${n}-scrollbar-rail--vertical--${s}`,f],"data-scrollbar-rail":!0,style:[h||"",this.verticalRailStyle],"aria-hidden":!0},w.h(c?A0:w.Transition,c?null:{name:"fade-in-transition"},{default:()=>this.needYBar&&this.isShowYBar&&!this.isIos?w.h("div",{class:`${n}-scrollbar-rail__scrollbar`,style:{height:this.yBarSizePx,top:this.yBarTopPx},onMousedown:this.handleYScrollMouseDown}):null})),d=()=>{var f,h;return(f=this.onRender)===null||f===void 0||f.call(this),w.h("div",w.mergeProps(this.$attrs,{role:"none",ref:"wrapperRef",class:[`${n}-scrollbar`,this.themeClass,o&&`${n}-scrollbar--rtl`],style:this.cssVars,onMouseenter:r?void 0:this.handleMouseEnterWrapper,onMouseleave:r?void 0:this.handleMouseLeaveWrapper}),[this.container?(h=e.default)===null||h===void 0?void 0:h.call(e):w.h("div",{role:"none",ref:"containerRef",class:[`${n}-scrollbar-container`,this.containerClass],style:this.containerStyle,onScroll:this.handleScroll,onWheel:this.onWheel},w.h(b0,{onResize:this.handleContentResize},{default:()=>w.h("div",{ref:"contentRef",role:"none",style:[{width:this.xScrollable?"fit-content":null},this.contentStyle],class:[`${n}-scrollbar-content`,this.contentClass]},e)})),i?null:u(void 0,void 0),l&&w.h("div",{ref:"xRailRef",class:[`${n}-scrollbar-rail`,`${n}-scrollbar-rail--horizontal`,`${n}-scrollbar-rail--horizontal--${a}`],style:this.horizontalRailStyle,"data-scrollbar-rail":!0,"aria-hidden":!0},w.h(c?A0:w.Transition,c?null:{name:"fade-in-transition"},{default:()=>this.needXBar&&this.isShowXBar&&!this.isIos?w.h("div",{class:`${n}-scrollbar-rail__scrollbar`,style:{width:this.xBarSizePx,right:o?this.xBarLeftPx:void 0,left:o?void 0:this.xBarLeftPx},onMousedown:this.handleXScrollMouseDown}):null}))])},p=this.container?d():w.h(b0,{onResize:this.handleContainerResize},{default:d});return i?w.h(w.Fragment,null,p,u(this.themeClass,this.cssVars)):p}}),V3=Pj;function Y0(t){return Array.isArray(t)?t:[t]}const jp={STOP:"STOP"};function U3(t,e){const n=e(t);t.children!==void 0&&n!==jp.STOP&&t.children.forEach(r=>U3(r,e))}function zj(t,e={}){const{preserveGroup:n=!1}=e,r=[],o=n?s=>{s.isLeaf||(r.push(s.key),i(s.children))}:s=>{s.isLeaf||(s.isGroup||r.push(s.key),i(s.children))};function i(s){s.forEach(o)}return i(t),r}function jj(t,e){const{isLeaf:n}=t;return n!==void 0?n:!e(t)}function qj(t){return t.children}function Vj(t){return t.key}function Uj(){return!1}function Hj(t,e){const{isLeaf:n}=t;return!(n===!1&&!Array.isArray(e(t)))}function Wj(t){return t.disabled===!0}function Gj(t,e){return t.isLeaf===!1&&!Array.isArray(e(t))}function Kj(t,e){if(t.isLeaf===!0){const n=e(t);if(Array.isArray(n)&&n.length>0)return!0}return!1}function fd(t){var e;return t==null?[]:Array.isArray(t)?t:(e=t.checkedKeys)!==null&&e!==void 0?e:[]}function hd(t){var e;return t==null||Array.isArray(t)?[]:(e=t.indeterminateKeys)!==null&&e!==void 0?e:[]}function Jj(t,e){const n=new Set(t);return e.forEach(r=>{n.has(r)||n.add(r)}),Array.from(n)}function Xj(t,e){const n=new Set(t);return e.forEach(r=>{n.has(r)&&n.delete(r)}),Array.from(n)}function Yj(t){return t?.type==="group"}class Zj extends Error{constructor(){super(),this.message="SubtreeNotLoadedError: checking a subtree whose required nodes are not fully loaded."}}function Qj(t,e,n,r){return Hl(e.concat(t),n,r,!1)}function eq(t,e){const n=new Set;return t.forEach(r=>{const o=e.treeNodeMap.get(r);if(o!==void 0){let i=o.parent;for(;i!==null&&!(i.disabled||n.has(i.key));)n.add(i.key),i=i.parent}}),n}function tq(t,e,n,r){const o=Hl(e,n,r,!1),i=Hl(t,n,r,!0),s=eq(t,n),a=[];return o.forEach(l=>{(i.has(l)||s.has(l))&&a.push(l)}),a.forEach(l=>o.delete(l)),o}function md(t,e){const{checkedKeys:n,keysToCheck:r,keysToUncheck:o,indeterminateKeys:i,cascade:s,leafOnly:a,checkStrategy:l,allowNotLoaded:c}=t;if(!s)return r!==void 0?{checkedKeys:Jj(n,r),indeterminateKeys:Array.from(i)}:o!==void 0?{checkedKeys:Xj(n,o),indeterminateKeys:Array.from(i)}:{checkedKeys:Array.from(n),indeterminateKeys:Array.from(i)};const{levelTreeNodeMap:u}=e;let d;o!==void 0?d=tq(o,n,e,c):r!==void 0?d=Qj(r,n,e,c):d=Hl(n,e,c,!1);const p=l==="parent",f=l==="child"||a,h=d,m=new Set,y=Math.max.apply(null,Array.from(u.keys()));for(let g=y;g>=0;g-=1){const v=g===0,k=u.get(g);for(const b of k){if(b.isLeaf)continue;const{key:C,shallowLoaded:D}=b;if(f&&D&&b.children.forEach(G=>{!G.disabled&&!G.isLeaf&&G.shallowLoaded&&h.has(G.key)&&h.delete(G.key)}),b.disabled||!D)continue;let M=!0,I=!1,E=!0;for(const G of b.children){const oe=G.key;if(!G.disabled){if(E&&(E=!1),h.has(oe))I=!0;else if(m.has(oe)){I=!0,M=!1;break}else if(M=!1,I)break}}M&&!E?(p&&b.children.forEach(G=>{!G.disabled&&h.has(G.key)&&h.delete(G.key)}),h.add(C)):I&&m.add(C),v&&f&&h.has(C)&&h.delete(C)}}return{checkedKeys:Array.from(h),indeterminateKeys:Array.from(m)}}function Hl(t,e,n,r){const{treeNodeMap:o,getChildren:i}=e,s=new Set,a=new Set(t);return t.forEach(l=>{const c=o.get(l);c!==void 0&&U3(c,u=>{if(u.disabled)return jp.STOP;const{key:d}=u;if(!s.has(d)&&(s.add(d),a.add(d),Gj(u.rawNode,i))){if(r)return jp.STOP;if(!n)throw new Zj}})}),a}function nq(t,{includeGroup:e=!1,includeSelf:n=!0},r){var o;const i=r.treeNodeMap;let s=t==null?null:(o=i.get(t))!==null&&o!==void 0?o:null;const a={keyPath:[],treeNodePath:[],treeNode:s};if(s?.ignored)return a.treeNode=null,a;for(;s;)!s.ignored&&(e||!s.isGroup)&&a.treeNodePath.push(s),s=s.parent;return a.treeNodePath.reverse(),n||a.treeNodePath.pop(),a.keyPath=a.treeNodePath.map(l=>l.key),a}function rq(t){if(t.length===0)return null;const e=t[0];return e.isGroup||e.ignored||e.disabled?e.getNext():e}function oq(t,e){const n=t.siblings,r=n.length,{index:o}=t;return e?n[(o+1)%r]:o===n.length-1?null:n[o+1]}function Z0(t,e,{loop:n=!1,includeDisabled:r=!1}={}){const o=e==="prev"?iq:oq,i={reverse:e==="prev"};let s=!1,a=null;function l(c){if(c!==null){if(c===t){if(!s)s=!0;else if(!t.disabled&&!t.isGroup){a=t;return}}else if((!c.disabled||r)&&!c.ignored&&!c.isGroup){a=c;return}if(c.isGroup){const u=uh(c,i);u!==null?a=u:l(o(c,n))}else{const u=o(c,!1);if(u!==null)l(u);else{const d=sq(c);d?.isGroup?l(o(d,n)):n&&l(o(c,!0))}}}}return l(t),a}function iq(t,e){const n=t.siblings,r=n.length,{index:o}=t;return e?n[(o-1+r)%r]:o===0?null:n[o-1]}function sq(t){return t.parent}function uh(t,e={}){const{reverse:n=!1}=e,{children:r}=t;if(r){const{length:o}=r,i=n?o-1:0,s=n?-1:o,a=n?-1:1;for(let l=i;l!==s;l+=a){const c=r[l];if(!c.disabled&&!c.ignored)if(c.isGroup){const u=uh(c,e);if(u!==null)return u}else return c}}return null}const aq={getChild(){return this.ignored?null:uh(this)},getParent(){const{parent:t}=this;return t?.isGroup?t.getParent():t},getNext(t={}){return Z0(this,"next",t)},getPrev(t={}){return Z0(this,"prev",t)}};function lq(t,e){const n=e?new Set(e):void 0,r=[];function o(i){i.forEach(s=>{r.push(s),!(s.isLeaf||!s.children||s.ignored)&&(s.isGroup||n===void 0||n.has(s.key))&&o(s.children)})}return o(t),r}function cq(t,e){const n=t.key;for(;e;){if(e.key===n)return!0;e=e.parent}return!1}function H3(t,e,n,r,o,i=null,s=0){const a=[];return t.forEach((l,c)=>{var u;Se.env.NODE_ENV!=="production"&&Kj(l,o)&&console.error("[treemate]: node",l,"is invalid");const d=Object.create(r);if(d.rawNode=l,d.siblings=a,d.level=s,d.index=c,d.isFirstChild=c===0,d.isLastChild=c+1===t.length,d.parent=i,!d.ignored){const p=o(l);Array.isArray(p)&&(d.children=H3(p,e,n,r,o,d,s+1))}a.push(d),e.set(d.key,d),n.has(s)||n.set(s,[]),(u=n.get(s))===null||u===void 0||u.push(d)}),a}function uq(t,e={}){var n;const r=new Map,o=new Map,{getDisabled:i=Wj,getIgnored:s=Uj,getIsGroup:a=Yj,getKey:l=Vj}=e,c=(n=e.getChildren)!==null&&n!==void 0?n:qj,u=e.ignoreEmptyChildren?b=>{const C=c(b);return Array.isArray(C)?C.length?C:null:C}:c,d=Object.assign({get key(){return l(this.rawNode)},get disabled(){return i(this.rawNode)},get isGroup(){return a(this.rawNode)},get isLeaf(){return jj(this.rawNode,u)},get shallowLoaded(){return Hj(this.rawNode,u)},get ignored(){return s(this.rawNode)},contains(b){return cq(this,b)}},aq),p=H3(t,r,o,d,u);function f(b){if(b==null)return null;const C=r.get(b);return C&&!C.isGroup&&!C.ignored?C:null}function h(b){if(b==null)return null;const C=r.get(b);return C&&!C.ignored?C:null}function m(b,C){const D=h(b);return D?D.getPrev(C):null}function y(b,C){const D=h(b);return D?D.getNext(C):null}function g(b){const C=h(b);return C?C.getParent():null}function v(b){const C=h(b);return C?C.getChild():null}const k={treeNodes:p,treeNodeMap:r,levelTreeNodeMap:o,maxLevel:Math.max(...o.keys()),getChildren:u,getFlattenedNodes(b){return lq(p,b)},getNode:f,getPrev:m,getNext:y,getParent:g,getChild:v,getFirstAvailableNode(){return rq(p)},getPath(b,C={}){return nq(b,C,k)},getCheckedKeys(b,C={}){const{cascade:D=!0,leafOnly:M=!1,checkStrategy:I="all",allowNotLoaded:E=!1}=C;return md({checkedKeys:fd(b),indeterminateKeys:hd(b),cascade:D,leafOnly:M,checkStrategy:I,allowNotLoaded:E},k)},check(b,C,D={}){const{cascade:M=!0,leafOnly:I=!1,checkStrategy:E="all",allowNotLoaded:G=!1}=D;return md({checkedKeys:fd(C),indeterminateKeys:hd(C),keysToCheck:b==null?[]:Y0(b),cascade:M,leafOnly:I,checkStrategy:E,allowNotLoaded:G},k)},uncheck(b,C,D={}){const{cascade:M=!0,leafOnly:I=!1,checkStrategy:E="all",allowNotLoaded:G=!1}=D;return md({checkedKeys:fd(C),indeterminateKeys:hd(C),keysToUncheck:b==null?[]:Y0(b),cascade:M,leafOnly:I,checkStrategy:E,allowNotLoaded:G},k)},getNonLeafKeys(b={}){return zj(p,b)}};return k}const{cubicBezierEaseIn:Q0,cubicBezierEaseOut:eb}=bc;function dq({transformOrigin:t="inherit",duration:e=".2s",enterScale:n=".9",originalTransform:r="",originalTransition:o=""}={}){return[qe("&.fade-in-scale-up-transition-leave-active",{transformOrigin:t,transition:`opacity ${e} ${Q0}, transform ${e} ${Q0} ${o&&`,${o}`}`}),qe("&.fade-in-scale-up-transition-enter-active",{transformOrigin:t,transition:`opacity ${e} ${eb}, transform ${e} ${eb} ${o&&`,${o}`}`}),qe("&.fade-in-scale-up-transition-enter-from, &.fade-in-scale-up-transition-leave-to",{opacity:0,transform:`${r} scale(${n})`}),qe("&.fade-in-scale-up-transition-leave-from, &.fade-in-scale-up-transition-enter-to",{opacity:1,transform:`${r} scale(1)`})]}const pq={space:"6px",spaceArrow:"10px",arrowOffset:"10px",arrowOffsetVertical:"10px",arrowHeight:"6px",padding:"8px 14px"};function fq(t){const{boxShadow2:e,popoverColor:n,textColor2:r,borderRadius:o,fontSize:i,dividerColor:s}=t;return Object.assign(Object.assign({},pq),{fontSize:i,borderRadius:o,color:n,dividerColor:s,textColor:r,boxShadow:e})}const dh={name:"Popover",common:Ei,self:fq},gd={top:"bottom",bottom:"top",left:"right",right:"left"},ht="var(--n-arrow-height) * 1.414",hq=qe([Qe("popover",`
167
+ transition:
168
+ box-shadow .3s var(--n-bezier),
169
+ background-color .3s var(--n-bezier),
170
+ color .3s var(--n-bezier);
171
+ position: relative;
172
+ font-size: var(--n-font-size);
173
+ color: var(--n-text-color);
174
+ box-shadow: var(--n-box-shadow);
175
+ word-break: break-word;
176
+ `,[qe(">",[Qe("scrollbar",`
177
+ height: inherit;
178
+ max-height: inherit;
179
+ `)]),ds("raw",`
180
+ background-color: var(--n-color);
181
+ border-radius: var(--n-border-radius);
182
+ `,[ds("scrollable",[ds("show-header-or-footer","padding: var(--n-padding);")])]),Pt("header",`
183
+ padding: var(--n-padding);
184
+ border-bottom: 1px solid var(--n-divider-color);
185
+ transition: border-color .3s var(--n-bezier);
186
+ `),Pt("footer",`
187
+ padding: var(--n-padding);
188
+ border-top: 1px solid var(--n-divider-color);
189
+ transition: border-color .3s var(--n-bezier);
190
+ `),st("scrollable, show-header-or-footer",[Pt("content",`
191
+ padding: var(--n-padding);
192
+ `)])]),Qe("popover-shared",`
193
+ transform-origin: inherit;
194
+ `,[Qe("popover-arrow-wrapper",`
195
+ position: absolute;
196
+ overflow: hidden;
197
+ pointer-events: none;
198
+ `,[Qe("popover-arrow",`
199
+ transition: background-color .3s var(--n-bezier);
200
+ position: absolute;
201
+ display: block;
202
+ width: calc(${ht});
203
+ height: calc(${ht});
204
+ box-shadow: 0 0 8px 0 rgba(0, 0, 0, .12);
205
+ transform: rotate(45deg);
206
+ background-color: var(--n-color);
207
+ pointer-events: all;
208
+ `)]),qe("&.popover-transition-enter-from, &.popover-transition-leave-to",`
209
+ opacity: 0;
210
+ transform: scale(.85);
211
+ `),qe("&.popover-transition-enter-to, &.popover-transition-leave-from",`
212
+ transform: scale(1);
213
+ opacity: 1;
214
+ `),qe("&.popover-transition-enter-active",`
215
+ transition:
216
+ box-shadow .3s var(--n-bezier),
217
+ background-color .3s var(--n-bezier),
218
+ color .3s var(--n-bezier),
219
+ opacity .15s var(--n-bezier-ease-out),
220
+ transform .15s var(--n-bezier-ease-out);
221
+ `),qe("&.popover-transition-leave-active",`
222
+ transition:
223
+ box-shadow .3s var(--n-bezier),
224
+ background-color .3s var(--n-bezier),
225
+ color .3s var(--n-bezier),
226
+ opacity .15s var(--n-bezier-ease-in),
227
+ transform .15s var(--n-bezier-ease-in);
228
+ `)]),dn("top-start",`
229
+ top: calc(${ht} / -2);
230
+ left: calc(${Hn("top-start")} - var(--v-offset-left));
231
+ `),dn("top",`
232
+ top: calc(${ht} / -2);
233
+ transform: translateX(calc(${ht} / -2)) rotate(45deg);
234
+ left: 50%;
235
+ `),dn("top-end",`
236
+ top: calc(${ht} / -2);
237
+ right: calc(${Hn("top-end")} + var(--v-offset-left));
238
+ `),dn("bottom-start",`
239
+ bottom: calc(${ht} / -2);
240
+ left: calc(${Hn("bottom-start")} - var(--v-offset-left));
241
+ `),dn("bottom",`
242
+ bottom: calc(${ht} / -2);
243
+ transform: translateX(calc(${ht} / -2)) rotate(45deg);
244
+ left: 50%;
245
+ `),dn("bottom-end",`
246
+ bottom: calc(${ht} / -2);
247
+ right: calc(${Hn("bottom-end")} + var(--v-offset-left));
248
+ `),dn("left-start",`
249
+ left: calc(${ht} / -2);
250
+ top: calc(${Hn("left-start")} - var(--v-offset-top));
251
+ `),dn("left",`
252
+ left: calc(${ht} / -2);
253
+ transform: translateY(calc(${ht} / -2)) rotate(45deg);
254
+ top: 50%;
255
+ `),dn("left-end",`
256
+ left: calc(${ht} / -2);
257
+ bottom: calc(${Hn("left-end")} + var(--v-offset-top));
258
+ `),dn("right-start",`
259
+ right: calc(${ht} / -2);
260
+ top: calc(${Hn("right-start")} - var(--v-offset-top));
261
+ `),dn("right",`
262
+ right: calc(${ht} / -2);
263
+ transform: translateY(calc(${ht} / -2)) rotate(45deg);
264
+ top: 50%;
265
+ `),dn("right-end",`
266
+ right: calc(${ht} / -2);
267
+ bottom: calc(${Hn("right-end")} + var(--v-offset-top));
268
+ `),...Aj({top:["right-start","left-start"],right:["top-end","bottom-end"],bottom:["right-end","left-end"],left:["top-start","bottom-start"]},(t,e)=>{const n=["right","left"].includes(e),r=n?"width":"height";return t.map(o=>{const i=o.split("-")[1]==="end",s=`calc((${`var(--v-target-${r}, 0px)`} - ${ht}) / 2)`,a=Hn(o);return qe(`[v-placement="${o}"] >`,[Qe("popover-shared",[st("center-arrow",[Qe("popover-arrow",`${e}: calc(max(${s}, ${a}) ${i?"+":"-"} var(--v-offset-${n?"left":"top"}));`)])])])})})]);function Hn(t){return["top","bottom"].includes(t.split("-")[0])?"var(--n-arrow-offset)":"var(--n-arrow-offset-vertical)"}function dn(t,e){const n=t.split("-")[0],r=["top","bottom"].includes(n)?"height: var(--n-space-arrow);":"width: var(--n-space-arrow);";return qe(`[v-placement="${t}"] >`,[Qe("popover-shared",`
269
+ margin-${gd[n]}: var(--n-space);
270
+ `,[st("show-arrow",`
271
+ margin-${gd[n]}: var(--n-space-arrow);
272
+ `),st("overlap",`
273
+ margin: 0;
274
+ `),eL("popover-arrow-wrapper",`
275
+ right: 0;
276
+ left: 0;
277
+ top: 0;
278
+ bottom: 0;
279
+ ${n}: 100%;
280
+ ${gd[n]}: auto;
281
+ ${r}
282
+ `,[Qe("popover-arrow",e)])])])}const W3=Object.assign(Object.assign({},nn.props),{to:wi.propTo,show:Boolean,trigger:String,showArrow:Boolean,delay:Number,duration:Number,raw:Boolean,arrowPointToCenter:Boolean,arrowClass:String,arrowStyle:[String,Object],arrowWrapperClass:String,arrowWrapperStyle:[String,Object],displayDirective:String,x:Number,y:Number,flip:Boolean,overlap:Boolean,placement:String,width:[Number,String],keepAliveOnHover:Boolean,scrollable:Boolean,contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],footerClass:String,footerStyle:[Object,String],internalDeactivateImmediately:Boolean,animated:Boolean,onClickoutside:Function,internalTrapFocus:Boolean,internalOnAfterLeave:Function,minWidth:Number,maxWidth:Number});function G3({arrowClass:t,arrowStyle:e,arrowWrapperClass:n,arrowWrapperStyle:r,clsPrefix:o}){return w.h("div",{key:"__popover-arrow__",style:r,class:[`${o}-popover-arrow-wrapper`,n]},w.h("div",{class:[`${o}-popover-arrow`,t],style:e}))}const mq=w.defineComponent({name:"PopoverBody",inheritAttrs:!1,props:W3,setup(t,{slots:e,attrs:n}){const{namespaceRef:r,mergedClsPrefixRef:o,inlineThemeDisabled:i}=Ai(t),s=nn("Popover","-popover",hq,dh,t,o),a=w.ref(null),l=w.inject("NPopover"),c=w.ref(null),u=w.ref(t.show),d=w.ref(!1);w.watchEffect(()=>{const{show:M}=t;M&&!EP()&&!t.internalDeactivateImmediately&&(d.value=!0)});const p=w.computed(()=>{const{trigger:M,onClickoutside:I}=t,E=[],{positionManuallyRef:{value:G}}=l;return G||(M==="click"&&!I&&E.push([r0,b,void 0,{capture:!0}]),M==="hover"&&E.push([PL,k])),I&&E.push([r0,b,void 0,{capture:!0}]),(t.displayDirective==="show"||t.animated&&d.value)&&E.push([w.vShow,t.show]),E}),f=w.computed(()=>{const{common:{cubicBezierEaseInOut:M,cubicBezierEaseIn:I,cubicBezierEaseOut:E},self:{space:G,spaceArrow:oe,padding:N,fontSize:H,textColor:A,dividerColor:J,color:ie,boxShadow:W,borderRadius:ce,arrowHeight:X,arrowOffset:ue,arrowOffsetVertical:Z}}=s.value;return{"--n-box-shadow":W,"--n-bezier":M,"--n-bezier-ease-in":I,"--n-bezier-ease-out":E,"--n-font-size":H,"--n-text-color":A,"--n-color":ie,"--n-divider-color":J,"--n-border-radius":ce,"--n-arrow-height":X,"--n-arrow-offset":ue,"--n-arrow-offset-vertical":Z,"--n-padding":N,"--n-space":G,"--n-space-arrow":oe}}),h=w.computed(()=>{const M=t.width==="trigger"?void 0:rl(t.width),I=[];M&&I.push({width:M});const{maxWidth:E,minWidth:G}=t;return E&&I.push({maxWidth:rl(E)}),G&&I.push({maxWidth:rl(G)}),i||I.push(f.value),I}),m=i?mc("popover",void 0,f,t):void 0;l.setBodyInstance({syncPosition:y}),w.onBeforeUnmount(()=>{l.setBodyInstance(null)}),w.watch(w.toRef(t,"show"),M=>{t.animated||(M?u.value=!0:u.value=!1)});function y(){var M;(M=a.value)===null||M===void 0||M.syncPosition()}function g(M){t.trigger==="hover"&&t.keepAliveOnHover&&t.show&&l.handleMouseEnter(M)}function v(M){t.trigger==="hover"&&t.keepAliveOnHover&&l.handleMouseLeave(M)}function k(M){t.trigger==="hover"&&!C().contains(Rl(M))&&l.handleMouseMoveOutside(M)}function b(M){(t.trigger==="click"&&!C().contains(Rl(M))||t.onClickoutside)&&l.handleClickOutside(M)}function C(){return l.getTriggerElement()}w.provide(pc,c),w.provide(Kf,null),w.provide(Jf,null);function D(){if(m?.onRender(),!(t.displayDirective==="show"||t.show||t.animated&&d.value))return null;let M;const I=l.internalRenderBodyRef.value,{value:E}=o;if(I)M=I([`${E}-popover-shared`,m?.themeClass.value,t.overlap&&`${E}-popover-shared--overlap`,t.showArrow&&`${E}-popover-shared--show-arrow`,t.arrowPointToCenter&&`${E}-popover-shared--center-arrow`],c,h.value,g,v);else{const{value:G}=l.extraClassRef,{internalTrapFocus:oe}=t,N=!S0(e.header)||!S0(e.footer),H=()=>{var A,J;const ie=N?w.h(w.Fragment,null,cd(e.header,X=>X?w.h("div",{class:[`${E}-popover__header`,t.headerClass],style:t.headerStyle},X):null),cd(e.default,X=>X?w.h("div",{class:[`${E}-popover__content`,t.contentClass],style:t.contentStyle},e):null),cd(e.footer,X=>X?w.h("div",{class:[`${E}-popover__footer`,t.footerClass],style:t.footerStyle},X):null)):t.scrollable?(A=e.default)===null||A===void 0?void 0:A.call(e):w.h("div",{class:[`${E}-popover__content`,t.contentClass],style:t.contentStyle},e),W=t.scrollable?w.h(V3,{contentClass:N?void 0:`${E}-popover__content ${(J=t.contentClass)!==null&&J!==void 0?J:""}`,contentStyle:N?void 0:t.contentStyle},{default:()=>ie}):ie,ce=t.showArrow?G3({arrowClass:t.arrowClass,arrowStyle:t.arrowStyle,arrowWrapperClass:t.arrowWrapperClass,arrowWrapperStyle:t.arrowWrapperStyle,clsPrefix:E}):null;return[W,ce]};M=w.h("div",w.mergeProps({class:[`${E}-popover`,`${E}-popover-shared`,m?.themeClass.value,G.map(A=>`${E}-${A}`),{[`${E}-popover--scrollable`]:t.scrollable,[`${E}-popover--show-header-or-footer`]:N,[`${E}-popover--raw`]:t.raw,[`${E}-popover-shared--overlap`]:t.overlap,[`${E}-popover-shared--show-arrow`]:t.showArrow,[`${E}-popover-shared--center-arrow`]:t.arrowPointToCenter}],ref:c,style:h.value,onKeydown:l.handleKeydown,onMouseenter:g,onMouseleave:v},n),oe?w.h(AP,{active:t.show,autoFocus:!0},{default:H}):H())}return w.withDirectives(M,p.value)}return{displayed:d,namespace:r,isMounted:l.isMountedRef,zIndex:l.zIndexRef,followerRef:a,adjustedTo:wi(t),followerEnabled:u,renderContentNode:D}},render(){return w.h(u3,{ref:"followerRef",zIndex:this.zIndex,show:this.show,enabled:this.followerEnabled,to:this.adjustedTo,x:this.x,y:this.y,flip:this.flip,placement:this.placement,containerClass:this.namespace,overlap:this.overlap,width:this.width==="trigger"?"target":void 0,teleportDisabled:this.adjustedTo===wi.tdkey},{default:()=>this.animated?w.h(w.Transition,{name:"popover-transition",appear:this.isMounted,onEnter:()=>{this.followerEnabled=!0},onAfterLeave:()=>{var t;(t=this.internalOnAfterLeave)===null||t===void 0||t.call(this),this.followerEnabled=!1,this.displayed=!1}},{default:this.renderContentNode}):this.renderContentNode()})}}),gq=Object.keys(W3),yq={focus:["onFocus","onBlur"],click:["onClick"],hover:["onMouseenter","onMouseleave"],manual:[],nested:["onFocus","onBlur","onMouseenter","onMouseleave","onClick"]};function wq(t,e,n){yq[e].forEach(r=>{t.props?t.props=Object.assign({},t.props):t.props={};const o=t.props[r],i=n[r];o?t.props[r]=(...s)=>{o(...s),i(...s)}:t.props[r]=i})}const vc={show:{type:Boolean,default:void 0},defaultShow:Boolean,showArrow:{type:Boolean,default:!0},trigger:{type:String,default:"hover"},delay:{type:Number,default:100},duration:{type:Number,default:100},raw:Boolean,placement:{type:String,default:"top"},x:Number,y:Number,arrowPointToCenter:Boolean,disabled:Boolean,getDisabled:Function,displayDirective:{type:String,default:"if"},arrowClass:String,arrowStyle:[String,Object],arrowWrapperClass:String,arrowWrapperStyle:[String,Object],flip:{type:Boolean,default:!0},animated:{type:Boolean,default:!0},width:{type:[Number,String],default:void 0},overlap:Boolean,keepAliveOnHover:{type:Boolean,default:!0},zIndex:Number,to:wi.propTo,scrollable:Boolean,contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],footerClass:String,footerStyle:[Object,String],onClickoutside:Function,"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],internalDeactivateImmediately:Boolean,internalSyncTargetWithParent:Boolean,internalInheritedEventHandlers:{type:Array,default:()=>[]},internalTrapFocus:Boolean,internalExtraClass:{type:Array,default:()=>[]},onShow:[Function,Array],onHide:[Function,Array],arrow:{type:Boolean,default:void 0},minWidth:Number,maxWidth:Number},bq=Object.assign(Object.assign(Object.assign({},nn.props),vc),{internalOnAfterLeave:Function,internalRenderBody:Function}),K3=w.defineComponent({name:"Popover",inheritAttrs:!1,props:bq,slots:Object,__popover__:!0,setup(t){Se.env.NODE_ENV!=="production"&&w.watchEffect(()=>{t.maxWidth!==void 0&&_i("popover","`max-width` is deprecated, please use `style` instead."),t.minWidth!==void 0&&_i("popover","`min-width` is deprecated, please use `style` instead."),t.arrow!==void 0&&_i("popover","`arrow` is deprecated, please use `showArrow` instead."),t.onHide!==void 0&&_i("popover","`on-hide` is deprecated, please use `on-update:show` instead."),t.onShow!==void 0&&_i("popover","`on-show` is deprecated, please use `on-update:show` instead.")});const e=r3(),n=w.ref(null),r=w.computed(()=>t.show),o=w.ref(t.defaultShow),i=n3(r,o),s=ir(()=>t.disabled?!1:i.value),a=()=>{if(t.disabled)return!0;const{getDisabled:A}=t;return!!A?.()},l=()=>a()?!1:i.value,c=$L(t,["arrow","showArrow"]),u=w.computed(()=>t.overlap?!1:c.value);let d=null;const p=w.ref(null),f=w.ref(null),h=ir(()=>t.x!==void 0&&t.y!==void 0);function m(A){const{"onUpdate:show":J,onUpdateShow:ie,onShow:W,onHide:ce}=t;o.value=A,J&&Tr(J,A),ie&&Tr(ie,A),A&&W&&Tr(W,!0),A&&ce&&Tr(ce,!1)}function y(){d&&d.syncPosition()}function g(){const{value:A}=p;A&&(window.clearTimeout(A),p.value=null)}function v(){const{value:A}=f;A&&(window.clearTimeout(A),f.value=null)}function k(){const A=a();if(t.trigger==="focus"&&!A){if(l())return;m(!0)}}function b(){const A=a();if(t.trigger==="focus"&&!A){if(!l())return;m(!1)}}function C(){const A=a();if(t.trigger==="hover"&&!A){if(v(),p.value!==null||l())return;const J=()=>{m(!0),p.value=null},{delay:ie}=t;ie===0?J():p.value=window.setTimeout(J,ie)}}function D(){const A=a();if(t.trigger==="hover"&&!A){if(g(),f.value!==null||!l())return;const J=()=>{m(!1),f.value=null},{duration:ie}=t;ie===0?J():f.value=window.setTimeout(J,ie)}}function M(){D()}function I(A){var J;l()&&(t.trigger==="click"&&(g(),v(),m(!1)),(J=t.onClickoutside)===null||J===void 0||J.call(t,A))}function E(){if(t.trigger==="click"&&!a()){g(),v();const A=!l();m(A)}}function G(A){t.internalTrapFocus&&A.key==="Escape"&&(g(),v(),m(!1))}function oe(A){o.value=A}function N(){var A;return(A=n.value)===null||A===void 0?void 0:A.targetRef}function H(A){d=A}return w.provide("NPopover",{getTriggerElement:N,handleKeydown:G,handleMouseEnter:C,handleMouseLeave:D,handleClickOutside:I,handleMouseMoveOutside:M,setBodyInstance:H,positionManuallyRef:h,isMountedRef:e,zIndexRef:w.toRef(t,"zIndex"),extraClassRef:w.toRef(t,"internalExtraClass"),internalRenderBodyRef:w.toRef(t,"internalRenderBody")}),w.watchEffect(()=>{i.value&&a()&&m(!1)}),{binderInstRef:n,positionManually:h,mergedShowConsideringDisabledProp:s,uncontrolledShow:o,mergedShowArrow:u,getMergedShow:l,setShow:oe,handleClick:E,handleMouseEnter:C,handleMouseLeave:D,handleFocus:k,handleBlur:b,syncPosition:y}},render(){var t;const{positionManually:e,$slots:n}=this;let r,o=!1;if(!e&&(r=OP(n,"trigger"),r)){r=w.cloneVNode(r),r=r.type===w.Text?w.h("span",[r]):r;const i={onClick:this.handleClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onFocus:this.handleFocus,onBlur:this.handleBlur};if(!((t=r.type)===null||t===void 0)&&t.__popover__)o=!0,r.props||(r.props={internalSyncTargetWithParent:!0,internalInheritedEventHandlers:[]}),r.props.internalSyncTargetWithParent=!0,r.props.internalInheritedEventHandlers?r.props.internalInheritedEventHandlers=[i,...r.props.internalInheritedEventHandlers]:r.props.internalInheritedEventHandlers=[i];else{const{internalInheritedEventHandlers:s}=this,a=[i,...s],l={onBlur:c=>{a.forEach(u=>{u.onBlur(c)})},onFocus:c=>{a.forEach(u=>{u.onFocus(c)})},onClick:c=>{a.forEach(u=>{u.onClick(c)})},onMouseenter:c=>{a.forEach(u=>{u.onMouseenter(c)})},onMouseleave:c=>{a.forEach(u=>{u.onMouseleave(c)})}};wq(r,s?"nested":e?"manual":this.trigger,l)}}return w.h(a3,{ref:"binderInstRef",syncTarget:!o,syncTargetWithParent:this.internalSyncTargetWithParent},{default:()=>{this.mergedShowConsideringDisabledProp;const i=this.getMergedShow();return[this.internalTrapFocus&&i?w.withDirectives(w.h("div",{style:{position:"fixed",top:0,right:0,bottom:0,left:0}}),[[c3,{enabled:i,zIndex:this.zIndex}]]):null,e?null:w.h(l3,null,{default:()=>r}),w.h(mq,x3(this.$props,gq,Object.assign(Object.assign({},this.$attrs),{showArrow:this.mergedShowArrow,show:i})),{default:()=>{var s,a;return(a=(s=this.$slots).default)===null||a===void 0?void 0:a.call(s)},header:()=>{var s,a;return(a=(s=this.$slots).header)===null||a===void 0?void 0:a.call(s)},footer:()=>{var s,a;return(a=(s=this.$slots).footer)===null||a===void 0?void 0:a.call(s)}})]}})}}),vq={padding:"4px 0",optionIconSizeSmall:"14px",optionIconSizeMedium:"16px",optionIconSizeLarge:"16px",optionIconSizeHuge:"18px",optionSuffixWidthSmall:"14px",optionSuffixWidthMedium:"14px",optionSuffixWidthLarge:"16px",optionSuffixWidthHuge:"16px",optionIconSuffixWidthSmall:"32px",optionIconSuffixWidthMedium:"32px",optionIconSuffixWidthLarge:"36px",optionIconSuffixWidthHuge:"36px",optionPrefixWidthSmall:"14px",optionPrefixWidthMedium:"14px",optionPrefixWidthLarge:"16px",optionPrefixWidthHuge:"16px",optionIconPrefixWidthSmall:"36px",optionIconPrefixWidthMedium:"36px",optionIconPrefixWidthLarge:"40px",optionIconPrefixWidthHuge:"40px"};function xq(t){const{primaryColor:e,textColor2:n,dividerColor:r,hoverColor:o,popoverColor:i,invertedColor:s,borderRadius:a,fontSizeSmall:l,fontSizeMedium:c,fontSizeLarge:u,fontSizeHuge:d,heightSmall:p,heightMedium:f,heightLarge:h,heightHuge:m,textColor3:y,opacityDisabled:g}=t;return Object.assign(Object.assign({},vq),{optionHeightSmall:p,optionHeightMedium:f,optionHeightLarge:h,optionHeightHuge:m,borderRadius:a,fontSizeSmall:l,fontSizeMedium:c,fontSizeLarge:u,fontSizeHuge:d,optionTextColor:n,optionTextColorHover:n,optionTextColorActive:e,optionTextColorChildActive:e,color:i,dividerColor:r,suffixColor:n,prefixColor:n,optionColorHover:o,optionColorActive:hL(e,{alpha:.1}),groupHeaderTextColor:y,optionTextColorInverted:"#BBB",optionTextColorHoverInverted:"#FFF",optionTextColorActiveInverted:"#FFF",optionTextColorChildActiveInverted:"#FFF",colorInverted:s,dividerColorInverted:"#BBB",suffixColorInverted:"#BBB",prefixColorInverted:"#BBB",optionColorHoverInverted:e,optionColorActiveInverted:e,groupHeaderTextColorInverted:"#AAA",optionOpacityDisabled:g})}const kq={common:Ei,peers:{Popover:dh},self:xq},Sq={padding:"8px 14px"};function Aq(t){const{borderRadius:e,boxShadow2:n,baseColor:r}=t;return Object.assign(Object.assign({},Sq),{borderRadius:e,boxShadow:n,color:e3(r,"rgba(0, 0, 0, .85)"),textColor:r})}const Cq={common:Ei,peers:{Popover:dh},self:Aq},Eq=Object.assign(Object.assign({},vc),nn.props),tb=w.defineComponent({name:"Tooltip",props:Eq,slots:Object,__popover__:!0,setup(t){const{mergedClsPrefixRef:e}=Ai(t),n=nn("Tooltip","-tooltip",void 0,Cq,t,e),r=w.ref(null);return Object.assign(Object.assign({},{syncPosition(){r.value.syncPosition()},setShow(o){r.value.setShow(o)}}),{popoverRef:r,mergedTheme:n,popoverThemeOverrides:w.computed(()=>n.value.self)})},render(){const{mergedTheme:t,internalExtraClass:e}=this;return w.h(K3,Object.assign(Object.assign({},this.$props),{theme:t.peers.Popover,themeOverrides:t.peerOverrides.Popover,builtinThemeOverrides:this.popoverThemeOverrides,internalExtraClass:e.concat("tooltip"),ref:"popoverRef"}),this.$slots)}}),ph="n-dropdown-menu",xc="n-dropdown",nb="n-dropdown-option",J3=w.defineComponent({name:"DropdownDivider",props:{clsPrefix:{type:String,required:!0}},render(){return w.h("div",{class:`${this.clsPrefix}-dropdown-divider`})}}),Tq=w.defineComponent({name:"DropdownGroupHeader",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(){const{showIconRef:t,hasSubmenuRef:e}=w.inject(ph),{renderLabelRef:n,labelFieldRef:r,nodePropsRef:o,renderOptionRef:i}=w.inject(xc);return{labelField:r,showIcon:t,hasSubmenu:e,renderLabel:n,nodeProps:o,renderOption:i}},render(){var t;const{clsPrefix:e,hasSubmenu:n,showIcon:r,nodeProps:o,renderLabel:i,renderOption:s}=this,{rawNode:a}=this.tmNode,l=w.h("div",Object.assign({class:`${e}-dropdown-option`},o?.(a)),w.h("div",{class:`${e}-dropdown-option-body ${e}-dropdown-option-body--group`},w.h("div",{"data-dropdown-option":!0,class:[`${e}-dropdown-option-body__prefix`,r&&`${e}-dropdown-option-body__prefix--show-icon`]},Pl(a.icon)),w.h("div",{class:`${e}-dropdown-option-body__label`,"data-dropdown-option":!0},i?i(a):Pl((t=a.title)!==null&&t!==void 0?t:a[this.labelField])),w.h("div",{class:[`${e}-dropdown-option-body__suffix`,n&&`${e}-dropdown-option-body__suffix--has-submenu`],"data-dropdown-option":!0})));return s?s({node:l,option:a}):l}});function $q(t){const{textColorBase:e,opacity1:n,opacity2:r,opacity3:o,opacity4:i,opacity5:s}=t;return{color:e,opacity1Depth:n,opacity2Depth:r,opacity3Depth:o,opacity4Depth:i,opacity5Depth:s}}const Oq={common:Ei,self:$q},Mq=Qe("icon",`
283
+ height: 1em;
284
+ width: 1em;
285
+ line-height: 1em;
286
+ text-align: center;
287
+ display: inline-block;
288
+ position: relative;
289
+ fill: currentColor;
290
+ transform: translateZ(0);
291
+ `,[st("color-transition",{transition:"color .3s var(--n-bezier)"}),st("depth",{color:"var(--n-color)"},[qe("svg",{opacity:"var(--n-opacity)",transition:"opacity .3s var(--n-bezier)"})]),qe("svg",{height:"1em",width:"1em"})]),Dq=Object.assign(Object.assign({},nn.props),{depth:[String,Number],size:[Number,String],color:String,component:[Object,Function]}),_q=w.defineComponent({_n_icon__:!0,name:"Icon",inheritAttrs:!1,props:Dq,setup(t){const{mergedClsPrefixRef:e,inlineThemeDisabled:n}=Ai(t),r=nn("Icon","-icon",Mq,Oq,t,e),o=w.computed(()=>{const{depth:s}=t,{common:{cubicBezierEaseInOut:a},self:l}=r.value;if(s!==void 0){const{color:c,[`opacity${s}Depth`]:u}=l;return{"--n-bezier":a,"--n-color":c,"--n-opacity":u}}return{"--n-bezier":a,"--n-color":"","--n-opacity":""}}),i=n?mc("icon",w.computed(()=>`${t.depth||"d"}`),o,t):void 0;return{mergedClsPrefix:e,mergedStyle:w.computed(()=>{const{size:s,color:a}=t;return{fontSize:rl(s),color:a}}),cssVars:n?void 0:o,themeClass:i?.themeClass,onRender:i?.onRender}},render(){var t;const{$parent:e,depth:n,mergedClsPrefix:r,component:o,onRender:i,themeClass:s}=this;return!((t=e?.$options)===null||t===void 0)&&t._n_icon__&&Ll("icon","don't wrap `n-icon` inside `n-icon`"),i?.(),w.h("i",w.mergeProps(this.$attrs,{role:"img",class:[`${r}-icon`,s,{[`${r}-icon--depth`]:n,[`${r}-icon--color-transition`]:n!==void 0}],style:[this.cssVars,this.mergedStyle]}),o?w.h(o):this.$slots)}});function qp(t,e){return t.type==="submenu"||t.type===void 0&&t[e]!==void 0}function Nq(t){return t.type==="group"}function X3(t){return t.type==="divider"}function Iq(t){return t.type==="render"}const Y3=w.defineComponent({name:"DropdownOption",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0},parentKey:{type:[String,Number],default:null},placement:{type:String,default:"right-start"},props:Object,scrollable:Boolean},setup(t){const e=w.inject(xc),{hoverKeyRef:n,keyboardKeyRef:r,lastToggledSubmenuKeyRef:o,pendingKeyPathRef:i,activeKeyPathRef:s,animatedRef:a,mergedShowRef:l,renderLabelRef:c,renderIconRef:u,labelFieldRef:d,childrenFieldRef:p,renderOptionRef:f,nodePropsRef:h,menuPropsRef:m}=e,y=w.inject(nb,null),g=w.inject(ph),v=w.inject(pc),k=w.computed(()=>t.tmNode.rawNode),b=w.computed(()=>{const{value:W}=p;return qp(t.tmNode.rawNode,W)}),C=w.computed(()=>{const{disabled:W}=t.tmNode;return W}),D=w.computed(()=>{if(!b.value)return!1;const{key:W,disabled:ce}=t.tmNode;if(ce)return!1;const{value:X}=n,{value:ue}=r,{value:Z}=o,{value:R}=i;return X!==null?R.includes(W):ue!==null?R.includes(W)&&R[R.length-1]!==W:Z!==null?R.includes(W):!1}),M=w.computed(()=>r.value===null&&!a.value),I=NL(D,300,M),E=w.computed(()=>!!y?.enteringSubmenuRef.value),G=w.ref(!1);w.provide(nb,{enteringSubmenuRef:G});function oe(){G.value=!0}function N(){G.value=!1}function H(){const{parentKey:W,tmNode:ce}=t;ce.disabled||l.value&&(o.value=W,r.value=null,n.value=ce.key)}function A(){const{tmNode:W}=t;W.disabled||l.value&&n.value!==W.key&&H()}function J(W){if(t.tmNode.disabled||!l.value)return;const{relatedTarget:ce}=W;ce&&!Yw({target:ce},"dropdownOption")&&!Yw({target:ce},"scrollbarRail")&&(n.value=null)}function ie(){const{value:W}=b,{tmNode:ce}=t;l.value&&!W&&!ce.disabled&&(e.doSelect(ce.key,ce.rawNode),e.doUpdateShow(!1))}return{labelField:d,renderLabel:c,renderIcon:u,siblingHasIcon:g.showIconRef,siblingHasSubmenu:g.hasSubmenuRef,menuProps:m,popoverBody:v,animated:a,mergedShowSubmenu:w.computed(()=>I.value&&!E.value),rawNode:k,hasSubmenu:b,pending:ir(()=>{const{value:W}=i,{key:ce}=t.tmNode;return W.includes(ce)}),childActive:ir(()=>{const{value:W}=s,{key:ce}=t.tmNode,X=W.findIndex(ue=>ce===ue);return X===-1?!1:X<W.length-1}),active:ir(()=>{const{value:W}=s,{key:ce}=t.tmNode,X=W.findIndex(ue=>ce===ue);return X===-1?!1:X===W.length-1}),mergedDisabled:C,renderOption:f,nodeProps:h,handleClick:ie,handleMouseMove:A,handleMouseEnter:H,handleMouseLeave:J,handleSubmenuBeforeEnter:oe,handleSubmenuAfterEnter:N}},render(){var t,e;const{animated:n,rawNode:r,mergedShowSubmenu:o,clsPrefix:i,siblingHasIcon:s,siblingHasSubmenu:a,renderLabel:l,renderIcon:c,renderOption:u,nodeProps:d,props:p,scrollable:f}=this;let h=null;if(o){const v=(t=this.menuProps)===null||t===void 0?void 0:t.call(this,r,r.children);h=w.h(Z3,Object.assign({},v,{clsPrefix:i,scrollable:this.scrollable,tmNodes:this.tmNode.children,parentKey:this.tmNode.key}))}const m={class:[`${i}-dropdown-option-body`,this.pending&&`${i}-dropdown-option-body--pending`,this.active&&`${i}-dropdown-option-body--active`,this.childActive&&`${i}-dropdown-option-body--child-active`,this.mergedDisabled&&`${i}-dropdown-option-body--disabled`],onMousemove:this.handleMouseMove,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onClick:this.handleClick},y=d?.(r),g=w.h("div",Object.assign({class:[`${i}-dropdown-option`,y?.class],"data-dropdown-option":!0},y),w.h("div",w.mergeProps(m,p),[w.h("div",{class:[`${i}-dropdown-option-body__prefix`,s&&`${i}-dropdown-option-body__prefix--show-icon`]},[c?c(r):Pl(r.icon)]),w.h("div",{"data-dropdown-option":!0,class:`${i}-dropdown-option-body__label`},l?l(r):Pl((e=r[this.labelField])!==null&&e!==void 0?e:r.title)),w.h("div",{"data-dropdown-option":!0,class:[`${i}-dropdown-option-body__suffix`,a&&`${i}-dropdown-option-body__suffix--has-submenu`]},this.hasSubmenu?w.h(_q,null,{default:()=>w.h(Mj,null)}):null)]),this.hasSubmenu?w.h(a3,null,{default:()=>[w.h(l3,null,{default:()=>w.h("div",{class:`${i}-dropdown-offset-container`},w.h(u3,{show:this.mergedShowSubmenu,placement:this.placement,to:f&&this.popoverBody||void 0,teleportDisabled:!f},{default:()=>w.h("div",{class:`${i}-dropdown-menu-wrapper`},n?w.h(w.Transition,{onBeforeEnter:this.handleSubmenuBeforeEnter,onAfterEnter:this.handleSubmenuAfterEnter,name:"fade-in-scale-up-transition",appear:!0},{default:()=>h}):h)}))})]}):null);return u?u({node:g,option:r}):g}}),Fq=w.defineComponent({name:"NDropdownGroup",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0},parentKey:{type:[String,Number],default:null}},render(){const{tmNode:t,parentKey:e,clsPrefix:n}=this,{children:r}=t;return w.h(w.Fragment,null,w.h(Tq,{clsPrefix:n,tmNode:t,key:t.key}),r?.map(o=>{const{rawNode:i}=o;return i.show===!1?null:X3(i)?w.h(J3,{clsPrefix:n,key:o.key}):o.isGroup?(Ll("dropdown","`group` node is not allowed to be put in `group` node."),null):w.h(Y3,{clsPrefix:n,tmNode:o,parentKey:e,key:o.key})}))}}),Rq=w.defineComponent({name:"DropdownRenderOption",props:{tmNode:{type:Object,required:!0}},render(){const{rawNode:{render:t,props:e}}=this.tmNode;return w.h("div",e,[t?.()])}}),Z3=w.defineComponent({name:"DropdownMenu",props:{scrollable:Boolean,showArrow:Boolean,arrowStyle:[String,Object],clsPrefix:{type:String,required:!0},tmNodes:{type:Array,default:()=>[]},parentKey:{type:[String,Number],default:null}},setup(t){const{renderIconRef:e,childrenFieldRef:n}=w.inject(xc);w.provide(ph,{showIconRef:w.computed(()=>{const o=e.value;return t.tmNodes.some(i=>{var s;if(i.isGroup)return(s=i.children)===null||s===void 0?void 0:s.some(({rawNode:l})=>o?o(l):l.icon);const{rawNode:a}=i;return o?o(a):a.icon})}),hasSubmenuRef:w.computed(()=>{const{value:o}=n;return t.tmNodes.some(i=>{var s;if(i.isGroup)return(s=i.children)===null||s===void 0?void 0:s.some(({rawNode:l})=>qp(l,o));const{rawNode:a}=i;return qp(a,o)})})});const r=w.ref(null);return w.provide(Jf,null),w.provide(Kf,null),w.provide(pc,r),{bodyRef:r}},render(){const{parentKey:t,clsPrefix:e,scrollable:n}=this,r=this.tmNodes.map(o=>{const{rawNode:i}=o;return i.show===!1?null:Iq(i)?w.h(Rq,{tmNode:o,key:o.key}):X3(i)?w.h(J3,{clsPrefix:e,key:o.key}):Nq(i)?w.h(Fq,{clsPrefix:e,tmNode:o,parentKey:t,key:o.key}):w.h(Y3,{clsPrefix:e,tmNode:o,parentKey:t,key:o.key,props:i.props,scrollable:n})});return w.h("div",{class:[`${e}-dropdown-menu`,n&&`${e}-dropdown-menu--scrollable`],ref:"bodyRef"},n?w.h(V3,{contentClass:`${e}-dropdown-menu__content`},{default:()=>r}):r,this.showArrow?G3({clsPrefix:e,arrowStyle:this.arrowStyle,arrowClass:void 0,arrowWrapperClass:void 0,arrowWrapperStyle:void 0}):null)}}),Bq=Qe("dropdown-menu",`
292
+ transform-origin: var(--v-transform-origin);
293
+ background-color: var(--n-color);
294
+ border-radius: var(--n-border-radius);
295
+ box-shadow: var(--n-box-shadow);
296
+ position: relative;
297
+ transition:
298
+ background-color .3s var(--n-bezier),
299
+ box-shadow .3s var(--n-bezier);
300
+ `,[dq(),Qe("dropdown-option",`
301
+ position: relative;
302
+ `,[qe("a",`
303
+ text-decoration: none;
304
+ color: inherit;
305
+ outline: none;
306
+ `,[qe("&::before",`
307
+ content: "";
308
+ position: absolute;
309
+ left: 0;
310
+ right: 0;
311
+ top: 0;
312
+ bottom: 0;
313
+ `)]),Qe("dropdown-option-body",`
314
+ display: flex;
315
+ cursor: pointer;
316
+ position: relative;
317
+ height: var(--n-option-height);
318
+ line-height: var(--n-option-height);
319
+ font-size: var(--n-font-size);
320
+ color: var(--n-option-text-color);
321
+ transition: color .3s var(--n-bezier);
322
+ `,[qe("&::before",`
323
+ content: "";
324
+ position: absolute;
325
+ top: 0;
326
+ bottom: 0;
327
+ left: 4px;
328
+ right: 4px;
329
+ transition: background-color .3s var(--n-bezier);
330
+ border-radius: var(--n-border-radius);
331
+ `),ds("disabled",[st("pending",`
332
+ color: var(--n-option-text-color-hover);
333
+ `,[Pt("prefix, suffix",`
334
+ color: var(--n-option-text-color-hover);
335
+ `),qe("&::before","background-color: var(--n-option-color-hover);")]),st("active",`
336
+ color: var(--n-option-text-color-active);
337
+ `,[Pt("prefix, suffix",`
338
+ color: var(--n-option-text-color-active);
339
+ `),qe("&::before","background-color: var(--n-option-color-active);")]),st("child-active",`
340
+ color: var(--n-option-text-color-child-active);
341
+ `,[Pt("prefix, suffix",`
342
+ color: var(--n-option-text-color-child-active);
343
+ `)])]),st("disabled",`
344
+ cursor: not-allowed;
345
+ opacity: var(--n-option-opacity-disabled);
346
+ `),st("group",`
347
+ font-size: calc(var(--n-font-size) - 1px);
348
+ color: var(--n-group-header-text-color);
349
+ `,[Pt("prefix",`
350
+ width: calc(var(--n-option-prefix-width) / 2);
351
+ `,[st("show-icon",`
352
+ width: calc(var(--n-option-icon-prefix-width) / 2);
353
+ `)])]),Pt("prefix",`
354
+ width: var(--n-option-prefix-width);
355
+ display: flex;
356
+ justify-content: center;
357
+ align-items: center;
358
+ color: var(--n-prefix-color);
359
+ transition: color .3s var(--n-bezier);
360
+ z-index: 1;
361
+ `,[st("show-icon",`
362
+ width: var(--n-option-icon-prefix-width);
363
+ `),Qe("icon",`
364
+ font-size: var(--n-option-icon-size);
365
+ `)]),Pt("label",`
366
+ white-space: nowrap;
367
+ flex: 1;
368
+ z-index: 1;
369
+ `),Pt("suffix",`
370
+ box-sizing: border-box;
371
+ flex-grow: 0;
372
+ flex-shrink: 0;
373
+ display: flex;
374
+ justify-content: flex-end;
375
+ align-items: center;
376
+ min-width: var(--n-option-suffix-width);
377
+ padding: 0 8px;
378
+ transition: color .3s var(--n-bezier);
379
+ color: var(--n-suffix-color);
380
+ z-index: 1;
381
+ `,[st("has-submenu",`
382
+ width: var(--n-option-icon-suffix-width);
383
+ `),Qe("icon",`
384
+ font-size: var(--n-option-icon-size);
385
+ `)]),Qe("dropdown-menu","pointer-events: all;")]),Qe("dropdown-offset-container",`
386
+ pointer-events: none;
387
+ position: absolute;
388
+ left: 0;
389
+ right: 0;
390
+ top: -4px;
391
+ bottom: -4px;
392
+ `)]),Qe("dropdown-divider",`
393
+ transition: background-color .3s var(--n-bezier);
394
+ background-color: var(--n-divider-color);
395
+ height: 1px;
396
+ margin: 4px 0;
397
+ `),Qe("dropdown-menu-wrapper",`
398
+ transform-origin: var(--v-transform-origin);
399
+ width: fit-content;
400
+ `),qe(">",[Qe("scrollbar",`
401
+ height: inherit;
402
+ max-height: inherit;
403
+ `)]),ds("scrollable",`
404
+ padding: var(--n-padding);
405
+ `),st("scrollable",[Pt("content",`
406
+ padding: var(--n-padding);
407
+ `)])]),Lq={animated:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},size:{type:String,default:"medium"},inverted:Boolean,placement:{type:String,default:"bottom"},onSelect:[Function,Array],options:{type:Array,default:()=>[]},menuProps:Function,showArrow:Boolean,renderLabel:Function,renderIcon:Function,renderOption:Function,nodeProps:Function,labelField:{type:String,default:"label"},keyField:{type:String,default:"key"},childrenField:{type:String,default:"children"},value:[String,Number]},Pq=Object.keys(vc),zq=Object.assign(Object.assign(Object.assign({},vc),Lq),nn.props),jq=w.defineComponent({name:"Dropdown",inheritAttrs:!1,props:zq,setup(t){const e=w.ref(!1),n=n3(w.toRef(t,"show"),e),r=w.computed(()=>{const{keyField:N,childrenField:H}=t;return uq(t.options,{getKey(A){return A[N]},getDisabled(A){return A.disabled===!0},getIgnored(A){return A.type==="divider"||A.type==="render"},getChildren(A){return A[H]}})}),o=w.computed(()=>r.value.treeNodes),i=w.ref(null),s=w.ref(null),a=w.ref(null),l=w.computed(()=>{var N,H,A;return(A=(H=(N=i.value)!==null&&N!==void 0?N:s.value)!==null&&H!==void 0?H:a.value)!==null&&A!==void 0?A:null}),c=w.computed(()=>r.value.getPath(l.value).keyPath),u=w.computed(()=>r.value.getPath(t.value).keyPath),d=ir(()=>t.keyboard&&n.value);DL({keydown:{ArrowUp:{prevent:!0,handler:C},ArrowRight:{prevent:!0,handler:b},ArrowDown:{prevent:!0,handler:D},ArrowLeft:{prevent:!0,handler:k},Enter:{prevent:!0,handler:M},Escape:v}},d);const{mergedClsPrefixRef:p,inlineThemeDisabled:f}=Ai(t),h=nn("Dropdown","-dropdown",Bq,kq,t,p);w.provide(xc,{labelFieldRef:w.toRef(t,"labelField"),childrenFieldRef:w.toRef(t,"childrenField"),renderLabelRef:w.toRef(t,"renderLabel"),renderIconRef:w.toRef(t,"renderIcon"),hoverKeyRef:i,keyboardKeyRef:s,lastToggledSubmenuKeyRef:a,pendingKeyPathRef:c,activeKeyPathRef:u,animatedRef:w.toRef(t,"animated"),mergedShowRef:n,nodePropsRef:w.toRef(t,"nodeProps"),renderOptionRef:w.toRef(t,"renderOption"),menuPropsRef:w.toRef(t,"menuProps"),doSelect:m,doUpdateShow:y}),w.watch(n,N=>{!t.animated&&!N&&g()});function m(N,H){const{onSelect:A}=t;A&&Tr(A,N,H)}function y(N){const{"onUpdate:show":H,onUpdateShow:A}=t;H&&Tr(H,N),A&&Tr(A,N),e.value=N}function g(){i.value=null,s.value=null,a.value=null}function v(){y(!1)}function k(){E("left")}function b(){E("right")}function C(){E("up")}function D(){E("down")}function M(){const N=I();N?.isLeaf&&n.value&&(m(N.key,N.rawNode),y(!1))}function I(){var N;const{value:H}=r,{value:A}=l;return!H||A===null?null:(N=H.getNode(A))!==null&&N!==void 0?N:null}function E(N){const{value:H}=l,{value:{getFirstAvailableNode:A}}=r;let J=null;if(H===null){const ie=A();ie!==null&&(J=ie.key)}else{const ie=I();if(ie){let W;switch(N){case"down":W=ie.getNext();break;case"up":W=ie.getPrev();break;case"right":W=ie.getChild();break;case"left":W=ie.getParent();break}W&&(J=W.key)}}J!==null&&(i.value=null,s.value=J)}const G=w.computed(()=>{const{size:N,inverted:H}=t,{common:{cubicBezierEaseInOut:A},self:J}=h.value,{padding:ie,dividerColor:W,borderRadius:ce,optionOpacityDisabled:X,[br("optionIconSuffixWidth",N)]:ue,[br("optionSuffixWidth",N)]:Z,[br("optionIconPrefixWidth",N)]:R,[br("optionPrefixWidth",N)]:ee,[br("fontSize",N)]:ne,[br("optionHeight",N)]:se,[br("optionIconSize",N)]:Y}=J,$={"--n-bezier":A,"--n-font-size":ne,"--n-padding":ie,"--n-border-radius":ce,"--n-option-height":se,"--n-option-prefix-width":ee,"--n-option-icon-prefix-width":R,"--n-option-suffix-width":Z,"--n-option-icon-suffix-width":ue,"--n-option-icon-size":Y,"--n-divider-color":W,"--n-option-opacity-disabled":X};return H?($["--n-color"]=J.colorInverted,$["--n-option-color-hover"]=J.optionColorHoverInverted,$["--n-option-color-active"]=J.optionColorActiveInverted,$["--n-option-text-color"]=J.optionTextColorInverted,$["--n-option-text-color-hover"]=J.optionTextColorHoverInverted,$["--n-option-text-color-active"]=J.optionTextColorActiveInverted,$["--n-option-text-color-child-active"]=J.optionTextColorChildActiveInverted,$["--n-prefix-color"]=J.prefixColorInverted,$["--n-suffix-color"]=J.suffixColorInverted,$["--n-group-header-text-color"]=J.groupHeaderTextColorInverted):($["--n-color"]=J.color,$["--n-option-color-hover"]=J.optionColorHover,$["--n-option-color-active"]=J.optionColorActive,$["--n-option-text-color"]=J.optionTextColor,$["--n-option-text-color-hover"]=J.optionTextColorHover,$["--n-option-text-color-active"]=J.optionTextColorActive,$["--n-option-text-color-child-active"]=J.optionTextColorChildActive,$["--n-prefix-color"]=J.prefixColor,$["--n-suffix-color"]=J.suffixColor,$["--n-group-header-text-color"]=J.groupHeaderTextColor),$}),oe=f?mc("dropdown",w.computed(()=>`${t.size[0]}${t.inverted?"i":""}`),G,t):void 0;return{mergedClsPrefix:p,mergedTheme:h,tmNodes:o,mergedShow:n,handleAfterLeave:()=>{t.animated&&g()},doUpdateShow:y,cssVars:f?void 0:G,themeClass:oe?.themeClass,onRender:oe?.onRender}},render(){const t=(r,o,i,s,a)=>{var l;const{mergedClsPrefix:c,menuProps:u}=this;(l=this.onRender)===null||l===void 0||l.call(this);const d=u?.(void 0,this.tmNodes.map(f=>f.rawNode))||{},p={ref:$P(o),class:[r,`${c}-dropdown`,this.themeClass],clsPrefix:c,tmNodes:this.tmNodes,style:[...i,this.cssVars],showArrow:this.showArrow,arrowStyle:this.arrowStyle,scrollable:this.scrollable,onMouseenter:s,onMouseleave:a};return w.h(Z3,w.mergeProps(this.$attrs,p,d))},{mergedTheme:e}=this,n={show:this.mergedShow,theme:e.peers.Popover,themeOverrides:e.peerOverrides.Popover,internalOnAfterLeave:this.handleAfterLeave,internalRenderBody:t,onUpdateShow:this.doUpdateShow,"onUpdate:show":void 0};return w.h(K3,Object.assign({},x3(this.$props,Pq),n),{trigger:()=>{var r,o;return(o=(r=this.$slots).default)===null||o===void 0?void 0:o.call(r)}})}});function qq(t){const{heightSmall:e,heightMedium:n,heightLarge:r,borderRadius:o}=t;return{color:"#eee",colorEnd:"#ddd",borderRadius:o,heightSmall:e,heightMedium:n,heightLarge:r}}const Vq={common:Ei,self:qq},Uq=qe([Qe("skeleton",`
408
+ height: 1em;
409
+ width: 100%;
410
+ transition:
411
+ --n-color-start .3s var(--n-bezier),
412
+ --n-color-end .3s var(--n-bezier),
413
+ background-color .3s var(--n-bezier);
414
+ animation: 2s skeleton-loading infinite cubic-bezier(0.36, 0, 0.64, 1);
415
+ background-color: var(--n-color-start);
416
+ `),qe("@keyframes skeleton-loading",`
417
+ 0% {
418
+ background: var(--n-color-start);
419
+ }
420
+ 40% {
421
+ background: var(--n-color-end);
422
+ }
423
+ 80% {
424
+ background: var(--n-color-start);
425
+ }
426
+ 100% {
427
+ background: var(--n-color-start);
428
+ }
429
+ `)]),Hq=Object.assign(Object.assign({},nn.props),{text:Boolean,round:Boolean,circle:Boolean,height:[String,Number],width:[String,Number],size:String,repeat:{type:Number,default:1},animated:{type:Boolean,default:!0},sharp:{type:Boolean,default:!0}}),En=w.defineComponent({name:"Skeleton",inheritAttrs:!1,props:Hq,setup(t){FL();const{mergedClsPrefixRef:e}=Ai(t),n=nn("Skeleton","-skeleton",Uq,Vq,t,e);return{mergedClsPrefix:e,style:w.computed(()=>{var r,o;const i=n.value,{common:{cubicBezierEaseInOut:s}}=i,a=i.self,{color:l,colorEnd:c,borderRadius:u}=a;let d;const{circle:p,sharp:f,round:h,width:m,height:y,size:g,text:v,animated:k}=t;g!==void 0&&(d=a[br("height",g)]);const b=p?(r=m??y)!==null&&r!==void 0?r:d:m,C=(o=p?m??y:y)!==null&&o!==void 0?o:d;return{display:v?"inline-block":"",verticalAlign:v?"-0.125em":"",borderRadius:p?"50%":h?"4096px":f?"":u,width:typeof b=="number"?Qw(b):b,height:typeof C=="number"?Qw(C):C,animation:k?"":"none","--n-bezier":s,"--n-color-start":l,"--n-color-end":c}})}},render(){const{repeat:t,style:e,mergedClsPrefix:n,$attrs:r}=this,o=w.h("div",w.mergeProps({class:`${n}-skeleton`,style:e},r));return t>1?w.h(w.Fragment,null,yL(t,null).map(i=>[o,`
430
+ `])):o}}),Wq={key:0},Gq={key:0},Kq={key:0},Jq={__name:"ButtonGroup",props:{toolbarItems:{type:Array,required:!0},overflowItems:{type:Array,default:()=>[]},position:{type:String,default:"left"}},emits:["command"],setup(t,{emit:e}){const n=e,r=t,o=w.ref(null),i=window.matchMedia("(max-width: 768px)").matches,s={left:{minWidth:"140px",justifyContent:"flex-start"},right:{minWidth:"140px",justifyContent:"flex-end"},default:{flexGrow:i?0:1,justifyContent:"center"}},a=w.computed(()=>s[r.position]||s.default),l=k=>k.type==="button",c=k=>k.type==="dropdown",u=k=>k.type==="separator",d=k=>k.type==="overflow",p=(k,b=null)=>{o.value=k,o.value.expand=!0,!k.disabled.value&&n("command",{item:k,argument:b})},f=(k,b)=>{k.disabled.value||(o.value=null,n("command",{item:k,argument:b}))},h=()=>{o.value&&(o.value.expand=!1,o.value=null)},m=w.ref(null),y=(k,b)=>{h();const C=k.dropdownValueKey.value?b[k.dropdownValueKey.value]:b.label;n("command",{item:k,argument:C,option:b}),m.value=b.key},g=k=>k.nestedOptions?.value?.length?k.nestedOptions.value.map(b=>({...b,props:{...b.props,class:m.value===b.key?"selected":""}})):[],v=k=>{h()};return(k,b)=>(w.openBlock(),w.createElementBlock("div",{style:w.normalizeStyle(a.value),class:"button-group"},[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(t.toolbarItems,C=>(w.openBlock(),w.createElementBlock("div",{key:C.id.value,class:w.normalizeClass([{narrow:C.isNarrow.value,wide:C.isWide.value},"toolbar-item-ctn"])},[u(C)?(w.openBlock(),w.createBlock(EB,{key:0,style:{width:"20px"}})):w.createCommentVNode("",!0),c(C)&&C.nestedOptions?.value?.length?(w.openBlock(),w.createBlock(w.unref(jq),{key:1,options:g(C),trigger:C.disabled.value?null:"click",show:C.expand.value,size:"medium",placement:"bottom-start",class:"toolbar-button toolbar-dropdown sd-editor-toolbar-dropdown",onSelect:(D,M)=>y(C,M),onClickoutside:v,style:w.normalizeStyle(C.dropdownStyles.value)},{default:w.withCtx(()=>[w.createVNode(w.unref(tb),{trigger:"hover",disabled:!C.tooltip?.value},{trigger:w.withCtx(()=>[w.createVNode(Ep,{"toolbar-item":C,onTextSubmit:D=>f(C,D),onButtonClick:D=>p(C)},null,8,["toolbar-item","onTextSubmit","onButtonClick"])]),default:w.withCtx(()=>[w.createBaseVNode("div",null,[w.createTextVNode(w.toDisplayString(C.tooltip)+" ",1),C.disabled.value?(w.openBlock(),w.createElementBlock("span",Wq,"(disabled)")):w.createCommentVNode("",!0)])]),_:2},1032,["disabled"])]),_:2},1032,["options","trigger","show","onSelect","style"])):l(C)?(w.openBlock(),w.createBlock(w.unref(tb),{key:2,trigger:"hover",class:"sd-editor-toolbar-tooltip"},{trigger:w.withCtx(()=>[w.createVNode(Ep,{"toolbar-item":C,onTextSubmit:D=>f(C,D),onButtonClick:D=>p(C)},null,8,["toolbar-item","onTextSubmit","onButtonClick"])]),default:w.withCtx(()=>[C.tooltip?(w.openBlock(),w.createElementBlock("div",Gq,[w.createTextVNode(w.toDisplayString(C.tooltip)+" ",1),C.disabled.value?(w.openBlock(),w.createElementBlock("span",Kq,"(disabled)")):w.createCommentVNode("",!0)])):w.createCommentVNode("",!0)]),_:2},1024)):w.createCommentVNode("",!0),d(C)&&t.overflowItems.length?(w.openBlock(),w.createBlock(DB,{key:3,"toolbar-item":C,"overflow-items":t.overflowItems},null,8,["toolbar-item","overflow-items"])):w.createCommentVNode("",!0)],2))),128))],4))}},ol=ft(Jq,[["__scopeId","data-v-7751c4e5"]]),Xq={__name:"Toolbar",emits:["command","toggle","select"],setup(t,{emit:e}){const{proxy:n}=w.getCurrentInstance();let r=w.ref(1);const o=n.$toolbar.config?.toolbarGroups?.includes("left"),i=n.$toolbar.config?.toolbarGroups?.includes("right"),s=n.$toolbar.config?.toolbarButtonsExclude||[],a=d=>n.$toolbar.getToolbarItemByGroup(d).filter(p=>!s.includes(p.name.value));w.onMounted(()=>{window.addEventListener("resize",c),window.addEventListener("keydown",l)}),w.onDeactivated(()=>{window.removeEventListener("resize",c),window.removeEventListener("keydown",l)});const l=async d=>{if(d.metaKey&&d.key==="f"){d.preventDefault();const p=n.$toolbar.getToolbarItemByName("search");p&&(p.expand.value=!0,await w.nextTick(),p.inputRef.value&&p.inputRef.value.focus())}},c=AR(async()=>{await n.$toolbar.onToolbarResize(),r.value+=1},300),u=({item:d,argument:p,option:f})=>{n.$toolbar.emitCommand({item:d,argument:p,option:f})};return(d,p)=>(w.openBlock(),w.createElementBlock("div",{class:"superdoc-toolbar",key:w.unref(r)},[w.unref(o)?(w.openBlock(),w.createBlock(ol,{key:0,"toolbar-items":a("left"),position:"left",onCommand:u,class:"superdoc-toolbar-group-side"},null,8,["toolbar-items"])):w.createCommentVNode("",!0),w.createVNode(ol,{"toolbar-items":a("center"),"overflow-items":w.unref(n).$toolbar.overflowItems,position:"center",onCommand:u},null,8,["toolbar-items","overflow-items"]),w.unref(i)?(w.openBlock(),w.createBlock(ol,{key:1,"toolbar-items":a("right"),position:"right",onCommand:u,class:"superdoc-toolbar-group-side"},null,8,["toolbar-items"])):w.createCommentVNode("",!0)]))}},Q3=ft(Xq,[["__scopeId","data-v-abd0fb95"]]),Yq="https://sd-dev-express-gateway-i6xtm.ondigitalocean.app/insights",eS="You are an expert copywriter and you are immersed in a document editor. You are to provide document related text responses based on the user prompts. Only write what is asked for. Do not provide explanations. Try to keep placeholders as short as possible. Do not output your prompt. Your instructions are: ";async function tS(t,e={}){const n=e.apiKey,r=e.endpoint||Yq;try{const o={"Content-Type":"application/json"};n&&(o["x-api-key"]=n);const i=await fetch(r,{method:"POST",headers:o,body:JSON.stringify(t)});if(!i.ok){const s=await i.text();throw new Error(`Harbour API error: ${i.status} - ${s}`)}return i}catch(o){throw console.error("Error calling Harbour API:",o),o}}async function nS(t,e,n){const r=t.getReader(),o=new TextDecoder;let i="",s="";try{for(;;){const{done:l,value:c}=await r.read();if(l){typeof n=="function"&&n();break}const u=o.decode(c,{stream:!0});typeof e=="function"&&e(u)}let a=Zq(s);return a!==null&&(i=a),i||""}catch(a){throw console.error("Error reading stream:",a),a}finally{r.releaseLock()}}function Zq(t){try{const e=/```json\s*\n([\s\S]*?)\n\s*```/,n=t.match(e);if(n&&n[1]){const r=JSON.parse(n[1]);if(r.custom_prompt&&r.custom_prompt.value!==void 0)return r.custom_prompt.value||""}return null}catch{return null}}async function Qq(t,e={},n,r){if(!t)throw new Error("Prompt is required for text generation");const o={stream:!0,context:eS,doc_text:"",insights:[{type:"custom_prompt",name:"text_generation",message:`Generate text based on the following prompt: ${t}`}]};e.documentXml&&(o.document_content=e.documentXml);const i=await tS(o,e.config||{});return i.body?await nS(i.body,n,r):""}async function eV(t,e="",n={},r,o){if(!t)throw new Error("Text is required for rewriting");const i={stream:!0,context:eS,insights:[{type:"custom_prompt",name:"text_rewrite",message:`Rewrite the following text: "${t}" using these instructions: ${e}`}]},s=await tS(i,n.config||{});return s.body?await nS(s.body,r,o):""}const tV={rules:[{name:"bold",pattern:/\*\*(.*?)\*\*/g,transform:(t,e,n)=>({type:"text",marks:[{type:"bold"}],text:e})}]};function nV(t){try{let e=t.state.doc;const n=e.textContent||"";if(!n)return;tV.rules.forEach(r=>{r.pattern.lastIndex=0;const o=[];let i;for(;(i=r.pattern.exec(n))!==null;)o.push({rule:r,startPos:i.index,endPos:i.index+i[0].length,originalText:i[0],contentText:i[1]});o.sort((s,a)=>a.startPos-s.startPos);for(const s of o){const{startPos:a,endPos:l,originalText:c,contentText:u}=s;try{let d=t.state.tr;const p=r.transform(c,u,t),f=[];if(e.nodesBetween(a,Math.min(l,e.content.size),(h,m)=>(h.isText&&f.push({node:h,pos:m}),!0)),f.length>0){let h=!1,m=-1,y=-1;for(let g=0;g<f.length;g++){const v=f[g],k=v.node.text||"",b=v.pos;if(k.includes(c)){const C=k.indexOf(c);m=b+C,y=m+c.length,h=!0;break}}if(!h){let g="",v=[],k=f[0].pos;for(const C of f){const D=C.node.text||"",M=C.pos-k;for(let I=0;I<D.length;I++)v.push(M+I);g+=D}const b=g.indexOf(c);if(b>=0){m=k+v[b];const C=b+c.length-1;y=k+(v[C]||0)+1,h=!0}}if(h){const g=p.marks?p.marks.map(v=>t.schema.marks[v.type].create(v.attrs)):[];d=d.delete(m,y),d=d.insert(m,t.schema.text(p.text,g)),d.docChanged&&(t.view.dispatch(d),e=t.state.doc)}}}catch(d){console.error("Error processing match:",d)}}})}catch(e){console.error("Error formatting document:",e)}}const rV=`<!-- @note: includes color gradient for inline svg AI Writer -->
431
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.-->
432
+ <linearGradient id="gradient" x1="125%" y1="50%" x2="-25%" y2="50%">
433
+ <stop offset="-20%" stop-color="rgba(218, 215, 118, 0.5)" />
434
+ <stop offset="30%" stop-color="rgb(191, 100, 100)" />
435
+ <stop offset="60%" stop-color="rgb(77, 82, 217)" />
436
+ <stop offset="150%" stop-color="rgb(255, 219, 102)" />
437
+ </linearGradient>
438
+ <path fill="url(#gradient)" d="M402.3 344.9l32-32c5-5 13.7-1.5 13.7 5.7V464c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V112c0-26.5 21.5-48 48-48h273.5c7.1 0 10.7 8.6 5.7 13.7l-32 32c-1.5 1.5-3.5 2.3-5.7 2.3H48v352h352V350.5c0-2.1 .8-4.1 2.3-5.6zm156.6-201.8L296.3 405.7l-90.4 10c-26.2 2.9-48.5-19.2-45.6-45.6l10-90.4L432.9 17.1c22.9-22.9 59.9-22.9 82.7 0l43.2 43.2c22.9 22.9 22.9 60 .1 82.8zM460.1 174L402 115.9 216.2 301.8l-7.3 65.3 65.3-7.3L460.1 174zm64.8-79.7l-43.2-43.2c-4.1-4.1-10.8-4.1-14.8 0L436 82l58.1 58.1 30.9-30.9c4-4.2 4-10.8-.1-14.9z"/>
439
+ </svg>`,oV=`<!-- @note: includes color gradient for inline svg AI Writer -->
440
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.-->
441
+ <defs>
442
+ <linearGradient id="gradient" x1="125%" y1="50%" x2="-25%" y2="50%">
443
+ <stop offset="-20%" stop-color="rgba(218, 215, 118, 0.5)" />
444
+ <stop offset="30%" stop-color="rgb(191, 100, 100)" />
445
+ <stop offset="60%" stop-color="rgb(77, 82, 217)" />
446
+ <stop offset="150%" stop-color="rgb(255, 219, 102)" />
447
+ </linearGradient>
448
+ </defs>
449
+ <path fill="url(#gradient)" d="M440 6.5L24 246.4c-34.4 19.9-31.1 70.8 5.7 85.9L144 379.6V464c0 46.4 59.2 65.5 86.6 28.6l43.8-59.1 111.9 46.2c5.9 2.4 12.1 3.6 18.3 3.6 8.2 0 16.3-2.1 23.6-6.2 12.8-7.2 21.6-20 23.9-34.5l59.4-387.2c6.1-40.1-36.9-68.8-71.5-48.9zM192 464v-64.6l36.6 15.1L192 464zm212.6-28.7l-153.8-63.5L391 169.5c10.7-15.5-9.5-33.5-23.7-21.2L155.8 332.6 48 288 464 48l-59.4 387.3z"/>
450
+ </svg>`,iV={class:"ai-user-input-field"},sV=["innerHTML"],aV=["placeholder"],lV={class:"ai-loader"},cV=["innerHTML"],uV={__name:"AIWriter",props:{selectedText:{type:String,required:!0},handleClose:{type:Function,required:!0},editor:{type:Object,required:!0},apiKey:{type:String},endpoint:{type:String,required:!1},superToolbar:{type:Object}},emits:["ai-highlight"],setup(t,{emit:e}){const n=t,r=e,o=w.ref(null),i=w.ref(null),s=A=>{i.value&&!i.value.contains(A.target)&&(m.value||l("remove"),n.handleClose())},a=w.ref(null),l=(A,J=null)=>{n.superToolbar?n.superToolbar.emit("ai-highlight",{type:A,data:J}):r("ai-highlight",{type:A,data:J})},c=()=>{n.selectedText&&(o.value={...n.editor.state.selection,from:n.editor.state.selection.from,to:n.editor.state.selection.to},n.editor.commands.setMeta("storedSelection",o.value),l("add"))},u=()=>{w.nextTick(()=>{a.value&&a.value.focus()})},d=()=>{document.addEventListener("mousedown",s),document.addEventListener("keydown",f,!0)},p=()=>{document.removeEventListener("mousedown",s),document.removeEventListener("keydown",f,!0)};w.onMounted(()=>{c(),u(),d()}),w.onUnmounted(()=>{m.value||l("remove"),p()});const f=A=>{a.value&&A.target===a.value&&["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(A.key)&&A.stopPropagation()},h=w.computed(()=>n.selectedText?"Insert prompt to update text":"Insert prompt to generate text"),m=w.ref(!1),y=w.ref(""),g=w.ref(""),v=w.ref(!1),k=w.ref(""),b=w.ref(!1),C=w.ref(!1),D=w.computed(()=>n.editor.isInSuggestingMode?.()||!1),M=()=>{try{return n.editor.state.doc.textContent||""}catch(A){return console.error("Error getting document XML:",A),""}},I=async A=>{try{if(n.editor.commands.removeAiNode("aiLoaderNode"),n.selectedText&&!v.value){if(l("remove"),n.editor.commands.clearAiHighlightStyle(),o.value){const{state:W}=n.editor,{from:ce,to:X}=o.value,ue=W.tr.setSelection(Pe.create(W.doc,ce,X));n.editor.view.dispatch(ue)}else console.warn("[AIWriter] No stored selection to restore");n.editor.commands.deleteSelection(),v.value=!0}if(A==null||A==="")return;const J=String(A),ie={type:"text",marks:[{type:"aiAnimationMark",attrs:{class:"sd-ai-text-appear",dataMarkId:`ai-animation-${Date.now()}`}}],text:J};n.editor.commands.insertContent(ie),C.value=!0,b.value||await E(),n.handleClose()}catch(J){console.error("Error handling text chunk:",J)}},E=async()=>{if(!b.value)try{b.value=!0,C.value=!1,await w.nextTick(),nV(n.editor),C.value&&(C.value=!1,await E())}finally{b.value=!1}},G=async()=>{(C.value||b.value)&&(C.value=!0,await new Promise(A=>{const J=()=>{!b.value&&!C.value?A():setTimeout(J,100)};J()})),await E(),setTimeout(()=>{n.editor.commands.removeAiMark("aiAnimationMark"),l("remove")},1e3)},oe=async()=>{y.value="",v.value=!1,k.value="",m.value=!0;try{n.handleClose(),n.selectedText?l("update"):n.editor.commands.insertContent({type:"aiLoaderNode"}),D.value&&n.editor.commands.enableTrackChanges();const A={docText:"",documentXml:M(),config:{apiKey:n.apiKey,endpoint:n.endpoint}};n.selectedText?await eV(n.selectedText,g.value,A,I,G):await Qq(g.value,A,I,G)}catch(A){console.error("AI generation error:",A),y.value=A.message||"An error occurred"}finally{g.value="",D.value&&n.editor.commands.disableTrackChanges(),m.value=!1,v.value=!1}},N=A=>{A.key==="Enter"&&!A.shiftKey&&(A.preventDefault(),oe())},H=A=>{y.value&&(y.value=""),g.value=A.target.value};return(A,J)=>(w.openBlock(),w.createElementBlock("div",{class:"ai-writer prosemirror-isolated",ref_key:"aiWriterRef",ref:i,onMousedown:J[1]||(J[1]=w.withModifiers(()=>{},["stop"]))},[w.createBaseVNode("div",iV,[w.createBaseVNode("span",{class:"ai-textarea-icon",innerHTML:w.unref(rV)},null,8,sV),w.withDirectives(w.createBaseVNode("textarea",{ref_key:"editableRef",ref:a,class:"ai-textarea",placeholder:h.value,onKeydown:N,onInput:H,"onUpdate:modelValue":J[0]||(J[0]=ie=>g.value=ie),rows:"4"},null,40,aV),[[w.vModelText,g.value]])]),w.createBaseVNode("div",lV,[g.value?(w.openBlock(),w.createElementBlock("span",{key:0,class:"ai-textarea-icon ai-submit-button",onClick:w.withModifiers(oe,["stop"]),innerHTML:w.unref(oV)},null,8,cV)):w.createCommentVNode("",!0)])],544))}},rS=ft(uV,[["__scopeId","data-v-4cf86e1f"]]);async function dV(t,e){const n=new Ld;return t.forEach((r,o)=>{n.file(e[o],r)}),await n.generateAsync({type:"blob"})}var pV=Object.defineProperty,oS=t=>{throw TypeError(t)},fV=(t,e,n)=>e in t?pV(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,rb=(t,e,n)=>fV(t,typeof e!="symbol"?e+"":e,n),iS=(t,e,n)=>e.has(t)||oS("Cannot "+n),yd=(t,e,n)=>(iS(t,e,"read from private field"),n?n.call(t):e.get(t)),ob=(t,e,n)=>e.has(t)?oS("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),rn=(t,e,n)=>(iS(t,e,"access private method"),n),sS={exports:{}};(function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function o(l,c,u){this.fn=l,this.context=c,this.once=u||!1}function i(l,c,u,d,p){if(typeof u!="function")throw new TypeError("The listener must be a function");var f=new o(u,d||l,p),h=n?n+c:c;return l._events[h]?l._events[h].fn?l._events[h]=[l._events[h],f]:l._events[h].push(f):(l._events[h]=f,l._eventsCount++),l}function s(l,c){--l._eventsCount===0?l._events=new r:delete l._events[c]}function a(){this._events=new r,this._eventsCount=0}a.prototype.eventNames=function(){var l=[],c,u;if(this._eventsCount===0)return l;for(u in c=this._events)e.call(c,u)&&l.push(n?u.slice(1):u);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(c)):l},a.prototype.listeners=function(l){var c=n?n+l:l,u=this._events[c];if(!u)return[];if(u.fn)return[u.fn];for(var d=0,p=u.length,f=new Array(p);d<p;d++)f[d]=u[d].fn;return f},a.prototype.listenerCount=function(l){var c=n?n+l:l,u=this._events[c];return u?u.fn?1:u.length:0},a.prototype.emit=function(l,c,u,d,p,f){var h=n?n+l:l;if(!this._events[h])return!1;var m=this._events[h],y=arguments.length,g,v;if(m.fn){switch(m.once&&this.removeListener(l,m.fn,void 0,!0),y){case 1:return m.fn.call(m.context),!0;case 2:return m.fn.call(m.context,c),!0;case 3:return m.fn.call(m.context,c,u),!0;case 4:return m.fn.call(m.context,c,u,d),!0;case 5:return m.fn.call(m.context,c,u,d,p),!0;case 6:return m.fn.call(m.context,c,u,d,p,f),!0}for(v=1,g=new Array(y-1);v<y;v++)g[v-1]=arguments[v];m.fn.apply(m.context,g)}else{var k=m.length,b;for(v=0;v<k;v++)switch(m[v].once&&this.removeListener(l,m[v].fn,void 0,!0),y){case 1:m[v].fn.call(m[v].context);break;case 2:m[v].fn.call(m[v].context,c);break;case 3:m[v].fn.call(m[v].context,c,u);break;case 4:m[v].fn.call(m[v].context,c,u,d);break;default:if(!g)for(b=1,g=new Array(y-1);b<y;b++)g[b-1]=arguments[b];m[v].fn.apply(m[v].context,g)}}return!0},a.prototype.on=function(l,c,u){return i(this,l,c,u,!1)},a.prototype.once=function(l,c,u){return i(this,l,c,u,!0)},a.prototype.removeListener=function(l,c,u,d){var p=n?n+l:l;if(!this._events[p])return this;if(!c)return s(this,p),this;var f=this._events[p];if(f.fn)f.fn===c&&(!d||f.once)&&(!u||f.context===u)&&s(this,p);else{for(var h=0,m=[],y=f.length;h<y;h++)(f[h].fn!==c||d&&!f[h].once||u&&f[h].context!==u)&&m.push(f[h]);m.length?this._events[p]=m.length===1?m[0]:m:s(this,p)}return this},a.prototype.removeAllListeners=function(l){var c;return l?(c=n?n+l:l,this._events[c]&&s(this,c)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,t.exports=a})(sS);var hV=sS.exports;const mV=Wl(hV);function gV(t){let e=t;for(;e;){const n=window.getComputedStyle(e).overflowY;if(/(auto|scroll)/.test(n)&&e.scrollHeight>e.clientHeight)return e;e=e.parentElement}return document.scrollingElement||document.documentElement}function yV(t,e={behavior:"smooth",block:"start"}){if(!t)return;const n=gV(t),r=n.getBoundingClientRect(),o=t.getBoundingClientRect().top-r.top+n.scrollTop;n.scrollTo({top:e.block==="start"?o:o-n.clientHeight+t.offsetHeight,behavior:e.behavior})}const Ve=t=>{if(!["button","options","separator","dropdown","overflow"].includes(t.type))throw new Error("Invalid toolbar item type - "+t.type);if(t.type==="button"&&!t.defaultLabel&&!t.icon)throw new Error("Toolbar button item needs either icon or label - "+t.name);if(!t.name)throw new Error("Invalid toolbar item name - "+t.name);const e=w.ref(Lr()),n=t.type,r=w.ref(t.name),o=t.command,i=t.noArgumentCommand,s=w.ref(t.icon),a=w.ref(t.group||"center"),l=w.ref(t.allowWithoutEditor),c=w.ref(t.attributes||{}),u=t.disabled||!1,d=w.ref(t.disabled),p=w.ref(!1),f=w.ref(!1),h=w.ref(t.style),m=w.ref(t.isNarrow),y=w.ref(t.isWide),g=w.ref(t.minWidth),v=w.ref(t.suppressActiveHighlight||!1),k=w.ref(t.argument),b=w.ref(null),C=w.ref(null),D=w.ref(t.iconColor),M=w.ref(t.hasCaret),I=w.ref(t.dropdownStyles),E=w.ref(t.tooltip),G=w.ref(t.tooltipVisible),oe=w.ref(t.tooltipTimeout),N=w.ref(t.defaultLabel),H=w.ref(t.label),A=w.ref(t.hideLabel),J=w.ref(t.inlineTextInputVisible),ie=w.ref(t.hasInlineTextInput),W=w.ref(t.markName),ce=w.ref(t.labelAttr),X=w.ref(t.selectedValue),ue=w.ref(t.dropdownValueKey),Z=w.ref(t.inputRef||null),R=w.ref([]);if(t.options){if(!Array.isArray(t.options))throw new Error("Invalid toolbar item options - "+t.options);R.value.push(...t.options)}const ee=F=>{$(F),!v.value&&(p.value=!0)},ne=()=>{T(),p.value=!1},se=F=>{d.value=F},Y=()=>{d.value=u},$=t.onActivate||(()=>null),T=t.onDeactivate||(()=>null),K=()=>{const F={};return Object.keys(q).forEach(L=>{q[L].value!==void 0&&(F[L]=q[L].value)}),F},q={id:e,name:r,type:n,command:o,noArgumentCommand:i,icon:s,tooltip:E,group:a,attributes:c,disabled:d,active:p,expand:f,nestedOptions:R,style:h,isNarrow:m,isWide:y,minWidth:g,argument:k,parentItem:C,iconColor:D,hasCaret:M,dropdownStyles:I,tooltipVisible:G,tooltipTimeout:oe,defaultLabel:N,label:H,hideLabel:A,inlineTextInputVisible:J,hasInlineTextInput:ie,markName:W,labelAttr:ce,childItem:b,allowWithoutEditor:l,dropdownValueKey:ue,selectedValue:X,inputRef:Z};return{...q,unref:K,activate:ee,deactivate:ne,setDisabled:se,resetDisabled:Y,onActivate:$,onDeactivate:T}},wV={class:"alignment-buttons"},bV=["innerHTML"],vV=["innerHTML"],xV=["innerHTML"],kV=["innerHTML"],SV={__name:"AlignmentButtons",emits:["select"],setup(t,{emit:e}){const n=e,r=o=>{n("select",o)};return(o,i)=>(w.openBlock(),w.createElementBlock("div",wV,[w.createBaseVNode("div",{class:"button-icon",onClick:i[0]||(i[0]=s=>r("left")),innerHTML:w.unref(ln).alignLeft,"data-item":"btn-textAlign-option"},null,8,bV),w.createBaseVNode("div",{class:"button-icon",onClick:i[1]||(i[1]=s=>r("center")),innerHTML:w.unref(ln).alignCenter,"data-item":"btn-textAlign-option"},null,8,vV),w.createBaseVNode("div",{class:"button-icon",onClick:i[2]||(i[2]=s=>r("right")),innerHTML:w.unref(ln).alignRight,"data-item":"btn-textAlign-option"},null,8,xV),w.createBaseVNode("div",{class:"button-icon",onClick:i[3]||(i[3]=s=>r("justify")),innerHTML:w.unref(ln).alignJustify,"data-item":"btn-textAlign-option"},null,8,kV)]))}},AV=ft(SV,[["__scopeId","data-v-932a4937"]]),CV={class:"link-input-ctn"},EV={key:0,class:"link-title"},TV={key:1,class:"link-title"},$V={key:2,class:"link-title"},OV={key:3},MV={class:"input-row"},DV=["innerHTML"],_V=["onKeydown"],NV=["innerHTML"],IV={class:"input-row link-buttons"},FV=["innerHTML"],RV={key:4,class:"input-row go-to-anchor clickable"},BV={__name:"LinkInput",props:{initialText:{type:String,default:""},href:{type:String,default:""},showInput:{type:Boolean,default:!0},showLink:{type:Boolean,default:!0},goToAnchor:{type:Function,default:()=>{}}},emits:["submit","cancel"],setup(t,{emit:e}){const n=e,r=t,{proxy:o}=w.getCurrentInstance(),i=()=>{if(o?.$submit instanceof Function&&o.$submit(),c.value&&d.value){n("submit",{text:l.value,href:u.value});return}else if(!c.value){n("submit",{text:l.value,href:null});return}console.debug("[LinkInput] Invalid URL in handleSubmit"),a.value=!0},s=()=>{n("submit",{text:l.value,href:null})},a=w.ref(!1),l=w.ref(r.initialText),c=w.ref(r.href),u=w.computed(()=>c.value?.startsWith("http")?c.value:"http://"+c.value),d=w.computed(()=>{const k=u.value.split(".").filter(Boolean);return u.value.includes(".")&&k.length>1}),p=w.computed(()=>h.value?"Apply":"Remove"),f=w.computed(()=>!d.value),h=w.computed(()=>!m.value),m=w.computed(()=>r.href&&!c.value),y=w.computed(()=>r.href.startsWith("#")),g=()=>{window.open(u.value,"_blank")};w.watch(()=>r.href,k=>{c.value=k});const v=()=>{const k=document.querySelector(".link-input-ctn input");k&&k.focus()};return w.onMounted(()=>{r.showInput&&v()}),(k,b)=>(w.openBlock(),w.createElementBlock("div",CV,[t.href?y.value?(w.openBlock(),w.createElementBlock("div",TV,"Page anchor")):(w.openBlock(),w.createElementBlock("div",$V,"Edit link")):(w.openBlock(),w.createElementBlock("div",EV,"Add link")),t.showInput&&!y.value?(w.openBlock(),w.createElementBlock("div",OV,[w.createBaseVNode("div",MV,[w.createBaseVNode("div",{class:"input-icon",innerHTML:w.unref(ln).linkInput},null,8,DV),w.withDirectives(w.createBaseVNode("input",{type:"text",placeholder:"Type or paste a link",class:w.normalizeClass({error:a.value}),"onUpdate:modelValue":b[0]||(b[0]=C=>c.value=C),onKeydown:[w.withKeys(w.withModifiers(i,["stop","prevent"]),["enter"]),b[1]||(b[1]=C=>a.value=!1)]},null,42,_V),[[w.vModelText,c.value]]),w.createBaseVNode("div",{class:w.normalizeClass(["open-link-icon",{disabled:!d.value}]),innerHTML:w.unref(ln).openLink,onClick:g,"data-item":"btn-link-open"},null,10,NV)]),w.createBaseVNode("div",IV,[t.href?(w.openBlock(),w.createElementBlock("button",{key:0,class:"remove-btn",onClick:s,"data-item":"btn-link-remove"},[w.createBaseVNode("div",{class:"remove-btn__icon",innerHTML:w.unref(ln).removeLink},null,8,FV),b[3]||(b[3]=w.createTextVNode(" Remove "))])):w.createCommentVNode("",!0),h.value?(w.openBlock(),w.createElementBlock("button",{key:1,class:w.normalizeClass(["submit-btn",{"disable-btn":f.value}]),onClick:i,"data-item":"btn-link-apply"},w.toDisplayString(p.value),3)):w.createCommentVNode("",!0)])])):y.value?(w.openBlock(),w.createElementBlock("div",RV,[w.createBaseVNode("a",{onClick:b[2]||(b[2]=w.withModifiers((...C)=>t.goToAnchor&&t.goToAnchor(...C),["stop","prevent"]))},"Go to "+w.toDisplayString(t.href.startsWith("#_")?t.href.substring(2):t.href),1)])):w.createCommentVNode("",!0)]))}},LV=ft(BV,[["__scopeId","data-v-04bac853"]]),PV={class:"document-mode"},zV=["onClick"],jV={class:"document-mode-column icon-column"},qV=["innerHTML"],VV={class:"document-mode-column text-column"},UV={class:"document-mode-type"},HV={class:"document-mode-description"},WV={__name:"DocumentMode",props:{options:{type:Array}},emits:["select"],setup(t,{emit:e}){const n=e,r=o=>{n("select",o)};return(o,i)=>(w.openBlock(),w.createElementBlock("div",PV,[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(t.options,s=>(w.openBlock(),w.createElementBlock("div",{class:w.normalizeClass(["option-item",{disabled:s.disabled}]),onClick:a=>r(s),"data-item":"btn-documentMode-option"},[w.createBaseVNode("div",jV,[w.createBaseVNode("div",{class:"icon-column__icon",innerHTML:s.icon},null,8,qV)]),w.createBaseVNode("div",VV,[w.createBaseVNode("div",UV,w.toDisplayString(s.label),1),w.createBaseVNode("div",HV,w.toDisplayString(s.description),1)])],10,zV))),256))]))}},GV=ft(WV,[["__scopeId","data-v-8afd7fbb"]]),KV={key:0,class:"linked-style-buttons"},JV=["onClick"],XV={__name:"LinkedStyle",props:{editor:{type:Object,required:!0},selectedOption:{type:String}},emits:["select"],setup(t,{emit:e}){const n=e,r=t,o=i=>{n("select",i)};return(i,s)=>r.editor?(w.openBlock(),w.createElementBlock("div",KV,[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(w.unref(Bx)(t.editor),a=>(w.openBlock(),w.createElementBlock("div",{class:w.normalizeClass(["style-item",{selected:t.selectedOption===a.id}]),onClick:l=>o(a)},[w.createBaseVNode("div",{class:"style-name",style:w.normalizeStyle(w.unref(Rx)(a,null,!1)),"data-item":"btn-linkedStyles-option"},w.toDisplayString(a.definition.attrs.name),5)],10,JV))),256))])):w.createCommentVNode("",!0)}},YV=ft(XV,[["__scopeId","data-v-bf5a8c1e"]]),ZV=["onClick"],QV=["innerHTML"],eU=["innerHTML"],tU={__name:"IconGridRow",props:{icons:{type:Array,required:!0},activeColor:{type:Object,required:!1}},emits:["select"],setup(t,{emit:e}){const n=e,r=t,o=w.computed(()=>a=>r.activeColor.value?r.activeColor.value.toUpperCase()===a.value:!1),i=(a,l)=>l===5||["#FFFFFF","#FAFF09"].includes(a)?{color:"#000"}:{color:"#FFF"},s=a=>{n("select",a.value)};return w.onMounted(()=>{if(!r.icons.every(a=>Array.isArray(a)))throw new Error("icon props must be 2d array")}),(a,l)=>(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(t.icons,(c,u)=>(w.openBlock(),w.createElementBlock("div",{class:"option-row",key:u},[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(c,(d,p)=>(w.openBlock(),w.createElementBlock("div",{class:"option",key:p,onClick:w.withModifiers(f=>s(d),["stop","prevent"])},[w.createBaseVNode("div",{class:"option__icon",innerHTML:d.icon,style:w.normalizeStyle(d.style)},null,12,QV),o.value(d)?(w.openBlock(),w.createElementBlock("div",{key:0,class:"option__check",innerHTML:w.unref(ln).colorOptionCheck,style:w.normalizeStyle(i(d.value,p))},null,12,eU)):w.createCommentVNode("",!0)],8,ZV))),128))]))),128))}},ib=ft(tU,[["__scopeId","data-v-6a2a9a40"]]),nU=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M320 512c53.2 0 101.4-21.6 136.1-56.6l-298.3-235C140 257.1 128 292.3 128 320c0 106 86 192 192 192zM505.2 370.7c4.4-16.2 6.8-33.1 6.8-50.7c0-91.2-130.2-262.3-166.6-308.3C339.4 4.2 330.5 0 320.9 0l-1.8 0c-9.6 0-18.5 4.2-24.5 11.7C277.8 33 240.7 81.3 205.8 136L38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L505.2 370.7zM224 336c0 44.2 35.8 80 80 80c8.8 0 16 7.2 16 16s-7.2 16-16 16c-61.9 0-112-50.1-112-112c0-8.8 7.2-16 16-16s16 7.2 16 16z"/></svg>
451
+ `,rU={class:"options-grid-wrap"},oU=["innerHTML"],iU={class:"option-grid-ctn"},sU={__name:"IconGrid",props:{icons:{type:Array,required:!0},customIcons:{type:Array,required:!1},activeColor:{type:Object,required:!1},hasNoneIcon:{type:Boolean,required:!1}},emits:["select","clickoutside"],setup(t,{emit:e}){const n=e,r=o=>{n("select",o)};return(o,i)=>(w.openBlock(),w.createElementBlock("div",rU,[t.hasNoneIcon?(w.openBlock(),w.createElementBlock("div",{key:0,class:"none-option",onClick:i[0]||(i[0]=s=>r("none"))},[w.createBaseVNode("span",{innerHTML:w.unref(nU),class:"none-icon"},null,8,oU),i[1]||(i[1]=w.createTextVNode(" None "))])):w.createCommentVNode("",!0),w.createBaseVNode("div",iU,[w.createVNode(ib,{icons:t.icons,"active-color":t.activeColor,onSelect:r},null,8,["icons","active-color"]),t.customIcons.flat().length?(w.openBlock(),w.createElementBlock(w.Fragment,{key:0},[i[2]||(i[2]=w.createBaseVNode("span",{class:"option-grid-ctn__subtitle"},"Custom colors",-1)),w.createVNode(ib,{icons:t.customIcons,"active-color":t.activeColor,onSelect:r},null,8,["icons","active-color"])],64)):w.createCommentVNode("",!0)])]))}},aU=ft(sU,[["__scopeId","data-v-47b783db"]]),lU=t=>{t.expand.value=!1},$e=(t,e=null)=>({label:e,icon:ln.colorOption,value:t,style:{color:t,boxShadow:"0 0 5px 1px rgba(0, 0, 0, 0.1)",borderRadius:"50%"}}),Vp=(t,e,n=[],r=!1)=>{const o=i=>{e.iconColor.value=i,t.emitCommand({item:e,argument:i}),lU(e)};return w.h("div",{},[w.h(aU,{icons:aS,customIcons:n,activeColor:e.iconColor,hasNoneIcon:r,onSelect:o})])},aS=[[$e("#111111"),$e("#333333"),$e("#5C5C5C"),$e("#858585"),$e("#ADADAD"),$e("#D6D6D6"),$e("#FFFFFF")],[$e("#860028"),$e("#D2003F"),$e("#DB3365"),$e("#E4668C"),$e("#ED99B2"),$e("#F6CCD9"),$e("#FF004D")],[$e("#83015E"),$e("#CD0194"),$e("#D734A9"),$e("#E167BF"),$e("#EB99D4"),$e("#F5CCEA"),$e("#FF00A8")],[$e("#8E220A"),$e("#DD340F"),$e("#E45C3F"),$e("#EB856F"),$e("#F1AE9F"),$e("#F8D6CF"),$e("#FF7A00")],[$e("#947D02"),$e("#E7C302"),$e("#ECCF35"),$e("#F1DB67"),$e("#F5E79A"),$e("#FAF3CC"),$e("#FAFF09")],[$e("#055432"),$e("#07834F"),$e("#399C72"),$e("#6AB595"),$e("#9CCDB9"),$e("#CDE6DC"),$e("#05F38F")],[$e("#063E7E"),$e("#0A60C5"),$e("#3B80D1"),$e("#6CA0DC"),$e("#9DBFE8"),$e("#CEDFF3"),$e("#21c8ce")],[$e("#3E027A"),$e("#6103BF"),$e("#8136CC"),$e("#A068D9"),$e("#C09AE6"),$e("#DFCDF2"),$e("#A91DFF")]],cU=()=>aS.flat().map(t=>t.value),uU={class:"toolbar-table-grid-wrapper"},dU=["data-cols","data-rows","onClick"],pU={class:"toolbar-table-grid-value"},fU={__name:"TableGrid",emits:["select","clickoutside"],setup(t,{emit:e}){const n=e,r=w.ref(0),o=w.ref(0),i=a=>{let l=a.target;if(l.dataset.grid)return;let c=[...l.parentElement.querySelectorAll("[data-item]")],u=parseInt(l.dataset.cols,10),d=parseInt(l.dataset.rows,10);o.value=u,r.value=d;for(let p=0;p<c.length;p++){let f=c[p],h=parseInt(f.dataset.cols,10),m=parseInt(f.dataset.rows,10);h<=u&&m<=d?f.classList.add("selected"):f.classList.remove("selected")}},s=({cols:a,rows:l})=>{n("select",{cols:a,rows:l})};return(a,l)=>(w.openBlock(),w.createElementBlock("div",uU,[w.createBaseVNode("div",{class:"toolbar-table-grid",onMouseover:i,"data-grid":"true"},[(w.openBlock(),w.createElementBlock(w.Fragment,null,w.renderList(5,c=>(w.openBlock(),w.createElementBlock(w.Fragment,{key:c},[(w.openBlock(),w.createElementBlock(w.Fragment,null,w.renderList(5,u=>w.createBaseVNode("div",{class:"toolbar-table-grid__item",key:`${c}_${u}`,"data-cols":u,"data-rows":c,"data-item":"true",onClick:w.withModifiers(d=>s({cols:u,rows:c}),["stop","prevent"])},null,8,dU)),64))],64))),64))],32),w.createBaseVNode("div",pU,w.toDisplayString(r.value)+" x "+w.toDisplayString(o.value),1)]))}},hU=ft(fU,[["__scopeId","data-v-06352ab9"]]),mU={class:"toolbar-table-actions"},gU=["onClick","data-item"],yU={class:"toolbar-table-actions__icon"},wU=["innerHTML"],bU={class:"toolbar-table-actions__label"},vU={__name:"TableActions",props:{options:{type:Array}},emits:["select"],setup(t,{emit:e}){const n=e,r=o=>{n("select",{command:o.command})};return(o,i)=>(w.openBlock(),w.createElementBlock("div",mU,[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(t.options,s=>(w.openBlock(),w.createElementBlock("div",{class:w.normalizeClass(["toolbar-table-actions__item",{"toolbar-table-actions__item--border":s.bottomBorder}]),onClick:a=>r(s),"data-item":s.props?.["data-item"]||""},[w.createBaseVNode("div",yU,[w.createBaseVNode("div",{class:"toolbar-table-actions__icon-wrapper",innerHTML:s.icon},null,8,wU)]),w.createBaseVNode("div",bU,w.toDisplayString(s.label),1)],10,gU))),256))]))}},xU=ft(vU,[["__scopeId","data-v-fdbfb4b0"]]),kU=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"/></svg>
452
+ `,SU={class:"search-input-ctn"},AU={class:"row"},CU=["onKeydown"],EU={__name:"SearchInput",props:{searchRef:{type:Object}},emits:["submit"],setup(t,{emit:e}){const n=w.ref(""),r=e,o=()=>{r("submit",{value:n.value})};return(i,s)=>(w.openBlock(),w.createElementBlock("div",SU,[w.createBaseVNode("div",AU,[w.withDirectives(w.createBaseVNode("input",{ref:t.searchRef,"onUpdate:modelValue":s[0]||(s[0]=a=>n.value=a),class:"search-input",type:"text",name:"search",placeholder:"Type search string",onKeydown:w.withKeys(w.withModifiers(o,["stop","prevent"]),["enter"])},null,40,CU),[[w.vModelText,n.value]])]),w.createBaseVNode("div",{class:"row submit"},[w.createBaseVNode("button",{class:"submit-btn",onClick:o}," Apply ")])]))}},TU=ft(EU,[["__scopeId","data-v-af870fbd"]]),$U=[{label:"Georgia",key:"Georgia, serif",fontWeight:400,props:{style:{fontFamily:"Georgia, serif"},"data-item":"btn-fontFamily-option"}},{label:"Arial",key:"Arial, sans-serif",fontWeight:400,props:{style:{fontFamily:"Arial, sans-serif"},"data-item":"btn-fontFamily-option"}},{label:"Courier New",key:"Courier New, monospace",fontWeight:400,props:{style:{fontFamily:"Courier New, monospace"},"data-item":"btn-fontFamily-option"}},{label:"Times New Roman",key:"Times New Roman, serif",fontWeight:400,props:{style:{fontFamily:"Times New Roman, serif"},"data-item":"btn-fontFamily-option"}}],mr=t=>{t.expand.value=!1},OU=({superToolbar:t,toolbarIcons:e,toolbarFonts:n,hideButtons:r,availableWidth:o,role:i,isDev:s=!1}={})=>{const a=Ve({type:"button",name:"bold",command:"toggleBold",icon:e.bold,tooltip:"Bold"}),l=Ve({type:"dropdown",name:"fontFamily",tooltip:"Font",command:"setFontFamily",defaultLabel:"Arial",label:"Arial",markName:"textStyle",labelAttr:"fontFamily",hasCaret:!0,isWide:!0,style:{width:"116px"},suppressActiveHighlight:!0,options:[...n||$U],onActivate:({fontFamily:P})=>{P&&(l.label.value=P)},onDeactivate:()=>l.label.value=l.defaultLabel.value}),c=Ve({type:"dropdown",dropdownStyles:{padding:0,outline:"none"},name:"ai",tooltip:"AI text generation",icon:e.ai,hideLabel:!0,hasCaret:!1,isWide:!0,suppressActiveHighlight:!0,options:[{type:"render",key:"ai",render:()=>{let P="";if(t.activeEditor){const{state:B}=t.activeEditor,{from:U,to:te,empty:ge}=B.selection;P=ge?"":B.doc.textBetween(U,te)}return w.h("div",{},[w.h(rS,{handleClose:()=>{mr(c)},selectedText:P,editor:t.activeEditor,apiKey:t.config.aiApiKey,endpoint:t.config.aiEndpoint,superToolbar:t})])}}]}),u=Ve({type:"dropdown",name:"fontSize",defaultLabel:"12",label:"12",minWidth:"50px",markName:"textStyle",labelAttr:"fontSize",tooltip:"Font size",hasCaret:!0,hasInlineTextInput:!1,inlineTextInputVisible:!0,suppressActiveHighlight:!0,isWide:!0,command:"setFontSize",options:[{label:"8",key:"8pt",props:{"data-item":"btn-fontSize-option"}},{label:"9",key:"9pt",props:{"data-item":"btn-fontSize-option"}},{label:"10",key:"10pt",props:{"data-item":"btn-fontSize-option"}},{label:"11",key:"11pt",props:{"data-item":"btn-fontSize-option"}},{label:"12",key:"12pt",props:{"data-item":"btn-fontSize-option"}},{label:"14",key:"14pt",props:{"data-item":"btn-fontSize-option"}},{label:"18",key:"18pt",props:{"data-item":"btn-fontSize-option"}},{label:"24",key:"24pt",props:{"data-item":"btn-fontSize-option"}},{label:"30",key:"30pt",props:{"data-item":"btn-fontSize-option"}},{label:"36",key:"36pt",props:{"data-item":"btn-fontSize-option"}},{label:"48",key:"48pt",props:{"data-item":"btn-fontSize-option"}},{label:"60",key:"60pt",props:{"data-item":"btn-fontSize-option"}},{label:"72",key:"72pt",props:{"data-item":"btn-fontSize-option"}},{label:"96",key:"96pt",props:{"data-item":"btn-fontSize-option"}}],onActivate:({fontSize:P})=>{if(!P)return u.label.value=u.defaultLabel.value;let B=SR(P,12);B<8&&(B=8),B>96&&(B=96),u.label.value=String(B)},onDeactivate:()=>u.label.value=u.defaultLabel.value}),d=Ve({type:"separator",name:"separator",isNarrow:!0}),p=Ve({type:"button",name:"italic",command:"toggleItalic",icon:e.italic,tooltip:"Italic"}),f=Ve({type:"button",name:"underline",command:"toggleUnderline",icon:e.underline,tooltip:"Underline"}),h=Ve({type:"dropdown",name:"highlight",icon:e.highlight,hideLabel:!0,markName:"highlight",labelAttr:"color",tooltip:"Highlight color",command:"setHighlight",noArgumentCommand:"unsetHighlight",suppressActiveHighlight:!0,options:[{key:"color",type:"render",render:()=>Vp(t,h,[],!0)}],onActivate:({color:P})=>{h.iconColor.value=P||""},onDeactivate:()=>h.iconColor.value=""}),m=Ve({type:"dropdown",name:"color",icon:e.color,hideLabel:!0,markName:"textStyle",labelAttr:"color",tooltip:"Text color",command:"setColor",suppressActiveHighlight:!0,options:[{key:"color",type:"render",render:()=>Vp(t,m)}],onActivate:({color:P})=>{m.iconColor.value=P},onDeactivate:()=>m.iconColor.value="#000"}),y=w.ref(null),g=Ve({type:"dropdown",name:"search",icon:e.search,tooltip:"Search",group:"right",inputRef:y,options:[{type:"render",key:"searchDropdown",render:()=>v()}]}),v=()=>w.h("div",{},[w.h(TU,{onSubmit:({value:P})=>{t.activeEditor.commands.search(P)},searchRef:y})]),k=Ve({type:"dropdown",name:"link",markName:"link",icon:e.link,tooltip:"Link",options:[{type:"render",key:"linkDropdown",render:()=>b(k)}],onActivate:({href:P})=>{P?k.attributes.value={href:P}:k.attributes.value={},k.expand.value=!0},onDeactivate:()=>{k.attributes.value={},k.expand.value=!1}});function b(P){return w.h("div",{},[w.h(LV,{onSubmit:({href:B})=>{mr(P),P.attributes.value.link={href:B};const U={...P,command:"toggleLink"};t.emitCommand({item:U,argument:{href:B,text:""}}),B||(P.active.value=!1)},href:P.attributes.value.href,goToAnchor:()=>{if(mr(P),!t.activeEditor||!P.attributes.value?.href)return;const B=P.attributes.value?.href?.slice(1),U=t.activeEditor.element.querySelector(`a[name='${B}']`);U&&yV(U)}})])}const C=Ve({type:"options",name:"linkInput",command:"toggleLink"});k.childItem=C,C.parentItem=k;const D=Ve({type:"button",name:"image",command:"startImageUpload",icon:e.image,tooltip:"Image",disabled:!1}),M=Ve({type:"dropdown",name:"table",icon:e.table,hideLabel:!0,labelAttr:"table",tooltip:"Insert table",command:"insertTable",suppressActiveHighlight:!0,options:[{key:"table",type:"render",render:()=>I(M)}]});function I(P){return w.h("div",{},[w.h(hU,{onSelect:B=>{t.emitCommand({item:P,argument:B}),mr(P)}})])}const E=Ve({type:"dropdown",name:"tableActions",command:"executeTableCommand",icon:e.tableActions,hideLabel:!0,disabled:!0,options:[{type:"render",render:()=>oe(E)}]}),G=[{label:"Insert row above",command:"addRowBefore",icon:e.addRowBefore,props:{"data-item":"btn-tableActions-option"}},{label:"Insert row below",command:"addRowAfter",icon:e.addRowAfter,props:{"data-item":"btn-tableActions-option"}},{label:"Insert column left",command:"addColumnBefore",icon:e.addColumnBefore,props:{"data-item":"btn-tableActions-option"}},{label:"Insert column right",command:"addColumnAfter",icon:e.addColumnAfter,bottomBorder:!0,props:{"data-item":"btn-tableActions-option"}},{label:"Delete row",command:"deleteRow",icon:e.deleteRow,props:{"data-item":"btn-tableActions-option"}},{label:"Delete column",command:"deleteColumn",icon:e.deleteColumn,props:{"data-item":"btn-tableActions-option"}},{label:"Delete table",command:"deleteTable",icon:e.deleteTable,props:{"data-item":"btn-tableActions-option"}},{label:"Transparent borders",command:"deleteCellAndTableBorders",icon:e.deleteBorders,bottomBorder:!0,props:{"data-item":"btn-tableActions-option"}},{label:"Merge cells",command:"mergeCells",icon:e.mergeCells,props:{"data-item":"btn-tableActions-option"}},{label:"Split cell",command:"splitCell",icon:e.splitCell,props:{"data-item":"btn-tableActions-option"}},{label:"Fix tables",command:"fixTables",icon:e.fixTables,props:{"data-item":"btn-tableActions-option"}}];function oe(P){return w.h(xU,{options:G,onSelect:B=>{mr(P);const{command:U}=B;t.emitCommand({item:P,argument:{command:U}})}})}const N=Ve({type:"dropdown",name:"textAlign",tooltip:"Alignment",icon:e.alignLeft,command:"setTextAlign",hasCaret:!0,markName:"textAlign",labelAttr:"textAlign",suppressActiveHighlight:!0,options:[{type:"render",render:()=>w.h("div",{},[w.h(AV,{onSelect:P=>{mr(N);const B={...N,command:"setTextAlign"};B.command="setTextAlign",t.emitCommand({item:B,argument:P}),H(N,P)}})]),key:"alignment"}],onActivate:({textAlign:P})=>{H(N,P)},onDeactivate:()=>{H(N,"left")}}),H=(P,B)=>{let U=B==="both"?"justify":B,te={left:e.alignLeft,right:e.alignRight,center:e.alignCenter,justify:e.alignJustify},ge=te[U]??te.left;P.icon.value=ge},A=Ve({type:"button",name:"list",command:"toggleBulletList",icon:e.bulletList,tooltip:"Bullet list"}),J=Ve({type:"button",name:"numberedlist",command:"toggleOrderedList",icon:e.numberedList,tooltip:"Numbered list"}),ie=Ve({type:"button",name:"indentleft",command:"decreaseTextIndent",icon:e.indentLeft,tooltip:"Left indent",disabled:!1}),W=Ve({type:"button",name:"indentright",command:"increaseTextIndent",icon:e.indentRight,tooltip:"Right indent",disabled:!1}),ce=Ve({type:"overflow",name:"overflow",command:"toggleOverflow",icon:e.overflow,disabled:!1}),X=Ve({type:"dropdown",name:"zoom",allowWithoutEditor:!0,tooltip:"Zoom",defaultLabel:"100%",label:"100%",hasCaret:!0,command:"setZoom",isWide:!0,inlineTextInputVisible:!1,hasInlineTextInput:!0,options:[{label:"50%",key:.5,props:{"data-item":"btn-zoom-option"}},{label:"75%",key:.75,props:{"data-item":"btn-zoom-option"}},{label:"90%",key:.9,props:{"data-item":"btn-zoom-option"}},{label:"100%",key:1,props:{"data-item":"btn-zoom-option"}},{label:"125%",key:1.25,props:{"data-item":"btn-zoom-option"}},{label:"150%",key:1.5,props:{"data-item":"btn-zoom-option"}},{label:"200%",key:2,props:{"data-item":"btn-zoom-option"}}],onActivate:({zoom:P})=>{P&&(X.label.value=P)}}),ue=Ve({type:"button",name:"undo",disabled:!0,tooltip:"Undo",command:"undo",icon:e.undo,group:"left",onDeactivate:()=>{ue.disabled.value=!t.undoDepth}}),Z=Ve({type:"button",disabled:!0,name:"redo",tooltip:"Redo",command:"redo",icon:e.redo,group:"left",onDeactivate:()=>{Z.disabled.value=!t.redoDepth}}),R=Ve({type:"button",disabled:!1,name:"toggleTrackChanges",tooltip:"Track Changes",command:"toggleTrackChanges",icon:e.trackChanges,group:"left"}),ee=Ve({type:"button",disabled:!1,name:"acceptTrackedChangeBySelection",tooltip:"Accept changes under selection",command:"acceptTrackedChangeBySelection",icon:e.trackChangesAccept,group:"left"}),ne=Ve({type:"button",disabled:!1,name:"rejectTrackedChangeOnSelection",tooltip:"Reject changes under selection",command:"rejectTrackedChangeOnSelection",icon:e.trackChangesReject,group:"left"}),se=Ve({type:"button",disabled:!1,name:"toggleTrackChangesShowOriginal",tooltip:"Toggle Show Original",command:"toggleTrackChangesShowOriginal",icon:e.trackChangesOriginal,group:"left"}),Y=Ve({type:"button",disabled:!1,name:"toggleTrackChangesShowFinal",tooltip:"Toggle Show Final",command:"toggleTrackChangesShowFinal",icon:e.trackChangesFinal,group:"left"}),$=Ve({type:"button",name:"clearFormatting",command:"clearFormat",tooltip:"Clear formatting",icon:e.clearFormatting});[a,p,f,W,ie,g,ce].map(P=>P.name);const T=Ve({type:"button",name:"copyFormat",tooltip:"Format painter",icon:e.copyFormat,command:"copyFormat"}),K=(P,B)=>P==="editor"?B:P==="suggester"?B.filter(U=>U.value==="suggesting"):B.filter(U=>U.value==="viewing"),q=P=>P==="editor"?"Editing":P==="suggester"?"Suggesting":"Viewing",F=Ve({type:"dropdown",name:"documentMode",command:"setDocumentMode",allowWithoutEditor:!0,icon:e.documentMode,defaultLabel:q(i),label:q(i),hasCaret:i==="editor",isWide:!0,style:{display:"flex",justifyContent:"flex-end"},inlineTextInputVisible:!1,hasInlineTextInput:!1,group:"right",disabled:i!=="editor",attributes:{dropdownPosition:"right",className:"toolbar-item--doc-mode"},options:[{type:"render",render:()=>le(F)}]}),L=[{label:"Editing",value:"editing",icon:e.documentEditingMode,description:"Edit document directly"},{label:"Suggesting",value:"suggesting",icon:e.documentSuggestingMode,description:"Edits become suggestions"},{label:"Viewing",value:"viewing",icon:e.documentViewingMode,description:"View clean version of document only"}];function le(P){const B=K(i,L);return w.h(GV,{options:B,onSelect:U=>{mr(P);const{label:te,icon:ge}=U;F.label.value=te,F.icon.value=ge,t.emitCommand({item:F,argument:te})}})}const S=Ve({type:"button",name:"pageBreakTool",command:"insertPageBreak",icon:e.pageBreak,tooltip:"Insert page break"}),re=new Map([["separator",20],["zoom",71],["fontFamily",118],["fontSize",57],["textAlign",40],["linkedStyles",142],["documentMode",47],["ai",32],["default",32]]),Q=Ve({type:"button",name:"ruler",command:"toggleRuler",icon:e.ruler,tooltip:"Show or hide ruler"}),z=w.ref(null),V=Ve({type:"dropdown",name:"linkedStyles",command:"setLinkedStyle",icon:e.paintbrush,defaultLabel:"Format text",label:"Format text",hasCaret:!0,isWide:!0,style:{width:"140px"},suppressActiveHighlight:!0,disabled:!1,attributes:{className:"toolbar-item--linked-styles"},options:[{type:"render",key:"linkedStyle",render:()=>{const P=B=>{mr(V);const U={...V,command:"setLinkedStyle"};t.emitCommand({item:U,argument:B}),z.value=B.id};return w.h("div",{},[w.h(YV,{editor:t.activeEditor,onSelect:P,selectedOption:z.value})])}}],onActivate:()=>{V.disabled.value=!1},onDeactivate:()=>{V.disabled.value=!0}}),j=(P,B)=>{if(B.value.toString()===P)return w.h("div",{innerHTML:kU,class:"dropdown-select-icon"})},de=Ve({type:"dropdown",name:"lineHeight",tooltip:"Line height",icon:e.lineHeight,hasCaret:!1,hasInlineTextInput:!1,inlineTextInputVisible:!1,suppressActiveHighlight:!0,isWide:!1,command:"setLineHeight",dropdownValueKey:"key",selectedValue:"1",options:[{label:"1,0",key:"1",icon:()=>j("1",de.selectedValue),props:{"data-item":"btn-lineHeight-option"}},{label:"1,15",key:"1.15",icon:()=>j("1.15",de.selectedValue),props:{"data-item":"btn-lineHeight-option"}},{label:"1,5",key:"1.5",icon:()=>j("1.5",de.selectedValue),props:{"data-item":"btn-lineHeight-option"}},{label:"2,0",key:"2",icon:()=>j("2",de.selectedValue),props:{"data-item":"btn-lineHeight-option"}},{label:"2,5",key:"2.5",icon:()=>j("2.5",de.selectedValue),props:{"data-item":"btn-lineHeight-option"}},{label:"3,0",key:"3",icon:()=>j("3",de.selectedValue),props:{"data-item":"btn-lineHeight-option"}}]}),fe={sm:768,md:1024,xl:1410},ae=120,me=32,we=["linkedStyles","clearFormatting","copyFormat","ruler"],he=["zoom","fontFamily","fontSize","redo"];let be=[ue,Z,ee,ne,X,l,d,u,d,a,p,f,m,h,d,k,D,M,E,d,N,A,J,ie,W,de,d,V,d,Q,S,T,$,c,ce,F];if(t.config?.superdoc?.config?.modules?.ai||(be=be.filter(P=>P.name.value!=="ai")),o<=fe.md&&r&&(be=be.filter(P=>P.type!=="separator")),t.config.pagination||(be=be.filter(P=>P.name.value!=="pageBreakTool")),t.config.mode!=="docx"){const P=be.findIndex(U=>U.name.value==="linkedStyles");be.splice(P-1,2);const B=["ruler","zoom","undo","redo"];be=be.filter(U=>!B.includes(U.name.value))}const ze=[R,se,Y];s||(i==="viewer"&&ze.push(ee,ne),be=be.filter(P=>!ze.includes(P)));const Ce=[g,ue,ce,F].map(P=>P.name),ct=P=>Ce.includes(P.name),x=[],O=[];let _=me+ae;return be.forEach(P=>{const B=re.get(P.name.value)||re.get("default");if(o<fe.xl&&we.includes(P.name.value)&&r){if(x.push(P),P.name.value==="linkedStyles"){const U=be.findIndex(te=>te.name.value==="linkedStyles");be.splice(U+1,1)}return}if(o<fe.sm&&he.includes(P.name.value)&&r){x.push(P);return}if(ct(P)){O.push(P),_+=B;return}_<o||!r?(O.push(P),_+=B):x.push(P)}),{defaultItems:O,overflowItems:x.filter(P=>P.type!=="separator")}},MU=[".jpg",".jpeg",".png","image/jpeg","image/png"],DU=()=>{let t=document.createElement("input");t.type="file";let e=MU;return t.accept=e.join(","),()=>new Promise((n,r)=>{t.onchange=async()=>{const o=t.files;if(!o)return n(null);const i=o.item(0);return n(i?{file:i}:null)},t.oncancel=()=>n(null),t.onerror=r,t.click()})},_U=t=>new Promise((e,n)=>{let r=new FileReader;r.onload=o=>e(o.target.result),r.onerror=n,setTimeout(()=>r.readAsDataURL(t),250)}),NU=(t,e)=>new Promise((n,r)=>{const o=new window.Image;o.onload=()=>{const i=document.createElement("canvas"),{width:s,height:a}=lS(o.width,o.height,e);if(i.width=s,i.height=a,i.getContext("2d").drawImage(o,0,0,s,a),typeof t=="string"){const l=i.toDataURL();n(l)}else i.toBlob(l=>{const c=new File([l],t.name,{type:t.type,lastModified:Date.now()});n({file:c,width:s,height:a})})},o.onerror=i=>r(i),o.src=typeof t=="string"?t:URL.createObjectURL(t)}),lS=(t,e,n)=>{const{width:r,height:o}=n.getMaxContentSize();if(!r||!o)return{width:t,height:e};let i=t,s=e;const a=t/e;return e>o&&(s=o,i=Math.round(o*a)),i>r&&(i=r,s=Math.round(r/a)),{width:i,height:s}},IU=async({editor:t,view:e,file:n})=>{let r=typeof t.options.handleImageUpload=="function"?t.options.handleImageUpload:_U;if((n.size/(1024*1024)).toFixed(4)>5){window.alert("Image size must be less than 5MB");return}let o,i;try{const u=await NU(n,t);o=u.width,i=u.height,n=u.file}catch(u){console.warn("Error processing image:",u);return}let s={},{tr:a,schema:l}=e.state;a.selection.empty||a.deleteSelection();let c={type:"add",pos:a.selection.from,id:s};a.setMeta(co,c),e.dispatch(a),r(n).then(u=>{let d=n.name.replace(" ","_"),p=oI(e.state,s);if(p==null)return;let f={type:"remove",id:s},h=`word/media/${d}`,m=l.nodes.image.create({src:h,size:{width:o,height:i}});t.storage.image.media=Object.assign(t.storage.image.media,{[h]:u}),t.options.ydoc&&t.commands.addImageToCollaboration({mediaPath:h,fileData:u}),e.dispatch(e.state.tr.replaceWith(p,p,m).setMeta(co,f))},()=>{let u={type:"remove",id:s};e.dispatch(a.setMeta(co,u))})};var Lt,cS,Xi,Up,uS,dS,Hp,pS,Ho;class FU extends mV{constructor(e){super(),ob(this,Lt),rb(this,"config",{selector:null,toolbarGroups:["left","center","right"],role:"editor",pagination:!1,icons:{...ln},fonts:null,hideButtons:!0,responsiveToContainer:!1,mode:"docx",excludeItems:[],groups:null,editor:null,aiApiKey:null,aiEndpoint:null,customButtons:[]}),ob(this,Xi,{setZoom:({item:n,argument:r})=>{if(!r)return;n.onActivate({zoom:r}),this.emit("superdoc-command",{item:n,argument:r});const o=document.querySelector(this.superdoc.config.selector)?.querySelector(".layers");if(!o)return;const i=typeof screen.orientation<"u",s=window.matchMedia("(max-width: 834px)").matches;i&&s?(o.style.transformOrigin="0 0",o.style.transform=`scale(${parseInt(r)/100})`):o.style.zoom=parseInt(r)/100,this.superdoc.superdocStore.activeZoom=parseInt(r)},setDocumentMode:({item:n,argument:r})=>{r&&this.emit("superdoc-command",{item:n,argument:r})},setFontSize:({item:n,argument:r})=>{rn(this,Lt,Ho).call(this,{item:n,argument:r},()=>{this.activeEditor?.commands.setFieldAnnotationsFontSize(r,!0)})},setFontFamily:({item:n,argument:r})=>{rn(this,Lt,Ho).call(this,{item:n,argument:r},()=>{this.activeEditor?.commands.setFieldAnnotationsFontFamily(r,!0)})},setColor:({item:n,argument:r})=>{rn(this,Lt,Ho).call(this,{item:n,argument:r},()=>{this.activeEditor?.commands.setFieldAnnotationsTextColor(r,!0)})},setHighlight:({item:n,argument:r})=>{rn(this,Lt,Ho).call(this,{item:n,argument:r,noArgumentCallback:!0},()=>{let o=r!=="none"?r:null;this.activeEditor?.commands.setFieldAnnotationsTextHighlight(o,!0),this.activeEditor?.commands.setCellBackground(o)})},toggleRuler:(n=null)=>{this.superdoc.toggleRuler()},startImageUpload:async(n=null)=>{let r=await DU()();r?.file&&IU({editor:this.activeEditor,view:this.activeEditor.view,file:r.file})},increaseTextIndent:({item:n,argument:r})=>{let o=n.command,{state:i}=this.activeEditor;if(Kt(s=>s.type.name==="listItem")(i.selection))return this.activeEditor.commands.increaseListIndent();o in this.activeEditor.commands&&this.activeEditor.commands[o](r)},decreaseTextIndent:({item:n,argument:r})=>{let o=n.command,{state:i}=this.activeEditor;if(Kt(s=>s.type.name==="listItem")(i.selection))return this.activeEditor.commands.decreaseListIndent();o in this.activeEditor.commands&&this.activeEditor.commands[o](r)},toggleBold:({item:n,argument:r})=>{let o=n.command;o in this.activeEditor.commands&&(this.activeEditor.commands[o](r),this.activeEditor.commands.toggleFieldAnnotationsFormat("bold",!0)),this.updateToolbarState()},toggleItalic:({item:n,argument:r})=>{let o=n.command;o in this.activeEditor.commands&&(this.activeEditor.commands[o](r),this.activeEditor.commands.toggleFieldAnnotationsFormat("italic",!0)),this.updateToolbarState()},toggleUnderline:({item:n,argument:r})=>{let o=n.command;o in this.activeEditor.commands&&(this.activeEditor.commands[o](r),this.activeEditor.commands.toggleFieldAnnotationsFormat("underline",!0)),this.updateToolbarState()},toggleLink:({item:n,argument:r})=>{let o=n.command;if(o in this.activeEditor.commands){this.activeEditor.commands[o](r);const{view:i}=this.activeEditor;let{selection:s}=i.state;this.activeEditor.options.isHeaderOrFooter&&(s=this.activeEditor.options.lastSelection);const a=s.$to.pos,l=new Pe(i.state.doc.resolve(a)),c=i.state.tr.setSelection(l),u=i.state.apply(c);i.updateState(u),this.activeEditor.options.isHeaderOrFooter||setTimeout(()=>{i.focus()},100)}this.updateToolbarState()},insertTable:({item:n,argument:r})=>{rn(this,Lt,Ho).call(this,{item:n,argument:r})},executeTableCommand:({item:n,argument:r})=>{if(!r)return;let o=r.command;o in this.activeEditor.commands&&this.activeEditor.commands[o](r),this.updateToolbarState()}}),rb(this,"onToolbarResize",()=>{rn(this,Lt,Up).call(this,{superToolbar:this,icons:this.config.icons,fonts:this.config.fonts,hideButtons:this.config.hideButtons,isDev:this.isDev}),this.role==="viewer"&&rn(this,Lt,Hp).call(this)}),this.config={...this.config,...e},this.toolbarItems=[],this.overflowItems=[],this.documentMode=e.documentMode||"editing",this.isDev=e.isDev||!1,this.superdoc=e.superdoc,this.role=e.role||"editor",this.toolbarContainer=null,this.config.editor&&(this.config.mode=this.config.editor.options.mode),this.config.icons={...ln,...e.icons},this.config.hideButtons=e.hideButtons??!0,this.config.responsiveToContainer=e.responsiveToContainer??!1,!this.config.selector&&this.config.element&&(this.config.selector=this.config.element),this.toolbarContainer=this.getElementBySelector(this.config.selector),this.toolbarContainer&&(rn(this,Lt,cS).call(this),rn(this,Lt,Up).call(this,{superToolbar:this,icons:this.config.icons,fonts:this.config.fonts,hideButtons:this.config.hideButtons,isDev:e.isDev}),this.app=w.createApp(Q3),this.app.directive("click-outside",CE),this.app.config.globalProperties.$toolbar=this,this.toolbarContainer&&(this.toolbar=this.app.mount(this.toolbarContainer)),this.activeEditor=e.editor||null,this.updateToolbarState())}getElementBySelector(e){let n=null;return e&&(e.startsWith("#")||e.startsWith(".")?n=document.querySelector(e):n=document.getElementById(e),!n)?(console.warn(`[super-toolbar 🎨] Element not found: ${e}`),null):n}log(...e){console.debug("[🎨 super-toolbar]",...e)}setZoom(e){const n=[...this.toolbarItems,...this.overflowItems].find(r=>r.name.value==="zoom");yd(this,Xi).setZoom({item:n,argument:e})}setActiveEditor(e){this.activeEditor=e,this.activeEditor.on("transaction",this.onEditorTransaction.bind(this))}getToolbarItemByGroup(e){return this.toolbarItems.filter(n=>(n.group?.value||"center")===e)}getToolbarItemByName(e){return this.toolbarItems.find(n=>n.name.value===e)}updateToolbarState(){if(rn(this,Lt,pS).call(this),rn(this,Lt,uS).call(this),rn(this,Lt,dS).call(this),!this.activeEditor||this.documentMode==="viewing"){rn(this,Lt,Hp).call(this);return}const e=df(this.activeEditor),n=wf(this.activeEditor.state);this.toolbarItems.forEach(r=>{if(r.resetDisabled(),r.name.value==="linkedStyles")return this.activeEditor&&!Bx(this.activeEditor).length?r.deactivate():r.activate();const o=e.find(a=>a.name===r.name.value);o?r.activate(o.attrs):r.deactivate();const i=e.find(a=>a.name==="styleId");if(i?.attrs.styleId){const a={fontSize:"font-size",fontFamily:"font-family",bold:"bold",textAlign:"textAlign"},l=this.activeEditor.converter?.linkedStyles.find(c=>c.id===i.attrs.styleId);if(l&&a[r.name.value]in l?.definition.styles){const c={[r.name.value]:l?.definition.styles[a[r.name.value]]};r.activate(c)}}const s=e.find(a=>a.name==="spacing");r.name.value==="lineHeight"&&(o?.attrs?.lineHeight||s)&&(r.selectedValue.value=o?.attrs?.lineHeight||s.attrs?.spacing?.line||""),r.name.value==="tableActions"&&(r.disabled.value=!n)})}onEditorTransaction({editor:e,transaction:n}){!n.docChanged&&!n.selectionSet||this.updateToolbarState()}emitCommand({item:e,argument:n,option:r}){this.activeEditor&&!this.activeEditor.options.isHeaderOrFooter&&this.activeEditor.focus();const{command:o}=e;if(o){if(this.log("(emmitCommand) Command:",o,`
453
+ item:`,e,`
454
+ argument:`,n,`
455
+ option:`,r),o in yd(this,Xi))return yd(this,Xi)[o]({item:e,argument:n});if(o in this.activeEditor?.commands)this.activeEditor.commands[o](n);else if(typeof o=="function")o({item:e,argument:n,option:r});else throw new Error(`[super-toolbar 🎨] Command not found: ${o}`);this.updateToolbarState()}}}Lt=new WeakSet,cS=function(){this.config.groups&&!Array.isArray(this.config.groups)&&Object.keys(this.config.groups).length&&(this.config.toolbarGroups=Object.keys(this.config.groups))},Xi=new WeakMap,Up=function({superToolbar:t,icons:e,fonts:n,hideButtons:r,isDev:o=!1}={}){const i=document.documentElement.clientWidth,s=this.toolbarContainer.offsetWidth,a=this.config.responsiveToContainer?s:i,{defaultItems:l,overflowItems:c}=OU({superToolbar:t,toolbarIcons:e,toolbarFonts:n,hideButtons:r,availableWidth:a,role:this.role,isDev:o}),u=this.config.customButtons||[];u.length&&l.push(...u.map(f=>Ve({...f})));let d=[...l.map(f=>f.name.value),...c.map(f=>f.name.value)];this.config.groups&&(d=Object.values(this.config.groups).flatMap(f=>f));const p=l.filter(f=>d.includes(f.name.value)).filter(f=>!this.config.excludeItems.includes(f.name.value));this.toolbarItems=p,this.overflowItems=c.filter(f=>d.includes(f.name.value))},uS=function(){if(!this.activeEditor||!this.activeEditor.converter)return;const{typeface:t="Arial",fontSizePt:e=12}=this.activeEditor.converter.getDocumentDefaultStyles()??{},n=this.toolbarItems.find(o=>o.name.value==="fontSize");n&&(n.defaultLabel.value=e);const r=this.toolbarItems.find(o=>o.name.value==="fontFamily");r&&(r.defaultLabel.value=t)},dS=function(){if(!this.activeEditor||!this.activeEditor.converter||!this.activeEditor.converter.docHiglightColors.size)return;const t=this.toolbarItems.find(i=>i.name.value==="highlight"),e=cU(),n=7,r=Array.from(this.activeEditor.converter.docHiglightColors).reduce((i,s,a)=>{const l=Math.floor(a/n);return i[l]||(i[l]=[]),e.includes(s)||i[l].push($e(s)),i},[]),o={key:"color",type:"render",render:()=>Vp(this,t,r,!0)};t.nestedOptions.value=[o]},Hp=function(){this.activeEditor=null,this.toolbarItems.forEach(t=>{const{allowWithoutEditor:e}=t;e.value||t.setDisabled(!0)})},pS=function(){this.activeEditor&&(this.undoDepth=BT(this.activeEditor.state),this.redoDepth=LT(this.activeEditor.state))},Ho=function({item:t,argument:e,noArgumentCallback:n=!1},r){if(!e||!this.activeEditor)return;let o=t.command;const i=t.noArgumentCommand;if(e==="none"&&i in this.activeEditor?.commands){this.activeEditor.commands[i](),typeof r=="function"&&n&&r(e),this.updateToolbarState();return}o in this.activeEditor?.commands&&(this.activeEditor.commands[o](e),typeof r=="function"&&r(e),this.updateToolbarState())};function RU(t,e){if(!t.value||!e?.value?.options?.scale)return;const n=e.value.options.scale,r=t.value.getBoundingClientRect(),o=t.value.querySelectorAll(".pagination-break-wrapper");let i;o.forEach(s=>{const a=(s.getBoundingClientRect().left-r.left)/n*-1+1;if(i||(i=a),a!==i){const l=a-i;s.style.transform=`translateX(${l}px)`}})}const BU=(t,e)=>{const n=t.clientY,r=t.clientX,{view:o}=e,i=o.dom.getBoundingClientRect();let s={left:0,top:n},a=!1;r>i.right?(s.left=i.left+i.width-1,a=!0):r<i.left&&(s.left=i.left);const l=o.posAtCoords(s)?.pos;if(l){let c=l;if(a){const d=o.state.doc.resolve(l).textOffset,p=o.state.doc.nodeAt(l),f=p?.text?.charAt(d);c=p?.isText&&f!==" "?l-1:l}const u=o.state.tr.setSelection(Pe.create(o.state.doc,c));o.dispatch(u),o.focus()}},LU={class:"numbering"},Ia=200,PU="flex-end",zU={__name:"Ruler",props:{orientation:{type:String,default:"horizontal"},length:{type:Number,default:0},editor:{type:Object,required:!0}},emits:["margin-change"],setup(t,{emit:e}){const n=e,r=t,o=w.ref(null),i=w.ref([]),s=w.ref("#CCCCCC"),a=w.ref("#2563EB66"),l=w.ref(null),c=w.ref(null),u=w.ref(!1),d=w.ref(null),p=w.reactive({side:"left",x:0}),f=w.reactive({side:"right",x:0}),h=w.ref(!1),m=w.ref(0);let y=0;const g=()=>{if(r.editor.options.mode!=="docx")return;const H=[],{pageMargins:A,pageSize:J}=r.editor.getPageStyles();l.value=J,c.value=A,f.x=J.width*96-A.right*96,p.x=A.left*96;for(let ie=0;ie<J.width;ie++){const W=`${5.5}px`,ce=J.width-ie;if(H.push(...v(1,"main","20%",W,ie)),H.push(...v(3,"eighth","10%",W)),H.push(...v(1,"half","40%",W)),ce<=.5)break;H.push(...v(3,"eighth","10%",W))}return H},v=(H,A,J,ie,W)=>Array.from({length:H},(ce,X)=>{const ue={className:`${A}-unit ruler-section`,height:J,margin:ie};return W!==void 0&&(ue.numbering=W),ue}),k=w.computed(()=>H=>({width:"1px",minWidth:"1px",maxWidth:"1px",height:H.height,backgroundColor:H.color||"#666",marginLeft:H.numbering===0?null:H.margin,marginRight:H.margin})),b=w.computed(()=>H=>({left:`${(H==="left"?p:f).x}px`})),C=w.computed(()=>{if(!o.value)return;const H=o.value.parentElement.querySelector(".super-editor").getBoundingClientRect();return{left:`${d.value.x}px`,minHeight:`${H.height}px`}}),D=H=>{u.value=!0,E();const A=H.currentTarget.id;d.value=A==="left-margin-handle"?p:f,m.value=d.value.x,y=H.clientX-d.value.x,h.value=!0},M=H=>{if(!u.value)return;const A=H.clientX-y;d.value.x=A,d.value.side==="left"?A<=0?d.value.x=0:A>=f.x-Ia&&(d.value.x=f.x-Ia):A>=l.value.width*96?d.value.x=l.value.width*96:A<=p.x+Ia&&(d.value.x=p.x+Ia)},I=()=>{if(u.value=!1,h.value=!1,G(),d.value&&d.value.x!==m.value){const H=oe();n("margin-change",{side:d.value.side,value:H})}},E=()=>{s.value=a.value},G=()=>{s.value="#CCC"},oe=()=>d.value.side==="left"?d.value.x/96:(l.value.width*96-d.value.x)/96,N=w.computed(()=>({"--alignment":PU,"--ruler-handle-color":s.value,"--ruler-handle-active-color":a.value}));return w.onMounted(()=>{i.value=g(),window.addEventListener("mousemove",M),window.addEventListener("mouseup",I)}),w.onUnmounted(()=>{window.removeEventListener("mousemove",M),window.removeEventListener("mouseup",I)}),(H,A)=>(w.openBlock(),w.createElementBlock("div",{class:"ruler",ref_key:"ruler",ref:o,style:w.normalizeStyle(N.value)},[w.createBaseVNode("div",{class:"margin-handle handle-left",id:"left-margin-handle",onMousedown:D,style:w.normalizeStyle(b.value("left"))},null,36),w.createBaseVNode("div",{class:"margin-handle handle-right",id:"right-margin-handle",onMousedown:D,style:w.normalizeStyle(b.value("right"))},null,36),h.value?(w.openBlock(),w.createElementBlock("div",{key:0,class:"vertical-indicator",style:w.normalizeStyle(C.value)},null,4)):w.createCommentVNode("",!0),(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(i.value,J=>(w.openBlock(),w.createElementBlock("div",{class:w.normalizeClass(J.className),style:w.normalizeStyle(k.value(J))},[w.createBaseVNode("div",LU,w.toDisplayString(J.numbering),1),(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(J.elements,ie=>(w.openBlock(),w.createElementBlock("div",{class:w.normalizeClass(ie.className),style:w.normalizeStyle(k.value(ie))},[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(ie.elements,W=>(w.openBlock(),w.createElementBlock("div",{class:w.normalizeClass(W.className),style:w.normalizeStyle(k.value(W))},null,6))),256))],6))),256))],6))),256))],4))}},jU=ft(zU,[["__scopeId","data-v-ad77036c"]]),qU={class:"super-editor-container"},VU={key:1,class:"placeholder-editor"},UU={class:"placeholder-title"},HU={__name:"SuperEditor",props:{documentId:{type:String,required:!1},fileSource:{type:File,required:!1},state:{type:Object,required:!1,default:()=>null},options:{type:Object,required:!1,default:()=>({})}},emits:["editor-ready","editor-click","editor-keydown","comments-loaded","selection-update"],setup(t,{emit:e}){const n=e,r=t,o=w.ref(!1),i=w.shallowRef(null),s=w.ref(null),a=w.ref(null);let l;const c=()=>{clearTimeout(l)},u=(k,b=10,C=500)=>{const D=k.getMap("meta"),M=()=>{const I=D.get("docx");I?(c(),h({content:I})):b>0?(console.debug(`Waiting for 'docx' data... retries left: ${b}`),l=setTimeout(M,C),b--):console.warn("Failed to load docx data from meta map.")};M()},d=async()=>{try{const[k,b,C,D]=await $s.loadXmlData(r.fileSource);return{content:k,media:b,mediaFiles:C,fonts:D}}catch(k){console.debug("Error loading new file data:",k)}},p=async()=>{if(r.fileSource){const k=await d();return h(k)}else if(r.options.ydoc&&r.options.collaborationProvider){delete r.options.content;const k=r.options.ydoc,b=r.options.collaborationProvider,C=()=>{u(k),b.off("synced",C)};b.on("synced",C)}},f=()=>{const k=Gf();return r.options.pagination?k:k.filter(b=>b.name!=="pagination")},h=async({content:k,media:b={},mediaFiles:C={},fonts:D={}}={})=>{i.value=new $s({mode:"docx",element:a.value,fileSource:r.fileSource,extensions:f(),externalExtensions:r.options.externalExtensions,documentId:r.documentId,content:k,media:b,mediaFiles:C,fonts:D,...r.options}),i.value.on("paginationUpdate",()=>{RU(a,i)}),i.value.on("collaborationReady",()=>{setTimeout(()=>{o.value=!0},150)})},m=k=>{n("editor-keydown",{editor:i.value})},y=k=>{n("editor-click",{editor:i.value});let b=a.value?.querySelector(".ProseMirror");!b||!i.value||!b.contains(k.target)&&i.value.isEditable&&i.value.view?.focus()};w.onMounted(()=>{p(),(r.options?.suppressSkeletonLoader||!r.options?.collaborationProvider)&&(o.value=!0)});const g=k=>{k.target.classList.contains("ProseMirror")||BU(k,i.value)},v=({side:k,value:b})=>{if(!i.value)return;const C=i.value.getPageStyles(),{pageMargins:D}=C,M={...D,[k]:b};i.value?.updatePageStyle({pageMargins:M})};return w.onBeforeUnmount(()=>{c(),i.value?.destroy(),i.value=null}),(k,b)=>(w.openBlock(),w.createElementBlock("div",qU,[t.options.rulers&&i.value?(w.openBlock(),w.createBlock(jU,{key:0,class:"ruler",editor:i.value,onMarginChange:v},null,8,["editor"])):w.createCommentVNode("",!0),w.createBaseVNode("div",{class:"super-editor",ref_key:"editorWrapper",ref:s,onKeydown:m,onClick:y,onMousedown:g},[w.createBaseVNode("div",{ref_key:"editorElem",ref:a,class:"editor-element super-editor__element"},null,512)],544),o.value?w.createCommentVNode("",!0):(w.openBlock(),w.createElementBlock("div",VU,[w.createBaseVNode("div",UU,[w.createVNode(w.unref(En),{text:"",style:{width:"60%"}})]),w.createVNode(w.unref(En),{text:"",repeat:6}),w.createVNode(w.unref(En),{text:"",style:{width:"60%"}}),w.createVNode(w.unref(En),{text:"",repeat:6,style:{width:"30%",display:"block",margin:"20px"}}),w.createVNode(w.unref(En),{text:"",style:{width:"60%"}}),w.createVNode(w.unref(En),{text:"",repeat:5}),w.createVNode(w.unref(En),{text:"",style:{width:"30%"}}),w.createVNode(w.unref(En),{text:"",style:{"margin-top":"50px"}}),w.createVNode(w.unref(En),{text:"",repeat:6}),w.createVNode(w.unref(En),{text:"",style:{width:"70%"}})]))]))}},WU=ft(HU,[["__scopeId","data-v-ff8f86f4"]]),GU={__name:"BasicUpload",emits:["file-change"],setup(t,{emit:e}){const n=e,r=o=>{n("file-change",o.target.files[0])};return(o,i)=>(w.openBlock(),w.createElementBlock("div",null,[w.createBaseVNode("input",{type:"file",id:"fileInput",onChange:r,accept:".docx"},null,32)]))}},KU=["innerHTML"],JU={__name:"SuperInput",props:{modelValue:{type:String},placeholder:{type:String,required:!1,default:"Type something..."},options:{type:Object,required:!1,default:()=>({})},users:{type:Array,required:!1,default:()=>[]}},emits:["update:modelValue","focus","blur"],setup(t,{emit:e}){const n=e,r=t,o=w.shallowRef(),i=w.ref(null),s=w.ref(!1),a=({editor:f,transaction:h})=>{const m=f.getHTML();n("update:modelValue",m)},l=({editor:f,transaction:h})=>{s.value=!0,p(),n("focus",{editor:f,transaction:h})},c=({editor:f,transaction:h})=>{s.value=!1,n("blur",{editor:f,transaction:h})},u=async()=>{wk.options.placeholder=r.placeholder||"Type something...",r.options.onTransaction=a,r.options.onFocus=l,r.options.onBlur=c,o.value=new $s({mode:"text",content:document.getElementById("currentContent"),element:i.value,extensions:Wf(),users:r.users,...r.options})},d=()=>{s.value=!0,o.value?.view?.focus()},p=()=>{o.value?.setOptions({users:r.users})};return w.onMounted(()=>{u()}),w.onBeforeUnmount(()=>{o.value?.destroy(),o.value=null}),(f,h)=>(w.openBlock(),w.createElementBlock("div",{class:w.normalizeClass(["super-editor super-input",{"super-input-active":s.value}]),onClick:w.withModifiers(d,["stop","prevent"])},[w.createBaseVNode("div",{id:"currentContent",style:{display:"none"},innerHTML:t.modelValue},null,8,KU),w.createBaseVNode("div",{ref_key:"editorElem",ref:i,class:"editor-element super-editor__element"},null,512)],2))}},XU=ft(JU,[["__scopeId","data-v-4d5cff52"]]),YU={Node:He,Attribute:Te,Extension:Ye,Plugin:Ue,Mark:tn};exports.$o=FU;exports.Ko=Ws;exports.No=YU;exports.Oo=XU;exports.Ot=Nr;exports.Pt=Pd;exports.R0=Q3;exports.Ro=GU;exports.aS=Wf;exports.bp=df;exports.c=dV;exports.ce=gt;exports.ge=bt;exports.kS=yI;exports.lS=Gf;exports.ls=$s;exports.vo=lS;exports.wS=V8;exports.xe=rS;exports.zo=WU;exports.zs=oc;