diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 0000000..2af58fa
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,48 @@
+name: Release
+on:
+ push:
+ tags:
+ - '*'
+
+permissions:
+ contents: write
+ id-token: write
+ attestations: write
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Use Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version: '20'
+
+ - name: Setup pnpm
+ uses: pnpm/action-setup@v3
+ with:
+ version: 10
+
+ - name: Install dependencies
+ run: pnpm install --frozen-lockfile
+
+ - name: Build
+ run: pnpm build
+
+ - name: Attest build provenance
+ uses: actions/attest-build-provenance@v1
+ with:
+ subject-path: |
+ main.js
+ styles.css
+ manifest.json
+
+ - name: Release
+ uses: softprops/action-gh-release@v2
+ with:
+ files: |
+ main.js
+ manifest.json
+ styles.css
diff --git a/.gitignore b/.gitignore
index ab337ba..5f272a3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,5 @@
.hotreload
node_modules/
-pnpm-lock.yaml
pnpm-workspace.yaml
.DS_Store
.vscode
@@ -9,3 +8,4 @@ pnpm-workspace.yaml
/docs
skills-lock.json
/.agent
+/.agents
diff --git a/README.md b/README.md
index cebd2d8..e310efb 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-
Colophon 2.0
+Colophon
Long-form writing canvas for Obsidian
Colophon provides a dedicated, typographically refined environment for writing manuscripts and screenplays. Unlike standard Markdown editors, Colophon uses a custom editor engine (Tiptap/ProseMirror) and a dedicated file format to ensure your formatting, footnotes, and script standards are preserved exactly as you intended.
diff --git a/main.js b/main.js
index 569857c..08cdcd6 100644
--- a/main.js
+++ b/main.js
@@ -1,31 +1,30 @@
-var Ow=Object.create;var Ls=Object.defineProperty;var Iw=Object.getOwnPropertyDescriptor;var Dw=Object.getOwnPropertyNames;var Rw=Object.getPrototypeOf,Pw=Object.prototype.hasOwnProperty;var M=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Lw=(t,e)=>{for(var n in e)Ls(t,n,{get:e[n],enumerable:!0})},Bf=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Dw(e))!Pw.call(t,i)&&i!==n&&Ls(t,i,{get:()=>e[i],enumerable:!(r=Iw(e,i))||r.enumerable});return t};var si=(t,e,n)=>(n=t!=null?Ow(Rw(t)):{},Bf(e||!t||!t.__esModule?Ls(n,"default",{value:t,enumerable:!0}):n,t)),Bw=t=>Bf(Ls({},"__esModule",{value:!0}),t);var Bi=M((dR,du)=>{"use strict";typeof process>"u"||!process.version||process.version.indexOf("v0.")===0||process.version.indexOf("v1.")===0&&process.version.indexOf("v1.8.")!==0?du.exports={nextTick:VC}:du.exports=process;function VC(t,e,n,r){if(typeof t!="function")throw new TypeError('"callback" argument must be a function');var i=arguments.length,s,o;switch(i){case 0:case 1:return process.nextTick(t);case 2:return process.nextTick(function(){t.call(null,e)});case 3:return process.nextTick(function(){t.call(null,e,n)});case 4:return process.nextTick(function(){t.call(null,e,n,r)});default:for(s=new Array(i-1),o=0;o{var UC={}.toString;Ag.exports=Array.isArray||function(t){return UC.call(t)=="[object Array]"}});var fu=M((hR,_g)=>{_g.exports=require("stream")});var zi=M((hu,Og)=>{var Do=require("buffer"),Ht=Do.Buffer;function Ng(t,e){for(var n in t)e[n]=t[n]}Ht.from&&Ht.alloc&&Ht.allocUnsafe&&Ht.allocUnsafeSlow?Og.exports=Do:(Ng(Do,hu),hu.Buffer=Cr);function Cr(t,e,n){return Ht(t,e,n)}Ng(Ht,Cr);Cr.from=function(t,e,n){if(typeof t=="number")throw new TypeError("Argument must not be a number");return Ht(t,e,n)};Cr.alloc=function(t,e,n){if(typeof t!="number")throw new TypeError("Argument must be a number");var r=Ht(t);return e!==void 0?typeof n=="string"?r.fill(e,n):r.fill(e):r.fill(0),r};Cr.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Ht(t)};Cr.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Do.SlowBuffer(t)}});var Er=M(Ne=>{function WC(t){return Array.isArray?Array.isArray(t):Ro(t)==="[object Array]"}Ne.isArray=WC;function jC(t){return typeof t=="boolean"}Ne.isBoolean=jC;function qC(t){return t===null}Ne.isNull=qC;function KC(t){return t==null}Ne.isNullOrUndefined=KC;function JC(t){return typeof t=="number"}Ne.isNumber=JC;function ZC(t){return typeof t=="string"}Ne.isString=ZC;function XC(t){return typeof t=="symbol"}Ne.isSymbol=XC;function GC(t){return t===void 0}Ne.isUndefined=GC;function YC(t){return Ro(t)==="[object RegExp]"}Ne.isRegExp=YC;function QC(t){return typeof t=="object"&&t!==null}Ne.isObject=QC;function eE(t){return Ro(t)==="[object Date]"}Ne.isDate=eE;function tE(t){return Ro(t)==="[object Error]"||t instanceof Error}Ne.isError=tE;function nE(t){return typeof t=="function"}Ne.isFunction=nE;function rE(t){return t===null||typeof t=="boolean"||typeof t=="number"||typeof t=="string"||typeof t=="symbol"||typeof t>"u"}Ne.isPrimitive=rE;Ne.isBuffer=require("buffer").Buffer.isBuffer;function Ro(t){return Object.prototype.toString.call(t)}});var Ig=M((mR,pu)=>{typeof Object.create=="function"?pu.exports=function(e,n){n&&(e.super_=n,e.prototype=Object.create(n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:pu.exports=function(e,n){if(n){e.super_=n;var r=function(){};r.prototype=n.prototype,e.prototype=new r,e.prototype.constructor=e}}});var Tr=M((gR,gu)=>{try{if(mu=require("util"),typeof mu.inherits!="function")throw"";gu.exports=mu.inherits}catch{gu.exports=Ig()}var mu});var Rg=M((yR,yu)=>{"use strict";function iE(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var Dg=zi().Buffer,Fi=require("util");function sE(t,e,n){t.copy(e,n)}yu.exports=(function(){function t(){iE(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(n){var r={data:n,next:null};this.length>0?this.tail.next=r:this.head=r,this.tail=r,++this.length},t.prototype.unshift=function(n){var r={data:n,next:this.head};this.length===0&&(this.tail=r),this.head=r,++this.length},t.prototype.shift=function(){if(this.length!==0){var n=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,n}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(n){if(this.length===0)return"";for(var r=this.head,i=""+r.data;r=r.next;)i+=n+r.data;return i},t.prototype.concat=function(n){if(this.length===0)return Dg.alloc(0);for(var r=Dg.allocUnsafe(n>>>0),i=this.head,s=0;i;)sE(i.data,r,s),s+=i.data.length,i=i.next;return r},t})();Fi&&Fi.inspect&&Fi.inspect.custom&&(yu.exports.prototype[Fi.inspect.custom]=function(){var t=Fi.inspect({length:this.length});return this.constructor.name+" "+t})});var bu=M((bR,Pg)=>{"use strict";var Po=Bi();function oE(t,e){var n=this,r=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return r||i?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,Po.nextTick(Lo,this,t)):Po.nextTick(Lo,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(s){!e&&s?n._writableState?n._writableState.errorEmitted||(n._writableState.errorEmitted=!0,Po.nextTick(Lo,n,s)):Po.nextTick(Lo,n,s):e&&e(s)}),this)}function aE(){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 Lo(t,e){t.emit("error",e)}Pg.exports={destroy:oE,undestroy:aE}});var Bg=M((vR,Lg)=>{Lg.exports=require("util").deprecate});var wu=M((wR,jg)=>{"use strict";var Hn=Bi();jg.exports=de;function Fg(t){var e=this;this.next=null,this.entry=null,this.finish=function(){EE(e,t)}}var lE=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:Hn.nextTick,Ar;de.WritableState=Hi;var $g=Object.create(Er());$g.inherits=Tr();var cE={deprecate:Bg()},Hg=fu(),zo=zi().Buffer,uE=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function dE(t){return zo.from(t)}function fE(t){return zo.isBuffer(t)||t instanceof uE}var Vg=bu();$g.inherits(de,Hg);function hE(){}function Hi(t,e){Ar=Ar||Vn(),t=t||{};var n=e instanceof Ar;this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var r=t.highWaterMark,i=t.writableHighWaterMark,s=this.objectMode?16:16*1024;r||r===0?this.highWaterMark=r:n&&(i||i===0)?this.highWaterMark=i:this.highWaterMark=s,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var o=t.decodeStrings===!1;this.decodeStrings=!o,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(a){wE(e,a)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new Fg(this)}Hi.prototype.getBuffer=function(){for(var e=this.bufferedRequest,n=[];e;)n.push(e),e=e.next;return n};(function(){try{Object.defineProperty(Hi.prototype,"buffer",{get:cE.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var Bo;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(Bo=Function.prototype[Symbol.hasInstance],Object.defineProperty(de,Symbol.hasInstance,{value:function(t){return Bo.call(this,t)?!0:this!==de?!1:t&&t._writableState instanceof Hi}})):Bo=function(t){return t instanceof this};function de(t){if(Ar=Ar||Vn(),!Bo.call(de,this)&&!(this instanceof Ar))return new de(t);this._writableState=new Hi(t,this),this.writable=!0,t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final)),Hg.call(this)}de.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function pE(t,e){var n=new Error("write after end");t.emit("error",n),Hn.nextTick(e,n)}function mE(t,e,n,r){var i=!0,s=!1;return n===null?s=new TypeError("May not write null values to stream"):typeof n!="string"&&n!==void 0&&!e.objectMode&&(s=new TypeError("Invalid non-string/buffer chunk")),s&&(t.emit("error",s),Hn.nextTick(r,s),i=!1),i}de.prototype.write=function(t,e,n){var r=this._writableState,i=!1,s=!r.objectMode&&fE(t);return s&&!zo.isBuffer(t)&&(t=dE(t)),typeof e=="function"&&(n=e,e=null),s?e="buffer":e||(e=r.defaultEncoding),typeof n!="function"&&(n=hE),r.ended?pE(this,n):(s||mE(this,r,t,n))&&(r.pendingcb++,i=yE(this,r,s,t,e,n)),i};de.prototype.cork=function(){var t=this._writableState;t.corked++};de.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&Ug(this,t))};de.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this};function gE(t,e,n){return!t.objectMode&&t.decodeStrings!==!1&&typeof e=="string"&&(e=zo.from(e,n)),e}Object.defineProperty(de.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function yE(t,e,n,r,i,s){if(!n){var o=gE(e,r,i);r!==o&&(n=!0,i="buffer",r=o)}var a=e.objectMode?1:r.length;e.length+=a;var l=e.length{"use strict";var qg=Bi(),TE=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e};Zg.exports=Vt;var Kg=Object.create(Er());Kg.inherits=Tr();var Jg=Su(),ku=wu();Kg.inherits(Vt,Jg);for(xu=TE(ku.prototype),Fo=0;Fo{"use strict";var Eu=zi().Buffer,Xg=Eu.isEncoding||function(t){switch(t=""+t,t&&t.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 _E(t){if(!t)return"utf8";for(var e;;)switch(t){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 t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}function NE(t){var e=_E(t);if(typeof e!="string"&&(Eu.isEncoding===Xg||!Xg(t)))throw new Error("Unknown encoding: "+t);return e||t}Gg.StringDecoder=Vi;function Vi(t){this.encoding=NE(t);var e;switch(this.encoding){case"utf16le":this.text=LE,this.end=BE,e=4;break;case"utf8":this.fillLast=DE,e=4;break;case"base64":this.text=zE,this.end=FE,e=3;break;default:this.write=$E,this.end=HE;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Eu.allocUnsafe(e)}Vi.prototype.write=function(t){if(t.length===0)return"";var e,n;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function OE(t,e,n){var r=e.length-1;if(r=0?(i>0&&(t.lastNeed=i-1),i):--r=0?(i>0&&(t.lastNeed=i-2),i):--r=0?(i>0&&(i===2?i=0:t.lastNeed=i-3),i):0))}function IE(t,e,n){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}function DE(t){var e=this.lastTotal-this.lastNeed,n=IE(this,t,e);if(n!==void 0)return n;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}function RE(t,e){var n=OE(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=n;var r=t.length-(n-this.lastNeed);return t.copy(this.lastChar,0,r),t.toString("utf8",e,r)}function PE(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function LE(t,e){if((t.length-e)%2===0){var n=t.toString("utf16le",e);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function BE(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,n)}return e}function zE(t,e){var n=(t.length-e)%3;return n===0?t.toString("base64",e):(this.lastNeed=3-n,this.lastTotal=3,n===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-n))}function FE(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function $E(t){return t.toString(this.encoding)}function HE(t){return t&&t.length?this.write(t):""}});var Su=M((CR,cy)=>{"use strict";var _r=Bi();cy.exports=G;var VE=Mg(),Ui;G.ReadableState=iy;var SR=require("events").EventEmitter,ty=function(t,e){return t.listeners(e).length},Ou=fu(),Wi=zi().Buffer,UE=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function WE(t){return Wi.from(t)}function jE(t){return Wi.isBuffer(t)||t instanceof UE}var ny=Object.create(Er());ny.inherits=Tr();var Au=require("util"),K=void 0;Au&&Au.debuglog?K=Au.debuglog("stream"):K=function(){};var qE=Rg(),ry=bu(),Mr;ny.inherits(G,Ou);var Mu=["error","close","destroy","pause","resume"];function KE(t,e,n){if(typeof t.prependListener=="function")return t.prependListener(e,n);!t._events||!t._events[e]?t.on(e,n):VE(t._events[e])?t._events[e].unshift(n):t._events[e]=[n,t._events[e]]}function iy(t,e){Ui=Ui||Vn(),t=t||{};var n=e instanceof Ui;this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var r=t.highWaterMark,i=t.readableHighWaterMark,s=this.objectMode?16:16*1024;r||r===0?this.highWaterMark=r:n&&(i||i===0)?this.highWaterMark=i:this.highWaterMark=s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new qE,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.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(Mr||(Mr=Tu().StringDecoder),this.decoder=new Mr(t.encoding),this.encoding=t.encoding)}function G(t){if(Ui=Ui||Vn(),!(this instanceof G))return new G(t);this._readableState=new iy(t,this),this.readable=!0,t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy)),Ou.call(this)}Object.defineProperty(G.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}});G.prototype.destroy=ry.destroy;G.prototype._undestroy=ry.undestroy;G.prototype._destroy=function(t,e){this.push(null),e(t)};G.prototype.push=function(t,e){var n=this._readableState,r;return n.objectMode?r=!0:typeof t=="string"&&(e=e||n.defaultEncoding,e!==n.encoding&&(t=Wi.from(t,e),e=""),r=!0),sy(this,t,e,!1,r)};G.prototype.unshift=function(t){return sy(this,t,null,!0,!1)};function sy(t,e,n,r,i){var s=t._readableState;if(e===null)s.reading=!1,GE(t,s);else{var o;i||(o=JE(s,e)),o?t.emit("error",o):s.objectMode||e&&e.length>0?(typeof e!="string"&&!s.objectMode&&Object.getPrototypeOf(e)!==Wi.prototype&&(e=WE(e)),r?s.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):_u(t,s,e,!0):s.ended?t.emit("error",new Error("stream.push() after EOF")):(s.reading=!1,s.decoder&&!n?(e=s.decoder.write(e),s.objectMode||e.length!==0?_u(t,s,e,!1):oy(t,s)):_u(t,s,e,!1))):r||(s.reading=!1)}return ZE(s)}function _u(t,e,n,r){e.flowing&&e.length===0&&!e.sync?(t.emit("data",n),t.read(0)):(e.length+=e.objectMode?1:n.length,r?e.buffer.unshift(n):e.buffer.push(n),e.needReadable&&Ho(t)),oy(t,e)}function JE(t,e){var n;return!jE(e)&&typeof e!="string"&&e!==void 0&&!t.objectMode&&(n=new TypeError("Invalid non-string/buffer chunk")),n}function ZE(t){return!t.ended&&(t.needReadable||t.length=Yg?t=Yg:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function Qg(t,e){return t<=0||e.length===0&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=XE(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}G.prototype.read=function(t){K("read",t),t=parseInt(t,10);var e=this._readableState,n=t;if(t!==0&&(e.emittedReadable=!1),t===0&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return K("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?Nu(this):Ho(this),null;if(t=Qg(t,e),t===0&&e.ended)return e.length===0&&Nu(this),null;var r=e.needReadable;K("need readable",r),(e.length===0||e.length-t0?i=ay(t,e):i=null,i===null?(e.needReadable=!0,t=0):e.length-=t,e.length===0&&(e.ended||(e.needReadable=!0),n!==t&&e.ended&&Nu(this)),i!==null&&this.emit("data",i),i};function GE(t,e){if(!e.ended){if(e.decoder){var n=e.decoder.end();n&&n.length&&(e.buffer.push(n),e.length+=e.objectMode?1:n.length)}e.ended=!0,Ho(t)}}function Ho(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(K("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?_r.nextTick(ey,t):ey(t))}function ey(t){K("emit readable"),t.emit("readable"),Iu(t)}function oy(t,e){e.readingMore||(e.readingMore=!0,_r.nextTick(YE,t,e))}function YE(t,e){for(var n=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length1&&ly(r.pipes,t)!==-1)&&!c&&(K("false write response, pause",r.awaitDrain),r.awaitDrain++,d=!0),n.pause())}function h(y){K("onerror",y),g(),t.removeListener("error",h),ty(t,"error")===0&&t.emit("error",y)}KE(t,"error",h);function p(){t.removeListener("finish",m),g()}t.once("close",p);function m(){K("onfinish"),t.removeListener("close",p),g()}t.once("finish",m);function g(){K("unpipe"),n.unpipe(t)}return t.emit("pipe",n),r.flowing||(K("pipe resume"),n.resume()),t};function QE(t){return function(){var e=t._readableState;K("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,e.awaitDrain===0&&ty(t,"data")&&(e.flowing=!0,Iu(t))}}G.prototype.unpipe=function(t){var e=this._readableState,n={hasUnpiped:!1};if(e.pipesCount===0)return this;if(e.pipesCount===1)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,n),this);if(!t){var r=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var s=0;s=e.length?(e.decoder?n=e.buffer.join(""):e.buffer.length===1?n=e.buffer.head.data:n=e.buffer.concat(e.length),e.buffer.clear()):n=rT(t,e.buffer,e.decoder),n}function rT(t,e,n){var r;return ts.length?s.length:t;if(o===s.length?i+=s:i+=s.slice(0,t),t-=o,t===0){o===s.length?(++r,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=s.slice(o));break}++r}return e.length-=r,i}function sT(t,e){var n=Wi.allocUnsafe(t),r=e.head,i=1;for(r.data.copy(n),t-=r.data.length;r=r.next;){var s=r.data,o=t>s.length?s.length:t;if(s.copy(n,n.length-t,0,o),t-=o,t===0){o===s.length?(++i,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=s.slice(o));break}++i}return e.length-=i,n}function Nu(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,_r.nextTick(oT,e,t))}function oT(t,e){!t.endEmitted&&t.length===0&&(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function ly(t,e){for(var n=0,r=t.length;n{"use strict";fy.exports=Ut;var Vo=Vn(),dy=Object.create(Er());dy.inherits=Tr();dy.inherits(Ut,Vo);function aT(t,e){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(!r)return this.emit("error",new Error("write callback called multiple times"));n.writechunk=null,n.writecb=null,e!=null&&this.push(e),r(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length{"use strict";my.exports=ji;var hy=Du(),py=Object.create(Er());py.inherits=Tr();py.inherits(ji,hy);function ji(t){if(!(this instanceof ji))return new ji(t);hy.call(this,t)}ji.prototype._transform=function(t,e,n){n(null,t)}});var Ru=M((Se,Uo)=>{var bt=require("stream");process.env.READABLE_STREAM==="disable"&&bt?(Uo.exports=bt,Se=Uo.exports=bt.Readable,Se.Readable=bt.Readable,Se.Writable=bt.Writable,Se.Duplex=bt.Duplex,Se.Transform=bt.Transform,Se.PassThrough=bt.PassThrough,Se.Stream=bt):(Se=Uo.exports=Su(),Se.Stream=bt||Se,Se.Readable=Se,Se.Writable=wu(),Se.Duplex=Vn(),Se.Transform=Du(),Se.PassThrough=gy())});var Wt=M(Ve=>{"use strict";Ve.base64=!0;Ve.array=!0;Ve.string=!0;Ve.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u";Ve.nodebuffer=typeof Buffer<"u";Ve.uint8array=typeof Uint8Array<"u";if(typeof ArrayBuffer>"u")Ve.blob=!1;else{Pu=new ArrayBuffer(0);try{Ve.blob=new Blob([Pu],{type:"application/zip"}).size===0}catch{try{yy=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,Lu=new yy,Lu.append(Pu),Ve.blob=Lu.getBlob("application/zip").size===0}catch{Ve.blob=!1}}}var Pu,yy,Lu;try{Ve.nodestream=!!Ru().Readable}catch{Ve.nodestream=!1}});var zu=M(Bu=>{"use strict";var cT=te(),uT=Wt(),vt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";Bu.encode=function(t){for(var e=[],n,r,i,s,o,a,l,c=0,u=t.length,d=u,f=cT.getTypeOf(t)!=="string";c>2,o=(n&3)<<4|r>>4,a=d>1?(r&15)<<2|i>>6:64,l=d>2?i&63:64,e.push(vt.charAt(s)+vt.charAt(o)+vt.charAt(a)+vt.charAt(l));return e.join("")};Bu.decode=function(t){var e,n,r,i,s,o,a,l=0,c=0,u="data:";if(t.substr(0,u.length)===u)throw new Error("Invalid base64 input, it looks like a data url.");t=t.replace(/[^A-Za-z0-9+/=]/g,"");var d=t.length*3/4;if(t.charAt(t.length-1)===vt.charAt(64)&&d--,t.charAt(t.length-2)===vt.charAt(64)&&d--,d%1!==0)throw new Error("Invalid base64 input, bad content length.");var f;for(uT.uint8array?f=new Uint8Array(d|0):f=new Array(d|0);l>4,n=(s&15)<<4|o>>2,r=(o&3)<<6|a,f[c++]=e,o!==64&&(f[c++]=n),a!==64&&(f[c++]=r);return f}});var qi=M((_R,by)=>{"use strict";by.exports={isNode:typeof Buffer<"u",newBufferFrom:function(t,e){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(t,e);if(typeof t=="number")throw new Error('The "data" argument must not be a number');return new Buffer(t,e)},allocBuffer:function(t){if(Buffer.alloc)return Buffer.alloc(t);var e=new Buffer(t);return e.fill(0),e},isBuffer:function(t){return Buffer.isBuffer(t)},isStream:function(t){return t&&typeof t.on=="function"&&typeof t.pause=="function"&&typeof t.resume=="function"}}});var ky=M((NR,xy)=>{"use strict";var vy=global.MutationObserver||global.WebKitMutationObserver,Nr;process.browser?vy?(Fu=0,wy=new vy(Ki),$u=global.document.createTextNode(""),wy.observe($u,{characterData:!0}),Nr=function(){$u.data=Fu=++Fu%2}):!global.setImmediate&&typeof global.MessageChannel<"u"?(Hu=new global.MessageChannel,Hu.port1.onmessage=Ki,Nr=function(){Hu.port2.postMessage(0)}):"document"in global&&"onreadystatechange"in global.document.createElement("script")?Nr=function(){var t=global.document.createElement("script");t.onreadystatechange=function(){Ki(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},global.document.documentElement.appendChild(t)}:Nr=function(){setTimeout(Ki,0)}:Nr=function(){process.nextTick(Ki)};var Fu,wy,$u,Hu,Vu,Ji=[];function Ki(){Vu=!0;for(var t,e,n=Ji.length;n;){for(e=Ji,Ji=[],t=-1;++t{"use strict";var Sy=ky();function Or(){}var Oe={},Cy=["REJECTED"],Uu=["FULFILLED"],Ey=["PENDING"];process.browser||(Zi=["UNHANDLED"]);var Zi;My.exports=ln;function ln(t){if(typeof t!="function")throw new TypeError("resolver must be a function");this.state=Ey,this.queue=[],this.outcome=void 0,process.browser||(this.handled=Zi),t!==Or&&Ty(this,t)}ln.prototype.finally=function(t){if(typeof t!="function")return this;var e=this.constructor;return this.then(n,r);function n(i){function s(){return i}return e.resolve(t()).then(s)}function r(i){function s(){throw i}return e.resolve(t()).then(s)}};ln.prototype.catch=function(t){return this.then(null,t)};ln.prototype.then=function(t,e){if(typeof t!="function"&&this.state===Uu||typeof e!="function"&&this.state===Cy)return this;var n=new this.constructor(Or);if(process.browser||this.handled===Zi&&(this.handled=null),this.state!==Ey){var r=this.state===Uu?t:e;Wu(n,r,this.outcome)}else this.queue.push(new Xi(n,t,e));return n};function Xi(t,e,n){this.promise=t,typeof e=="function"&&(this.onFulfilled=e,this.callFulfilled=this.otherCallFulfilled),typeof n=="function"&&(this.onRejected=n,this.callRejected=this.otherCallRejected)}Xi.prototype.callFulfilled=function(t){Oe.resolve(this.promise,t)};Xi.prototype.otherCallFulfilled=function(t){Wu(this.promise,this.onFulfilled,t)};Xi.prototype.callRejected=function(t){Oe.reject(this.promise,t)};Xi.prototype.otherCallRejected=function(t){Wu(this.promise,this.onRejected,t)};function Wu(t,e,n){Sy(function(){var r;try{r=e(n)}catch(i){return Oe.reject(t,i)}r===t?Oe.reject(t,new TypeError("Cannot resolve promise with itself")):Oe.resolve(t,r)})}Oe.resolve=function(t,e){var n=Ay(fT,e);if(n.status==="error")return Oe.reject(t,n.value);var r=n.value;if(r)Ty(t,r);else{t.state=Uu,t.outcome=e;for(var i=-1,s=t.queue.length;++i{"use strict";var ju=null;typeof Promise<"u"?ju=Promise:ju=_y();Ny.exports={Promise:ju}});var Iy=M(Oy=>{(function(t,e){"use strict";if(t.setImmediate)return;var n=1,r={},i=!1,s=t.document,o;function a(b){typeof b!="function"&&(b=new Function(""+b));for(var x=new Array(arguments.length-1),w=0;w"u"?typeof global>"u"?Oy:global:self)});var te=M(fe=>{"use strict";var cn=Wt(),yT=zu(),Dr=qi(),qu=Ir();Iy();function bT(t){var e=null;return cn.uint8array?e=new Uint8Array(t.length):e=new Array(t.length),jo(t,e)}fe.newBlob=function(t,e){fe.checkSupport("blob");try{return new Blob([t],{type:e})}catch{try{var n=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,r=new n;return r.append(t),r.getBlob(e)}catch{throw new Error("Bug : can't construct the Blob.")}}};function Gi(t){return t}function jo(t,e){for(var n=0;n1;)try{return Wo.stringifyByChunk(t,n,e)}catch{e=Math.floor(e/2)}return Wo.stringifyByChar(t)}fe.applyFromCharCode=Yi;function qo(t,e){for(var n=0;n"u"&&(t[n]=arguments[e][n]);return t};fe.prepareContent=function(t,e,n,r,i){var s=qu.Promise.resolve(e).then(function(o){var a=cn.blob&&(o instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(o))!==-1);return a&&typeof FileReader<"u"?new qu.Promise(function(l,c){var u=new FileReader;u.onload=function(d){l(d.target.result)},u.onerror=function(d){c(d.target.error)},u.readAsArrayBuffer(o)}):o});return s.then(function(o){var a=fe.getTypeOf(o);return a?(a==="arraybuffer"?o=fe.transformTo("uint8array",o):a==="string"&&(i?o=yT.decode(o):n&&r!==!0&&(o=bT(o))),o):qu.Promise.reject(new Error("Can't read the data of '"+t+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}});var Ue=M((PR,Ry)=>{"use strict";function Dy(t){this.name=t||"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}Dy.prototype={push:function(t){this.emit("data",t)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(t){this.emit("error",t)}return!0},error:function(t){return this.isFinished?!1:(this.isPaused?this.generatedError=t:(this.isFinished=!0,this.emit("error",t),this.previous&&this.previous.error(t),this.cleanUp()),!0)},on:function(t,e){return this._listeners[t].push(e),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(t,e){if(this._listeners[t])for(var n=0;n "+t:t}};Ry.exports=Dy});var Pr=M(dn=>{"use strict";var Rr=te(),Un=Wt(),vT=qi(),Ko=Ue(),Qi=new Array(256);for(jt=0;jt<256;jt++)Qi[jt]=jt>=252?6:jt>=248?5:jt>=240?4:jt>=224?3:jt>=192?2:1;var jt;Qi[254]=Qi[254]=1;var wT=function(t){var e,n,r,i,s,o=t.length,a=0;for(i=0;i>>6,e[s++]=128|n&63):n<65536?(e[s++]=224|n>>>12,e[s++]=128|n>>>6&63,e[s++]=128|n&63):(e[s++]=240|n>>>18,e[s++]=128|n>>>12&63,e[s++]=128|n>>>6&63,e[s++]=128|n&63);return e},xT=function(t,e){var n;for(e=e||t.length,e>t.length&&(e=t.length),n=e-1;n>=0&&(t[n]&192)===128;)n--;return n<0||n===0?e:n+Qi[t[n]]>e?n:e},kT=function(t){var e,n,r,i,s=t.length,o=new Array(s*2);for(n=0,e=0;e4){o[n++]=65533,e+=i-1;continue}for(r&=i===2?31:i===3?15:7;i>1&&e1){o[n++]=65533;continue}r<65536?o[n++]=r:(r-=65536,o[n++]=55296|r>>10&1023,o[n++]=56320|r&1023)}return o.length!==n&&(o.subarray?o=o.subarray(0,n):o.length=n),Rr.applyFromCharCode(o)};dn.utf8encode=function(e){return Un.nodebuffer?vT.newBufferFrom(e,"utf-8"):wT(e)};dn.utf8decode=function(e){return Un.nodebuffer?Rr.transformTo("nodebuffer",e).toString("utf-8"):(e=Rr.transformTo(Un.uint8array?"uint8array":"array",e),kT(e))};function Jo(){Ko.call(this,"utf-8 decode"),this.leftOver=null}Rr.inherits(Jo,Ko);Jo.prototype.processChunk=function(t){var e=Rr.transformTo(Un.uint8array?"uint8array":"array",t.data);if(this.leftOver&&this.leftOver.length){if(Un.uint8array){var n=e;e=new Uint8Array(n.length+this.leftOver.length),e.set(this.leftOver,0),e.set(n,this.leftOver.length)}else e=this.leftOver.concat(e);this.leftOver=null}var r=xT(e),i=e;r!==e.length&&(Un.uint8array?(i=e.subarray(0,r),this.leftOver=e.subarray(r,e.length)):(i=e.slice(0,r),this.leftOver=e.slice(r,e.length))),this.push({data:dn.utf8decode(i),meta:t.meta})};Jo.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:dn.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)};dn.Utf8DecodeWorker=Jo;function Ku(){Ko.call(this,"utf-8 encode")}Rr.inherits(Ku,Ko);Ku.prototype.processChunk=function(t){this.push({data:dn.utf8encode(t.data),meta:t.meta})};dn.Utf8EncodeWorker=Ku});var zy=M((BR,By)=>{"use strict";var Py=Ue(),Ly=te();function Ju(t){Py.call(this,"ConvertWorker to "+t),this.destType=t}Ly.inherits(Ju,Py);Ju.prototype.processChunk=function(t){this.push({data:Ly.transformTo(this.destType,t.data),meta:t.meta})};By.exports=Ju});var Hy=M((zR,$y)=>{"use strict";var Fy=Ru().Readable,ST=te();ST.inherits(Zu,Fy);function Zu(t,e,n){Fy.call(this,e),this._helper=t;var r=this;t.on("data",function(i,s){r.push(i)||r._helper.pause(),n&&n(s)}).on("error",function(i){r.emit("error",i)}).on("end",function(){r.push(null)})}Zu.prototype._read=function(){this._helper.resume()};$y.exports=Zu});var Xu=M((FR,Wy)=>{"use strict";var Wn=te(),CT=zy(),ET=Ue(),TT=zu(),AT=Wt(),MT=Ir(),Vy=null;if(AT.nodestream)try{Vy=Hy()}catch{}function _T(t,e,n){switch(t){case"blob":return Wn.newBlob(Wn.transformTo("arraybuffer",e),n);case"base64":return TT.encode(e);default:return Wn.transformTo(t,e)}}function NT(t,e){var n,r=0,i=null,s=0;for(n=0;n{"use strict";it.base64=!1;it.binary=!1;it.dir=!1;it.createFolders=!0;it.date=null;it.compression=null;it.compressionOptions=null;it.comment=null;it.unixPermissions=null;it.dosPermissions=null});var Yu=M((HR,jy)=>{"use strict";var Zo=te(),Xo=Ue(),IT=16*1024;function Lr(t){Xo.call(this,"DataWorker");var e=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,t.then(function(n){e.dataIsReady=!0,e.data=n,e.max=n&&n.length||0,e.type=Zo.getTypeOf(n),e.isPaused||e._tickAndRepeat()},function(n){e.error(n)})}Zo.inherits(Lr,Xo);Lr.prototype.cleanUp=function(){Xo.prototype.cleanUp.call(this),this.data=null};Lr.prototype.resume=function(){return Xo.prototype.resume.call(this)?(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,Zo.delay(this._tickAndRepeat,[],this)),!0):!1};Lr.prototype._tickAndRepeat=function(){this._tickScheduled=!1,!(this.isPaused||this.isFinished)&&(this._tick(),this.isFinished||(Zo.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))};Lr.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var t=IT,e=null,n=Math.min(this.max,this.index+t);if(this.index>=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,n);break;case"uint8array":e=this.data.subarray(this.index,n);break;case"array":case"nodebuffer":e=this.data.slice(this.index,n);break}return this.index=n,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})};jy.exports=Lr});var Go=M((VR,Ky)=>{"use strict";var DT=te();function RT(){for(var t,e=[],n=0;n<256;n++){t=n;for(var r=0;r<8;r++)t=t&1?3988292384^t>>>1:t>>>1;e[n]=t}return e}var qy=RT();function PT(t,e,n,r){var i=qy,s=r+n;t=t^-1;for(var o=r;o>>8^i[(t^e[o])&255];return t^-1}function LT(t,e,n,r){var i=qy,s=r+n;t=t^-1;for(var o=r;o>>8^i[(t^e.charCodeAt(o))&255];return t^-1}Ky.exports=function(e,n){if(typeof e>"u"||!e.length)return 0;var r=DT.getTypeOf(e)!=="string";return r?PT(n|0,e,e.length,0):LT(n|0,e,e.length,0)}});var ed=M((UR,Zy)=>{"use strict";var Jy=Ue(),BT=Go(),zT=te();function Qu(){Jy.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}zT.inherits(Qu,Jy);Qu.prototype.processChunk=function(t){this.streamInfo.crc32=BT(t.data,this.streamInfo.crc32||0),this.push(t)};Zy.exports=Qu});var Gy=M((WR,Xy)=>{"use strict";var FT=te(),td=Ue();function nd(t){td.call(this,"DataLengthProbe for "+t),this.propName=t,this.withStreamInfo(t,0)}FT.inherits(nd,td);nd.prototype.processChunk=function(t){if(t){var e=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=e+t.data.length}td.prototype.processChunk.call(this,t)};Xy.exports=nd});var Yo=M((jR,e0)=>{"use strict";var Yy=Ir(),Qy=Yu(),$T=ed(),rd=Gy();function id(t,e,n,r,i){this.compressedSize=t,this.uncompressedSize=e,this.crc32=n,this.compression=r,this.compressedContent=i}id.prototype={getContentWorker:function(){var t=new Qy(Yy.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new rd("data_length")),e=this;return t.on("end",function(){if(this.streamInfo.data_length!==e.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),t},getCompressedWorker:function(){return new Qy(Yy.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}};id.createWorkerFrom=function(t,e,n){return t.pipe(new $T).pipe(new rd("uncompressedSize")).pipe(e.compressWorker(n)).pipe(new rd("compressedSize")).withStreamInfo("compression",e)};e0.exports=id});var i0=M((qR,r0)=>{"use strict";var HT=Xu(),VT=Yu(),sd=Pr(),od=Yo(),t0=Ue(),ad=function(t,e,n){this.name=t,this.dir=n.dir,this.date=n.date,this.comment=n.comment,this.unixPermissions=n.unixPermissions,this.dosPermissions=n.dosPermissions,this._data=e,this._dataBinary=n.binary,this.options={compression:n.compression,compressionOptions:n.compressionOptions}};ad.prototype={internalStream:function(t){var e=null,n="string";try{if(!t)throw new Error("No output type specified.");n=t.toLowerCase();var r=n==="string"||n==="text";(n==="binarystring"||n==="text")&&(n="string"),e=this._decompressWorker();var i=!this._dataBinary;i&&!r&&(e=e.pipe(new sd.Utf8EncodeWorker)),!i&&r&&(e=e.pipe(new sd.Utf8DecodeWorker))}catch(s){e=new t0("error"),e.error(s)}return new HT(e,n,"")},async:function(t,e){return this.internalStream(t).accumulate(e)},nodeStream:function(t,e){return this.internalStream(t||"nodebuffer").toNodejsStream(e)},_compressWorker:function(t,e){if(this._data instanceof od&&this._data.compression.magic===t.magic)return this._data.getCompressedWorker();var n=this._decompressWorker();return this._dataBinary||(n=n.pipe(new sd.Utf8EncodeWorker)),od.createWorkerFrom(n,t,e)},_decompressWorker:function(){return this._data instanceof od?this._data.getContentWorker():this._data instanceof t0?this._data:new VT(this._data)}};var n0=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],UT=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")};for(Qo=0;Qo{"use strict";var WT=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function jT(t,e){return Object.prototype.hasOwnProperty.call(t,e)}Pe.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var n=e.shift();if(n){if(typeof n!="object")throw new TypeError(n+"must be non-object");for(var r in n)jT(n,r)&&(t[r]=n[r])}}return t};Pe.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var qT={arraySet:function(t,e,n,r,i){if(e.subarray&&t.subarray){t.set(e.subarray(n,n+r),i);return}for(var s=0;s{"use strict";var JT=qt(),ZT=4,s0=0,o0=1,XT=2;function zr(t){for(var e=t.length;--e>=0;)t[e]=0}var GT=0,f0=1,YT=2,QT=3,eA=258,pd=29,ss=256,ts=ss+1+pd,Br=30,md=19,h0=2*ts+1,jn=15,ld=16,tA=7,gd=256,p0=16,m0=17,g0=18,fd=[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],ea=[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],nA=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],y0=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],rA=512,Kt=new Array((ts+2)*2);zr(Kt);var es=new Array(Br*2);zr(es);var ns=new Array(rA);zr(ns);var rs=new Array(eA-QT+1);zr(rs);var yd=new Array(pd);zr(yd);var ta=new Array(Br);zr(ta);function cd(t,e,n,r,i){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=t&&t.length}var b0,v0,w0;function ud(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function x0(t){return t<256?ns[t]:ns[256+(t>>>7)]}function is(t,e){t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255}function $e(t,e,n){t.bi_valid>ld-n?(t.bi_buf|=e<>ld-t.bi_valid,t.bi_valid+=n-ld):(t.bi_buf|=e<>>=1,n<<=1;while(--e>0);return n>>>1}function iA(t){t.bi_valid===16?(is(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=t.bi_buf&255,t.bi_buf>>=8,t.bi_valid-=8)}function sA(t,e){var n=e.dyn_tree,r=e.max_code,i=e.stat_desc.static_tree,s=e.stat_desc.has_stree,o=e.stat_desc.extra_bits,a=e.stat_desc.extra_base,l=e.stat_desc.max_length,c,u,d,f,h,p,m=0;for(f=0;f<=jn;f++)t.bl_count[f]=0;for(n[t.heap[t.heap_max]*2+1]=0,c=t.heap_max+1;cl&&(f=l,m++),n[u*2+1]=f,!(u>r)&&(t.bl_count[f]++,h=0,u>=a&&(h=o[u-a]),p=n[u*2],t.opt_len+=p*(f+h),s&&(t.static_len+=p*(i[u*2+1]+h)));if(m!==0){do{for(f=l-1;t.bl_count[f]===0;)f--;t.bl_count[f]--,t.bl_count[f+1]+=2,t.bl_count[l]--,m-=2}while(m>0);for(f=l;f!==0;f--)for(u=t.bl_count[f];u!==0;)d=t.heap[--c],!(d>r)&&(n[d*2+1]!==f&&(t.opt_len+=(f-n[d*2+1])*n[d*2],n[d*2+1]=f),u--)}}function S0(t,e,n){var r=new Array(jn+1),i=0,s,o;for(s=1;s<=jn;s++)r[s]=i=i+n[s-1]<<1;for(o=0;o<=e;o++){var a=t[o*2+1];a!==0&&(t[o*2]=k0(r[a]++,a))}}function oA(){var t,e,n,r,i,s=new Array(jn+1);for(n=0,r=0;r>=7;r
8?is(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function aA(t,e,n,r){E0(t),r&&(is(t,n),is(t,~n)),JT.arraySet(t.pending_buf,t.window,e,n,t.pending),t.pending+=n}function a0(t,e,n,r){var i=e*2,s=n*2;return t[i]>1;o>=1;o--)dd(t,n,o);c=s;do o=t.heap[1],t.heap[1]=t.heap[t.heap_len--],dd(t,n,1),a=t.heap[1],t.heap[--t.heap_max]=o,t.heap[--t.heap_max]=a,n[c*2]=n[o*2]+n[a*2],t.depth[c]=(t.depth[o]>=t.depth[a]?t.depth[o]:t.depth[a])+1,n[o*2+1]=n[a*2+1]=c,t.heap[1]=c++,dd(t,n,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],sA(t,e),S0(n,l,t.bl_count)}function c0(t,e,n){var r,i=-1,s,o=e[1],a=0,l=7,c=4;for(o===0&&(l=138,c=3),e[(n+1)*2+1]=65535,r=0;r<=n;r++)s=o,o=e[(r+1)*2+1],!(++a=3&&t.bl_tree[y0[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e}function cA(t,e,n,r){var i;for($e(t,e-257,5),$e(t,n-1,5),$e(t,r-4,4),i=0;i>>=1)if(e&1&&t.dyn_ltree[n*2]!==0)return s0;if(t.dyn_ltree[18]!==0||t.dyn_ltree[20]!==0||t.dyn_ltree[26]!==0)return o0;for(n=32;n0?(t.strm.data_type===XT&&(t.strm.data_type=uA(t)),hd(t,t.l_desc),hd(t,t.d_desc),o=lA(t),i=t.opt_len+3+7>>>3,s=t.static_len+3+7>>>3,s<=i&&(i=s)):i=s=n+5,n+4<=i&&e!==-1?T0(t,e,n,r):t.strategy===ZT||s===i?($e(t,(f0<<1)+(r?1:0),3),l0(t,Kt,es)):($e(t,(YT<<1)+(r?1:0),3),cA(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),l0(t,t.dyn_ltree,t.dyn_dtree)),C0(t),r&&E0(t)}function pA(t,e,n){return t.pending_buf[t.d_buf+t.last_lit*2]=e>>>8&255,t.pending_buf[t.d_buf+t.last_lit*2+1]=e&255,t.pending_buf[t.l_buf+t.last_lit]=n&255,t.last_lit++,e===0?t.dyn_ltree[n*2]++:(t.matches++,e--,t.dyn_ltree[(rs[n]+ss+1)*2]++,t.dyn_dtree[x0(e)*2]++),t.last_lit===t.lit_bufsize-1}Fr._tr_init=dA;Fr._tr_stored_block=T0;Fr._tr_flush_block=hA;Fr._tr_tally=pA;Fr._tr_align=fA});var bd=M((ZR,M0)=>{"use strict";function mA(t,e,n,r){for(var i=t&65535|0,s=t>>>16&65535|0,o=0;n!==0;){o=n>2e3?2e3:n,n-=o;do i=i+e[r++]|0,s=s+i|0;while(--o);i%=65521,s%=65521}return i|s<<16|0}M0.exports=mA});var vd=M((XR,_0)=>{"use strict";function gA(){for(var t,e=[],n=0;n<256;n++){t=n;for(var r=0;r<8;r++)t=t&1?3988292384^t>>>1:t>>>1;e[n]=t}return e}var yA=gA();function bA(t,e,n,r){var i=yA,s=r+n;t^=-1;for(var o=r;o>>8^i[(t^e[o])&255];return t^-1}_0.exports=bA});var na=M((GR,N0)=>{"use strict";N0.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"}});var F0=M(St=>{"use strict";var Le=qt(),Ye=A0(),R0=bd(),fn=vd(),vA=na(),Zn=0,wA=1,xA=3,yn=4,O0=5,kt=0,I0=1,Qe=-2,kA=-3,wd=-5,SA=-1,CA=1,ra=2,EA=3,TA=4,AA=0,MA=2,aa=8,_A=9,NA=15,OA=8,IA=29,DA=256,kd=DA+1+IA,RA=30,PA=19,LA=2*kd+1,BA=15,H=3,mn=258,st=mn+H+1,zA=32,la=42,Sd=69,ia=73,sa=91,oa=103,qn=113,ls=666,he=1,cs=2,Kn=3,Vr=4,FA=3;function gn(t,e){return t.msg=vA[e],e}function D0(t){return(t<<1)-(t>4?9:0)}function pn(t){for(var e=t.length;--e>=0;)t[e]=0}function hn(t){var e=t.state,n=e.pending;n>t.avail_out&&(n=t.avail_out),n!==0&&(Le.arraySet(t.output,e.pending_buf,e.pending_out,n,t.next_out),t.next_out+=n,e.pending_out+=n,t.total_out+=n,t.avail_out-=n,e.pending-=n,e.pending===0&&(e.pending_out=0))}function Ce(t,e){Ye._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,hn(t.strm)}function q(t,e){t.pending_buf[t.pending++]=e}function as(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255}function $A(t,e,n,r){var i=t.avail_in;return i>r&&(i=r),i===0?0:(t.avail_in-=i,Le.arraySet(e,t.input,t.next_in,i,n),t.state.wrap===1?t.adler=R0(t.adler,e,i,n):t.state.wrap===2&&(t.adler=fn(t.adler,e,i,n)),t.next_in+=i,t.total_in+=i,i)}function P0(t,e){var n=t.max_chain_length,r=t.strstart,i,s,o=t.prev_length,a=t.nice_match,l=t.strstart>t.w_size-st?t.strstart-(t.w_size-st):0,c=t.window,u=t.w_mask,d=t.prev,f=t.strstart+mn,h=c[r+o-1],p=c[r+o];t.prev_length>=t.good_match&&(n>>=2),a>t.lookahead&&(a=t.lookahead);do if(i=e,!(c[i+o]!==p||c[i+o-1]!==h||c[i]!==c[r]||c[++i]!==c[r+1])){r+=2,i++;do;while(c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&ro){if(t.match_start=e,o=s,s>=a)break;h=c[r+o-1],p=c[r+o]}}while((e=d[e&u])>l&&--n!==0);return o<=t.lookahead?o:t.lookahead}function Jn(t){var e=t.w_size,n,r,i,s,o;do{if(s=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-st)){Le.arraySet(t.window,t.window,e,e,0),t.match_start-=e,t.strstart-=e,t.block_start-=e,r=t.hash_size,n=r;do i=t.head[--n],t.head[n]=i>=e?i-e:0;while(--r);r=e,n=r;do i=t.prev[--n],t.prev[n]=i>=e?i-e:0;while(--r);s+=e}if(t.strm.avail_in===0)break;if(r=$A(t.strm,t.window,t.strstart+t.lookahead,s),t.lookahead+=r,t.lookahead+t.insert>=H)for(o=t.strstart-t.insert,t.ins_h=t.window[o],t.ins_h=(t.ins_h<t.pending_buf_size-5&&(n=t.pending_buf_size-5);;){if(t.lookahead<=1){if(Jn(t),t.lookahead===0&&e===Zn)return he;if(t.lookahead===0)break}t.strstart+=t.lookahead,t.lookahead=0;var r=t.block_start+n;if((t.strstart===0||t.strstart>=r)&&(t.lookahead=t.strstart-r,t.strstart=r,Ce(t,!1),t.strm.avail_out===0)||t.strstart-t.block_start>=t.w_size-st&&(Ce(t,!1),t.strm.avail_out===0))return he}return t.insert=0,e===yn?(Ce(t,!0),t.strm.avail_out===0?Kn:Vr):(t.strstart>t.block_start&&(Ce(t,!1),t.strm.avail_out===0),he)}function xd(t,e){for(var n,r;;){if(t.lookahead=H&&(t.ins_h=(t.ins_h<=H)if(r=Ye._tr_tally(t,t.strstart-t.match_start,t.match_length-H),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=H){t.match_length--;do t.strstart++,t.ins_h=(t.ins_h<=H&&(t.ins_h=(t.ins_h<4096)&&(t.match_length=H-1)),t.prev_length>=H&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-H,r=Ye._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-H),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=i&&(t.ins_h=(t.ins_h<=H&&t.strstart>0&&(i=t.strstart-1,r=o[i],r===o[++i]&&r===o[++i]&&r===o[++i])){s=t.strstart+mn;do;while(r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&it.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=H?(n=Ye._tr_tally(t,1,t.match_length-H),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(n=Ye._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),n&&(Ce(t,!1),t.strm.avail_out===0))return he}return t.insert=0,e===yn?(Ce(t,!0),t.strm.avail_out===0?Kn:Vr):t.last_lit&&(Ce(t,!1),t.strm.avail_out===0)?he:cs}function UA(t,e){for(var n;;){if(t.lookahead===0&&(Jn(t),t.lookahead===0)){if(e===Zn)return he;break}if(t.match_length=0,n=Ye._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,n&&(Ce(t,!1),t.strm.avail_out===0))return he}return t.insert=0,e===yn?(Ce(t,!0),t.strm.avail_out===0?Kn:Vr):t.last_lit&&(Ce(t,!1),t.strm.avail_out===0)?he:cs}function xt(t,e,n,r,i){this.good_length=t,this.max_lazy=e,this.nice_length=n,this.max_chain=r,this.func=i}var Hr;Hr=[new xt(0,0,0,0,HA),new xt(4,4,8,4,xd),new xt(4,5,16,8,xd),new xt(4,6,32,32,xd),new xt(4,4,16,16,$r),new xt(8,16,32,32,$r),new xt(8,16,128,128,$r),new xt(8,32,128,256,$r),new xt(32,128,258,1024,$r),new xt(32,258,258,4096,$r)];function WA(t){t.window_size=2*t.w_size,pn(t.head),t.max_lazy_match=Hr[t.level].max_lazy,t.good_match=Hr[t.level].good_length,t.nice_match=Hr[t.level].nice_length,t.max_chain_length=Hr[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=H-1,t.match_available=0,t.ins_h=0}function jA(){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=aa,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 Le.Buf16(LA*2),this.dyn_dtree=new Le.Buf16((2*RA+1)*2),this.bl_tree=new Le.Buf16((2*PA+1)*2),pn(this.dyn_ltree),pn(this.dyn_dtree),pn(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Le.Buf16(BA+1),this.heap=new Le.Buf16(2*kd+1),pn(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Le.Buf16(2*kd+1),pn(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 L0(t){var e;return!t||!t.state?gn(t,Qe):(t.total_in=t.total_out=0,t.data_type=MA,e=t.state,e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?la:qn,t.adler=e.wrap===2?0:1,e.last_flush=Zn,Ye._tr_init(e),kt)}function B0(t){var e=L0(t);return e===kt&&WA(t.state),e}function qA(t,e){return!t||!t.state||t.state.wrap!==2?Qe:(t.state.gzhead=e,kt)}function z0(t,e,n,r,i,s){if(!t)return Qe;var o=1;if(e===SA&&(e=6),r<0?(o=0,r=-r):r>15&&(o=2,r-=16),i<1||i>_A||n!==aa||r<8||r>15||e<0||e>9||s<0||s>TA)return gn(t,Qe);r===8&&(r=9);var a=new jA;return t.state=a,a.strm=t,a.wrap=o,a.gzhead=null,a.w_bits=r,a.w_size=1<O0||e<0)return t?gn(t,Qe):Qe;if(r=t.state,!t.output||!t.input&&t.avail_in!==0||r.status===ls&&e!==yn)return gn(t,t.avail_out===0?wd:Qe);if(r.strm=t,n=r.last_flush,r.last_flush=e,r.status===la)if(r.wrap===2)t.adler=0,q(r,31),q(r,139),q(r,8),r.gzhead?(q(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),q(r,r.gzhead.time&255),q(r,r.gzhead.time>>8&255),q(r,r.gzhead.time>>16&255),q(r,r.gzhead.time>>24&255),q(r,r.level===9?2:r.strategy>=ra||r.level<2?4:0),q(r,r.gzhead.os&255),r.gzhead.extra&&r.gzhead.extra.length&&(q(r,r.gzhead.extra.length&255),q(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=fn(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=Sd):(q(r,0),q(r,0),q(r,0),q(r,0),q(r,0),q(r,r.level===9?2:r.strategy>=ra||r.level<2?4:0),q(r,FA),r.status=qn);else{var o=aa+(r.w_bits-8<<4)<<8,a=-1;r.strategy>=ra||r.level<2?a=0:r.level<6?a=1:r.level===6?a=2:a=3,o|=a<<6,r.strstart!==0&&(o|=zA),o+=31-o%31,r.status=qn,as(r,o),r.strstart!==0&&(as(r,t.adler>>>16),as(r,t.adler&65535)),t.adler=1}if(r.status===Sd)if(r.gzhead.extra){for(i=r.pending;r.gzindex<(r.gzhead.extra.length&65535)&&!(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(t.adler=fn(t.adler,r.pending_buf,r.pending-i,i)),hn(t),i=r.pending,r.pending===r.pending_buf_size));)q(r,r.gzhead.extra[r.gzindex]&255),r.gzindex++;r.gzhead.hcrc&&r.pending>i&&(t.adler=fn(t.adler,r.pending_buf,r.pending-i,i)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=ia)}else r.status=ia;if(r.status===ia)if(r.gzhead.name){i=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(t.adler=fn(t.adler,r.pending_buf,r.pending-i,i)),hn(t),i=r.pending,r.pending===r.pending_buf_size)){s=1;break}r.gzindexi&&(t.adler=fn(t.adler,r.pending_buf,r.pending-i,i)),s===0&&(r.gzindex=0,r.status=sa)}else r.status=sa;if(r.status===sa)if(r.gzhead.comment){i=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(t.adler=fn(t.adler,r.pending_buf,r.pending-i,i)),hn(t),i=r.pending,r.pending===r.pending_buf_size)){s=1;break}r.gzindexi&&(t.adler=fn(t.adler,r.pending_buf,r.pending-i,i)),s===0&&(r.status=oa)}else r.status=oa;if(r.status===oa&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&hn(t),r.pending+2<=r.pending_buf_size&&(q(r,t.adler&255),q(r,t.adler>>8&255),t.adler=0,r.status=qn)):r.status=qn),r.pending!==0){if(hn(t),t.avail_out===0)return r.last_flush=-1,kt}else if(t.avail_in===0&&D0(e)<=D0(n)&&e!==yn)return gn(t,wd);if(r.status===ls&&t.avail_in!==0)return gn(t,wd);if(t.avail_in!==0||r.lookahead!==0||e!==Zn&&r.status!==ls){var l=r.strategy===ra?UA(r,e):r.strategy===EA?VA(r,e):Hr[r.level].func(r,e);if((l===Kn||l===Vr)&&(r.status=ls),l===he||l===Kn)return t.avail_out===0&&(r.last_flush=-1),kt;if(l===cs&&(e===wA?Ye._tr_align(r):e!==O0&&(Ye._tr_stored_block(r,0,0,!1),e===xA&&(pn(r.head),r.lookahead===0&&(r.strstart=0,r.block_start=0,r.insert=0))),hn(t),t.avail_out===0))return r.last_flush=-1,kt}return e!==yn?kt:r.wrap<=0?I0:(r.wrap===2?(q(r,t.adler&255),q(r,t.adler>>8&255),q(r,t.adler>>16&255),q(r,t.adler>>24&255),q(r,t.total_in&255),q(r,t.total_in>>8&255),q(r,t.total_in>>16&255),q(r,t.total_in>>24&255)):(as(r,t.adler>>>16),as(r,t.adler&65535)),hn(t),r.wrap>0&&(r.wrap=-r.wrap),r.pending!==0?kt:I0)}function ZA(t){var e;return!t||!t.state?Qe:(e=t.state.status,e!==la&&e!==Sd&&e!==ia&&e!==sa&&e!==oa&&e!==qn&&e!==ls?gn(t,Qe):(t.state=null,e===qn?gn(t,kA):kt))}function XA(t,e){var n=e.length,r,i,s,o,a,l,c,u;if(!t||!t.state||(r=t.state,o=r.wrap,o===2||o===1&&r.status!==la||r.lookahead))return Qe;for(o===1&&(t.adler=R0(t.adler,e,n,0)),r.wrap=0,n>=r.w_size&&(o===0&&(pn(r.head),r.strstart=0,r.block_start=0,r.insert=0),u=new Le.Buf8(r.w_size),Le.arraySet(u,e,n-r.w_size,r.w_size,0),e=u,n=r.w_size),a=t.avail_in,l=t.next_in,c=t.input,t.avail_in=n,t.next_in=0,t.input=e,Jn(r);r.lookahead>=H;){i=r.strstart,s=r.lookahead-(H-1);do r.ins_h=(r.ins_h<{"use strict";var ca=qt(),$0=!0,H0=!0;try{String.fromCharCode.apply(null,[0])}catch{$0=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{H0=!1}var us=new ca.Buf8(256);for(Jt=0;Jt<256;Jt++)us[Jt]=Jt>=252?6:Jt>=248?5:Jt>=240?4:Jt>=224?3:Jt>=192?2:1;var Jt;us[254]=us[254]=1;Ur.string2buf=function(t){var e,n,r,i,s,o=t.length,a=0;for(i=0;i>>6,e[s++]=128|n&63):n<65536?(e[s++]=224|n>>>12,e[s++]=128|n>>>6&63,e[s++]=128|n&63):(e[s++]=240|n>>>18,e[s++]=128|n>>>12&63,e[s++]=128|n>>>6&63,e[s++]=128|n&63);return e};function V0(t,e){if(e<65534&&(t.subarray&&H0||!t.subarray&&$0))return String.fromCharCode.apply(null,ca.shrinkBuf(t,e));for(var n="",r=0;r4){a[r++]=65533,n+=s-1;continue}for(i&=s===2?31:s===3?15:7;s>1&&n1){a[r++]=65533;continue}i<65536?a[r++]=i:(i-=65536,a[r++]=55296|i>>10&1023,a[r++]=56320|i&1023)}return V0(a,r)};Ur.utf8border=function(t,e){var n;for(e=e||t.length,e>t.length&&(e=t.length),n=e-1;n>=0&&(t[n]&192)===128;)n--;return n<0||n===0?e:n+us[t[n]]>e?n:e}});var Ed=M((e2,U0)=>{"use strict";function GA(){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}U0.exports=GA});var K0=M(hs=>{"use strict";var ds=F0(),fs=qt(),Ad=Cd(),Md=na(),YA=Ed(),q0=Object.prototype.toString,QA=0,Td=4,Wr=0,W0=1,j0=2,eM=-1,tM=0,nM=8;function Xn(t){if(!(this instanceof Xn))return new Xn(t);this.options=fs.assign({level:eM,method:nM,chunkSize:16384,windowBits:15,memLevel:8,strategy:tM,to:""},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new YA,this.strm.avail_out=0;var n=ds.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(n!==Wr)throw new Error(Md[n]);if(e.header&&ds.deflateSetHeader(this.strm,e.header),e.dictionary){var r;if(typeof e.dictionary=="string"?r=Ad.string2buf(e.dictionary):q0.call(e.dictionary)==="[object ArrayBuffer]"?r=new Uint8Array(e.dictionary):r=e.dictionary,n=ds.deflateSetDictionary(this.strm,r),n!==Wr)throw new Error(Md[n]);this._dict_set=!0}}Xn.prototype.push=function(t,e){var n=this.strm,r=this.options.chunkSize,i,s;if(this.ended)return!1;s=e===~~e?e:e===!0?Td:QA,typeof t=="string"?n.input=Ad.string2buf(t):q0.call(t)==="[object ArrayBuffer]"?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;do{if(n.avail_out===0&&(n.output=new fs.Buf8(r),n.next_out=0,n.avail_out=r),i=ds.deflate(n,s),i!==W0&&i!==Wr)return this.onEnd(i),this.ended=!0,!1;(n.avail_out===0||n.avail_in===0&&(s===Td||s===j0))&&(this.options.to==="string"?this.onData(Ad.buf2binstring(fs.shrinkBuf(n.output,n.next_out))):this.onData(fs.shrinkBuf(n.output,n.next_out)))}while((n.avail_in>0||n.avail_out===0)&&i!==W0);return s===Td?(i=ds.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===Wr):(s===j0&&(this.onEnd(Wr),n.avail_out=0),!0)};Xn.prototype.onData=function(t){this.chunks.push(t)};Xn.prototype.onEnd=function(t){t===Wr&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=fs.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function _d(t,e){var n=new Xn(e);if(n.push(t,!0),n.err)throw n.msg||Md[n.err];return n.result}function rM(t,e){return e=e||{},e.raw=!0,_d(t,e)}function iM(t,e){return e=e||{},e.gzip=!0,_d(t,e)}hs.Deflate=Xn;hs.deflate=_d;hs.deflateRaw=rM;hs.gzip=iM});var Z0=M((n2,J0)=>{"use strict";var ua=30,sM=12;J0.exports=function(e,n){var r,i,s,o,a,l,c,u,d,f,h,p,m,g,y,b,x,w,v,T,k,E,_,z,N;r=e.state,i=e.next_in,z=e.input,s=i+(e.avail_in-5),o=e.next_out,N=e.output,a=o-(n-e.avail_out),l=o+(e.avail_out-257),c=r.dmax,u=r.wsize,d=r.whave,f=r.wnext,h=r.window,p=r.hold,m=r.bits,g=r.lencode,y=r.distcode,b=(1<>>24,p>>>=v,m-=v,v=w>>>16&255,v===0)N[o++]=w&65535;else if(v&16){T=w&65535,v&=15,v&&(m>>=v,m-=v),m<15&&(p+=z[i++]<>>24,p>>>=v,m-=v,v=w>>>16&255,v&16){if(k=w&65535,v&=15,mc){e.msg="invalid distance too far back",r.mode=ua;break e}if(p>>>=v,m-=v,v=o-a,k>v){if(v=k-v,v>d&&r.sane){e.msg="invalid distance too far back",r.mode=ua;break e}if(E=0,_=h,f===0){if(E+=u-v,v2;)N[o++]=_[E++],N[o++]=_[E++],N[o++]=_[E++],T-=3;T&&(N[o++]=_[E++],T>1&&(N[o++]=_[E++]))}else{E=o-k;do N[o++]=N[E++],N[o++]=N[E++],N[o++]=N[E++],T-=3;while(T>2);T&&(N[o++]=N[E++],T>1&&(N[o++]=N[E++]))}}else if((v&64)===0){w=y[(w&65535)+(p&(1<>3,i-=T,m-=T<<3,p&=(1<{"use strict";var X0=qt(),jr=15,G0=852,Y0=592,Q0=0,Nd=1,eb=2,oM=[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],aM=[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],lM=[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],cM=[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];tb.exports=function(e,n,r,i,s,o,a,l){var c=l.bits,u=0,d=0,f=0,h=0,p=0,m=0,g=0,y=0,b=0,x=0,w,v,T,k,E,_=null,z=0,N,X=new X0.Buf16(jr+1),ne=new X0.Buf16(jr+1),re=null,ie=0,Nt,ct,Ps;for(u=0;u<=jr;u++)X[u]=0;for(d=0;d=1&&X[h]===0;h--);if(p>h&&(p=h),h===0)return s[o++]=1<<24|64<<16|0,s[o++]=1<<24|64<<16|0,l.bits=1,0;for(f=1;f0&&(e===Q0||h!==1))return-1;for(ne[1]=0,u=1;uG0||e===eb&&b>Y0)return 1;for(;;){Nt=u-g,a[d]N?(ct=re[ie+a[d]],Ps=_[z+a[d]]):(ct=96,Ps=0),w=1<>g)+v]=Nt<<24|ct<<16|Ps|0;while(v!==0);for(w=1<>=1;if(w!==0?(x&=w-1,x+=w):x=0,d++,--X[u]===0){if(u===h)break;u=n[r+a[d]]}if(u>p&&(x&k)!==T){for(g===0&&(g=p),E+=f,m=u-g,y=1<G0||e===eb&&b>Y0)return 1;T=x&k,s[T]=p<<24|m<<16|E-o|0}}return x!==0&&(s[E+x]=u-g<<24|64<<16|0),l.bits=p,0}});var Bb=M(ot=>{"use strict";var We=qt(),Ld=bd(),Ct=vd(),uM=Z0(),ps=nb(),dM=0,Mb=1,_b=2,rb=4,fM=5,da=6,Gn=0,hM=1,pM=2,et=-2,Nb=-3,Bd=-4,mM=-5,ib=8,Ob=1,sb=2,ob=3,ab=4,lb=5,cb=6,ub=7,db=8,fb=9,hb=10,pa=11,Zt=12,Od=13,pb=14,Id=15,mb=16,gb=17,yb=18,bb=19,fa=20,ha=21,vb=22,wb=23,xb=24,kb=25,Sb=26,Dd=27,Cb=28,Eb=29,Y=30,zd=31,gM=32,yM=852,bM=592,vM=15,wM=vM;function Tb(t){return(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24)}function xM(){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 We.Buf16(320),this.work=new We.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Ib(t){var e;return!t||!t.state?et:(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=Ob,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new We.Buf32(yM),e.distcode=e.distdyn=new We.Buf32(bM),e.sane=1,e.back=-1,Gn)}function Db(t){var e;return!t||!t.state?et:(e=t.state,e.wsize=0,e.whave=0,e.wnext=0,Ib(t))}function Rb(t,e){var n,r;return!t||!t.state||(r=t.state,e<0?(n=0,e=-e):(n=(e>>4)+1,e<48&&(e&=15)),e&&(e<8||e>15))?et:(r.window!==null&&r.wbits!==e&&(r.window=null),r.wrap=n,r.wbits=e,Db(t))}function Pb(t,e){var n,r;return t?(r=new xM,t.state=r,r.window=null,n=Rb(t,e),n!==Gn&&(t.state=null),n):et}function kM(t){return Pb(t,wM)}var Ab=!0,Rd,Pd;function SM(t){if(Ab){var e;for(Rd=new We.Buf32(512),Pd=new We.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(ps(Mb,t.lens,0,288,Rd,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;ps(_b,t.lens,0,32,Pd,0,t.work,{bits:5}),Ab=!1}t.lencode=Rd,t.lenbits=9,t.distcode=Pd,t.distbits=5}function Lb(t,e,n,r){var i,s=t.state;return s.window===null&&(s.wsize=1<=s.wsize?(We.arraySet(s.window,e,n-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):(i=s.wsize-s.wnext,i>r&&(i=r),We.arraySet(s.window,e,n-r,i,s.wnext),r-=i,r?(We.arraySet(s.window,e,n-r,r,0),s.wnext=r,s.whave=s.wsize):(s.wnext+=i,s.wnext===s.wsize&&(s.wnext=0),s.whave>>8&255,n.check=Ct(n.check,_,2,0),c=0,u=0,n.mode=sb;break}if(n.flags=0,n.head&&(n.head.done=!1),!(n.wrap&1)||(((c&255)<<8)+(c>>8))%31){t.msg="incorrect header check",n.mode=Y;break}if((c&15)!==ib){t.msg="unknown compression method",n.mode=Y;break}if(c>>>=4,u-=4,k=(c&15)+8,n.wbits===0)n.wbits=k;else if(k>n.wbits){t.msg="invalid window size",n.mode=Y;break}n.dmax=1<>8&1),n.flags&512&&(_[0]=c&255,_[1]=c>>>8&255,n.check=Ct(n.check,_,2,0)),c=0,u=0,n.mode=ob;case ob:for(;u<32;){if(a===0)break e;a--,c+=r[s++]<>>8&255,_[2]=c>>>16&255,_[3]=c>>>24&255,n.check=Ct(n.check,_,4,0)),c=0,u=0,n.mode=ab;case ab:for(;u<16;){if(a===0)break e;a--,c+=r[s++]<>8),n.flags&512&&(_[0]=c&255,_[1]=c>>>8&255,n.check=Ct(n.check,_,2,0)),c=0,u=0,n.mode=lb;case lb:if(n.flags&1024){for(;u<16;){if(a===0)break e;a--,c+=r[s++]<>>8&255,n.check=Ct(n.check,_,2,0)),c=0,u=0}else n.head&&(n.head.extra=null);n.mode=cb;case cb:if(n.flags&1024&&(h=n.length,h>a&&(h=a),h&&(n.head&&(k=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),We.arraySet(n.head.extra,r,s,h,k)),n.flags&512&&(n.check=Ct(n.check,r,h,s)),a-=h,s+=h,n.length-=h),n.length))break e;n.length=0,n.mode=ub;case ub:if(n.flags&2048){if(a===0)break e;h=0;do k=r[s+h++],n.head&&k&&n.length<65536&&(n.head.name+=String.fromCharCode(k));while(k&&h>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=Zt;break;case hb:for(;u<32;){if(a===0)break e;a--,c+=r[s++]<>>=u&7,u-=u&7,n.mode=Dd;break}for(;u<3;){if(a===0)break e;a--,c+=r[s++]<>>=1,u-=1,c&3){case 0:n.mode=pb;break;case 1:if(SM(n),n.mode=fa,e===da){c>>>=2,u-=2;break e}break;case 2:n.mode=gb;break;case 3:t.msg="invalid block type",n.mode=Y}c>>>=2,u-=2;break;case pb:for(c>>>=u&7,u-=u&7;u<32;){if(a===0)break e;a--,c+=r[s++]<>>16^65535)){t.msg="invalid stored block lengths",n.mode=Y;break}if(n.length=c&65535,c=0,u=0,n.mode=Id,e===da)break e;case Id:n.mode=mb;case mb:if(h=n.length,h){if(h>a&&(h=a),h>l&&(h=l),h===0)break e;We.arraySet(i,r,s,h,o),a-=h,s+=h,l-=h,o+=h,n.length-=h;break}n.mode=Zt;break;case gb:for(;u<14;){if(a===0)break e;a--,c+=r[s++]<>>=5,u-=5,n.ndist=(c&31)+1,c>>>=5,u-=5,n.ncode=(c&15)+4,c>>>=4,u-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=Y;break}n.have=0,n.mode=yb;case yb:for(;n.have>>=3,u-=3}for(;n.have<19;)n.lens[X[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,z={bits:n.lenbits},E=ps(dM,n.lens,0,19,n.lencode,0,n.work,z),n.lenbits=z.bits,E){t.msg="invalid code lengths set",n.mode=Y;break}n.have=0,n.mode=bb;case bb:for(;n.have>>24,b=g>>>16&255,x=g&65535,!(y<=u);){if(a===0)break e;a--,c+=r[s++]<>>=y,u-=y,n.lens[n.have++]=x;else{if(x===16){for(N=y+2;u>>=y,u-=y,n.have===0){t.msg="invalid bit length repeat",n.mode=Y;break}k=n.lens[n.have-1],h=3+(c&3),c>>>=2,u-=2}else if(x===17){for(N=y+3;u>>=y,u-=y,k=0,h=3+(c&7),c>>>=3,u-=3}else{for(N=y+7;u>>=y,u-=y,k=0,h=11+(c&127),c>>>=7,u-=7}if(n.have+h>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=Y;break}for(;h--;)n.lens[n.have++]=k}}if(n.mode===Y)break;if(n.lens[256]===0){t.msg="invalid code -- missing end-of-block",n.mode=Y;break}if(n.lenbits=9,z={bits:n.lenbits},E=ps(Mb,n.lens,0,n.nlen,n.lencode,0,n.work,z),n.lenbits=z.bits,E){t.msg="invalid literal/lengths set",n.mode=Y;break}if(n.distbits=6,n.distcode=n.distdyn,z={bits:n.distbits},E=ps(_b,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,z),n.distbits=z.bits,E){t.msg="invalid distances set",n.mode=Y;break}if(n.mode=fa,e===da)break e;case fa:n.mode=ha;case ha:if(a>=6&&l>=258){t.next_out=o,t.avail_out=l,t.next_in=s,t.avail_in=a,n.hold=c,n.bits=u,uM(t,f),o=t.next_out,i=t.output,l=t.avail_out,s=t.next_in,r=t.input,a=t.avail_in,c=n.hold,u=n.bits,n.mode===Zt&&(n.back=-1);break}for(n.back=0;g=n.lencode[c&(1<>>24,b=g>>>16&255,x=g&65535,!(y<=u);){if(a===0)break e;a--,c+=r[s++]<>w)],y=g>>>24,b=g>>>16&255,x=g&65535,!(w+y<=u);){if(a===0)break e;a--,c+=r[s++]<>>=w,u-=w,n.back+=w}if(c>>>=y,u-=y,n.back+=y,n.length=x,b===0){n.mode=Sb;break}if(b&32){n.back=-1,n.mode=Zt;break}if(b&64){t.msg="invalid literal/length code",n.mode=Y;break}n.extra=b&15,n.mode=vb;case vb:if(n.extra){for(N=n.extra;u>>=n.extra,u-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=wb;case wb:for(;g=n.distcode[c&(1<>>24,b=g>>>16&255,x=g&65535,!(y<=u);){if(a===0)break e;a--,c+=r[s++]<>w)],y=g>>>24,b=g>>>16&255,x=g&65535,!(w+y<=u);){if(a===0)break e;a--,c+=r[s++]<>>=w,u-=w,n.back+=w}if(c>>>=y,u-=y,n.back+=y,b&64){t.msg="invalid distance code",n.mode=Y;break}n.offset=x,n.extra=b&15,n.mode=xb;case xb:if(n.extra){for(N=n.extra;u>>=n.extra,u-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=Y;break}n.mode=kb;case kb:if(l===0)break e;if(h=f-l,n.offset>h){if(h=n.offset-h,h>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=Y;break}h>n.wnext?(h-=n.wnext,p=n.wsize-h):p=n.wnext-h,h>n.length&&(h=n.length),m=n.window}else m=i,p=o-n.offset,h=n.length;h>l&&(h=l),l-=h,n.length-=h;do i[o++]=m[p++];while(--h);n.length===0&&(n.mode=ha);break;case Sb:if(l===0)break e;i[o++]=n.length,l--,n.mode=ha;break;case Dd:if(n.wrap){for(;u<32;){if(a===0)break e;a--,c|=r[s++]<{"use strict";zb.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}});var $b=M((o2,Fb)=>{"use strict";function MM(){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}Fb.exports=MM});var Vb=M(gs=>{"use strict";var qr=Bb(),ms=qt(),ma=Cd(),le=Fd(),$d=na(),_M=Ed(),NM=$b(),Hb=Object.prototype.toString;function Yn(t){if(!(this instanceof Yn))return new Yn(t);this.options=ms.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15)===0&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new _M,this.strm.avail_out=0;var n=qr.inflateInit2(this.strm,e.windowBits);if(n!==le.Z_OK)throw new Error($d[n]);if(this.header=new NM,qr.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=ma.string2buf(e.dictionary):Hb.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(n=qr.inflateSetDictionary(this.strm,e.dictionary),n!==le.Z_OK)))throw new Error($d[n])}Yn.prototype.push=function(t,e){var n=this.strm,r=this.options.chunkSize,i=this.options.dictionary,s,o,a,l,c,u=!1;if(this.ended)return!1;o=e===~~e?e:e===!0?le.Z_FINISH:le.Z_NO_FLUSH,typeof t=="string"?n.input=ma.binstring2buf(t):Hb.call(t)==="[object ArrayBuffer]"?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;do{if(n.avail_out===0&&(n.output=new ms.Buf8(r),n.next_out=0,n.avail_out=r),s=qr.inflate(n,le.Z_NO_FLUSH),s===le.Z_NEED_DICT&&i&&(s=qr.inflateSetDictionary(this.strm,i)),s===le.Z_BUF_ERROR&&u===!0&&(s=le.Z_OK,u=!1),s!==le.Z_STREAM_END&&s!==le.Z_OK)return this.onEnd(s),this.ended=!0,!1;n.next_out&&(n.avail_out===0||s===le.Z_STREAM_END||n.avail_in===0&&(o===le.Z_FINISH||o===le.Z_SYNC_FLUSH))&&(this.options.to==="string"?(a=ma.utf8border(n.output,n.next_out),l=n.next_out-a,c=ma.buf2string(n.output,a),n.next_out=l,n.avail_out=r-l,l&&ms.arraySet(n.output,n.output,a,l,0),this.onData(c)):this.onData(ms.shrinkBuf(n.output,n.next_out))),n.avail_in===0&&n.avail_out===0&&(u=!0)}while((n.avail_in>0||n.avail_out===0)&&s!==le.Z_STREAM_END);return s===le.Z_STREAM_END&&(o=le.Z_FINISH),o===le.Z_FINISH?(s=qr.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,s===le.Z_OK):(o===le.Z_SYNC_FLUSH&&(this.onEnd(le.Z_OK),n.avail_out=0),!0)};Yn.prototype.onData=function(t){this.chunks.push(t)};Yn.prototype.onEnd=function(t){t===le.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=ms.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function Hd(t,e){var n=new Yn(e);if(n.push(t,!0),n.err)throw n.msg||$d[n.err];return n.result}function OM(t,e){return e=e||{},e.raw=!0,Hd(t,e)}gs.Inflate=Yn;gs.inflate=Hd;gs.inflateRaw=OM;gs.ungzip=Hd});var jb=M((l2,Wb)=>{"use strict";var IM=qt().assign,DM=K0(),RM=Vb(),PM=Fd(),Ub={};IM(Ub,DM,RM,PM);Wb.exports=Ub});var Kb=M(ya=>{"use strict";var LM=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",BM=jb(),qb=te(),ga=Ue(),zM=LM?"uint8array":"array";ya.magic="\b\0";function Qn(t,e){ga.call(this,"FlateWorker/"+t),this._pako=null,this._pakoAction=t,this._pakoOptions=e,this.meta={}}qb.inherits(Qn,ga);Qn.prototype.processChunk=function(t){this.meta=t.meta,this._pako===null&&this._createPako(),this._pako.push(qb.transformTo(zM,t.data),!1)};Qn.prototype.flush=function(){ga.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)};Qn.prototype.cleanUp=function(){ga.prototype.cleanUp.call(this),this._pako=null};Qn.prototype._createPako=function(){this._pako=new BM[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var t=this;this._pako.onData=function(e){t.push({data:e,meta:t.meta})}};ya.compressWorker=function(t){return new Qn("Deflate",t)};ya.uncompressWorker=function(){return new Qn("Inflate",{})}});var Ud=M(Vd=>{"use strict";var Jb=Ue();Vd.STORE={magic:"\0\0",compressWorker:function(){return new Jb("STORE compression")},uncompressWorker:function(){return new Jb("STORE decompression")}};Vd.DEFLATE=Kb()});var Wd=M(er=>{"use strict";er.LOCAL_FILE_HEADER="PK";er.CENTRAL_FILE_HEADER="PK";er.CENTRAL_DIRECTORY_END="PK";er.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07";er.ZIP64_CENTRAL_DIRECTORY_END="PK";er.DATA_DESCRIPTOR="PK\x07\b"});var Yb=M((f2,Gb)=>{"use strict";var Kr=te(),Jr=Ue(),jd=Pr(),Zb=Go(),ba=Wd(),Z=function(t,e){var n="",r;for(r=0;r>>8;return n},FM=function(t,e){var n=t;return t||(n=e?16893:33204),(n&65535)<<16},$M=function(t){return(t||0)&63},Xb=function(t,e,n,r,i,s){var o=t.file,a=t.compression,l=s!==jd.utf8encode,c=Kr.transformTo("string",s(o.name)),u=Kr.transformTo("string",jd.utf8encode(o.name)),d=o.comment,f=Kr.transformTo("string",s(d)),h=Kr.transformTo("string",jd.utf8encode(d)),p=u.length!==o.name.length,m=h.length!==d.length,g,y,b="",x="",w="",v=o.dir,T=o.date,k={crc32:0,compressedSize:0,uncompressedSize:0};(!e||n)&&(k.crc32=t.crc32,k.compressedSize=t.compressedSize,k.uncompressedSize=t.uncompressedSize);var E=0;e&&(E|=8),!l&&(p||m)&&(E|=2048);var _=0,z=0;v&&(_|=16),i==="UNIX"?(z=798,_|=FM(o.unixPermissions,v)):(z=20,_|=$M(o.dosPermissions,v)),g=T.getUTCHours(),g=g<<6,g=g|T.getUTCMinutes(),g=g<<5,g=g|T.getUTCSeconds()/2,y=T.getUTCFullYear()-1980,y=y<<4,y=y|T.getUTCMonth()+1,y=y<<5,y=y|T.getUTCDate(),p&&(x=Z(1,1)+Z(Zb(c),4)+u,b+="up"+Z(x.length,2)+x),m&&(w=Z(1,1)+Z(Zb(f),4)+h,b+="uc"+Z(w.length,2)+w);var N="";N+=`
-\0`,N+=Z(E,2),N+=a.magic,N+=Z(g,2),N+=Z(y,2),N+=Z(k.crc32,4),N+=Z(k.compressedSize,4),N+=Z(k.uncompressedSize,4),N+=Z(c.length,2),N+=Z(b.length,2);var X=ba.LOCAL_FILE_HEADER+N+c+b,ne=ba.CENTRAL_FILE_HEADER+Z(z,2)+N+Z(f.length,2)+"\0\0\0\0"+Z(_,4)+Z(r,4)+c+b+f;return{fileRecord:X,dirRecord:ne}},HM=function(t,e,n,r,i){var s="",o=Kr.transformTo("string",i(r));return s=ba.CENTRAL_DIRECTORY_END+"\0\0\0\0"+Z(t,2)+Z(t,2)+Z(e,4)+Z(n,4)+Z(o.length,2)+o,s},VM=function(t){var e="";return e=ba.DATA_DESCRIPTOR+Z(t.crc32,4)+Z(t.compressedSize,4)+Z(t.uncompressedSize,4),e};function at(t,e,n,r){Jr.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=e,this.zipPlatform=n,this.encodeFileName=r,this.streamFiles=t,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}Kr.inherits(at,Jr);at.prototype.push=function(t){var e=t.meta.percent||0,n=this.entriesCount,r=this._sources.length;this.accumulate?this.contentBuffer.push(t):(this.bytesWritten+=t.data.length,Jr.prototype.push.call(this,{data:t.data,meta:{currentFile:this.currentFile,percent:n?(e+100*(n-r-1))/n:100}}))};at.prototype.openedSource=function(t){this.currentSourceOffset=this.bytesWritten,this.currentFile=t.file.name;var e=this.streamFiles&&!t.file.dir;if(e){var n=Xb(t,e,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:n.fileRecord,meta:{percent:0}})}else this.accumulate=!0};at.prototype.closedSource=function(t){this.accumulate=!1;var e=this.streamFiles&&!t.file.dir,n=Xb(t,e,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(n.dirRecord),e)this.push({data:VM(t),meta:{percent:100}});else for(this.push({data:n.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null};at.prototype.flush=function(){for(var t=this.bytesWritten,e=0;e{"use strict";var UM=Ud(),WM=Yb(),jM=function(t,e){var n=t||e,r=UM[n];if(!r)throw new Error(n+" is not a valid compression method !");return r};Qb.generateWorker=function(t,e,n){var r=new WM(e.streamFiles,n,e.platform,e.encodeFileName),i=0;try{t.forEach(function(s,o){i++;var a=jM(o.options.compression,e.compression),l=o.options.compressionOptions||e.compressionOptions||{},c=o.dir,u=o.date;o._compressWorker(a,l).withStreamInfo("file",{name:s,dir:c,date:u,comment:o.comment||"",unixPermissions:o.unixPermissions,dosPermissions:o.dosPermissions}).pipe(r)}),r.entriesCount=i}catch(s){r.error(s)}return r}});var nv=M((p2,tv)=>{"use strict";var qM=te(),va=Ue();function ys(t,e){va.call(this,"Nodejs stream input adapter for "+t),this._upstreamEnded=!1,this._bindStream(e)}qM.inherits(ys,va);ys.prototype._bindStream=function(t){var e=this;this._stream=t,t.pause(),t.on("data",function(n){e.push({data:n,meta:{percent:0}})}).on("error",function(n){e.isPaused?this.generatedError=n:e.error(n)}).on("end",function(){e.isPaused?e._upstreamEnded=!0:e.end()})};ys.prototype.pause=function(){return va.prototype.pause.call(this)?(this._stream.pause(),!0):!1};ys.prototype.resume=function(){return va.prototype.resume.call(this)?(this._upstreamEnded?this.end():this._stream.resume(),!0):!1};tv.exports=ys});var fv=M((m2,dv)=>{"use strict";var KM=Pr(),bs=te(),ov=Ue(),JM=Xu(),av=Gu(),rv=Yo(),ZM=i0(),XM=ev(),iv=qi(),GM=nv(),lv=function(t,e,n){var r=bs.getTypeOf(e),i,s=bs.extend(n||{},av);s.date=s.date||new Date,s.compression!==null&&(s.compression=s.compression.toUpperCase()),typeof s.unixPermissions=="string"&&(s.unixPermissions=parseInt(s.unixPermissions,8)),s.unixPermissions&&s.unixPermissions&16384&&(s.dir=!0),s.dosPermissions&&s.dosPermissions&16&&(s.dir=!0),s.dir&&(t=cv(t)),s.createFolders&&(i=YM(t))&&uv.call(this,i,!0);var o=r==="string"&&s.binary===!1&&s.base64===!1;(!n||typeof n.binary>"u")&&(s.binary=!o);var a=e instanceof rv&&e.uncompressedSize===0;(a||s.dir||!e||e.length===0)&&(s.base64=!1,s.binary=!0,e="",s.compression="STORE",r="string");var l=null;e instanceof rv||e instanceof ov?l=e:iv.isNode&&iv.isStream(e)?l=new GM(t,e):l=bs.prepareContent(t,e,s.binary,s.optimizedBinaryString,s.base64);var c=new ZM(t,l,s);this.files[t]=c},YM=function(t){t.slice(-1)==="/"&&(t=t.substring(0,t.length-1));var e=t.lastIndexOf("/");return e>0?t.substring(0,e):""},cv=function(t){return t.slice(-1)!=="/"&&(t+="/"),t},uv=function(t,e){return e=typeof e<"u"?e:av.createFolders,t=cv(t),this.files[t]||lv.call(this,t,null,{dir:!0,createFolders:e}),this.files[t]};function sv(t){return Object.prototype.toString.call(t)==="[object RegExp]"}var QM={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(t){var e,n,r;for(e in this.files)r=this.files[e],n=e.slice(this.root.length,e.length),n&&e.slice(0,this.root.length)===this.root&&t(n,r)},filter:function(t){var e=[];return this.forEach(function(n,r){t(n,r)&&e.push(r)}),e},file:function(t,e,n){if(arguments.length===1)if(sv(t)){var r=t;return this.filter(function(s,o){return!o.dir&&r.test(s)})}else{var i=this.files[this.root+t];return i&&!i.dir?i:null}else t=this.root+t,lv.call(this,t,e,n);return this},folder:function(t){if(!t)return this;if(sv(t))return this.filter(function(i,s){return s.dir&&t.test(i)});var e=this.root+t,n=uv.call(this,e),r=this.clone();return r.root=n.name,r},remove:function(t){t=this.root+t;var e=this.files[t];if(e||(t.slice(-1)!=="/"&&(t+="/"),e=this.files[t]),e&&!e.dir)delete this.files[t];else for(var n=this.filter(function(i,s){return s.name.slice(0,t.length)===t}),r=0;r{"use strict";var e_=te();function hv(t){this.data=t,this.length=t.length,this.index=0,this.zero=0}hv.prototype={checkOffset:function(t){this.checkIndex(this.index+t)},checkIndex:function(t){if(this.length=this.index;n--)e=(e<<8)+this.byteAt(n);return this.index+=t,e},readString:function(t){return e_.transformTo("string",this.readData(t))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var t=this.readInt(4);return new Date(Date.UTC((t>>25&127)+1980,(t>>21&15)-1,t>>16&31,t>>11&31,t>>5&63,(t&31)<<1))}};pv.exports=hv});var Kd=M((y2,gv)=>{"use strict";var mv=qd(),t_=te();function Zr(t){mv.call(this,t);for(var e=0;e=0;--s)if(this.data[s]===e&&this.data[s+1]===n&&this.data[s+2]===r&&this.data[s+3]===i)return s-this.zero;return-1};Zr.prototype.readAndCheckSignature=function(t){var e=t.charCodeAt(0),n=t.charCodeAt(1),r=t.charCodeAt(2),i=t.charCodeAt(3),s=this.readData(4);return e===s[0]&&n===s[1]&&r===s[2]&&i===s[3]};Zr.prototype.readData=function(t){if(this.checkOffset(t),t===0)return[];var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e};gv.exports=Zr});var vv=M((b2,bv)=>{"use strict";var yv=qd(),n_=te();function Xr(t){yv.call(this,t)}n_.inherits(Xr,yv);Xr.prototype.byteAt=function(t){return this.data.charCodeAt(this.zero+t)};Xr.prototype.lastIndexOfSignature=function(t){return this.data.lastIndexOf(t)-this.zero};Xr.prototype.readAndCheckSignature=function(t){var e=this.readData(4);return t===e};Xr.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e};bv.exports=Xr});var Zd=M((v2,xv)=>{"use strict";var wv=Kd(),r_=te();function Jd(t){wv.call(this,t)}r_.inherits(Jd,wv);Jd.prototype.readData=function(t){if(this.checkOffset(t),t===0)return new Uint8Array(0);var e=this.data.subarray(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e};xv.exports=Jd});var Cv=M((w2,Sv)=>{"use strict";var kv=Zd(),i_=te();function Xd(t){kv.call(this,t)}i_.inherits(Xd,kv);Xd.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e};Sv.exports=Xd});var Gd=M((x2,Tv)=>{"use strict";var wa=te(),Ev=Wt(),s_=Kd(),o_=vv(),a_=Cv(),l_=Zd();Tv.exports=function(t){var e=wa.getTypeOf(t);return wa.checkSupport(e),e==="string"&&!Ev.uint8array?new o_(t):e==="nodebuffer"?new a_(t):Ev.uint8array?new l_(wa.transformTo("uint8array",t)):new s_(wa.transformTo("array",t))}});var Nv=M((k2,_v)=>{"use strict";var Yd=Gd(),bn=te(),c_=Yo(),Av=Go(),xa=Pr(),ka=Ud(),u_=Wt(),d_=0,f_=3,h_=function(t){for(var e in ka)if(Object.prototype.hasOwnProperty.call(ka,e)&&ka[e].magic===t)return ka[e];return null};function Mv(t,e){this.options=t,this.loadOptions=e}Mv.prototype={isEncrypted:function(){return(this.bitFlag&1)===1},useUTF8:function(){return(this.bitFlag&2048)===2048},readLocalPart:function(t){var e,n;if(t.skip(22),this.fileNameLength=t.readInt(2),n=t.readInt(2),this.fileName=t.readData(this.fileNameLength),t.skip(n),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(e=h_(this.compressionMethod),e===null)throw new Error("Corrupted zip : compression "+bn.pretty(this.compressionMethod)+" unknown (inner file : "+bn.transformTo("string",this.fileName)+")");this.decompressed=new c_(this.compressedSize,this.uncompressedSize,this.crc32,e,t.readData(this.compressedSize))},readCentralPart:function(t){this.versionMadeBy=t.readInt(2),t.skip(2),this.bitFlag=t.readInt(2),this.compressionMethod=t.readString(2),this.date=t.readDate(),this.crc32=t.readInt(4),this.compressedSize=t.readInt(4),this.uncompressedSize=t.readInt(4);var e=t.readInt(2);if(this.extraFieldsLength=t.readInt(2),this.fileCommentLength=t.readInt(2),this.diskNumberStart=t.readInt(2),this.internalFileAttributes=t.readInt(2),this.externalFileAttributes=t.readInt(4),this.localHeaderOffset=t.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");t.skip(e),this.readExtraFields(t),this.parseZIP64ExtraField(t),this.fileComment=t.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var t=this.versionMadeBy>>8;this.dir=!!(this.externalFileAttributes&16),t===d_&&(this.dosPermissions=this.externalFileAttributes&63),t===f_&&(this.unixPermissions=this.externalFileAttributes>>16&65535),!this.dir&&this.fileNameStr.slice(-1)==="/"&&(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var t=Yd(this.extraFields[1].value);this.uncompressedSize===bn.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===bn.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===bn.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===bn.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(t){var e=t.index+this.extraFieldsLength,n,r,i;for(this.extraFields||(this.extraFields={});t.index+4{"use strict";var p_=Gd(),Xt=te(),lt=Wd(),m_=Nv(),g_=Wt();function Ov(t){this.files=[],this.loadOptions=t}Ov.prototype={checkSignature:function(t){if(!this.reader.readAndCheckSignature(t)){this.reader.index-=4;var e=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+Xt.pretty(e)+", expected "+Xt.pretty(t)+")")}},isSignature:function(t,e){var n=this.reader.index;this.reader.setIndex(t);var r=this.reader.readString(4),i=r===e;return this.reader.setIndex(n),i},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 t=this.reader.readData(this.zipCommentLength),e=g_.uint8array?"uint8array":"array",n=Xt.transformTo(e,t);this.zipComment=this.loadOptions.decodeFileName(n)},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 t=this.zip64EndOfCentralSize-44,e=0,n,r,i;e1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var t,e;for(t=0;t0)this.isSignature(n,lt.CENTRAL_FILE_HEADER)||(this.reader.zero=i);else if(i<0)throw new Error("Corrupted zip: missing "+Math.abs(i)+" bytes.")},prepareReader:function(t){this.reader=p_(t)},load:function(t){this.prepareReader(t),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}};Iv.exports=Ov});var Lv=M((C2,Pv)=>{"use strict";var Qd=te(),Sa=Ir(),y_=Pr(),b_=Dv(),v_=ed(),Rv=qi();function w_(t){return new Sa.Promise(function(e,n){var r=t.decompressed.getContentWorker().pipe(new v_);r.on("error",function(i){n(i)}).on("end",function(){r.streamInfo.crc32!==t.decompressed.crc32?n(new Error("Corrupted zip : CRC32 mismatch")):e()}).resume()})}Pv.exports=function(t,e){var n=this;return e=Qd.extend(e||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:y_.utf8decode}),Rv.isNode&&Rv.isStream(t)?Sa.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):Qd.prepareContent("the loaded zip file",t,!0,e.optimizedBinaryString,e.base64).then(function(r){var i=new b_(e);return i.load(r),i}).then(function(i){var s=[Sa.Promise.resolve(i)],o=i.files;if(e.checkCRC32)for(var a=0;a{"use strict";function tt(){if(!(this instanceof tt))return new tt;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 t=new tt;for(var e in this)typeof this[e]!="function"&&(t[e]=this[e]);return t}}tt.prototype=fv();tt.prototype.loadAsync=Lv();tt.support=Wt();tt.defaults=Gu();tt.version="3.10.1";tt.loadAsync=function(t,e){return new tt().loadAsync(t,e)};tt.external=Ir();Bv.exports=tt});var al=M(be=>{"use strict";var D_="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5m\xF6gensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",R_="\u03B5\u03BB1\u03C52\u0431\u04331\u0435\u043B3\u0434\u0435\u0442\u04384\u0435\u044E2\u043A\u0430\u0442\u043E\u043B\u0438\u043A6\u043E\u043C3\u043C\u043A\u04342\u043E\u043D1\u0441\u043A\u0432\u04306\u043E\u043D\u043B\u0430\u0439\u043D5\u0440\u04333\u0440\u0443\u04412\u04442\u0441\u0430\u0439\u04423\u0440\u04313\u0443\u043A\u04403\u049B\u0430\u04373\u0570\u0561\u05753\u05D9\u05E9\u05E8\u05D0\u05DC5\u05E7\u05D5\u05DD3\u0627\u0628\u0648\u0638\u0628\u064A5\u0631\u0627\u0645\u0643\u06485\u0644\u0627\u0631\u062F\u06464\u0628\u062D\u0631\u064A\u06465\u062C\u0632\u0627\u0626\u06315\u0633\u0639\u0648\u062F\u064A\u06296\u0639\u0644\u064A\u0627\u06465\u0645\u063A\u0631\u06285\u0645\u0627\u0631\u0627\u062A5\u06CC\u0631\u0627\u06465\u0628\u0627\u0631\u062A2\u0632\u0627\u06314\u064A\u062A\u06433\u06BE\u0627\u0631\u062A5\u062A\u0648\u0646\u06334\u0633\u0648\u062F\u0627\u06463\u0631\u064A\u06295\u0634\u0628\u0643\u06294\u0639\u0631\u0627\u06422\u06282\u0645\u0627\u06464\u0641\u0644\u0633\u0637\u064A\u06466\u0642\u0637\u06313\u0643\u0627\u062B\u0648\u0644\u064A\u06436\u0648\u06453\u0645\u0635\u06312\u0644\u064A\u0633\u064A\u06275\u0648\u0631\u064A\u062A\u0627\u0646\u064A\u06277\u0642\u06394\u0647\u0645\u0631\u0627\u06475\u067E\u0627\u06A9\u0633\u062A\u0627\u06467\u0680\u0627\u0631\u062A4\u0915\u0949\u092E3\u0928\u0947\u091F3\u092D\u093E\u0930\u09240\u092E\u094D3\u094B\u09245\u0938\u0902\u0917\u0920\u09285\u09AC\u09BE\u0982\u09B2\u09BE5\u09AD\u09BE\u09B0\u09A42\u09F0\u09A44\u0A2D\u0A3E\u0A30\u0A244\u0AAD\u0ABE\u0AB0\u0AA44\u0B2D\u0B3E\u0B30\u0B244\u0B87\u0BA8\u0BCD\u0BA4\u0BBF\u0BAF\u0BBE6\u0BB2\u0B99\u0BCD\u0B95\u0BC86\u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0BC2\u0BB0\u0BCD11\u0C2D\u0C3E\u0C30\u0C24\u0C4D5\u0CAD\u0CBE\u0CB0\u0CA44\u0D2D\u0D3E\u0D30\u0D24\u0D025\u0DBD\u0D82\u0D9A\u0DCF4\u0E04\u0E2D\u0E213\u0E44\u0E17\u0E223\u0EA5\u0EB2\u0EA73\u10D2\u10D42\u307F\u3093\u306A3\u30A2\u30DE\u30BE\u30F34\u30AF\u30E9\u30A6\u30C94\u30B0\u30FC\u30B0\u30EB4\u30B3\u30E02\u30B9\u30C8\u30A23\u30BB\u30FC\u30EB3\u30D5\u30A1\u30C3\u30B7\u30E7\u30F36\u30DD\u30A4\u30F3\u30C84\u4E16\u754C2\u4E2D\u4FE11\u56FD1\u570B1\u6587\u7F513\u4E9A\u9A6C\u900A3\u4F01\u4E1A2\u4F5B\u5C712\u4FE1\u606F2\u5065\u5EB72\u516B\u53662\u516C\u53F81\u76CA2\u53F0\u6E7E1\u70632\u5546\u57CE1\u5E971\u68072\u5609\u91CC0\u5927\u9152\u5E975\u5728\u7EBF2\u5927\u62FF2\u5929\u4E3B\u65593\u5A31\u4E502\u5BB6\u96FB2\u5E7F\u4E1C2\u5FAE\u535A2\u6148\u55842\u6211\u7231\u4F603\u624B\u673A2\u62DB\u80582\u653F\u52A11\u5E9C2\u65B0\u52A0\u57612\u95FB2\u65F6\u5C1A2\u66F8\u7C4D2\u673A\u67842\u6DE1\u9A6C\u95213\u6E38\u620F2\u6FB3\u95802\u70B9\u770B2\u79FB\u52A82\u7EC4\u7EC7\u673A\u67844\u7F51\u57401\u5E971\u7AD91\u7EDC2\u8054\u901A2\u8C37\u6B4C2\u8D2D\u72692\u901A\u8CA92\u96C6\u56E22\u96FB\u8A0A\u76C8\u79D14\u98DE\u5229\u6D663\u98DF\u54C12\u9910\u53852\u9999\u683C\u91CC\u62C93\u6E2F2\uB2F7\uB1371\uCEF42\uC0BC\uC1312\uD55C\uAD6D2",af="numeric",lf="ascii",cf="alpha",ks="asciinumeric",ws="alphanumeric",uf="domain",tw="emoji",P_="scheme",L_="slashscheme",nf="whitespace";function B_(t,e){return t in e||(e[t]=[]),e[t]}function nr(t,e,n){e[af]&&(e[ks]=!0,e[ws]=!0),e[lf]&&(e[ks]=!0,e[cf]=!0),e[ks]&&(e[ws]=!0),e[cf]&&(e[ws]=!0),e[ws]&&(e[uf]=!0),e[tw]&&(e[uf]=!0);for(let r in e){let i=B_(r,n);i.indexOf(t)<0&&i.push(t)}}function z_(t,e){let n={};for(let r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function Be(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}Be.groups={};Be.prototype={accepts(){return!!this.t},go(t){let e=this,n=e.j[t];if(n)return n;for(let r=0;rt.ta(e,n,r,i),oe=(t,e,n,r,i)=>t.tr(e,n,r,i),Gv=(t,e,n,r,i)=>t.ts(e,n,r,i),C=(t,e,n,r,i)=>t.tt(e,n,r,i),Gt="WORD",df="UWORD",nw="ASCIINUMERICAL",rw="ALPHANUMERICAL",Ms="LOCALHOST",ff="TLD",hf="UTLD",Na="SCHEME",Qr="SLASH_SCHEME",yf="NUM",pf="WS",bf="NL",Ss="OPENBRACE",Cs="CLOSEBRACE",Da="OPENBRACKET",Ra="CLOSEBRACKET",Pa="OPENPAREN",La="CLOSEPAREN",Ba="OPENANGLEBRACKET",za="CLOSEANGLEBRACKET",Fa="FULLWIDTHLEFTPAREN",$a="FULLWIDTHRIGHTPAREN",Ha="LEFTCORNERBRACKET",Va="RIGHTCORNERBRACKET",Ua="LEFTWHITECORNERBRACKET",Wa="RIGHTWHITECORNERBRACKET",ja="FULLWIDTHLESSTHAN",qa="FULLWIDTHGREATERTHAN",Ka="AMPERSAND",Ja="APOSTROPHE",Za="ASTERISK",wn="AT",Xa="BACKSLASH",Ga="BACKTICK",Ya="CARET",xn="COLON",vf="COMMA",Qa="DOLLAR",At="DOT",el="EQUALS",wf="EXCLAMATION",rt="HYPHEN",Es="PERCENT",tl="PIPE",nl="PLUS",rl="POUND",Ts="QUERY",xf="QUOTE",iw="FULLWIDTHMIDDLEDOT",kf="SEMI",Mt="SLASH",As="TILDE",il="UNDERSCORE",sw="EMOJI",sl="SYM",ow=Object.freeze({__proto__:null,ALPHANUMERICAL:rw,AMPERSAND:Ka,APOSTROPHE:Ja,ASCIINUMERICAL:nw,ASTERISK:Za,AT:wn,BACKSLASH:Xa,BACKTICK:Ga,CARET:Ya,CLOSEANGLEBRACKET:za,CLOSEBRACE:Cs,CLOSEBRACKET:Ra,CLOSEPAREN:La,COLON:xn,COMMA:vf,DOLLAR:Qa,DOT:At,EMOJI:sw,EQUALS:el,EXCLAMATION:wf,FULLWIDTHGREATERTHAN:qa,FULLWIDTHLEFTPAREN:Fa,FULLWIDTHLESSTHAN:ja,FULLWIDTHMIDDLEDOT:iw,FULLWIDTHRIGHTPAREN:$a,HYPHEN:rt,LEFTCORNERBRACKET:Ha,LEFTWHITECORNERBRACKET:Ua,LOCALHOST:Ms,NL:bf,NUM:yf,OPENANGLEBRACKET:Ba,OPENBRACE:Ss,OPENBRACKET:Da,OPENPAREN:Pa,PERCENT:Es,PIPE:tl,PLUS:nl,POUND:rl,QUERY:Ts,QUOTE:xf,RIGHTCORNERBRACKET:Va,RIGHTWHITECORNERBRACKET:Wa,SCHEME:Na,SEMI:kf,SLASH:Mt,SLASH_SCHEME:Qr,SYM:sl,TILDE:As,TLD:ff,UNDERSCORE:il,UTLD:hf,UWORD:df,WORD:Gt,WS:pf}),Et=/[a-z]/,ei=/\p{L}/u,Oa=/\p{Emoji}/u,F_=/\ufe0f/,Tt=/\d/,Ia=/\s/,$_=Object.freeze({__proto__:null,ASCII_LETTER:Et,DIGIT:Tt,EMOJI:Oa,EMOJI_VARIATION:F_,LETTER:ei,SPACE:Ia}),Yv="\r",rf=`
-`,H_="\uFE0F",V_="\u200D",sf="\uFFFC",Ma=null,_a=null;function U_(t=[]){let e={};Be.groups=e;let n=new Be;Ma==null&&(Ma=Qv(D_)),_a==null&&(_a=Qv(R_)),C(n,"'",Ja),C(n,"{",Ss),C(n,"}",Cs),C(n,"[",Da),C(n,"]",Ra),C(n,"(",Pa),C(n,")",La),C(n,"<",Ba),C(n,">",za),C(n,"\uFF08",Fa),C(n,"\uFF09",$a),C(n,"\u300C",Ha),C(n,"\u300D",Va),C(n,"\u300E",Ua),C(n,"\u300F",Wa),C(n,"\uFF1C",ja),C(n,"\uFF1E",qa),C(n,"&",Ka),C(n,"*",Za),C(n,"@",wn),C(n,"`",Ga),C(n,"^",Ya),C(n,":",xn),C(n,",",vf),C(n,"$",Qa),C(n,".",At),C(n,"=",el),C(n,"!",wf),C(n,"-",rt),C(n,"%",Es),C(n,"|",tl),C(n,"+",nl),C(n,"#",rl),C(n,"?",Ts),C(n,'"',xf),C(n,"/",Mt),C(n,";",kf),C(n,"~",As),C(n,"_",il),C(n,"\\",Xa),C(n,"\u30FB",iw);let r=oe(n,Tt,yf,{[af]:!0});oe(r,Tt,r);let i=oe(r,Et,nw,{[ks]:!0}),s=oe(r,ei,rw,{[ws]:!0}),o=oe(n,Et,Gt,{[lf]:!0});oe(o,Tt,i),oe(o,Et,o),oe(i,Tt,i),oe(i,Et,i);let a=oe(n,ei,df,{[cf]:!0});oe(a,Et),oe(a,Tt,s),oe(a,ei,a),oe(s,Tt,s),oe(s,Et),oe(s,ei,s);let l=C(n,rf,bf,{[nf]:!0}),c=C(n,Yv,pf,{[nf]:!0}),u=oe(n,Ia,pf,{[nf]:!0});C(n,sf,u),C(c,rf,l),C(c,sf,u),oe(c,Ia,u),C(u,Yv),C(u,rf),oe(u,Ia,u),C(u,sf,u);let d=oe(n,Oa,sw,{[tw]:!0});C(d,"#"),oe(d,Oa,d),C(d,H_,d);let f=C(d,V_);C(f,"#"),oe(f,Oa,d);let h=[[Et,o],[Tt,i]],p=[[Et,null],[ei,a],[Tt,s]];for(let m=0;mm[0]>g[0]?1:-1);for(let m=0;m=0?b[uf]=!0:Et.test(g)?Tt.test(g)?b[ks]=!0:b[lf]=!0:b[af]=!0,Gv(n,g,g,b)}return Gv(n,"localhost",Ms,{ascii:!0}),n.jd=new Be(sl),{start:n,tokens:Object.assign({groups:e},ow)}}function aw(t,e){let n=lw(e.replace(/[A-Z]/g,a=>a.toLowerCase())),r=n.length,i=[],s=0,o=0;for(;o=0&&(d+=n[o].length,f++),c+=n[o].length,s+=n[o].length,o++;s-=d,o-=f,c-=d,i.push({t:u.t,v:e.slice(s-c,s),s:s-c,e:s})}return i}function lw(t){let e=[],n=t.length,r=0;for(;r56319||r+1===n||(s=t.charCodeAt(r+1))<56320||s>57343?t[r]:t.slice(r,r+2);e.push(o),r+=o.length}return e}function vn(t,e,n,r,i){let s,o=e.length;for(let a=0;a=0;)s++;if(s>0){e.push(n.join(""));for(let o=parseInt(t.substring(r,r+s),10);o>0;o--)n.pop();r+=s}else n.push(t[r]),r++}return e}var ti={defaultProtocol:"http",events:null,format:ew,formatHref:ew,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Os(t,e=null){let n=Object.assign({},ti);t&&(n=Object.assign(n,t instanceof Os?t.o:t));let r=n.ignoreTags,i=[];for(let s=0;sn?r.substring(0,n)+"\u2026":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=ti.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){let e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),i=t.get("tagName",n,e),s=this.toFormattedString(t),o={},a=t.get("className",n,e),l=t.get("target",n,e),c=t.get("rel",n,e),u=t.getObj("attributes",n,e),d=t.getObj("events",n,e);return o.href=r,a&&(o.class=a),l&&(o.target=l),c&&(o.rel=c),u&&Object.assign(o,u),{tagName:i,attributes:o,content:s,eventListeners:d}}};function ni(t,e){class n extends _s{constructor(i,s){super(i,s),this.t=t}}for(let r in e)n.prototype[r]=e[r];return n.t=t,n}var mf=ni("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),gf=ni("text"),cw=ni("nl"),xs=ni("url",{isLink:!0,toHref(t=ti.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){let t=this.tk;return t.length>=2&&t[0].t!==Ms&&t[1].t===xn}}),uw=Object.freeze({__proto__:null,Base:_s,Email:mf,MultiToken:_s,Nl:cw,Text:gf,Url:xs,createTokenClass:ni}),nt=t=>new Be(t);function j_({groups:t}){let e=t.domain.concat([Ka,Za,wn,Xa,Ga,Ya,Qa,el,rt,yf,Es,tl,nl,rl,Mt,sl,As,il]),n=[Ja,xn,vf,At,wf,Es,Ts,xf,kf,Ba,za,Ss,Cs,Ra,Da,Pa,La,Fa,$a,Ha,Va,Ua,Wa,ja,qa],r=[Ka,Ja,Za,Xa,Ga,Ya,Qa,el,rt,Ss,Cs,Es,tl,nl,rl,Ts,Mt,sl,As,il],i=nt(),s=C(i,As);$(s,r,s),$(s,t.domain,s);let o=nt(),a=nt(),l=nt();$(i,t.domain,o),$(i,t.scheme,a),$(i,t.slashscheme,l),$(o,r,s),$(o,t.domain,o);let c=C(o,wn);C(s,wn,c),C(a,wn,c),C(l,wn,c);let u=C(s,At);$(u,r,s),$(u,t.domain,s);let d=nt();$(c,t.domain,d),$(d,t.domain,d);let f=C(d,At);$(f,t.domain,d);let h=nt(mf);$(f,t.tld,h),$(f,t.utld,h),C(c,Ms,h);let p=C(d,rt);C(p,rt,p),$(p,t.domain,d),$(h,t.domain,d),C(h,At,f),C(h,rt,p);let m=C(h,xn);$(m,t.numeric,mf);let g=C(o,rt),y=C(o,At);C(g,rt,g),$(g,t.domain,o),$(y,r,s),$(y,t.domain,o);let b=nt(xs);$(y,t.tld,b),$(y,t.utld,b),$(b,t.domain,o),$(b,r,s),C(b,At,y),C(b,rt,g),C(b,wn,c);let x=C(b,xn),w=nt(xs);$(x,t.numeric,w);let v=nt(xs),T=nt();$(v,e,v),$(v,n,T),$(T,e,v),$(T,n,T),C(b,Mt,v),C(w,Mt,v);let k=C(a,xn),E=C(l,xn),_=C(E,Mt),z=C(_,Mt);$(a,t.domain,o),C(a,At,y),C(a,rt,g),$(l,t.domain,o),C(l,At,y),C(l,rt,g),$(k,t.domain,v),C(k,Mt,v),C(k,Ts,v),$(z,t.domain,v),$(z,e,v),C(z,Mt,v);let N=[[Ss,Cs],[Da,Ra],[Pa,La],[Ba,za],[Fa,$a],[Ha,Va],[Ua,Wa],[ja,qa]];for(let X=0;X=0&&f++,i++,u++;if(f<0)i-=u,i0&&(s.push(of(gf,e,o)),o=[]),i-=f,u-=f;let h=d.t,p=n.slice(i-u,i);s.push(of(h,e,p))}}return o.length>0&&s.push(of(gf,e,o)),s}function of(t,e,n){let r=n[0].s,i=n[n.length-1].e,s=e.slice(r,i);return new t(s,n)}var Ns=typeof console<"u"&&console&&console.warn||(()=>{}),Sf="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",V={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function K_(){return Be.groups={},V.scanner=null,V.parser=null,V.tokenQueue=[],V.pluginQueue=[],V.customSchemes=[],V.initialized=!1,V}function J_(t,e){if(typeof e!="function")throw new Error(`linkifyjs: Invalid token plugin ${e} (expects function)`);for(let n=0;n()=>(t||n((t={exports:{}}).exports,t),t.exports),yf=(n,t)=>{for(var e in t)Er(n,e,{get:t[e],enumerable:!0})},dl=(n,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of pf(t))!gf.call(n,i)&&i!==e&&Er(n,i,{get:()=>t[i],enumerable:!(r=ff(t,i))||r.enumerable});return n};var Tr=(n,t,e)=>(e=n!=null?df(mf(n)):{},dl(t||!n||!n.__esModule?Er(e,"default",{value:n,enumerable:!0}):e,n)),bf=n=>dl(Er({},"__esModule",{value:!0}),n);var ls=hl(at=>{"use strict";var X0="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5m\xF6gensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",Q0="\u03B5\u03BB1\u03C52\u0431\u04331\u0435\u043B3\u0434\u0435\u0442\u04384\u0435\u044E2\u043A\u0430\u0442\u043E\u043B\u0438\u043A6\u043E\u043C3\u043C\u043A\u04342\u043E\u043D1\u0441\u043A\u0432\u04306\u043E\u043D\u043B\u0430\u0439\u043D5\u0440\u04333\u0440\u0443\u04412\u04442\u0441\u0430\u0439\u04423\u0440\u04313\u0443\u043A\u04403\u049B\u0430\u04373\u0570\u0561\u05753\u05D9\u05E9\u05E8\u05D0\u05DC5\u05E7\u05D5\u05DD3\u0627\u0628\u0648\u0638\u0628\u064A5\u0631\u0627\u0645\u0643\u06485\u0644\u0627\u0631\u062F\u06464\u0628\u062D\u0631\u064A\u06465\u062C\u0632\u0627\u0626\u06315\u0633\u0639\u0648\u062F\u064A\u06296\u0639\u0644\u064A\u0627\u06465\u0645\u063A\u0631\u06285\u0645\u0627\u0631\u0627\u062A5\u06CC\u0631\u0627\u06465\u0628\u0627\u0631\u062A2\u0632\u0627\u06314\u064A\u062A\u06433\u06BE\u0627\u0631\u062A5\u062A\u0648\u0646\u06334\u0633\u0648\u062F\u0627\u06463\u0631\u064A\u06295\u0634\u0628\u0643\u06294\u0639\u0631\u0627\u06422\u06282\u0645\u0627\u06464\u0641\u0644\u0633\u0637\u064A\u06466\u0642\u0637\u06313\u0643\u0627\u062B\u0648\u0644\u064A\u06436\u0648\u06453\u0645\u0635\u06312\u0644\u064A\u0633\u064A\u06275\u0648\u0631\u064A\u062A\u0627\u0646\u064A\u06277\u0642\u06394\u0647\u0645\u0631\u0627\u06475\u067E\u0627\u06A9\u0633\u062A\u0627\u06467\u0680\u0627\u0631\u062A4\u0915\u0949\u092E3\u0928\u0947\u091F3\u092D\u093E\u0930\u09240\u092E\u094D3\u094B\u09245\u0938\u0902\u0917\u0920\u09285\u09AC\u09BE\u0982\u09B2\u09BE5\u09AD\u09BE\u09B0\u09A42\u09F0\u09A44\u0A2D\u0A3E\u0A30\u0A244\u0AAD\u0ABE\u0AB0\u0AA44\u0B2D\u0B3E\u0B30\u0B244\u0B87\u0BA8\u0BCD\u0BA4\u0BBF\u0BAF\u0BBE6\u0BB2\u0B99\u0BCD\u0B95\u0BC86\u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0BC2\u0BB0\u0BCD11\u0C2D\u0C3E\u0C30\u0C24\u0C4D5\u0CAD\u0CBE\u0CB0\u0CA44\u0D2D\u0D3E\u0D30\u0D24\u0D025\u0DBD\u0D82\u0D9A\u0DCF4\u0E04\u0E2D\u0E213\u0E44\u0E17\u0E223\u0EA5\u0EB2\u0EA73\u10D2\u10D42\u307F\u3093\u306A3\u30A2\u30DE\u30BE\u30F34\u30AF\u30E9\u30A6\u30C94\u30B0\u30FC\u30B0\u30EB4\u30B3\u30E02\u30B9\u30C8\u30A23\u30BB\u30FC\u30EB3\u30D5\u30A1\u30C3\u30B7\u30E7\u30F36\u30DD\u30A4\u30F3\u30C84\u4E16\u754C2\u4E2D\u4FE11\u56FD1\u570B1\u6587\u7F513\u4E9A\u9A6C\u900A3\u4F01\u4E1A2\u4F5B\u5C712\u4FE1\u606F2\u5065\u5EB72\u516B\u53662\u516C\u53F81\u76CA2\u53F0\u6E7E1\u70632\u5546\u57CE1\u5E971\u68072\u5609\u91CC0\u5927\u9152\u5E975\u5728\u7EBF2\u5927\u62FF2\u5929\u4E3B\u65593\u5A31\u4E502\u5BB6\u96FB2\u5E7F\u4E1C2\u5FAE\u535A2\u6148\u55842\u6211\u7231\u4F603\u624B\u673A2\u62DB\u80582\u653F\u52A11\u5E9C2\u65B0\u52A0\u57612\u95FB2\u65F6\u5C1A2\u66F8\u7C4D2\u673A\u67842\u6DE1\u9A6C\u95213\u6E38\u620F2\u6FB3\u95802\u70B9\u770B2\u79FB\u52A82\u7EC4\u7EC7\u673A\u67844\u7F51\u57401\u5E971\u7AD91\u7EDC2\u8054\u901A2\u8C37\u6B4C2\u8D2D\u72692\u901A\u8CA92\u96C6\u56E22\u96FB\u8A0A\u76C8\u79D14\u98DE\u5229\u6D663\u98DF\u54C12\u9910\u53852\u9999\u683C\u91CC\u62C93\u6E2F2\uB2F7\uB1371\uCEF42\uC0BC\uC1312\uD55C\uAD6D2",Ia="numeric",Da="ascii",Pa="alpha",dr="asciinumeric",ur="alphanumeric",Ra="domain",Rd="emoji",Y0="scheme",Z0="slashscheme",Ma="whitespace";function tb(n,t){return n in t||(t[n]=[]),t[n]}function Ge(n,t,e){t[Ia]&&(t[dr]=!0,t[ur]=!0),t[Da]&&(t[dr]=!0,t[Pa]=!0),t[dr]&&(t[ur]=!0),t[Pa]&&(t[ur]=!0),t[ur]&&(t[Ra]=!0),t[Rd]&&(t[Ra]=!0);for(let r in t){let i=tb(r,e);i.indexOf(n)<0&&i.push(n)}}function eb(n,t){let e={};for(let r in t)t[r].indexOf(n)>=0&&(e[r]=!0);return e}function Et(n=null){this.j={},this.jr=[],this.jd=null,this.t=n}Et.groups={};Et.prototype={accepts(){return!!this.t},go(n){let t=this,e=t.j[n];if(e)return e;for(let r=0;rn.ta(t,e,r,i),Z=(n,t,e,r,i)=>n.tr(t,e,r,i),Od=(n,t,e,r,i)=>n.ts(t,e,r,i),w=(n,t,e,r,i)=>n.tt(t,e,r,i),pe="WORD",La="UWORD",Ld="ASCIINUMERICAL",zd="ALPHANUMERICAL",br="LOCALHOST",za="TLD",Ba="UTLD",Oi="SCHEME",xn="SLASH_SCHEME",Va="NUM",Fa="WS",Wa="NL",fr="OPENBRACE",pr="CLOSEBRACE",Pi="OPENBRACKET",Ri="CLOSEBRACKET",Li="OPENPAREN",zi="CLOSEPAREN",Bi="OPENANGLEBRACKET",Fi="CLOSEANGLEBRACKET",$i="FULLWIDTHLEFTPAREN",Hi="FULLWIDTHRIGHTPAREN",Vi="LEFTCORNERBRACKET",Wi="RIGHTCORNERBRACKET",Ui="LEFTWHITECORNERBRACKET",ji="RIGHTWHITECORNERBRACKET",_i="FULLWIDTHLESSTHAN",Ki="FULLWIDTHGREATERTHAN",qi="AMPERSAND",Ji="APOSTROPHE",Gi="ASTERISK",Te="AT",Xi="BACKSLASH",Qi="BACKTICK",Yi="CARET",Me="COLON",Ua="COMMA",Zi="DOLLAR",Zt="DOT",ts="EQUALS",ja="EXCLAMATION",$t="HYPHEN",mr="PERCENT",es="PIPE",ns="PLUS",rs="POUND",gr="QUERY",_a="QUOTE",Bd="FULLWIDTHMIDDLEDOT",Ka="SEMI",te="SLASH",yr="TILDE",is="UNDERSCORE",Fd="EMOJI",ss="SYM",$d=Object.freeze({__proto__:null,ALPHANUMERICAL:zd,AMPERSAND:qi,APOSTROPHE:Ji,ASCIINUMERICAL:Ld,ASTERISK:Gi,AT:Te,BACKSLASH:Xi,BACKTICK:Qi,CARET:Yi,CLOSEANGLEBRACKET:Fi,CLOSEBRACE:pr,CLOSEBRACKET:Ri,CLOSEPAREN:zi,COLON:Me,COMMA:Ua,DOLLAR:Zi,DOT:Zt,EMOJI:Fd,EQUALS:ts,EXCLAMATION:ja,FULLWIDTHGREATERTHAN:Ki,FULLWIDTHLEFTPAREN:$i,FULLWIDTHLESSTHAN:_i,FULLWIDTHMIDDLEDOT:Bd,FULLWIDTHRIGHTPAREN:Hi,HYPHEN:$t,LEFTCORNERBRACKET:Vi,LEFTWHITECORNERBRACKET:Ui,LOCALHOST:br,NL:Wa,NUM:Va,OPENANGLEBRACKET:Bi,OPENBRACE:fr,OPENBRACKET:Pi,OPENPAREN:Li,PERCENT:mr,PIPE:es,PLUS:ns,POUND:rs,QUERY:gr,QUOTE:_a,RIGHTCORNERBRACKET:Wi,RIGHTWHITECORNERBRACKET:ji,SCHEME:Oi,SEMI:Ka,SLASH:te,SLASH_SCHEME:xn,SYM:ss,TILDE:yr,TLD:za,UNDERSCORE:is,UTLD:Ba,UWORD:La,WORD:pe,WS:Fa}),Qt=/[a-z]/,Sn=/\p{L}/u,Ii=/\p{Emoji}/u,nb=/\ufe0f/,Yt=/\d/,Di=/\s/,rb=Object.freeze({__proto__:null,ASCII_LETTER:Qt,DIGIT:Yt,EMOJI:Ii,EMOJI_VARIATION:nb,LETTER:Sn,SPACE:Di}),Id="\r",Aa=`
+`,ib="\uFE0F",sb="\u200D",Na="\uFFFC",Ai=null,Ni=null;function ob(n=[]){let t={};Et.groups=t;let e=new Et;Ai==null&&(Ai=Dd(X0)),Ni==null&&(Ni=Dd(Q0)),w(e,"'",Ji),w(e,"{",fr),w(e,"}",pr),w(e,"[",Pi),w(e,"]",Ri),w(e,"(",Li),w(e,")",zi),w(e,"<",Bi),w(e,">",Fi),w(e,"\uFF08",$i),w(e,"\uFF09",Hi),w(e,"\u300C",Vi),w(e,"\u300D",Wi),w(e,"\u300E",Ui),w(e,"\u300F",ji),w(e,"\uFF1C",_i),w(e,"\uFF1E",Ki),w(e,"&",qi),w(e,"*",Gi),w(e,"@",Te),w(e,"`",Qi),w(e,"^",Yi),w(e,":",Me),w(e,",",Ua),w(e,"$",Zi),w(e,".",Zt),w(e,"=",ts),w(e,"!",ja),w(e,"-",$t),w(e,"%",mr),w(e,"|",es),w(e,"+",ns),w(e,"#",rs),w(e,"?",gr),w(e,'"',_a),w(e,"/",te),w(e,";",Ka),w(e,"~",yr),w(e,"_",is),w(e,"\\",Xi),w(e,"\u30FB",Bd);let r=Z(e,Yt,Va,{[Ia]:!0});Z(r,Yt,r);let i=Z(r,Qt,Ld,{[dr]:!0}),s=Z(r,Sn,zd,{[ur]:!0}),o=Z(e,Qt,pe,{[Da]:!0});Z(o,Yt,i),Z(o,Qt,o),Z(i,Yt,i),Z(i,Qt,i);let a=Z(e,Sn,La,{[Pa]:!0});Z(a,Qt),Z(a,Yt,s),Z(a,Sn,a),Z(s,Yt,s),Z(s,Qt),Z(s,Sn,s);let l=w(e,Aa,Wa,{[Ma]:!0}),c=w(e,Id,Fa,{[Ma]:!0}),u=Z(e,Di,Fa,{[Ma]:!0});w(e,Na,u),w(c,Aa,l),w(c,Na,u),Z(c,Di,u),w(u,Id),w(u,Aa),Z(u,Di,u),w(u,Na,u);let h=Z(e,Ii,Fd,{[Rd]:!0});w(h,"#"),Z(h,Ii,h),w(h,ib,h);let d=w(h,sb);w(d,"#"),Z(d,Ii,h);let f=[[Qt,o],[Yt,i]],p=[[Qt,null],[Sn,a],[Yt,s]];for(let m=0;mm[0]>g[0]?1:-1);for(let m=0;m=0?b[Ra]=!0:Qt.test(g)?Yt.test(g)?b[dr]=!0:b[Da]=!0:b[Ia]=!0,Od(e,g,g,b)}return Od(e,"localhost",br,{ascii:!0}),e.jd=new Et(ss),{start:e,tokens:Object.assign({groups:t},$d)}}function Hd(n,t){let e=Vd(t.replace(/[A-Z]/g,a=>a.toLowerCase())),r=e.length,i=[],s=0,o=0;for(;o=0&&(h+=e[o].length,d++),c+=e[o].length,s+=e[o].length,o++;s-=h,o-=d,c-=h,i.push({t:u.t,v:t.slice(s-c,s),s:s-c,e:s})}return i}function Vd(n){let t=[],e=n.length,r=0;for(;r56319||r+1===e||(s=n.charCodeAt(r+1))<56320||s>57343?n[r]:n.slice(r,r+2);t.push(o),r+=o.length}return t}function Ee(n,t,e,r,i){let s,o=t.length;for(let a=0;a=0;)s++;if(s>0){t.push(e.join(""));for(let o=parseInt(n.substring(r,r+s),10);o>0;o--)e.pop();r+=s}else e.push(n[r]),r++}return t}var Cn={defaultProtocol:"http",events:null,format:Pd,formatHref:Pd,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function kr(n,t=null){let e=Object.assign({},Cn);n&&(e=Object.assign(e,n instanceof kr?n.o:n));let r=e.ignoreTags,i=[];for(let s=0;se?r.substring(0,e)+"\u2026":r},toFormattedHref(n){return n.get("formatHref",this.toHref(n.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(n=Cn.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(n),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(n){return{type:this.t,value:this.toFormattedString(n),isLink:this.isLink,href:this.toFormattedHref(n),start:this.startIndex(),end:this.endIndex()}},validate(n){return n.get("validate",this.toString(),this)},render(n){let t=this,e=this.toHref(n.get("defaultProtocol")),r=n.get("formatHref",e,this),i=n.get("tagName",e,t),s=this.toFormattedString(n),o={},a=n.get("className",e,t),l=n.get("target",e,t),c=n.get("rel",e,t),u=n.getObj("attributes",e,t),h=n.getObj("events",e,t);return o.href=r,a&&(o.class=a),l&&(o.target=l),c&&(o.rel=c),u&&Object.assign(o,u),{tagName:i,attributes:o,content:s,eventListeners:h}}};function En(n,t){class e extends vr{constructor(i,s){super(i,s),this.t=n}}for(let r in t)e.prototype[r]=t[r];return e.t=n,e}var $a=En("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Ha=En("text"),Wd=En("nl"),hr=En("url",{isLink:!0,toHref(n=Cn.defaultProtocol){return this.hasProtocol()?this.v:`${n}://${this.v}`},hasProtocol(){let n=this.tk;return n.length>=2&&n[0].t!==br&&n[1].t===Me}}),Ud=Object.freeze({__proto__:null,Base:vr,Email:$a,MultiToken:vr,Nl:Wd,Text:Ha,Url:hr,createTokenClass:En}),Ft=n=>new Et(n);function lb({groups:n}){let t=n.domain.concat([qi,Gi,Te,Xi,Qi,Yi,Zi,ts,$t,Va,mr,es,ns,rs,te,ss,yr,is]),e=[Ji,Me,Ua,Zt,ja,mr,gr,_a,Ka,Bi,Fi,fr,pr,Ri,Pi,Li,zi,$i,Hi,Vi,Wi,Ui,ji,_i,Ki],r=[qi,Ji,Gi,Xi,Qi,Yi,Zi,ts,$t,fr,pr,mr,es,ns,rs,gr,te,ss,yr,is],i=Ft(),s=w(i,yr);B(s,r,s),B(s,n.domain,s);let o=Ft(),a=Ft(),l=Ft();B(i,n.domain,o),B(i,n.scheme,a),B(i,n.slashscheme,l),B(o,r,s),B(o,n.domain,o);let c=w(o,Te);w(s,Te,c),w(a,Te,c),w(l,Te,c);let u=w(s,Zt);B(u,r,s),B(u,n.domain,s);let h=Ft();B(c,n.domain,h),B(h,n.domain,h);let d=w(h,Zt);B(d,n.domain,h);let f=Ft($a);B(d,n.tld,f),B(d,n.utld,f),w(c,br,f);let p=w(h,$t);w(p,$t,p),B(p,n.domain,h),B(f,n.domain,h),w(f,Zt,d),w(f,$t,p);let m=w(f,Me);B(m,n.numeric,$a);let g=w(o,$t),y=w(o,Zt);w(g,$t,g),B(g,n.domain,o),B(y,r,s),B(y,n.domain,o);let b=Ft(hr);B(y,n.tld,b),B(y,n.utld,b),B(b,n.domain,o),B(b,r,s),w(b,Zt,y),w(b,$t,g),w(b,Te,c);let C=w(b,Me),M=Ft(hr);B(C,n.numeric,M);let x=Ft(hr),N=Ft();B(x,t,x),B(x,e,N),B(N,t,x),B(N,e,N),w(b,te,x),w(M,te,x);let k=w(a,Me),E=w(l,Me),T=w(E,te),$=w(T,te);B(a,n.domain,o),w(a,Zt,y),w(a,$t,g),B(l,n.domain,o),w(l,Zt,y),w(l,$t,g),B(k,n.domain,x),w(k,te,x),w(k,gr,x),B($,n.domain,x),B($,t,x),w($,te,x);let kt=[[fr,pr],[Pi,Ri],[Li,zi],[Bi,Fi],[$i,Hi],[Vi,Wi],[Ui,ji],[_i,Ki]];for(let q=0;q=0&&d++,i++,u++;if(d<0)i-=u,i0&&(s.push(Oa(Ha,t,o)),o=[]),i-=d,u-=d;let f=h.t,p=e.slice(i-u,i);s.push(Oa(f,t,p))}}return o.length>0&&s.push(Oa(Ha,t,o)),s}function Oa(n,t,e){let r=e[0].s,i=e[e.length-1].e,s=t.slice(r,i);return new n(s,e)}var wr=typeof console<"u"&&console&&console.warn||(()=>{}),qa="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",F={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function ub(){return Et.groups={},F.scanner=null,F.parser=null,F.tokenQueue=[],F.pluginQueue=[],F.customSchemes=[],F.initialized=!1,F}function hb(n,t){if(typeof t!="function")throw new Error(`linkifyjs: Invalid token plugin ${t} (expects function)`);for(let e=0;e{var Pf=class{constructor(){}dehydrate(e,n={},r={}){if(!e||!e.content)return"";let i=[];e.content.forEach(a=>{let l=this.serializeNode(a);l&&i.push(l)});let s=i.join(`
+3. "-" cannot repeat`);F.customSchemes.push([n,t])}function jd(){F.scanner=ob(F.customSchemes);for(let n=0;n{var sl=class{constructor(){}dehydrate(t,e={},r={}){if(!t||!t.content)return"";let i=[];t.content.forEach(a=>{let l=this.serializeNode(a);l&&i.push(l)});let s=i.join(`
-`),o=Object.entries(n);return o.length>0&&(s+=`
+`),o=Object.entries(e);return o.length>0&&(s+=`
---
`,o.forEach(([a,l])=>{let c=l.content.map(u=>this.serializeNode(u)).join(" ").trim();s+=`[^${a}]: ${c}
-`})),s}hydrate(e){let n=e.split(`
+`})),s}hydrate(t){let e=t.split(`
`),r=[],i={},s=null,o=[],a=()=>{if(o.length===0&&!s)return;let l=o.join(`
-`).trim();if(!l&&!s)return;let c=s?.type||"body",u={id:s?.id||this.generateShortId()},d=l.match(/^(#{1,4})\s+([\s\S]*)/);if(d&&!s){let f=d[1].length;f<=3?c=`heading-${f}`:c="body",l=d[2]}r.push({type:c,attrs:u,content:this.parseInline(l)}),o=[],s=null};for(let l=0;ln.length-20){a();continue}let d=c.match(//);if(d){a(),s={id:d[1],type:d[2]};continue}if(c.trim()===""){a();continue}o.push(c)}return a(),{type:"manuscript",doc:{type:"doc",content:r},footnotes:i,comments:{}}}serializeNode(e){if(!e)return"";switch(e.type){case"heading":case"heading-1":case"heading-2":case"heading-3":let n=e.attrs?.level;return!n&&e.type.startsWith("heading-")&&(n=parseInt(e.type.split("-")[1])),`${"#".repeat(n||1)} ${this.serializeInline(e.content)}`;case"body":case"paragraph":case"supertitle":case"title":case"subtitle":case"epigraph":case"body-first":case"footnote":return this.serializeInline(e.content);case"horizontalRule":return"---";case"hardBreak":return`
-`;default:return this.serializeInline(e.content)}}serializeInline(e){return!e||!Array.isArray(e)?"":e.map(n=>{if(n.type==="footnoteMarker"||n.type==="footnote")return`[^${n.attrs?.id}]`;if(n.type==="internalLink"){let i=n.attrs?.alias||n.attrs?.target;return`[[${n.attrs?.target}|${i}]]`}let r=n.text||"";return n.marks&&n.marks.forEach(i=>{switch(i.type){case"bold":r=`**${r}**`;break;case"italic":r=`*${r}*`;break;case"code":r=`\`${r}\``;break;case"strike":r=`~~${r}~~`;break;case"underline":r=`${r}`;break;case"commentHighlight":r=`${r}`;break}}),r}).join("")}parseInline(e){let n=[],r=/(\[\^([\w-]+)\])|(\[\[(.*?)(?:\|(.*?))?\]\])|(([\s\S]*?))|(\*\*(.*?)\*\*)|(\*(.*?)\*)|(`(.*?)`)|(~~(.*?)~~)|((.*?)<\/u>)/g,i=0,s;for(;(s=r.exec(e))!==null;){if(s.index>i&&n.push({type:"text",text:e.substring(i,s.index)}),s[1])n.push({type:"footnoteMarker",attrs:{id:s[2]}});else if(s[3]){let o=s[4],a=s[5]||o;n.push({type:"internalLink",attrs:{target:o,alias:a}})}else if(s[6]){let o=s[7],a=s[8];this.parseInline(a).forEach(c=>{c.type==="text"&&(c.marks||(c.marks=[]),c.marks.push({type:"commentHighlight",attrs:{threadId:o}})),n.push(c)})}else s[9]?n.push({type:"text",text:s[10],marks:[{type:"bold"}]}):s[11]?n.push({type:"text",text:s[12],marks:[{type:"italic"}]}):s[13]?n.push({type:"text",text:s[14],marks:[{type:"code"}]}):s[15]?n.push({type:"text",text:s[16],marks:[{type:"strike"}]}):s[17]&&n.push({type:"text",text:s[18],marks:[{type:"underline"}]});i=r.lastIndex}return ibl});module.exports=Bw(wN);var Q=require("obsidian");var ii=require("obsidian");function Ee(t){this.content=t}Ee.prototype={constructor:Ee,find:function(t){for(var e=0;e>1}};Ee.from=function(t){if(t instanceof Ee)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Ee(e)};var vl=Ee;function Kf(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),s=e.child(r);if(i==s){n+=i.nodeSize;continue}if(!i.sameMarkup(s))return n;if(i.isText&&i.text!=s.text){for(let o=0;i.text[o]==s.text[o];o++)n++;return n}if(i.content.size||s.content.size){let o=Kf(i.content,s.content,n+1);if(o!=null)return o}n+=i.nodeSize}}function Jf(t,e,n,r){for(let i=t.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:n,b:r};let o=t.child(--i),a=e.child(--s),l=o.nodeSize;if(o==a){n-=l,r-=l;continue}if(!o.sameMarkup(a))return{a:n,b:r};if(o.isText&&o.text!=a.text){let c=0,u=Math.min(o.text.length,a.text.length);for(;ce&&r(l,i+a,s||null,o)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,e-u),Math.min(l.content.size,n-u),r,i+u)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let s="",o=!0;return this.nodesBetween(e,n,(a,l)=>{let c=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&r&&(o?o=!1:s+=r),s+=c},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),s=1);se)for(let s=0,o=0;oe&&((on)&&(a.isText?a=a.cut(Math.max(0,e-o),Math.min(a.text.length,n-o)):a=a.cut(Math.max(0,e-o-1),Math.min(a.content.size,n-o-1))),r.push(a),i+=a.nodeSize),o=l}return new t(r,i)}cutByIndex(e,n){return e==n?t.empty:e==0&&n==this.content.length?this:new t(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),s=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new t(i,s)}addToStart(e){return new t([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new t(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;nthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),s=r+i.nodeSize;if(s>=e)return s==e?Bs(n+1,s):Bs(n,r);r=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 t.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new t(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return t.empty;let n,r=0;for(let i=0;ithis.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(s)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;nr.type.rank-i.type.rank),n}};W.none=[];var Cn=class extends Error{},A=class t{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=Xf(this.content,e+this.openStart,n);return r&&new t(r,this.openStart,this.openEnd)}removeBetween(e,n){return new t(Zf(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 t.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new t(S.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=e.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)i++;return new t(e,r,i)}};A.empty=new A(S.empty,0,0);function Zf(t,e,n){let{index:r,offset:i}=t.findIndex(e),s=t.maybeChild(r),{index:o,offset:a}=t.findIndex(n);if(i==e||s.isText){if(a!=n&&!t.child(o).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=o)throw new RangeError("Removing non-flat range");return t.replaceChild(r,s.copy(Zf(s.content,e-i-1,n-i-1)))}function Xf(t,e,n,r){let{index:i,offset:s}=t.findIndex(e),o=t.maybeChild(i);if(s==e||o.isText)return r&&!r.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let a=Xf(o.content,e-s-1,n,o);return a&&t.replaceChild(i,o.copy(a))}function zw(t,e,n){if(n.openStart>t.depth)throw new Cn("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Cn("Inconsistent open depths");return Gf(t,e,n,0)}function Gf(t,e,n,r){let i=t.index(r),s=t.node(r);if(i==e.index(r)&&r=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function oi(t,e,n,r){let i=(e||t).node(n),s=0,o=e?e.index(n):i.childCount;t&&(s=t.index(n),t.depth>n?s++:t.textOffset&&(kn(t.nodeAfter,r),s++));for(let a=s;ai&&kl(t,e,i+1),o=r.depth>i&&kl(n,r,i+1),a=[];return oi(null,t,i,a),s&&o&&e.index(i)==n.index(i)?(Yf(s,o),kn(Sn(s,Qf(t,e,n,r,i+1)),a)):(s&&kn(Sn(s,$s(t,e,i+1)),a),oi(e,n,i,a),o&&kn(Sn(o,$s(n,r,i+1)),a)),oi(r,null,i,a),new S(a)}function $s(t,e,n){let r=[];if(oi(null,t,n,r),t.depth>n){let i=kl(t,e,n+1);kn(Sn(i,$s(t,e,n+1)),r)}return oi(e,null,n,r),new S(r)}function Fw(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let s=n-1;s>=0;s--)i=e.node(s).copy(S.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}var Hs=class t{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],i=e.child(n);return r?e.child(n).cut(r):i}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],i=n==0?0:this.path[n*3-1]+1;for(let s=0;s0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new En(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=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,s=n;for(let o=e;;){let{index:a,offset:l}=o.content.findIndex(s),c=s-l;if(r.push(o,a,i+l),!c||(o=o.child(a),o.isText))break;s=c-1,i+=l+1}return new t(n,r,s)}static resolveCached(e,n){let r=zf.get(e);if(r)for(let s=0;se&&this.nodesBetween(e,n,s=>(r.isInSet(s.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),eh(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=S.empty,i=0,s=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,i,s),a=o&&o.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=i;ln.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 i=S.fromJSON(e,n.content),s=e.nodeType(n.type).create(n.attrs,i,r);return s.type.checkAttrs(s.attrs),s}};ze.prototype.text=void 0;var Cl=class t extends ze{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):eh(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 t(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new t(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 eh(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}var Tn=class t{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new El(e,n);if(r.next==null)return t.empty;let i=th(r);r.next&&r.err("Unexpected trailing text");let s=Jw(Kw(i));return Zw(s,r),s}matchType(e){for(let n=0;nc.createAndFill()));for(let c=0;c=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 i=0;i{let s=i+(r.validEnd?"*":" ")+" ";for(let o=0;o"+e.indexOf(r.next[o].next);return s}).join(`
-`)}};Tn.empty=new Tn(!0);var El=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 th(t){let e=[];do e.push(Vw(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Vw(t){let e=[];do e.push(Uw(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function Uw(t){let e=qw(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=Ww(t,e);else break;return e}function Ff(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function Ww(t,e){let n=Ff(t),r=n;return t.eat(",")&&(t.next!="}"?r=Ff(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function jw(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let s in n){let o=n[s];o.isInGroup(e)&&i.push(o)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function qw(t){if(t.eat("(")){let e=th(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=jw(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 Kw(t){let e=[[]];return i(s(t,0),n()),e;function n(){return e.push([])-1}function r(o,a,l){let c={term:l,to:a};return e[o].push(c),c}function i(o,a){o.forEach(l=>l.to=a)}function s(o,a){if(o.type=="choice")return o.exprs.reduce((l,c)=>l.concat(s(c,a)),[]);if(o.type=="seq")for(let l=0;;l++){let c=s(o.exprs[l],a);if(l==o.exprs.length-1)return c;i(c,a=n())}else if(o.type=="star"){let l=n();return r(a,l),i(s(o.expr,l),l),[r(l)]}else if(o.type=="plus"){let l=n();return i(s(o.expr,a),l),i(s(o.expr,l),l),[r(l)]}else{if(o.type=="opt")return[r(a)].concat(s(o.expr,a));if(o.type=="range"){let l=a;for(let c=0;c{t[o].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let u=0;u{c||i.push([a,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let s=e[r.join(",")]=new Tn(r.indexOf(t.length-1)>-1);for(let o=0;o-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:ih(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new ze(this,this.computeAttrs(e),S.from(n),W.setFrom(r))}createChecked(e=null,n,r){return n=S.from(n),this.checkContent(n),new ze(this,this.computeAttrs(e),n,W.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=S.from(n),n.size){let o=this.contentMatch.fillBefore(n);if(!o)return null;n=o.append(n)}let i=this.contentMatch.matchFragment(n),s=i&&i.fillBefore(S.empty,!0);return s?new ze(this,e,n.append(s),W.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;nr[s]=new t(s,n,o));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let s in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function Xw(t,e,n){let r=n.split("|");return i=>{let s=i===null?"null":typeof i;if(r.indexOf(s)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${s}`)}}var Tl=class{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?Xw(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}},li=class t{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=oh(e,i.attrs),this.excluded=null;let s=rh(this.attrs);this.instance=s?new W(this,s):null}create(e=null){return!e&&this.instance?this.instance:new W(this,ih(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((s,o)=>r[s]=new t(s,i++,n,o)),r}removeFromSet(e){for(var n=0;n-1}},ar=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=vl.from(e.nodes),n.marks=vl.from(e.marks||{}),this.nodes=Vs.compile(this.spec.nodes,this),this.marks=li.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let s=this.nodes[i],o=s.spec.content||"",a=s.spec.marks;if(s.contentMatch=r[o]||(r[o]=Tn.parse(o,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=a=="_"?null:a?Hf(this,a.split(" ")):a==""||!s.inlineContent?[]:null}for(let i in this.marks){let s=this.marks[i],o=s.spec.excludes;s.excluded=o==null?[s]:o==""?[]:Hf(this,o.split(" "))}this.nodeFromJSON=i=>ze.fromJSON(this,i),this.markFromJSON=i=>W.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Vs){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,i)}text(e,n){let r=this.nodes.text;return new Cl(r,r.defaultAttrs,e,W.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}};function Hf(t,e){let n=[];for(let r=0;r-1)&&n.push(o=l)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function Gw(t){return t.tag!=null}function Yw(t){return t.style!=null}var ut=class t{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(Gw(i))this.tags.push(i);else if(Yw(i)){let s=/[^=]*/.exec(i.style)[0];r.indexOf(s)<0&&r.push(s),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let s=e.nodes[i.node];return s.contentMatch.matchType(s)})}parse(e,n={}){let r=new Us(this,n,!1);return r.addAll(e,W.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new Us(this,n,!0);return r.addAll(e,W.none,n.from,n.to),A.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;ie.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(o.getAttrs){let l=o.getAttrs(n);if(l===!1)continue;o.attrs=l||void 0}return o}}}static schemaRules(e){let n=[];function r(i){let s=i.priority==null?50:i.priority,o=0;for(;o{r(o=Uf(o)),o.mark||o.ignore||o.clearMark||(o.mark=i)})}for(let i in e.nodes){let s=e.nodes[i].spec.parseDOM;s&&s.forEach(o=>{r(o=Uf(o)),o.node||o.ignore||o.mark||(o.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new t(e,t.schemaRules(e)))}},ah={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},Qw={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},lh={ol:!0,ul:!0},ci=1,Al=2,ai=4;function Vf(t,e,n){return e!=null?(e?ci:0)|(e==="full"?Al:0):t&&t.whitespace=="pre"?ci|Al:n&~ai}var or=class{constructor(e,n,r,i,s,o){this.type=e,this.attrs=n,this.marks=r,this.solid=i,this.options=o,this.content=[],this.activeMarks=W.none,this.match=s||(o&ai?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(S.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&ci)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let s=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-i[0].length))}}let n=S.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(S.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&&!ah.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},Us=class{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,s,o=Vf(null,n.preserveWhitespace,0)|(r?ai:0);i?s=new or(i.type,i.attrs,W.none,!0,n.topMatch||i.type.contentMatch,o):r?s=new or(null,null,W.none,!0,null,o):s=new or(e.schema.topNodeType,null,W.none,!0,null,o),this.nodes=[s],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,i=this.top,s=i.options&Al?"full":this.localPreserveWS||(i.options&ci)>0,{schema:o}=this.parser;if(s==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(s)if(s==="full")r=r.replace(/\r\n?/g,`
-`);else if(o.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(o.linebreakReplacement.create())){let a=r.split(/\r?\n|\r/);for(let l=0;l!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,i){let s,o;if(n.node)if(o=this.parser.schema.nodes[n.node],o.isLeaf)this.insertNode(o.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let l=this.enter(o,n.attrs||null,r,n.preserveWhitespace);l&&(s=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let a=this.top;if(o&&o.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);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)}s&&this.sync(a)&&this.open--}addAll(e,n,r,i){let s=r||0;for(let o=r?e.childNodes[r]:e.firstChild,a=i==null?null:e.childNodes[i];o!=a;o=o.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(o,n);this.findAtPoint(e,s)}findPlace(e,n,r){let i,s;for(let o=this.open,a=0;o>=0;o--){let l=this.nodes[o],c=l.findWrapping(e);if(c&&(!i||i.length>c.length+a)&&(i=c,s=l,!c.length))break;if(l.solid){if(r)break;a+=2}}if(!i)return null;this.sync(s);for(let o=0;o(o.type?o.type.allowsMarkType(c.type):Wf(c.type,e))?(l=c.addToSet(l),!1):!0),this.nodes.push(new or(e,n,l,i,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|=ci)}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 i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),s=-(r?r.depth+1:0)+(i?0:1),o=(a,l)=>{for(;a>=0;a--){let c=n[a];if(c==""){if(a==n.length-1||a==0)continue;for(;l>=s;l--)if(o(a-1,l))return!0;return!1}else{let u=l>0||l==0&&i?this.nodes[l].type:r&&l>=s?r.node(l-s).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;l--}}return!0};return o(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 ex(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&lh.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function tx(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Uf(t){let e={};for(let n in t)e[n]=t[n];return e}function Wf(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let s=[],o=a=>{s.push(a);for(let l=0;l{if(s.length||o.marks.length){let a=0,l=0;for(;a=0;i--){let s=this.serializeMark(e.marks[i],e.isInline,n);s&&((s.contentDOM||s.dom).appendChild(r),r=s.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&zs(xl(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return zs(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new t(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=jf(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return jf(e.marks)}};function jf(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function xl(t){return t.document||window.document}var qf=new WeakMap;function nx(t){let e=qf.get(t);return e===void 0&&qf.set(t,e=rx(t)),e}function rx(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 i=0;i-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 o=i.indexOf(" ");o>0&&(n=i.slice(0,o),i=i.slice(o+1));let a,l=n?t.createElementNS(n,i):t.createElement(i),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 f=d.indexOf(" ");f>0?l.setAttributeNS(d.slice(0,f),d.slice(f+1),c[d]):d=="style"&&l.style?l.style.cssText=c[d]:l.setAttribute(d,c[d])}}for(let d=u;du)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:h,contentDOM:p}=zs(t,f,n,r);if(l.appendChild(h),p){if(a)throw new RangeError("Multiple content holes");a=p}}}return{dom:l,contentDOM:a}}var dh=65535,fh=Math.pow(2,16);function ix(t,e){return t+e*fh}function ch(t){return t&dh}function sx(t){return(t-(t&dh))/fh}var hh=1,ph=2,Ws=4,mh=8,fi=class{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&mh)>0}get deletedBefore(){return(this.delInfo&(hh|Ws))>0}get deletedAfter(){return(this.delInfo&(ph|Ws))>0}get deletedAcross(){return(this.delInfo&Ws)>0}},It=class t{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&t.empty)return t.empty}recover(e){let n=0,r=ch(e);if(!this.inverted)for(let i=0;ie)break;let c=this.ranges[a+s],u=this.ranges[a+o],d=l+c;if(e<=d){let f=c?e==l?-1:e==d?1:n:n,h=l+i+(f<0?0:u);if(r)return h;let p=e==(n<0?l:d)?null:ix(a/3,e-l),m=e==l?ph:e==d?hh:Ws;return(n<0?e!=l:e!=d)&&(m|=mh),new fi(h,m,p)}i+=u-c}return r?e+i:new fi(e+i,0,null)}touches(e,n){let r=0,i=ch(n),s=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;ae)break;let c=this.ranges[a+s],u=l+c;if(e<=u&&a==i*3)return!0;r+=this.ranges[a+o]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,s=0;i=0;n--){let i=e.getMirror(n);this.appendMap(e._maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new t;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;rs&&l!o.isAtom||!a.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),n.openStart,n.openEnd);return ve.fromReplace(e,this.from,this.to,s)}invert(){return new Dt(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 t(n.pos,r.pos,this.mark)}merge(e){return e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new t(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 t(n.from,n.to,e.markFromJSON(n.mark))}};me.jsonID("addMark",pi);var Dt=class t extends me{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 A(Dl(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return ve.fromReplace(e,this.from,this.to,r)}invert(){return new pi(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 t(n.pos,r.pos,this.mark)}merge(e){return e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new t(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 t(n.from,n.to,e.markFromJSON(n.mark))}};me.jsonID("removeMark",Dt);var mi=class t extends me{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return ve.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return ve.fromReplace(e,this.pos,this.pos+1,new A(S.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 i=0;ir.pos?null:new t(n.pos,r.pos,i,s,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 t(n.from,n.to,n.gapFrom,n.gapTo,A.fromJSON(e,n.slice),n.insert,!!n.structure)}};me.jsonID("replaceAround",ce);function Ol(t,e,n){let r=t.resolve(e),i=n-e,s=r.depth;for(;i>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,i--;if(i>0){let o=r.node(s).maybeChild(r.indexAfter(s));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}function ox(t,e,n,r){let i=[],s=[],o,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 f=Math.max(c,e),h=Math.min(c+l.nodeSize,n),p=r.addToSet(d);for(let m=0;mt.step(l)),s.forEach(l=>t.step(l))}function ax(t,e,n,r){let i=[],s=0;t.doc.nodesBetween(e,n,(o,a)=>{if(!o.isInline)return;s++;let l=null;if(r instanceof li){let c=o.marks,u;for(;u=r.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(o.marks)&&(l=[r]):l=o.marks;if(l&&l.length){let c=Math.min(a+o.nodeSize,n);for(let u=0;ut.step(new Dt(o.from,o.to,o.style)))}function Rl(t,e,n,r=n.contentMatch,i=!0){let s=t.doc.nodeAt(e),o=[],a=e+1;for(let l=0;l=0;l--)t.step(o[l])}function lx(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Rt(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth,i=0,s=0;;--r){let o=t.$from.node(r),a=t.$from.index(r)+i,l=t.$to.indexAfter(r)-s;if(rn;p--)m||r.index(p)>0?(m=!0,u=S.from(r.node(p).copy(u)),d++):l--;let f=S.empty,h=0;for(let p=s,m=!1;p>n;p--)m||i.after(p+1)=0;o--){if(r.size){let a=n[o].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=S.from(n[o].type.create(n[o].attrs,r))}let i=e.start,s=e.end;t.step(new ce(i,s,i,s,new A(r,0,0),n.length,!0))}function hx(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=t.steps.length;t.doc.nodesBetween(e,n,(o,a)=>{let l=typeof i=="function"?i(o):i;if(o.isTextblock&&!o.hasMarkup(r,l)&&px(t.doc,t.mapping.slice(s).map(a),r)){let c=null;if(r.schema.linebreakReplacement){let h=r.whitespace=="pre",p=!!r.contentMatch.matchType(r.schema.linebreakReplacement);h&&!p?c=!1:!h&&p&&(c=!0)}c===!1&&yh(t,o,a,s),Rl(t,t.mapping.slice(s).map(a,1),r,void 0,c===null);let u=t.mapping.slice(s),d=u.map(a,1),f=u.map(a+o.nodeSize,1);return t.step(new ce(d,f,d+1,f-1,new A(S.from(r.create(l,null,o.marks)),0,0),1,!0)),c===!0&&gh(t,o,a,s),!1}})}function gh(t,e,n,r){e.forEach((i,s)=>{if(i.isText){let o,a=/\r?\n|\r/g;for(;o=a.exec(i.text);){let l=t.mapping.slice(r).map(n+1+s+o.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function yh(t,e,n,r){e.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let o=t.mapping.slice(r).map(n+1+s);t.replaceWith(o,o+1,e.type.schema.text(`
-`))}})}function px(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function mx(t,e,n,r,i){let s=t.doc.nodeAt(e);if(!s)throw new RangeError("No node at given position");n||(n=s.type);let o=n.create(r,null,i||s.marks);if(s.isLeaf)return t.replaceWith(e,e+s.nodeSize,o);if(!n.validContent(s.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new ce(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new A(S.from(o),0,0),1,!0))}function He(t,e,n=1,r){let i=t.resolve(e),s=i.depth-n,o=r&&r[r.length-1]||i.parent;if(s<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,u=n-2;c>s;c--,u--){let d=i.node(c),f=i.index(c);if(d.type.spec.isolating)return!1;let h=d.content.cutByIndex(f,d.childCount),p=r&&r[u+1];p&&(h=h.replaceChild(0,p.type.create(p.attrs)));let m=r&&r[u]||d;if(!d.canReplace(f+1,d.childCount)||!m.type.validContent(h))return!1}let a=i.indexAfter(s),l=r&&r[0];return i.node(s).canReplaceWith(a,a,l?l.type:i.node(s+1).type)}function gx(t,e,n=1,r){let i=t.doc.resolve(e),s=S.empty,o=S.empty;for(let a=i.depth,l=i.depth-n,c=n-1;a>l;a--,c--){s=S.from(i.node(a).copy(s));let u=r&&r[c];o=S.from(u?u.type.create(u.attrs,o):i.node(a).copy(o))}t.step(new Te(e,e,new A(s.append(o),n,n),!0))}function qe(t,e){let n=t.resolve(e),r=n.index();return bh(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function yx(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let i=0;i0?(s=r.node(i+1),a++,o=r.node(i).maybeChild(a)):(s=r.node(i).maybeChild(a-1),o=r.node(i+1)),s&&!s.isTextblock&&bh(s,o)&&r.node(i).canReplace(a,a+1))return e;if(i==0)break;e=n<0?r.before(i):r.after(i)}}function bx(t,e,n){let r=null,{linebreakReplacement:i}=t.doc.type.schema,s=t.doc.resolve(e-n),o=s.node().type;if(i&&o.inlineContent){let u=o.whitespace=="pre",d=!!o.contentMatch.matchType(i);u&&!d?r=!1:!u&&d&&(r=!0)}let a=t.steps.length;if(r===!1){let u=t.doc.resolve(e+n);yh(t,u.node(),u.before(),a)}o.inlineContent&&Rl(t,e+n-1,o,s.node().contentMatchAt(s.index()),r==null);let l=t.mapping.slice(a),c=l.map(e-n);if(t.step(new Te(c,l.map(e+n,-1),A.empty,!0)),r===!0){let u=t.doc.resolve(c);gh(t,u.node(),u.before(),t.steps.length)}return t}function vx(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 i=r.depth-1;i>=0;i--){let s=r.index(i);if(r.node(i).canReplaceWith(s,s,n))return r.before(i+1);if(s>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let s=r.indexAfter(i);if(r.node(i).canReplaceWith(s,s,n))return r.after(i+1);if(s=0;o--){let a=o==r.depth?0:r.pos<=(r.start(o+1)+r.end(o+1))/2?-1:1,l=r.index(o)+(a>0?1:0),c=r.node(o),u=!1;if(s==1)u=c.canReplace(l,l,i);else{let d=c.contentMatchAt(l).findWrapping(i.firstChild.type);u=d&&c.canReplaceWith(l,l,d[0])}if(u)return a==0?r.pos:a<0?r.before(o+1):r.after(o+1)}return null}function gi(t,e,n=e,r=A.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),s=t.resolve(n);return vh(i,s,r)?new Te(e,n,r):new Il(i,s,r).fit()}function vh(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}var Il=class{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=S.empty;for(let i=0;i<=e.depth;i++){let s=e.node(i);this.frontier.push({type:s.type,match:s.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=S.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let s=this.placed,o=r.depth,a=i.depth;for(;o&&a&&s.childCount==1;)s=s.firstChild.content,o--,a--;let l=new A(s,o,a);return e>-1?new ce(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new Te(r.pos,i.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r1&&(i=0),s.type.spec.isolating&&i<=r){e=r;break}n=s.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,s=null;r?(s=_l(this.unplaced.content,r-1).firstChild,i=s.content):i=this.unplaced.content;let o=i.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:c}=this.frontier[a],u,d=null;if(n==1&&(o?c.matchType(o.type)||(d=c.fillBefore(S.from(o),!1)):s&&l.compatibleContent(s.type)))return{sliceDepth:r,frontierDepth:a,parent:s,inject:d};if(n==2&&o&&(u=c.findWrapping(o.type)))return{sliceDepth:r,frontierDepth:a,parent:s,wrap:u};if(s&&c.matchType(s.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=_l(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new A(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=_l(e,n);if(i.childCount<=1&&n>0){let s=e.size-n<=n+i.size;this.unplaced=new A(ui(e,n-1,1),n-1,s?n-1:r)}else this.unplaced=new A(ui(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:s}){for(;this.depth>n;)this.closeFrontierNode();if(s)for(let m=0;m1||l==0||m.content.size)&&(d=g,u.push(wh(m.mark(f.allowedMarks(m.marks)),c==1?l:0,c==a.childCount?h:-1)))}let p=c==a.childCount;p||(h=-1),this.placed=di(this.placed,n,S.from(u)),this.frontier[n].match=d,p&&h<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,g=a;m1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],s=n=0;a--){let{match:l,type:c}=this.frontier[a],u=Nl(e,a,c,l,!0);if(!u||u.childCount)continue e}return{depth:n,fit:o,move:s?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=di(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let i=e.node(r),s=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,s)}return e}openFrontierNode(e,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=di(this.placed,this.depth,S.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(S.empty,!0);n.childCount&&(this.placed=di(this.placed,this.frontier.length,n))}};function ui(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(ui(t.firstChild.content,e-1,n)))}function di(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(di(t.lastChild.content,e-1,n)))}function _l(t,e){for(let n=0;n1&&(r=r.replaceChild(0,wh(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(S.empty,!0)))),t.copy(r)}function Nl(t,e,n,r,i){let s=t.node(e),o=i?t.indexAfter(e):t.index(e);if(o==s.childCount&&!n.compatibleContent(s.type))return null;let a=r.fillBefore(s.content,!0,o);return a&&!wx(n,s.content,o)?a:null}function wx(t,e,n){for(let r=n;r0;f--,h--){let p=i.node(f).type.spec;if(p.defining||p.definingAsContext||p.isolating)break;o.indexOf(f)>-1?a=f:i.before(f)==h&&o.splice(1,0,-f)}let l=o.indexOf(a),c=[],u=r.openStart;for(let f=r.content,h=0;;h++){let p=f.firstChild;if(c.push(p),h==r.openStart)break;f=p.content}for(let f=u-1;f>=0;f--){let h=c[f],p=xx(h.type);if(p&&!h.sameMarkup(i.node(Math.abs(a)-1)))u=f;else if(p||!h.type.isTextblock)break}for(let f=r.openStart;f>=0;f--){let h=(f+u+1)%(r.openStart+1),p=c[h];if(p)for(let m=0;m=0&&(t.replace(e,n,r),!(t.steps.length>d));f--){let h=o[f];h<0||(e=i.before(h),n=s.after(h))}}function xh(t,e,n,r,i){if(er){let s=i.contentMatchAt(0),o=s.fillBefore(t).append(t);t=o.append(s.matchFragment(o).fillBefore(S.empty,!0))}return t}function Sx(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=vx(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new A(S.from(r),0,0))}function Cx(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),s=kh(r,i);for(let o=0;o0&&(l||r.node(a-1).canReplace(r.index(a-1),i.indexAfter(a-1))))return t.delete(r.before(a),i.after(a))}for(let o=1;o<=r.depth&&o<=i.depth;o++)if(e-r.start(o)==r.depth-o&&n>r.end(o)&&i.end(o)-n!=i.depth-o&&r.start(o-1)==i.start(o-1)&&r.node(o-1).canReplace(r.index(o-1),i.index(o-1)))return t.delete(r.before(o),n);t.delete(e,n)}function kh(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let s=t.start(i);if(se.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(s==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==s-1)&&n.push(i)}return n}var js=class t extends me{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 ve.fail("No node at attribute step's position");let r=Object.create(null);for(let s in n.attrs)r[s]=n.attrs[s];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return ve.fromReplace(e,this.pos,this.pos+1,new A(S.from(i),0,n.isLeaf?0:1))}getMap(){return It.empty}invert(e){return new t(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 t(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 t(n.pos,n.attr,n.value)}};me.jsonID("attr",js);var qs=class t extends me{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let i in e.attrs)n[i]=e.attrs[i];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return ve.ok(r)}getMap(){return It.empty}invert(e){return new t(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 t(n.attr,n.value)}};me.jsonID("docAttr",qs);var cr=class extends Error{};cr=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};cr.prototype=Object.create(Error.prototype);cr.prototype.constructor=cr;cr.prototype.name="TransformError";var ur=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new hi}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new cr(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}changedRange(){let e=1e9,n=-1e9;for(let r=0;r{e=Math.min(e,a),n=Math.max(n,l)})}return e==1e9?null:{from:e,to:n}}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=A.empty){let i=gi(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new A(S.from(r),0,0))}delete(e,n){return this.replace(e,n,A.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return kx(this,e,n,r),this}replaceRangeWith(e,n,r){return Sx(this,e,n,r),this}deleteRange(e,n){return Cx(this,e,n),this}lift(e,n){return cx(this,e,n),this}join(e,n=1){return bx(this,e,n),this}wrap(e,n){return fx(this,e,n),this}setBlockType(e,n=e,r,i=null){return hx(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return mx(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new js(e,n,r)),this}setDocAttribute(e,n){return this.step(new qs(e,n)),this}addNodeMark(e,n){return this.step(new mi(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 W)n.isInSet(r.marks)&&this.step(new lr(e,n));else{let i=r.marks,s,o=[];for(;s=n.isInSet(i);)o.push(new lr(e,s)),i=s.removeFromSet(i);for(let a=o.length-1;a>=0;a--)this.step(o[a])}return this}split(e,n=1,r){return gx(this,e,n,r),this}addMark(e,n,r){return ox(this,e,n,r),this}removeMark(e,n,r){return ax(this,e,n,r),this}clearIncompatible(e,n,r){return Rl(this,e,n,r),this}};var Pl=Object.create(null),L=class{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new Zs(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=0;s--){let o=n<0?fr(e.node(0),e.node(s),e.before(s+1),e.index(s),n,r):fr(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,n,r);if(o)return o}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new Ie(e.node(0))}static atStart(e){return fr(e,e,0,0,1)||new Ie(e)}static atEnd(e){return fr(e,e,e.content.size,e.childCount,-1)||new Ie(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Pl[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 Pl)throw new RangeError("Duplicate use of selection JSON ID "+e);return Pl[e]=n,n.prototype.jsonID=e,n}getBookmark(){return D.between(this.$anchor,this.$head).getBookmark()}};L.prototype.visible=!0;var Zs=class{constructor(e,n){this.$from=e,this.$to=n}},Sh=!1;function Ch(t){!Sh&&!t.parent.inlineContent&&(Sh=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}var D=class t extends L{constructor(e,n=e){Ch(e),Ch(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 L.near(r);let i=e.resolve(n.map(this.anchor));return new t(i.parent.inlineContent?i:r,r)}replace(e,n=A.empty){if(super.replace(e,n),n==A.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof t&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Xs(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 t(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let s=L.findFrom(n,r,!0)||L.findFrom(n,-r,!0);if(s)n=s.$head;else return L.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(L.findFrom(e,-r,!0)||L.findFrom(e,r,!0)).$anchor,e.pos0?0:1);i>0?o=0;o+=i){let a=e.child(o);if(a.isAtom){if(!s&&O.isSelectable(a))return O.create(t,n-(i<0?a.nodeSize:0))}else{let l=fr(t,a,n+i,i<0?a.childCount:0,i,s);if(l)return l}n+=a.nodeSize*i}return null}function Eh(t,e,n){let r=t.steps.length-1;if(r{o==null&&(o=u)}),t.setSelection(L.near(t.doc.resolve(o),n))}var Th=1,Js=2,Ah=4,zl=class extends ur{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.curSelectionFor0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Js,this}ensureMarks(e){return W.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&Js)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~Js,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)||W.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let i=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),!e)return this.deleteRange(n,r);let s=this.storedMarks;if(!s){let o=this.doc.resolve(n);s=r==n?o.marks():o.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(e,s)),!this.selection.empty&&this.selection.to==n+e.length&&this.setSelection(L.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|=Ah,this}get scrolledIntoView(){return(this.updated&Ah)>0}};function Mh(t,e){return!e||!t?t:t.bind(e)}var Mn=class{constructor(e,n,r){this.name=e,this.init=Mh(n.init,r),this.apply=Mh(n.apply,r)}},Tx=[new Mn("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Mn("selection",{init(t,e){return t.selection||L.atStart(e.doc)},apply(t){return t.selection}}),new Mn("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Mn("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})],yi=class{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Tx.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 Mn(r.key,r.spec.state,r))})}},Gs=class t{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;rr.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 i=e[r],s=i.spec.state;s&&s.toJSON&&(n[r]=s.toJSON.call(i,this[i.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 i=new yi(e.schema,e.plugins),s=new t(i);return i.fields.forEach(o=>{if(o.name=="doc")s.doc=ze.fromJSON(e.schema,n.doc);else if(o.name=="selection")s.selection=L.fromJSON(s.doc,n.selection);else if(o.name=="storedMarks")n.storedMarks&&(s.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==o.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){s[o.name]=c.fromJSON.call(l,e,n[a],s);return}}s[o.name]=o.init(e,s)}}),s}};function _h(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=_h(i,e,{})),n[r]=i}return n}var R=class{constructor(e){this.spec=e,this.props={},e.props&&_h(e.props,this,this.props),this.key=e.key?e.key.key:Nh("plugin")}getState(e){return e[this.key]}},Ll=Object.create(null);function Nh(t){return t in Ll?t+"$"+ ++Ll[t]:(Ll[t]=0,t+"$")}var F=class{constructor(e="key"){this.key=Nh(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}};var Ys=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function Ih(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}var $l=(t,e,n)=>{let r=Ih(t,n);if(!r)return!1;let i=Vl(r);if(!i){let o=r.blockRange(),a=o&&Rt(o);return a==null?!1:(e&&e(t.tr.lift(o,a).scrollIntoView()),!0)}let s=i.nodeBefore;if(Hh(t,i,e,-1))return!0;if(r.parent.content.size==0&&(hr(s,"end")||O.isSelectable(s)))for(let o=r.depth;;o--){let a=gi(t.doc,r.before(o),r.after(o),A.empty);if(a&&a.slice.size1)break}return s.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos-s.nodeSize,i.pos).scrollIntoView()),!0):!1},Dh=(t,e,n)=>{let r=Ih(t,n);if(!r)return!1;let i=Vl(r);return i?Ph(t,i,e):!1},Rh=(t,e,n)=>{let r=Lh(t,n);if(!r)return!1;let i=jl(r);return i?Ph(t,i,e):!1};function Ph(t,e,n){let r=e.nodeBefore,i=r,s=e.pos-1;for(;!i.isTextblock;s--){if(i.type.spec.isolating)return!1;let u=i.lastChild;if(!u)return!1;i=u}let o=e.nodeAfter,a=o,l=e.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let u=a.firstChild;if(!u)return!1;a=u}let c=gi(t.doc,s,l,A.empty);if(!c||c.from!=s||c instanceof Te&&c.slice.size>=l-s)return!1;if(n){let u=t.tr.step(c);u.setSelection(D.create(u.doc,s)),n(u.scrollIntoView())}return!0}function hr(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}var Hl=(t,e,n)=>{let{$head:r,empty:i}=t.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;s=Vl(r)}let o=s&&s.nodeBefore;return!o||!O.isSelectable(o)?!1:(e&&e(t.tr.setSelection(O.create(t.doc,s.pos-o.nodeSize)).scrollIntoView()),!0)};function Vl(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 Lh(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset{let r=Lh(t,n);if(!r)return!1;let i=jl(r);if(!i)return!1;let s=i.nodeAfter;if(Hh(t,i,e,1))return!0;if(r.parent.content.size==0&&(hr(s,"start")||O.isSelectable(s))){let o=gi(t.doc,r.before(),r.after(),A.empty);if(o&&o.slice.size{let{$head:r,empty:i}=t.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset=0;e--){let n=t.node(e);if(t.index(e)+1{let n=t.selection,r=n instanceof O,i;if(r){if(n.node.isTextblock||!qe(t.doc,n.from))return!1;i=n.from}else if(i=An(t.doc,n.from,-1),i==null)return!1;if(e){let s=t.tr.join(i);r&&s.setSelection(O.create(s.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(s.scrollIntoView())}return!0},zh=(t,e)=>{let n=t.selection,r;if(n instanceof O){if(n.node.isTextblock||!qe(t.doc,n.to))return!1;r=n.to}else if(r=An(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},Fh=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),s=i&&Rt(i);return s==null?!1:(e&&e(t.tr.lift(i,s).scrollIntoView()),!0)},ql=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
-`).scrollIntoView()),!0)};function Kl(t){for(let e=0;e{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),s=n.indexAfter(-1),o=Kl(i.contentMatchAt(s));if(!o||!i.canReplaceWith(s,s,o))return!1;if(e){let a=n.after(),l=t.tr.replaceWith(a,a,o.createAndFill());l.setSelection(L.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},Zl=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof Ie||r.parent.inlineContent||i.parent.inlineContent)return!1;let s=Kl(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let o=(!r.parentOffset&&i.index(){let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let s=n.before();if(He(t.doc,s))return e&&e(t.tr.split(s).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Rt(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)};function Ax(t){return(e,n)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof O&&e.selection.node.isBlock)return!r.parentOffset||!He(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let s=[],o,a,l=!1,c=!1;for(let h=r.depth;;h--)if(r.node(h).isBlock){l=r.end(h)==r.pos+(r.depth-h),c=r.start(h)==r.pos-(r.depth-h),a=Kl(r.node(h-1).contentMatchAt(r.indexAfter(h-1)));let m=t&&t(i.parent,l,r);s.unshift(m||(l&&a?{type:a}:null)),o=h;break}else{if(h==1)return!1;s.unshift(null)}let u=e.tr;(e.selection instanceof D||e.selection instanceof Ie)&&u.deleteSelection();let d=u.mapping.map(r.pos),f=He(u.doc,d,s.length,s);if(f||(s[0]=a?{type:a}:null,f=He(u.doc,d,s.length,s)),!f)return!1;if(u.split(d,s.length,s),!l&&c&&r.node(o).type!=a){let h=u.mapping.map(r.before(o)),p=u.doc.resolve(h);a&&r.node(o-1).canReplaceWith(p.index(),p.index()+1,a)&&u.setNodeMarkup(u.mapping.map(r.before(o)),a)}return n&&n(u.scrollIntoView()),!0}}var Mx=Ax();var $h=(t,e)=>{let{$from:n,to:r}=t.selection,i,s=n.sharedDepth(r);return s==0?!1:(i=n.before(s),e&&e(t.tr.setSelection(O.create(t.doc,i))),!0)},_x=(t,e)=>(e&&e(t.tr.setSelection(new Ie(t.doc))),!0);function Nx(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,s=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(s-1,s)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(s,s+1)||!(i.isTextblock||qe(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function Hh(t,e,n,r){let i=e.nodeBefore,s=e.nodeAfter,o,a,l=i.type.spec.isolating||s.type.spec.isolating;if(!l&&Nx(t,e,n))return!0;let c=!l&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(o=(a=i.contentMatchAt(i.childCount)).findWrapping(s.type))&&a.matchType(o[0]||s.type).validEnd){if(n){let h=e.pos+s.nodeSize,p=S.empty;for(let y=o.length-1;y>=0;y--)p=S.from(o[y].create(null,p));p=S.from(i.copy(p));let m=t.tr.step(new ce(e.pos-1,h,e.pos,h,new A(p,1,0),o.length,!0)),g=m.doc.resolve(h+2*o.length);g.nodeAfter&&g.nodeAfter.type==i.type&&qe(m.doc,g.pos)&&m.join(g.pos),n(m.scrollIntoView())}return!0}let u=s.type.spec.isolating||r>0&&l?null:L.findFrom(e,1),d=u&&u.$from.blockRange(u.$to),f=d&&Rt(d);if(f!=null&&f>=e.depth)return n&&n(t.tr.lift(d,f).scrollIntoView()),!0;if(c&&hr(s,"start",!0)&&hr(i,"end")){let h=i,p=[];for(;p.push(h),!h.isTextblock;)h=h.lastChild;let m=s,g=1;for(;!m.isTextblock;m=m.firstChild)g++;if(h.canReplace(h.childCount,h.childCount,m.content)){if(n){let y=S.empty;for(let x=p.length-1;x>=0;x--)y=S.from(p[x].copy(y));let b=t.tr.step(new ce(e.pos-p.length,e.pos+s.nodeSize,e.pos+g,e.pos+s.nodeSize-g,new A(y,p.length,0),0,!0));n(b.scrollIntoView())}return!0}}return!1}function Vh(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return i.node(s).isTextblock?(n&&n(e.tr.setSelection(D.create(e.doc,t<0?i.start(s):i.end(s)))),!0):!1}}var Gl=Vh(-1),Yl=Vh(1);function Uh(t,e=null){return function(n,r){let{$from:i,$to:s}=n.selection,o=i.blockRange(s),a=o&&dr(o,t,e);return a?(r&&r(n.tr.wrap(o,a).scrollIntoView()),!0):!1}}function Ql(t,e=null){return function(n,r){let i=!1;for(let s=0;s{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)i=!0;else{let u=n.doc.resolve(c),d=u.index();i=u.parent.canReplaceWith(d,d+1,t)}})}if(!i)return!1;if(r){let s=n.tr;for(let o=0;o=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=o.resolve(e.start-2);s=new En(l,l,e.depth),e.endIndex=0;u--)s=S.from(n[u].type.create(n[u].attrs,s));t.step(new ce(e.start-(r?2:0),e.end,e.start,e.end,new A(s,0,0),n.length,!0));let o=0;for(let u=0;uo.childCount>0&&o.firstChild.type==t);return s?n?r.node(s.depth-1).type==t?Rx(e,n,t,s):Px(e,n,s):!0:!1}}function Rx(t,e,n,r){let i=t.tr,s=r.end,o=r.$to.end(r.depth);sm;p--)h-=i.child(p).nodeSize,r.delete(h-1,h+1);let s=r.doc.resolve(n.start),o=s.nodeAfter;if(r.mapping.map(n.end)!=n.start+s.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==i.childCount,c=s.node(-1),u=s.index(-1);if(!c.canReplace(u+(a?0:1),u+1,o.content.append(l?S.empty:S.from(i))))return!1;let d=s.pos,f=d+o.nodeSize;return r.step(new ce(d-(a?1:0),f+(l?1:0),d+1,f-1,new A((a?S.empty:S.from(i.copy(S.empty))).append(l?S.empty:S.from(i.copy(S.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}function qh(t){return function(e,n){let{$from:r,$to:i}=e.selection,s=r.blockRange(i,c=>c.childCount>0&&c.firstChild.type==t);if(!s)return!1;let o=s.startIndex;if(o==0)return!1;let a=s.parent,l=a.child(o-1);if(l.type!=t)return!1;if(n){let c=l.lastChild&&l.lastChild.type==a.type,u=S.from(c?t.create():null),d=new A(S.from(t.create(null,S.from(a.type.create(null,u)))),c?3:1,0),f=s.start,h=s.end;n(e.tr.step(new ce(f-(c?3:1),h,f,h,d,1,!0)).scrollIntoView())}return!0}}var we=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},br=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e},oc=null,Lt=function(t,e,n){let r=oc||(oc=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},Lx=function(){oc=null},Pn=function(t,e,n,r){return n&&(Kh(t,e,n,r,-1)||Kh(t,e,n,r,1))},Bx=/^(img|br|input|textarea|hr)$/i;function Kh(t,e,n,r,i){for(var s;;){if(t==n&&e==r)return!0;if(e==(i<0?0:Je(t))){let o=t.parentNode;if(!o||o.nodeType!=1||Ei(t)||Bx.test(t.nodeName)||t.contentEditable=="false")return!1;e=we(t)+(i<0?0:1),t=o}else if(t.nodeType==1){let o=t.childNodes[e+(i<0?-1:0)];if(o.nodeType==1&&o.contentEditable=="false")if(!((s=o.pmViewDesc)===null||s===void 0)&&s.ignoreForSelection)e+=i;else return!1;else t=o,e=i<0?Je(t):0}else return!1}}function Je(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function zx(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=Je(t)}else if(t.parentNode&&!Ei(t))e=we(t),t=t.parentNode;else return null}}function Fx(t,e){for(;;){if(t.nodeType==3&&e2),Ke=vr||(dt?/Mac/.test(dt.platform):!1),Mp=dt?/Win/.test(dt.platform):!1,Bt=/Android \d/.test(an),Ti=!!Jh&&"webkitFontSmoothing"in Jh.documentElement.style,Ux=Ti?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Wx(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 Pt(t,e){return typeof t=="number"?t:t[e]}function jx(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 Zh(t,e,n){let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,s=t.dom.ownerDocument;for(let o=n||t.dom;o;){if(o.nodeType!=1){o=br(o);continue}let a=o,l=a==s.body,c=l?Wx(s):jx(a),u=0,d=0;if(e.topc.bottom-Pt(r,"bottom")&&(d=e.bottom-e.top>c.bottom-c.top?e.top+Pt(i,"top")-c.top:e.bottom-c.bottom+Pt(i,"bottom")),e.leftc.right-Pt(r,"right")&&(u=e.right-c.right+Pt(i,"right")),u||d)if(l)s.defaultView.scrollBy(u,d);else{let h=a.scrollLeft,p=a.scrollTop;d&&(a.scrollTop+=d),u&&(a.scrollLeft+=u);let m=a.scrollLeft-h,g=a.scrollTop-p;e={left:e.left-m,top:e.top-g,right:e.right-m,bottom:e.bottom-g}}let f=l?"fixed":getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(f))break;o=f=="absolute"?o.offsetParent:br(o)}}function qx(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,i;for(let s=(e.left+e.right)/2,o=n+1;o=n-20){r=a,i=l.top;break}}return{refDOM:r,refTop:i,stack:_p(t.dom)}}function _p(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=br(r));return e}function Kx({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;Np(n,r==0?0:r-e)}function Np(t,e){for(let n=0;n=a){o=Math.max(p.bottom,o),a=Math.min(p.top,a);let m=p.left>e.left?p.left-e.left:p.right=(p.left+p.right)/2?1:0));continue}}else p.top>e.top&&!l&&p.left<=e.left&&p.right>=e.left&&(l=u,c={left:Math.max(p.left,Math.min(p.right,e.left)),top:p.top});!n&&(e.left>=p.right&&e.top>=p.top||e.left>=p.left&&e.top>=p.bottom)&&(s=d+1)}}return!n&&l&&(n=l,i=c,r=0),n&&n.nodeType==3?Zx(n,i):!n||r&&n.nodeType==1?{node:t,offset:s}:Op(n,i)}function Zx(t,e){let n=t.nodeValue.length,r=document.createRange(),i;for(let s=0;s=(o.left+o.right)/2?1:0)};break}}return r.detach(),i||{node:t,offset:0}}function Cc(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function Xx(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left(o.left+o.right)/2?1:-1}return t.docView.posFromDOM(r,i,s)}function Yx(t,e,n,r){let i=-1;for(let s=e,o=!1;s!=t.dom;){let a=t.docView.nearestDesc(s,!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&&!/^T(R|BODY|HEAD|FOOT)$/.test(a.dom.nodeName)&&(!o&&l.left>r.left||l.top>r.top?i=a.posBefore:(!o&&l.right-1?i:t.docView.posFromDOM(e,n,-1)}function Ip(t,e,n){let r=t.childNodes.length;if(r&&n.tope.top&&i++}let c;Ti&&i&&r.nodeType==1&&(c=r.childNodes[i-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&i--,r==t.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(a=Yx(t,r,i,e))}a==null&&(a=Gx(t,o,e));let l=t.docView.nearestDesc(o,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function Xh(t){return t.top=0&&i==r.nodeValue.length?(l--,u=1):n<0?l--:c++,bi(tn(Lt(r,l,c),u),u<0)}if(!t.state.doc.resolve(e-(s||0)).parent.inlineContent){if(s==null&&i&&(n<0||i==Je(r))){let l=r.childNodes[i-1];if(l.nodeType==1)return tc(l.getBoundingClientRect(),!1)}if(s==null&&i=0)}if(s==null&&i&&(n<0||i==Je(r))){let l=r.childNodes[i-1],c=l.nodeType==3?Lt(l,Je(l)-(o?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return bi(tn(c,1),!1)}if(s==null&&i=0)}function bi(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 tc(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 Rp(t,e,n){let r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus()}}function tk(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return Rp(t,e,()=>{let{node:s}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(s,!0);if(!a)break;if(a.node.isBlock){s=a.contentDOM||a.dom;break}s=a.dom.parentNode}let o=Dp(t,i.pos,1);for(let a=s.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=Lt(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;cu.top+1&&(n=="up"?o.top-u.top>(u.bottom-o.top)*2:u.bottom-o.bottom>(o.bottom-u.top)*2))return!1}}return!0})}var nk=/[\u0590-\u08ac]/;function rk(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,s=!i,o=i==r.parent.content.size,a=t.domSelection();return a?!nk.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?s:o:Rp(t,e,()=>{let{focusNode:l,focusOffset:c,anchorNode:u,anchorOffset:d}=t.domSelectionRange(),f=a.caretBidiLevel;a.modify("move",n,"character");let h=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:p,focusOffset:m}=t.domSelectionRange(),g=p&&!h.contains(p.nodeType==1?p:p.parentNode)||l==p&&c==m;try{a.collapse(u,d),l&&(l!=u||c!=d)&&a.extend&&a.extend(l,c)}catch{}return f!=null&&(a.caretBidiLevel=f),g}):r.pos==r.start()||r.pos==r.end()}var Gh=null,Yh=null,Qh=!1;function ik(t,e,n){return Gh==e&&Yh==n?Qh:(Gh=e,Yh=n,Qh=n=="up"||n=="down"?tk(t,e,n):rk(t,e,n))}var Xe=0,ep=1,Nn=2,ft=3,Ln=class{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=Xe,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;nwe(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!1;break}if(s.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!0;break}if(s.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,i=e;i;i=i.parentNode){let s=this.getDesc(i),o;if(s&&(!n||s.node))if(r&&(o=s.nodeDOM)&&!(o.nodeType==1?o.contains(e.nodeType==1?e:e.parentNode):o==e))r=!1;else return s}}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 i=e;i;i=i.parentNode){let s=this.getDesc(i);if(s)return s.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;ne||o instanceof to){i=e-s;break}s=a}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let s;r&&!(s=this.children[r-1]).size&&s instanceof Qs&&s.side>=0;r--);if(n<=0){let s,o=!0;for(;s=r?this.children[r-1]:null,!(!s||s.dom.parentNode==this.contentDOM);r--,o=!1);return s&&n&&o&&!s.border&&!s.domAtom?s.domFromPos(s.size,n):{node:this.contentDOM,offset:s?we(s.dom)+1:0}}else{let s,o=!0;for(;s=r=u&&n<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,n,u);e=o;for(let d=a;d>0;d--){let f=this.children[d-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){i=we(f.dom)+1;break}e-=f.size}i==-1&&(i=0)}if(i>-1&&(c>n||a==this.children.length-1)){n=c;for(let u=a+1;up&&on){let p=a;a=l,l=p}let h=document.createRange();h.setEnd(l.node,l.offset),h.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(h)}}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,i=0;i=r:er){let a=r+s.border,l=o-s.border;if(e>=a&&n<=l){this.dirty=e==r||n==o?Nn:ep,e==a&&n==l&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=ft:s.markDirty(e-a,n-a);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?Nn:ft}r=o}this.dirty=Nn}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?Nn:ep;n.dirty{if(!s)return i;if(s.parent)return s.parent.posBeforeChild(s)})),!n.type.spec.raw){if(o.nodeType!=1){let a=document.createElement("span");a.appendChild(o),o=a}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=n,this.widget=n,s=this}matchesWidget(e){return this.dirty==Xe&&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 ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}},uc=class extends Ln{constructor(e,n,r,i){super(e,[],n,null),this.textDOM=r,this.text=i}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}},wr=class t extends Ln{constructor(e,n,r,i,s){super(e,[],r,i),this.mark=n,this.spec=s}static create(e,n,r,i){let s=i.nodeViews[n.type.name],o=s&&s(n,i,r);return(!o||!o.dom)&&(o=Ot.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new t(e,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&ft||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=ft&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=Xe){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty0&&(s=pc(s,0,e,r));for(let a=0;a{if(!l)return o;if(l.parent)return l.parent.posBeforeChild(l)},r,i),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}=Ot.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 f=u;return u=Bp(u,r,n),c?l=new dc(e,n,r,i,u,d||null,f,c,s,o+1):n.isText?new eo(e,n,r,i,u,f,s):new t(e,n,r,i,u,d||null,f,s,o+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=()=>S.empty)}return e}matchesNode(e,n,r){return this.dirty==Xe&&e.eq(this.node)&&no(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,i=n,s=e.composing?this.localCompositionInfo(e,n):null,o=s&&s.pos>-1?s:null,a=s&&s.pos<0,l=new hc(this,o&&o.node,e);lk(this.node,this.innerDeco,(c,u,d)=>{c.spec.marks?l.syncToMarks(c.spec.marks,r,e,u):c.type.side>=0&&!d&&l.syncToMarks(u==this.node.childCount?W.none:this.node.child(u).marks,r,e,u),l.placeWidget(c,e,i)},(c,u,d,f)=>{l.syncToMarks(c.marks,r,e,f);let h;l.findNodeMatch(c,u,d,f)||a&&e.state.selection.from>i&&e.state.selection.to-1&&l.updateNodeAt(c,u,d,h,e)||l.updateNextNode(c,u,d,e,f,i)||l.addNode(c,u,d,e,i),i+=c.nodeSize}),l.syncToMarks([],r,e,0),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==Nn)&&(o&&this.protectLocalComposition(e,o),Pp(this.contentDOM,this.children,e),vr&&ck(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof D)||rn+this.node.content.size)return null;let s=e.input.compositionNode;if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let o=s.nodeValue,a=uk(this.node.content,o,r-n,i-n);return a<0?null:{node:s,pos:a,text:o}}else return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let s=n;for(;s.parentNode!=this.contentDOM;s=s.parentNode){for(;s.previousSibling;)s.parentNode.removeChild(s.previousSibling);for(;s.nextSibling;)s.parentNode.removeChild(s.nextSibling);s.pmViewDesc&&(s.pmViewDesc=void 0)}let o=new uc(this,s,n,i);e.input.compositionNodes.push(o),this.children=pc(this.children,r,r+i.length,e,o)}update(e,n,r,i){return this.dirty==ft||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,i),!0)}updateInner(e,n,r,i){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=Xe}updateOuterDeco(e){if(no(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=Lp(this.dom,this.nodeDOM,fc(this.outerDeco,this.node,n),fc(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.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}};function tp(t,e,n,r,i){Bp(r,e,t);let s=new on(void 0,t,e,n,r,r,r,i,0);return s.contentDOM&&s.updateChildren(i,0),s}var eo=class t extends on{constructor(e,n,r,i,s,o,a){super(e,n,r,i,s,null,o,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,i){return this.dirty==ft||this.dirty!=Xe&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Xe||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=Xe,!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 i=this.node.cut(e,n),s=document.createTextNode(i.text);return new t(this.parent,i,this.outerDeco,this.innerDeco,s,s,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=ft)}get domAtom(){return!1}isText(e){return this.node.text==e}},to=class extends Ln{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Xe&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}},dc=class extends on{constructor(e,n,r,i,s,o,a,l,c,u){super(e,n,r,i,s,o,a,c,u),this.spec=l}update(e,n,r,i){if(this.dirty==ft)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let s=this.spec.update(e,n,r);return s&&this.updateInner(e,n,r,i),s}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,i){this.spec.setSelection?this.spec.setSelection(e,n,r.root):super.setSelection(e,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}};function Pp(t,e,n){let r=t.firstChild,i=!1;for(let s=0;s>1,a=Math.min(o,e.length);for(;s-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let u=wr.create(this.top,e[o],n,r);this.top.children.splice(this.index,0,u),this.top=u,this.changed=!0}this.index=0,o++}}findNodeMatch(e,n,r,i){let s=-1,o;if(i>=this.preMatch.index&&(o=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&o.matchesNode(e,n,r))s=this.top.children.indexOf(o,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a0;){let a;for(;;)if(r){let c=n.children[r-1];if(c instanceof wr)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(i-1))break;--i,s.set(a,i),o.push(a)}}return{index:i,matched:s,matches:o.reverse()}}function ak(t,e){return t.type.side-e.type.side}function lk(t,e,n,r){let i=e.locals(t),s=0;if(i.length==0){for(let c=0;cs;)a.push(i[o++]);let p=s+f.nodeSize;if(f.isText){let g=p;o!g.inline):a.slice();r(f,m,e.forChild(s,f),h),s=p}}function ck(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 uk(t,e,n,r){for(let i=0,s=0;i=n){if(s>=r&&l.slice(r-e.length-a,r-a)==e)return r-e.length;let c=a=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 pc(t,e,n,r,i){let s=[];for(let o=0,a=0;o=n||u<=e?s.push(l):(cn&&s.push(l.slice(n-c,l.size,r)))}return s}function Ec(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),s=i&&i.size==0,o=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let a=r.resolve(o),l,c;if(co(n)){for(l=o;i&&!i.node;)i=i.parent;let d=i.node;if(i&&d.isAtom&&O.isSelectable(d)&&i.parent&&!(d.isInline&&$x(n.focusNode,n.focusOffset,i.dom))){let f=i.posBefore;c=new O(o==f?a:r.resolve(f))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let d=o,f=o;for(let h=0;h{(n.anchorNode!=r||n.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!zp(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function fk(t){let e=t.domSelection();if(!e)return;let n=t.cursorWrapper.dom,r=n.nodeName=="IMG";r?e.collapse(n.parentNode,we(n)+1):e.collapse(n,0),!r&&!t.state.selection.visible&&Fe&&sn<=11&&(n.disabled=!0,n.disabled=!1)}function Fp(t,e){if(e instanceof O){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(op(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else op(t)}function op(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Tc(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||D.between(e,n,r)}function ap(t){return t.editable&&!t.hasFocus()?!1:$p(t)}function $p(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 hk(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return Pn(e.node,e.offset,n.anchorNode,n.anchorOffset)}function mc(t,e){let{$anchor:n,$head:r}=t.selection,i=e>0?n.max(r):n.min(r),s=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return s&&L.findFrom(s,e)}function nn(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function lp(t,e,n){let r=t.state.selection;if(r instanceof D)if(n.indexOf("s")>-1){let{$head:i}=r,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let o=t.state.doc.resolve(i.pos+s.nodeSize*(e<0?-1:1));return nn(t,new D(r.$anchor,o))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=mc(t.state,e);return i&&i instanceof O?nn(t,i):!1}else if(!(Ke&&n.indexOf("m")>-1)){let i=r.$head,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,o;if(!s||s.isText)return!1;let a=e<0?i.pos-s.nodeSize:i.pos;return s.isAtom||(o=t.docView.descAt(a))&&!o.contentDOM?O.isSelectable(s)?nn(t,new O(e<0?t.state.doc.resolve(i.pos-s.nodeSize):i)):Ti?nn(t,new D(t.state.doc.resolve(e<0?a:a+s.nodeSize))):!1:!1}}else return!1;else{if(r instanceof O&&r.node.isInline)return nn(t,new D(e>0?r.$to:r.$from));{let i=mc(t.state,e);return i?nn(t,i):!1}}}function ro(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function wi(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function mr(t,e){return e<0?pk(t):mk(t)}function pk(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,s,o=!1;for(Ze&&n.nodeType==1&&r0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(wi(a,-1))i=n,s=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(Hp(n))break;{let a=n.previousSibling;for(;a&&wi(a,-1);)i=n.parentNode,s=we(a),a=a.previousSibling;if(a)n=a,r=ro(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}o?gc(t,n,r):i&&gc(t,i,s)}function mk(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=ro(n),s,o;for(;;)if(r{t.state==i&&zt(t)},50)}function cp(t,e){let n=t.state.doc.resolve(e);if(!(ge||Mp)&&n.parent.inlineContent){let i=t.coordsAtPos(e);if(e>n.start()){let s=t.coordsAtPos(e-1),o=(s.top+s.bottom)/2;if(o>i.top&&o1)return s.lefti.top&&o1)return s.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function up(t,e,n){let r=t.state.selection;if(r instanceof D&&!r.empty||n.indexOf("s")>-1||Ke&&n.indexOf("m")>-1)return!1;let{$from:i,$to:s}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let o=mc(t.state,e);if(o&&o instanceof O)return nn(t,o)}if(!i.parent.inlineContent){let o=e<0?i:s,a=r instanceof Ie?L.near(o,e):L.findFrom(o,e);return a?nn(t,a):!1}return!1}function dp(t,e){if(!(t.state.selection instanceof D))return!0;let{$head:n,$anchor:r,empty:i}=t.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let s=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(s&&!s.isText){let o=t.state.tr;return e<0?o.delete(n.pos-s.nodeSize,n.pos):o.delete(n.pos,n.pos+s.nodeSize),t.dispatch(o),!0}return!1}function fp(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function bk(t){if(!xe||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;fp(t,r,"true"),setTimeout(()=>fp(t,r,"false"),20)}return!1}function vk(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function wk(t,e){let n=e.keyCode,r=vk(e);if(n==8||Ke&&n==72&&r=="c")return dp(t,-1)||mr(t,-1);if(n==46&&!e.shiftKey||Ke&&n==68&&r=="c")return dp(t,1)||mr(t,1);if(n==13||n==27)return!0;if(n==37||Ke&&n==66&&r=="c"){let i=n==37?cp(t,t.state.selection.from)=="ltr"?-1:1:-1;return lp(t,i,r)||mr(t,i)}else if(n==39||Ke&&n==70&&r=="c"){let i=n==39?cp(t,t.state.selection.from)=="ltr"?1:-1:1;return lp(t,i,r)||mr(t,i)}else{if(n==38||Ke&&n==80&&r=="c")return up(t,-1,r)||mr(t,-1);if(n==40||Ke&&n==78&&r=="c")return bk(t)||up(t,1,r)||mr(t,1);if(r==(Ke?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function Ac(t,e){t.someProp("transformCopied",h=>{e=h(e,t)});let n=[],{content:r,openStart:i,openEnd:s}=e;for(;i>1&&s>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,s--;let h=r.firstChild;n.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),r=h.content}let o=t.someProp("clipboardSerializer")||Ot.fromSchema(t.state.schema),a=Kp(),l=a.createElement("div");l.appendChild(o.serializeFragment(r,{document:a}));let c=l.firstChild,u,d=0;for(;c&&c.nodeType==1&&(u=qp[c.nodeName.toLowerCase()]);){for(let h=u.length-1;h>=0;h--){let p=a.createElement(u[h]);for(;l.firstChild;)p.appendChild(l.firstChild);l.appendChild(p),d++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${i} ${s}${d?` -${d}`:""} ${JSON.stringify(n)}`);let f=t.someProp("clipboardTextSerializer",h=>h(e,t))||e.content.textBetween(0,e.content.size,`
+`).trim();if(!l&&!s)return;let c=s?.type||"body",u={id:s?.id||this.generateShortId()},h=l.match(/^(#{1,4})\s+([\s\S]*)/);if(h&&!s){let d=h[1].length;d<=3?c=`heading-${d}`:c="body",l=h[2]}r.push({type:c,attrs:u,content:this.parseInline(l)}),o=[],s=null};for(let l=0;le.length-20){a();continue}let h=c.match(//);if(h){a(),s={id:h[1],type:h[2]};continue}if(c.trim()===""){a();continue}o.push(c)}return a(),{type:"manuscript",doc:{type:"doc",content:r},footnotes:i,comments:{}}}serializeNode(t){if(!t)return"";switch(t.type){case"heading":case"heading-1":case"heading-2":case"heading-3":let e=t.attrs?.level;return!e&&t.type.startsWith("heading-")&&(e=parseInt(t.type.split("-")[1])),`${"#".repeat(e||1)} ${this.serializeInline(t.content)}`;case"body":case"paragraph":case"supertitle":case"title":case"subtitle":case"epigraph":case"body-first":case"footnote":return this.serializeInline(t.content);case"horizontalRule":return"---";case"hardBreak":return`
+`;default:return this.serializeInline(t.content)}}serializeInline(t){return!t||!Array.isArray(t)?"":t.map(e=>{if(e.type==="footnoteMarker"||e.type==="footnote")return`[^${e.attrs?.id}]`;if(e.type==="internalLink"){let i=e.attrs?.alias||e.attrs?.target;return`[[${e.attrs?.target}|${i}]]`}let r=e.text||"";return e.marks&&e.marks.forEach(i=>{switch(i.type){case"bold":r=`**${r}**`;break;case"italic":r=`*${r}*`;break;case"code":r=`\`${r}\``;break;case"strike":r=`~~${r}~~`;break;case"underline":r=`${r}`;break;case"commentHighlight":r=`${r}`;break}}),r}).join("")}parseInline(t){let e=[],r=/(\[\^([\w-]+)\])|(\[\[(.*?)(?:\|(.*?))?\]\])|(([\s\S]*?))|(\*\*(.*?)\*\*)|(\*(.*?)\*)|(`(.*?)`)|(~~(.*?)~~)|((.*?)<\/u>)/g,i=0,s;for(;(s=r.exec(t))!==null;){if(s.index>i&&e.push({type:"text",text:t.substring(i,s.index)}),s[1])e.push({type:"footnoteMarker",attrs:{id:s[2]}});else if(s[3]){let o=s[4],a=s[5]||o;e.push({type:"internalLink",attrs:{target:o,alias:a}})}else if(s[6]){let o=s[7],a=s[8];this.parseInline(a).forEach(c=>{c.type==="text"&&(c.marks||(c.marks=[]),c.marks.push({type:"commentHighlight",attrs:{threadId:o}})),e.push(c)})}else s[9]?e.push({type:"text",text:s[10],marks:[{type:"bold"}]}):s[11]?e.push({type:"text",text:s[12],marks:[{type:"italic"}]}):s[13]?e.push({type:"text",text:s[14],marks:[{type:"code"}]}):s[15]?e.push({type:"text",text:s[16],marks:[{type:"strike"}]}):s[17]&&e.push({type:"text",text:s[18],marks:[{type:"underline"}]});i=r.lastIndex}return ivs});module.exports=bf(Bb);var J=require("obsidian");var Mn=require("obsidian");function gt(n){this.content=n}gt.prototype={constructor:gt,find:function(n){for(var t=0;t>1}};gt.from=function(n){if(n instanceof gt)return n;var t=[];if(n)for(var e in n)t.push(e,n[e]);return new gt(t)};var Cs=gt;function xl(n,t,e){for(let r=0;;r++){if(r==n.childCount||r==t.childCount)return n.childCount==t.childCount?null:e;let i=n.child(r),s=t.child(r);if(i==s){e+=i.nodeSize;continue}if(!i.sameMarkup(s))return e;if(i.isText&&i.text!=s.text){for(let o=0;i.text[o]==s.text[o];o++)e++;return e}if(i.content.size||s.content.size){let o=xl(i.content,s.content,e+1);if(o!=null)return o}e+=i.nodeSize}}function Sl(n,t,e,r){for(let i=n.childCount,s=t.childCount;;){if(i==0||s==0)return i==s?null:{a:e,b:r};let o=n.child(--i),a=t.child(--s),l=o.nodeSize;if(o==a){e-=l,r-=l;continue}if(!o.sameMarkup(a))return{a:e,b:r};if(o.isText&&o.text!=a.text){let c=0,u=Math.min(o.text.length,a.text.length);for(;ct&&r(l,i+a,s||null,o)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,t-u),Math.min(l.content.size,e-u),r,i+u)}a=c}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,e,r,i){let s="",o=!0;return this.nodesBetween(t,e,(a,l)=>{let c=a.isText?a.text.slice(Math.max(t,l)-l,e-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&r&&(o?o=!1:s+=r),s+=c},0),s}append(t){if(!t.size)return this;if(!this.size)return t;let e=this.lastChild,r=t.firstChild,i=this.content.slice(),s=0;for(e.isText&&e.sameMarkup(r)&&(i[i.length-1]=e.withText(e.text+r.text),s=1);st)for(let s=0,o=0;ot&&((oe)&&(a.isText?a=a.cut(Math.max(0,t-o),Math.min(a.text.length,e-o)):a=a.cut(Math.max(0,t-o-1),Math.min(a.content.size,e-o-1))),r.push(a),i+=a.nodeSize),o=l}return new n(r,i)}cutByIndex(t,e){return t==e?n.empty:t==0&&e==this.content.length?this:new n(this.content.slice(t,e))}replaceChild(t,e){let r=this.content[t];if(r==e)return this;let i=this.content.slice(),s=this.size+e.nodeSize-r.nodeSize;return i[t]=e,new n(i,s)}addToStart(t){return new n([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new n(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let e=0;e