@spinacia_/file-viewer
Version:
A file viewer component.
7 lines • 1.79 MB
JavaScript
(function(Vl,V){typeof exports=="object"&&typeof module<"u"?V(exports,require("vue"),require("docx-preview")):typeof define=="function"&&define.amd?define(["exports","vue","docx-preview"],V):(Vl=typeof globalThis<"u"?globalThis:Vl||self,V(Vl["@spinacia_/file-viewer"]={},Vl.Vue,Vl.docxPreview))})(this,function(Vl,V,eZ){"use strict";var yc=typeof document<"u"?document.currentScript:null,Tc={},Ht={};Ht.byteLength=Is,Ht.toByteArray=Rs,Ht.fromByteArray=js;for(var El=[],Jl=[],Ls=typeof Uint8Array<"u"?Uint8Array:Array,oc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Nt=0,zs=oc.length;Nt<zs;++Nt)El[Nt]=oc[Nt],Jl[oc.charCodeAt(Nt)]=Nt;Jl[45]=62,Jl[95]=63;function GZ(a){var l=a.length;if(l%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=a.indexOf("=");t===-1&&(t=l);var c=t===l?0:4-t%4;return[t,c]}function Is(a){var l=GZ(a),t=l[0],c=l[1];return(t+c)*3/4-c}function ws(a,l,t){return(l+t)*3/4-t}function Rs(a){var l,t=GZ(a),c=t[0],Z=t[1],s=new Ls(ws(a,c,Z)),d=0,i=Z>0?c-4:c,b;for(b=0;b<i;b+=4)l=Jl[a.charCodeAt(b)]<<18|Jl[a.charCodeAt(b+1)]<<12|Jl[a.charCodeAt(b+2)]<<6|Jl[a.charCodeAt(b+3)],s[d++]=l>>16&255,s[d++]=l>>8&255,s[d++]=l&255;return Z===2&&(l=Jl[a.charCodeAt(b)]<<2|Jl[a.charCodeAt(b+1)]>>4,s[d++]=l&255),Z===1&&(l=Jl[a.charCodeAt(b)]<<10|Jl[a.charCodeAt(b+1)]<<4|Jl[a.charCodeAt(b+2)]>>2,s[d++]=l>>8&255,s[d++]=l&255),s}function Ss(a){return El[a>>18&63]+El[a>>12&63]+El[a>>6&63]+El[a&63]}function xs(a,l,t){for(var c,Z=[],s=l;s<t;s+=3)c=(a[s]<<16&16711680)+(a[s+1]<<8&65280)+(a[s+2]&255),Z.push(Ss(c));return Z.join("")}function js(a){for(var l,t=a.length,c=t%3,Z=[],s=16383,d=0,i=t-c;d<i;d+=s)Z.push(xs(a,d,d+s>i?i:d+s));return c===1?(l=a[t-1],Z.push(El[l>>2]+El[l<<4&63]+"==")):c===2&&(l=(a[t-2]<<8)+a[t-1],Z.push(El[l>>10]+El[l>>4&63]+El[l<<2&63]+"=")),Z.join("")}var Vc={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */Vc.read=function(a,l,t,c,Z){var s,d,i=Z*8-c-1,b=(1<<i)-1,h=b>>1,m=-7,W=t?Z-1:0,e=t?-1:1,N=a[l+W];for(W+=e,s=N&(1<<-m)-1,N>>=-m,m+=i;m>0;s=s*256+a[l+W],W+=e,m-=8);for(d=s&(1<<-m)-1,s>>=-m,m+=c;m>0;d=d*256+a[l+W],W+=e,m-=8);if(s===0)s=1-h;else{if(s===b)return d?NaN:(N?-1:1)*(1/0);d=d+Math.pow(2,c),s=s-h}return(N?-1:1)*d*Math.pow(2,s-c)},Vc.write=function(a,l,t,c,Z,s){var d,i,b,h=s*8-Z-1,m=(1<<h)-1,W=m>>1,e=Z===23?Math.pow(2,-24)-Math.pow(2,-77):0,N=c?0:s-1,M=c?1:-1,X=l<0||l===0&&1/l<0?1:0;for(l=Math.abs(l),isNaN(l)||l===1/0?(i=isNaN(l)?1:0,d=m):(d=Math.floor(Math.log(l)/Math.LN2),l*(b=Math.pow(2,-d))<1&&(d--,b*=2),d+W>=1?l+=e/b:l+=e*Math.pow(2,1-W),l*b>=2&&(d++,b/=2),d+W>=m?(i=0,d=m):d+W>=1?(i=(l*b-1)*Math.pow(2,Z),d=d+W):(i=l*Math.pow(2,W-1)*Math.pow(2,Z),d=0));Z>=8;a[t+N]=i&255,N+=M,i/=256,Z-=8);for(d=d<<Z|i,h+=Z;h>0;a[t+N]=d&255,N+=M,d/=256,h-=8);a[t+N-M]|=X*128};/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/(function(a){const l=Ht,t=Vc,c=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;a.Buffer=m,a.SlowBuffer=I,a.INSPECT_MAX_BYTES=50;const Z=2147483647;a.kMaxLength=Z;const{Uint8Array:s,ArrayBuffer:d,SharedArrayBuffer:i}=globalThis;m.TYPED_ARRAY_SUPPORT=b(),!m.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function b(){try{const Y=new s(1),n={foo:function(){return 42}};return Object.setPrototypeOf(n,s.prototype),Object.setPrototypeOf(Y,n),Y.foo()===42}catch{return!1}}Object.defineProperty(m.prototype,"parent",{enumerable:!0,get:function(){if(m.isBuffer(this))return this.buffer}}),Object.defineProperty(m.prototype,"offset",{enumerable:!0,get:function(){if(m.isBuffer(this))return this.byteOffset}});function h(Y){if(Y>Z)throw new RangeError('The value "'+Y+'" is invalid for option "size"');const n=new s(Y);return Object.setPrototypeOf(n,m.prototype),n}function m(Y,n,G){if(typeof Y=="number"){if(typeof n=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return M(Y)}return W(Y,n,G)}m.poolSize=8192;function W(Y,n,G){if(typeof Y=="string")return X(Y,n);if(d.isView(Y))return T(Y);if(Y==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Y);if(ql(Y,d)||Y&&ql(Y.buffer,d)||typeof i<"u"&&(ql(Y,i)||Y&&ql(Y.buffer,i)))return L(Y,n,G);if(typeof Y=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const y=Y.valueOf&&Y.valueOf();if(y!=null&&y!==Y)return m.from(y,n,G);const p=o(Y);if(p)return p;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof Y[Symbol.toPrimitive]=="function")return m.from(Y[Symbol.toPrimitive]("string"),n,G);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Y)}m.from=function(Y,n,G){return W(Y,n,G)},Object.setPrototypeOf(m.prototype,s.prototype),Object.setPrototypeOf(m,s);function e(Y){if(typeof Y!="number")throw new TypeError('"size" argument must be of type number');if(Y<0)throw new RangeError('The value "'+Y+'" is invalid for option "size"')}function N(Y,n,G){return e(Y),Y<=0?h(Y):n!==void 0?typeof G=="string"?h(Y).fill(n,G):h(Y).fill(n):h(Y)}m.alloc=function(Y,n,G){return N(Y,n,G)};function M(Y){return e(Y),h(Y<0?0:z(Y)|0)}m.allocUnsafe=function(Y){return M(Y)},m.allocUnsafeSlow=function(Y){return M(Y)};function X(Y,n){if((typeof n!="string"||n==="")&&(n="utf8"),!m.isEncoding(n))throw new TypeError("Unknown encoding: "+n);const G=S(Y,n)|0;let y=h(G);const p=y.write(Y,n);return p!==G&&(y=y.slice(0,p)),y}function u(Y){const n=Y.length<0?0:z(Y.length)|0,G=h(n);for(let y=0;y<n;y+=1)G[y]=Y[y]&255;return G}function T(Y){if(ql(Y,s)){const n=new s(Y);return L(n.buffer,n.byteOffset,n.byteLength)}return u(Y)}function L(Y,n,G){if(n<0||Y.byteLength<n)throw new RangeError('"offset" is outside of buffer bounds');if(Y.byteLength<n+(G||0))throw new RangeError('"length" is outside of buffer bounds');let y;return n===void 0&&G===void 0?y=new s(Y):G===void 0?y=new s(Y,n):y=new s(Y,n,G),Object.setPrototypeOf(y,m.prototype),y}function o(Y){if(m.isBuffer(Y)){const n=z(Y.length)|0,G=h(n);return G.length===0||Y.copy(G,0,0,n),G}if(Y.length!==void 0)return typeof Y.length!="number"||nZ(Y.length)?h(0):u(Y);if(Y.type==="Buffer"&&Array.isArray(Y.data))return u(Y.data)}function z(Y){if(Y>=Z)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Z.toString(16)+" bytes");return Y|0}function I(Y){return+Y!=Y&&(Y=0),m.alloc(+Y)}m.isBuffer=function(n){return n!=null&&n._isBuffer===!0&&n!==m.prototype},m.compare=function(n,G){if(ql(n,s)&&(n=m.from(n,n.offset,n.byteLength)),ql(G,s)&&(G=m.from(G,G.offset,G.byteLength)),!m.isBuffer(n)||!m.isBuffer(G))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(n===G)return 0;let y=n.length,p=G.length;for(let w=0,D=Math.min(y,p);w<D;++w)if(n[w]!==G[w]){y=n[w],p=G[w];break}return y<p?-1:p<y?1:0},m.isEncoding=function(n){switch(String(n).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},m.concat=function(n,G){if(!Array.isArray(n))throw new TypeError('"list" argument must be an Array of Buffers');if(n.length===0)return m.alloc(0);let y;if(G===void 0)for(G=0,y=0;y<n.length;++y)G+=n[y].length;const p=m.allocUnsafe(G);let w=0;for(y=0;y<n.length;++y){let D=n[y];if(ql(D,s))w+D.length>p.length?(m.isBuffer(D)||(D=m.from(D)),D.copy(p,w)):s.prototype.set.call(p,D,w);else if(m.isBuffer(D))D.copy(p,w);else throw new TypeError('"list" argument must be an Array of Buffers');w+=D.length}return p};function S(Y,n){if(m.isBuffer(Y))return Y.length;if(d.isView(Y)||ql(Y,d))return Y.byteLength;if(typeof Y!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof Y);const G=Y.length,y=arguments.length>2&&arguments[2]===!0;if(!y&&G===0)return 0;let p=!1;for(;;)switch(n){case"ascii":case"latin1":case"binary":return G;case"utf8":case"utf-8":return WZ(Y).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return G*2;case"hex":return G>>>1;case"base64":return ps(Y).length;default:if(p)return y?-1:WZ(Y).length;n=(""+n).toLowerCase(),p=!0}}m.byteLength=S;function x(Y,n,G){let y=!1;if((n===void 0||n<0)&&(n=0),n>this.length||((G===void 0||G>this.length)&&(G=this.length),G<=0)||(G>>>=0,n>>>=0,G<=n))return"";for(Y||(Y="utf8");;)switch(Y){case"hex":return il(this,n,G);case"utf8":case"utf-8":return J(this,n,G);case"ascii":return Yl(this,n,G);case"latin1":case"binary":return wl(this,n,G);case"base64":return r(this,n,G);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ll(this,n,G);default:if(y)throw new TypeError("Unknown encoding: "+Y);Y=(Y+"").toLowerCase(),y=!0}}m.prototype._isBuffer=!0;function R(Y,n,G){const y=Y[n];Y[n]=Y[G],Y[G]=y}m.prototype.swap16=function(){const n=this.length;if(n%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let G=0;G<n;G+=2)R(this,G,G+1);return this},m.prototype.swap32=function(){const n=this.length;if(n%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let G=0;G<n;G+=4)R(this,G,G+3),R(this,G+1,G+2);return this},m.prototype.swap64=function(){const n=this.length;if(n%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let G=0;G<n;G+=8)R(this,G,G+7),R(this,G+1,G+6),R(this,G+2,G+5),R(this,G+3,G+4);return this},m.prototype.toString=function(){const n=this.length;return n===0?"":arguments.length===0?J(this,0,n):x.apply(this,arguments)},m.prototype.toLocaleString=m.prototype.toString,m.prototype.equals=function(n){if(!m.isBuffer(n))throw new TypeError("Argument must be a Buffer");return this===n?!0:m.compare(this,n)===0},m.prototype.inspect=function(){let n="";const G=a.INSPECT_MAX_BYTES;return n=this.toString("hex",0,G).replace(/(.{2})/g,"$1 ").trim(),this.length>G&&(n+=" ... "),"<Buffer "+n+">"},c&&(m.prototype[c]=m.prototype.inspect),m.prototype.compare=function(n,G,y,p,w){if(ql(n,s)&&(n=m.from(n,n.offset,n.byteLength)),!m.isBuffer(n))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof n);if(G===void 0&&(G=0),y===void 0&&(y=n?n.length:0),p===void 0&&(p=0),w===void 0&&(w=this.length),G<0||y>n.length||p<0||w>this.length)throw new RangeError("out of range index");if(p>=w&&G>=y)return 0;if(p>=w)return-1;if(G>=y)return 1;if(G>>>=0,y>>>=0,p>>>=0,w>>>=0,this===n)return 0;let D=w-p,B=y-G;const ml=Math.min(D,B),sl=this.slice(p,w),al=n.slice(G,y);for(let $=0;$<ml;++$)if(sl[$]!==al[$]){D=sl[$],B=al[$];break}return D<B?-1:B<D?1:0};function j(Y,n,G,y,p){if(Y.length===0)return-1;if(typeof G=="string"?(y=G,G=0):G>2147483647?G=2147483647:G<-2147483648&&(G=-2147483648),G=+G,nZ(G)&&(G=p?0:Y.length-1),G<0&&(G=Y.length+G),G>=Y.length){if(p)return-1;G=Y.length-1}else if(G<0)if(p)G=0;else return-1;if(typeof n=="string"&&(n=m.from(n,y)),m.isBuffer(n))return n.length===0?-1:F(Y,n,G,y,p);if(typeof n=="number")return n=n&255,typeof s.prototype.indexOf=="function"?p?s.prototype.indexOf.call(Y,n,G):s.prototype.lastIndexOf.call(Y,n,G):F(Y,[n],G,y,p);throw new TypeError("val must be string, number or Buffer")}function F(Y,n,G,y,p){let w=1,D=Y.length,B=n.length;if(y!==void 0&&(y=String(y).toLowerCase(),y==="ucs2"||y==="ucs-2"||y==="utf16le"||y==="utf-16le")){if(Y.length<2||n.length<2)return-1;w=2,D/=2,B/=2,G/=2}function ml(al,$){return w===1?al[$]:al.readUInt16BE($*w)}let sl;if(p){let al=-1;for(sl=G;sl<D;sl++)if(ml(Y,sl)===ml(n,al===-1?0:sl-al)){if(al===-1&&(al=sl),sl-al+1===B)return al*w}else al!==-1&&(sl-=sl-al),al=-1}else for(G+B>D&&(G=D-B),sl=G;sl>=0;sl--){let al=!0;for(let $=0;$<B;$++)if(ml(Y,sl+$)!==ml(n,$)){al=!1;break}if(al)return sl}return-1}m.prototype.includes=function(n,G,y){return this.indexOf(n,G,y)!==-1},m.prototype.indexOf=function(n,G,y){return j(this,n,G,y,!0)},m.prototype.lastIndexOf=function(n,G,y){return j(this,n,G,y,!1)};function U(Y,n,G,y){G=Number(G)||0;const p=Y.length-G;y?(y=Number(y),y>p&&(y=p)):y=p;const w=n.length;y>w/2&&(y=w/2);let D;for(D=0;D<y;++D){const B=parseInt(n.substr(D*2,2),16);if(nZ(B))return D;Y[G+D]=B}return D}function K(Y,n,G,y){return uc(WZ(n,Y.length-G),Y,G,y)}function v(Y,n,G,y){return uc(am(n),Y,G,y)}function E(Y,n,G,y){return uc(ps(n),Y,G,y)}function tl(Y,n,G,y){return uc(hm(n,Y.length-G),Y,G,y)}m.prototype.write=function(n,G,y,p){if(G===void 0)p="utf8",y=this.length,G=0;else if(y===void 0&&typeof G=="string")p=G,y=this.length,G=0;else if(isFinite(G))G=G>>>0,isFinite(y)?(y=y>>>0,p===void 0&&(p="utf8")):(p=y,y=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const w=this.length-G;if((y===void 0||y>w)&&(y=w),n.length>0&&(y<0||G<0)||G>this.length)throw new RangeError("Attempt to write outside buffer bounds");p||(p="utf8");let D=!1;for(;;)switch(p){case"hex":return U(this,n,G,y);case"utf8":case"utf-8":return K(this,n,G,y);case"ascii":case"latin1":case"binary":return v(this,n,G,y);case"base64":return E(this,n,G,y);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return tl(this,n,G,y);default:if(D)throw new TypeError("Unknown encoding: "+p);p=(""+p).toLowerCase(),D=!0}},m.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function r(Y,n,G){return n===0&&G===Y.length?l.fromByteArray(Y):l.fromByteArray(Y.slice(n,G))}function J(Y,n,G){G=Math.min(Y.length,G);const y=[];let p=n;for(;p<G;){const w=Y[p];let D=null,B=w>239?4:w>223?3:w>191?2:1;if(p+B<=G){let ml,sl,al,$;switch(B){case 1:w<128&&(D=w);break;case 2:ml=Y[p+1],(ml&192)===128&&($=(w&31)<<6|ml&63,$>127&&(D=$));break;case 3:ml=Y[p+1],sl=Y[p+2],(ml&192)===128&&(sl&192)===128&&($=(w&15)<<12|(ml&63)<<6|sl&63,$>2047&&($<55296||$>57343)&&(D=$));break;case 4:ml=Y[p+1],sl=Y[p+2],al=Y[p+3],(ml&192)===128&&(sl&192)===128&&(al&192)===128&&($=(w&15)<<18|(ml&63)<<12|(sl&63)<<6|al&63,$>65535&&$<1114112&&(D=$))}}D===null?(D=65533,B=1):D>65535&&(D-=65536,y.push(D>>>10&1023|55296),D=56320|D&1023),y.push(D),p+=B}return _(y)}const Q=4096;function _(Y){const n=Y.length;if(n<=Q)return String.fromCharCode.apply(String,Y);let G="",y=0;for(;y<n;)G+=String.fromCharCode.apply(String,Y.slice(y,y+=Q));return G}function Yl(Y,n,G){let y="";G=Math.min(Y.length,G);for(let p=n;p<G;++p)y+=String.fromCharCode(Y[p]&127);return y}function wl(Y,n,G){let y="";G=Math.min(Y.length,G);for(let p=n;p<G;++p)y+=String.fromCharCode(Y[p]);return y}function il(Y,n,G){const y=Y.length;(!n||n<0)&&(n=0),(!G||G<0||G>y)&&(G=y);let p="";for(let w=n;w<G;++w)p+=Wm[Y[w]];return p}function ll(Y,n,G){const y=Y.slice(n,G);let p="";for(let w=0;w<y.length-1;w+=2)p+=String.fromCharCode(y[w]+y[w+1]*256);return p}m.prototype.slice=function(n,G){const y=this.length;n=~~n,G=G===void 0?y:~~G,n<0?(n+=y,n<0&&(n=0)):n>y&&(n=y),G<0?(G+=y,G<0&&(G=0)):G>y&&(G=y),G<n&&(G=n);const p=this.subarray(n,G);return Object.setPrototypeOf(p,m.prototype),p};function cl(Y,n,G){if(Y%1!==0||Y<0)throw new RangeError("offset is not uint");if(Y+n>G)throw new RangeError("Trying to access beyond buffer length")}m.prototype.readUintLE=m.prototype.readUIntLE=function(n,G,y){n=n>>>0,G=G>>>0,y||cl(n,G,this.length);let p=this[n],w=1,D=0;for(;++D<G&&(w*=256);)p+=this[n+D]*w;return p},m.prototype.readUintBE=m.prototype.readUIntBE=function(n,G,y){n=n>>>0,G=G>>>0,y||cl(n,G,this.length);let p=this[n+--G],w=1;for(;G>0&&(w*=256);)p+=this[n+--G]*w;return p},m.prototype.readUint8=m.prototype.readUInt8=function(n,G){return n=n>>>0,G||cl(n,1,this.length),this[n]},m.prototype.readUint16LE=m.prototype.readUInt16LE=function(n,G){return n=n>>>0,G||cl(n,2,this.length),this[n]|this[n+1]<<8},m.prototype.readUint16BE=m.prototype.readUInt16BE=function(n,G){return n=n>>>0,G||cl(n,2,this.length),this[n]<<8|this[n+1]},m.prototype.readUint32LE=m.prototype.readUInt32LE=function(n,G){return n=n>>>0,G||cl(n,4,this.length),(this[n]|this[n+1]<<8|this[n+2]<<16)+this[n+3]*16777216},m.prototype.readUint32BE=m.prototype.readUInt32BE=function(n,G){return n=n>>>0,G||cl(n,4,this.length),this[n]*16777216+(this[n+1]<<16|this[n+2]<<8|this[n+3])},m.prototype.readBigUInt64LE=it(function(n){n=n>>>0,zt(n,"offset");const G=this[n],y=this[n+7];(G===void 0||y===void 0)&&Qt(n,this.length-8);const p=G+this[++n]*2**8+this[++n]*2**16+this[++n]*2**24,w=this[++n]+this[++n]*2**8+this[++n]*2**16+y*2**24;return BigInt(p)+(BigInt(w)<<BigInt(32))}),m.prototype.readBigUInt64BE=it(function(n){n=n>>>0,zt(n,"offset");const G=this[n],y=this[n+7];(G===void 0||y===void 0)&&Qt(n,this.length-8);const p=G*2**24+this[++n]*2**16+this[++n]*2**8+this[++n],w=this[++n]*2**24+this[++n]*2**16+this[++n]*2**8+y;return(BigInt(p)<<BigInt(32))+BigInt(w)}),m.prototype.readIntLE=function(n,G,y){n=n>>>0,G=G>>>0,y||cl(n,G,this.length);let p=this[n],w=1,D=0;for(;++D<G&&(w*=256);)p+=this[n+D]*w;return w*=128,p>=w&&(p-=Math.pow(2,8*G)),p},m.prototype.readIntBE=function(n,G,y){n=n>>>0,G=G>>>0,y||cl(n,G,this.length);let p=G,w=1,D=this[n+--p];for(;p>0&&(w*=256);)D+=this[n+--p]*w;return w*=128,D>=w&&(D-=Math.pow(2,8*G)),D},m.prototype.readInt8=function(n,G){return n=n>>>0,G||cl(n,1,this.length),this[n]&128?(255-this[n]+1)*-1:this[n]},m.prototype.readInt16LE=function(n,G){n=n>>>0,G||cl(n,2,this.length);const y=this[n]|this[n+1]<<8;return y&32768?y|4294901760:y},m.prototype.readInt16BE=function(n,G){n=n>>>0,G||cl(n,2,this.length);const y=this[n+1]|this[n]<<8;return y&32768?y|4294901760:y},m.prototype.readInt32LE=function(n,G){return n=n>>>0,G||cl(n,4,this.length),this[n]|this[n+1]<<8|this[n+2]<<16|this[n+3]<<24},m.prototype.readInt32BE=function(n,G){return n=n>>>0,G||cl(n,4,this.length),this[n]<<24|this[n+1]<<16|this[n+2]<<8|this[n+3]},m.prototype.readBigInt64LE=it(function(n){n=n>>>0,zt(n,"offset");const G=this[n],y=this[n+7];(G===void 0||y===void 0)&&Qt(n,this.length-8);const p=this[n+4]+this[n+5]*2**8+this[n+6]*2**16+(y<<24);return(BigInt(p)<<BigInt(32))+BigInt(G+this[++n]*2**8+this[++n]*2**16+this[++n]*2**24)}),m.prototype.readBigInt64BE=it(function(n){n=n>>>0,zt(n,"offset");const G=this[n],y=this[n+7];(G===void 0||y===void 0)&&Qt(n,this.length-8);const p=(G<<24)+this[++n]*2**16+this[++n]*2**8+this[++n];return(BigInt(p)<<BigInt(32))+BigInt(this[++n]*2**24+this[++n]*2**16+this[++n]*2**8+y)}),m.prototype.readFloatLE=function(n,G){return n=n>>>0,G||cl(n,4,this.length),t.read(this,n,!0,23,4)},m.prototype.readFloatBE=function(n,G){return n=n>>>0,G||cl(n,4,this.length),t.read(this,n,!1,23,4)},m.prototype.readDoubleLE=function(n,G){return n=n>>>0,G||cl(n,8,this.length),t.read(this,n,!0,52,8)},m.prototype.readDoubleBE=function(n,G){return n=n>>>0,G||cl(n,8,this.length),t.read(this,n,!1,52,8)};function bl(Y,n,G,y,p,w){if(!m.isBuffer(Y))throw new TypeError('"buffer" argument must be a Buffer instance');if(n>p||n<w)throw new RangeError('"value" argument is out of bounds');if(G+y>Y.length)throw new RangeError("Index out of range")}m.prototype.writeUintLE=m.prototype.writeUIntLE=function(n,G,y,p){if(n=+n,G=G>>>0,y=y>>>0,!p){const B=Math.pow(2,8*y)-1;bl(this,n,G,y,B,0)}let w=1,D=0;for(this[G]=n&255;++D<y&&(w*=256);)this[G+D]=n/w&255;return G+y},m.prototype.writeUintBE=m.prototype.writeUIntBE=function(n,G,y,p){if(n=+n,G=G>>>0,y=y>>>0,!p){const B=Math.pow(2,8*y)-1;bl(this,n,G,y,B,0)}let w=y-1,D=1;for(this[G+w]=n&255;--w>=0&&(D*=256);)this[G+w]=n/D&255;return G+y},m.prototype.writeUint8=m.prototype.writeUInt8=function(n,G,y){return n=+n,G=G>>>0,y||bl(this,n,G,1,255,0),this[G]=n&255,G+1},m.prototype.writeUint16LE=m.prototype.writeUInt16LE=function(n,G,y){return n=+n,G=G>>>0,y||bl(this,n,G,2,65535,0),this[G]=n&255,this[G+1]=n>>>8,G+2},m.prototype.writeUint16BE=m.prototype.writeUInt16BE=function(n,G,y){return n=+n,G=G>>>0,y||bl(this,n,G,2,65535,0),this[G]=n>>>8,this[G+1]=n&255,G+2},m.prototype.writeUint32LE=m.prototype.writeUInt32LE=function(n,G,y){return n=+n,G=G>>>0,y||bl(this,n,G,4,4294967295,0),this[G+3]=n>>>24,this[G+2]=n>>>16,this[G+1]=n>>>8,this[G]=n&255,G+4},m.prototype.writeUint32BE=m.prototype.writeUInt32BE=function(n,G,y){return n=+n,G=G>>>0,y||bl(this,n,G,4,4294967295,0),this[G]=n>>>24,this[G+1]=n>>>16,this[G+2]=n>>>8,this[G+3]=n&255,G+4};function gl(Y,n,G,y,p){Vs(n,y,p,Y,G,7);let w=Number(n&BigInt(4294967295));Y[G++]=w,w=w>>8,Y[G++]=w,w=w>>8,Y[G++]=w,w=w>>8,Y[G++]=w;let D=Number(n>>BigInt(32)&BigInt(4294967295));return Y[G++]=D,D=D>>8,Y[G++]=D,D=D>>8,Y[G++]=D,D=D>>8,Y[G++]=D,G}function Zl(Y,n,G,y,p){Vs(n,y,p,Y,G,7);let w=Number(n&BigInt(4294967295));Y[G+7]=w,w=w>>8,Y[G+6]=w,w=w>>8,Y[G+5]=w,w=w>>8,Y[G+4]=w;let D=Number(n>>BigInt(32)&BigInt(4294967295));return Y[G+3]=D,D=D>>8,Y[G+2]=D,D=D>>8,Y[G+1]=D,D=D>>8,Y[G]=D,G+8}m.prototype.writeBigUInt64LE=it(function(n,G=0){return gl(this,n,G,BigInt(0),BigInt("0xffffffffffffffff"))}),m.prototype.writeBigUInt64BE=it(function(n,G=0){return Zl(this,n,G,BigInt(0),BigInt("0xffffffffffffffff"))}),m.prototype.writeIntLE=function(n,G,y,p){if(n=+n,G=G>>>0,!p){const ml=Math.pow(2,8*y-1);bl(this,n,G,y,ml-1,-ml)}let w=0,D=1,B=0;for(this[G]=n&255;++w<y&&(D*=256);)n<0&&B===0&&this[G+w-1]!==0&&(B=1),this[G+w]=(n/D>>0)-B&255;return G+y},m.prototype.writeIntBE=function(n,G,y,p){if(n=+n,G=G>>>0,!p){const ml=Math.pow(2,8*y-1);bl(this,n,G,y,ml-1,-ml)}let w=y-1,D=1,B=0;for(this[G+w]=n&255;--w>=0&&(D*=256);)n<0&&B===0&&this[G+w+1]!==0&&(B=1),this[G+w]=(n/D>>0)-B&255;return G+y},m.prototype.writeInt8=function(n,G,y){return n=+n,G=G>>>0,y||bl(this,n,G,1,127,-128),n<0&&(n=255+n+1),this[G]=n&255,G+1},m.prototype.writeInt16LE=function(n,G,y){return n=+n,G=G>>>0,y||bl(this,n,G,2,32767,-32768),this[G]=n&255,this[G+1]=n>>>8,G+2},m.prototype.writeInt16BE=function(n,G,y){return n=+n,G=G>>>0,y||bl(this,n,G,2,32767,-32768),this[G]=n>>>8,this[G+1]=n&255,G+2},m.prototype.writeInt32LE=function(n,G,y){return n=+n,G=G>>>0,y||bl(this,n,G,4,2147483647,-2147483648),this[G]=n&255,this[G+1]=n>>>8,this[G+2]=n>>>16,this[G+3]=n>>>24,G+4},m.prototype.writeInt32BE=function(n,G,y){return n=+n,G=G>>>0,y||bl(this,n,G,4,2147483647,-2147483648),n<0&&(n=4294967295+n+1),this[G]=n>>>24,this[G+1]=n>>>16,this[G+2]=n>>>8,this[G+3]=n&255,G+4},m.prototype.writeBigInt64LE=it(function(n,G=0){return gl(this,n,G,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),m.prototype.writeBigInt64BE=it(function(n,G=0){return Zl(this,n,G,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function dt(Y,n,G,y,p,w){if(G+y>Y.length)throw new RangeError("Index out of range");if(G<0)throw new RangeError("Index out of range")}function Mc(Y,n,G,y,p){return n=+n,G=G>>>0,p||dt(Y,n,G,4),t.write(Y,n,G,y,23,4),G+4}m.prototype.writeFloatLE=function(n,G,y){return Mc(this,n,G,!0,y)},m.prototype.writeFloatBE=function(n,G,y){return Mc(this,n,G,!1,y)};function Yc(Y,n,G,y,p){return n=+n,G=G>>>0,p||dt(Y,n,G,8),t.write(Y,n,G,y,52,8),G+8}m.prototype.writeDoubleLE=function(n,G,y){return Yc(this,n,G,!0,y)},m.prototype.writeDoubleBE=function(n,G,y){return Yc(this,n,G,!1,y)},m.prototype.copy=function(n,G,y,p){if(!m.isBuffer(n))throw new TypeError("argument should be a Buffer");if(y||(y=0),!p&&p!==0&&(p=this.length),G>=n.length&&(G=n.length),G||(G=0),p>0&&p<y&&(p=y),p===y||n.length===0||this.length===0)return 0;if(G<0)throw new RangeError("targetStart out of bounds");if(y<0||y>=this.length)throw new RangeError("Index out of range");if(p<0)throw new RangeError("sourceEnd out of bounds");p>this.length&&(p=this.length),n.length-G<p-y&&(p=n.length-G+y);const w=p-y;return this===n&&typeof s.prototype.copyWithin=="function"?this.copyWithin(G,y,p):s.prototype.set.call(n,this.subarray(y,p),G),w},m.prototype.fill=function(n,G,y,p){if(typeof n=="string"){if(typeof G=="string"?(p=G,G=0,y=this.length):typeof y=="string"&&(p=y,y=this.length),p!==void 0&&typeof p!="string")throw new TypeError("encoding must be a string");if(typeof p=="string"&&!m.isEncoding(p))throw new TypeError("Unknown encoding: "+p);if(n.length===1){const D=n.charCodeAt(0);(p==="utf8"&&D<128||p==="latin1")&&(n=D)}}else typeof n=="number"?n=n&255:typeof n=="boolean"&&(n=Number(n));if(G<0||this.length<G||this.length<y)throw new RangeError("Out of range index");if(y<=G)return this;G=G>>>0,y=y===void 0?this.length:y>>>0,n||(n=0);let w;if(typeof n=="number")for(w=G;w<y;++w)this[w]=n;else{const D=m.isBuffer(n)?n:m.from(n,p),B=D.length;if(B===0)throw new TypeError('The value "'+n+'" is invalid for argument "value"');for(w=0;w<y-G;++w)this[w+G]=D[w%B]}return this};const _l={};function Gt(Y,n,G){_l[Y]=class extends G{constructor(){super(),Object.defineProperty(this,"message",{value:n.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${Y}]`,this.stack,delete this.name}get code(){return Y}set code(p){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:p,writable:!0})}toString(){return`${this.name} [${Y}]: ${this.message}`}}}Gt("ERR_BUFFER_OUT_OF_BOUNDS",function(Y){return Y?`${Y} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Gt("ERR_INVALID_ARG_TYPE",function(Y,n){return`The "${Y}" argument must be of type number. Received type ${typeof n}`},TypeError),Gt("ERR_OUT_OF_RANGE",function(Y,n,G){let y=`The value of "${Y}" is out of range.`,p=G;return Number.isInteger(G)&&Math.abs(G)>2**32?p=Kt(String(G)):typeof G=="bigint"&&(p=String(G),(G>BigInt(2)**BigInt(32)||G<-(BigInt(2)**BigInt(32)))&&(p=Kt(p)),p+="n"),y+=` It must be ${n}. Received ${p}`,y},RangeError);function Kt(Y){let n="",G=Y.length;const y=Y[0]==="-"?1:0;for(;G>=y+4;G-=3)n=`_${Y.slice(G-3,G)}${n}`;return`${Y.slice(0,G)}${n}`}function hZ(Y,n,G){zt(n,"offset"),(Y[n]===void 0||Y[n+G]===void 0)&&Qt(n,Y.length-(G+1))}function Vs(Y,n,G,y,p,w){if(Y>G||Y<n){const D=typeof n=="bigint"?"n":"";let B;throw n===0||n===BigInt(0)?B=`>= 0${D} and < 2${D} ** ${(w+1)*8}${D}`:B=`>= -(2${D} ** ${(w+1)*8-1}${D}) and < 2 ** ${(w+1)*8-1}${D}`,new _l.ERR_OUT_OF_RANGE("value",B,Y)}hZ(y,p,w)}function zt(Y,n){if(typeof Y!="number")throw new _l.ERR_INVALID_ARG_TYPE(n,"number",Y)}function Qt(Y,n,G){throw Math.floor(Y)!==Y?(zt(Y,G),new _l.ERR_OUT_OF_RANGE("offset","an integer",Y)):n<0?new _l.ERR_BUFFER_OUT_OF_BOUNDS:new _l.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${n}`,Y)}const bm=/[^+/0-9A-Za-z-_]/g;function mm(Y){if(Y=Y.split("=")[0],Y=Y.trim().replace(bm,""),Y.length<2)return"";for(;Y.length%4!==0;)Y=Y+"=";return Y}function WZ(Y,n){n=n||1/0;let G;const y=Y.length;let p=null;const w=[];for(let D=0;D<y;++D){if(G=Y.charCodeAt(D),G>55295&&G<57344){if(!p){if(G>56319){(n-=3)>-1&&w.push(239,191,189);continue}else if(D+1===y){(n-=3)>-1&&w.push(239,191,189);continue}p=G;continue}if(G<56320){(n-=3)>-1&&w.push(239,191,189),p=G;continue}G=(p-55296<<10|G-56320)+65536}else p&&(n-=3)>-1&&w.push(239,191,189);if(p=null,G<128){if((n-=1)<0)break;w.push(G)}else if(G<2048){if((n-=2)<0)break;w.push(G>>6|192,G&63|128)}else if(G<65536){if((n-=3)<0)break;w.push(G>>12|224,G>>6&63|128,G&63|128)}else if(G<1114112){if((n-=4)<0)break;w.push(G>>18|240,G>>12&63|128,G>>6&63|128,G&63|128)}else throw new Error("Invalid code point")}return w}function am(Y){const n=[];for(let G=0;G<Y.length;++G)n.push(Y.charCodeAt(G)&255);return n}function hm(Y,n){let G,y,p;const w=[];for(let D=0;D<Y.length&&!((n-=2)<0);++D)G=Y.charCodeAt(D),y=G>>8,p=G%256,w.push(p),w.push(y);return w}function ps(Y){return l.toByteArray(mm(Y))}function uc(Y,n,G,y){let p;for(p=0;p<y&&!(p+G>=n.length||p>=Y.length);++p)n[p+G]=Y[p];return p}function ql(Y,n){return Y instanceof n||Y!=null&&Y.constructor!=null&&Y.constructor.name!=null&&Y.constructor.name===n.name}function nZ(Y){return Y!==Y}const Wm=function(){const Y="0123456789abcdef",n=new Array(256);for(let G=0;G<16;++G){const y=G*16;for(let p=0;p<16;++p)n[y+p]=Y[G]+Y[p]}return n}();function it(Y){return typeof BigInt>"u"?nm:Y}function nm(){throw new Error("BigInt not supported")}})(Tc);const pc=Tc.Buffer,Lc=Tc.Buffer,Ds="End-Of-Stream";class Xt extends Error{constructor(){super(Ds)}}class Js{constructor(l){this.position=0,this.numBuffer=new Uint8Array(8),this.fileInfo=l||{}}async readToken(l,t=this.position){const c=Lc.alloc(l.len);if(await this.readBuffer(c,{position:t})<l.len)throw new Xt;return l.get(c,0)}async peekToken(l,t=this.position){const c=Lc.alloc(l.len);if(await this.peekBuffer(c,{position:t})<l.len)throw new Xt;return l.get(c,0)}async readNumber(l){if(await this.readBuffer(this.numBuffer,{length:l.len})<l.len)throw new Xt;return l.get(this.numBuffer,0)}async peekNumber(l){if(await this.peekBuffer(this.numBuffer,{length:l.len})<l.len)throw new Xt;return l.get(this.numBuffer,0)}async ignore(l){if(this.fileInfo.size!==void 0){const t=this.fileInfo.size-this.position;if(l>t)return this.position+=t,t}return this.position+=l,l}async close(){}normalizeOptions(l,t){if(t&&t.position!==void 0&&t.position<this.position)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");return t?{mayBeLess:t.mayBeLess===!0,offset:t.offset?t.offset:0,length:t.length?t.length:l.length-(t.offset?t.offset:0),position:t.position?t.position:this.position}:{mayBeLess:!1,offset:0,length:l.length,position:this.position}}}class Fs extends Js{constructor(l,t){super(t),this.uint8Array=l,this.fileInfo.size=this.fileInfo.size?this.fileInfo.size:l.length}async readBuffer(l,t){if(t&&t.position){if(t.position<this.position)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");this.position=t.position}const c=await this.peekBuffer(l,t);return this.position+=c,c}async peekBuffer(l,t){const c=this.normalizeOptions(l,t),Z=Math.min(this.uint8Array.length-c.position,c.length);if(!c.mayBeLess&&Z<c.length)throw new Xt;return l.set(this.uint8Array.subarray(c.position,c.position+Z),c.offset),Z}async close(){}}function rs(a,l){return new Fs(a,l)}class NZ{constructor(l,t){this.len=l,this.encoding=t}get(l,t){return Lc.from(l).toString(this.encoding,t,t+this.len)}}const Us=4100,Os=[137,80,78,71,13,10,26,10],Cs=[255,216,255],ks=[66,77],gs=[71,73,70],Es=[77,90],Ks=[80,75,3,4],Qs=[39,10,0,0,0,0,0,0,0,0,0,0],Hs=[0,0,1,0],zc=a=>[...a].map(l=>l.charCodeAt(0)),Ps=zc("WEBP"),vs=zc("%PDF"),Bs=zc("SCRM"),fs=(a,l=0,t=2)=>new Promise((c,Z)=>{const s=new FileReader;s.onload=()=>{c(s.result)},s.onerror=Z,s.readAsArrayBuffer(a.slice(l,t))}),As=a=>new Promise((l,t)=>{const c=new FileReader;c.onload=()=>{l(c.result)},c.onerror=t,c.readAsArrayBuffer(a)}),Ul=async(a,l,t=0)=>{const c=await fs(a,t,l.length+t),Z=new Uint8Array(c);return l.every((s,d)=>s===Z[d])},Ic=async a=>{if(await Ul(a,Os))return{ext:"png",mime:"image/png"};if(await Ul(a,Cs))return{ext:"jpg",mime:"image/jpeg"};if(await Ul(a,Ps,8))return{ext:"webp",mime:"image/webp"};if(await Ul(a,ks))return{ext:"bmp",mime:"image/bmp"};if(await Ul(a,gs))return{ext:"gif",mime:"image/gif"};if(await Ul(a,vs))return{ext:"pdf",mime:"application/pdf"};if(await Ul(a,Hs))return{ext:"ico",mime:"image/x-icon"};if(await Ul(a,Ks)){const l=pc.alloc(Us),t=new Uint8Array(await As(a)),c=rs(t);c.fileInfo.size===void 0&&(c.fileInfo.size=Number.MAX_SAFE_INTEGER),await c.peekBuffer(l,{length:12,mayBeLess:!0});try{for(;c.position+30<c.fileInfo.size;){await c.readBuffer(l,{length:30});const Z={compressedSize:l.readUInt32LE(18),uncompressedSize:l.readUInt32LE(22),filenameLength:l.readUInt16LE(26),extraFieldLength:l.readUInt16LE(28),filename:""};if(Z.filename=await c.readToken(new NZ(Z.filenameLength,"utf-8")),await c.ignore(Z.extraFieldLength),Z.filename==="META-INF/mozilla.rsa")return{ext:"xpi",mime:"application/x-xpinstall"};if(Z.filename.endsWith(".rels")||Z.filename.endsWith(".xml"))switch(Z.filename.split("/")[0]){case"_rels":break;case"word":return{ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"};case"ppt":return{ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"};case"xl":return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};default:break}if(Z.filename.startsWith("xl/"))return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};if(Z.filename.startsWith("3D/")&&Z.filename.endsWith(".model"))return{ext:"3mf",mime:"model/3mf"};if(Z.filename==="mimetype"&&Z.compressedSize===Z.uncompressedSize){let s=await c.readToken(new NZ(Z.compressedSize,"utf-8"));switch(s=s.trim(),s){case"application/epub+zip":return{ext:"epub",mime:"application/epub+zip"};case"application/vnd.oasis.opendocument.text":return{ext:"odt",mime:"application/vnd.oasis.opendocument.text"};case"application/vnd.oasis.opendocument.spreadsheet":return{ext:"ods",mime:"application/vnd.oasis.opendocument.spreadsheet"};case"application/vnd.oasis.opendocument.presentation":return{ext:"odp",mime:"application/vnd.oasis.opendocument.presentation"};default:break}}if(Z.compressedSize===0){let s=-1;for(;s<0&&c.position<c.fileInfo.size;)await c.peekBuffer(l,{mayBeLess:!0}),s=l.indexOf("504B0304",0,"hex"),await c.ignore(s>=0?s:l.length)}else await c.ignore(Z.compressedSize)}}catch(Z){if(!(Z instanceof Xt))throw Z}return{ext:"zip",mime:"application/zip"}}if(await Ul(a,Es))return{ext:"exe",mime:"application/x-msdownload"};if(await Ul(a,Bs))return{ext:"s3m",mime:"audio/x-s3m"};if(await Ul(a,Qs,2))return{ext:"shp",mime:"application/x-esri-shape"};switch(a.type){case"text/plain":return{ext:"txt",mime:"text/plain"};case"image/svg+xml":return{ext:"svg",mime:"image/svg+xml"}}return{ext:"unknown",mime:"unknown"}},Pt=["png","jpg","webp","bmp","gif","svg","ico"],vt=["pdf"],Bt=["docx"],_s=["xlsx","csv"],ft=["txt"],qs=["zip"];function $s(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var XZ={exports:{}},hl=XZ.exports={},Kl,Ql;function wc(){throw new Error("setTimeout has not been defined")}function Rc(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Kl=setTimeout:Kl=wc}catch{Kl=wc}try{typeof clearTimeout=="function"?Ql=clearTimeout:Ql=Rc}catch{Ql=Rc}})();function MZ(a){if(Kl===setTimeout)return setTimeout(a,0);if((Kl===wc||!Kl)&&setTimeout)return Kl=setTimeout,setTimeout(a,0);try{return Kl(a,0)}catch{try{return Kl.call(null,a,0)}catch{return Kl.call(this,a,0)}}}function ld(a){if(Ql===clearTimeout)return clearTimeout(a);if((Ql===Rc||!Ql)&&clearTimeout)return Ql=clearTimeout,clearTimeout(a);try{return Ql(a)}catch{try{return Ql.call(null,a)}catch{return Ql.call(this,a)}}}var $l=[],Mt=!1,bt,At=-1;function td(){!Mt||!bt||(Mt=!1,bt.length?$l=bt.concat($l):At=-1,$l.length&&YZ())}function YZ(){if(!Mt){var a=MZ(td);Mt=!0;for(var l=$l.length;l;){for(bt=$l,$l=[];++At<l;)bt&&bt[At].run();At=-1,l=$l.length}bt=null,Mt=!1,ld(a)}}hl.nextTick=function(a){var l=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)l[t-1]=arguments[t];$l.push(new uZ(a,l)),$l.length===1&&!Mt&&MZ(YZ)};function uZ(a,l){this.fun=a,this.array=l}uZ.prototype.run=function(){this.fun.apply(null,this.array)},hl.title="browser",hl.browser=!0,hl.env={},hl.argv=[],hl.version="",hl.versions={};function lt(){}hl.on=lt,hl.addListener=lt,hl.once=lt,hl.off=lt,hl.removeListener=lt,hl.removeAllListeners=lt,hl.emit=lt,hl.prependListener=lt,hl.prependOnceListener=lt,hl.listeners=function(a){return[]},hl.binding=function(a){throw new Error("process.binding is not supported")},hl.cwd=function(){return"/"},hl.chdir=function(a){throw new Error("process.chdir is not supported")},hl.umask=function(){return 0};var cd=XZ.exports;const Ol=$s(cd),zl=typeof Ol=="object"&&Ol+""=="[object process]"&&!Ol.versions.nw&&!(Ol.versions.electron&&Ol.type&&Ol.type!=="browser"),Sc=[.001,0,0,.001,0,0],xc=1.35,xl={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,IS_EDITING:128,OPLIST:256},Hl={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},Zd="pdfjs_internal_editor_",H={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,SIGNATURE:101},A={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,HIGHLIGHT_COLOR:31,HIGHLIGHT_DEFAULT_COLOR:32,HIGHLIGHT_THICKNESS:33,HIGHLIGHT_FREE:34,HIGHLIGHT_SHOW_ALL:35,DRAW_STEP:41},sd={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},pl={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},_t={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},el={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26},Yt={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},qt={ERRORS:0,WARNINGS:1,INFOS:5},$t={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91,setStrokeTransparent:92,setFillTransparent:93,rawFillPath:94},lc={moveTo:0,lineTo:1,curveTo:2,closePath:3},dd={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let tc=qt.WARNINGS;function id(a){Number.isInteger(a)&&(tc=a)}function bd(){return tc}function cc(a){tc>=qt.INFOS&&console.log(`Info: ${a}`)}function P(a){tc>=qt.WARNINGS&&console.log(`Warning: ${a}`)}function q(a){throw new Error(a)}function Gl(a,l){a||q(l)}function md(a){switch(a?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function yZ(a,l=null,t=null){if(!a)return null;if(t&&typeof a=="string"&&(t.addDefaultProtocol&&a.startsWith("www.")&&a.match(/\./g)?.length>=2&&(a=`http://${a}`),t.tryConvertEncoding))try{a=ed(a)}catch{}const c=l?URL.parse(a,l):URL.parse(a);return md(c)?c:null}function TZ(a,l,t=!1){const c=URL.parse(a);return c?(c.hash=l,c.href):t&&yZ(a,"http://example.com")?a.split("#",1)[0]+`${l?`#${l}`:""}`:""}function f(a,l,t,c=!1){return Object.defineProperty(a,l,{value:t,enumerable:!c,configurable:!0,writable:!1}),t}const mt=function(){function l(t,c){this.message=t,this.name=c}return l.prototype=new Error,l.constructor=l,l}();class oZ extends mt{constructor(l,t){super(l,"PasswordException"),this.code=t}}class jc extends mt{constructor(l,t){super(l,"UnknownErrorException"),this.details=t}}class Dc extends mt{constructor(l){super(l,"InvalidPDFException")}}class Zc extends mt{constructor(l,t,c){super(l,"ResponseException"),this.status=t,this.missing=c}}class ad extends mt{constructor(l){super(l,"FormatError")}}class Zt extends mt{constructor(l){super(l,"AbortException")}}function VZ(a){(typeof a!="object"||a?.length===void 0)&&q("Invalid argument for bytesToString");const l=a.length,t=8192;if(l<t)return String.fromCharCode.apply(null,a);const c=[];for(let Z=0;Z<l;Z+=t){const s=Math.min(Z+t,l),d=a.subarray(Z,s);c.push(String.fromCharCode.apply(null,d))}return c.join("")}function It(a){typeof a!="string"&&q("Invalid argument for stringToBytes");const l=a.length,t=new Uint8Array(l);for(let c=0;c<l;++c)t[c]=a.charCodeAt(c)&255;return t}function hd(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)}function Wd(){const a=new Uint8Array(4);return a[0]=1,new Uint32Array(a.buffer,0,1)[0]===1}function nd(){try{return new Function(""),!0}catch{return!1}}class ul{static get isLittleEndian(){return f(this,"isLittleEndian",Wd())}static get isEvalSupported(){return f(this,"isEvalSupported",nd())}static get isOffscreenCanvasSupported(){return f(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get isImageDecoderSupported(){return f(this,"isImageDecoderSupported",typeof ImageDecoder<"u")}static get platform(){const{platform:l,userAgent:t}=navigator;return f(this,"platform",{isAndroid:t.includes("Android"),isLinux:l.includes("Linux"),isMac:l.includes("Mac"),isWindows:l.includes("Win"),isFirefox:t.includes("Firefox")})}static get isCSSRoundSupported(){return f(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}}const Jc=Array.from(Array(256).keys(),a=>a.toString(16).padStart(2,"0"));class C{static makeHexColor(l,t,c){return`#${Jc[l]}${Jc[t]}${Jc[c]}`}static scaleMinMax(l,t){let c;l[0]?(l[0]<0&&(c=t[0],t[0]=t[2],t[2]=c),t[0]*=l[0],t[2]*=l[0],l[3]<0&&(c=t[1],t[1]=t[3],t[3]=c),t[1]*=l[3],t[3]*=l[3]):(c=t[0],t[0]=t[1],t[1]=c,c=t[2],t[2]=t[3],t[3]=c,l[1]<0&&(c=t[1],t[1]=t[3],t[3]=c),t[1]*=l[1],t[3]*=l[1],l[2]<0&&(c=t[0],t[0]=t[2],t[2]=c),t[0]*=l[2],t[2]*=l[2]),t[0]+=l[4],t[1]+=l[5],t[2]+=l[4],t[3]+=l[5]}static transform(l,t){return[l[0]*t[0]+l[2]*t[1],l[1]*t[0]+l[3]*t[1],l[0]*t[2]+l[2]*t[3],l[1]*t[2]+l[3]*t[3],l[0]*t[4]+l[2]*t[5]+l[4],l[1]*t[4]+l[3]*t[5]+l[5]]}static applyTransform(l,t,c=0){const Z=l[c],s=l[c+1];l[c]=Z*t[0]+s*t[2]+t[4],l[c+1]=Z*t[1]+s*t[3]+t[5]}static applyTransformToBezier(l,t,c=0){const Z=t[0],s=t[1],d=t[2],i=t[3],b=t[4],h=t[5];for(let m=0;m<6;m+=2){const W=l[c+m],e=l[c+m+1];l[c+m]=W*Z+e*d+b,l[c+m+1]=W*s+e*i+h}}static applyInverseTransform(l,t){const c=l[0],Z=l[1],s=t[0]*t[3]-t[1]*t[2];l[0]=(c*t[3]-Z*t[2]+t[2]*t[5]-t[4]*t[3])/s,l[1]=(-c*t[1]+Z*t[0]+t[4]*t[1]-t[5]*t[0])/s}static axialAlignedBoundingBox(l,t,c){const Z=t[0],s=t[1],d=t[2],i=t[3],b=t[4],h=t[5],m=l[0],W=l[1],e=l[2],N=l[3];let M=Z*m+b,X=M,u=Z*e+b,T=u,L=i*W+h,o=L,z=i*N+h,I=z;if(s!==0||d!==0){const S=s*m,x=s*e,R=d*W,j=d*N;M+=R,T+=R,u+=j,X+=j,L+=S,I+=S,z+=x,o+=x}c[0]=Math.min(c[0],M,u,X,T),c[1]=Math.min(c[1],L,z,o,I),c[2]=Math.max(c[2],M,u,X,T),c[3]=Math.max(c[3],L,z,o,I)}static inverseTransform(l){const t=l[0]*l[3]-l[1]*l[2];return[l[3]/t,-l[1]/t,-l[2]/t,l[0]/t,(l[2]*l[5]-l[4]*l[3])/t,(l[4]*l[1]-l[5]*l[0])/t]}static singularValueDecompose2dScale(l,t){const c=l[0],Z=l[1],s=l[2],d=l[3],i=c**2+Z**2,b=c*s+Z*d,h=s**2+d**2,m=(i+h)/2,W=Math.sqrt(m**2-(i*h-b**2));t[0]=Math.sqrt(m+W||1),t[1]=Math.sqrt(m-W||1)}static normalizeRect(l){const t=l.slice(0);return l[0]>l[2]&&(t[0]=l[2],t[2]=l[0]),l[1]>l[3]&&(t[1]=l[3],t[3]=l[1]),t}static intersect(l,t){const c=Math.max(Math.min(l[0],l[2]),Math.min(t[0],t[2])),Z=Math.min(Math.max(l[0],l[2]),Math.max(t[0],t[2]));if(c>Z)return null;const s=Math.max(Math.min(l[1],l[3]),Math.min(t[1],t[3])),d=Math.min(Math.max(l[1],l[3]),Math.max(t[1],t[3]));return s>d?null:[c,s,Z,d]}static pointBoundingBox(l,t,c){c[0]=Math.min(c[0],l),c[1]=Math.min(c[1],t),c[2]=Math.max(c[2],l),c[3]=Math.max(c[3],t)}static rectBoundingBox(l,t,c,Z,s){s[0]=Math.min(s[0],l,c),s[1]=Math.min(s[1],t,Z),s[2]=Math.max(s[2],l,c),s[3]=Math.max(s[3],t,Z)}static#l(l,t,c,Z,s,d,i,b,h,m){if(h<=0||h>=1)return;const W=1-h,e=h*h,N=e*h,M=W*(W*(W*l+3*h*t)+3*e*c)+N*Z,X=W*(W*(W*s+3*h*d)+3*e*i)+N*b;m[0]=Math.min(m[0],M),m[1]=Math.min(m[1],X),m[2]=Math.max(m[2],M),m[3]=Math.max(m[3],X)}static#t(l,t,c,Z,s,d,i,b,h,m,W,e){if(Math.abs(h)<1e-12){Math.abs(m)>=1e-12&&this.#l(l,t,c,Z,s,d,i,b,-W/m,e);return}const N=m**2-4*W*h;if(N<0)return;const M=Math.sqrt(N),X=2*h;this.#l(l,t,c,Z,s,d,i,b,(-m+M)/X,e),this.#l(l,t,c,Z,s,d,i,b,(-m-M)/X,e)}static bezierBoundingBox(l,t,c,Z,s,d,i,b,h){h[0]=Math.min(h[0],l,i),h[1]=Math.min(h[1],t,b),h[2]=Math.max(h[2],l,i),h[3]=Math.max(h[3],t,b),this.#t(l,c,s,i,t,Z,d,b,3*(-l+3*(c-s)+i),6*(l-2*c+s),3*(c-l),h),this.#t(l,c,s,i,t,Z,d,b,3*(-t+3*(Z-d)+b),6*(t-2*Z+d),3*(Z-t),h)}}function ed(a){return decodeURIComponent(escape(a))}let Fc=null,pZ=null;function Gd(a){return Fc||(Fc=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,pZ=new Map([["ſt","ſt"]])),a.replaceAll(Fc,(l,t,c)=>t?t.normalize("NFKC"):pZ.get(c))}function LZ(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();const a=new Uint8Array(32);return crypto.getRandomValues(a),VZ(a)}const rc="pdfjs_internal_id_";function Nd(a,l,t){if(!Array.isArray(t)||t.length<2)return!1;const[c,Z,...s]=t;if(!a(c)&&!Number.isInteger(c)||!l(Z))return!1;const d=s.length;let i=!0;switch(Z.name){case"XYZ":if(d<2||d>3)return!1;break;case"Fit":case"FitB":return d===0;case"FitH":case"FitBH":case"FitV":case"FitBV":if(d>1)return!1;break;case"FitR":if(d!==4)return!1;i=!1;break;default:return!1}for(const b of s)if(!(typeof b=="number"||i&&b===null))return!1;return!0}function Il(a,l,t){return Math.min(Math.max(a,l),t)}function zZ(a){return Uint8Array.prototype.toBase64?a.toBase64():btoa(VZ(a))}function Xd(a){return Uint8Array.fromBase64?Uint8Array.fromBase64(a):It(atob(a))}typeof Promise.try!="function"&&(Promise.try=function(a,...l){return new Promise(t=>{t(a(...l))})}),typeof Math.sumPrecise!="function"&&(Math.sumPrecise=function(a){return a.reduce((l,t)=>l+t,0)});const tt="http://www.w3.org/2000/svg";class ut{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}async function wt(a,l="text"){if(St(a,document.baseURI)){const t=await fetch(a);if(!t.ok)throw new Error(t.statusText);switch(l){case"arraybuffer":return t.arrayBuffer();case"blob":return t.blob();case"json":return t.json()}return t.text()}return new Promise((t,c)=>{const Z=new XMLHttpRequest;Z.open("GET",a,!0),Z.responseType=l,Z.onreadystatechange=()=>{if(Z.readyState===XMLHttpRequest.DONE){if(Z.status===200||Z.status===0){switch(l){case"arraybuffer":case"blob":case"json":t(Z.response);return}t(Z.responseText);return}c(new Error(Z.statusText))}},Z.send(null)})}class Rt{constructor({viewBox:l,userUnit:t,scale:c,rotation:Z,offsetX:s=0,offsetY:d=0,dontFlip:i=!1}){this.viewBox=l,this.userUnit=t,this.scale=c,this.rotation=Z,this.offsetX=s,this.offsetY=d,c*=t;const b=(l[2]+l[0])/2,h=(l[3]+l[1])/2;let m,W,e,N;switch(Z%=360,Z<0&&(Z+=360),Z){case 180:m=-1,W=0,e=0,N=1;break;case 90:m=0,W=1,e=1,N=0;break;case 270:m=0,W=-1,e=-1,N=0;break;case 0:m=1,W=0,e=0,N=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}i&&(e=-e,N=-N);let M,X,u,T;m===0?(M=Math.abs(h-l[1])*c+s,X=Math.abs(b-l[0])*c+d,u=(l[3]-l[1])*c,T=(l[2]-l[0])*c):(M=Math.abs(b-l[0])*c+s,X=Math.abs(h-l[1])*c+d,u=(l[2]-l[0])*c,T=(l[3]-l[1])*c),this.transform=[m*c,W*c,e*c,N*c,M-m*c*b-e*c*h,X-W*c*b-N*c*h],this.width=u,this.height=T}get rawDims(){const l=this.viewBox;return f(this,"rawDims",{pageWidth:l[2]-l[0],pageHeight:l[3]-l[1],pageX:l[0],pageY:l[1]})}clone({scale:l=this.scale,rotation:t=this.rotation,offsetX:c=this.offsetX,offsetY:Z=this.offsetY,dontFlip:s=!1}={}){return new Rt({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:l,rotation:t,offsetX:c,offsetY:Z,dontFlip:s})}convertToViewportPoint(l,t){const c=[l,t];return C.applyTransform(c,this.transform),c}convertToViewportRectangle(l){const t=[l[0],l[1]];C.applyTransform(t,this.transform);const c=[l[2],l[3]];return C.applyTransform(c,this.transform),[t[0],t[1],c[0],c[1]]}convertToPdfPoint(l,t){const c=[l,t];return C.applyInverseTransform(c,this.transform),c}}class Uc extends mt{constructor(l,t=0){super(l,"RenderingCancelledException"),this.extraDelay=t}}function sc(a){const l=a.length;let t=0;for(;t<l&&a[t].trim()==="";)t++;return a.substring(t,t+5).toLowerCase()==="data:"}function Oc(a){return typeof a=="string"&&/\.pdf$/i.test(a)}function Md(a){return[a]=a.split(/[#?]/,1),a.substring(a.lastIndexOf("/")+1)}function Yd(a,l="document.pdf"){if(typeof a!="string")return l;if(sc(a))return P('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),l;const t=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/,c=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,Z=t.exec(a);let s=c.exec(Z[1])||c.exec(Z[2])||c.exec(Z[3]);if(s&&(s=s[0],s.includes("%")))try{s=c.exec(decodeURIComponent(s))[0]}catch{}return s||l}class IZ{started=Object.create(null);times=[];time(l){l in this.started&&P(`Timer is already running for ${l}`),this.started[l]=Date.now()}timeEnd(l){l in this.started||P(`Timer has not been started for ${l}`),this.times.push({name:l,start:this.started[l],end:Date.now()}),delete this.started[l]}toString(){const l=[];let t=0;for(const{name:c}of this.times)t=Math.max(c.length,t);for(const{name:c,start:Z,end:s}of this.times)l.push(`${c.padEnd(t)} ${s-Z}ms
`);return l.join("")}}function St(a,l){const t=l?URL.parse(a,l):URL.parse(a);return t?.protocol==="http:"||t?.protocol==="https:"}function Cl(a){a.preventDefault()}function Nl(a){a.preventDefault(),a.stopPropagation()}function ud(a){console.log("Deprecated API usage: "+a)}class wZ{static#l;static toDateObject(l){if(!l||typeof l!="string")return null;this.#l||=new