officeparser 6.0.6 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +92 -13
- package/dist/OfficeParser.d.ts +10 -1
- package/dist/OfficeParser.js +43 -56
- package/dist/cli.d.ts +20 -0
- package/dist/cli.js +116 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +7 -59
- package/dist/index.mjs +18 -0
- package/dist/officeparser.browser.d.ts +756 -0
- package/dist/officeparser.browser.iife.js +112 -0
- package/dist/officeparser.browser.mjs +111 -0
- package/dist/parsers/ExcelParser.d.ts +1 -1
- package/dist/parsers/ExcelParser.js +71 -63
- package/dist/parsers/OpenOfficeParser.d.ts +1 -1
- package/dist/parsers/OpenOfficeParser.js +131 -114
- package/dist/parsers/PdfParser.d.ts +1 -1
- package/dist/parsers/PdfParser.js +98 -94
- package/dist/parsers/PowerPointParser.d.ts +1 -1
- package/dist/parsers/PowerPointParser.js +85 -88
- package/dist/parsers/RtfParser.d.ts +1 -1
- package/dist/parsers/RtfParser.js +10 -6
- package/dist/parsers/WordParser.d.ts +1 -1
- package/dist/parsers/WordParser.js +109 -101
- package/dist/sbom.cdx.json +1807 -0
- package/dist/types.d.ts +69 -1
- package/dist/utils/chartUtils.js +2 -0
- package/dist/utils/dateUtils.d.ts +17 -0
- package/dist/utils/dateUtils.js +69 -0
- package/dist/utils/envUtils.d.ts +24 -0
- package/dist/utils/envUtils.js +69 -0
- package/dist/utils/moduleLoader.d.ts +2 -1
- package/dist/utils/moduleLoader.js +9 -39
- package/dist/utils/ocrUtils.d.ts +16 -12
- package/dist/utils/ocrUtils.js +186 -25
- package/dist/utils/xmlUtils.d.ts +80 -9
- package/dist/utils/xmlUtils.js +236 -18
- package/dist/utils/zipUtils.js +6 -47
- package/package.json +39 -18
- package/dist/officeparser.browser.js +0 -153
- package/dist/officeparser.browser.js.map +0 -7
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
// Shim for setImmediate
|
|
4
|
-
if (typeof setImmediate === 'undefined') {
|
|
5
|
-
window.setImmediate = function(callback) {
|
|
6
|
-
return setTimeout(callback, 0);
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
"use strict";var officeParser=(()=>{var F8=Object.create;var zp=Object.defineProperty;var U8=Object.getOwnPropertyDescriptor;var j8=Object.getOwnPropertyNames;var $8=Object.getPrototypeOf,W8=Object.prototype.hasOwnProperty;var fC=r=>{throw TypeError(r)};var z8=(r,e,t)=>e in r?zp(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var Uu=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')});var _t=(r,e)=>()=>(r&&(e=r(r=0)),e);var mt=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),uo=(r,e)=>{for(var t in e)zp(r,t,{get:e[t],enumerable:!0})},hC=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of j8(e))!W8.call(r,i)&&i!==t&&zp(r,i,{get:()=>e[i],enumerable:!(n=U8(e,i))||n.enumerable});return r};var ju=(r,e,t)=>(t=r!=null?F8($8(r)):{},hC(e||!r||!r.__esModule?zp(t,"default",{value:r,enumerable:!0}):t,r)),zr=r=>hC(zp({},"__esModule",{value:!0}),r);var ze=(r,e,t)=>z8(r,typeof e!="symbol"?e+"":e,t),zE=(r,e,t)=>e.has(r)||fC("Cannot "+t);var l=(r,e,t)=>(zE(r,e,"read from private field"),t?t.call(r):e.get(r)),z=(r,e,t)=>e.has(r)?fC("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),O=(r,e,t,n)=>(zE(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t),X=(r,e,t)=>(zE(r,e,"access private method"),t);var on=(r,e,t,n)=>({set _(i){O(r,e,i,t)},get _(){return l(r,e,n)}});var Te=_t(()=>{});var We={};uo(We,{_debugEnd:()=>tR,_debugProcess:()=>eR,_events:()=>yR,_eventsCount:()=>bR,_exiting:()=>PC,_fatalExceptions:()=>KC,_getActiveHandles:()=>UC,_getActiveRequests:()=>FC,_kill:()=>$C,_linkedBinding:()=>kC,_maxListeners:()=>mR,_preload_modules:()=>dR,_rawDebug:()=>NC,_startProfilerIdleNotifier:()=>rR,_stopProfilerIdleNotifier:()=>nR,_tickCallback:()=>QC,abort:()=>aR,addListener:()=>wR,allowedNodeEnvironmentFlags:()=>VC,arch:()=>yC,argv:()=>vC,argv0:()=>hR,assert:()=>YC,binding:()=>SC,browser:()=>IC,chdir:()=>RC,config:()=>MC,cpuUsage:()=>qy,cwd:()=>CC,debugPort:()=>fR,default:()=>RR,dlopen:()=>BC,domain:()=>LC,emit:()=>xR,emitWarning:()=>xC,env:()=>wC,execArgv:()=>EC,execPath:()=>cR,exit:()=>qC,features:()=>XC,hasUncaughtExceptionCaptureCallback:()=>JC,hrtime:()=>Hy,kill:()=>HC,listeners:()=>CR,memoryUsage:()=>zC,moduleLoadList:()=>OC,nextTick:()=>pC,off:()=>ER,on:()=>ta,once:()=>vR,openStdin:()=>GC,pid:()=>lR,platform:()=>bC,ppid:()=>uR,prependListener:()=>SR,prependOnceListener:()=>TR,reallyExit:()=>jC,release:()=>DC,removeAllListeners:()=>AR,removeListener:()=>_R,resourceUsage:()=>WC,setSourceMapsEnabled:()=>pR,setUncaughtExceptionCaptureCallback:()=>ZC,stderr:()=>sR,stdin:()=>oR,stdout:()=>iR,title:()=>mC,umask:()=>TC,uptime:()=>gR,version:()=>_C,versions:()=>AC});function GE(r){throw new Error("Node.js process "+r+" is not supported by JSPM core outside of Node.js")}function H8(){!Zf||!$u||(Zf=!1,$u.length?ea=$u.concat(ea):zy=-1,ea.length&&dC())}function dC(){if(!Zf){var r=setTimeout(H8,0);Zf=!0;for(var e=ea.length;e;){for($u=ea,ea=[];++zy<e;)$u&&$u[zy].run();zy=-1,e=ea.length}$u=null,Zf=!1,clearTimeout(r)}}function pC(r){var e=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)e[t-1]=arguments[t];ea.push(new gC(r,e)),ea.length===1&&!Zf&&setTimeout(dC,0)}function gC(r,e){this.fun=r,this.array=e}function Bn(){}function kC(r){GE("_linkedBinding")}function BC(r){GE("dlopen")}function FC(){return[]}function UC(){return[]}function YC(r,e){if(!r)throw new Error(e||"assertion error")}function JC(){return!1}function gR(){return wl.now()/1e3}function Hy(r){var e=Math.floor((Date.now()-wl.now())*.001),t=wl.now()*.001,n=Math.floor(t)+e,i=Math.floor(t%1*1e9);return r&&(n=n-r[0],i=i-r[1],i<0&&(n--,i+=qE)),[n,i]}function ta(){return RR}function CR(r){return[]}var ea,Zf,$u,zy,mC,yC,bC,wC,vC,EC,_C,AC,xC,SC,TC,CC,RC,DC,IC,NC,OC,LC,PC,MC,jC,$C,qy,WC,zC,HC,qC,GC,VC,XC,KC,ZC,QC,eR,tR,rR,nR,iR,sR,oR,aR,lR,uR,cR,fR,hR,dR,pR,wl,HE,qE,mR,yR,bR,wR,vR,ER,_R,AR,xR,SR,TR,RR,DR=_t(()=>{Te();Re();Ce();ea=[],Zf=!1,zy=-1;gC.prototype.run=function(){this.fun.apply(null,this.array)};mC="browser",yC="x64",bC="browser",wC={PATH:"/usr/bin",LANG:typeof navigator<"u"?navigator.language+".UTF-8":void 0,PWD:"/",HOME:"/home",TMP:"/tmp"},vC=["/usr/bin/node"],EC=[],_C="v16.8.0",AC={},xC=function(r,e){console.warn((e?e+": ":"")+r)},SC=function(r){GE("binding")},TC=function(r){return 0},CC=function(){return"/"},RC=function(r){},DC={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};IC=!0,NC=Bn,OC=[];LC={},PC=!1,MC={};jC=Bn,$C=Bn,qy=function(){return{}},WC=qy,zC=qy,HC=Bn,qC=Bn,GC=Bn,VC={};XC={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},KC=Bn,ZC=Bn;QC=Bn,eR=Bn,tR=Bn,rR=Bn,nR=Bn,iR=void 0,sR=void 0,oR=void 0,aR=Bn,lR=2,uR=1,cR="/bin/usr/node",fR=9229,hR="node",dR=[],pR=Bn,wl={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};wl.now===void 0&&(HE=Date.now(),wl.timing&&wl.timing.navigationStart&&(HE=wl.timing.navigationStart),wl.now=()=>Date.now()-HE);qE=1e9;Hy.bigint=function(r){var e=Hy(r);return typeof BigInt>"u"?e[0]*qE+e[1]:BigInt(e[0]*qE)+BigInt(e[1])};mR=10,yR={},bR=0;wR=ta,vR=ta,ER=ta,_R=ta,AR=ta,xR=Bn,SR=ta,TR=ta;RR={version:_C,versions:AC,arch:yC,platform:bC,browser:IC,release:DC,_rawDebug:NC,moduleLoadList:OC,binding:SC,_linkedBinding:kC,_events:yR,_eventsCount:bR,_maxListeners:mR,on:ta,addListener:wR,once:vR,off:ER,removeListener:_R,removeAllListeners:AR,emit:xR,prependListener:SR,prependOnceListener:TR,listeners:CR,domain:LC,_exiting:PC,config:MC,dlopen:BC,uptime:gR,_getActiveRequests:FC,_getActiveHandles:UC,reallyExit:jC,_kill:$C,cpuUsage:qy,resourceUsage:WC,memoryUsage:zC,kill:HC,exit:qC,openStdin:GC,allowedNodeEnvironmentFlags:VC,assert:YC,features:XC,_fatalExceptions:KC,setUncaughtExceptionCaptureCallback:ZC,hasUncaughtExceptionCaptureCallback:JC,emitWarning:xC,nextTick:pC,_tickCallback:QC,_debugProcess:eR,_debugEnd:tR,_startProfilerIdleNotifier:rR,_stopProfilerIdleNotifier:nR,stdout:iR,stdin:oR,stderr:sR,abort:aR,umask:TC,chdir:RC,cwd:CC,env:wC,title:mC,argv:vC,execArgv:EC,pid:lR,ppid:uR,execPath:cR,debugPort:fR,hrtime:Hy,argv0:hR,_preload_modules:dR,setSourceMapsEnabled:pR}});var Ce=_t(()=>{DR()});function q8(){if(IR)return Hp;IR=!0,Hp.byteLength=a,Hp.toByteArray=c,Hp.fromByteArray=d;for(var r=[],e=[],t=typeof Uint8Array<"u"?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,o=n.length;i<o;++i)r[i]=n[i],e[n.charCodeAt(i)]=i;e[45]=62,e[95]=63;function s(m){var y=m.length;if(y%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var v=m.indexOf("=");v===-1&&(v=y);var w=v===y?0:4-v%4;return[v,w]}function a(m){var y=s(m),v=y[0],w=y[1];return(v+w)*3/4-w}function u(m,y,v){return(y+v)*3/4-v}function c(m){var y,v=s(m),w=v[0],b=v[1],E=new t(u(m,w,b)),_=0,S=b>0?w-4:w,A;for(A=0;A<S;A+=4)y=e[m.charCodeAt(A)]<<18|e[m.charCodeAt(A+1)]<<12|e[m.charCodeAt(A+2)]<<6|e[m.charCodeAt(A+3)],E[_++]=y>>16&255,E[_++]=y>>8&255,E[_++]=y&255;return b===2&&(y=e[m.charCodeAt(A)]<<2|e[m.charCodeAt(A+1)]>>4,E[_++]=y&255),b===1&&(y=e[m.charCodeAt(A)]<<10|e[m.charCodeAt(A+1)]<<4|e[m.charCodeAt(A+2)]>>2,E[_++]=y>>8&255,E[_++]=y&255),E}function f(m){return r[m>>18&63]+r[m>>12&63]+r[m>>6&63]+r[m&63]}function h(m,y,v){for(var w,b=[],E=y;E<v;E+=3)w=(m[E]<<16&16711680)+(m[E+1]<<8&65280)+(m[E+2]&255),b.push(f(w));return b.join("")}function d(m){for(var y,v=m.length,w=v%3,b=[],E=16383,_=0,S=v-w;_<S;_+=E)b.push(h(m,_,_+E>S?S:_+E));return w===1?(y=m[v-1],b.push(r[y>>2]+r[y<<4&63]+"==")):w===2&&(y=(m[v-2]<<8)+m[v-1],b.push(r[y>>10]+r[y>>4&63]+r[y<<2&63]+"=")),b.join("")}return Hp}function G8(){if(NR)return Gy;NR=!0;return Gy.read=function(r,e,t,n,i){var o,s,a=i*8-n-1,u=(1<<a)-1,c=u>>1,f=-7,h=t?i-1:0,d=t?-1:1,m=r[e+h];for(h+=d,o=m&(1<<-f)-1,m>>=-f,f+=a;f>0;o=o*256+r[e+h],h+=d,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=s*256+r[e+h],h+=d,f-=8);if(o===0)o=1-c;else{if(o===u)return s?NaN:(m?-1:1)*(1/0);s=s+Math.pow(2,n),o=o-c}return(m?-1:1)*s*Math.pow(2,o-n)},Gy.write=function(r,e,t,n,i,o){var s,a,u,c=o*8-i-1,f=(1<<c)-1,h=f>>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=n?0:o-1,y=n?1:-1,v=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),s+h>=1?e+=d/u:e+=d*Math.pow(2,1-h),e*u>=2&&(s++,u/=2),s+h>=f?(a=0,s=f):s+h>=1?(a=(e*u-1)*Math.pow(2,i),s=s+h):(a=e*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;r[t+m]=a&255,m+=y,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;r[t+m]=s&255,m+=y,s/=256,c-=8);r[t+m-y]|=v*128},Gy}function gn(){if(OR)return Wu;OR=!0;let r=q8(),e=G8(),t=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Wu.Buffer=s,Wu.SlowBuffer=b,Wu.INSPECT_MAX_BYTES=50;let n=2147483647;Wu.kMaxLength=n,s.TYPED_ARRAY_SUPPORT=i(),!s.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 i(){try{let T=new Uint8Array(1),g={foo:function(){return 42}};return Object.setPrototypeOf(g,Uint8Array.prototype),Object.setPrototypeOf(T,g),T.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function o(T){if(T>n)throw new RangeError('The value "'+T+'" is invalid for option "size"');let g=new Uint8Array(T);return Object.setPrototypeOf(g,s.prototype),g}function s(T,g,p){if(typeof T=="number"){if(typeof g=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return f(T)}return a(T,g,p)}s.poolSize=8192;function a(T,g,p){if(typeof T=="string")return h(T,g);if(ArrayBuffer.isView(T))return m(T);if(T==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T);if(ke(T,ArrayBuffer)||T&&ke(T.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ke(T,SharedArrayBuffer)||T&&ke(T.buffer,SharedArrayBuffer)))return y(T,g,p);if(typeof T=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let R=T.valueOf&&T.valueOf();if(R!=null&&R!==T)return s.from(R,g,p);let J=v(T);if(J)return J;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof T[Symbol.toPrimitive]=="function")return s.from(T[Symbol.toPrimitive]("string"),g,p);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T)}s.from=function(T,g,p){return a(T,g,p)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function u(T){if(typeof T!="number")throw new TypeError('"size" argument must be of type number');if(T<0)throw new RangeError('The value "'+T+'" is invalid for option "size"')}function c(T,g,p){return u(T),T<=0?o(T):g!==void 0?typeof p=="string"?o(T).fill(g,p):o(T).fill(g):o(T)}s.alloc=function(T,g,p){return c(T,g,p)};function f(T){return u(T),o(T<0?0:w(T)|0)}s.allocUnsafe=function(T){return f(T)},s.allocUnsafeSlow=function(T){return f(T)};function h(T,g){if((typeof g!="string"||g==="")&&(g="utf8"),!s.isEncoding(g))throw new TypeError("Unknown encoding: "+g);let p=E(T,g)|0,R=o(p),J=R.write(T,g);return J!==p&&(R=R.slice(0,J)),R}function d(T){let g=T.length<0?0:w(T.length)|0,p=o(g);for(let R=0;R<g;R+=1)p[R]=T[R]&255;return p}function m(T){if(ke(T,Uint8Array)){let g=new Uint8Array(T);return y(g.buffer,g.byteOffset,g.byteLength)}return d(T)}function y(T,g,p){if(g<0||T.byteLength<g)throw new RangeError('"offset" is outside of buffer bounds');if(T.byteLength<g+(p||0))throw new RangeError('"length" is outside of buffer bounds');let R;return g===void 0&&p===void 0?R=new Uint8Array(T):p===void 0?R=new Uint8Array(T,g):R=new Uint8Array(T,g,p),Object.setPrototypeOf(R,s.prototype),R}function v(T){if(s.isBuffer(T)){let g=w(T.length)|0,p=o(g);return p.length===0||T.copy(p,0,0,g),p}if(T.length!==void 0)return typeof T.length!="number"||Ne(T.length)?o(0):d(T);if(T.type==="Buffer"&&Array.isArray(T.data))return d(T.data)}function w(T){if(T>=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return T|0}function b(T){return+T!=T&&(T=0),s.alloc(+T)}s.isBuffer=function(g){return g!=null&&g._isBuffer===!0&&g!==s.prototype},s.compare=function(g,p){if(ke(g,Uint8Array)&&(g=s.from(g,g.offset,g.byteLength)),ke(p,Uint8Array)&&(p=s.from(p,p.offset,p.byteLength)),!s.isBuffer(g)||!s.isBuffer(p))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(g===p)return 0;let R=g.length,J=p.length;for(let D=0,le=Math.min(R,J);D<le;++D)if(g[D]!==p[D]){R=g[D],J=p[D];break}return R<J?-1:J<R?1:0},s.isEncoding=function(g){switch(String(g).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}},s.concat=function(g,p){if(!Array.isArray(g))throw new TypeError('"list" argument must be an Array of Buffers');if(g.length===0)return s.alloc(0);let R;if(p===void 0)for(p=0,R=0;R<g.length;++R)p+=g[R].length;let J=s.allocUnsafe(p),D=0;for(R=0;R<g.length;++R){let le=g[R];if(ke(le,Uint8Array))D+le.length>J.length?(s.isBuffer(le)||(le=s.from(le)),le.copy(J,D)):Uint8Array.prototype.set.call(J,le,D);else if(s.isBuffer(le))le.copy(J,D);else throw new TypeError('"list" argument must be an Array of Buffers');D+=le.length}return J};function E(T,g){if(s.isBuffer(T))return T.length;if(ArrayBuffer.isView(T)||ke(T,ArrayBuffer))return T.byteLength;if(typeof T!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof T);let p=T.length,R=arguments.length>2&&arguments[2]===!0;if(!R&&p===0)return 0;let J=!1;for(;;)switch(g){case"ascii":case"latin1":case"binary":return p;case"utf8":case"utf-8":return Se(T).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return p*2;case"hex":return p>>>1;case"base64":return Ae(T).length;default:if(J)return R?-1:Se(T).length;g=(""+g).toLowerCase(),J=!0}}s.byteLength=E;function _(T,g,p){let R=!1;if((g===void 0||g<0)&&(g=0),g>this.length||((p===void 0||p>this.length)&&(p=this.length),p<=0)||(p>>>=0,g>>>=0,p<=g))return"";for(T||(T="utf8");;)switch(T){case"hex":return x(this,g,p);case"utf8":case"utf-8":return $(this,g,p);case"ascii":return re(this,g,p);case"latin1":case"binary":return k(this,g,p);case"base64":return L(this,g,p);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,g,p);default:if(R)throw new TypeError("Unknown encoding: "+T);T=(T+"").toLowerCase(),R=!0}}s.prototype._isBuffer=!0;function S(T,g,p){let R=T[g];T[g]=T[p],T[p]=R}s.prototype.swap16=function(){let g=this.length;if(g%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let p=0;p<g;p+=2)S(this,p,p+1);return this},s.prototype.swap32=function(){let g=this.length;if(g%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let p=0;p<g;p+=4)S(this,p,p+3),S(this,p+1,p+2);return this},s.prototype.swap64=function(){let g=this.length;if(g%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let p=0;p<g;p+=8)S(this,p,p+7),S(this,p+1,p+6),S(this,p+2,p+5),S(this,p+3,p+4);return this},s.prototype.toString=function(){let g=this.length;return g===0?"":arguments.length===0?$(this,0,g):_.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(g){if(!s.isBuffer(g))throw new TypeError("Argument must be a Buffer");return this===g?!0:s.compare(this,g)===0},s.prototype.inspect=function(){let g="",p=Wu.INSPECT_MAX_BYTES;return g=this.toString("hex",0,p).replace(/(.{2})/g,"$1 ").trim(),this.length>p&&(g+=" ... "),"<Buffer "+g+">"},t&&(s.prototype[t]=s.prototype.inspect),s.prototype.compare=function(g,p,R,J,D){if(ke(g,Uint8Array)&&(g=s.from(g,g.offset,g.byteLength)),!s.isBuffer(g))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof g);if(p===void 0&&(p=0),R===void 0&&(R=g?g.length:0),J===void 0&&(J=0),D===void 0&&(D=this.length),p<0||R>g.length||J<0||D>this.length)throw new RangeError("out of range index");if(J>=D&&p>=R)return 0;if(J>=D)return-1;if(p>=R)return 1;if(p>>>=0,R>>>=0,J>>>=0,D>>>=0,this===g)return 0;let le=D-J,he=R-p,_e=Math.min(le,he),ve=this.slice(J,D),Ie=g.slice(p,R);for(let Z=0;Z<_e;++Z)if(ve[Z]!==Ie[Z]){le=ve[Z],he=Ie[Z];break}return le<he?-1:he<le?1:0};function A(T,g,p,R,J){if(T.length===0)return-1;if(typeof p=="string"?(R=p,p=0):p>2147483647?p=2147483647:p<-2147483648&&(p=-2147483648),p=+p,Ne(p)&&(p=J?0:T.length-1),p<0&&(p=T.length+p),p>=T.length){if(J)return-1;p=T.length-1}else if(p<0)if(J)p=0;else return-1;if(typeof g=="string"&&(g=s.from(g,R)),s.isBuffer(g))return g.length===0?-1:F(T,g,p,R,J);if(typeof g=="number")return g=g&255,typeof Uint8Array.prototype.indexOf=="function"?J?Uint8Array.prototype.indexOf.call(T,g,p):Uint8Array.prototype.lastIndexOf.call(T,g,p):F(T,[g],p,R,J);throw new TypeError("val must be string, number or Buffer")}function F(T,g,p,R,J){let D=1,le=T.length,he=g.length;if(R!==void 0&&(R=String(R).toLowerCase(),R==="ucs2"||R==="ucs-2"||R==="utf16le"||R==="utf-16le")){if(T.length<2||g.length<2)return-1;D=2,le/=2,he/=2,p/=2}function _e(Ie,Z){return D===1?Ie[Z]:Ie.readUInt16BE(Z*D)}let ve;if(J){let Ie=-1;for(ve=p;ve<le;ve++)if(_e(T,ve)===_e(g,Ie===-1?0:ve-Ie)){if(Ie===-1&&(Ie=ve),ve-Ie+1===he)return Ie*D}else Ie!==-1&&(ve-=ve-Ie),Ie=-1}else for(p+he>le&&(p=le-he),ve=p;ve>=0;ve--){let Ie=!0;for(let Z=0;Z<he;Z++)if(_e(T,ve+Z)!==_e(g,Z)){Ie=!1;break}if(Ie)return ve}return-1}s.prototype.includes=function(g,p,R){return this.indexOf(g,p,R)!==-1},s.prototype.indexOf=function(g,p,R){return A(this,g,p,R,!0)},s.prototype.lastIndexOf=function(g,p,R){return A(this,g,p,R,!1)};function I(T,g,p,R){p=Number(p)||0;let J=T.length-p;R?(R=Number(R),R>J&&(R=J)):R=J;let D=g.length;R>D/2&&(R=D/2);let le;for(le=0;le<R;++le){let he=parseInt(g.substr(le*2,2),16);if(Ne(he))return le;T[p+le]=he}return le}function q(T,g,p,R){return $e(Se(g,T.length-p),T,p,R)}function ee(T,g,p,R){return $e(be(g),T,p,R)}function K(T,g,p,R){return $e(Ae(g),T,p,R)}function ne(T,g,p,R){return $e(pe(g,T.length-p),T,p,R)}s.prototype.write=function(g,p,R,J){if(p===void 0)J="utf8",R=this.length,p=0;else if(R===void 0&&typeof p=="string")J=p,R=this.length,p=0;else if(isFinite(p))p=p>>>0,isFinite(R)?(R=R>>>0,J===void 0&&(J="utf8")):(J=R,R=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let D=this.length-p;if((R===void 0||R>D)&&(R=D),g.length>0&&(R<0||p<0)||p>this.length)throw new RangeError("Attempt to write outside buffer bounds");J||(J="utf8");let le=!1;for(;;)switch(J){case"hex":return I(this,g,p,R);case"utf8":case"utf-8":return q(this,g,p,R);case"ascii":case"latin1":case"binary":return ee(this,g,p,R);case"base64":return K(this,g,p,R);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ne(this,g,p,R);default:if(le)throw new TypeError("Unknown encoding: "+J);J=(""+J).toLowerCase(),le=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function L(T,g,p){return g===0&&p===T.length?r.fromByteArray(T):r.fromByteArray(T.slice(g,p))}function $(T,g,p){p=Math.min(T.length,p);let R=[],J=g;for(;J<p;){let D=T[J],le=null,he=D>239?4:D>223?3:D>191?2:1;if(J+he<=p){let _e,ve,Ie,Z;switch(he){case 1:D<128&&(le=D);break;case 2:_e=T[J+1],(_e&192)===128&&(Z=(D&31)<<6|_e&63,Z>127&&(le=Z));break;case 3:_e=T[J+1],ve=T[J+2],(_e&192)===128&&(ve&192)===128&&(Z=(D&15)<<12|(_e&63)<<6|ve&63,Z>2047&&(Z<55296||Z>57343)&&(le=Z));break;case 4:_e=T[J+1],ve=T[J+2],Ie=T[J+3],(_e&192)===128&&(ve&192)===128&&(Ie&192)===128&&(Z=(D&15)<<18|(_e&63)<<12|(ve&63)<<6|Ie&63,Z>65535&&Z<1114112&&(le=Z))}}le===null?(le=65533,he=1):le>65535&&(le-=65536,R.push(le>>>10&1023|55296),le=56320|le&1023),R.push(le),J+=he}return ie(R)}let Y=4096;function ie(T){let g=T.length;if(g<=Y)return String.fromCharCode.apply(String,T);let p="",R=0;for(;R<g;)p+=String.fromCharCode.apply(String,T.slice(R,R+=Y));return p}function re(T,g,p){let R="";p=Math.min(T.length,p);for(let J=g;J<p;++J)R+=String.fromCharCode(T[J]&127);return R}function k(T,g,p){let R="";p=Math.min(T.length,p);for(let J=g;J<p;++J)R+=String.fromCharCode(T[J]);return R}function x(T,g,p){let R=T.length;(!g||g<0)&&(g=0),(!p||p<0||p>R)&&(p=R);let J="";for(let D=g;D<p;++D)J+=Ze[T[D]];return J}function P(T,g,p){let R=T.slice(g,p),J="";for(let D=0;D<R.length-1;D+=2)J+=String.fromCharCode(R[D]+R[D+1]*256);return J}s.prototype.slice=function(g,p){let R=this.length;g=~~g,p=p===void 0?R:~~p,g<0?(g+=R,g<0&&(g=0)):g>R&&(g=R),p<0?(p+=R,p<0&&(p=0)):p>R&&(p=R),p<g&&(p=g);let J=this.subarray(g,p);return Object.setPrototypeOf(J,s.prototype),J};function C(T,g,p){if(T%1!==0||T<0)throw new RangeError("offset is not uint");if(T+g>p)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(g,p,R){g=g>>>0,p=p>>>0,R||C(g,p,this.length);let J=this[g],D=1,le=0;for(;++le<p&&(D*=256);)J+=this[g+le]*D;return J},s.prototype.readUintBE=s.prototype.readUIntBE=function(g,p,R){g=g>>>0,p=p>>>0,R||C(g,p,this.length);let J=this[g+--p],D=1;for(;p>0&&(D*=256);)J+=this[g+--p]*D;return J},s.prototype.readUint8=s.prototype.readUInt8=function(g,p){return g=g>>>0,p||C(g,1,this.length),this[g]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(g,p){return g=g>>>0,p||C(g,2,this.length),this[g]|this[g+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(g,p){return g=g>>>0,p||C(g,2,this.length),this[g]<<8|this[g+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(g,p){return g=g>>>0,p||C(g,4,this.length),(this[g]|this[g+1]<<8|this[g+2]<<16)+this[g+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(g,p){return g=g>>>0,p||C(g,4,this.length),this[g]*16777216+(this[g+1]<<16|this[g+2]<<8|this[g+3])},s.prototype.readBigUInt64LE=tt(function(g){g=g>>>0,V(g,"offset");let p=this[g],R=this[g+7];(p===void 0||R===void 0)&&M(g,this.length-8);let J=p+this[++g]*2**8+this[++g]*2**16+this[++g]*2**24,D=this[++g]+this[++g]*2**8+this[++g]*2**16+R*2**24;return BigInt(J)+(BigInt(D)<<BigInt(32))}),s.prototype.readBigUInt64BE=tt(function(g){g=g>>>0,V(g,"offset");let p=this[g],R=this[g+7];(p===void 0||R===void 0)&&M(g,this.length-8);let J=p*2**24+this[++g]*2**16+this[++g]*2**8+this[++g],D=this[++g]*2**24+this[++g]*2**16+this[++g]*2**8+R;return(BigInt(J)<<BigInt(32))+BigInt(D)}),s.prototype.readIntLE=function(g,p,R){g=g>>>0,p=p>>>0,R||C(g,p,this.length);let J=this[g],D=1,le=0;for(;++le<p&&(D*=256);)J+=this[g+le]*D;return D*=128,J>=D&&(J-=Math.pow(2,8*p)),J},s.prototype.readIntBE=function(g,p,R){g=g>>>0,p=p>>>0,R||C(g,p,this.length);let J=p,D=1,le=this[g+--J];for(;J>0&&(D*=256);)le+=this[g+--J]*D;return D*=128,le>=D&&(le-=Math.pow(2,8*p)),le},s.prototype.readInt8=function(g,p){return g=g>>>0,p||C(g,1,this.length),this[g]&128?(255-this[g]+1)*-1:this[g]},s.prototype.readInt16LE=function(g,p){g=g>>>0,p||C(g,2,this.length);let R=this[g]|this[g+1]<<8;return R&32768?R|4294901760:R},s.prototype.readInt16BE=function(g,p){g=g>>>0,p||C(g,2,this.length);let R=this[g+1]|this[g]<<8;return R&32768?R|4294901760:R},s.prototype.readInt32LE=function(g,p){return g=g>>>0,p||C(g,4,this.length),this[g]|this[g+1]<<8|this[g+2]<<16|this[g+3]<<24},s.prototype.readInt32BE=function(g,p){return g=g>>>0,p||C(g,4,this.length),this[g]<<24|this[g+1]<<16|this[g+2]<<8|this[g+3]},s.prototype.readBigInt64LE=tt(function(g){g=g>>>0,V(g,"offset");let p=this[g],R=this[g+7];(p===void 0||R===void 0)&&M(g,this.length-8);let J=this[g+4]+this[g+5]*2**8+this[g+6]*2**16+(R<<24);return(BigInt(J)<<BigInt(32))+BigInt(p+this[++g]*2**8+this[++g]*2**16+this[++g]*2**24)}),s.prototype.readBigInt64BE=tt(function(g){g=g>>>0,V(g,"offset");let p=this[g],R=this[g+7];(p===void 0||R===void 0)&&M(g,this.length-8);let J=(p<<24)+this[++g]*2**16+this[++g]*2**8+this[++g];return(BigInt(J)<<BigInt(32))+BigInt(this[++g]*2**24+this[++g]*2**16+this[++g]*2**8+R)}),s.prototype.readFloatLE=function(g,p){return g=g>>>0,p||C(g,4,this.length),e.read(this,g,!0,23,4)},s.prototype.readFloatBE=function(g,p){return g=g>>>0,p||C(g,4,this.length),e.read(this,g,!1,23,4)},s.prototype.readDoubleLE=function(g,p){return g=g>>>0,p||C(g,8,this.length),e.read(this,g,!0,52,8)},s.prototype.readDoubleBE=function(g,p){return g=g>>>0,p||C(g,8,this.length),e.read(this,g,!1,52,8)};function j(T,g,p,R,J,D){if(!s.isBuffer(T))throw new TypeError('"buffer" argument must be a Buffer instance');if(g>J||g<D)throw new RangeError('"value" argument is out of bounds');if(p+R>T.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(g,p,R,J){if(g=+g,p=p>>>0,R=R>>>0,!J){let he=Math.pow(2,8*R)-1;j(this,g,p,R,he,0)}let D=1,le=0;for(this[p]=g&255;++le<R&&(D*=256);)this[p+le]=g/D&255;return p+R},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(g,p,R,J){if(g=+g,p=p>>>0,R=R>>>0,!J){let he=Math.pow(2,8*R)-1;j(this,g,p,R,he,0)}let D=R-1,le=1;for(this[p+D]=g&255;--D>=0&&(le*=256);)this[p+D]=g/le&255;return p+R},s.prototype.writeUint8=s.prototype.writeUInt8=function(g,p,R){return g=+g,p=p>>>0,R||j(this,g,p,1,255,0),this[p]=g&255,p+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(g,p,R){return g=+g,p=p>>>0,R||j(this,g,p,2,65535,0),this[p]=g&255,this[p+1]=g>>>8,p+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(g,p,R){return g=+g,p=p>>>0,R||j(this,g,p,2,65535,0),this[p]=g>>>8,this[p+1]=g&255,p+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(g,p,R){return g=+g,p=p>>>0,R||j(this,g,p,4,4294967295,0),this[p+3]=g>>>24,this[p+2]=g>>>16,this[p+1]=g>>>8,this[p]=g&255,p+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(g,p,R){return g=+g,p=p>>>0,R||j(this,g,p,4,4294967295,0),this[p]=g>>>24,this[p+1]=g>>>16,this[p+2]=g>>>8,this[p+3]=g&255,p+4};function U(T,g,p,R,J){xe(g,R,J,T,p,7);let D=Number(g&BigInt(4294967295));T[p++]=D,D=D>>8,T[p++]=D,D=D>>8,T[p++]=D,D=D>>8,T[p++]=D;let le=Number(g>>BigInt(32)&BigInt(4294967295));return T[p++]=le,le=le>>8,T[p++]=le,le=le>>8,T[p++]=le,le=le>>8,T[p++]=le,p}function B(T,g,p,R,J){xe(g,R,J,T,p,7);let D=Number(g&BigInt(4294967295));T[p+7]=D,D=D>>8,T[p+6]=D,D=D>>8,T[p+5]=D,D=D>>8,T[p+4]=D;let le=Number(g>>BigInt(32)&BigInt(4294967295));return T[p+3]=le,le=le>>8,T[p+2]=le,le=le>>8,T[p+1]=le,le=le>>8,T[p]=le,p+8}s.prototype.writeBigUInt64LE=tt(function(g,p=0){return U(this,g,p,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeBigUInt64BE=tt(function(g,p=0){return B(this,g,p,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeIntLE=function(g,p,R,J){if(g=+g,p=p>>>0,!J){let _e=Math.pow(2,8*R-1);j(this,g,p,R,_e-1,-_e)}let D=0,le=1,he=0;for(this[p]=g&255;++D<R&&(le*=256);)g<0&&he===0&&this[p+D-1]!==0&&(he=1),this[p+D]=(g/le>>0)-he&255;return p+R},s.prototype.writeIntBE=function(g,p,R,J){if(g=+g,p=p>>>0,!J){let _e=Math.pow(2,8*R-1);j(this,g,p,R,_e-1,-_e)}let D=R-1,le=1,he=0;for(this[p+D]=g&255;--D>=0&&(le*=256);)g<0&&he===0&&this[p+D+1]!==0&&(he=1),this[p+D]=(g/le>>0)-he&255;return p+R},s.prototype.writeInt8=function(g,p,R){return g=+g,p=p>>>0,R||j(this,g,p,1,127,-128),g<0&&(g=255+g+1),this[p]=g&255,p+1},s.prototype.writeInt16LE=function(g,p,R){return g=+g,p=p>>>0,R||j(this,g,p,2,32767,-32768),this[p]=g&255,this[p+1]=g>>>8,p+2},s.prototype.writeInt16BE=function(g,p,R){return g=+g,p=p>>>0,R||j(this,g,p,2,32767,-32768),this[p]=g>>>8,this[p+1]=g&255,p+2},s.prototype.writeInt32LE=function(g,p,R){return g=+g,p=p>>>0,R||j(this,g,p,4,2147483647,-2147483648),this[p]=g&255,this[p+1]=g>>>8,this[p+2]=g>>>16,this[p+3]=g>>>24,p+4},s.prototype.writeInt32BE=function(g,p,R){return g=+g,p=p>>>0,R||j(this,g,p,4,2147483647,-2147483648),g<0&&(g=4294967295+g+1),this[p]=g>>>24,this[p+1]=g>>>16,this[p+2]=g>>>8,this[p+3]=g&255,p+4},s.prototype.writeBigInt64LE=tt(function(g,p=0){return U(this,g,p,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),s.prototype.writeBigInt64BE=tt(function(g,p=0){return B(this,g,p,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Q(T,g,p,R,J,D){if(p+R>T.length)throw new RangeError("Index out of range");if(p<0)throw new RangeError("Index out of range")}function fe(T,g,p,R,J){return g=+g,p=p>>>0,J||Q(T,g,p,4),e.write(T,g,p,R,23,4),p+4}s.prototype.writeFloatLE=function(g,p,R){return fe(this,g,p,!0,R)},s.prototype.writeFloatBE=function(g,p,R){return fe(this,g,p,!1,R)};function Ee(T,g,p,R,J){return g=+g,p=p>>>0,J||Q(T,g,p,8),e.write(T,g,p,R,52,8),p+8}s.prototype.writeDoubleLE=function(g,p,R){return Ee(this,g,p,!0,R)},s.prototype.writeDoubleBE=function(g,p,R){return Ee(this,g,p,!1,R)},s.prototype.copy=function(g,p,R,J){if(!s.isBuffer(g))throw new TypeError("argument should be a Buffer");if(R||(R=0),!J&&J!==0&&(J=this.length),p>=g.length&&(p=g.length),p||(p=0),J>0&&J<R&&(J=R),J===R||g.length===0||this.length===0)return 0;if(p<0)throw new RangeError("targetStart out of bounds");if(R<0||R>=this.length)throw new RangeError("Index out of range");if(J<0)throw new RangeError("sourceEnd out of bounds");J>this.length&&(J=this.length),g.length-p<J-R&&(J=g.length-p+R);let D=J-R;return this===g&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(p,R,J):Uint8Array.prototype.set.call(g,this.subarray(R,J),p),D},s.prototype.fill=function(g,p,R,J){if(typeof g=="string"){if(typeof p=="string"?(J=p,p=0,R=this.length):typeof R=="string"&&(J=R,R=this.length),J!==void 0&&typeof J!="string")throw new TypeError("encoding must be a string");if(typeof J=="string"&&!s.isEncoding(J))throw new TypeError("Unknown encoding: "+J);if(g.length===1){let le=g.charCodeAt(0);(J==="utf8"&&le<128||J==="latin1")&&(g=le)}}else typeof g=="number"?g=g&255:typeof g=="boolean"&&(g=Number(g));if(p<0||this.length<p||this.length<R)throw new RangeError("Out of range index");if(R<=p)return this;p=p>>>0,R=R===void 0?this.length:R>>>0,g||(g=0);let D;if(typeof g=="number")for(D=p;D<R;++D)this[D]=g;else{let le=s.isBuffer(g)?g:s.from(g,J),he=le.length;if(he===0)throw new TypeError('The value "'+g+'" is invalid for argument "value"');for(D=0;D<R-p;++D)this[D+p]=le[D%he]}return this};let te={};function H(T,g,p){te[T]=class extends p{constructor(){super(),Object.defineProperty(this,"message",{value:g.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${T}]`,this.stack,delete this.name}get code(){return T}set code(J){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:J,writable:!0})}toString(){return`${this.name} [${T}]: ${this.message}`}}}H("ERR_BUFFER_OUT_OF_BOUNDS",function(T){return T?`${T} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),H("ERR_INVALID_ARG_TYPE",function(T,g){return`The "${T}" argument must be of type number. Received type ${typeof g}`},TypeError),H("ERR_OUT_OF_RANGE",function(T,g,p){let R=`The value of "${T}" is out of range.`,J=p;return Number.isInteger(p)&&Math.abs(p)>2**32?J=ae(String(p)):typeof p=="bigint"&&(J=String(p),(p>BigInt(2)**BigInt(32)||p<-(BigInt(2)**BigInt(32)))&&(J=ae(J)),J+="n"),R+=` It must be ${g}. Received ${J}`,R},RangeError);function ae(T){let g="",p=T.length,R=T[0]==="-"?1:0;for(;p>=R+4;p-=3)g=`_${T.slice(p-3,p)}${g}`;return`${T.slice(0,p)}${g}`}function we(T,g,p){V(g,"offset"),(T[g]===void 0||T[g+p]===void 0)&&M(g,T.length-(p+1))}function xe(T,g,p,R,J,D){if(T>p||T<g){let le=typeof g=="bigint"?"n":"",he;throw g===0||g===BigInt(0)?he=`>= 0${le} and < 2${le} ** ${(D+1)*8}${le}`:he=`>= -(2${le} ** ${(D+1)*8-1}${le}) and < 2 ** ${(D+1)*8-1}${le}`,new te.ERR_OUT_OF_RANGE("value",he,T)}we(R,J,D)}function V(T,g){if(typeof T!="number")throw new te.ERR_INVALID_ARG_TYPE(g,"number",T)}function M(T,g,p){throw Math.floor(T)!==T?(V(T,p),new te.ERR_OUT_OF_RANGE("offset","an integer",T)):g<0?new te.ERR_BUFFER_OUT_OF_BOUNDS:new te.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${g}`,T)}let oe=/[^+/0-9A-Za-z-_]/g;function ge(T){if(T=T.split("=")[0],T=T.trim().replace(oe,""),T.length<2)return"";for(;T.length%4!==0;)T=T+"=";return T}function Se(T,g){g=g||1/0;let p,R=T.length,J=null,D=[];for(let le=0;le<R;++le){if(p=T.charCodeAt(le),p>55295&&p<57344){if(!J){if(p>56319){(g-=3)>-1&&D.push(239,191,189);continue}else if(le+1===R){(g-=3)>-1&&D.push(239,191,189);continue}J=p;continue}if(p<56320){(g-=3)>-1&&D.push(239,191,189),J=p;continue}p=(J-55296<<10|p-56320)+65536}else J&&(g-=3)>-1&&D.push(239,191,189);if(J=null,p<128){if((g-=1)<0)break;D.push(p)}else if(p<2048){if((g-=2)<0)break;D.push(p>>6|192,p&63|128)}else if(p<65536){if((g-=3)<0)break;D.push(p>>12|224,p>>6&63|128,p&63|128)}else if(p<1114112){if((g-=4)<0)break;D.push(p>>18|240,p>>12&63|128,p>>6&63|128,p&63|128)}else throw new Error("Invalid code point")}return D}function be(T){let g=[];for(let p=0;p<T.length;++p)g.push(T.charCodeAt(p)&255);return g}function pe(T,g){let p,R,J,D=[];for(let le=0;le<T.length&&!((g-=2)<0);++le)p=T.charCodeAt(le),R=p>>8,J=p%256,D.push(J),D.push(R);return D}function Ae(T){return r.toByteArray(ge(T))}function $e(T,g,p,R){let J;for(J=0;J<R&&!(J+p>=g.length||J>=T.length);++J)g[J+p]=T[J];return J}function ke(T,g){return T instanceof g||T!=null&&T.constructor!=null&&T.constructor.name!=null&&T.constructor.name===g.name}function Ne(T){return T!==T}let Ze=(function(){let T="0123456789abcdef",g=new Array(256);for(let p=0;p<16;++p){let R=p*16;for(let J=0;J<16;++J)g[R+J]=T[p]+T[J]}return g})();function tt(T){return typeof BigInt>"u"?it:T}function it(){throw new Error("BigInt not supported")}return Wu}var Hp,IR,Gy,NR,Wu,OR,Jf=_t(()=>{Te();Re();Ce();Hp={},IR=!1;Gy={},NR=!1;Wu={},OR=!1});var Qf={};uo(Qf,{Buffer:()=>He,INSPECT_MAX_BYTES:()=>V8,default:()=>vl,kMaxLength:()=>Y8});var vl,He,V8,Y8,El=_t(()=>{Te();Re();Ce();Jf();vl=gn();vl.Buffer;vl.SlowBuffer;vl.INSPECT_MAX_BYTES;vl.kMaxLength;He=vl.Buffer,V8=vl.INSPECT_MAX_BYTES,Y8=vl.kMaxLength});var Re=_t(()=>{El()});function ZE(){throw new Error("setTimeout has not been defined")}function JE(){throw new Error("clearTimeout has not been defined")}function VR(r){if(na===setTimeout)return setTimeout(r,0);if((na===ZE||!na)&&setTimeout)return na=setTimeout,setTimeout(r,0);try{return na(r,0)}catch{try{return na.call(null,r,0)}catch{return na.call(this||th,r,0)}}}function X8(){eh&&Hu&&(eh=!1,Hu.length?sa=Hu.concat(sa):Jy=-1,sa.length&&YR())}function YR(){if(!eh){var r=VR(X8);eh=!0;for(var e=sa.length;e;){for(Hu=sa,sa=[];++Jy<e;)Hu&&Hu[Jy].run();Jy=-1,e=sa.length}Hu=null,eh=!1,(function(t){if(ia===clearTimeout)return clearTimeout(t);if((ia===JE||!ia)&&clearTimeout)return ia=clearTimeout,clearTimeout(t);try{ia(t)}catch{try{return ia.call(null,t)}catch{return ia.call(this||th,t)}}})(r)}}function kR(r,e){(this||th).fun=r,(this||th).array=e}function ra(){}function Gu(r){return r.call.bind(r)}function Yp(r,e){if(typeof r!="object")return!1;try{return e(r),!0}catch{return!1}}function MR(r){return oi&&Di?Ii(r)!==void 0:rD(r)||nD(r)||iD(r)||sD(r)||oD(r)||aD(r)||lD(r)||uD(r)||cD(r)||fD(r)||hD(r)}function rD(r){return oi&&Di?Ii(r)==="Uint8Array":Cr(r)==="[object Uint8Array]"||s6(r)&&r.buffer!==void 0}function nD(r){return oi&&Di?Ii(r)==="Uint8ClampedArray":Cr(r)==="[object Uint8ClampedArray]"}function iD(r){return oi&&Di?Ii(r)==="Uint16Array":Cr(r)==="[object Uint16Array]"}function sD(r){return oi&&Di?Ii(r)==="Uint32Array":Cr(r)==="[object Uint32Array]"}function oD(r){return oi&&Di?Ii(r)==="Int8Array":Cr(r)==="[object Int8Array]"}function aD(r){return oi&&Di?Ii(r)==="Int16Array":Cr(r)==="[object Int16Array]"}function lD(r){return oi&&Di?Ii(r)==="Int32Array":Cr(r)==="[object Int32Array]"}function uD(r){return oi&&Di?Ii(r)==="Float32Array":Cr(r)==="[object Float32Array]"}function cD(r){return oi&&Di?Ii(r)==="Float64Array":Cr(r)==="[object Float64Array]"}function fD(r){return oi&&Di?Ii(r)==="BigInt64Array":Cr(r)==="[object BigInt64Array]"}function hD(r){return oi&&Di?Ii(r)==="BigUint64Array":Cr(r)==="[object BigUint64Array]"}function Vy(r){return Cr(r)==="[object Map]"}function Yy(r){return Cr(r)==="[object Set]"}function Xy(r){return Cr(r)==="[object WeakMap]"}function VE(r){return Cr(r)==="[object WeakSet]"}function eb(r){return Cr(r)==="[object ArrayBuffer]"}function BR(r){return typeof ArrayBuffer<"u"&&(eb.working?eb(r):r instanceof ArrayBuffer)}function tb(r){return Cr(r)==="[object DataView]"}function FR(r){return typeof DataView<"u"&&(tb.working?tb(r):r instanceof DataView)}function rb(r){return Cr(r)==="[object SharedArrayBuffer]"}function UR(r){return typeof SharedArrayBuffer<"u"&&(rb.working?rb(r):r instanceof SharedArrayBuffer)}function jR(r){return Yp(r,u6)}function $R(r){return Yp(r,c6)}function WR(r){return Yp(r,f6)}function zR(r){return QR&&Yp(r,eD)}function HR(r){return e1&&Yp(r,tD)}function _l(r,e){var t={seen:[],stylize:p6};return arguments.length>=3&&(t.depth=arguments[2]),arguments.length>=4&&(t.colors=arguments[3]),t1(e)?t.showHidden=e:e&&qe._extend(t,e),qu(t.showHidden)&&(t.showHidden=!1),qu(t.depth)&&(t.depth=2),qu(t.colors)&&(t.colors=!1),qu(t.customInspect)&&(t.customInspect=!0),t.colors&&(t.stylize=d6),nb(t,r,t.depth)}function d6(r,e){var t=_l.styles[e];return t?"\x1B["+_l.colors[t][0]+"m"+r+"\x1B["+_l.colors[t][1]+"m":r}function p6(r,e){return r}function nb(r,e,t){if(r.customInspect&&e&&Qy(e.inspect)&&e.inspect!==qe.inspect&&(!e.constructor||e.constructor.prototype!==e)){var n=e.inspect(t,r);return ib(n)||(n=nb(r,n,t)),n}var i=(function(d,m){if(qu(m))return d.stylize("undefined","undefined");if(ib(m)){var y="'"+JSON.stringify(m).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return d.stylize(y,"string")}if(gD(m))return d.stylize(""+m,"number");if(t1(m))return d.stylize(""+m,"boolean");if(ab(m))return d.stylize("null","null")})(r,e);if(i)return i;var o=Object.keys(e),s=(function(d){var m={};return d.forEach((function(y,v){m[y]=!0})),m})(o);if(r.showHidden&&(o=Object.getOwnPropertyNames(e)),Vp(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return YE(e);if(o.length===0){if(Qy(e)){var a=e.name?": "+e.name:"";return r.stylize("[Function"+a+"]","special")}if(Gp(e))return r.stylize(RegExp.prototype.toString.call(e),"regexp");if(sb(e))return r.stylize(Date.prototype.toString.call(e),"date");if(Vp(e))return YE(e)}var u,c="",f=!1,h=["{","}"];return pD(e)&&(f=!0,h=["[","]"]),Qy(e)&&(c=" [Function"+(e.name?": "+e.name:"")+"]"),Gp(e)&&(c=" "+RegExp.prototype.toString.call(e)),sb(e)&&(c=" "+Date.prototype.toUTCString.call(e)),Vp(e)&&(c=" "+YE(e)),o.length!==0||f&&e.length!=0?t<0?Gp(e)?r.stylize(RegExp.prototype.toString.call(e),"regexp"):r.stylize("[Object]","special"):(r.seen.push(e),u=f?(function(d,m,y,v,w){for(var b=[],E=0,_=m.length;E<_;++E)mD(m,String(E))?b.push(XE(d,m,y,v,String(E),!0)):b.push("");return w.forEach((function(S){S.match(/^\d+$/)||b.push(XE(d,m,y,v,S,!0))})),b})(r,e,t,s,o):o.map((function(d){return XE(r,e,t,s,d,f)})),r.seen.pop(),(function(d,m,y){var v=0;return d.reduce((function(w,b){return v++,b.indexOf(`
|
|
11
|
-
`)>=0&&v++,w+b.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60?y[0]+(m===""?"":m+`
|
|
12
|
-
`)+" "+d.join(`,
|
|
13
|
-
`)+" "+y[1]:y[0]+m+" "+d.join(", ")+" "+y[1]})(u,c,h)):h[0]+c+h[1]}function YE(r){return"["+Error.prototype.toString.call(r)+"]"}function XE(r,e,t,n,i,o){var s,a,u;if((u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?a=u.set?r.stylize("[Getter/Setter]","special"):r.stylize("[Getter]","special"):u.set&&(a=r.stylize("[Setter]","special")),mD(n,i)||(s="["+i+"]"),a||(r.seen.indexOf(u.value)<0?(a=ab(t)?nb(r,u.value,null):nb(r,u.value,t-1)).indexOf(`
|
|
14
|
-
`)>-1&&(a=o?a.split(`
|
|
15
|
-
`).map((function(c){return" "+c})).join(`
|
|
16
|
-
`).substr(2):`
|
|
17
|
-
`+a.split(`
|
|
18
|
-
`).map((function(c){return" "+c})).join(`
|
|
19
|
-
`)):a=r.stylize("[Circular]","special")),qu(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=r.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=r.stylize(s,"string"))}return s+": "+a}function pD(r){return Array.isArray(r)}function t1(r){return typeof r=="boolean"}function ab(r){return r===null}function gD(r){return typeof r=="number"}function ib(r){return typeof r=="string"}function qu(r){return r===void 0}function Gp(r){return rh(r)&&r1(r)==="[object RegExp]"}function rh(r){return typeof r=="object"&&r!==null}function sb(r){return rh(r)&&r1(r)==="[object Date]"}function Vp(r){return rh(r)&&(r1(r)==="[object Error]"||r instanceof Error)}function Qy(r){return typeof r=="function"}function r1(r){return Object.prototype.toString.call(r)}function KE(r){return r<10?"0"+r.toString(10):r.toString(10)}function m6(){var r=new Date,e=[KE(r.getHours()),KE(r.getMinutes()),KE(r.getSeconds())].join(":");return[r.getDate(),g6[r.getMonth()],e].join(" ")}function mD(r,e){return Object.prototype.hasOwnProperty.call(r,e)}function y6(r,e){if(!r){var t=new Error("Promise was rejected with a falsy value");t.reason=r,r=t}return e(r)}var GR,na,ia,th,Hr,Hu,sa,eh,Jy,hr,K8,QE,ob,XR,Z8,J8,Q8,e6,t6,KR,ZR,LR,r6,n6,i6,JR,Pt,s6,o6,a6,QR,e1,Di,oi,l6,PR,Ii,Cr,u6,c6,f6,eD,tD,qp,qe,co,qR,h6,Ky,dD,Zy,g6,zu,$Y,Al=_t(()=>{Te();Re();Ce();th=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window,Hr=GR={};(function(){try{na=typeof setTimeout=="function"?setTimeout:ZE}catch{na=ZE}try{ia=typeof clearTimeout=="function"?clearTimeout:JE}catch{ia=JE}})();sa=[],eh=!1,Jy=-1;Hr.nextTick=function(r){var e=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)e[t-1]=arguments[t];sa.push(new kR(r,e)),sa.length!==1||eh||VR(YR)},kR.prototype.run=function(){(this||th).fun.apply(null,(this||th).array)},Hr.title="browser",Hr.browser=!0,Hr.env={},Hr.argv=[],Hr.version="",Hr.versions={},Hr.on=ra,Hr.addListener=ra,Hr.once=ra,Hr.off=ra,Hr.removeListener=ra,Hr.removeAllListeners=ra,Hr.emit=ra,Hr.prependListener=ra,Hr.prependOnceListener=ra,Hr.listeners=function(r){return[]},Hr.binding=function(r){throw new Error("process.binding is not supported")},Hr.cwd=function(){return"/"},Hr.chdir=function(r){throw new Error("process.chdir is not supported")},Hr.umask=function(){return 0};hr=GR;hr.addListener;hr.argv;hr.binding;hr.browser;hr.chdir;hr.cwd;hr.emit;hr.env;hr.listeners;hr.nextTick;hr.off;hr.on;hr.once;hr.prependListener;hr.prependOnceListener;hr.removeAllListeners;hr.removeListener;hr.title;hr.umask;hr.version;hr.versions;K8=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol",QE=Object.prototype.toString,ob=function(r){return!(K8&&r&&typeof r=="object"&&Symbol.toStringTag in r)&&QE.call(r)==="[object Arguments]"},XR=function(r){return!!ob(r)||r!==null&&typeof r=="object"&&typeof r.length=="number"&&r.length>=0&&QE.call(r)!=="[object Array]"&&QE.call(r.callee)==="[object Function]"},Z8=(function(){return ob(arguments)})();ob.isLegacyArguments=XR;J8=Z8?ob:XR,Q8=Object.prototype.toString,e6=Function.prototype.toString,t6=/^\s*(?:function)?\*/,KR=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol",ZR=Object.getPrototypeOf,LR=(function(){if(!KR)return!1;try{return Function("return function*() {}")()}catch{}})(),r6=LR?ZR(LR):{},n6=function(r){return typeof r=="function"&&(!!t6.test(e6.call(r))||(KR?ZR(r)===r6:Q8.call(r)==="[object GeneratorFunction]"))},i6=typeof Object.create=="function"?function(r,e){e&&(r.super_=e,r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}))}:function(r,e){if(e){r.super_=e;var t=function(){};t.prototype=e.prototype,r.prototype=new t,r.prototype.constructor=r}},JR=function(r){return r&&typeof r=="object"&&typeof r.copy=="function"&&typeof r.fill=="function"&&typeof r.readUInt8=="function"},Pt={},s6=JR,o6=J8,a6=n6;QR=typeof BigInt<"u",e1=typeof Symbol<"u",Di=e1&&Symbol.toStringTag!==void 0,oi=typeof Uint8Array<"u",l6=typeof ArrayBuffer<"u";oi&&Di&&(PR=Object.getPrototypeOf(Uint8Array.prototype),Ii=Gu(Object.getOwnPropertyDescriptor(PR,Symbol.toStringTag).get));Cr=Gu(Object.prototype.toString),u6=Gu(Number.prototype.valueOf),c6=Gu(String.prototype.valueOf),f6=Gu(Boolean.prototype.valueOf);QR&&(eD=Gu(BigInt.prototype.valueOf));e1&&(tD=Gu(Symbol.prototype.valueOf));Pt.isArgumentsObject=o6,Pt.isGeneratorFunction=a6,Pt.isPromise=function(r){return typeof Promise<"u"&&r instanceof Promise||r!==null&&typeof r=="object"&&typeof r.then=="function"&&typeof r.catch=="function"},Pt.isArrayBufferView=function(r){return l6&&ArrayBuffer.isView?ArrayBuffer.isView(r):MR(r)||FR(r)},Pt.isTypedArray=MR,Pt.isUint8Array=rD,Pt.isUint8ClampedArray=nD,Pt.isUint16Array=iD,Pt.isUint32Array=sD,Pt.isInt8Array=oD,Pt.isInt16Array=aD,Pt.isInt32Array=lD,Pt.isFloat32Array=uD,Pt.isFloat64Array=cD,Pt.isBigInt64Array=fD,Pt.isBigUint64Array=hD,Vy.working=typeof Map<"u"&&Vy(new Map),Pt.isMap=function(r){return typeof Map<"u"&&(Vy.working?Vy(r):r instanceof Map)},Yy.working=typeof Set<"u"&&Yy(new Set),Pt.isSet=function(r){return typeof Set<"u"&&(Yy.working?Yy(r):r instanceof Set)},Xy.working=typeof WeakMap<"u"&&Xy(new WeakMap),Pt.isWeakMap=function(r){return typeof WeakMap<"u"&&(Xy.working?Xy(r):r instanceof WeakMap)},VE.working=typeof WeakSet<"u"&&VE(new WeakSet),Pt.isWeakSet=function(r){return VE(r)},eb.working=typeof ArrayBuffer<"u"&&eb(new ArrayBuffer),Pt.isArrayBuffer=BR,tb.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&tb(new DataView(new ArrayBuffer(1),0,1)),Pt.isDataView=FR,rb.working=typeof SharedArrayBuffer<"u"&&rb(new SharedArrayBuffer),Pt.isSharedArrayBuffer=UR,Pt.isAsyncFunction=function(r){return Cr(r)==="[object AsyncFunction]"},Pt.isMapIterator=function(r){return Cr(r)==="[object Map Iterator]"},Pt.isSetIterator=function(r){return Cr(r)==="[object Set Iterator]"},Pt.isGeneratorObject=function(r){return Cr(r)==="[object Generator]"},Pt.isWebAssemblyCompiledModule=function(r){return Cr(r)==="[object WebAssembly.Module]"},Pt.isNumberObject=jR,Pt.isStringObject=$R,Pt.isBooleanObject=WR,Pt.isBigIntObject=zR,Pt.isSymbolObject=HR,Pt.isBoxedPrimitive=function(r){return jR(r)||$R(r)||WR(r)||zR(r)||HR(r)},Pt.isAnyArrayBuffer=function(r){return oi&&(BR(r)||UR(r))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(r){Object.defineProperty(Pt,r,{enumerable:!1,value:function(){throw new Error(r+" is not supported in userland")}})}));qp=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window,qe={},co=hr,qR=Object.getOwnPropertyDescriptors||function(r){for(var e=Object.keys(r),t={},n=0;n<e.length;n++)t[e[n]]=Object.getOwnPropertyDescriptor(r,e[n]);return t},h6=/%[sdj%]/g;qe.format=function(r){if(!ib(r)){for(var e=[],t=0;t<arguments.length;t++)e.push(_l(arguments[t]));return e.join(" ")}t=1;for(var n=arguments,i=n.length,o=String(r).replace(h6,(function(a){if(a==="%%")return"%";if(t>=i)return a;switch(a){case"%s":return String(n[t++]);case"%d":return Number(n[t++]);case"%j":try{return JSON.stringify(n[t++])}catch{return"[Circular]"}default:return a}})),s=n[t];t<i;s=n[++t])ab(s)||!rh(s)?o+=" "+s:o+=" "+_l(s);return o},qe.deprecate=function(r,e){if(co!==void 0&&co.noDeprecation===!0)return r;if(co===void 0)return function(){return qe.deprecate(r,e).apply(this||qp,arguments)};var t=!1;return function(){if(!t){if(co.throwDeprecation)throw new Error(e);co.traceDeprecation?console.trace(e):console.error(e),t=!0}return r.apply(this||qp,arguments)}};Ky={},dD=/^$/;co.env.NODE_DEBUG&&(Zy=co.env.NODE_DEBUG,Zy=Zy.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),dD=new RegExp("^"+Zy+"$","i"));qe.debuglog=function(r){if(r=r.toUpperCase(),!Ky[r])if(dD.test(r)){var e=co.pid;Ky[r]=function(){var t=qe.format.apply(qe,arguments);console.error("%s %d: %s",r,e,t)}}else Ky[r]=function(){};return Ky[r]},qe.inspect=_l,_l.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},_l.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},qe.types=Pt,qe.isArray=pD,qe.isBoolean=t1,qe.isNull=ab,qe.isNullOrUndefined=function(r){return r==null},qe.isNumber=gD,qe.isString=ib,qe.isSymbol=function(r){return typeof r=="symbol"},qe.isUndefined=qu,qe.isRegExp=Gp,qe.types.isRegExp=Gp,qe.isObject=rh,qe.isDate=sb,qe.types.isDate=sb,qe.isError=Vp,qe.types.isNativeError=Vp,qe.isFunction=Qy,qe.isPrimitive=function(r){return r===null||typeof r=="boolean"||typeof r=="number"||typeof r=="string"||typeof r=="symbol"||r===void 0},qe.isBuffer=JR;g6=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];qe.log=function(){console.log("%s - %s",m6(),qe.format.apply(qe,arguments))},qe.inherits=i6,qe._extend=function(r,e){if(!e||!rh(e))return r;for(var t=Object.keys(e),n=t.length;n--;)r[t[n]]=e[t[n]];return r};zu=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;qe.promisify=function(r){if(typeof r!="function")throw new TypeError('The "original" argument must be of type Function');if(zu&&r[zu]){var e;if(typeof(e=r[zu])!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,zu,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var t,n,i=new Promise((function(a,u){t=a,n=u})),o=[],s=0;s<arguments.length;s++)o.push(arguments[s]);o.push((function(a,u){a?n(a):t(u)}));try{r.apply(this||qp,o)}catch(a){n(a)}return i}return Object.setPrototypeOf(e,Object.getPrototypeOf(r)),zu&&Object.defineProperty(e,zu,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,qR(r))},qe.promisify.custom=zu,qe.callbackify=function(r){if(typeof r!="function")throw new TypeError('The "original" argument must be of type Function');function e(){for(var t=[],n=0;n<arguments.length;n++)t.push(arguments[n]);var i=t.pop();if(typeof i!="function")throw new TypeError("The last argument must be of type Function");var o=this||qp,s=function(){return i.apply(o,arguments)};r.apply(this||qp,t).then((function(a){co.nextTick(s.bind(null,null,a))}),(function(a){co.nextTick(y6.bind(null,a,s))}))}return Object.setPrototypeOf(e,Object.getPrototypeOf(r)),Object.defineProperties(e,qR(r)),e};qe._extend;qe.callbackify;qe.debuglog;qe.deprecate;qe.format;qe.inherits;qe.inspect;qe.isArray;qe.isBoolean;qe.isBuffer;qe.isDate;qe.isError;qe.isFunction;qe.isNull;qe.isNullOrUndefined;qe.isNumber;qe.isObject;qe.isPrimitive;qe.isRegExp;qe.isString;qe.isSymbol;qe.isUndefined;qe.log;qe.promisify;qe._extend;qe.callbackify;qe.debuglog;qe.deprecate;qe.format;qe.inherits;qe.inspect;qe.isArray;qe.isBoolean;qe.isBuffer;qe.isDate;qe.isError;qe.isFunction;qe.isNull;qe.isNullOrUndefined;qe.isNumber;qe.isObject;qe.isPrimitive;qe.isRegExp;qe.isString;qe.isSymbol;qe.isUndefined;qe.log;$Y=qe.promisify;qe.types});function yD(r,e){if(r==null)throw new TypeError("Cannot convert first argument to object");for(var t=Object(r),n=1;n<arguments.length;n++){var i=arguments[n];if(i!=null)for(var o=Object.keys(Object(i)),s=0,a=o.length;s<a;s++){var u=o[s],c=Object.getOwnPropertyDescriptor(i,u);c!==void 0&&c.enumerable&&(t[u]=i[u])}}return t}function aI(){if(ID)return u1;function r(c){return(r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(f){return typeof f}:function(f){return f&&typeof Symbol=="function"&&f.constructor===Symbol&&f!==Symbol.prototype?"symbol":typeof f})(c)}function e(c,f){return!f||r(f)!=="object"&&typeof f!="function"?(function(h){if(h===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h})(c):f}function t(c){return(t=Object.setPrototypeOf?Object.getPrototypeOf:function(f){return f.__proto__||Object.getPrototypeOf(f)})(c)}function n(c,f){return(n=Object.setPrototypeOf||function(h,d){return h.__proto__=d,h})(c,f)}ID=!0;var i,o,s={};function a(c,f,h){h||(h=Error);var d=(function(m){function y(v,w,b){var E;return(function(_,S){if(!(_ instanceof S))throw new TypeError("Cannot call a class as a function")})(this,y),(E=e(this,t(y).call(this,(function(_,S,A){return typeof f=="string"?f:f(_,S,A)})(v,w,b)))).code=c,E}return(function(v,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function");v.prototype=Object.create(w&&w.prototype,{constructor:{value:v,writable:!0,configurable:!0}}),w&&n(v,w)})(y,m),y})(h);s[c]=d}function u(c,f){if(Array.isArray(c)){var h=c.length;return c=c.map((function(d){return String(d)})),h>2?"one of ".concat(f," ").concat(c.slice(0,h-1).join(", "),", or ")+c[h-1]:h===2?"one of ".concat(f," ").concat(c[0]," or ").concat(c[1]):"of ".concat(f," ").concat(c[0])}return"of ".concat(f," ").concat(String(c))}return a("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),a("ERR_INVALID_ARG_TYPE",(function(c,f,h){var d,m,y;if(i===void 0&&(i=g1()),i(typeof c=="string","'name' must be a string"),typeof f=="string"&&(m="not ",f.substr(0,m.length)===m)?(d="must not be",f=f.replace(/^not /,"")):d="must be",(function(w,b,E){return(E===void 0||E>w.length)&&(E=w.length),w.substring(E-b.length,E)===b})(c," argument"))y="The ".concat(c," ").concat(d," ").concat(u(f,"type"));else{var v=(function(w,b,E){return typeof E!="number"&&(E=0),!(E+b.length>w.length)&&w.indexOf(b,E)!==-1})(c,".")?"property":"argument";y='The "'.concat(c,'" ').concat(v," ").concat(d," ").concat(u(f,"type"))}return y+=". Received type ".concat(r(h))}),TypeError),a("ERR_INVALID_ARG_VALUE",(function(c,f){var h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";o===void 0&&(o=qe);var d=o.inspect(f);return d.length>128&&(d="".concat(d.slice(0,128),"...")),"The argument '".concat(c,"' ").concat(h,". Received ").concat(d)}),TypeError),a("ERR_INVALID_RETURN_VALUE",(function(c,f,h){var d;return d=h&&h.constructor&&h.constructor.name?"instance of ".concat(h.constructor.name):"type ".concat(r(h)),"Expected ".concat(c,' to be returned from the "').concat(f,'"')+" function but got ".concat(d,".")}),TypeError),a("ERR_MISSING_ARGS",(function(){for(var c=arguments.length,f=new Array(c),h=0;h<c;h++)f[h]=arguments[h];i===void 0&&(i=g1()),i(f.length>0,"At least one arg needs to be specified");var d="The ",m=f.length;switch(f=f.map((function(y){return'"'.concat(y,'"')})),m){case 1:d+="".concat(f[0]," argument");break;case 2:d+="".concat(f[0]," and ").concat(f[1]," arguments");break;default:d+=f.slice(0,m-1).join(", "),d+=", and ".concat(f[m-1]," arguments")}return"".concat(d," must be specified")}),TypeError),u1.codes=s,u1}function r4(){if(OD)return ND;OD=!0;var r=hr;function e(I,q,ee){return q in I?Object.defineProperty(I,q,{value:ee,enumerable:!0,configurable:!0,writable:!0}):I[q]=ee,I}function t(I,q){for(var ee=0;ee<q.length;ee++){var K=q[ee];K.enumerable=K.enumerable||!1,K.configurable=!0,"value"in K&&(K.writable=!0),Object.defineProperty(I,K.key,K)}}function n(I,q){return!q||f(q)!=="object"&&typeof q!="function"?i(I):q}function i(I){if(I===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I}function o(I){var q=typeof Map=="function"?new Map:void 0;return(o=function(ee){if(ee===null||(K=ee,Function.toString.call(K).indexOf("[native code]")===-1))return ee;var K;if(typeof ee!="function")throw new TypeError("Super expression must either be null or a function");if(q!==void 0){if(q.has(ee))return q.get(ee);q.set(ee,ne)}function ne(){return a(ee,arguments,c(this).constructor)}return ne.prototype=Object.create(ee.prototype,{constructor:{value:ne,enumerable:!1,writable:!0,configurable:!0}}),u(ne,ee)})(I)}function s(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch{return!1}}function a(I,q,ee){return(a=s()?Reflect.construct:function(K,ne,L){var $=[null];$.push.apply($,ne);var Y=new(Function.bind.apply(K,$));return L&&u(Y,L.prototype),Y}).apply(null,arguments)}function u(I,q){return(u=Object.setPrototypeOf||function(ee,K){return ee.__proto__=K,ee})(I,q)}function c(I){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(q){return q.__proto__||Object.getPrototypeOf(q)})(I)}function f(I){return(f=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(q){return typeof q}:function(q){return q&&typeof Symbol=="function"&&q.constructor===Symbol&&q!==Symbol.prototype?"symbol":typeof q})(I)}var h=qe.inspect,d=aI().codes.ERR_INVALID_ARG_TYPE;function m(I,q,ee){return(ee===void 0||ee>I.length)&&(ee=I.length),I.substring(ee-q.length,ee)===q}var y="",v="",w="",b="",E={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function _(I){var q=Object.keys(I),ee=Object.create(Object.getPrototypeOf(I));return q.forEach((function(K){ee[K]=I[K]})),Object.defineProperty(ee,"message",{value:I.message}),ee}function S(I){return h(I,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function A(I,q,ee){var K="",ne="",L=0,$="",Y=!1,ie=S(I),re=ie.split(`
|
|
20
|
-
`),k=S(q).split(`
|
|
21
|
-
`),x=0,P="";if(ee==="strictEqual"&&f(I)==="object"&&f(q)==="object"&&I!==null&&q!==null&&(ee="strictEqualObject"),re.length===1&&k.length===1&&re[0]!==k[0]){var C=re[0].length+k[0].length;if(C<=10){if(!(f(I)==="object"&&I!==null||f(q)==="object"&&q!==null||I===0&&q===0))return"".concat(E[ee],`
|
|
22
|
-
|
|
23
|
-
`)+"".concat(re[0]," !== ").concat(k[0],`
|
|
24
|
-
`)}else if(ee!=="strictEqualObject"&&C<(r.stderr&&r.stderr.isTTY?r.stderr.columns:80)){for(;re[0][x]===k[0][x];)x++;x>2&&(P=`
|
|
25
|
-
`.concat((function(V,M){if(M=Math.floor(M),V.length==0||M==0)return"";var oe=V.length*M;for(M=Math.floor(Math.log(M)/Math.log(2));M;)V+=V,M--;return V+=V.substring(0,oe-V.length)})(" ",x),"^"),x=0)}}for(var j=re[re.length-1],U=k[k.length-1];j===U&&(x++<2?$=`
|
|
26
|
-
`.concat(j).concat($):K=j,re.pop(),k.pop(),re.length!==0&&k.length!==0);)j=re[re.length-1],U=k[k.length-1];var B=Math.max(re.length,k.length);if(B===0){var Q=ie.split(`
|
|
27
|
-
`);if(Q.length>30)for(Q[26]="".concat(y,"...").concat(b);Q.length>27;)Q.pop();return"".concat(E.notIdentical,`
|
|
28
|
-
|
|
29
|
-
`).concat(Q.join(`
|
|
30
|
-
`),`
|
|
31
|
-
`)}x>3&&($=`
|
|
32
|
-
`.concat(y,"...").concat(b).concat($),Y=!0),K!==""&&($=`
|
|
33
|
-
`.concat(K).concat($),K="");var fe=0,Ee=E[ee]+`
|
|
34
|
-
`.concat(v,"+ actual").concat(b," ").concat(w,"- expected").concat(b),te=" ".concat(y,"...").concat(b," Lines skipped");for(x=0;x<B;x++){var H=x-L;if(re.length<x+1)H>1&&x>2&&(H>4?(ne+=`
|
|
35
|
-
`.concat(y,"...").concat(b),Y=!0):H>3&&(ne+=`
|
|
36
|
-
`.concat(k[x-2]),fe++),ne+=`
|
|
37
|
-
`.concat(k[x-1]),fe++),L=x,K+=`
|
|
38
|
-
`.concat(w,"-").concat(b," ").concat(k[x]),fe++;else if(k.length<x+1)H>1&&x>2&&(H>4?(ne+=`
|
|
39
|
-
`.concat(y,"...").concat(b),Y=!0):H>3&&(ne+=`
|
|
40
|
-
`.concat(re[x-2]),fe++),ne+=`
|
|
41
|
-
`.concat(re[x-1]),fe++),L=x,ne+=`
|
|
42
|
-
`.concat(v,"+").concat(b," ").concat(re[x]),fe++;else{var ae=k[x],we=re[x],xe=we!==ae&&(!m(we,",")||we.slice(0,-1)!==ae);xe&&m(ae,",")&&ae.slice(0,-1)===we&&(xe=!1,we+=","),xe?(H>1&&x>2&&(H>4?(ne+=`
|
|
43
|
-
`.concat(y,"...").concat(b),Y=!0):H>3&&(ne+=`
|
|
44
|
-
`.concat(re[x-2]),fe++),ne+=`
|
|
45
|
-
`.concat(re[x-1]),fe++),L=x,ne+=`
|
|
46
|
-
`.concat(v,"+").concat(b," ").concat(we),K+=`
|
|
47
|
-
`.concat(w,"-").concat(b," ").concat(ae),fe+=2):(ne+=K,K="",H!==1&&x!==0||(ne+=`
|
|
48
|
-
`.concat(we),fe++))}if(fe>20&&x<B-2)return"".concat(Ee).concat(te,`
|
|
49
|
-
`).concat(ne,`
|
|
50
|
-
`).concat(y,"...").concat(b).concat(K,`
|
|
51
|
-
`)+"".concat(y,"...").concat(b)}return"".concat(Ee).concat(Y?te:"",`
|
|
52
|
-
`).concat(ne).concat(K).concat($).concat(P)}var F=(function(I){function q(ne){var L;if((function(Q,fe){if(!(Q instanceof fe))throw new TypeError("Cannot call a class as a function")})(this,q),f(ne)!=="object"||ne===null)throw new d("options","Object",ne);var $=ne.message,Y=ne.operator,ie=ne.stackStartFn,re=ne.actual,k=ne.expected,x=Error.stackTraceLimit;if(Error.stackTraceLimit=0,$!=null)L=n(this,c(q).call(this,String($)));else if(r.stderr&&r.stderr.isTTY&&(r.stderr&&r.stderr.getColorDepth&&r.stderr.getColorDepth()!==1?(y="\x1B[34m",v="\x1B[32m",b="\x1B[39m",w="\x1B[31m"):(y="",v="",b="",w="")),f(re)==="object"&&re!==null&&f(k)==="object"&&k!==null&&"stack"in re&&re instanceof Error&&"stack"in k&&k instanceof Error&&(re=_(re),k=_(k)),Y==="deepStrictEqual"||Y==="strictEqual")L=n(this,c(q).call(this,A(re,k,Y)));else if(Y==="notDeepStrictEqual"||Y==="notStrictEqual"){var P=E[Y],C=S(re).split(`
|
|
53
|
-
`);if(Y==="notStrictEqual"&&f(re)==="object"&&re!==null&&(P=E.notStrictEqualObject),C.length>30)for(C[26]="".concat(y,"...").concat(b);C.length>27;)C.pop();L=C.length===1?n(this,c(q).call(this,"".concat(P," ").concat(C[0]))):n(this,c(q).call(this,"".concat(P,`
|
|
54
|
-
|
|
55
|
-
`).concat(C.join(`
|
|
56
|
-
`),`
|
|
57
|
-
`)))}else{var j=S(re),U="",B=E[Y];Y==="notDeepEqual"||Y==="notEqual"?(j="".concat(E[Y],`
|
|
58
|
-
|
|
59
|
-
`).concat(j)).length>1024&&(j="".concat(j.slice(0,1021),"...")):(U="".concat(S(k)),j.length>512&&(j="".concat(j.slice(0,509),"...")),U.length>512&&(U="".concat(U.slice(0,509),"...")),Y==="deepEqual"||Y==="equal"?j="".concat(B,`
|
|
60
|
-
|
|
61
|
-
`).concat(j,`
|
|
62
|
-
|
|
63
|
-
should equal
|
|
64
|
-
|
|
65
|
-
`):U=" ".concat(Y," ").concat(U)),L=n(this,c(q).call(this,"".concat(j).concat(U)))}return Error.stackTraceLimit=x,L.generatedMessage=!$,Object.defineProperty(i(L),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),L.code="ERR_ASSERTION",L.actual=re,L.expected=k,L.operator=Y,Error.captureStackTrace&&Error.captureStackTrace(i(L),ie),L.stack,L.name="AssertionError",n(L)}var ee,K;return(function(ne,L){if(typeof L!="function"&&L!==null)throw new TypeError("Super expression must either be null or a function");ne.prototype=Object.create(L&&L.prototype,{constructor:{value:ne,writable:!0,configurable:!0}}),L&&u(ne,L)})(q,I),ee=q,(K=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:h.custom,value:function(ne,L){return h(this,(function($){for(var Y=1;Y<arguments.length;Y++){var ie=arguments[Y]!=null?arguments[Y]:{},re=Object.keys(ie);typeof Object.getOwnPropertySymbols=="function"&&(re=re.concat(Object.getOwnPropertySymbols(ie).filter((function(k){return Object.getOwnPropertyDescriptor(ie,k).enumerable})))),re.forEach((function(k){e($,k,ie[k])}))}return $})({},L,{customInspect:!1,depth:0}))}}])&&t(ee.prototype,K),q})(o(Error));return ND=F}function kD(r,e){return(function(t){if(Array.isArray(t))return t})(r)||(function(t,n){var i=[],o=!0,s=!1,a=void 0;try{for(var u,c=t[Symbol.iterator]();!(o=(u=c.next()).done)&&(i.push(u.value),!n||i.length!==n);o=!0);}catch(f){s=!0,a=f}finally{try{o||c.return==null||c.return()}finally{if(s)throw a}}return i})(r,e)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")})()}function Bs(r){return(Bs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(r)}function b1(r){return r.call.bind(r)}function f4(r){if(r.length===0||r.length>10)return!0;for(var e=0;e<r.length;e++){var t=r.charCodeAt(e);if(t<48||t>57)return!0}return r.length===10&&r>=Math.pow(2,32)}function fb(r){return Object.keys(r).filter(f4).concat(db(r).filter(Object.prototype.propertyIsEnumerable.bind(r)))}function zD(r,e){if(r===e)return 0;for(var t=r.length,n=e.length,i=0,o=Math.min(t,n);i<o;++i)if(r[i]!==e[i]){t=r[i],n=e[i];break}return t<n?-1:n<t?1:0}function us(r,e,t,n){if(r===e)return r!==0||!t||PD(r,e);if(t){if(Bs(r)!=="object")return typeof r=="number"&&p1(r)&&p1(e);if(Bs(e)!=="object"||r===null||e===null||Object.getPrototypeOf(r)!==Object.getPrototypeOf(e))return!1}else{if(r===null||Bs(r)!=="object")return(e===null||Bs(e)!=="object")&&r==e;if(e===null||Bs(e)!=="object")return!1}var i,o,s,a,u=MD(r);if(u!==MD(e))return!1;if(Array.isArray(r)){if(r.length!==e.length)return!1;var c=fb(r),f=fb(e);return c.length===f.length&&Zp(r,e,t,n,1,c)}if(u==="[object Object]"&&(!ub(r)&&ub(e)||!cb(r)&&cb(e)))return!1;if(BD(r)){if(!BD(e)||Date.prototype.getTime.call(r)!==Date.prototype.getTime.call(e))return!1}else if(FD(r)){if(!FD(e)||(s=r,a=e,!(n4?s.source===a.source&&s.flags===a.flags:RegExp.prototype.toString.call(s)===RegExp.prototype.toString.call(a))))return!1}else if(o4(r)||r instanceof Error){if(r.message!==e.message||r.name!==e.name)return!1}else{if(s4(r)){if(t||!u4(r)&&!c4(r)){if(!(function(m,y){return m.byteLength===y.byteLength&&zD(new Uint8Array(m.buffer,m.byteOffset,m.byteLength),new Uint8Array(y.buffer,y.byteOffset,y.byteLength))===0})(r,e))return!1}else if(!(function(m,y){if(m.byteLength!==y.byteLength)return!1;for(var v=0;v<m.byteLength;v++)if(m[v]!==y[v])return!1;return!0})(r,e))return!1;var h=fb(r),d=fb(e);return h.length===d.length&&Zp(r,e,t,n,0,h)}if(cb(r))return!(!cb(e)||r.size!==e.size)&&Zp(r,e,t,n,2);if(ub(r))return!(!ub(e)||r.size!==e.size)&&Zp(r,e,t,n,3);if(i4(r)){if(o=e,(i=r).byteLength!==o.byteLength||zD(new Uint8Array(i),new Uint8Array(o))!==0)return!1}else if(a4(r)&&!(function(m,y){return UD(m)?UD(y)&&PD(Number.prototype.valueOf.call(m),Number.prototype.valueOf.call(y)):jD(m)?jD(y)&&String.prototype.valueOf.call(m)===String.prototype.valueOf.call(y):$D(m)?$D(y)&&Boolean.prototype.valueOf.call(m)===Boolean.prototype.valueOf.call(y):WD(m)?WD(y)&&BigInt.prototype.valueOf.call(m)===BigInt.prototype.valueOf.call(y):l4(y)&&Symbol.prototype.valueOf.call(m)===Symbol.prototype.valueOf.call(y)})(r,e))return!1}return Zp(r,e,t,n,0)}function HD(r,e){return e.filter((function(t){return pb(r,t)}))}function Zp(r,e,t,n,i,o){if(arguments.length===5){o=Object.keys(r);var s=Object.keys(e);if(o.length!==s.length)return!1}for(var a=0;a<o.length;a++)if(!Jp(e,o[a]))return!1;if(t&&arguments.length===5){var u=db(r);if(u.length!==0){var c=0;for(a=0;a<u.length;a++){var f=u[a];if(pb(r,f)){if(!pb(e,f))return!1;o.push(f),c++}else if(pb(e,f))return!1}var h=db(e);if(u.length!==h.length&&HD(e,h).length!==c)return!1}else{var d=db(e);if(d.length!==0&&HD(e,d).length!==0)return!1}}if(o.length===0&&(i===0||i===1&&r.length===0||r.size===0))return!0;if(n===void 0)n={val1:new Map,val2:new Map,position:0};else{var m=n.val1.get(r);if(m!==void 0){var y=n.val2.get(e);if(y!==void 0)return m===y}n.position++}n.val1.set(r,n.position),n.val2.set(e,n.position);var v=p4(r,e,t,o,n,i);return n.val1.delete(r),n.val2.delete(e),v}function qD(r,e,t,n){for(var i=gb(r),o=0;o<i.length;o++){var s=i[o];if(us(e,s,t,n))return r.delete(s),!0}return!1}function lI(r){switch(Bs(r)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":r=+r;case"number":if(p1(r))return!1}return!0}function h4(r,e,t){var n=lI(t);return n??(e.has(n)&&!r.has(n))}function d4(r,e,t,n,i){var o=lI(t);if(o!=null)return o;var s=e.get(o);return!(s===void 0&&!e.has(o)||!us(n,s,!1,i))&&!r.has(o)&&us(n,s,!1,i)}function GD(r,e,t,n,i,o){for(var s=gb(r),a=0;a<s.length;a++){var u=s[a];if(us(t,u,i,o)&&us(n,e.get(u),i,o))return r.delete(u),!0}return!1}function p4(r,e,t,n,i,o){var s=0;if(o===2){if(!(function(f,h,d,m){for(var y=null,v=gb(f),w=0;w<v.length;w++){var b=v[w];if(Bs(b)==="object"&&b!==null)y===null&&(y=new Set),y.add(b);else if(!h.has(b)){if(d||!h4(f,h,b))return!1;y===null&&(y=new Set),y.add(b)}}if(y!==null){for(var E=gb(h),_=0;_<E.length;_++){var S=E[_];if(Bs(S)==="object"&&S!==null){if(!qD(y,S,d,m))return!1}else if(!d&&!f.has(S)&&!qD(y,S,d,m))return!1}return y.size===0}return!0})(r,e,t,i))return!1}else if(o===3){if(!(function(f,h,d,m){for(var y=null,v=LD(f),w=0;w<v.length;w++){var b=kD(v[w],2),E=b[0],_=b[1];if(Bs(E)==="object"&&E!==null)y===null&&(y=new Set),y.add(E);else{var S=h.get(E);if(S===void 0&&!h.has(E)||!us(_,S,d,m)){if(d||!d4(f,h,E,_,m))return!1;y===null&&(y=new Set),y.add(E)}}}if(y!==null){for(var A=LD(h),F=0;F<A.length;F++){var I=kD(A[F],2),q=(E=I[0],I[1]);if(Bs(E)==="object"&&E!==null){if(!GD(y,f,E,q,d,m))return!1}else if(!(d||f.has(E)&&us(f.get(E),q,!1,m)||GD(y,f,E,q,!1,m)))return!1}return y.size===0}return!0})(r,e,t,i))return!1}else if(o===1)for(;s<r.length;s++){if(!Jp(r,s)){if(Jp(e,s))return!1;for(var a=Object.keys(r);s<a.length;s++){var u=a[s];if(!Jp(e,u)||!us(r[u],e[u],t,i))return!1}return a.length===Object.keys(e).length}if(!Jp(e,s)||!us(r[s],e[s],t,i))return!1}for(s=0;s<n.length;s++){var c=n[s];if(!us(r[c],e[c],t,i))return!1}return!0}function g1(){if(YD)return c1;YD=!0;var r=hr;function e(k){return(e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(x){return typeof x}:function(x){return x&&typeof Symbol=="function"&&x.constructor===Symbol&&x!==Symbol.prototype?"symbol":typeof x})(k)}var t,n,i=aI().codes,o=i.ERR_AMBIGUOUS_ARGUMENT,s=i.ERR_INVALID_ARG_TYPE,a=i.ERR_INVALID_ARG_VALUE,u=i.ERR_INVALID_RETURN_VALUE,c=i.ERR_MISSING_ARGS,f=r4(),h=qe.inspect,d=qe.types,m=d.isPromise,y=d.isRegExp,v=Object.assign?Object.assign:b6.assign,w=Object.is?Object.is:iI;function b(){t=VD.isDeepEqual,n=VD.isDeepStrictEqual}var E=!1,_=c1=I,S={};function A(k){throw k.message instanceof Error?k.message:new f(k)}function F(k,x,P,C){if(!P){var j=!1;if(x===0)j=!0,C="No value argument passed to `assert.ok()`";else if(C instanceof Error)throw C;var U=new f({actual:P,expected:!0,message:C,operator:"==",stackStartFn:k});throw U.generatedMessage=j,U}}function I(){for(var k=arguments.length,x=new Array(k),P=0;P<k;P++)x[P]=arguments[P];F.apply(void 0,[I,x.length].concat(x))}_.fail=function k(x,P,C,j,U){var B,Q=arguments.length;if(Q===0)B="Failed";else if(Q===1)C=x,x=void 0;else{if(E===!1){E=!0;var fe=r.emitWarning?r.emitWarning:console.warn.bind(console);fe("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")}Q===2&&(j="!=")}if(C instanceof Error)throw C;var Ee={actual:x,expected:P,operator:j===void 0?"fail":j,stackStartFn:U||k};C!==void 0&&(Ee.message=C);var te=new f(Ee);throw B&&(te.message=B,te.generatedMessage=!0),te},_.AssertionError=f,_.ok=I,_.equal=function k(x,P,C){if(arguments.length<2)throw new c("actual","expected");x!=P&&A({actual:x,expected:P,message:C,operator:"==",stackStartFn:k})},_.notEqual=function k(x,P,C){if(arguments.length<2)throw new c("actual","expected");x==P&&A({actual:x,expected:P,message:C,operator:"!=",stackStartFn:k})},_.deepEqual=function k(x,P,C){if(arguments.length<2)throw new c("actual","expected");t===void 0&&b(),t(x,P)||A({actual:x,expected:P,message:C,operator:"deepEqual",stackStartFn:k})},_.notDeepEqual=function k(x,P,C){if(arguments.length<2)throw new c("actual","expected");t===void 0&&b(),t(x,P)&&A({actual:x,expected:P,message:C,operator:"notDeepEqual",stackStartFn:k})},_.deepStrictEqual=function k(x,P,C){if(arguments.length<2)throw new c("actual","expected");t===void 0&&b(),n(x,P)||A({actual:x,expected:P,message:C,operator:"deepStrictEqual",stackStartFn:k})},_.notDeepStrictEqual=function k(x,P,C){if(arguments.length<2)throw new c("actual","expected");t===void 0&&b(),n(x,P)&&A({actual:x,expected:P,message:C,operator:"notDeepStrictEqual",stackStartFn:k})},_.strictEqual=function k(x,P,C){if(arguments.length<2)throw new c("actual","expected");w(x,P)||A({actual:x,expected:P,message:C,operator:"strictEqual",stackStartFn:k})},_.notStrictEqual=function k(x,P,C){if(arguments.length<2)throw new c("actual","expected");w(x,P)&&A({actual:x,expected:P,message:C,operator:"notStrictEqual",stackStartFn:k})};var q=function k(x,P,C){var j=this;(function(U,B){if(!(U instanceof B))throw new TypeError("Cannot call a class as a function")})(this,k),P.forEach((function(U){U in x&&(C!==void 0&&typeof C[U]=="string"&&y(x[U])&&x[U].test(C[U])?j[U]=C[U]:j[U]=x[U])}))};function ee(k,x,P,C,j,U){if(!(P in k)||!n(k[P],x[P])){if(!C){var B=new q(k,j),Q=new q(x,j,k),fe=new f({actual:B,expected:Q,operator:"deepStrictEqual",stackStartFn:U});throw fe.actual=k,fe.expected=x,fe.operator=U.name,fe}A({actual:k,expected:x,message:C,operator:U.name,stackStartFn:U})}}function K(k,x,P,C){if(typeof x!="function"){if(y(x))return x.test(k);if(arguments.length===2)throw new s("expected",["Function","RegExp"],x);if(e(k)!=="object"||k===null){var j=new f({actual:k,expected:x,message:P,operator:"deepStrictEqual",stackStartFn:C});throw j.operator=C.name,j}var U=Object.keys(x);if(x instanceof Error)U.push("name","message");else if(U.length===0)throw new a("error",x,"may not be an empty object");return t===void 0&&b(),U.forEach((function(B){typeof k[B]=="string"&&y(x[B])&&x[B].test(k[B])||ee(k,x,B,P,U,C)})),!0}return x.prototype!==void 0&&k instanceof x||!Error.isPrototypeOf(x)&&x.call({},k)===!0}function ne(k){if(typeof k!="function")throw new s("fn","Function",k);try{k()}catch(x){return x}return S}function L(k){return m(k)||k!==null&&e(k)==="object"&&typeof k.then=="function"&&typeof k.catch=="function"}function $(k){return Promise.resolve().then((function(){var x;if(typeof k=="function"){if(!L(x=k()))throw new u("instance of Promise","promiseFn",x)}else{if(!L(k))throw new s("promiseFn",["Function","Promise"],k);x=k}return Promise.resolve().then((function(){return x})).then((function(){return S})).catch((function(P){return P}))}))}function Y(k,x,P,C){if(typeof P=="string"){if(arguments.length===4)throw new s("error",["Object","Error","Function","RegExp"],P);if(e(x)==="object"&&x!==null){if(x.message===P)throw new o("error/message",'The error message "'.concat(x.message,'" is identical to the message.'))}else if(x===P)throw new o("error/message",'The error "'.concat(x,'" is identical to the message.'));C=P,P=void 0}else if(P!=null&&e(P)!=="object"&&typeof P!="function")throw new s("error",["Object","Error","Function","RegExp"],P);if(x===S){var j="";P&&P.name&&(j+=" (".concat(P.name,")")),j+=C?": ".concat(C):".";var U=k.name==="rejects"?"rejection":"exception";A({actual:void 0,expected:P,operator:k.name,message:"Missing expected ".concat(U).concat(j),stackStartFn:k})}if(P&&!K(x,P,C,k))throw x}function ie(k,x,P,C){if(x!==S){if(typeof P=="string"&&(C=P,P=void 0),!P||K(x,P)){var j=C?": ".concat(C):".",U=k.name==="doesNotReject"?"rejection":"exception";A({actual:x,expected:P,operator:k.name,message:"Got unwanted ".concat(U).concat(j,`
|
|
66
|
-
`)+'Actual message: "'.concat(x&&x.message,'"'),stackStartFn:k})}throw x}}function re(){for(var k=arguments.length,x=new Array(k),P=0;P<k;P++)x[P]=arguments[P];F.apply(void 0,[re,x.length].concat(x))}return _.throws=function k(x){for(var P=arguments.length,C=new Array(P>1?P-1:0),j=1;j<P;j++)C[j-1]=arguments[j];Y.apply(void 0,[k,ne(x)].concat(C))},_.rejects=function k(x){for(var P=arguments.length,C=new Array(P>1?P-1:0),j=1;j<P;j++)C[j-1]=arguments[j];return $(x).then((function(U){return Y.apply(void 0,[k,U].concat(C))}))},_.doesNotThrow=function k(x){for(var P=arguments.length,C=new Array(P>1?P-1:0),j=1;j<P;j++)C[j-1]=arguments[j];ie.apply(void 0,[k,ne(x)].concat(C))},_.doesNotReject=function k(x){for(var P=arguments.length,C=new Array(P>1?P-1:0),j=1;j<P;j++)C[j-1]=arguments[j];return $(x).then((function(U){return ie.apply(void 0,[k,U].concat(C))}))},_.ifError=function k(x){if(x!=null){var P="ifError got unwanted exception: ";e(x)==="object"&&typeof x.message=="string"?x.message.length===0&&x.constructor?P+=x.constructor.name:P+=x.message:P+=h(x);var C=new f({actual:x,expected:null,operator:"ifError",message:P,stackStartFn:k}),j=x.stack;if(typeof j=="string"){var U=j.split(`
|
|
67
|
-
`);U.shift();for(var B=C.stack.split(`
|
|
68
|
-
`),Q=0;Q<U.length;Q++){var fe=B.indexOf(U[Q]);if(fe!==-1){B=B.slice(0,fe);break}}C.stack="".concat(B.join(`
|
|
69
|
-
`),`
|
|
70
|
-
`).concat(U.join(`
|
|
71
|
-
`))}throw C}},_.strict=v(re,_,{equal:_.strictEqual,deepEqual:_.deepStrictEqual,notEqual:_.notStrictEqual,notDeepEqual:_.notDeepStrictEqual}),_.strict.strict=_.strict,c1}var b6,XD,bD,KD,Xp,n1,wD,i1,vD,ED,Kp,lb,_D,AD,w6,v6,E6,xD,hb,SD,_6,A6,x6,S6,T6,f1,ZD,C6,JD,mb,R6,TD,D6,I6,N6,s1,O6,k6,QD,Qp,Xu,o1,L6,Vu,Yu,a1,l1,CD,P6,M6,B6,F6,U6,eI,RD,tI,j6,$6,W6,h1,d1,DD,z6,H6,q6,G6,V6,rI,Y6,nI,iI,m1,y1,X6,K6,Z6,J6,Q6,sI,e4,oI,t4,u1,ID,ND,OD,n4,gb,LD,PD,db,p1,Jp,pb,MD,Xn,i4,s4,BD,ub,FD,cb,o4,a4,UD,jD,$D,WD,l4,u4,c4,VD,c1,YD,gt,w1=_t(()=>{Te();Re();Ce();Al();b6={assign:yD,polyfill:function(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:yD})}},bD=Object.prototype.toString,KD=function(r){var e=bD.call(r),t=e==="[object Arguments]";return t||(t=e!=="[object Array]"&&r!==null&&typeof r=="object"&&typeof r.length=="number"&&r.length>=0&&bD.call(r.callee)==="[object Function]"),t};Object.keys||(Xp=Object.prototype.hasOwnProperty,n1=Object.prototype.toString,wD=KD,i1=Object.prototype.propertyIsEnumerable,vD=!i1.call({toString:null},"toString"),ED=i1.call((function(){}),"prototype"),Kp=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],lb=function(r){var e=r.constructor;return e&&e.prototype===r},_D={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},AD=(function(){if(typeof window>"u")return!1;for(var r in window)try{if(!_D["$"+r]&&Xp.call(window,r)&&window[r]!==null&&typeof window[r]=="object")try{lb(window[r])}catch{return!0}}catch{return!0}return!1})(),XD=function(r){var e=r!==null&&typeof r=="object",t=n1.call(r)==="[object Function]",n=wD(r),i=e&&n1.call(r)==="[object String]",o=[];if(!e&&!t&&!n)throw new TypeError("Object.keys called on a non-object");var s=ED&&t;if(i&&r.length>0&&!Xp.call(r,0))for(var a=0;a<r.length;++a)o.push(String(a));if(n&&r.length>0)for(var u=0;u<r.length;++u)o.push(String(u));else for(var c in r)s&&c==="prototype"||!Xp.call(r,c)||o.push(String(c));if(vD)for(var f=(function(d){if(typeof window>"u"||!AD)return lb(d);try{return lb(d)}catch{return!1}})(r),h=0;h<Kp.length;++h)f&&Kp[h]==="constructor"||!Xp.call(r,Kp[h])||o.push(Kp[h]);return o});w6=XD,v6=Array.prototype.slice,E6=KD,xD=Object.keys,hb=xD?function(r){return xD(r)}:w6,SD=Object.keys;hb.shim=function(){return Object.keys?(function(){var r=Object.keys(arguments);return r&&r.length===arguments.length})(1,2)||(Object.keys=function(r){return E6(r)?SD(v6.call(r)):SD(r)}):Object.keys=hb,Object.keys||hb};_6=hb,A6=_6,x6=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",S6=Object.prototype.toString,T6=Array.prototype.concat,f1=Object.defineProperty,ZD=f1&&(function(){var r={};try{for(var e in f1(r,"x",{enumerable:!1,value:r}),r)return!1;return r.x===r}catch{return!1}})(),C6=function(r,e,t,n){var i;(!(e in r)||typeof(i=n)=="function"&&S6.call(i)==="[object Function]"&&n())&&(ZD?f1(r,e,{configurable:!0,enumerable:!1,value:t,writable:!0}):r[e]=t)},JD=function(r,e){var t=arguments.length>2?arguments[2]:{},n=A6(e);x6&&(n=T6.call(n,Object.getOwnPropertySymbols(e)));for(var i=0;i<n.length;i+=1)C6(r,n[i],e[n[i]],t[n[i]])};JD.supportsDescriptors=!!ZD;mb=JD,R6=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var r={},e=Symbol("test"),t=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(t)!=="[object Symbol]")return!1;for(e in r[e]=42,r)return!1;if(typeof Object.keys=="function"&&Object.keys(r).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(r).length!==0)return!1;var n=Object.getOwnPropertySymbols(r);if(n.length!==1||n[0]!==e||!Object.prototype.propertyIsEnumerable.call(r,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var i=Object.getOwnPropertyDescriptor(r,e);if(i.value!==42||i.enumerable!==!0)return!1}return!0},TD=(typeof globalThis<"u"?globalThis:typeof self<"u"?self:window).Symbol,D6=R6,I6=function(){return typeof TD=="function"&&typeof Symbol=="function"&&typeof TD("foo")=="symbol"&&typeof Symbol("bar")=="symbol"&&D6()},N6="Function.prototype.bind called on incompatible ",s1=Array.prototype.slice,O6=Object.prototype.toString,k6=function(r){var e=this;if(typeof e!="function"||O6.call(e)!=="[object Function]")throw new TypeError(N6+e);for(var t,n=s1.call(arguments,1),i=function(){if(this instanceof t){var c=e.apply(this,n.concat(s1.call(arguments)));return Object(c)===c?c:this}return e.apply(r,n.concat(s1.call(arguments)))},o=Math.max(0,e.length-n.length),s=[],a=0;a<o;a++)s.push("$"+a);if(t=Function("binder","return function ("+s.join(",")+"){ return binder.apply(this,arguments); }")(i),e.prototype){var u=function(){};u.prototype=e.prototype,t.prototype=new u,u.prototype=null}return t},QD=Function.prototype.bind||k6,Qp=TypeError,Xu=Object.getOwnPropertyDescriptor;if(Xu)try{Xu({},"")}catch{Xu=null}o1=function(){throw new Qp},L6=Xu?(function(){try{return arguments.callee,o1}catch{try{return Xu(arguments,"callee").get}catch{return o1}}})():o1,Vu=I6(),Yu=Object.getPrototypeOf||function(r){return r.__proto__},a1=typeof Uint8Array>"u"?void 0:Yu(Uint8Array),l1={"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?void 0:ArrayBuffer,"%ArrayBufferPrototype%":typeof ArrayBuffer>"u"?void 0:ArrayBuffer.prototype,"%ArrayIteratorPrototype%":Vu?Yu([][Symbol.iterator]()):void 0,"%ArrayPrototype%":Array.prototype,"%ArrayProto_entries%":Array.prototype.entries,"%ArrayProto_forEach%":Array.prototype.forEach,"%ArrayProto_keys%":Array.prototype.keys,"%ArrayProto_values%":Array.prototype.values,"%AsyncFromSyncIteratorPrototype%":void 0,"%AsyncFunction%":void 0,"%AsyncFunctionPrototype%":void 0,"%AsyncGenerator%":void 0,"%AsyncGeneratorFunction%":void 0,"%AsyncGeneratorPrototype%":void 0,"%AsyncIteratorPrototype%":void 0,"%Atomics%":typeof Atomics>"u"?void 0:Atomics,"%Boolean%":Boolean,"%BooleanPrototype%":Boolean.prototype,"%DataView%":typeof DataView>"u"?void 0:DataView,"%DataViewPrototype%":typeof DataView>"u"?void 0:DataView.prototype,"%Date%":Date,"%DatePrototype%":Date.prototype,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%ErrorPrototype%":Error.prototype,"%eval%":eval,"%EvalError%":EvalError,"%EvalErrorPrototype%":EvalError.prototype,"%Float32Array%":typeof Float32Array>"u"?void 0:Float32Array,"%Float32ArrayPrototype%":typeof Float32Array>"u"?void 0:Float32Array.prototype,"%Float64Array%":typeof Float64Array>"u"?void 0:Float64Array,"%Float64ArrayPrototype%":typeof Float64Array>"u"?void 0:Float64Array.prototype,"%Function%":Function,"%FunctionPrototype%":Function.prototype,"%Generator%":void 0,"%GeneratorFunction%":void 0,"%GeneratorPrototype%":void 0,"%Int8Array%":typeof Int8Array>"u"?void 0:Int8Array,"%Int8ArrayPrototype%":typeof Int8Array>"u"?void 0:Int8Array.prototype,"%Int16Array%":typeof Int16Array>"u"?void 0:Int16Array,"%Int16ArrayPrototype%":typeof Int16Array>"u"?void 0:Int8Array.prototype,"%Int32Array%":typeof Int32Array>"u"?void 0:Int32Array,"%Int32ArrayPrototype%":typeof Int32Array>"u"?void 0:Int32Array.prototype,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Vu?Yu(Yu([][Symbol.iterator]())):void 0,"%JSON%":typeof JSON=="object"?JSON:void 0,"%JSONParse%":typeof JSON=="object"?JSON.parse:void 0,"%Map%":typeof Map>"u"?void 0:Map,"%MapIteratorPrototype%":typeof Map<"u"&&Vu?Yu(new Map()[Symbol.iterator]()):void 0,"%MapPrototype%":typeof Map>"u"?void 0:Map.prototype,"%Math%":Math,"%Number%":Number,"%NumberPrototype%":Number.prototype,"%Object%":Object,"%ObjectPrototype%":Object.prototype,"%ObjProto_toString%":Object.prototype.toString,"%ObjProto_valueOf%":Object.prototype.valueOf,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?void 0:Promise,"%PromisePrototype%":typeof Promise>"u"?void 0:Promise.prototype,"%PromiseProto_then%":typeof Promise>"u"?void 0:Promise.prototype.then,"%Promise_all%":typeof Promise>"u"?void 0:Promise.all,"%Promise_reject%":typeof Promise>"u"?void 0:Promise.reject,"%Promise_resolve%":typeof Promise>"u"?void 0:Promise.resolve,"%Proxy%":typeof Proxy>"u"?void 0:Proxy,"%RangeError%":RangeError,"%RangeErrorPrototype%":RangeError.prototype,"%ReferenceError%":ReferenceError,"%ReferenceErrorPrototype%":ReferenceError.prototype,"%Reflect%":typeof Reflect>"u"?void 0:Reflect,"%RegExp%":RegExp,"%RegExpPrototype%":RegExp.prototype,"%Set%":typeof Set>"u"?void 0:Set,"%SetIteratorPrototype%":typeof Set<"u"&&Vu?Yu(new Set()[Symbol.iterator]()):void 0,"%SetPrototype%":typeof Set>"u"?void 0:Set.prototype,"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?void 0:SharedArrayBuffer,"%SharedArrayBufferPrototype%":typeof SharedArrayBuffer>"u"?void 0:SharedArrayBuffer.prototype,"%String%":String,"%StringIteratorPrototype%":Vu?Yu(""[Symbol.iterator]()):void 0,"%StringPrototype%":String.prototype,"%Symbol%":Vu?Symbol:void 0,"%SymbolPrototype%":Vu?Symbol.prototype:void 0,"%SyntaxError%":SyntaxError,"%SyntaxErrorPrototype%":SyntaxError.prototype,"%ThrowTypeError%":L6,"%TypedArray%":a1,"%TypedArrayPrototype%":a1?a1.prototype:void 0,"%TypeError%":Qp,"%TypeErrorPrototype%":Qp.prototype,"%Uint8Array%":typeof Uint8Array>"u"?void 0:Uint8Array,"%Uint8ArrayPrototype%":typeof Uint8Array>"u"?void 0:Uint8Array.prototype,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?void 0:Uint8ClampedArray,"%Uint8ClampedArrayPrototype%":typeof Uint8ClampedArray>"u"?void 0:Uint8ClampedArray.prototype,"%Uint16Array%":typeof Uint16Array>"u"?void 0:Uint16Array,"%Uint16ArrayPrototype%":typeof Uint16Array>"u"?void 0:Uint16Array.prototype,"%Uint32Array%":typeof Uint32Array>"u"?void 0:Uint32Array,"%Uint32ArrayPrototype%":typeof Uint32Array>"u"?void 0:Uint32Array.prototype,"%URIError%":URIError,"%URIErrorPrototype%":URIError.prototype,"%WeakMap%":typeof WeakMap>"u"?void 0:WeakMap,"%WeakMapPrototype%":typeof WeakMap>"u"?void 0:WeakMap.prototype,"%WeakSet%":typeof WeakSet>"u"?void 0:WeakSet,"%WeakSetPrototype%":typeof WeakSet>"u"?void 0:WeakSet.prototype},CD=QD.call(Function.call,String.prototype.replace),P6=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,M6=/\\(\\)?/g,B6=function(r){var e=[];return CD(r,P6,(function(t,n,i,o){e[e.length]=i?CD(o,M6,"$1"):n||t})),e},F6=function(r,e){if(!(r in l1))throw new SyntaxError("intrinsic "+r+" does not exist!");if(l1[r]===void 0&&!e)throw new Qp("intrinsic "+r+" exists, but is not available. Please file an issue!");return l1[r]},U6=function(r,e){if(r.length===0)throw new TypeError("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new TypeError('"allowMissing" argument must be a boolean');for(var t=B6(r),n=F6("%"+(t.length>0?t[0]:"")+"%",e),i=1;i<t.length;i+=1)if(n!=null)if(Xu&&i+1>=t.length){var o=Xu(n,t[i]);if(!(t[i]in n))throw new Qp("base intrinsic for "+r+" exists, but the property is not available.");n=o?o.get||o.value:n[t[i]]}else n=n[t[i]];return n},RD=QD,tI=U6("%Function%"),j6=tI.apply,$6=tI.call;(eI=function(){return RD.apply($6,arguments)}).apply=function(){return RD.apply(j6,arguments)};W6=eI,DD=function(r){return r!=r},z6=(h1=function(r,e){return r===0&&e===0?1/r==1/e:r===e||!(!DD(r)||!DD(e))},h1),H6=(d1=function(){return typeof Object.is=="function"?Object.is:z6},d1),q6=mb,G6=mb,V6=h1,rI=d1,Y6=function(){var r=H6();return q6(Object,{is:r},{is:function(){return Object.is!==r}}),r},nI=W6(rI(),Object);G6(nI,{getPolyfill:rI,implementation:V6,shim:Y6});iI=nI;m1=function(r){return r!=r};X6=m1,K6=(y1=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:X6},mb),Z6=y1,J6=mb,Q6=m1,sI=y1,e4=function(){var r=Z6();return K6(Number,{isNaN:r},{isNaN:function(){return Number.isNaN!==r}}),r},oI=sI();J6(oI,{getPolyfill:sI,implementation:Q6,shim:e4});t4=oI,u1={},ID=!1;ND={},OD=!1;n4=/a/g.flags!==void 0,gb=function(r){var e=[];return r.forEach((function(t){return e.push(t)})),e},LD=function(r){var e=[];return r.forEach((function(t,n){return e.push([n,t])})),e},PD=Object.is?Object.is:iI,db=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},p1=Number.isNaN?Number.isNaN:t4;Jp=b1(Object.prototype.hasOwnProperty),pb=b1(Object.prototype.propertyIsEnumerable),MD=b1(Object.prototype.toString),Xn=qe.types,i4=Xn.isAnyArrayBuffer,s4=Xn.isArrayBufferView,BD=Xn.isDate,ub=Xn.isMap,FD=Xn.isRegExp,cb=Xn.isSet,o4=Xn.isNativeError,a4=Xn.isBoxedPrimitive,UD=Xn.isNumberObject,jD=Xn.isStringObject,$D=Xn.isBooleanObject,WD=Xn.isBigIntObject,l4=Xn.isSymbolObject,u4=Xn.isFloat32Array,c4=Xn.isFloat64Array;VD={isDeepEqual:function(r,e){return us(r,e,!1)},isDeepStrictEqual:function(r,e){return us(r,e,!0)}},c1={},YD=!1;gt=g1();gt.AssertionError;gt.deepEqual;gt.deepStrictEqual;gt.doesNotReject;gt.doesNotThrow;gt.equal;gt.fail;gt.ifError;gt.notDeepEqual;gt.notDeepStrictEqual;gt.notEqual;gt.notStrictEqual;gt.ok;gt.rejects;gt.strict;gt.strictEqual;gt.throws;gt.AssertionError;gt.deepEqual;gt.deepStrictEqual;gt.doesNotReject;gt.doesNotThrow;gt.equal;gt.fail;gt.ifError;gt.notDeepEqual;gt.notDeepStrictEqual;gt.notEqual;gt.notStrictEqual;gt.ok;gt.rejects;gt.strict;gt.strictEqual;gt.throws;gt.AssertionError;gt.deepEqual;gt.deepStrictEqual;gt.doesNotReject;gt.doesNotThrow;gt.equal;gt.fail;gt.ifError;gt.notDeepEqual;gt.notDeepStrictEqual;gt.notEqual;gt.notStrictEqual;gt.ok;gt.rejects;gt.strict;gt.strictEqual;gt.throws});var v1,yb=_t(()=>{Te();Re();Ce();Al();qe._extend;qe.callbackify;qe.debuglog;qe.deprecate;qe.format;qe.inherits;qe.inspect;qe.isArray;qe.isBoolean;qe.isBuffer;qe.isDate;qe.isError;qe.isFunction;qe.isNull;qe.isNullOrUndefined;qe.isNumber;qe.isObject;qe.isPrimitive;qe.isRegExp;qe.isString;qe.isSymbol;qe.isUndefined;qe.log;v1=qe.promisify;qe.types;qe.TextEncoder=globalThis.TextEncoder;qe.TextDecoder=globalThis.TextDecoder});function g4(){if(uI)return E1;uI=!0;var r=E1={},e,t;function n(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?e=setTimeout:e=n}catch{e=n}try{typeof clearTimeout=="function"?t=clearTimeout:t=i}catch{t=i}})();function o(v){if(e===setTimeout)return setTimeout(v,0);if((e===n||!e)&&setTimeout)return e=setTimeout,setTimeout(v,0);try{return e(v,0)}catch{try{return e.call(null,v,0)}catch{return e.call(this||nh,v,0)}}}function s(v){if(t===clearTimeout)return clearTimeout(v);if((t===i||!t)&&clearTimeout)return t=clearTimeout,clearTimeout(v);try{return t(v)}catch{try{return t.call(null,v)}catch{return t.call(this||nh,v)}}}var a=[],u=!1,c,f=-1;function h(){!u||!c||(u=!1,c.length?a=c.concat(a):f=-1,a.length&&d())}function d(){if(!u){var v=o(h);u=!0;for(var w=a.length;w;){for(c=a,a=[];++f<w;)c&&c[f].run();f=-1,w=a.length}c=null,u=!1,s(v)}}r.nextTick=function(v){var w=new Array(arguments.length-1);if(arguments.length>1)for(var b=1;b<arguments.length;b++)w[b-1]=arguments[b];a.push(new m(v,w)),a.length===1&&!u&&o(d)};function m(v,w){(this||nh).fun=v,(this||nh).array=w}m.prototype.run=function(){(this||nh).fun.apply(null,(this||nh).array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={};function y(){}return r.on=y,r.addListener=y,r.once=y,r.off=y,r.removeListener=y,r.removeAllListeners=y,r.emit=y,r.prependListener=y,r.prependOnceListener=y,r.listeners=function(v){return[]},r.binding=function(v){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(v){throw new Error("process.chdir is not supported")},r.umask=function(){return 0},E1}var E1,uI,nh,Xt,ih=_t(()=>{Te();Re();Ce();E1={},uI=!1,nh=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;Xt=g4();Xt.platform="browser";Xt.addListener;Xt.argv;Xt.binding;Xt.browser;Xt.chdir;Xt.cwd;Xt.emit;Xt.env;Xt.listeners;Xt.nextTick;Xt.off;Xt.on;Xt.once;Xt.prependListener;Xt.prependOnceListener;Xt.removeAllListeners;Xt.removeListener;Xt.title;Xt.umask;Xt.version;Xt.versions});function m4(){if(cI)return _1;cI=!0;var r=Xt;function e(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function t(o,s){for(var a="",u=0,c=-1,f=0,h,d=0;d<=o.length;++d){if(d<o.length)h=o.charCodeAt(d);else{if(h===47)break;h=47}if(h===47){if(!(c===d-1||f===1))if(c!==d-1&&f===2){if(a.length<2||u!==2||a.charCodeAt(a.length-1)!==46||a.charCodeAt(a.length-2)!==46){if(a.length>2){var m=a.lastIndexOf("/");if(m!==a.length-1){m===-1?(a="",u=0):(a=a.slice(0,m),u=a.length-1-a.lastIndexOf("/")),c=d,f=0;continue}}else if(a.length===2||a.length===1){a="",u=0,c=d,f=0;continue}}s&&(a.length>0?a+="/..":a="..",u=2)}else a.length>0?a+="/"+o.slice(c+1,d):a=o.slice(c+1,d),u=d-c-1;c=d,f=0}else h===46&&f!==-1?++f:f=-1}return a}function n(o,s){var a=s.dir||s.root,u=s.base||(s.name||"")+(s.ext||"");return a?a===s.root?a+u:a+o+u:u}var i={resolve:function(){for(var s="",a=!1,u,c=arguments.length-1;c>=-1&&!a;c--){var f;c>=0?f=arguments[c]:(u===void 0&&(u=r.cwd()),f=u),e(f),f.length!==0&&(s=f+"/"+s,a=f.charCodeAt(0)===47)}return s=t(s,!a),a?s.length>0?"/"+s:"/":s.length>0?s:"."},normalize:function(s){if(e(s),s.length===0)return".";var a=s.charCodeAt(0)===47,u=s.charCodeAt(s.length-1)===47;return s=t(s,!a),s.length===0&&!a&&(s="."),s.length>0&&u&&(s+="/"),a?"/"+s:s},isAbsolute:function(s){return e(s),s.length>0&&s.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var s,a=0;a<arguments.length;++a){var u=arguments[a];e(u),u.length>0&&(s===void 0?s=u:s+="/"+u)}return s===void 0?".":i.normalize(s)},relative:function(s,a){if(e(s),e(a),s===a||(s=i.resolve(s),a=i.resolve(a),s===a))return"";for(var u=1;u<s.length&&s.charCodeAt(u)===47;++u);for(var c=s.length,f=c-u,h=1;h<a.length&&a.charCodeAt(h)===47;++h);for(var d=a.length,m=d-h,y=f<m?f:m,v=-1,w=0;w<=y;++w){if(w===y){if(m>y){if(a.charCodeAt(h+w)===47)return a.slice(h+w+1);if(w===0)return a.slice(h+w)}else f>y&&(s.charCodeAt(u+w)===47?v=w:w===0&&(v=0));break}var b=s.charCodeAt(u+w),E=a.charCodeAt(h+w);if(b!==E)break;b===47&&(v=w)}var _="";for(w=u+v+1;w<=c;++w)(w===c||s.charCodeAt(w)===47)&&(_.length===0?_+="..":_+="/..");return _.length>0?_+a.slice(h+v):(h+=v,a.charCodeAt(h)===47&&++h,a.slice(h))},_makeLong:function(s){return s},dirname:function(s){if(e(s),s.length===0)return".";for(var a=s.charCodeAt(0),u=a===47,c=-1,f=!0,h=s.length-1;h>=1;--h)if(a=s.charCodeAt(h),a===47){if(!f){c=h;break}}else f=!1;return c===-1?u?"/":".":u&&c===1?"//":s.slice(0,c)},basename:function(s,a){if(a!==void 0&&typeof a!="string")throw new TypeError('"ext" argument must be a string');e(s);var u=0,c=-1,f=!0,h;if(a!==void 0&&a.length>0&&a.length<=s.length){if(a.length===s.length&&a===s)return"";var d=a.length-1,m=-1;for(h=s.length-1;h>=0;--h){var y=s.charCodeAt(h);if(y===47){if(!f){u=h+1;break}}else m===-1&&(f=!1,m=h+1),d>=0&&(y===a.charCodeAt(d)?--d===-1&&(c=h):(d=-1,c=m))}return u===c?c=m:c===-1&&(c=s.length),s.slice(u,c)}else{for(h=s.length-1;h>=0;--h)if(s.charCodeAt(h)===47){if(!f){u=h+1;break}}else c===-1&&(f=!1,c=h+1);return c===-1?"":s.slice(u,c)}},extname:function(s){e(s);for(var a=-1,u=0,c=-1,f=!0,h=0,d=s.length-1;d>=0;--d){var m=s.charCodeAt(d);if(m===47){if(!f){u=d+1;break}continue}c===-1&&(f=!1,c=d+1),m===46?a===-1?a=d:h!==1&&(h=1):a!==-1&&(h=-1)}return a===-1||c===-1||h===0||h===1&&a===c-1&&a===u+1?"":s.slice(a,c)},format:function(s){if(s===null||typeof s!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof s);return n("/",s)},parse:function(s){e(s);var a={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return a;var u=s.charCodeAt(0),c=u===47,f;c?(a.root="/",f=1):f=0;for(var h=-1,d=0,m=-1,y=!0,v=s.length-1,w=0;v>=f;--v){if(u=s.charCodeAt(v),u===47){if(!y){d=v+1;break}continue}m===-1&&(y=!1,m=v+1),u===46?h===-1?h=v:w!==1&&(w=1):h!==-1&&(w=-1)}return h===-1||m===-1||w===0||w===1&&h===m-1&&h===d+1?m!==-1&&(d===0&&c?a.base=a.name=s.slice(1,m):a.base=a.name=s.slice(d,m)):(d===0&&c?(a.name=s.slice(1,h),a.base=s.slice(1,m)):(a.name=s.slice(d,h),a.base=s.slice(d,m)),a.ext=s.slice(h,m)),d>0?a.dir=s.slice(0,d-1):c&&(a.dir="/"),a},sep:"/",delimiter:":",win32:null,posix:null};return i.posix=i,_1=i,_1}function Ku(r){throw new RangeError(v4[r])}function fI(r,e){let t=r.split("@"),n="";t.length>1&&(n=t[0]+"@",r=t[1]);let i=(function(o,s){let a=[],u=o.length;for(;u--;)a[u]=s(o[u]);return a})((r=r.replace(w4,".")).split("."),e).join(".");return n+i}function vI(r){let e=[],t=0,n=r.length;for(;t<n;){let i=r.charCodeAt(t++);if(i>=55296&&i<=56319&&t<n){let o=r.charCodeAt(t++);(64512&o)==56320?e.push(((1023&i)<<10)+(1023&o)+65536):(e.push(i),t--)}else e.push(i)}return e}function _4(r,e){return Object.prototype.hasOwnProperty.call(r,e)}function cs(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function tg(r,e,t){if(r&&fo.isObject(r)&&r instanceof cs)return r;var n=new cs;return n.parse(r,e,t),n}function O4(){if(bI)return T1;bI=!0;var r=hr;function e(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function t(o,s){for(var a="",u=0,c=-1,f=0,h,d=0;d<=o.length;++d){if(d<o.length)h=o.charCodeAt(d);else{if(h===47)break;h=47}if(h===47){if(!(c===d-1||f===1))if(c!==d-1&&f===2){if(a.length<2||u!==2||a.charCodeAt(a.length-1)!==46||a.charCodeAt(a.length-2)!==46){if(a.length>2){var m=a.lastIndexOf("/");if(m!==a.length-1){m===-1?(a="",u=0):(a=a.slice(0,m),u=a.length-1-a.lastIndexOf("/")),c=d,f=0;continue}}else if(a.length===2||a.length===1){a="",u=0,c=d,f=0;continue}}s&&(a.length>0?a+="/..":a="..",u=2)}else a.length>0?a+="/"+o.slice(c+1,d):a=o.slice(c+1,d),u=d-c-1;c=d,f=0}else h===46&&f!==-1?++f:f=-1}return a}function n(o,s){var a=s.dir||s.root,u=s.base||(s.name||"")+(s.ext||"");return a?a===s.root?a+u:a+o+u:u}var i={resolve:function(){for(var s="",a=!1,u,c=arguments.length-1;c>=-1&&!a;c--){var f;c>=0?f=arguments[c]:(u===void 0&&(u=r.cwd()),f=u),e(f),f.length!==0&&(s=f+"/"+s,a=f.charCodeAt(0)===47)}return s=t(s,!a),a?s.length>0?"/"+s:"/":s.length>0?s:"."},normalize:function(s){if(e(s),s.length===0)return".";var a=s.charCodeAt(0)===47,u=s.charCodeAt(s.length-1)===47;return s=t(s,!a),s.length===0&&!a&&(s="."),s.length>0&&u&&(s+="/"),a?"/"+s:s},isAbsolute:function(s){return e(s),s.length>0&&s.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var s,a=0;a<arguments.length;++a){var u=arguments[a];e(u),u.length>0&&(s===void 0?s=u:s+="/"+u)}return s===void 0?".":i.normalize(s)},relative:function(s,a){if(e(s),e(a),s===a||(s=i.resolve(s),a=i.resolve(a),s===a))return"";for(var u=1;u<s.length&&s.charCodeAt(u)===47;++u);for(var c=s.length,f=c-u,h=1;h<a.length&&a.charCodeAt(h)===47;++h);for(var d=a.length,m=d-h,y=f<m?f:m,v=-1,w=0;w<=y;++w){if(w===y){if(m>y){if(a.charCodeAt(h+w)===47)return a.slice(h+w+1);if(w===0)return a.slice(h+w)}else f>y&&(s.charCodeAt(u+w)===47?v=w:w===0&&(v=0));break}var b=s.charCodeAt(u+w),E=a.charCodeAt(h+w);if(b!==E)break;b===47&&(v=w)}var _="";for(w=u+v+1;w<=c;++w)(w===c||s.charCodeAt(w)===47)&&(_.length===0?_+="..":_+="/..");return _.length>0?_+a.slice(h+v):(h+=v,a.charCodeAt(h)===47&&++h,a.slice(h))},_makeLong:function(s){return s},dirname:function(s){if(e(s),s.length===0)return".";for(var a=s.charCodeAt(0),u=a===47,c=-1,f=!0,h=s.length-1;h>=1;--h)if(a=s.charCodeAt(h),a===47){if(!f){c=h;break}}else f=!1;return c===-1?u?"/":".":u&&c===1?"//":s.slice(0,c)},basename:function(s,a){if(a!==void 0&&typeof a!="string")throw new TypeError('"ext" argument must be a string');e(s);var u=0,c=-1,f=!0,h;if(a!==void 0&&a.length>0&&a.length<=s.length){if(a.length===s.length&&a===s)return"";var d=a.length-1,m=-1;for(h=s.length-1;h>=0;--h){var y=s.charCodeAt(h);if(y===47){if(!f){u=h+1;break}}else m===-1&&(f=!1,m=h+1),d>=0&&(y===a.charCodeAt(d)?--d===-1&&(c=h):(d=-1,c=m))}return u===c?c=m:c===-1&&(c=s.length),s.slice(u,c)}else{for(h=s.length-1;h>=0;--h)if(s.charCodeAt(h)===47){if(!f){u=h+1;break}}else c===-1&&(f=!1,c=h+1);return c===-1?"":s.slice(u,c)}},extname:function(s){e(s);for(var a=-1,u=0,c=-1,f=!0,h=0,d=s.length-1;d>=0;--d){var m=s.charCodeAt(d);if(m===47){if(!f){u=d+1;break}continue}c===-1&&(f=!1,c=d+1),m===46?a===-1?a=d:h!==1&&(h=1):a!==-1&&(h=-1)}return a===-1||c===-1||h===0||h===1&&a===c-1&&a===u+1?"":s.slice(a,c)},format:function(s){if(s===null||typeof s!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof s);return n("/",s)},parse:function(s){e(s);var a={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return a;var u=s.charCodeAt(0),c=u===47,f;c?(a.root="/",f=1):f=0;for(var h=-1,d=0,m=-1,y=!0,v=s.length-1,w=0;v>=f;--v){if(u=s.charCodeAt(v),u===47){if(!y){d=v+1;break}continue}m===-1&&(y=!1,m=v+1),u===46?h===-1?h=v:w!==1&&(w=1):h!==-1&&(w=-1)}return h===-1||m===-1||w===0||w===1&&h===m-1&&h===d+1?m!==-1&&(d===0&&c?a.base=a.name=s.slice(1,m):a.base=a.name=s.slice(d,m)):(d===0&&c?(a.name=s.slice(1,h),a.base=s.slice(1,m)):(a.name=s.slice(d,h),a.base=s.slice(d,m)),a.ext=s.slice(h,m)),d>0?a.dir=s.slice(0,d-1):c&&(a.dir="/"),a},sep:"/",delimiter:":",win32:null,posix:null};return i.posix=i,T1=i,T1}function H4(r){if(typeof r=="string")r=new URL(r);else if(!(r instanceof URL))throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");if(r.protocol!=="file:")throw new Deno.errors.InvalidData("invalid url scheme");return R1?q4(r):G4(r)}function q4(r){let e=r.hostname,t=r.pathname;for(let n=0;n<t.length;n++)if(t[n]==="%"){let i=t.codePointAt(n+2)||32;if(t[n+1]==="2"&&i===102||t[n+1]==="5"&&i===99)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(t=t.replace(F4,"\\"),t=decodeURIComponent(t),e!=="")return`\\\\${e}${t}`;{let n=t.codePointAt(1)|32,i=t[2];if(n<M4||n>B4||i!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return t.slice(1)}}function G4(r){if(r.hostname!=="")throw new Deno.errors.InvalidData("invalid file url hostname");let e=r.pathname;for(let t=0;t<e.length;t++)if(e[t]==="%"){let n=e.codePointAt(t+2)||32;if(e[t+1]==="2"&&n===102)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(e)}function V4(r){let e=wI.resolve(r),t=r.charCodeAt(r.length-1);(t===P4||R1&&t===L4)&&e[e.length-1]!==wI.sep&&(e+="/");let n=new URL("file://");return e.includes("%")&&(e=e.replace(U4,"%25")),!R1&&e.includes("\\")&&(e=e.replace(j4,"%5C")),e.includes(`
|
|
72
|
-
`)&&(e=e.replace($4,"%0A")),e.includes("\r")&&(e=e.replace(W4,"%0D")),e.includes(" ")&&(e=e.replace(z4,"%09")),n.pathname=e,n}function s5(r){if(typeof r=="string")r=new URL(r);else if(!(r instanceof URL))throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");if(r.protocol!=="file:")throw new Deno.errors.InvalidData("invalid url scheme");return D1?o5(r):a5(r)}function o5(r){let e=r.hostname,t=r.pathname;for(let n=0;n<t.length;n++)if(t[n]==="%"){let i=t.codePointAt(n+2)||32;if(t[n+1]==="2"&&i===102||t[n+1]==="5"&&i===99)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(t=t.replace(Q4,"\\"),t=decodeURIComponent(t),e!=="")return`\\\\${e}${t}`;{let n=t.codePointAt(1)|32,i=t[2];if(n<Z4||n>J4||i!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return t.slice(1)}}function a5(r){if(r.hostname!=="")throw new Deno.errors.InvalidData("invalid file url hostname");let e=r.pathname;for(let t=0;t<e.length;t++)if(e[t]==="%"){let n=e.codePointAt(t+2)||32;if(e[t+1]==="2"&&n===102)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(e)}function l5(r){let e=an.resolve(r),t=r.charCodeAt(r.length-1);(t===K4||D1&&t===X4)&&e[e.length-1]!==an.sep&&(e+="/");let n=new URL("file://");return e.includes("%")&&(e=e.replace(e5,"%25")),!D1&&e.includes("\\")&&(e=e.replace(t5,"%5C")),e.includes(`
|
|
73
|
-
`)&&(e=e.replace(r5,"%0A")),e.includes("\r")&&(e=e.replace(n5,"%0D")),e.includes(" ")&&(e=e.replace(i5,"%09")),n.pathname=e,n}var _1,cI,an,oh,y4,b4,w4,v4,ho,A1,hI,EI,dI,pI,E4,A4,eg,x4,oa,nr,S4,fo,T4,C4,R4,D4,C1,gI,mI,yI,I4,N4,x1,sh,S1,T1,bI,wI,k4,L4,P4,M4,B4,R1,F4,U4,j4,$4,W4,z4,Y4,X4,K4,Z4,J4,D1,Q4,e5,t5,r5,n5,i5,_I=_t(()=>{Te();Re();Ce();Al();ih();_1={},cI=!1;an=m4(),oh=2147483647,y4=/^xn--/,b4=/[^\0-\x7E]/,w4=/[\x2E\u3002\uFF0E\uFF61]/g,v4={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},ho=Math.floor,A1=String.fromCharCode;hI=function(r,e){return r+22+75*(r<26)-((e!=0)<<5)},EI=function(r,e,t){let n=0;for(r=t?ho(r/700):r>>1,r+=ho(r/e);r>455;n+=36)r=ho(r/35);return ho(n+36*r/(r+38))},dI=function(r){let e=[],t=r.length,n=0,i=128,o=72,s=r.lastIndexOf("-");s<0&&(s=0);for(let u=0;u<s;++u)r.charCodeAt(u)>=128&&Ku("not-basic"),e.push(r.charCodeAt(u));for(let u=s>0?s+1:0;u<t;){let c=n;for(let h=1,d=36;;d+=36){u>=t&&Ku("invalid-input");let m=(a=r.charCodeAt(u++))-48<10?a-22:a-65<26?a-65:a-97<26?a-97:36;(m>=36||m>ho((oh-n)/h))&&Ku("overflow"),n+=m*h;let y=d<=o?1:d>=o+26?26:d-o;if(m<y)break;let v=36-y;h>ho(oh/v)&&Ku("overflow"),h*=v}let f=e.length+1;o=EI(n-c,f,c==0),ho(n/f)>oh-i&&Ku("overflow"),i+=ho(n/f),n%=f,e.splice(n++,0,i)}var a;return String.fromCodePoint(...e)},pI=function(r){let e=[],t=(r=vI(r)).length,n=128,i=0,o=72;for(let u of r)u<128&&e.push(A1(u));let s=e.length,a=s;for(s&&e.push("-");a<t;){let u=oh;for(let f of r)f>=n&&f<u&&(u=f);let c=a+1;u-n>ho((oh-i)/c)&&Ku("overflow"),i+=(u-n)*c,n=u;for(let f of r)if(f<n&&++i>oh&&Ku("overflow"),f==n){let h=i;for(let d=36;;d+=36){let m=d<=o?1:d>=o+26?26:d-o;if(h<m)break;let y=h-m,v=36-m;e.push(A1(hI(m+y%v,0))),h=ho(y/v)}e.push(A1(hI(h,0))),o=EI(i,c,a==s),i=0,++a}++i,++n}return e.join("")},E4={version:"2.1.0",ucs2:{decode:vI,encode:r=>String.fromCodePoint(...r)},decode:dI,encode:pI,toASCII:function(r){return fI(r,(function(e){return b4.test(e)?"xn--"+pI(e):e}))},toUnicode:function(r){return fI(r,(function(e){return y4.test(e)?dI(e.slice(4).toLowerCase()):e}))}};A4=function(r,e,t,n){e=e||"&",t=t||"=";var i={};if(typeof r!="string"||r.length===0)return i;var o=/\+/g;r=r.split(e);var s=1e3;n&&typeof n.maxKeys=="number"&&(s=n.maxKeys);var a=r.length;s>0&&a>s&&(a=s);for(var u=0;u<a;++u){var c,f,h,d,m=r[u].replace(o,"%20"),y=m.indexOf(t);y>=0?(c=m.substr(0,y),f=m.substr(y+1)):(c=m,f=""),h=decodeURIComponent(c),d=decodeURIComponent(f),_4(i,h)?Array.isArray(i[h])?i[h].push(d):i[h]=[i[h],d]:i[h]=d}return i},eg=function(r){switch(typeof r){case"string":return r;case"boolean":return r?"true":"false";case"number":return isFinite(r)?r:"";default:return""}},x4=function(r,e,t,n){return e=e||"&",t=t||"=",r===null&&(r=void 0),typeof r=="object"?Object.keys(r).map((function(i){var o=encodeURIComponent(eg(i))+t;return Array.isArray(r[i])?r[i].map((function(s){return o+encodeURIComponent(eg(s))})).join(e):o+encodeURIComponent(eg(r[i]))})).join(e):n?encodeURIComponent(eg(n))+t+encodeURIComponent(eg(r)):""},oa={};oa.decode=oa.parse=A4,oa.encode=oa.stringify=x4;oa.decode;oa.encode;oa.parse;oa.stringify;nr={},S4=E4,fo={isString:function(r){return typeof r=="string"},isObject:function(r){return typeof r=="object"&&r!==null},isNull:function(r){return r===null},isNullOrUndefined:function(r){return r==null}};nr.parse=tg,nr.resolve=function(r,e){return tg(r,!1,!0).resolve(e)},nr.resolveObject=function(r,e){return r?tg(r,!1,!0).resolveObject(e):e},nr.format=function(r){return fo.isString(r)&&(r=tg(r)),r instanceof cs?r.format():cs.prototype.format.call(r)},nr.Url=cs;T4=/^([a-z0-9.+-]+:)/i,C4=/:[0-9]*$/,R4=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,D4=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
|
|
74
|
-
`," "]),C1=["'"].concat(D4),gI=["%","/","?",";","#"].concat(C1),mI=["/","?","#"],yI=/^[+a-z0-9A-Z_-]{0,63}$/,I4=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,N4={javascript:!0,"javascript:":!0},x1={javascript:!0,"javascript:":!0},sh={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},S1=oa;cs.prototype.parse=function(r,e,t){if(!fo.isString(r))throw new TypeError("Parameter 'url' must be a string, not "+typeof r);var n=r.indexOf("?"),i=n!==-1&&n<r.indexOf("#")?"?":"#",o=r.split(i);o[0]=o[0].replace(/\\/g,"/");var s=r=o.join(i);if(s=s.trim(),!t&&r.split("#").length===1){var a=R4.exec(s);if(a)return this.path=s,this.href=s,this.pathname=a[1],a[2]?(this.search=a[2],this.query=e?S1.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var u=T4.exec(s);if(u){var c=(u=u[0]).toLowerCase();this.protocol=c,s=s.substr(u.length)}if(t||u||s.match(/^\/\/[^@\/]+@[^@\/]+/)){var f=s.substr(0,2)==="//";!f||u&&x1[u]||(s=s.substr(2),this.slashes=!0)}if(!x1[u]&&(f||u&&!sh[u])){for(var h,d,m=-1,y=0;y<mI.length;y++)(v=s.indexOf(mI[y]))!==-1&&(m===-1||v<m)&&(m=v);for((d=m===-1?s.lastIndexOf("@"):s.lastIndexOf("@",m))!==-1&&(h=s.slice(0,d),s=s.slice(d+1),this.auth=decodeURIComponent(h)),m=-1,y=0;y<gI.length;y++){var v;(v=s.indexOf(gI[y]))!==-1&&(m===-1||v<m)&&(m=v)}m===-1&&(m=s.length),this.host=s.slice(0,m),s=s.slice(m),this.parseHost(),this.hostname=this.hostname||"";var w=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!w)for(var b=this.hostname.split(/\./),E=(y=0,b.length);y<E;y++){var _=b[y];if(_&&!_.match(yI)){for(var S="",A=0,F=_.length;A<F;A++)_.charCodeAt(A)>127?S+="x":S+=_[A];if(!S.match(yI)){var I=b.slice(0,y),q=b.slice(y+1),ee=_.match(I4);ee&&(I.push(ee[1]),q.unshift(ee[2])),q.length&&(s="/"+q.join(".")+s),this.hostname=I.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),w||(this.hostname=S4.toASCII(this.hostname));var K=this.port?":"+this.port:"",ne=this.hostname||"";this.host=ne+K,this.href+=this.host,w&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),s[0]!=="/"&&(s="/"+s))}if(!N4[c])for(y=0,E=C1.length;y<E;y++){var L=C1[y];if(s.indexOf(L)!==-1){var $=encodeURIComponent(L);$===L&&($=escape(L)),s=s.split(L).join($)}}var Y=s.indexOf("#");Y!==-1&&(this.hash=s.substr(Y),s=s.slice(0,Y));var ie=s.indexOf("?");if(ie!==-1?(this.search=s.substr(ie),this.query=s.substr(ie+1),e&&(this.query=S1.parse(this.query)),s=s.slice(0,ie)):e&&(this.search="",this.query={}),s&&(this.pathname=s),sh[c]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){K=this.pathname||"";var re=this.search||"";this.path=K+re}return this.href=this.format(),this},cs.prototype.format=function(){var r=this.auth||"";r&&(r=(r=encodeURIComponent(r)).replace(/%3A/i,":"),r+="@");var e=this.protocol||"",t=this.pathname||"",n=this.hash||"",i=!1,o="";this.host?i=r+this.host:this.hostname&&(i=r+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&fo.isObject(this.query)&&Object.keys(this.query).length&&(o=S1.stringify(this.query));var s=this.search||o&&"?"+o||"";return e&&e.substr(-1)!==":"&&(e+=":"),this.slashes||(!e||sh[e])&&i!==!1?(i="//"+(i||""),t&&t.charAt(0)!=="/"&&(t="/"+t)):i||(i=""),n&&n.charAt(0)!=="#"&&(n="#"+n),s&&s.charAt(0)!=="?"&&(s="?"+s),e+i+(t=t.replace(/[?#]/g,(function(a){return encodeURIComponent(a)})))+(s=s.replace("#","%23"))+n},cs.prototype.resolve=function(r){return this.resolveObject(tg(r,!1,!0)).format()},cs.prototype.resolveObject=function(r){if(fo.isString(r)){var e=new cs;e.parse(r,!1,!0),r=e}for(var t=new cs,n=Object.keys(this),i=0;i<n.length;i++){var o=n[i];t[o]=this[o]}if(t.hash=r.hash,r.href==="")return t.href=t.format(),t;if(r.slashes&&!r.protocol){for(var s=Object.keys(r),a=0;a<s.length;a++){var u=s[a];u!=="protocol"&&(t[u]=r[u])}return sh[t.protocol]&&t.hostname&&!t.pathname&&(t.path=t.pathname="/"),t.href=t.format(),t}if(r.protocol&&r.protocol!==t.protocol){if(!sh[r.protocol]){for(var c=Object.keys(r),f=0;f<c.length;f++){var h=c[f];t[h]=r[h]}return t.href=t.format(),t}if(t.protocol=r.protocol,r.host||x1[r.protocol])t.pathname=r.pathname;else{for(var d=(r.pathname||"").split("/");d.length&&!(r.host=d.shift()););r.host||(r.host=""),r.hostname||(r.hostname=""),d[0]!==""&&d.unshift(""),d.length<2&&d.unshift(""),t.pathname=d.join("/")}if(t.search=r.search,t.query=r.query,t.host=r.host||"",t.auth=r.auth,t.hostname=r.hostname||r.host,t.port=r.port,t.pathname||t.search){var m=t.pathname||"",y=t.search||"";t.path=m+y}return t.slashes=t.slashes||r.slashes,t.href=t.format(),t}var v=t.pathname&&t.pathname.charAt(0)==="/",w=r.host||r.pathname&&r.pathname.charAt(0)==="/",b=w||v||t.host&&r.pathname,E=b,_=t.pathname&&t.pathname.split("/")||[],S=(d=r.pathname&&r.pathname.split("/")||[],t.protocol&&!sh[t.protocol]);if(S&&(t.hostname="",t.port=null,t.host&&(_[0]===""?_[0]=t.host:_.unshift(t.host)),t.host="",r.protocol&&(r.hostname=null,r.port=null,r.host&&(d[0]===""?d[0]=r.host:d.unshift(r.host)),r.host=null),b=b&&(d[0]===""||_[0]==="")),w)t.host=r.host||r.host===""?r.host:t.host,t.hostname=r.hostname||r.hostname===""?r.hostname:t.hostname,t.search=r.search,t.query=r.query,_=d;else if(d.length)_||(_=[]),_.pop(),_=_.concat(d),t.search=r.search,t.query=r.query;else if(!fo.isNullOrUndefined(r.search))return S&&(t.hostname=t.host=_.shift(),(ee=!!(t.host&&t.host.indexOf("@")>0)&&t.host.split("@"))&&(t.auth=ee.shift(),t.host=t.hostname=ee.shift())),t.search=r.search,t.query=r.query,fo.isNull(t.pathname)&&fo.isNull(t.search)||(t.path=(t.pathname?t.pathname:"")+(t.search?t.search:"")),t.href=t.format(),t;if(!_.length)return t.pathname=null,t.search?t.path="/"+t.search:t.path=null,t.href=t.format(),t;for(var A=_.slice(-1)[0],F=(t.host||r.host||_.length>1)&&(A==="."||A==="..")||A==="",I=0,q=_.length;q>=0;q--)(A=_[q])==="."?_.splice(q,1):A===".."?(_.splice(q,1),I++):I&&(_.splice(q,1),I--);if(!b&&!E)for(;I--;I)_.unshift("..");!b||_[0]===""||_[0]&&_[0].charAt(0)==="/"||_.unshift(""),F&&_.join("/").substr(-1)!=="/"&&_.push("");var ee,K=_[0]===""||_[0]&&_[0].charAt(0)==="/";return S&&(t.hostname=t.host=K?"":_.length?_.shift():"",(ee=!!(t.host&&t.host.indexOf("@")>0)&&t.host.split("@"))&&(t.auth=ee.shift(),t.host=t.hostname=ee.shift())),(b=b||t.host&&_.length)&&!K&&_.unshift(""),_.length?t.pathname=_.join("/"):(t.pathname=null,t.path=null),fo.isNull(t.pathname)&&fo.isNull(t.search)||(t.path=(t.pathname?t.pathname:"")+(t.search?t.search:"")),t.auth=r.auth||t.auth,t.slashes=t.slashes||r.slashes,t.href=t.format(),t},cs.prototype.parseHost=function(){var r=this.host,e=C4.exec(r);e&&((e=e[0])!==":"&&(this.port=e.substr(1)),r=r.substr(0,r.length-e.length)),r&&(this.hostname=r)};nr.Url;nr.format;nr.resolve;nr.resolveObject;T1={},bI=!1;wI=O4(),k4=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;nr.URL=typeof URL<"u"?URL:null;nr.pathToFileURL=V4;nr.fileURLToPath=H4;nr.Url;nr.format;nr.resolve;nr.resolveObject;nr.URL;L4=92,P4=47,M4=97,B4=122,R1=k4==="win32",F4=/\//g,U4=/%/g,j4=/\\/g,$4=/\n/g,W4=/\r/g,z4=/\t/g;Y4=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;nr.URL=typeof URL<"u"?URL:null;nr.pathToFileURL=l5;nr.fileURLToPath=s5;nr.Url;nr.format;nr.resolve;nr.resolveObject;nr.parse;nr.URL;X4=92,K4=47,Z4=97,J4=122,D1=Y4==="win32",Q4=/\//g,e5=/%/g,t5=/\\/g,r5=/\n/g,n5=/\r/g,i5=/\t/g});function k1(r){throw new Error("Node.js process "+r+" is not supported by JSPM core outside of Node.js")}function u5(){!ah||!Zu||(ah=!1,Zu.length?aa=Zu.concat(aa):bb=-1,aa.length&&AI())}function AI(){if(!ah){var r=setTimeout(u5,0);ah=!0;for(var e=aa.length;e;){for(Zu=aa,aa=[];++bb<e;)Zu&&Zu[bb].run();bb=-1,e=aa.length}Zu=null,ah=!1,clearTimeout(r)}}function c5(r){var e=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)e[t-1]=arguments[t];aa.push(new xI(r,e)),aa.length===1&&!ah&&setTimeout(AI,0)}function xI(r,e){this.fun=r,this.array=e}function Fn(){}function C5(r){k1("_linkedBinding")}function N5(r){k1("dlopen")}function O5(){return[]}function k5(){return[]}function W5(r,e){if(!r)throw new Error(e||"assertion error")}function G5(){return!1}function uU(){return xl.now()/1e3}function O1(r){var e=Math.floor((Date.now()-xl.now())*.001),t=xl.now()*.001,n=Math.floor(t)+e,i=Math.floor(t%1*1e9);return r&&(n=n-r[0],i=i-r[1],i<0&&(n--,i+=N1)),[n,i]}function Sl(){return qr}function EU(r){return[]}var aa,ah,Zu,bb,f5,h5,d5,p5,g5,m5,y5,b5,w5,v5,E5,_5,A5,x5,S5,T5,R5,D5,I5,L5,P5,L1,M5,B5,F5,U5,j5,$5,z5,H5,q5,V5,Y5,X5,K5,Z5,J5,Q5,eU,tU,rU,nU,iU,sU,oU,aU,lU,xl,I1,N1,cU,fU,hU,dU,pU,gU,mU,yU,bU,wU,vU,qr,Ju=_t(()=>{Te();Re();Ce();aa=[],ah=!1,bb=-1;xI.prototype.run=function(){this.fun.apply(null,this.array)};f5="browser",h5="x64",d5="browser",p5={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},g5=["/usr/bin/node"],m5=[],y5="v16.8.0",b5={},w5=function(r,e){console.warn((e?e+": ":"")+r)},v5=function(r){k1("binding")},E5=function(r){return 0},_5=function(){return"/"},A5=function(r){},x5={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};S5=Fn,T5=[];R5={},D5=!1,I5={};L5=Fn,P5=Fn,L1=function(){return{}},M5=L1,B5=L1,F5=Fn,U5=Fn,j5=Fn,$5={};z5={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},H5=Fn,q5=Fn;V5=Fn,Y5=Fn,X5=Fn,K5=Fn,Z5=Fn,J5=void 0,Q5=void 0,eU=void 0,tU=Fn,rU=2,nU=1,iU="/bin/usr/node",sU=9229,oU="node",aU=[],lU=Fn,xl={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};xl.now===void 0&&(I1=Date.now(),xl.timing&&xl.timing.navigationStart&&(I1=xl.timing.navigationStart),xl.now=()=>Date.now()-I1);N1=1e9;O1.bigint=function(r){var e=O1(r);return typeof BigInt>"u"?e[0]*N1+e[1]:BigInt(e[0]*N1)+BigInt(e[1])};cU=10,fU={},hU=0;dU=Sl,pU=Sl,gU=Sl,mU=Sl,yU=Sl,bU=Fn,wU=Sl,vU=Sl;qr={version:y5,versions:b5,arch:h5,platform:d5,release:x5,_rawDebug:S5,moduleLoadList:T5,binding:v5,_linkedBinding:C5,_events:fU,_eventsCount:hU,_maxListeners:cU,on:Sl,addListener:dU,once:pU,off:gU,removeListener:mU,removeAllListeners:yU,emit:bU,prependListener:wU,prependOnceListener:vU,listeners:EU,domain:R5,_exiting:D5,config:I5,dlopen:N5,uptime:uU,_getActiveRequests:O5,_getActiveHandles:k5,reallyExit:L5,_kill:P5,cpuUsage:L1,resourceUsage:M5,memoryUsage:B5,kill:F5,exit:U5,openStdin:j5,allowedNodeEnvironmentFlags:$5,assert:W5,features:z5,_fatalExceptions:H5,setUncaughtExceptionCaptureCallback:q5,hasUncaughtExceptionCaptureCallback:G5,emitWarning:w5,nextTick:c5,_tickCallback:V5,_debugProcess:Y5,_debugEnd:X5,_startProfilerIdleNotifier:K5,_stopProfilerIdleNotifier:Z5,stdout:J5,stdin:eU,stderr:Q5,abort:tU,umask:E5,chdir:A5,cwd:_5,env:p5,title:f5,argv:g5,execArgv:m5,pid:rU,ppid:nU,execPath:iU,debugPort:sU,hrtime:O1,argv0:oU,_preload_modules:aU,setSourceMapsEnabled:lU}});function ir(){ir.init.call(this)}function wb(r){if(typeof r!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r)}function LI(r){return r._maxListeners===void 0?ir.defaultMaxListeners:r._maxListeners}function RI(r,e,t,n){var i,o,s,a;if(wb(t),(o=r._events)===void 0?(o=r._events=Object.create(null),r._eventsCount=0):(o.newListener!==void 0&&(r.emit("newListener",e,t.listener?t.listener:t),o=r._events),s=o[e]),s===void 0)s=o[e]=t,++r._eventsCount;else if(typeof s=="function"?s=o[e]=n?[t,s]:[s,t]:n?s.unshift(t):s.push(t),(i=LI(r))>0&&s.length>i&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=r,u.type=e,u.count=s.length,a=u,console&&console.warn&&console.warn(a)}return r}function _U(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function DI(r,e,t){var n={fired:!1,wrapFn:void 0,target:r,type:e,listener:t},i=_U.bind(n);return i.listener=t,n.wrapFn=i,i}function II(r,e,t){var n=r._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?t?[i.listener||i]:[i]:t?(function(o){for(var s=new Array(o.length),a=0;a<s.length;++a)s[a]=o[a].listener||o[a];return s})(i):PI(i,i.length)}function NI(r){var e=this._events;if(e!==void 0){var t=e[r];if(typeof t=="function")return 1;if(t!==void 0)return t.length}return 0}function PI(r,e){for(var t=new Array(e),n=0;n<e;++n)t[n]=r[n];return t}var OI,kI,lh,SI,TI,CI,ln,uh=_t(()=>{Te();Re();Ce();lh=typeof Reflect=="object"?Reflect:null,SI=lh&&typeof lh.apply=="function"?lh.apply:function(r,e,t){return Function.prototype.apply.call(r,e,t)};kI=lh&&typeof lh.ownKeys=="function"?lh.ownKeys:Object.getOwnPropertySymbols?function(r){return Object.getOwnPropertyNames(r).concat(Object.getOwnPropertySymbols(r))}:function(r){return Object.getOwnPropertyNames(r)};TI=Number.isNaN||function(r){return r!=r};OI=ir,ir.EventEmitter=ir,ir.prototype._events=void 0,ir.prototype._eventsCount=0,ir.prototype._maxListeners=void 0;CI=10;Object.defineProperty(ir,"defaultMaxListeners",{enumerable:!0,get:function(){return CI},set:function(r){if(typeof r!="number"||r<0||TI(r))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");CI=r}}),ir.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},ir.prototype.setMaxListeners=function(r){if(typeof r!="number"||r<0||TI(r))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+r+".");return this._maxListeners=r,this},ir.prototype.getMaxListeners=function(){return LI(this)},ir.prototype.emit=function(r){for(var e=[],t=1;t<arguments.length;t++)e.push(arguments[t]);var n=r==="error",i=this._events;if(i!==void 0)n=n&&i.error===void 0;else if(!n)return!1;if(n){var o;if(e.length>0&&(o=e[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var a=i[r];if(a===void 0)return!1;if(typeof a=="function")SI(a,this,e);else{var u=a.length,c=PI(a,u);for(t=0;t<u;++t)SI(c[t],this,e)}return!0},ir.prototype.addListener=function(r,e){return RI(this,r,e,!1)},ir.prototype.on=ir.prototype.addListener,ir.prototype.prependListener=function(r,e){return RI(this,r,e,!0)},ir.prototype.once=function(r,e){return wb(e),this.on(r,DI(this,r,e)),this},ir.prototype.prependOnceListener=function(r,e){return wb(e),this.prependListener(r,DI(this,r,e)),this},ir.prototype.removeListener=function(r,e){var t,n,i,o,s;if(wb(e),(n=this._events)===void 0)return this;if((t=n[r])===void 0)return this;if(t===e||t.listener===e)--this._eventsCount==0?this._events=Object.create(null):(delete n[r],n.removeListener&&this.emit("removeListener",r,t.listener||e));else if(typeof t!="function"){for(i=-1,o=t.length-1;o>=0;o--)if(t[o]===e||t[o].listener===e){s=t[o].listener,i=o;break}if(i<0)return this;i===0?t.shift():(function(a,u){for(;u+1<a.length;u++)a[u]=a[u+1];a.pop()})(t,i),t.length===1&&(n[r]=t[0]),n.removeListener!==void 0&&this.emit("removeListener",r,s||e)}return this},ir.prototype.off=ir.prototype.removeListener,ir.prototype.removeAllListeners=function(r){var e,t,n;if((t=this._events)===void 0)return this;if(t.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):t[r]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete t[r]),this;if(arguments.length===0){var i,o=Object.keys(t);for(n=0;n<o.length;++n)(i=o[n])!=="removeListener"&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(e=t[r])=="function")this.removeListener(r,e);else if(e!==void 0)for(n=e.length-1;n>=0;n--)this.removeListener(r,e[n]);return this},ir.prototype.listeners=function(r){return II(this,r,!0)},ir.prototype.rawListeners=function(r){return II(this,r,!1)},ir.listenerCount=function(r,e){return typeof r.listenerCount=="function"?r.listenerCount(e):NI.call(r,e)},ir.prototype.listenerCount=NI,ir.prototype.eventNames=function(){return this._eventsCount>0?kI(this._events):[]};ln=OI;ln.EventEmitter;ln.defaultMaxListeners;ln.init;ln.listenerCount;ln.EventEmitter;ln.defaultMaxListeners;ln.init;ln.listenerCount});var vb=_t(()=>{Te();Re();Ce();uh();ln.once=function(r,e){return new Promise((t,n)=>{function i(...s){o!==void 0&&r.removeListener("error",o),t(s)}let o;e!=="error"&&(o=s=>{r.removeListener(name,i),n(s)},r.once("error",o)),r.once(e,i)})};ln.on=function(r,e){let t=[],n=[],i=null,o=!1,s={async next(){let c=t.shift();if(c)return createIterResult(c,!1);if(i){let f=Promise.reject(i);return i=null,f}return o?createIterResult(void 0,!0):new Promise((f,h)=>n.push({resolve:f,reject:h}))},async return(){r.removeListener(e,a),r.removeListener("error",u),o=!0;for(let c of n)c.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)},throw(c){i=c,r.removeListener(e,a),r.removeListener("error",u)},[Symbol.asyncIterator](){return this}};return r.on(e,a),r.on("error",u),s;function a(...c){let f=n.shift();f?f.resolve(createIterResult(c,!1)):t.push(c)}function u(c){o=!0;let f=n.shift();f?f.reject(c):i=c,s.return()}}});function FI(r){var e=r.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=r.indexOf("=");return t===-1&&(t=e),[t,t===e?0:4-t%4]}function AU(r,e,t){for(var n,i,o=[],s=e;s<t;s+=3)n=(r[s]<<16&16711680)+(r[s+1]<<8&65280)+(255&r[s+2]),o.push(Fs[(i=n)>>18&63]+Fs[i>>12&63]+Fs[i>>6&63]+Fs[63&i]);return o.join("")}function la(r){if(r>2147483647)throw new RangeError('The value "'+r+'" is invalid for option "size"');var e=new Uint8Array(r);return Object.setPrototypeOf(e,Ke.prototype),e}function Ke(r,e,t){if(typeof r=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return e2(r)}return dN(r,e,t)}function dN(r,e,t){if(typeof r=="string")return(function(o,s){if(typeof s=="string"&&s!==""||(s="utf8"),!Ke.isEncoding(s))throw new TypeError("Unknown encoding: "+s);var a=0|gN(o,s),u=la(a),c=u.write(o,s);return c!==a&&(u=u.slice(0,c)),u})(r,e);if(ArrayBuffer.isView(r))return P1(r);if(r==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(ua(r,ArrayBuffer)||r&&ua(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ua(r,SharedArrayBuffer)||r&&ua(r.buffer,SharedArrayBuffer)))return jI(r,e,t);if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var n=r.valueOf&&r.valueOf();if(n!=null&&n!==r)return Ke.from(n,e,t);var i=(function(o){if(Ke.isBuffer(o)){var s=0|i2(o.length),a=la(s);return a.length===0||o.copy(a,0,0,s),a}if(o.length!==void 0)return typeof o.length!="number"||s2(o.length)?la(0):P1(o);if(o.type==="Buffer"&&Array.isArray(o.data))return P1(o.data)})(r);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return Ke.from(r[Symbol.toPrimitive]("string"),e,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}function pN(r){if(typeof r!="number")throw new TypeError('"size" argument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is invalid for option "size"')}function e2(r){return pN(r),la(r<0?0:0|i2(r))}function P1(r){for(var e=r.length<0?0:0|i2(r.length),t=la(e),n=0;n<e;n+=1)t[n]=255&r[n];return t}function jI(r,e,t){if(e<0||r.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(r.byteLength<e+(t||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=e===void 0&&t===void 0?new Uint8Array(r):t===void 0?new Uint8Array(r,e):new Uint8Array(r,e,t),Object.setPrototypeOf(n,Ke.prototype),n}function i2(r){if(r>=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|r}function gN(r,e){if(Ke.isBuffer(r))return r.length;if(ArrayBuffer.isView(r)||ua(r,ArrayBuffer))return r.byteLength;if(typeof r!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof r);var t=r.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&t===0)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return t2(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*t;case"hex":return t>>>1;case"base64":return wN(r).length;default:if(i)return n?-1:t2(r).length;e=(""+e).toLowerCase(),i=!0}}function SU(r,e,t){var n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0)<=(e>>>=0))return"";for(r||(r="utf8");;)switch(r){case"hex":return LU(this,e,t);case"utf8":case"utf-8":return yN(this,e,t);case"ascii":return OU(this,e,t);case"latin1":case"binary":return kU(this,e,t);case"base64":return NU(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return PU(this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}function ec(r,e,t){var n=r[e];r[e]=r[t],r[t]=n}function $I(r,e,t,n,i){if(r.length===0)return-1;if(typeof t=="string"?(n=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),s2(t=+t)&&(t=i?0:r.length-1),t<0&&(t=r.length+t),t>=r.length){if(i)return-1;t=r.length-1}else if(t<0){if(!i)return-1;t=0}if(typeof e=="string"&&(e=Ke.from(e,n)),Ke.isBuffer(e))return e.length===0?-1:WI(r,e,t,n,i);if(typeof e=="number")return e&=255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):WI(r,[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}function WI(r,e,t,n,i){var o,s=1,a=r.length,u=e.length;if(n!==void 0&&((n=String(n).toLowerCase())==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(r.length<2||e.length<2)return-1;s=2,a/=2,u/=2,t/=2}function c(m,y){return s===1?m[y]:m.readUInt16BE(y*s)}if(i){var f=-1;for(o=t;o<a;o++)if(c(r,o)===c(e,f===-1?0:o-f)){if(f===-1&&(f=o),o-f+1===u)return f*s}else f!==-1&&(o-=o-f),f=-1}else for(t+u>a&&(t=a-u),o=t;o>=0;o--){for(var h=!0,d=0;d<u;d++)if(c(r,o+d)!==c(e,d)){h=!1;break}if(h)return o}return-1}function TU(r,e,t,n){t=Number(t)||0;var i=r.length-t;n?(n=Number(n))>i&&(n=i):n=i;var o=e.length;n>o/2&&(n=o/2);for(var s=0;s<n;++s){var a=parseInt(e.substr(2*s,2),16);if(s2(a))return s;r[t+s]=a}return s}function CU(r,e,t,n){return Tb(t2(e,r.length-t),r,t,n)}function mN(r,e,t,n){return Tb((function(i){for(var o=[],s=0;s<i.length;++s)o.push(255&i.charCodeAt(s));return o})(e),r,t,n)}function RU(r,e,t,n){return mN(r,e,t,n)}function DU(r,e,t,n){return Tb(wN(e),r,t,n)}function IU(r,e,t,n){return Tb((function(i,o){for(var s,a,u,c=[],f=0;f<i.length&&!((o-=2)<0);++f)s=i.charCodeAt(f),a=s>>8,u=s%256,c.push(u),c.push(a);return c})(e,r.length-t),r,t,n)}function NU(r,e,t){return e===0&&t===r.length?Q1.fromByteArray(r):Q1.fromByteArray(r.slice(e,t))}function yN(r,e,t){t=Math.min(r.length,t);for(var n=[],i=e;i<t;){var o,s,a,u,c=r[i],f=null,h=c>239?4:c>223?3:c>191?2:1;if(i+h<=t)switch(h){case 1:c<128&&(f=c);break;case 2:(192&(o=r[i+1]))==128&&(u=(31&c)<<6|63&o)>127&&(f=u);break;case 3:o=r[i+1],s=r[i+2],(192&o)==128&&(192&s)==128&&(u=(15&c)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:o=r[i+1],s=r[i+2],a=r[i+3],(192&o)==128&&(192&s)==128&&(192&a)==128&&(u=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(f=u)}f===null?(f=65533,h=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=h}return(function(d){var m=d.length;if(m<=4096)return String.fromCharCode.apply(String,d);for(var y="",v=0;v<m;)y+=String.fromCharCode.apply(String,d.slice(v,v+=4096));return y})(n)}function OU(r,e,t){var n="";t=Math.min(r.length,t);for(var i=e;i<t;++i)n+=String.fromCharCode(127&r[i]);return n}function kU(r,e,t){var n="";t=Math.min(r.length,t);for(var i=e;i<t;++i)n+=String.fromCharCode(r[i]);return n}function LU(r,e,t){var n=r.length;(!e||e<0)&&(e=0),(!t||t<0||t>n)&&(t=n);for(var i="",o=e;o<t;++o)i+=BU[r[o]];return i}function PU(r,e,t){for(var n=r.slice(e,t),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function mn(r,e,t){if(r%1!=0||r<0)throw new RangeError("offset is not uint");if(r+e>t)throw new RangeError("Trying to access beyond buffer length")}function ai(r,e,t,n,i,o){if(!Ke.isBuffer(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(t+n>r.length)throw new RangeError("Index out of range")}function bN(r,e,t,n,i,o){if(t+n>r.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function zI(r,e,t,n,i){return e=+e,t>>>=0,i||bN(r,0,t,4),ch.write(r,e,t,n,23,4),t+4}function HI(r,e,t,n,i){return e=+e,t>>>=0,i||bN(r,0,t,8),ch.write(r,e,t,n,52,8),t+8}function t2(r,e){var t;e=e||1/0;for(var n=r.length,i=null,o=[],s=0;s<n;++s){if((t=r.charCodeAt(s))>55295&&t<57344){if(!i){if(t>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=t;continue}if(t<56320){(e-=3)>-1&&o.push(239,191,189),i=t;continue}t=65536+(i-55296<<10|t-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,t<128){if((e-=1)<0)break;o.push(t)}else if(t<2048){if((e-=2)<0)break;o.push(t>>6|192,63&t|128)}else if(t<65536){if((e-=3)<0)break;o.push(t>>12|224,t>>6&63|128,63&t|128)}else{if(!(t<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(t>>18|240,t>>12&63|128,t>>6&63|128,63&t|128)}}return o}function wN(r){return Q1.toByteArray((function(e){if((e=(e=e.split("=")[0]).trim().replace(MU,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e})(r))}function Tb(r,e,t,n){for(var i=0;i<n&&!(i+t>=e.length||i>=r.length);++i)e[i+t]=r[i];return i}function ua(r,e){return r instanceof e||r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===e.name}function s2(r){return r!=r}function qI(r,e){for(var t in r)e[t]=r[t]}function tc(r,e,t){return po(r,e,t)}function rg(r){var e;switch(this.encoding=(function(t){var n=(function(i){if(!i)return"utf8";for(var o;;)switch(i){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 i;default:if(o)return;i=(""+i).toLowerCase(),o=!0}})(t);if(typeof n!="string"&&(n2.isEncoding===GI||!GI(t)))throw new Error("Unknown encoding: "+t);return n||t})(r),this.encoding){case"utf16le":this.text=jU,this.end=$U,e=4;break;case"utf8":this.fillLast=UU,e=4;break;case"base64":this.text=WU,this.end=zU,e=3;break;default:return this.write=HU,this.end=qU,void 0}this.lastNeed=0,this.lastTotal=0,this.lastChar=n2.allocUnsafe(e)}function M1(r){return r<=127?0:r>>5==6?2:r>>4==14?3:r>>3==30?4:r>>6==2?-1:-2}function UU(r){var e=this.lastTotal-this.lastNeed,t=(function(n,i,o){if((192&i[0])!=128)return n.lastNeed=0,"\uFFFD";if(n.lastNeed>1&&i.length>1){if((192&i[1])!=128)return n.lastNeed=1,"\uFFFD";if(n.lastNeed>2&&i.length>2&&(192&i[2])!=128)return n.lastNeed=2,"\uFFFD"}})(this,r);return t!==void 0?t:this.lastNeed<=r.length?(r.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(r.copy(this.lastChar,e,0,r.length),this.lastNeed-=r.length,void 0)}function jU(r,e){if((r.length-e)%2==0){var t=r.toString("utf16le",e);if(t){var n=t.charCodeAt(t.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=r[r.length-2],this.lastChar[1]=r[r.length-1],t.slice(0,-1)}return t}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=r[r.length-1],r.toString("utf16le",e,r.length-1)}function $U(r){var e=r&&r.length?this.write(r):"";if(this.lastNeed){var t=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,t)}return e}function WU(r,e){var t=(r.length-e)%3;return t===0?r.toString("base64",e):(this.lastNeed=3-t,this.lastTotal=3,t===1?this.lastChar[0]=r[r.length-1]:(this.lastChar[0]=r[r.length-2],this.lastChar[1]=r[r.length-1]),r.toString("base64",e,r.length-t))}function zU(r){var e=r&&r.length?this.write(r):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function HU(r){return r.toString(this.encoding)}function qU(r){return r&&r.length?this.write(r):""}function GU(){if(VI)return ng;VI=!0,ng.byteLength=a,ng.toByteArray=c,ng.fromByteArray=d;for(var r=[],e=[],t=typeof Uint8Array<"u"?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,o=n.length;i<o;++i)r[i]=n[i],e[n.charCodeAt(i)]=i;e[45]=62,e[95]=63;function s(m){var y=m.length;if(y%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var v=m.indexOf("=");v===-1&&(v=y);var w=v===y?0:4-v%4;return[v,w]}function a(m){var y=s(m),v=y[0],w=y[1];return(v+w)*3/4-w}function u(m,y,v){return(y+v)*3/4-v}function c(m){var y,v=s(m),w=v[0],b=v[1],E=new t(u(m,w,b)),_=0,S=b>0?w-4:w,A;for(A=0;A<S;A+=4)y=e[m.charCodeAt(A)]<<18|e[m.charCodeAt(A+1)]<<12|e[m.charCodeAt(A+2)]<<6|e[m.charCodeAt(A+3)],E[_++]=y>>16&255,E[_++]=y>>8&255,E[_++]=y&255;return b===2&&(y=e[m.charCodeAt(A)]<<2|e[m.charCodeAt(A+1)]>>4,E[_++]=y&255),b===1&&(y=e[m.charCodeAt(A)]<<10|e[m.charCodeAt(A+1)]<<4|e[m.charCodeAt(A+2)]>>2,E[_++]=y>>8&255,E[_++]=y&255),E}function f(m){return r[m>>18&63]+r[m>>12&63]+r[m>>6&63]+r[m&63]}function h(m,y,v){for(var w,b=[],E=y;E<v;E+=3)w=(m[E]<<16&16711680)+(m[E+1]<<8&65280)+(m[E+2]&255),b.push(f(w));return b.join("")}function d(m){for(var y,v=m.length,w=v%3,b=[],E=16383,_=0,S=v-w;_<S;_+=E)b.push(h(m,_,_+E>S?S:_+E));return w===1?(y=m[v-1],b.push(r[y>>2]+r[y<<4&63]+"==")):w===2&&(y=(m[v-2]<<8)+m[v-1],b.push(r[y>>10]+r[y>>4&63]+r[y<<2&63]+"=")),b.join("")}return ng}function VU(){if(YI)return _b;YI=!0;return _b.read=function(r,e,t,n,i){var o,s,a=i*8-n-1,u=(1<<a)-1,c=u>>1,f=-7,h=t?i-1:0,d=t?-1:1,m=r[e+h];for(h+=d,o=m&(1<<-f)-1,m>>=-f,f+=a;f>0;o=o*256+r[e+h],h+=d,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=s*256+r[e+h],h+=d,f-=8);if(o===0)o=1-c;else{if(o===u)return s?NaN:(m?-1:1)*(1/0);s=s+Math.pow(2,n),o=o-c}return(m?-1:1)*s*Math.pow(2,o-n)},_b.write=function(r,e,t,n,i,o){var s,a,u,c=o*8-i-1,f=(1<<c)-1,h=f>>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=n?0:o-1,y=n?1:-1,v=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),s+h>=1?e+=d/u:e+=d*Math.pow(2,1-h),e*u>=2&&(s++,u/=2),s+h>=f?(a=0,s=f):s+h>=1?(a=(e*u-1)*Math.pow(2,i),s=s+h):(a=e*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;r[t+m]=a&255,m+=y,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;r[t+m]=s&255,m+=y,s/=256,c-=8);r[t+m-y]|=v*128},_b}function YU(){if(XI)return rc;XI=!0;let r=GU(),e=VU(),t=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;rc.Buffer=s,rc.SlowBuffer=b,rc.INSPECT_MAX_BYTES=50;let n=2147483647;rc.kMaxLength=n,s.TYPED_ARRAY_SUPPORT=i(),!s.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 i(){try{let T=new Uint8Array(1),g={foo:function(){return 42}};return Object.setPrototypeOf(g,Uint8Array.prototype),Object.setPrototypeOf(T,g),T.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function o(T){if(T>n)throw new RangeError('The value "'+T+'" is invalid for option "size"');let g=new Uint8Array(T);return Object.setPrototypeOf(g,s.prototype),g}function s(T,g,p){if(typeof T=="number"){if(typeof g=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return f(T)}return a(T,g,p)}s.poolSize=8192;function a(T,g,p){if(typeof T=="string")return h(T,g);if(ArrayBuffer.isView(T))return m(T);if(T==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T);if(ke(T,ArrayBuffer)||T&&ke(T.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ke(T,SharedArrayBuffer)||T&&ke(T.buffer,SharedArrayBuffer)))return y(T,g,p);if(typeof T=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let R=T.valueOf&&T.valueOf();if(R!=null&&R!==T)return s.from(R,g,p);let J=v(T);if(J)return J;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof T[Symbol.toPrimitive]=="function")return s.from(T[Symbol.toPrimitive]("string"),g,p);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T)}s.from=function(T,g,p){return a(T,g,p)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function u(T){if(typeof T!="number")throw new TypeError('"size" argument must be of type number');if(T<0)throw new RangeError('The value "'+T+'" is invalid for option "size"')}function c(T,g,p){return u(T),T<=0?o(T):g!==void 0?typeof p=="string"?o(T).fill(g,p):o(T).fill(g):o(T)}s.alloc=function(T,g,p){return c(T,g,p)};function f(T){return u(T),o(T<0?0:w(T)|0)}s.allocUnsafe=function(T){return f(T)},s.allocUnsafeSlow=function(T){return f(T)};function h(T,g){if((typeof g!="string"||g==="")&&(g="utf8"),!s.isEncoding(g))throw new TypeError("Unknown encoding: "+g);let p=E(T,g)|0,R=o(p),J=R.write(T,g);return J!==p&&(R=R.slice(0,J)),R}function d(T){let g=T.length<0?0:w(T.length)|0,p=o(g);for(let R=0;R<g;R+=1)p[R]=T[R]&255;return p}function m(T){if(ke(T,Uint8Array)){let g=new Uint8Array(T);return y(g.buffer,g.byteOffset,g.byteLength)}return d(T)}function y(T,g,p){if(g<0||T.byteLength<g)throw new RangeError('"offset" is outside of buffer bounds');if(T.byteLength<g+(p||0))throw new RangeError('"length" is outside of buffer bounds');let R;return g===void 0&&p===void 0?R=new Uint8Array(T):p===void 0?R=new Uint8Array(T,g):R=new Uint8Array(T,g,p),Object.setPrototypeOf(R,s.prototype),R}function v(T){if(s.isBuffer(T)){let g=w(T.length)|0,p=o(g);return p.length===0||T.copy(p,0,0,g),p}if(T.length!==void 0)return typeof T.length!="number"||Ne(T.length)?o(0):d(T);if(T.type==="Buffer"&&Array.isArray(T.data))return d(T.data)}function w(T){if(T>=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return T|0}function b(T){return+T!=T&&(T=0),s.alloc(+T)}s.isBuffer=function(g){return g!=null&&g._isBuffer===!0&&g!==s.prototype},s.compare=function(g,p){if(ke(g,Uint8Array)&&(g=s.from(g,g.offset,g.byteLength)),ke(p,Uint8Array)&&(p=s.from(p,p.offset,p.byteLength)),!s.isBuffer(g)||!s.isBuffer(p))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(g===p)return 0;let R=g.length,J=p.length;for(let D=0,le=Math.min(R,J);D<le;++D)if(g[D]!==p[D]){R=g[D],J=p[D];break}return R<J?-1:J<R?1:0},s.isEncoding=function(g){switch(String(g).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}},s.concat=function(g,p){if(!Array.isArray(g))throw new TypeError('"list" argument must be an Array of Buffers');if(g.length===0)return s.alloc(0);let R;if(p===void 0)for(p=0,R=0;R<g.length;++R)p+=g[R].length;let J=s.allocUnsafe(p),D=0;for(R=0;R<g.length;++R){let le=g[R];if(ke(le,Uint8Array))D+le.length>J.length?(s.isBuffer(le)||(le=s.from(le)),le.copy(J,D)):Uint8Array.prototype.set.call(J,le,D);else if(s.isBuffer(le))le.copy(J,D);else throw new TypeError('"list" argument must be an Array of Buffers');D+=le.length}return J};function E(T,g){if(s.isBuffer(T))return T.length;if(ArrayBuffer.isView(T)||ke(T,ArrayBuffer))return T.byteLength;if(typeof T!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof T);let p=T.length,R=arguments.length>2&&arguments[2]===!0;if(!R&&p===0)return 0;let J=!1;for(;;)switch(g){case"ascii":case"latin1":case"binary":return p;case"utf8":case"utf-8":return Se(T).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return p*2;case"hex":return p>>>1;case"base64":return Ae(T).length;default:if(J)return R?-1:Se(T).length;g=(""+g).toLowerCase(),J=!0}}s.byteLength=E;function _(T,g,p){let R=!1;if((g===void 0||g<0)&&(g=0),g>this.length||((p===void 0||p>this.length)&&(p=this.length),p<=0)||(p>>>=0,g>>>=0,p<=g))return"";for(T||(T="utf8");;)switch(T){case"hex":return x(this,g,p);case"utf8":case"utf-8":return $(this,g,p);case"ascii":return re(this,g,p);case"latin1":case"binary":return k(this,g,p);case"base64":return L(this,g,p);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,g,p);default:if(R)throw new TypeError("Unknown encoding: "+T);T=(T+"").toLowerCase(),R=!0}}s.prototype._isBuffer=!0;function S(T,g,p){let R=T[g];T[g]=T[p],T[p]=R}s.prototype.swap16=function(){let g=this.length;if(g%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let p=0;p<g;p+=2)S(this,p,p+1);return this},s.prototype.swap32=function(){let g=this.length;if(g%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let p=0;p<g;p+=4)S(this,p,p+3),S(this,p+1,p+2);return this},s.prototype.swap64=function(){let g=this.length;if(g%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let p=0;p<g;p+=8)S(this,p,p+7),S(this,p+1,p+6),S(this,p+2,p+5),S(this,p+3,p+4);return this},s.prototype.toString=function(){let g=this.length;return g===0?"":arguments.length===0?$(this,0,g):_.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(g){if(!s.isBuffer(g))throw new TypeError("Argument must be a Buffer");return this===g?!0:s.compare(this,g)===0},s.prototype.inspect=function(){let g="",p=rc.INSPECT_MAX_BYTES;return g=this.toString("hex",0,p).replace(/(.{2})/g,"$1 ").trim(),this.length>p&&(g+=" ... "),"<Buffer "+g+">"},t&&(s.prototype[t]=s.prototype.inspect),s.prototype.compare=function(g,p,R,J,D){if(ke(g,Uint8Array)&&(g=s.from(g,g.offset,g.byteLength)),!s.isBuffer(g))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof g);if(p===void 0&&(p=0),R===void 0&&(R=g?g.length:0),J===void 0&&(J=0),D===void 0&&(D=this.length),p<0||R>g.length||J<0||D>this.length)throw new RangeError("out of range index");if(J>=D&&p>=R)return 0;if(J>=D)return-1;if(p>=R)return 1;if(p>>>=0,R>>>=0,J>>>=0,D>>>=0,this===g)return 0;let le=D-J,he=R-p,_e=Math.min(le,he),ve=this.slice(J,D),Ie=g.slice(p,R);for(let Z=0;Z<_e;++Z)if(ve[Z]!==Ie[Z]){le=ve[Z],he=Ie[Z];break}return le<he?-1:he<le?1:0};function A(T,g,p,R,J){if(T.length===0)return-1;if(typeof p=="string"?(R=p,p=0):p>2147483647?p=2147483647:p<-2147483648&&(p=-2147483648),p=+p,Ne(p)&&(p=J?0:T.length-1),p<0&&(p=T.length+p),p>=T.length){if(J)return-1;p=T.length-1}else if(p<0)if(J)p=0;else return-1;if(typeof g=="string"&&(g=s.from(g,R)),s.isBuffer(g))return g.length===0?-1:F(T,g,p,R,J);if(typeof g=="number")return g=g&255,typeof Uint8Array.prototype.indexOf=="function"?J?Uint8Array.prototype.indexOf.call(T,g,p):Uint8Array.prototype.lastIndexOf.call(T,g,p):F(T,[g],p,R,J);throw new TypeError("val must be string, number or Buffer")}function F(T,g,p,R,J){let D=1,le=T.length,he=g.length;if(R!==void 0&&(R=String(R).toLowerCase(),R==="ucs2"||R==="ucs-2"||R==="utf16le"||R==="utf-16le")){if(T.length<2||g.length<2)return-1;D=2,le/=2,he/=2,p/=2}function _e(Ie,Z){return D===1?Ie[Z]:Ie.readUInt16BE(Z*D)}let ve;if(J){let Ie=-1;for(ve=p;ve<le;ve++)if(_e(T,ve)===_e(g,Ie===-1?0:ve-Ie)){if(Ie===-1&&(Ie=ve),ve-Ie+1===he)return Ie*D}else Ie!==-1&&(ve-=ve-Ie),Ie=-1}else for(p+he>le&&(p=le-he),ve=p;ve>=0;ve--){let Ie=!0;for(let Z=0;Z<he;Z++)if(_e(T,ve+Z)!==_e(g,Z)){Ie=!1;break}if(Ie)return ve}return-1}s.prototype.includes=function(g,p,R){return this.indexOf(g,p,R)!==-1},s.prototype.indexOf=function(g,p,R){return A(this,g,p,R,!0)},s.prototype.lastIndexOf=function(g,p,R){return A(this,g,p,R,!1)};function I(T,g,p,R){p=Number(p)||0;let J=T.length-p;R?(R=Number(R),R>J&&(R=J)):R=J;let D=g.length;R>D/2&&(R=D/2);let le;for(le=0;le<R;++le){let he=parseInt(g.substr(le*2,2),16);if(Ne(he))return le;T[p+le]=he}return le}function q(T,g,p,R){return $e(Se(g,T.length-p),T,p,R)}function ee(T,g,p,R){return $e(be(g),T,p,R)}function K(T,g,p,R){return $e(Ae(g),T,p,R)}function ne(T,g,p,R){return $e(pe(g,T.length-p),T,p,R)}s.prototype.write=function(g,p,R,J){if(p===void 0)J="utf8",R=this.length,p=0;else if(R===void 0&&typeof p=="string")J=p,R=this.length,p=0;else if(isFinite(p))p=p>>>0,isFinite(R)?(R=R>>>0,J===void 0&&(J="utf8")):(J=R,R=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let D=this.length-p;if((R===void 0||R>D)&&(R=D),g.length>0&&(R<0||p<0)||p>this.length)throw new RangeError("Attempt to write outside buffer bounds");J||(J="utf8");let le=!1;for(;;)switch(J){case"hex":return I(this,g,p,R);case"utf8":case"utf-8":return q(this,g,p,R);case"ascii":case"latin1":case"binary":return ee(this,g,p,R);case"base64":return K(this,g,p,R);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ne(this,g,p,R);default:if(le)throw new TypeError("Unknown encoding: "+J);J=(""+J).toLowerCase(),le=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function L(T,g,p){return g===0&&p===T.length?r.fromByteArray(T):r.fromByteArray(T.slice(g,p))}function $(T,g,p){p=Math.min(T.length,p);let R=[],J=g;for(;J<p;){let D=T[J],le=null,he=D>239?4:D>223?3:D>191?2:1;if(J+he<=p){let _e,ve,Ie,Z;switch(he){case 1:D<128&&(le=D);break;case 2:_e=T[J+1],(_e&192)===128&&(Z=(D&31)<<6|_e&63,Z>127&&(le=Z));break;case 3:_e=T[J+1],ve=T[J+2],(_e&192)===128&&(ve&192)===128&&(Z=(D&15)<<12|(_e&63)<<6|ve&63,Z>2047&&(Z<55296||Z>57343)&&(le=Z));break;case 4:_e=T[J+1],ve=T[J+2],Ie=T[J+3],(_e&192)===128&&(ve&192)===128&&(Ie&192)===128&&(Z=(D&15)<<18|(_e&63)<<12|(ve&63)<<6|Ie&63,Z>65535&&Z<1114112&&(le=Z))}}le===null?(le=65533,he=1):le>65535&&(le-=65536,R.push(le>>>10&1023|55296),le=56320|le&1023),R.push(le),J+=he}return ie(R)}let Y=4096;function ie(T){let g=T.length;if(g<=Y)return String.fromCharCode.apply(String,T);let p="",R=0;for(;R<g;)p+=String.fromCharCode.apply(String,T.slice(R,R+=Y));return p}function re(T,g,p){let R="";p=Math.min(T.length,p);for(let J=g;J<p;++J)R+=String.fromCharCode(T[J]&127);return R}function k(T,g,p){let R="";p=Math.min(T.length,p);for(let J=g;J<p;++J)R+=String.fromCharCode(T[J]);return R}function x(T,g,p){let R=T.length;(!g||g<0)&&(g=0),(!p||p<0||p>R)&&(p=R);let J="";for(let D=g;D<p;++D)J+=Ze[T[D]];return J}function P(T,g,p){let R=T.slice(g,p),J="";for(let D=0;D<R.length-1;D+=2)J+=String.fromCharCode(R[D]+R[D+1]*256);return J}s.prototype.slice=function(g,p){let R=this.length;g=~~g,p=p===void 0?R:~~p,g<0?(g+=R,g<0&&(g=0)):g>R&&(g=R),p<0?(p+=R,p<0&&(p=0)):p>R&&(p=R),p<g&&(p=g);let J=this.subarray(g,p);return Object.setPrototypeOf(J,s.prototype),J};function C(T,g,p){if(T%1!==0||T<0)throw new RangeError("offset is not uint");if(T+g>p)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(g,p,R){g=g>>>0,p=p>>>0,R||C(g,p,this.length);let J=this[g],D=1,le=0;for(;++le<p&&(D*=256);)J+=this[g+le]*D;return J},s.prototype.readUintBE=s.prototype.readUIntBE=function(g,p,R){g=g>>>0,p=p>>>0,R||C(g,p,this.length);let J=this[g+--p],D=1;for(;p>0&&(D*=256);)J+=this[g+--p]*D;return J},s.prototype.readUint8=s.prototype.readUInt8=function(g,p){return g=g>>>0,p||C(g,1,this.length),this[g]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(g,p){return g=g>>>0,p||C(g,2,this.length),this[g]|this[g+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(g,p){return g=g>>>0,p||C(g,2,this.length),this[g]<<8|this[g+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(g,p){return g=g>>>0,p||C(g,4,this.length),(this[g]|this[g+1]<<8|this[g+2]<<16)+this[g+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(g,p){return g=g>>>0,p||C(g,4,this.length),this[g]*16777216+(this[g+1]<<16|this[g+2]<<8|this[g+3])},s.prototype.readBigUInt64LE=tt(function(g){g=g>>>0,V(g,"offset");let p=this[g],R=this[g+7];(p===void 0||R===void 0)&&M(g,this.length-8);let J=p+this[++g]*2**8+this[++g]*2**16+this[++g]*2**24,D=this[++g]+this[++g]*2**8+this[++g]*2**16+R*2**24;return BigInt(J)+(BigInt(D)<<BigInt(32))}),s.prototype.readBigUInt64BE=tt(function(g){g=g>>>0,V(g,"offset");let p=this[g],R=this[g+7];(p===void 0||R===void 0)&&M(g,this.length-8);let J=p*2**24+this[++g]*2**16+this[++g]*2**8+this[++g],D=this[++g]*2**24+this[++g]*2**16+this[++g]*2**8+R;return(BigInt(J)<<BigInt(32))+BigInt(D)}),s.prototype.readIntLE=function(g,p,R){g=g>>>0,p=p>>>0,R||C(g,p,this.length);let J=this[g],D=1,le=0;for(;++le<p&&(D*=256);)J+=this[g+le]*D;return D*=128,J>=D&&(J-=Math.pow(2,8*p)),J},s.prototype.readIntBE=function(g,p,R){g=g>>>0,p=p>>>0,R||C(g,p,this.length);let J=p,D=1,le=this[g+--J];for(;J>0&&(D*=256);)le+=this[g+--J]*D;return D*=128,le>=D&&(le-=Math.pow(2,8*p)),le},s.prototype.readInt8=function(g,p){return g=g>>>0,p||C(g,1,this.length),this[g]&128?(255-this[g]+1)*-1:this[g]},s.prototype.readInt16LE=function(g,p){g=g>>>0,p||C(g,2,this.length);let R=this[g]|this[g+1]<<8;return R&32768?R|4294901760:R},s.prototype.readInt16BE=function(g,p){g=g>>>0,p||C(g,2,this.length);let R=this[g+1]|this[g]<<8;return R&32768?R|4294901760:R},s.prototype.readInt32LE=function(g,p){return g=g>>>0,p||C(g,4,this.length),this[g]|this[g+1]<<8|this[g+2]<<16|this[g+3]<<24},s.prototype.readInt32BE=function(g,p){return g=g>>>0,p||C(g,4,this.length),this[g]<<24|this[g+1]<<16|this[g+2]<<8|this[g+3]},s.prototype.readBigInt64LE=tt(function(g){g=g>>>0,V(g,"offset");let p=this[g],R=this[g+7];(p===void 0||R===void 0)&&M(g,this.length-8);let J=this[g+4]+this[g+5]*2**8+this[g+6]*2**16+(R<<24);return(BigInt(J)<<BigInt(32))+BigInt(p+this[++g]*2**8+this[++g]*2**16+this[++g]*2**24)}),s.prototype.readBigInt64BE=tt(function(g){g=g>>>0,V(g,"offset");let p=this[g],R=this[g+7];(p===void 0||R===void 0)&&M(g,this.length-8);let J=(p<<24)+this[++g]*2**16+this[++g]*2**8+this[++g];return(BigInt(J)<<BigInt(32))+BigInt(this[++g]*2**24+this[++g]*2**16+this[++g]*2**8+R)}),s.prototype.readFloatLE=function(g,p){return g=g>>>0,p||C(g,4,this.length),e.read(this,g,!0,23,4)},s.prototype.readFloatBE=function(g,p){return g=g>>>0,p||C(g,4,this.length),e.read(this,g,!1,23,4)},s.prototype.readDoubleLE=function(g,p){return g=g>>>0,p||C(g,8,this.length),e.read(this,g,!0,52,8)},s.prototype.readDoubleBE=function(g,p){return g=g>>>0,p||C(g,8,this.length),e.read(this,g,!1,52,8)};function j(T,g,p,R,J,D){if(!s.isBuffer(T))throw new TypeError('"buffer" argument must be a Buffer instance');if(g>J||g<D)throw new RangeError('"value" argument is out of bounds');if(p+R>T.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(g,p,R,J){if(g=+g,p=p>>>0,R=R>>>0,!J){let he=Math.pow(2,8*R)-1;j(this,g,p,R,he,0)}let D=1,le=0;for(this[p]=g&255;++le<R&&(D*=256);)this[p+le]=g/D&255;return p+R},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(g,p,R,J){if(g=+g,p=p>>>0,R=R>>>0,!J){let he=Math.pow(2,8*R)-1;j(this,g,p,R,he,0)}let D=R-1,le=1;for(this[p+D]=g&255;--D>=0&&(le*=256);)this[p+D]=g/le&255;return p+R},s.prototype.writeUint8=s.prototype.writeUInt8=function(g,p,R){return g=+g,p=p>>>0,R||j(this,g,p,1,255,0),this[p]=g&255,p+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(g,p,R){return g=+g,p=p>>>0,R||j(this,g,p,2,65535,0),this[p]=g&255,this[p+1]=g>>>8,p+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(g,p,R){return g=+g,p=p>>>0,R||j(this,g,p,2,65535,0),this[p]=g>>>8,this[p+1]=g&255,p+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(g,p,R){return g=+g,p=p>>>0,R||j(this,g,p,4,4294967295,0),this[p+3]=g>>>24,this[p+2]=g>>>16,this[p+1]=g>>>8,this[p]=g&255,p+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(g,p,R){return g=+g,p=p>>>0,R||j(this,g,p,4,4294967295,0),this[p]=g>>>24,this[p+1]=g>>>16,this[p+2]=g>>>8,this[p+3]=g&255,p+4};function U(T,g,p,R,J){xe(g,R,J,T,p,7);let D=Number(g&BigInt(4294967295));T[p++]=D,D=D>>8,T[p++]=D,D=D>>8,T[p++]=D,D=D>>8,T[p++]=D;let le=Number(g>>BigInt(32)&BigInt(4294967295));return T[p++]=le,le=le>>8,T[p++]=le,le=le>>8,T[p++]=le,le=le>>8,T[p++]=le,p}function B(T,g,p,R,J){xe(g,R,J,T,p,7);let D=Number(g&BigInt(4294967295));T[p+7]=D,D=D>>8,T[p+6]=D,D=D>>8,T[p+5]=D,D=D>>8,T[p+4]=D;let le=Number(g>>BigInt(32)&BigInt(4294967295));return T[p+3]=le,le=le>>8,T[p+2]=le,le=le>>8,T[p+1]=le,le=le>>8,T[p]=le,p+8}s.prototype.writeBigUInt64LE=tt(function(g,p=0){return U(this,g,p,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeBigUInt64BE=tt(function(g,p=0){return B(this,g,p,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeIntLE=function(g,p,R,J){if(g=+g,p=p>>>0,!J){let _e=Math.pow(2,8*R-1);j(this,g,p,R,_e-1,-_e)}let D=0,le=1,he=0;for(this[p]=g&255;++D<R&&(le*=256);)g<0&&he===0&&this[p+D-1]!==0&&(he=1),this[p+D]=(g/le>>0)-he&255;return p+R},s.prototype.writeIntBE=function(g,p,R,J){if(g=+g,p=p>>>0,!J){let _e=Math.pow(2,8*R-1);j(this,g,p,R,_e-1,-_e)}let D=R-1,le=1,he=0;for(this[p+D]=g&255;--D>=0&&(le*=256);)g<0&&he===0&&this[p+D+1]!==0&&(he=1),this[p+D]=(g/le>>0)-he&255;return p+R},s.prototype.writeInt8=function(g,p,R){return g=+g,p=p>>>0,R||j(this,g,p,1,127,-128),g<0&&(g=255+g+1),this[p]=g&255,p+1},s.prototype.writeInt16LE=function(g,p,R){return g=+g,p=p>>>0,R||j(this,g,p,2,32767,-32768),this[p]=g&255,this[p+1]=g>>>8,p+2},s.prototype.writeInt16BE=function(g,p,R){return g=+g,p=p>>>0,R||j(this,g,p,2,32767,-32768),this[p]=g>>>8,this[p+1]=g&255,p+2},s.prototype.writeInt32LE=function(g,p,R){return g=+g,p=p>>>0,R||j(this,g,p,4,2147483647,-2147483648),this[p]=g&255,this[p+1]=g>>>8,this[p+2]=g>>>16,this[p+3]=g>>>24,p+4},s.prototype.writeInt32BE=function(g,p,R){return g=+g,p=p>>>0,R||j(this,g,p,4,2147483647,-2147483648),g<0&&(g=4294967295+g+1),this[p]=g>>>24,this[p+1]=g>>>16,this[p+2]=g>>>8,this[p+3]=g&255,p+4},s.prototype.writeBigInt64LE=tt(function(g,p=0){return U(this,g,p,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),s.prototype.writeBigInt64BE=tt(function(g,p=0){return B(this,g,p,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Q(T,g,p,R,J,D){if(p+R>T.length)throw new RangeError("Index out of range");if(p<0)throw new RangeError("Index out of range")}function fe(T,g,p,R,J){return g=+g,p=p>>>0,J||Q(T,g,p,4),e.write(T,g,p,R,23,4),p+4}s.prototype.writeFloatLE=function(g,p,R){return fe(this,g,p,!0,R)},s.prototype.writeFloatBE=function(g,p,R){return fe(this,g,p,!1,R)};function Ee(T,g,p,R,J){return g=+g,p=p>>>0,J||Q(T,g,p,8),e.write(T,g,p,R,52,8),p+8}s.prototype.writeDoubleLE=function(g,p,R){return Ee(this,g,p,!0,R)},s.prototype.writeDoubleBE=function(g,p,R){return Ee(this,g,p,!1,R)},s.prototype.copy=function(g,p,R,J){if(!s.isBuffer(g))throw new TypeError("argument should be a Buffer");if(R||(R=0),!J&&J!==0&&(J=this.length),p>=g.length&&(p=g.length),p||(p=0),J>0&&J<R&&(J=R),J===R||g.length===0||this.length===0)return 0;if(p<0)throw new RangeError("targetStart out of bounds");if(R<0||R>=this.length)throw new RangeError("Index out of range");if(J<0)throw new RangeError("sourceEnd out of bounds");J>this.length&&(J=this.length),g.length-p<J-R&&(J=g.length-p+R);let D=J-R;return this===g&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(p,R,J):Uint8Array.prototype.set.call(g,this.subarray(R,J),p),D},s.prototype.fill=function(g,p,R,J){if(typeof g=="string"){if(typeof p=="string"?(J=p,p=0,R=this.length):typeof R=="string"&&(J=R,R=this.length),J!==void 0&&typeof J!="string")throw new TypeError("encoding must be a string");if(typeof J=="string"&&!s.isEncoding(J))throw new TypeError("Unknown encoding: "+J);if(g.length===1){let le=g.charCodeAt(0);(J==="utf8"&&le<128||J==="latin1")&&(g=le)}}else typeof g=="number"?g=g&255:typeof g=="boolean"&&(g=Number(g));if(p<0||this.length<p||this.length<R)throw new RangeError("Out of range index");if(R<=p)return this;p=p>>>0,R=R===void 0?this.length:R>>>0,g||(g=0);let D;if(typeof g=="number")for(D=p;D<R;++D)this[D]=g;else{let le=s.isBuffer(g)?g:s.from(g,J),he=le.length;if(he===0)throw new TypeError('The value "'+g+'" is invalid for argument "value"');for(D=0;D<R-p;++D)this[D+p]=le[D%he]}return this};let te={};function H(T,g,p){te[T]=class extends p{constructor(){super(),Object.defineProperty(this,"message",{value:g.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${T}]`,this.stack,delete this.name}get code(){return T}set code(J){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:J,writable:!0})}toString(){return`${this.name} [${T}]: ${this.message}`}}}H("ERR_BUFFER_OUT_OF_BOUNDS",function(T){return T?`${T} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),H("ERR_INVALID_ARG_TYPE",function(T,g){return`The "${T}" argument must be of type number. Received type ${typeof g}`},TypeError),H("ERR_OUT_OF_RANGE",function(T,g,p){let R=`The value of "${T}" is out of range.`,J=p;return Number.isInteger(p)&&Math.abs(p)>2**32?J=ae(String(p)):typeof p=="bigint"&&(J=String(p),(p>BigInt(2)**BigInt(32)||p<-(BigInt(2)**BigInt(32)))&&(J=ae(J)),J+="n"),R+=` It must be ${g}. Received ${J}`,R},RangeError);function ae(T){let g="",p=T.length,R=T[0]==="-"?1:0;for(;p>=R+4;p-=3)g=`_${T.slice(p-3,p)}${g}`;return`${T.slice(0,p)}${g}`}function we(T,g,p){V(g,"offset"),(T[g]===void 0||T[g+p]===void 0)&&M(g,T.length-(p+1))}function xe(T,g,p,R,J,D){if(T>p||T<g){let le=typeof g=="bigint"?"n":"",he;throw g===0||g===BigInt(0)?he=`>= 0${le} and < 2${le} ** ${(D+1)*8}${le}`:he=`>= -(2${le} ** ${(D+1)*8-1}${le}) and < 2 ** ${(D+1)*8-1}${le}`,new te.ERR_OUT_OF_RANGE("value",he,T)}we(R,J,D)}function V(T,g){if(typeof T!="number")throw new te.ERR_INVALID_ARG_TYPE(g,"number",T)}function M(T,g,p){throw Math.floor(T)!==T?(V(T,p),new te.ERR_OUT_OF_RANGE("offset","an integer",T)):g<0?new te.ERR_BUFFER_OUT_OF_BOUNDS:new te.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${g}`,T)}let oe=/[^+/0-9A-Za-z-_]/g;function ge(T){if(T=T.split("=")[0],T=T.trim().replace(oe,""),T.length<2)return"";for(;T.length%4!==0;)T=T+"=";return T}function Se(T,g){g=g||1/0;let p,R=T.length,J=null,D=[];for(let le=0;le<R;++le){if(p=T.charCodeAt(le),p>55295&&p<57344){if(!J){if(p>56319){(g-=3)>-1&&D.push(239,191,189);continue}else if(le+1===R){(g-=3)>-1&&D.push(239,191,189);continue}J=p;continue}if(p<56320){(g-=3)>-1&&D.push(239,191,189),J=p;continue}p=(J-55296<<10|p-56320)+65536}else J&&(g-=3)>-1&&D.push(239,191,189);if(J=null,p<128){if((g-=1)<0)break;D.push(p)}else if(p<2048){if((g-=2)<0)break;D.push(p>>6|192,p&63|128)}else if(p<65536){if((g-=3)<0)break;D.push(p>>12|224,p>>6&63|128,p&63|128)}else if(p<1114112){if((g-=4)<0)break;D.push(p>>18|240,p>>12&63|128,p>>6&63|128,p&63|128)}else throw new Error("Invalid code point")}return D}function be(T){let g=[];for(let p=0;p<T.length;++p)g.push(T.charCodeAt(p)&255);return g}function pe(T,g){let p,R,J,D=[];for(let le=0;le<T.length&&!((g-=2)<0);++le)p=T.charCodeAt(le),R=p>>8,J=p%256,D.push(J),D.push(R);return D}function Ae(T){return r.toByteArray(ge(T))}function $e(T,g,p,R){let J;for(J=0;J<R&&!(J+p>=g.length||J>=T.length);++J)g[J+p]=T[J];return J}function ke(T,g){return T instanceof g||T!=null&&T.constructor!=null&&T.constructor.name!=null&&T.constructor.name===g.name}function Ne(T){return T!==T}let Ze=(function(){let T="0123456789abcdef",g=new Array(256);for(let p=0;p<16;++p){let R=p*16;for(let J=0;J<16;++J)g[R+J]=T[p]+T[J]}return g})();function tt(T){return typeof BigInt>"u"?it:T}function it(){throw new Error("BigInt not supported")}return rc}function ic(){return KI||(KI=!0,typeof Object.create=="function"?Ab=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Ab=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}),Ab}function vN(){return ZI||(ZI=!0,B1=ln.EventEmitter),B1}function XU(){if(JI)return F1;JI=!0;function r(d,m){var y=Object.keys(d);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(d);m&&(v=v.filter(function(w){return Object.getOwnPropertyDescriptor(d,w).enumerable})),y.push.apply(y,v)}return y}function e(d){for(var m=1;m<arguments.length;m++){var y=arguments[m]!=null?arguments[m]:{};m%2?r(Object(y),!0).forEach(function(v){t(d,v,y[v])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(y)):r(Object(y)).forEach(function(v){Object.defineProperty(d,v,Object.getOwnPropertyDescriptor(y,v))})}return d}function t(d,m,y){return m in d?Object.defineProperty(d,m,{value:y,enumerable:!0,configurable:!0,writable:!0}):d[m]=y,d}function n(d,m){if(!(d instanceof m))throw new TypeError("Cannot call a class as a function")}function i(d,m){for(var y=0;y<m.length;y++){var v=m[y];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(d,v.key,v)}}function o(d,m,y){return m&&i(d.prototype,m),d}var s=fh,a=s.Buffer,u=qe,c=u.inspect,f=c&&c.custom||"inspect";function h(d,m,y){a.prototype.copy.call(d,m,y)}return F1=(function(){function d(){n(this,d),this.head=null,this.tail=null,this.length=0}return o(d,[{key:"push",value:function(y){var v={data:y,next:null};this.length>0?this.tail.next=v:this.head=v,this.tail=v,++this.length}},{key:"unshift",value:function(y){var v={data:y,next:this.head};this.length===0&&(this.tail=v),this.head=v,++this.length}},{key:"shift",value:function(){if(this.length!==0){var y=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,y}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(y){if(this.length===0)return"";for(var v=this.head,w=""+v.data;v=v.next;)w+=y+v.data;return w}},{key:"concat",value:function(y){if(this.length===0)return a.alloc(0);for(var v=a.allocUnsafe(y>>>0),w=this.head,b=0;w;)h(w.data,v,b),b+=w.data.length,w=w.next;return v}},{key:"consume",value:function(y,v){var w;return y<this.head.data.length?(w=this.head.data.slice(0,y),this.head.data=this.head.data.slice(y)):y===this.head.data.length?w=this.shift():w=v?this._getString(y):this._getBuffer(y),w}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(y){var v=this.head,w=1,b=v.data;for(y-=b.length;v=v.next;){var E=v.data,_=y>E.length?E.length:y;if(_===E.length?b+=E:b+=E.slice(0,y),y-=_,y===0){_===E.length?(++w,v.next?this.head=v.next:this.head=this.tail=null):(this.head=v,v.data=E.slice(_));break}++w}return this.length-=w,b}},{key:"_getBuffer",value:function(y){var v=a.allocUnsafe(y),w=this.head,b=1;for(w.data.copy(v),y-=w.data.length;w=w.next;){var E=w.data,_=y>E.length?E.length:y;if(E.copy(v,v.length-y,0,_),y-=_,y===0){_===E.length?(++b,w.next?this.head=w.next:this.head=this.tail=null):(this.head=w,w.data=E.slice(_));break}++b}return this.length-=b,v}},{key:f,value:function(y,v){return c(this,e({},v,{depth:0,customInspect:!1}))}}]),d})(),F1}function EN(){if(QI)return U1;QI=!0;var r=Xt;function e(a,u){var c=this,f=this._readableState&&this._readableState.destroyed,h=this._writableState&&this._writableState.destroyed;return f||h?(u?u(a):a&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,r.nextTick(o,this,a)):r.nextTick(o,this,a)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(a||null,function(d){!u&&d?c._writableState?c._writableState.errorEmitted?r.nextTick(n,c):(c._writableState.errorEmitted=!0,r.nextTick(t,c,d)):r.nextTick(t,c,d):u?(r.nextTick(n,c),u(d)):r.nextTick(n,c)}),this)}function t(a,u){o(a,u),n(a)}function n(a){a._writableState&&!a._writableState.emitClose||a._readableState&&!a._readableState.emitClose||a.emit("close")}function i(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function o(a,u){a.emit("error",u)}function s(a,u){var c=a._readableState,f=a._writableState;c&&c.autoDestroy||f&&f.autoDestroy?a.destroy(u):a.emit("error",u)}return U1={destroy:e,undestroy:i,errorOrDestroy:s},U1}function hh(){if(eN)return j1;eN=!0;let r={};function e(s,a,u){u||(u=Error);function c(h,d,m){return typeof a=="string"?a:a(h,d,m)}class f extends u{constructor(d,m,y){super(c(d,m,y))}}f.prototype.name=u.name,f.prototype.code=s,r[s]=f}function t(s,a){if(Array.isArray(s)){let u=s.length;return s=s.map(c=>String(c)),u>2?`one of ${a} ${s.slice(0,u-1).join(", ")}, or `+s[u-1]:u===2?`one of ${a} ${s[0]} or ${s[1]}`:`of ${a} ${s[0]}`}else return`of ${a} ${String(s)}`}function n(s,a,u){return s.substr(0,a.length)===a}function i(s,a,u){return(u===void 0||u>s.length)&&(u=s.length),s.substring(u-a.length,u)===a}function o(s,a,u){return typeof u!="number"&&(u=0),u+a.length>s.length?!1:s.indexOf(a,u)!==-1}return e("ERR_INVALID_OPT_VALUE",function(s,a){return'The value "'+a+'" is invalid for option "'+s+'"'},TypeError),e("ERR_INVALID_ARG_TYPE",function(s,a,u){let c;typeof a=="string"&&n(a,"not ")?(c="must not be",a=a.replace(/^not /,"")):c="must be";let f;if(i(s," argument"))f=`The ${s} ${c} ${t(a,"type")}`;else{let h=o(s,".")?"property":"argument";f=`The "${s}" ${h} ${c} ${t(a,"type")}`}return f+=`. Received type ${typeof u}`,f},TypeError),e("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),e("ERR_METHOD_NOT_IMPLEMENTED",function(s){return"The "+s+" method is not implemented"}),e("ERR_STREAM_PREMATURE_CLOSE","Premature close"),e("ERR_STREAM_DESTROYED",function(s){return"Cannot call "+s+" after a stream was destroyed"}),e("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),e("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),e("ERR_STREAM_WRITE_AFTER_END","write after end"),e("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),e("ERR_UNKNOWN_ENCODING",function(s){return"Unknown encoding: "+s},TypeError),e("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),j1.codes=r,j1}function _N(){if(tN)return $1;tN=!0;var r=hh().codes.ERR_INVALID_OPT_VALUE;function e(n,i,o){return n.highWaterMark!=null?n.highWaterMark:i?n[o]:null}function t(n,i,o,s){var a=e(i,s,o);if(a!=null){if(!(isFinite(a)&&Math.floor(a)===a)||a<0){var u=s?o:"highWaterMark";throw new r(u,a)}return Math.floor(a)}return n.objectMode?16:16*1024}return $1={getHighWaterMark:t},$1}function KU(){if(rN)return W1;rN=!0,W1=r;function r(t,n){if(e("noDeprecation"))return t;var i=!1;function o(){if(!i){if(e("throwDeprecation"))throw new Error(n);e("traceDeprecation")?console.trace(n):console.warn(n),i=!0}return t.apply(this||z1,arguments)}return o}function e(t){try{if(!z1.localStorage)return!1}catch{return!1}var n=z1.localStorage[t];return n==null?!1:String(n).toLowerCase()==="true"}return W1}function o2(){if(nN)return H1;nN=!0;var r=Xt;H1=ee;function e(te){var H=this;this.next=null,this.entry=null,this.finish=function(){Ee(H,te)}}var t;ee.WritableState=I;var n={deprecate:KU()},i=vN(),o=fh.Buffer,s=ZU.Uint8Array||function(){};function a(te){return o.from(te)}function u(te){return o.isBuffer(te)||te instanceof s}var c=EN(),f=_N(),h=f.getHighWaterMark,d=hh().codes,m=d.ERR_INVALID_ARG_TYPE,y=d.ERR_METHOD_NOT_IMPLEMENTED,v=d.ERR_MULTIPLE_CALLBACK,w=d.ERR_STREAM_CANNOT_PIPE,b=d.ERR_STREAM_DESTROYED,E=d.ERR_STREAM_NULL_VALUES,_=d.ERR_STREAM_WRITE_AFTER_END,S=d.ERR_UNKNOWN_ENCODING,A=c.errorOrDestroy;ic()(ee,i);function F(){}function I(te,H,ae){t=t||nc(),te=te||{},typeof ae!="boolean"&&(ae=H instanceof t),this.objectMode=!!te.objectMode,ae&&(this.objectMode=this.objectMode||!!te.writableObjectMode),this.highWaterMark=h(this,te,"writableHighWaterMark",ae),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var we=te.decodeStrings===!1;this.decodeStrings=!we,this.defaultEncoding=te.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(xe){k(H,xe)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=te.emitClose!==!1,this.autoDestroy=!!te.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}I.prototype.getBuffer=function(){for(var H=this.bufferedRequest,ae=[];H;)ae.push(H),H=H.next;return ae},(function(){try{Object.defineProperty(I.prototype,"buffer",{get:n.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var q;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(q=Function.prototype[Symbol.hasInstance],Object.defineProperty(ee,Symbol.hasInstance,{value:function(H){return q.call(this,H)?!0:this!==ee?!1:H&&H._writableState instanceof I}})):q=function(H){return H instanceof this};function ee(te){t=t||nc();var H=this instanceof t;if(!H&&!q.call(ee,this))return new ee(te);this._writableState=new I(te,this,H),this.writable=!0,te&&(typeof te.write=="function"&&(this._write=te.write),typeof te.writev=="function"&&(this._writev=te.writev),typeof te.destroy=="function"&&(this._destroy=te.destroy),typeof te.final=="function"&&(this._final=te.final)),i.call(this)}ee.prototype.pipe=function(){A(this,new w)};function K(te,H){var ae=new _;A(te,ae),r.nextTick(H,ae)}function ne(te,H,ae,we){var xe;return ae===null?xe=new E:typeof ae!="string"&&!H.objectMode&&(xe=new m("chunk",["string","Buffer"],ae)),xe?(A(te,xe),r.nextTick(we,xe),!1):!0}ee.prototype.write=function(te,H,ae){var we=this._writableState,xe=!1,V=!we.objectMode&&u(te);return V&&!o.isBuffer(te)&&(te=a(te)),typeof H=="function"&&(ae=H,H=null),V?H="buffer":H||(H=we.defaultEncoding),typeof ae!="function"&&(ae=F),we.ending?K(this,ae):(V||ne(this,we,te,ae))&&(we.pendingcb++,xe=$(this,we,V,te,H,ae)),xe},ee.prototype.cork=function(){this._writableState.corked++},ee.prototype.uncork=function(){var te=this._writableState;te.corked&&(te.corked--,!te.writing&&!te.corked&&!te.bufferProcessing&&te.bufferedRequest&&C(this,te))},ee.prototype.setDefaultEncoding=function(H){if(typeof H=="string"&&(H=H.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((H+"").toLowerCase())>-1))throw new S(H);return this._writableState.defaultEncoding=H,this},Object.defineProperty(ee.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function L(te,H,ae){return!te.objectMode&&te.decodeStrings!==!1&&typeof H=="string"&&(H=o.from(H,ae)),H}Object.defineProperty(ee.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function $(te,H,ae,we,xe,V){if(!ae){var M=L(H,we,xe);we!==M&&(ae=!0,xe="buffer",we=M)}var oe=H.objectMode?1:we.length;H.length+=oe;var ge=H.length<H.highWaterMark;if(ge||(H.needDrain=!0),H.writing||H.corked){var Se=H.lastBufferedRequest;H.lastBufferedRequest={chunk:we,encoding:xe,isBuf:ae,callback:V,next:null},Se?Se.next=H.lastBufferedRequest:H.bufferedRequest=H.lastBufferedRequest,H.bufferedRequestCount+=1}else Y(te,H,!1,oe,we,xe,V);return ge}function Y(te,H,ae,we,xe,V,M){H.writelen=we,H.writecb=M,H.writing=!0,H.sync=!0,H.destroyed?H.onwrite(new b("write")):ae?te._writev(xe,H.onwrite):te._write(xe,V,H.onwrite),H.sync=!1}function ie(te,H,ae,we,xe){--H.pendingcb,ae?(r.nextTick(xe,we),r.nextTick(Q,te,H),te._writableState.errorEmitted=!0,A(te,we)):(xe(we),te._writableState.errorEmitted=!0,A(te,we),Q(te,H))}function re(te){te.writing=!1,te.writecb=null,te.length-=te.writelen,te.writelen=0}function k(te,H){var ae=te._writableState,we=ae.sync,xe=ae.writecb;if(typeof xe!="function")throw new v;if(re(ae),H)ie(te,ae,we,H,xe);else{var V=j(ae)||te.destroyed;!V&&!ae.corked&&!ae.bufferProcessing&&ae.bufferedRequest&&C(te,ae),we?r.nextTick(x,te,ae,V,xe):x(te,ae,V,xe)}}function x(te,H,ae,we){ae||P(te,H),H.pendingcb--,we(),Q(te,H)}function P(te,H){H.length===0&&H.needDrain&&(H.needDrain=!1,te.emit("drain"))}function C(te,H){H.bufferProcessing=!0;var ae=H.bufferedRequest;if(te._writev&&ae&&ae.next){var we=H.bufferedRequestCount,xe=new Array(we),V=H.corkedRequestsFree;V.entry=ae;for(var M=0,oe=!0;ae;)xe[M]=ae,ae.isBuf||(oe=!1),ae=ae.next,M+=1;xe.allBuffers=oe,Y(te,H,!0,H.length,xe,"",V.finish),H.pendingcb++,H.lastBufferedRequest=null,V.next?(H.corkedRequestsFree=V.next,V.next=null):H.corkedRequestsFree=new e(H),H.bufferedRequestCount=0}else{for(;ae;){var ge=ae.chunk,Se=ae.encoding,be=ae.callback,pe=H.objectMode?1:ge.length;if(Y(te,H,!1,pe,ge,Se,be),ae=ae.next,H.bufferedRequestCount--,H.writing)break}ae===null&&(H.lastBufferedRequest=null)}H.bufferedRequest=ae,H.bufferProcessing=!1}ee.prototype._write=function(te,H,ae){ae(new y("_write()"))},ee.prototype._writev=null,ee.prototype.end=function(te,H,ae){var we=this._writableState;return typeof te=="function"?(ae=te,te=null,H=null):typeof H=="function"&&(ae=H,H=null),te!=null&&this.write(te,H),we.corked&&(we.corked=1,this.uncork()),we.ending||fe(this,we,ae),this},Object.defineProperty(ee.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function j(te){return te.ending&&te.length===0&&te.bufferedRequest===null&&!te.finished&&!te.writing}function U(te,H){te._final(function(ae){H.pendingcb--,ae&&A(te,ae),H.prefinished=!0,te.emit("prefinish"),Q(te,H)})}function B(te,H){!H.prefinished&&!H.finalCalled&&(typeof te._final=="function"&&!H.destroyed?(H.pendingcb++,H.finalCalled=!0,r.nextTick(U,te,H)):(H.prefinished=!0,te.emit("prefinish")))}function Q(te,H){var ae=j(H);if(ae&&(B(te,H),H.pendingcb===0&&(H.finished=!0,te.emit("finish"),H.autoDestroy))){var we=te._readableState;(!we||we.autoDestroy&&we.endEmitted)&&te.destroy()}return ae}function fe(te,H,ae){H.ending=!0,Q(te,H),ae&&(H.finished?r.nextTick(ae):te.once("finish",ae)),H.ended=!0,te.writable=!1}function Ee(te,H,ae){var we=te.entry;for(te.entry=null;we;){var xe=we.callback;H.pendingcb--,xe(ae),we=we.next}H.corkedRequestsFree.next=te}return Object.defineProperty(ee.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(H){this._writableState&&(this._writableState.destroyed=H)}}),ee.prototype.destroy=c.destroy,ee.prototype._undestroy=c.undestroy,ee.prototype._destroy=function(te,H){H(te)},H1}function nc(){if(iN)return q1;iN=!0;var r=Xt,e=Object.keys||function(f){var h=[];for(var d in f)h.push(d);return h};q1=a;var t=a2(),n=o2();ic()(a,t);for(var i=e(n.prototype),o=0;o<i.length;o++){var s=i[o];a.prototype[s]||(a.prototype[s]=n.prototype[s])}function a(f){if(!(this instanceof a))return new a(f);t.call(this,f),n.call(this,f),this.allowHalfOpen=!0,f&&(f.readable===!1&&(this.readable=!1),f.writable===!1&&(this.writable=!1),f.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",u)))}Object.defineProperty(a.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(a.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(a.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function u(){this._writableState.ended||r.nextTick(c,this)}function c(f){f.end()}return Object.defineProperty(a.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(h){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=h,this._writableState.destroyed=h)}}),q1}function Cb(){if(sN)return G1;sN=!0;var r=hh().codes.ERR_STREAM_PREMATURE_CLOSE;function e(o){var s=!1;return function(){if(!s){s=!0;for(var a=arguments.length,u=new Array(a),c=0;c<a;c++)u[c]=arguments[c];o.apply(this,u)}}}function t(){}function n(o){return o.setHeader&&typeof o.abort=="function"}function i(o,s,a){if(typeof s=="function")return i(o,null,s);s||(s={}),a=e(a||t);var u=s.readable||s.readable!==!1&&o.readable,c=s.writable||s.writable!==!1&&o.writable,f=function(){o.writable||d()},h=o._writableState&&o._writableState.finished,d=function(){c=!1,h=!0,u||a.call(o)},m=o._readableState&&o._readableState.endEmitted,y=function(){u=!1,m=!0,c||a.call(o)},v=function(_){a.call(o,_)},w=function(){var _;if(u&&!m)return(!o._readableState||!o._readableState.ended)&&(_=new r),a.call(o,_);if(c&&!h)return(!o._writableState||!o._writableState.ended)&&(_=new r),a.call(o,_)},b=function(){o.req.on("finish",d)};return n(o)?(o.on("complete",d),o.on("abort",w),o.req?b():o.on("request",b)):c&&!o._writableState&&(o.on("end",f),o.on("close",f)),o.on("end",y),o.on("finish",d),s.error!==!1&&o.on("error",v),o.on("close",w),function(){o.removeListener("complete",d),o.removeListener("abort",w),o.removeListener("request",b),o.req&&o.req.removeListener("finish",d),o.removeListener("end",f),o.removeListener("close",f),o.removeListener("finish",d),o.removeListener("end",y),o.removeListener("error",v),o.removeListener("close",w)}}return G1=i,G1}function JU(){if(oN)return V1;oN=!0;var r=Xt,e;function t(E,_,S){return _ in E?Object.defineProperty(E,_,{value:S,enumerable:!0,configurable:!0,writable:!0}):E[_]=S,E}var n=Cb(),i=Symbol("lastResolve"),o=Symbol("lastReject"),s=Symbol("error"),a=Symbol("ended"),u=Symbol("lastPromise"),c=Symbol("handlePromise"),f=Symbol("stream");function h(E,_){return{value:E,done:_}}function d(E){var _=E[i];if(_!==null){var S=E[f].read();S!==null&&(E[u]=null,E[i]=null,E[o]=null,_(h(S,!1)))}}function m(E){r.nextTick(d,E)}function y(E,_){return function(S,A){E.then(function(){if(_[a]){S(h(void 0,!0));return}_[c](S,A)},A)}}var v=Object.getPrototypeOf(function(){}),w=Object.setPrototypeOf((e={get stream(){return this[f]},next:function(){var _=this,S=this[s];if(S!==null)return Promise.reject(S);if(this[a])return Promise.resolve(h(void 0,!0));if(this[f].destroyed)return new Promise(function(q,ee){r.nextTick(function(){_[s]?ee(_[s]):q(h(void 0,!0))})});var A=this[u],F;if(A)F=new Promise(y(A,this));else{var I=this[f].read();if(I!==null)return Promise.resolve(h(I,!1));F=new Promise(this[c])}return this[u]=F,F}},t(e,Symbol.asyncIterator,function(){return this}),t(e,"return",function(){var _=this;return new Promise(function(S,A){_[f].destroy(null,function(F){if(F){A(F);return}S(h(void 0,!0))})})}),e),v),b=function(_){var S,A=Object.create(w,(S={},t(S,f,{value:_,writable:!0}),t(S,i,{value:null,writable:!0}),t(S,o,{value:null,writable:!0}),t(S,s,{value:null,writable:!0}),t(S,a,{value:_._readableState.endEmitted,writable:!0}),t(S,c,{value:function(I,q){var ee=A[f].read();ee?(A[u]=null,A[i]=null,A[o]=null,I(h(ee,!1))):(A[i]=I,A[o]=q)},writable:!0}),S));return A[u]=null,n(_,function(F){if(F&&F.code!=="ERR_STREAM_PREMATURE_CLOSE"){var I=A[o];I!==null&&(A[u]=null,A[i]=null,A[o]=null,I(F)),A[s]=F;return}var q=A[i];q!==null&&(A[u]=null,A[i]=null,A[o]=null,q(h(void 0,!0))),A[a]=!0}),_.on("readable",m.bind(null,A)),A};return V1=b,V1}function QU(){return aN||(aN=!0,Y1=function(){throw new Error("Readable.from is not available in the browser")}),Y1}function a2(){if(lN)return X1;lN=!0;var r=Xt;X1=K;var e;K.ReadableState=ee,ln.EventEmitter;var t=function(M,oe){return M.listeners(oe).length},n=vN(),i=fh.Buffer,o=ej.Uint8Array||function(){};function s(V){return i.from(V)}function a(V){return i.isBuffer(V)||V instanceof o}var u=qe,c;u&&u.debuglog?c=u.debuglog("stream"):c=function(){};var f=XU(),h=EN(),d=_N(),m=d.getHighWaterMark,y=hh().codes,v=y.ERR_INVALID_ARG_TYPE,w=y.ERR_STREAM_PUSH_AFTER_EOF,b=y.ERR_METHOD_NOT_IMPLEMENTED,E=y.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,_,S,A;ic()(K,n);var F=h.errorOrDestroy,I=["error","close","destroy","pause","resume"];function q(V,M,oe){if(typeof V.prependListener=="function")return V.prependListener(M,oe);!V._events||!V._events[M]?V.on(M,oe):Array.isArray(V._events[M])?V._events[M].unshift(oe):V._events[M]=[oe,V._events[M]]}function ee(V,M,oe){e=e||nc(),V=V||{},typeof oe!="boolean"&&(oe=M instanceof e),this.objectMode=!!V.objectMode,oe&&(this.objectMode=this.objectMode||!!V.readableObjectMode),this.highWaterMark=m(this,V,"readableHighWaterMark",oe),this.buffer=new f,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=V.emitClose!==!1,this.autoDestroy=!!V.autoDestroy,this.destroyed=!1,this.defaultEncoding=V.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,V.encoding&&(_||(_=r2.StringDecoder),this.decoder=new _(V.encoding),this.encoding=V.encoding)}function K(V){if(e=e||nc(),!(this instanceof K))return new K(V);var M=this instanceof e;this._readableState=new ee(V,this,M),this.readable=!0,V&&(typeof V.read=="function"&&(this._read=V.read),typeof V.destroy=="function"&&(this._destroy=V.destroy)),n.call(this)}Object.defineProperty(K.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(M){this._readableState&&(this._readableState.destroyed=M)}}),K.prototype.destroy=h.destroy,K.prototype._undestroy=h.undestroy,K.prototype._destroy=function(V,M){M(V)},K.prototype.push=function(V,M){var oe=this._readableState,ge;return oe.objectMode?ge=!0:typeof V=="string"&&(M=M||oe.defaultEncoding,M!==oe.encoding&&(V=i.from(V,M),M=""),ge=!0),ne(this,V,M,!1,ge)},K.prototype.unshift=function(V){return ne(this,V,null,!0,!1)};function ne(V,M,oe,ge,Se){c("readableAddChunk",M);var be=V._readableState;if(M===null)be.reading=!1,k(V,be);else{var pe;if(Se||(pe=$(be,M)),pe)F(V,pe);else if(be.objectMode||M&&M.length>0)if(typeof M!="string"&&!be.objectMode&&Object.getPrototypeOf(M)!==i.prototype&&(M=s(M)),ge)be.endEmitted?F(V,new E):L(V,be,M,!0);else if(be.ended)F(V,new w);else{if(be.destroyed)return!1;be.reading=!1,be.decoder&&!oe?(M=be.decoder.write(M),be.objectMode||M.length!==0?L(V,be,M,!1):C(V,be)):L(V,be,M,!1)}else ge||(be.reading=!1,C(V,be))}return!be.ended&&(be.length<be.highWaterMark||be.length===0)}function L(V,M,oe,ge){M.flowing&&M.length===0&&!M.sync?(M.awaitDrain=0,V.emit("data",oe)):(M.length+=M.objectMode?1:oe.length,ge?M.buffer.unshift(oe):M.buffer.push(oe),M.needReadable&&x(V)),C(V,M)}function $(V,M){var oe;return!a(M)&&typeof M!="string"&&M!==void 0&&!V.objectMode&&(oe=new v("chunk",["string","Buffer","Uint8Array"],M)),oe}K.prototype.isPaused=function(){return this._readableState.flowing===!1},K.prototype.setEncoding=function(V){_||(_=r2.StringDecoder);var M=new _(V);this._readableState.decoder=M,this._readableState.encoding=this._readableState.decoder.encoding;for(var oe=this._readableState.buffer.head,ge="";oe!==null;)ge+=M.write(oe.data),oe=oe.next;return this._readableState.buffer.clear(),ge!==""&&this._readableState.buffer.push(ge),this._readableState.length=ge.length,this};var Y=1073741824;function ie(V){return V>=Y?V=Y:(V--,V|=V>>>1,V|=V>>>2,V|=V>>>4,V|=V>>>8,V|=V>>>16,V++),V}function re(V,M){return V<=0||M.length===0&&M.ended?0:M.objectMode?1:V!==V?M.flowing&&M.length?M.buffer.head.data.length:M.length:(V>M.highWaterMark&&(M.highWaterMark=ie(V)),V<=M.length?V:M.ended?M.length:(M.needReadable=!0,0))}K.prototype.read=function(V){c("read",V),V=parseInt(V,10);var M=this._readableState,oe=V;if(V!==0&&(M.emittedReadable=!1),V===0&&M.needReadable&&((M.highWaterMark!==0?M.length>=M.highWaterMark:M.length>0)||M.ended))return c("read: emitReadable",M.length,M.ended),M.length===0&&M.ended?ae(this):x(this),null;if(V=re(V,M),V===0&&M.ended)return M.length===0&&ae(this),null;var ge=M.needReadable;c("need readable",ge),(M.length===0||M.length-V<M.highWaterMark)&&(ge=!0,c("length less than watermark",ge)),M.ended||M.reading?(ge=!1,c("reading or ended",ge)):ge&&(c("do read"),M.reading=!0,M.sync=!0,M.length===0&&(M.needReadable=!0),this._read(M.highWaterMark),M.sync=!1,M.reading||(V=re(oe,M)));var Se;return V>0?Se=H(V,M):Se=null,Se===null?(M.needReadable=M.length<=M.highWaterMark,V=0):(M.length-=V,M.awaitDrain=0),M.length===0&&(M.ended||(M.needReadable=!0),oe!==V&&M.ended&&ae(this)),Se!==null&&this.emit("data",Se),Se};function k(V,M){if(c("onEofChunk"),!M.ended){if(M.decoder){var oe=M.decoder.end();oe&&oe.length&&(M.buffer.push(oe),M.length+=M.objectMode?1:oe.length)}M.ended=!0,M.sync?x(V):(M.needReadable=!1,M.emittedReadable||(M.emittedReadable=!0,P(V)))}}function x(V){var M=V._readableState;c("emitReadable",M.needReadable,M.emittedReadable),M.needReadable=!1,M.emittedReadable||(c("emitReadable",M.flowing),M.emittedReadable=!0,r.nextTick(P,V))}function P(V){var M=V._readableState;c("emitReadable_",M.destroyed,M.length,M.ended),!M.destroyed&&(M.length||M.ended)&&(V.emit("readable"),M.emittedReadable=!1),M.needReadable=!M.flowing&&!M.ended&&M.length<=M.highWaterMark,te(V)}function C(V,M){M.readingMore||(M.readingMore=!0,r.nextTick(j,V,M))}function j(V,M){for(;!M.reading&&!M.ended&&(M.length<M.highWaterMark||M.flowing&&M.length===0);){var oe=M.length;if(c("maybeReadMore read 0"),V.read(0),oe===M.length)break}M.readingMore=!1}K.prototype._read=function(V){F(this,new b("_read()"))},K.prototype.pipe=function(V,M){var oe=this,ge=this._readableState;switch(ge.pipesCount){case 0:ge.pipes=V;break;case 1:ge.pipes=[ge.pipes,V];break;default:ge.pipes.push(V);break}ge.pipesCount+=1,c("pipe count=%d opts=%j",ge.pipesCount,M);var Se=(!M||M.end!==!1)&&V!==r.stdout&&V!==r.stderr,be=Se?Ae:g;ge.endEmitted?r.nextTick(be):oe.once("end",be),V.on("unpipe",pe);function pe(p,R){c("onunpipe"),p===oe&&R&&R.hasUnpiped===!1&&(R.hasUnpiped=!0,Ne())}function Ae(){c("onend"),V.end()}var $e=U(oe);V.on("drain",$e);var ke=!1;function Ne(){c("cleanup"),V.removeListener("close",it),V.removeListener("finish",T),V.removeListener("drain",$e),V.removeListener("error",tt),V.removeListener("unpipe",pe),oe.removeListener("end",Ae),oe.removeListener("end",g),oe.removeListener("data",Ze),ke=!0,ge.awaitDrain&&(!V._writableState||V._writableState.needDrain)&&$e()}oe.on("data",Ze);function Ze(p){c("ondata");var R=V.write(p);c("dest.write",R),R===!1&&((ge.pipesCount===1&&ge.pipes===V||ge.pipesCount>1&&xe(ge.pipes,V)!==-1)&&!ke&&(c("false write response, pause",ge.awaitDrain),ge.awaitDrain++),oe.pause())}function tt(p){c("onerror",p),g(),V.removeListener("error",tt),t(V,"error")===0&&F(V,p)}q(V,"error",tt);function it(){V.removeListener("finish",T),g()}V.once("close",it);function T(){c("onfinish"),V.removeListener("close",it),g()}V.once("finish",T);function g(){c("unpipe"),oe.unpipe(V)}return V.emit("pipe",oe),ge.flowing||(c("pipe resume"),oe.resume()),V};function U(V){return function(){var oe=V._readableState;c("pipeOnDrain",oe.awaitDrain),oe.awaitDrain&&oe.awaitDrain--,oe.awaitDrain===0&&t(V,"data")&&(oe.flowing=!0,te(V))}}K.prototype.unpipe=function(V){var M=this._readableState,oe={hasUnpiped:!1};if(M.pipesCount===0)return this;if(M.pipesCount===1)return V&&V!==M.pipes?this:(V||(V=M.pipes),M.pipes=null,M.pipesCount=0,M.flowing=!1,V&&V.emit("unpipe",this,oe),this);if(!V){var ge=M.pipes,Se=M.pipesCount;M.pipes=null,M.pipesCount=0,M.flowing=!1;for(var be=0;be<Se;be++)ge[be].emit("unpipe",this,{hasUnpiped:!1});return this}var pe=xe(M.pipes,V);return pe===-1?this:(M.pipes.splice(pe,1),M.pipesCount-=1,M.pipesCount===1&&(M.pipes=M.pipes[0]),V.emit("unpipe",this,oe),this)},K.prototype.on=function(V,M){var oe=n.prototype.on.call(this,V,M),ge=this._readableState;return V==="data"?(ge.readableListening=this.listenerCount("readable")>0,ge.flowing!==!1&&this.resume()):V==="readable"&&!ge.endEmitted&&!ge.readableListening&&(ge.readableListening=ge.needReadable=!0,ge.flowing=!1,ge.emittedReadable=!1,c("on readable",ge.length,ge.reading),ge.length?x(this):ge.reading||r.nextTick(Q,this)),oe},K.prototype.addListener=K.prototype.on,K.prototype.removeListener=function(V,M){var oe=n.prototype.removeListener.call(this,V,M);return V==="readable"&&r.nextTick(B,this),oe},K.prototype.removeAllListeners=function(V){var M=n.prototype.removeAllListeners.apply(this,arguments);return(V==="readable"||V===void 0)&&r.nextTick(B,this),M};function B(V){var M=V._readableState;M.readableListening=V.listenerCount("readable")>0,M.resumeScheduled&&!M.paused?M.flowing=!0:V.listenerCount("data")>0&&V.resume()}function Q(V){c("readable nexttick read 0"),V.read(0)}K.prototype.resume=function(){var V=this._readableState;return V.flowing||(c("resume"),V.flowing=!V.readableListening,fe(this,V)),V.paused=!1,this};function fe(V,M){M.resumeScheduled||(M.resumeScheduled=!0,r.nextTick(Ee,V,M))}function Ee(V,M){c("resume",M.reading),M.reading||V.read(0),M.resumeScheduled=!1,V.emit("resume"),te(V),M.flowing&&!M.reading&&V.read(0)}K.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function te(V){var M=V._readableState;for(c("flow",M.flowing);M.flowing&&V.read()!==null;);}K.prototype.wrap=function(V){var M=this,oe=this._readableState,ge=!1;V.on("end",function(){if(c("wrapped end"),oe.decoder&&!oe.ended){var pe=oe.decoder.end();pe&&pe.length&&M.push(pe)}M.push(null)}),V.on("data",function(pe){if(c("wrapped data"),oe.decoder&&(pe=oe.decoder.write(pe)),!(oe.objectMode&&pe==null)&&!(!oe.objectMode&&(!pe||!pe.length))){var Ae=M.push(pe);Ae||(ge=!0,V.pause())}});for(var Se in V)this[Se]===void 0&&typeof V[Se]=="function"&&(this[Se]=(function(Ae){return function(){return V[Ae].apply(V,arguments)}})(Se));for(var be=0;be<I.length;be++)V.on(I[be],this.emit.bind(this,I[be]));return this._read=function(pe){c("wrapped _read",pe),ge&&(ge=!1,V.resume())},this},typeof Symbol=="function"&&(K.prototype[Symbol.asyncIterator]=function(){return S===void 0&&(S=JU()),S(this)}),Object.defineProperty(K.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(K.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(K.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(M){this._readableState&&(this._readableState.flowing=M)}}),K._fromList=H,Object.defineProperty(K.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function H(V,M){if(M.length===0)return null;var oe;return M.objectMode?oe=M.buffer.shift():!V||V>=M.length?(M.decoder?oe=M.buffer.join(""):M.buffer.length===1?oe=M.buffer.first():oe=M.buffer.concat(M.length),M.buffer.clear()):oe=M.buffer.consume(V,M.decoder),oe}function ae(V){var M=V._readableState;c("endReadable",M.endEmitted),M.endEmitted||(M.ended=!0,r.nextTick(we,M,V))}function we(V,M){if(c("endReadableNT",V.endEmitted,V.length),!V.endEmitted&&V.length===0&&(V.endEmitted=!0,M.readable=!1,M.emit("end"),V.autoDestroy)){var oe=M._writableState;(!oe||oe.autoDestroy&&oe.finished)&&M.destroy()}}typeof Symbol=="function"&&(K.from=function(V,M){return A===void 0&&(A=QU()),A(K,V,M)});function xe(V,M){for(var oe=0,ge=V.length;oe<ge;oe++)if(V[oe]===M)return oe;return-1}return X1}function l2(){if(uN)return K1;uN=!0,K1=a;var r=hh().codes,e=r.ERR_METHOD_NOT_IMPLEMENTED,t=r.ERR_MULTIPLE_CALLBACK,n=r.ERR_TRANSFORM_ALREADY_TRANSFORMING,i=r.ERR_TRANSFORM_WITH_LENGTH_0,o=nc();ic()(a,o);function s(f,h){var d=this._transformState;d.transforming=!1;var m=d.writecb;if(m===null)return this.emit("error",new t);d.writechunk=null,d.writecb=null,h!=null&&this.push(h),m(f);var y=this._readableState;y.reading=!1,(y.needReadable||y.length<y.highWaterMark)&&this._read(y.highWaterMark)}function a(f){if(!(this instanceof a))return new a(f);o.call(this,f),this._transformState={afterTransform:s.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,f&&(typeof f.transform=="function"&&(this._transform=f.transform),typeof f.flush=="function"&&(this._flush=f.flush)),this.on("prefinish",u)}function u(){var f=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(h,d){c(f,h,d)}):c(this,null,null)}a.prototype.push=function(f,h){return this._transformState.needTransform=!1,o.prototype.push.call(this,f,h)},a.prototype._transform=function(f,h,d){d(new e("_transform()"))},a.prototype._write=function(f,h,d){var m=this._transformState;if(m.writecb=d,m.writechunk=f,m.writeencoding=h,!m.transforming){var y=this._readableState;(m.needTransform||y.needReadable||y.length<y.highWaterMark)&&this._read(y.highWaterMark)}},a.prototype._read=function(f){var h=this._transformState;h.writechunk!==null&&!h.transforming?(h.transforming=!0,this._transform(h.writechunk,h.writeencoding,h.afterTransform)):h.needTransform=!0},a.prototype._destroy=function(f,h){o.prototype._destroy.call(this,f,function(d){h(d)})};function c(f,h,d){if(h)return f.emit("error",h);if(d!=null&&f.push(d),f._writableState.length)throw new i;if(f._transformState.transforming)throw new n;return f.push(null)}return K1}function AN(){if(cN)return Z1;cN=!0,Z1=e;var r=l2();ic()(e,r);function e(t){if(!(this instanceof e))return new e(t);r.call(this,t)}return e.prototype._transform=function(t,n,i){i(null,t)},Z1}function xN(){if(fN)return J1;fN=!0;var r;function e(d){var m=!1;return function(){m||(m=!0,d.apply(void 0,arguments))}}var t=hh().codes,n=t.ERR_MISSING_ARGS,i=t.ERR_STREAM_DESTROYED;function o(d){if(d)throw d}function s(d){return d.setHeader&&typeof d.abort=="function"}function a(d,m,y,v){v=e(v);var w=!1;d.on("close",function(){w=!0}),r===void 0&&(r=Cb()),r(d,{readable:m,writable:y},function(E){if(E)return v(E);w=!0,v()});var b=!1;return function(E){if(!w&&!b){if(b=!0,s(d))return d.abort();if(typeof d.destroy=="function")return d.destroy();v(E||new i("pipe"))}}}function u(d){d()}function c(d,m){return d.pipe(m)}function f(d){return!d.length||typeof d[d.length-1]!="function"?o:d.pop()}function h(){for(var d=arguments.length,m=new Array(d),y=0;y<d;y++)m[y]=arguments[y];var v=f(m);if(Array.isArray(m[0])&&(m=m[0]),m.length<2)throw new n("streams");var w,b=m.map(function(E,_){var S=_<m.length-1,A=_>0;return a(E,S,A,function(F){w||(w=F),F&&b.forEach(u),!S&&(b.forEach(u),v(w))})});return m.reduce(c)}return J1=h,J1}var hN,Fs,Ni,MI,Eb,Qu,BI,xU,ca,Q1,ch,UI,MU,BU,xb,Sb,po,FU,r2,n2,GI,ng,VI,_b,YI,rc,XI,fh,Ab,KI,B1,ZI,F1,JI,U1,QI,j1,eN,$1,tN,W1,rN,z1,H1,nN,ZU,q1,iN,G1,sN,V1,oN,Y1,aN,X1,lN,ej,K1,uN,Z1,cN,J1,fN,Rb=_t(()=>{Te();Re();Ce();uh();Al();ih();for(hN={byteLength:function(r){var e=FI(r),t=e[0],n=e[1];return 3*(t+n)/4-n},toByteArray:function(r){var e,t,n=FI(r),i=n[0],o=n[1],s=new MI((function(c,f,h){return 3*(f+h)/4-h})(0,i,o)),a=0,u=o>0?i-4:i;for(t=0;t<u;t+=4)e=Ni[r.charCodeAt(t)]<<18|Ni[r.charCodeAt(t+1)]<<12|Ni[r.charCodeAt(t+2)]<<6|Ni[r.charCodeAt(t+3)],s[a++]=e>>16&255,s[a++]=e>>8&255,s[a++]=255&e;return o===2&&(e=Ni[r.charCodeAt(t)]<<2|Ni[r.charCodeAt(t+1)]>>4,s[a++]=255&e),o===1&&(e=Ni[r.charCodeAt(t)]<<10|Ni[r.charCodeAt(t+1)]<<4|Ni[r.charCodeAt(t+2)]>>2,s[a++]=e>>8&255,s[a++]=255&e),s},fromByteArray:function(r){for(var e,t=r.length,n=t%3,i=[],o=0,s=t-n;o<s;o+=16383)i.push(AU(r,o,o+16383>s?s:o+16383));return n===1?(e=r[t-1],i.push(Fs[e>>2]+Fs[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1],i.push(Fs[e>>10]+Fs[e>>4&63]+Fs[e<<2&63]+"=")),i.join("")}},Fs=[],Ni=[],MI=typeof Uint8Array<"u"?Uint8Array:Array,Eb="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Qu=0,BI=Eb.length;Qu<BI;++Qu)Fs[Qu]=Eb[Qu],Ni[Eb.charCodeAt(Qu)]=Qu;Ni[45]=62,Ni[95]=63;xU={read:function(r,e,t,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,c=u>>1,f=-7,h=t?i-1:0,d=t?-1:1,m=r[e+h];for(h+=d,o=m&(1<<-f)-1,m>>=-f,f+=a;f>0;o=256*o+r[e+h],h+=d,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=256*s+r[e+h],h+=d,f-=8);if(o===0)o=1-c;else{if(o===u)return s?NaN:1/0*(m?-1:1);s+=Math.pow(2,n),o-=c}return(m?-1:1)*s*Math.pow(2,o-n)},write:function(r,e,t,n,i,o){var s,a,u,c=8*o-i-1,f=(1<<c)-1,h=f>>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=n?0:o-1,y=n?1:-1,v=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+h>=1?d/u:d*Math.pow(2,1-h))*u>=2&&(s++,u/=2),s+h>=f?(a=0,s=f):s+h>=1?(a=(e*u-1)*Math.pow(2,i),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;r[t+m]=255&a,m+=y,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;r[t+m]=255&s,m+=y,s/=256,c-=8);r[t+m-y]|=128*v}},ca={},Q1=hN,ch=xU,UI=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;ca.Buffer=Ke,ca.SlowBuffer=function(r){return+r!=r&&(r=0),Ke.alloc(+r)},ca.INSPECT_MAX_BYTES=50;ca.kMaxLength=2147483647,Ke.TYPED_ARRAY_SUPPORT=(function(){try{var r=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(r,e),r.foo()===42}catch{return!1}})(),Ke.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."),Object.defineProperty(Ke.prototype,"parent",{enumerable:!0,get:function(){if(Ke.isBuffer(this))return this.buffer}}),Object.defineProperty(Ke.prototype,"offset",{enumerable:!0,get:function(){if(Ke.isBuffer(this))return this.byteOffset}}),Ke.poolSize=8192,Ke.from=function(r,e,t){return dN(r,e,t)},Object.setPrototypeOf(Ke.prototype,Uint8Array.prototype),Object.setPrototypeOf(Ke,Uint8Array),Ke.alloc=function(r,e,t){return(function(n,i,o){return pN(n),n<=0?la(n):i!==void 0?typeof o=="string"?la(n).fill(i,o):la(n).fill(i):la(n)})(r,e,t)},Ke.allocUnsafe=function(r){return e2(r)},Ke.allocUnsafeSlow=function(r){return e2(r)},Ke.isBuffer=function(r){return r!=null&&r._isBuffer===!0&&r!==Ke.prototype},Ke.compare=function(r,e){if(ua(r,Uint8Array)&&(r=Ke.from(r,r.offset,r.byteLength)),ua(e,Uint8Array)&&(e=Ke.from(e,e.offset,e.byteLength)),!Ke.isBuffer(r)||!Ke.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(r===e)return 0;for(var t=r.length,n=e.length,i=0,o=Math.min(t,n);i<o;++i)if(r[i]!==e[i]){t=r[i],n=e[i];break}return t<n?-1:n<t?1:0},Ke.isEncoding=function(r){switch(String(r).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}},Ke.concat=function(r,e){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return Ke.alloc(0);var t;if(e===void 0)for(e=0,t=0;t<r.length;++t)e+=r[t].length;var n=Ke.allocUnsafe(e),i=0;for(t=0;t<r.length;++t){var o=r[t];if(ua(o,Uint8Array)&&(o=Ke.from(o)),!Ke.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},Ke.byteLength=gN,Ke.prototype._isBuffer=!0,Ke.prototype.swap16=function(){var r=this.length;if(r%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<r;e+=2)ec(this,e,e+1);return this},Ke.prototype.swap32=function(){var r=this.length;if(r%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<r;e+=4)ec(this,e,e+3),ec(this,e+1,e+2);return this},Ke.prototype.swap64=function(){var r=this.length;if(r%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<r;e+=8)ec(this,e,e+7),ec(this,e+1,e+6),ec(this,e+2,e+5),ec(this,e+3,e+4);return this},Ke.prototype.toString=function(){var r=this.length;return r===0?"":arguments.length===0?yN(this,0,r):SU.apply(this,arguments)},Ke.prototype.toLocaleString=Ke.prototype.toString,Ke.prototype.equals=function(r){if(!Ke.isBuffer(r))throw new TypeError("Argument must be a Buffer");return this===r||Ke.compare(this,r)===0},Ke.prototype.inspect=function(){var r="",e=ca.INSPECT_MAX_BYTES;return r=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(r+=" ... "),"<Buffer "+r+">"},UI&&(Ke.prototype[UI]=Ke.prototype.inspect),Ke.prototype.compare=function(r,e,t,n,i){if(ua(r,Uint8Array)&&(r=Ke.from(r,r.offset,r.byteLength)),!Ke.isBuffer(r))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof r);if(e===void 0&&(e=0),t===void 0&&(t=r?r.length:0),n===void 0&&(n=0),i===void 0&&(i=this.length),e<0||t>r.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=t)return 0;if(n>=i)return-1;if(e>=t)return 1;if(this===r)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(t>>>=0)-(e>>>=0),a=Math.min(o,s),u=this.slice(n,i),c=r.slice(e,t),f=0;f<a;++f)if(u[f]!==c[f]){o=u[f],s=c[f];break}return o<s?-1:s<o?1:0},Ke.prototype.includes=function(r,e,t){return this.indexOf(r,e,t)!==-1},Ke.prototype.indexOf=function(r,e,t){return $I(this,r,e,t,!0)},Ke.prototype.lastIndexOf=function(r,e,t){return $I(this,r,e,t,!1)},Ke.prototype.write=function(r,e,t,n){if(e===void 0)n="utf8",t=this.length,e=0;else if(t===void 0&&typeof e=="string")n=e,t=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(t)?(t>>>=0,n===void 0&&(n="utf8")):(n=t,t=void 0)}var i=this.length-e;if((t===void 0||t>i)&&(t=i),r.length>0&&(t<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return TU(this,r,e,t);case"utf8":case"utf-8":return CU(this,r,e,t);case"ascii":return mN(this,r,e,t);case"latin1":case"binary":return RU(this,r,e,t);case"base64":return DU(this,r,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return IU(this,r,e,t);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},Ke.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};Ke.prototype.slice=function(r,e){var t=this.length;(r=~~r)<0?(r+=t)<0&&(r=0):r>t&&(r=t),(e=e===void 0?t:~~e)<0?(e+=t)<0&&(e=0):e>t&&(e=t),e<r&&(e=r);var n=this.subarray(r,e);return Object.setPrototypeOf(n,Ke.prototype),n},Ke.prototype.readUIntLE=function(r,e,t){r>>>=0,e>>>=0,t||mn(r,e,this.length);for(var n=this[r],i=1,o=0;++o<e&&(i*=256);)n+=this[r+o]*i;return n},Ke.prototype.readUIntBE=function(r,e,t){r>>>=0,e>>>=0,t||mn(r,e,this.length);for(var n=this[r+--e],i=1;e>0&&(i*=256);)n+=this[r+--e]*i;return n},Ke.prototype.readUInt8=function(r,e){return r>>>=0,e||mn(r,1,this.length),this[r]},Ke.prototype.readUInt16LE=function(r,e){return r>>>=0,e||mn(r,2,this.length),this[r]|this[r+1]<<8},Ke.prototype.readUInt16BE=function(r,e){return r>>>=0,e||mn(r,2,this.length),this[r]<<8|this[r+1]},Ke.prototype.readUInt32LE=function(r,e){return r>>>=0,e||mn(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+16777216*this[r+3]},Ke.prototype.readUInt32BE=function(r,e){return r>>>=0,e||mn(r,4,this.length),16777216*this[r]+(this[r+1]<<16|this[r+2]<<8|this[r+3])},Ke.prototype.readIntLE=function(r,e,t){r>>>=0,e>>>=0,t||mn(r,e,this.length);for(var n=this[r],i=1,o=0;++o<e&&(i*=256);)n+=this[r+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},Ke.prototype.readIntBE=function(r,e,t){r>>>=0,e>>>=0,t||mn(r,e,this.length);for(var n=e,i=1,o=this[r+--n];n>0&&(i*=256);)o+=this[r+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},Ke.prototype.readInt8=function(r,e){return r>>>=0,e||mn(r,1,this.length),128&this[r]?-1*(255-this[r]+1):this[r]},Ke.prototype.readInt16LE=function(r,e){r>>>=0,e||mn(r,2,this.length);var t=this[r]|this[r+1]<<8;return 32768&t?4294901760|t:t},Ke.prototype.readInt16BE=function(r,e){r>>>=0,e||mn(r,2,this.length);var t=this[r+1]|this[r]<<8;return 32768&t?4294901760|t:t},Ke.prototype.readInt32LE=function(r,e){return r>>>=0,e||mn(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24},Ke.prototype.readInt32BE=function(r,e){return r>>>=0,e||mn(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]},Ke.prototype.readFloatLE=function(r,e){return r>>>=0,e||mn(r,4,this.length),ch.read(this,r,!0,23,4)},Ke.prototype.readFloatBE=function(r,e){return r>>>=0,e||mn(r,4,this.length),ch.read(this,r,!1,23,4)},Ke.prototype.readDoubleLE=function(r,e){return r>>>=0,e||mn(r,8,this.length),ch.read(this,r,!0,52,8)},Ke.prototype.readDoubleBE=function(r,e){return r>>>=0,e||mn(r,8,this.length),ch.read(this,r,!1,52,8)},Ke.prototype.writeUIntLE=function(r,e,t,n){r=+r,e>>>=0,t>>>=0,n||ai(this,r,e,t,Math.pow(2,8*t)-1,0);var i=1,o=0;for(this[e]=255&r;++o<t&&(i*=256);)this[e+o]=r/i&255;return e+t},Ke.prototype.writeUIntBE=function(r,e,t,n){r=+r,e>>>=0,t>>>=0,n||ai(this,r,e,t,Math.pow(2,8*t)-1,0);var i=t-1,o=1;for(this[e+i]=255&r;--i>=0&&(o*=256);)this[e+i]=r/o&255;return e+t},Ke.prototype.writeUInt8=function(r,e,t){return r=+r,e>>>=0,t||ai(this,r,e,1,255,0),this[e]=255&r,e+1},Ke.prototype.writeUInt16LE=function(r,e,t){return r=+r,e>>>=0,t||ai(this,r,e,2,65535,0),this[e]=255&r,this[e+1]=r>>>8,e+2},Ke.prototype.writeUInt16BE=function(r,e,t){return r=+r,e>>>=0,t||ai(this,r,e,2,65535,0),this[e]=r>>>8,this[e+1]=255&r,e+2},Ke.prototype.writeUInt32LE=function(r,e,t){return r=+r,e>>>=0,t||ai(this,r,e,4,4294967295,0),this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=255&r,e+4},Ke.prototype.writeUInt32BE=function(r,e,t){return r=+r,e>>>=0,t||ai(this,r,e,4,4294967295,0),this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=255&r,e+4},Ke.prototype.writeIntLE=function(r,e,t,n){if(r=+r,e>>>=0,!n){var i=Math.pow(2,8*t-1);ai(this,r,e,t,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&r;++o<t&&(s*=256);)r<0&&a===0&&this[e+o-1]!==0&&(a=1),this[e+o]=(r/s>>0)-a&255;return e+t},Ke.prototype.writeIntBE=function(r,e,t,n){if(r=+r,e>>>=0,!n){var i=Math.pow(2,8*t-1);ai(this,r,e,t,i-1,-i)}var o=t-1,s=1,a=0;for(this[e+o]=255&r;--o>=0&&(s*=256);)r<0&&a===0&&this[e+o+1]!==0&&(a=1),this[e+o]=(r/s>>0)-a&255;return e+t},Ke.prototype.writeInt8=function(r,e,t){return r=+r,e>>>=0,t||ai(this,r,e,1,127,-128),r<0&&(r=255+r+1),this[e]=255&r,e+1},Ke.prototype.writeInt16LE=function(r,e,t){return r=+r,e>>>=0,t||ai(this,r,e,2,32767,-32768),this[e]=255&r,this[e+1]=r>>>8,e+2},Ke.prototype.writeInt16BE=function(r,e,t){return r=+r,e>>>=0,t||ai(this,r,e,2,32767,-32768),this[e]=r>>>8,this[e+1]=255&r,e+2},Ke.prototype.writeInt32LE=function(r,e,t){return r=+r,e>>>=0,t||ai(this,r,e,4,2147483647,-2147483648),this[e]=255&r,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24,e+4},Ke.prototype.writeInt32BE=function(r,e,t){return r=+r,e>>>=0,t||ai(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=255&r,e+4},Ke.prototype.writeFloatLE=function(r,e,t){return zI(this,r,e,!0,t)},Ke.prototype.writeFloatBE=function(r,e,t){return zI(this,r,e,!1,t)},Ke.prototype.writeDoubleLE=function(r,e,t){return HI(this,r,e,!0,t)},Ke.prototype.writeDoubleBE=function(r,e,t){return HI(this,r,e,!1,t)},Ke.prototype.copy=function(r,e,t,n){if(!Ke.isBuffer(r))throw new TypeError("argument should be a Buffer");if(t||(t=0),n||n===0||(n=this.length),e>=r.length&&(e=r.length),e||(e=0),n>0&&n<t&&(n=t),n===t||r.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(t<0||t>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),r.length-e<n-t&&(n=r.length-e+t);var i=n-t;if(this===r&&typeof Uint8Array.prototype.copyWithin=="function")this.copyWithin(e,t,n);else if(this===r&&t<e&&e<n)for(var o=i-1;o>=0;--o)r[o+e]=this[o+t];else Uint8Array.prototype.set.call(r,this.subarray(t,n),e);return i},Ke.prototype.fill=function(r,e,t,n){if(typeof r=="string"){if(typeof e=="string"?(n=e,e=0,t=this.length):typeof t=="string"&&(n=t,t=this.length),n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!Ke.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(r.length===1){var i=r.charCodeAt(0);(n==="utf8"&&i<128||n==="latin1")&&(r=i)}}else typeof r=="number"?r&=255:typeof r=="boolean"&&(r=Number(r));if(e<0||this.length<e||this.length<t)throw new RangeError("Out of range index");if(t<=e)return this;var o;if(e>>>=0,t=t===void 0?this.length:t>>>0,r||(r=0),typeof r=="number")for(o=e;o<t;++o)this[o]=r;else{var s=Ke.isBuffer(r)?r:Ke.from(r,n),a=s.length;if(a===0)throw new TypeError('The value "'+r+'" is invalid for argument "value"');for(o=0;o<t-e;++o)this[o+e]=s[o%a]}return this};MU=/[^+/0-9A-Za-z-_]/g;BU=(function(){for(var r=new Array(256),e=0;e<16;++e)for(var t=16*e,n=0;n<16;++n)r[t+n]="0123456789abcdef"[e]+"0123456789abcdef"[n];return r})();ca.Buffer;ca.INSPECT_MAX_BYTES;ca.kMaxLength;xb={},Sb=ca,po=Sb.Buffer;po.from&&po.alloc&&po.allocUnsafe&&po.allocUnsafeSlow?xb=Sb:(qI(Sb,xb),xb.Buffer=tc),tc.prototype=Object.create(po.prototype),qI(po,tc),tc.from=function(r,e,t){if(typeof r=="number")throw new TypeError("Argument must not be a number");return po(r,e,t)},tc.alloc=function(r,e,t){if(typeof r!="number")throw new TypeError("Argument must be a number");var n=po(r);return e!==void 0?typeof t=="string"?n.fill(e,t):n.fill(e):n.fill(0),n},tc.allocUnsafe=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return po(r)},tc.allocUnsafeSlow=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return Sb.SlowBuffer(r)};FU=xb,r2={},n2=FU.Buffer,GI=n2.isEncoding||function(r){switch((r=""+r)&&r.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}};r2.StringDecoder=rg,rg.prototype.write=function(r){if(r.length===0)return"";var e,t;if(this.lastNeed){if((e=this.fillLast(r))===void 0)return"";t=this.lastNeed,this.lastNeed=0}else t=0;return t<r.length?e?e+this.text(r,t):this.text(r,t):e||""},rg.prototype.end=function(r){var e=r&&r.length?this.write(r):"";return this.lastNeed?e+"\uFFFD":e},rg.prototype.text=function(r,e){var t=(function(i,o,s){var a=o.length-1;if(a<s)return 0;var u=M1(o[a]);return u>=0?(u>0&&(i.lastNeed=u-1),u):--a<s||u===-2?0:(u=M1(o[a]))>=0?(u>0&&(i.lastNeed=u-2),u):--a<s||u===-2?0:(u=M1(o[a]))>=0?(u>0&&(u===2?u=0:i.lastNeed=u-3),u):0})(this,r,e);if(!this.lastNeed)return r.toString("utf8",e);this.lastTotal=t;var n=r.length-(t-this.lastNeed);return r.copy(this.lastChar,0,n),r.toString("utf8",e,n)},rg.prototype.fillLast=function(r){if(this.lastNeed<=r.length)return r.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);r.copy(this.lastChar,this.lastTotal-this.lastNeed,0,r.length),this.lastNeed-=r.length};ng={},VI=!1;_b={},YI=!1;rc={},XI=!1;fh=YU();fh.Buffer;fh.INSPECT_MAX_BYTES;fh.kMaxLength;Ab={},KI=!1;B1={},ZI=!1;F1={},JI=!1;U1={},QI=!1;j1={},eN=!1;$1={},tN=!1;W1={},rN=!1,z1=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;H1={},nN=!1,ZU=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;q1={},iN=!1;G1={},sN=!1;V1={},oN=!1;Y1={},aN=!1;X1={},lN=!1,ej=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;K1={},uN=!1;Z1={},cN=!1;J1={},fN=!1});function tj(){if(SN)return u2;SN=!0,u2=t;var r=ln.EventEmitter,e=ic();e(t,r),t.Readable=a2(),t.Writable=o2(),t.Duplex=nc(),t.Transform=l2(),t.PassThrough=AN(),t.finished=Cb(),t.pipeline=xN(),t.Stream=t;function t(){r.call(this||c2)}return t.prototype.pipe=function(n,i){var o=this||c2;function s(m){n.writable&&n.write(m)===!1&&o.pause&&o.pause()}o.on("data",s);function a(){o.readable&&o.resume&&o.resume()}n.on("drain",a),!n._isStdio&&(!i||i.end!==!1)&&(o.on("end",c),o.on("close",f));var u=!1;function c(){u||(u=!0,n.end())}function f(){u||(u=!0,typeof n.destroy=="function"&&n.destroy())}function h(m){if(d(),r.listenerCount(this||c2,"error")===0)throw m}o.on("error",h),n.on("error",h);function d(){o.removeListener("data",s),n.removeListener("drain",a),o.removeListener("end",c),o.removeListener("close",f),o.removeListener("error",h),n.removeListener("error",h),o.removeListener("end",d),o.removeListener("close",d),n.removeListener("close",d)}return o.on("end",d),o.on("close",d),n.on("close",d),n.emit("pipe",o),n},u2}var u2,SN,c2,li,TN,f2=_t(()=>{Te();Re();Ce();vb();Rb();uh();yb();Al();ih();u2={},SN=!1,c2=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;li=tj(),TN=li.Readable;TN.wrap=function(r,e){return e=Object.assign({objectMode:r.readableObjectMode!=null||r.objectMode!=null||!0},e),e.destroy=function(t,n){r.destroy(t),n(t)},new TN(e).wrap(r)};li.Writable;li.Duplex;li.Transform;li.PassThrough;li.finished;li.pipeline;li.Stream;v1(li.finished),v1(li.pipeline)});function rj(){if(CN)return h2;CN=!0;let r=2147483647,e=36,t=1,n=26,i=38,o=700,s=72,a=128,u="-",c=/^xn--/,f=/[^\0-\x7F]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,d={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=e-t,y=Math.floor,v=String.fromCharCode;function w($){throw new RangeError(d[$])}function b($,Y){let ie=[],re=$.length;for(;re--;)ie[re]=Y($[re]);return ie}function E($,Y){let ie=$.split("@"),re="";ie.length>1&&(re=ie[0]+"@",$=ie[1]),$=$.replace(h,".");let k=$.split("."),x=b(k,Y).join(".");return re+x}function _($){let Y=[],ie=0,re=$.length;for(;ie<re;){let k=$.charCodeAt(ie++);if(k>=55296&&k<=56319&&ie<re){let x=$.charCodeAt(ie++);(x&64512)==56320?Y.push(((k&1023)<<10)+(x&1023)+65536):(Y.push(k),ie--)}else Y.push(k)}return Y}let S=$=>String.fromCodePoint(...$),A=function($){return $>=48&&$<58?26+($-48):$>=65&&$<91?$-65:$>=97&&$<123?$-97:e},F=function($,Y){return $+22+75*($<26)-((Y!=0)<<5)},I=function($,Y,ie){let re=0;for($=ie?y($/o):$>>1,$+=y($/Y);$>m*n>>1;re+=e)$=y($/m);return y(re+(m+1)*$/($+i))},q=function($){let Y=[],ie=$.length,re=0,k=a,x=s,P=$.lastIndexOf(u);P<0&&(P=0);for(let C=0;C<P;++C)$.charCodeAt(C)>=128&&w("not-basic"),Y.push($.charCodeAt(C));for(let C=P>0?P+1:0;C<ie;){let j=re;for(let B=1,Q=e;;Q+=e){C>=ie&&w("invalid-input");let fe=A($.charCodeAt(C++));fe>=e&&w("invalid-input"),fe>y((r-re)/B)&&w("overflow"),re+=fe*B;let Ee=Q<=x?t:Q>=x+n?n:Q-x;if(fe<Ee)break;let te=e-Ee;B>y(r/te)&&w("overflow"),B*=te}let U=Y.length+1;x=I(re-j,U,j==0),y(re/U)>r-k&&w("overflow"),k+=y(re/U),re%=U,Y.splice(re++,0,k)}return String.fromCodePoint(...Y)},ee=function($){let Y=[];$=_($);let ie=$.length,re=a,k=0,x=s;for(let j of $)j<128&&Y.push(v(j));let P=Y.length,C=P;for(P&&Y.push(u);C<ie;){let j=r;for(let B of $)B>=re&&B<j&&(j=B);let U=C+1;j-re>y((r-k)/U)&&w("overflow"),k+=(j-re)*U,re=j;for(let B of $)if(B<re&&++k>r&&w("overflow"),B===re){let Q=k;for(let fe=e;;fe+=e){let Ee=fe<=x?t:fe>=x+n?n:fe-x;if(Q<Ee)break;let te=Q-Ee,H=e-Ee;Y.push(v(F(Ee+te%H,0))),Q=y(te/H)}Y.push(v(F(Q,0))),x=I(k,U,C===P),k=0,++C}++k,++re}return Y.join("")};return h2={version:"2.3.1",ucs2:{decode:_,encode:S},decode:q,encode:ee,toASCII:function($){return E($,function(Y){return f.test(Y)?"xn--"+ee(Y):Y})},toUnicode:function($){return E($,function(Y){return c.test(Y)?q(Y.slice(4).toLowerCase()):Y})}},h2}var h2,CN,Tl,WX,zX,HX,qX,GX,VX,d2=_t(()=>{Te();Re();Ce();h2={},CN=!1;Tl=rj(),WX=Tl.decode,zX=Tl.encode,HX=Tl.toASCII,qX=Tl.toUnicode,GX=Tl.ucs2,VX=Tl.version});function L2(){return RN||(RN=!0,p2=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[t]=i;for(t in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var o=Object.getOwnPropertySymbols(e);if(o.length!==1||o[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(e,t);if(s.value!==i||s.enumerable!==!0)return!1}return!0}),p2}function nj(){return DN||(DN=!0,g2=Error),g2}function ij(){return IN||(IN=!0,m2=EvalError),m2}function sj(){return NN||(NN=!0,y2=RangeError),y2}function oj(){return ON||(ON=!0,b2=ReferenceError),b2}function XN(){return kN||(kN=!0,w2=SyntaxError),w2}function dh(){return LN||(LN=!0,v2=TypeError),v2}function aj(){return PN||(PN=!0,E2=URIError),E2}function lj(){if(MN)return _2;MN=!0;var r=typeof Symbol<"u"&&Symbol,e=L2();return _2=function(){return typeof r!="function"||typeof Symbol!="function"||typeof r("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},_2}function uj(){if(BN)return A2;BN=!0;var r={__proto__:null,foo:{}},e=Object;return A2=function(){return{__proto__:r}.foo===r.foo&&!(r instanceof e)},A2}function cj(){if(FN)return x2;FN=!0;var r="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,t=Math.max,n="[object Function]",i=function(u,c){for(var f=[],h=0;h<u.length;h+=1)f[h]=u[h];for(var d=0;d<c.length;d+=1)f[d+u.length]=c[d];return f},o=function(u,c){for(var f=[],h=c,d=0;h<u.length;h+=1,d+=1)f[d]=u[h];return f},s=function(a,u){for(var c="",f=0;f<a.length;f+=1)c+=a[f],f+1<a.length&&(c+=u);return c};return x2=function(u){var c=this;if(typeof c!="function"||e.apply(c)!==n)throw new TypeError(r+c);for(var f=o(arguments,1),h,d=function(){if(this instanceof h){var b=c.apply(this,i(f,arguments));return Object(b)===b?b:this}return c.apply(u,i(f,arguments))},m=t(0,c.length-f.length),y=[],v=0;v<m;v++)y[v]="$"+v;if(h=Function("binder","return function ("+s(y,",")+"){ return binder.apply(this,arguments); }")(d),c.prototype){var w=function(){};w.prototype=c.prototype,h.prototype=new w,w.prototype=null}return h},x2}function P2(){if(UN)return S2;UN=!0;var r=cj();return S2=Function.prototype.bind||r,S2}function fj(){if(jN)return T2;jN=!0;var r=Function.prototype.call,e=Object.prototype.hasOwnProperty,t=P2();return T2=t.call(r,e),T2}function sc(){if($N)return C2;$N=!0;var r,e=nj(),t=ij(),n=sj(),i=oj(),o=XN(),s=dh(),a=aj(),u=Function,c=function(k){try{return u('"use strict"; return ('+k+").constructor;")()}catch{}},f=Object.getOwnPropertyDescriptor;if(f)try{f({},"")}catch{f=null}var h=function(){throw new s},d=f?(function(){try{return arguments.callee,h}catch{try{return f(arguments,"callee").get}catch{return h}}})():h,m=lj()(),y=uj()(),v=Object.getPrototypeOf||(y?function(k){return k.__proto__}:null),w={},b=typeof Uint8Array>"u"||!v?r:v(Uint8Array),E={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?r:ArrayBuffer,"%ArrayIteratorPrototype%":m&&v?v([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":w,"%AsyncGenerator%":w,"%AsyncGeneratorFunction%":w,"%AsyncIteratorPrototype%":w,"%Atomics%":typeof Atomics>"u"?r:Atomics,"%BigInt%":typeof BigInt>"u"?r:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?r:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":e,"%eval%":eval,"%EvalError%":t,"%Float32Array%":typeof Float32Array>"u"?r:Float32Array,"%Float64Array%":typeof Float64Array>"u"?r:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?r:FinalizationRegistry,"%Function%":u,"%GeneratorFunction%":w,"%Int8Array%":typeof Int8Array>"u"?r:Int8Array,"%Int16Array%":typeof Int16Array>"u"?r:Int16Array,"%Int32Array%":typeof Int32Array>"u"?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":m&&v?v(v([][Symbol.iterator]())):r,"%JSON%":typeof JSON=="object"?JSON:r,"%Map%":typeof Map>"u"?r:Map,"%MapIteratorPrototype%":typeof Map>"u"||!m||!v?r:v(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?r:Promise,"%Proxy%":typeof Proxy>"u"?r:Proxy,"%RangeError%":n,"%ReferenceError%":i,"%Reflect%":typeof Reflect>"u"?r:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?r:Set,"%SetIteratorPrototype%":typeof Set>"u"||!m||!v?r:v(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":m&&v?v(""[Symbol.iterator]()):r,"%Symbol%":m?Symbol:r,"%SyntaxError%":o,"%ThrowTypeError%":d,"%TypedArray%":b,"%TypeError%":s,"%Uint8Array%":typeof Uint8Array>"u"?r:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?r:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?r:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?r:Uint32Array,"%URIError%":a,"%WeakMap%":typeof WeakMap>"u"?r:WeakMap,"%WeakRef%":typeof WeakRef>"u"?r:WeakRef,"%WeakSet%":typeof WeakSet>"u"?r:WeakSet};if(v)try{null.error}catch(k){var _=v(v(k));E["%Error.prototype%"]=_}var S=function k(x){var P;if(x==="%AsyncFunction%")P=c("async function () {}");else if(x==="%GeneratorFunction%")P=c("function* () {}");else if(x==="%AsyncGeneratorFunction%")P=c("async function* () {}");else if(x==="%AsyncGenerator%"){var C=k("%AsyncGeneratorFunction%");C&&(P=C.prototype)}else if(x==="%AsyncIteratorPrototype%"){var j=k("%AsyncGenerator%");j&&v&&(P=v(j.prototype))}return E[x]=P,P},A={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},F=P2(),I=fj(),q=F.call(Function.call,Array.prototype.concat),ee=F.call(Function.apply,Array.prototype.splice),K=F.call(Function.call,String.prototype.replace),ne=F.call(Function.call,String.prototype.slice),L=F.call(Function.call,RegExp.prototype.exec),$=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Y=/\\(\\)?/g,ie=function(x){var P=ne(x,0,1),C=ne(x,-1);if(P==="%"&&C!=="%")throw new o("invalid intrinsic syntax, expected closing `%`");if(C==="%"&&P!=="%")throw new o("invalid intrinsic syntax, expected opening `%`");var j=[];return K(x,$,function(U,B,Q,fe){j[j.length]=Q?K(fe,Y,"$1"):B||U}),j},re=function(x,P){var C=x,j;if(I(A,C)&&(j=A[C],C="%"+j[0]+"%"),I(E,C)){var U=E[C];if(U===w&&(U=S(C)),typeof U>"u"&&!P)throw new s("intrinsic "+x+" exists, but is not available. Please file an issue!");return{alias:j,name:C,value:U}}throw new o("intrinsic "+x+" does not exist!")};return C2=function(x,P){if(typeof x!="string"||x.length===0)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof P!="boolean")throw new s('"allowMissing" argument must be a boolean');if(L(/^%?[^%]*%?$/,x)===null)throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var C=ie(x),j=C.length>0?C[0]:"",U=re("%"+j+"%",P),B=U.name,Q=U.value,fe=!1,Ee=U.alias;Ee&&(j=Ee[0],ee(C,q([0,1],Ee)));for(var te=1,H=!0;te<C.length;te+=1){var ae=C[te],we=ne(ae,0,1),xe=ne(ae,-1);if((we==='"'||we==="'"||we==="`"||xe==='"'||xe==="'"||xe==="`")&&we!==xe)throw new o("property names with quotes must have matching quotes");if((ae==="constructor"||!H)&&(fe=!0),j+="."+ae,B="%"+j+"%",I(E,B))Q=E[B];else if(Q!=null){if(!(ae in Q)){if(!P)throw new s("base intrinsic for "+x+" exists, but the property is not available.");return}if(f&&te+1>=C.length){var V=f(Q,ae);H=!!V,H&&"get"in V&&!("originalValue"in V.get)?Q=V.get:Q=Q[ae]}else H=I(Q,ae),Q=Q[ae];H&&!fe&&(E[B]=Q)}}return Q},C2}function M2(){if(WN)return R2;WN=!0;var r=sc(),e=r("%Object.defineProperty%",!0)||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return R2=e,R2}function Db(){if(zN)return D2;zN=!0;var r=sc(),e=r("%Object.getOwnPropertyDescriptor%",!0);if(e)try{e([],"length")}catch{e=null}return D2=e,D2}function hj(){if(HN)return I2;HN=!0;var r=M2(),e=XN(),t=dh(),n=Db();return I2=function(o,s,a){if(!o||typeof o!="object"&&typeof o!="function")throw new t("`obj` must be an object or a function`");if(typeof s!="string"&&typeof s!="symbol")throw new t("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new t("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new t("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new t("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new t("`loose`, if provided, must be a boolean");var u=arguments.length>3?arguments[3]:null,c=arguments.length>4?arguments[4]:null,f=arguments.length>5?arguments[5]:null,h=arguments.length>6?arguments[6]:!1,d=!!n&&n(o,s);if(r)r(o,s,{configurable:f===null&&d?d.configurable:!f,enumerable:u===null&&d?d.enumerable:!u,value:a,writable:c===null&&d?d.writable:!c});else if(h||!u&&!c&&!f)o[s]=a;else throw new e("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},I2}function dj(){if(qN)return N2;qN=!0;var r=M2(),e=function(){return!!r};return e.hasArrayLengthDefineBug=function(){if(!r)return null;try{return r([],"length",{value:1}).length!==1}catch{return!0}},N2=e,N2}function pj(){if(GN)return O2;GN=!0;var r=sc(),e=hj(),t=dj()(),n=Db(),i=dh(),o=r("%Math.floor%");return O2=function(a,u){if(typeof a!="function")throw new i("`fn` is not a function");if(typeof u!="number"||u<0||u>4294967295||o(u)!==u)throw new i("`length` must be a positive 32-bit integer");var c=arguments.length>2&&!!arguments[2],f=!0,h=!0;if("length"in a&&n){var d=n(a,"length");d&&!d.configurable&&(f=!1),d&&!d.writable&&(h=!1)}return(f||h||!c)&&(t?e(a,"length",u,!0,!0):e(a,"length",u)),a},O2}function B2(){if(VN)return ig;VN=!0;var r=P2(),e=sc(),t=pj(),n=dh(),i=e("%Function.prototype.apply%"),o=e("%Function.prototype.call%"),s=e("%Reflect.apply%",!0)||r.call(o,i),a=M2(),u=e("%Math.max%");ig=function(h){if(typeof h!="function")throw new n("a function is required");var d=s(r,o,arguments);return t(d,1+u(0,h.length-(arguments.length-1)),!0)};var c=function(){return s(r,i,arguments)};return a?a(ig,"apply",{value:c}):ig.apply=c,ig}function sg(){if(YN)return k2;YN=!0;var r=sc(),e=B2(),t=e(r("String.prototype.indexOf"));return k2=function(i,o){var s=r(i,!!o);return typeof s=="function"&&t(i,".prototype.")>-1?e(s):s},k2}var p2,RN,g2,DN,m2,IN,y2,NN,b2,ON,w2,kN,v2,LN,E2,PN,_2,MN,A2,BN,x2,FN,S2,UN,T2,jN,C2,$N,R2,WN,D2,zN,I2,HN,N2,qN,O2,GN,ig,VN,k2,YN,og=_t(()=>{Te();Re();Ce();p2={},RN=!1;g2={},DN=!1;m2={},IN=!1;y2={},NN=!1;b2={},ON=!1;w2={},kN=!1;v2={},LN=!1;E2={},PN=!1;_2={},MN=!1;A2={},BN=!1;x2={},FN=!1;S2={},UN=!1;T2={},jN=!1;C2={},$N=!1;R2={},WN=!1;D2={},zN=!1;I2={},HN=!1;N2={},qN=!1;O2={},GN=!1;ig={},VN=!1;k2={},YN=!1});function gj(){if(KN)return F2;KN=!0;var r=qr;function e(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function t(o,s){for(var a="",u=0,c=-1,f=0,h,d=0;d<=o.length;++d){if(d<o.length)h=o.charCodeAt(d);else{if(h===47)break;h=47}if(h===47){if(!(c===d-1||f===1))if(c!==d-1&&f===2){if(a.length<2||u!==2||a.charCodeAt(a.length-1)!==46||a.charCodeAt(a.length-2)!==46){if(a.length>2){var m=a.lastIndexOf("/");if(m!==a.length-1){m===-1?(a="",u=0):(a=a.slice(0,m),u=a.length-1-a.lastIndexOf("/")),c=d,f=0;continue}}else if(a.length===2||a.length===1){a="",u=0,c=d,f=0;continue}}s&&(a.length>0?a+="/..":a="..",u=2)}else a.length>0?a+="/"+o.slice(c+1,d):a=o.slice(c+1,d),u=d-c-1;c=d,f=0}else h===46&&f!==-1?++f:f=-1}return a}function n(o,s){var a=s.dir||s.root,u=s.base||(s.name||"")+(s.ext||"");return a?a===s.root?a+u:a+o+u:u}var i={resolve:function(){for(var s="",a=!1,u,c=arguments.length-1;c>=-1&&!a;c--){var f;c>=0?f=arguments[c]:(u===void 0&&(u=r.cwd()),f=u),e(f),f.length!==0&&(s=f+"/"+s,a=f.charCodeAt(0)===47)}return s=t(s,!a),a?s.length>0?"/"+s:"/":s.length>0?s:"."},normalize:function(s){if(e(s),s.length===0)return".";var a=s.charCodeAt(0)===47,u=s.charCodeAt(s.length-1)===47;return s=t(s,!a),s.length===0&&!a&&(s="."),s.length>0&&u&&(s+="/"),a?"/"+s:s},isAbsolute:function(s){return e(s),s.length>0&&s.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var s,a=0;a<arguments.length;++a){var u=arguments[a];e(u),u.length>0&&(s===void 0?s=u:s+="/"+u)}return s===void 0?".":i.normalize(s)},relative:function(s,a){if(e(s),e(a),s===a||(s=i.resolve(s),a=i.resolve(a),s===a))return"";for(var u=1;u<s.length&&s.charCodeAt(u)===47;++u);for(var c=s.length,f=c-u,h=1;h<a.length&&a.charCodeAt(h)===47;++h);for(var d=a.length,m=d-h,y=f<m?f:m,v=-1,w=0;w<=y;++w){if(w===y){if(m>y){if(a.charCodeAt(h+w)===47)return a.slice(h+w+1);if(w===0)return a.slice(h+w)}else f>y&&(s.charCodeAt(u+w)===47?v=w:w===0&&(v=0));break}var b=s.charCodeAt(u+w),E=a.charCodeAt(h+w);if(b!==E)break;b===47&&(v=w)}var _="";for(w=u+v+1;w<=c;++w)(w===c||s.charCodeAt(w)===47)&&(_.length===0?_+="..":_+="/..");return _.length>0?_+a.slice(h+v):(h+=v,a.charCodeAt(h)===47&&++h,a.slice(h))},_makeLong:function(s){return s},dirname:function(s){if(e(s),s.length===0)return".";for(var a=s.charCodeAt(0),u=a===47,c=-1,f=!0,h=s.length-1;h>=1;--h)if(a=s.charCodeAt(h),a===47){if(!f){c=h;break}}else f=!1;return c===-1?u?"/":".":u&&c===1?"//":s.slice(0,c)},basename:function(s,a){if(a!==void 0&&typeof a!="string")throw new TypeError('"ext" argument must be a string');e(s);var u=0,c=-1,f=!0,h;if(a!==void 0&&a.length>0&&a.length<=s.length){if(a.length===s.length&&a===s)return"";var d=a.length-1,m=-1;for(h=s.length-1;h>=0;--h){var y=s.charCodeAt(h);if(y===47){if(!f){u=h+1;break}}else m===-1&&(f=!1,m=h+1),d>=0&&(y===a.charCodeAt(d)?--d===-1&&(c=h):(d=-1,c=m))}return u===c?c=m:c===-1&&(c=s.length),s.slice(u,c)}else{for(h=s.length-1;h>=0;--h)if(s.charCodeAt(h)===47){if(!f){u=h+1;break}}else c===-1&&(f=!1,c=h+1);return c===-1?"":s.slice(u,c)}},extname:function(s){e(s);for(var a=-1,u=0,c=-1,f=!0,h=0,d=s.length-1;d>=0;--d){var m=s.charCodeAt(d);if(m===47){if(!f){u=d+1;break}continue}c===-1&&(f=!1,c=d+1),m===46?a===-1?a=d:h!==1&&(h=1):a!==-1&&(h=-1)}return a===-1||c===-1||h===0||h===1&&a===c-1&&a===u+1?"":s.slice(a,c)},format:function(s){if(s===null||typeof s!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof s);return n("/",s)},parse:function(s){e(s);var a={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return a;var u=s.charCodeAt(0),c=u===47,f;c?(a.root="/",f=1):f=0;for(var h=-1,d=0,m=-1,y=!0,v=s.length-1,w=0;v>=f;--v){if(u=s.charCodeAt(v),u===47){if(!y){d=v+1;break}continue}m===-1&&(y=!1,m=v+1),u===46?h===-1?h=v:w!==1&&(w=1):h!==-1&&(w=-1)}return h===-1||m===-1||w===0||w===1&&h===m-1&&h===d+1?m!==-1&&(d===0&&c?a.base=a.name=s.slice(1,m):a.base=a.name=s.slice(d,m)):(d===0&&c?(a.name=s.slice(1,h),a.base=s.slice(1,m)):(a.name=s.slice(d,h),a.base=s.slice(d,m)),a.ext=s.slice(h,m)),d>0?a.dir=s.slice(0,d-1):c&&(a.dir="/"),a},sep:"/",delimiter:":",win32:null,posix:null};return i.posix=i,F2=i,F2}var F2,KN,U2,j2=_t(()=>{Te();Re();Ce();Ju();F2={},KN=!1;U2=gj()});function yj(){if(ZN)return $2;ZN=!0;var r=typeof Map=="function"&&Map.prototype,e=Object.getOwnPropertyDescriptor&&r?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,t=r&&e&&typeof e.get=="function"?e.get:null,n=r&&Map.prototype.forEach,i=typeof Set=="function"&&Set.prototype,o=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,s=i&&o&&typeof o.get=="function"?o.get:null,a=i&&Set.prototype.forEach,u=typeof WeakMap=="function"&&WeakMap.prototype,c=u?WeakMap.prototype.has:null,f=typeof WeakSet=="function"&&WeakSet.prototype,h=f?WeakSet.prototype.has:null,d=typeof WeakRef=="function"&&WeakRef.prototype,m=d?WeakRef.prototype.deref:null,y=Boolean.prototype.valueOf,v=Object.prototype.toString,w=Function.prototype.toString,b=String.prototype.match,E=String.prototype.slice,_=String.prototype.replace,S=String.prototype.toUpperCase,A=String.prototype.toLowerCase,F=RegExp.prototype.test,I=Array.prototype.concat,q=Array.prototype.join,ee=Array.prototype.slice,K=Math.floor,ne=typeof BigInt=="function"?BigInt.prototype.valueOf:null,L=Object.getOwnPropertySymbols,$=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Y=typeof Symbol=="function"&&typeof Symbol.iterator=="object",ie=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Y||!0)?Symbol.toStringTag:null,re=Object.prototype.propertyIsEnumerable,k=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(he){return he.__proto__}:null);function x(he,_e){if(he===1/0||he===-1/0||he!==he||he&&he>-1e3&&he<1e3||F.call(/e/,_e))return _e;var ve=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof he=="number"){var Ie=he<0?-K(-he):K(he);if(Ie!==he){var Z=String(Ie),Me=E.call(_e,Z.length+1);return _.call(Z,ve,"$&_")+"."+_.call(_.call(Me,/([0-9]{3})/g,"$&_"),/_$/,"")}}return _.call(_e,ve,"$&_")}var P=mj,C=P.custom,j=xe(C)?C:null;$2=function he(_e,ve,Ie,Z){var Me=ve||{};if(oe(Me,"quoteStyle")&&Me.quoteStyle!=="single"&&Me.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(oe(Me,"maxStringLength")&&(typeof Me.maxStringLength=="number"?Me.maxStringLength<0&&Me.maxStringLength!==1/0:Me.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var nt=oe(Me,"customInspect")?Me.customInspect:!0;if(typeof nt!="boolean"&&nt!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(oe(Me,"indent")&&Me.indent!==null&&Me.indent!==" "&&!(parseInt(Me.indent,10)===Me.indent&&Me.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(oe(Me,"numericSeparator")&&typeof Me.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var N=Me.numericSeparator;if(typeof _e>"u")return"undefined";if(_e===null)return"null";if(typeof _e=="boolean")return _e?"true":"false";if(typeof _e=="string")return tt(_e,Me);if(typeof _e=="number"){if(_e===0)return 1/0/_e>0?"0":"-0";var Pe=String(_e);return N?x(_e,Pe):Pe}if(typeof _e=="bigint"){var je=String(_e)+"n";return N?x(_e,je):je}var de=typeof Me.depth>"u"?5:Me.depth;if(typeof Ie>"u"&&(Ie=0),Ie>=de&&de>0&&typeof _e=="object")return Q(_e)?"[Array]":"[Object]";var De=J(Me,Ie);if(typeof Z>"u")Z=[];else if(be(Z,_e)>=0)return"[Circular]";function Be(Zt,tn,rn){if(tn&&(Z=ee.call(Z),Z.push(tn)),rn){var nn={depth:Me.depth};return oe(Me,"quoteStyle")&&(nn.quoteStyle=Me.quoteStyle),he(Zt,nn,Ie+1,Z)}return he(Zt,Me,Ie+1,Z)}if(typeof _e=="function"&&!Ee(_e)){var ft=Se(_e),ue=le(_e,Be);return"[Function"+(ft?": "+ft:" (anonymous)")+"]"+(ue.length>0?" { "+q.call(ue,", ")+" }":"")}if(xe(_e)){var me=Y?_.call(String(_e),/^(Symbol\(.*\))_[^)]*$/,"$1"):$.call(_e);return typeof _e=="object"&&!Y?T(me):me}if(Ze(_e)){for(var Ge="<"+A.call(String(_e.nodeName)),Ue=_e.attributes||[],et=0;et<Ue.length;et++)Ge+=" "+Ue[et].name+"="+U(B(Ue[et].value),"double",Me);return Ge+=">",_e.childNodes&&_e.childNodes.length&&(Ge+="..."),Ge+="</"+A.call(String(_e.nodeName))+">",Ge}if(Q(_e)){if(_e.length===0)return"[]";var pt=le(_e,Be);return De&&!R(pt)?"["+D(pt,De)+"]":"[ "+q.call(pt,", ")+" ]"}if(te(_e)){var It=le(_e,Be);return!("cause"in Error.prototype)&&"cause"in _e&&!re.call(_e,"cause")?"{ ["+String(_e)+"] "+q.call(I.call("[cause]: "+Be(_e.cause),It),", ")+" }":It.length===0?"["+String(_e)+"]":"{ ["+String(_e)+"] "+q.call(It,", ")+" }"}if(typeof _e=="object"&&nt){if(j&&typeof _e[j]=="function"&&P)return P(_e,{depth:de-Ie});if(nt!=="symbol"&&typeof _e.inspect=="function")return _e.inspect()}if(pe(_e)){var xt=[];return n&&n.call(_e,function(Zt,tn){xt.push(Be(tn,_e,!0)+" => "+Be(Zt,_e))}),p("Map",t.call(_e),xt,De)}if(ke(_e)){var fr=[];return a&&a.call(_e,function(Zt){fr.push(Be(Zt,_e))}),p("Set",s.call(_e),fr,De)}if(Ae(_e))return g("WeakMap");if(Ne(_e))return g("WeakSet");if($e(_e))return g("WeakRef");if(ae(_e))return T(Be(Number(_e)));if(V(_e))return T(Be(ne.call(_e)));if(we(_e))return T(y.call(_e));if(H(_e))return T(Be(String(_e)));if(typeof window<"u"&&_e===window)return"{ [object Window] }";if(typeof globalThis<"u"&&_e===globalThis||typeof W2<"u"&&_e===W2)return"{ [object globalThis] }";if(!fe(_e)&&!Ee(_e)){var Ri=le(_e,Be),Yn=k?k(_e)===Object.prototype:_e instanceof Object||_e.constructor===Object,Yt=_e instanceof Object?"":"null prototype",Or=!Yn&&ie&&Object(_e)===_e&&ie in _e?E.call(ge(_e),8,-1):Yt?"Object":"",wr=Yn||typeof _e.constructor!="function"?"":_e.constructor.name?_e.constructor.name+" ":"",Ht=wr+(Or||Yt?"["+q.call(I.call([],Or||[],Yt||[]),": ")+"] ":"");return Ri.length===0?Ht+"{}":De?Ht+"{"+D(Ri,De)+"}":Ht+"{ "+q.call(Ri,", ")+" }"}return String(_e)};function U(he,_e,ve){var Ie=(ve.quoteStyle||_e)==="double"?'"':"'";return Ie+he+Ie}function B(he){return _.call(String(he),/"/g,""")}function Q(he){return ge(he)==="[object Array]"&&(!ie||!(typeof he=="object"&&ie in he))}function fe(he){return ge(he)==="[object Date]"&&(!ie||!(typeof he=="object"&&ie in he))}function Ee(he){return ge(he)==="[object RegExp]"&&(!ie||!(typeof he=="object"&&ie in he))}function te(he){return ge(he)==="[object Error]"&&(!ie||!(typeof he=="object"&&ie in he))}function H(he){return ge(he)==="[object String]"&&(!ie||!(typeof he=="object"&&ie in he))}function ae(he){return ge(he)==="[object Number]"&&(!ie||!(typeof he=="object"&&ie in he))}function we(he){return ge(he)==="[object Boolean]"&&(!ie||!(typeof he=="object"&&ie in he))}function xe(he){if(Y)return he&&typeof he=="object"&&he instanceof Symbol;if(typeof he=="symbol")return!0;if(!he||typeof he!="object"||!$)return!1;try{return $.call(he),!0}catch{}return!1}function V(he){if(!he||typeof he!="object"||!ne)return!1;try{return ne.call(he),!0}catch{}return!1}var M=Object.prototype.hasOwnProperty||function(he){return he in(this||W2)};function oe(he,_e){return M.call(he,_e)}function ge(he){return v.call(he)}function Se(he){if(he.name)return he.name;var _e=b.call(w.call(he),/^function\s*([\w$]+)/);return _e?_e[1]:null}function be(he,_e){if(he.indexOf)return he.indexOf(_e);for(var ve=0,Ie=he.length;ve<Ie;ve++)if(he[ve]===_e)return ve;return-1}function pe(he){if(!t||!he||typeof he!="object")return!1;try{t.call(he);try{s.call(he)}catch{return!0}return he instanceof Map}catch{}return!1}function Ae(he){if(!c||!he||typeof he!="object")return!1;try{c.call(he,c);try{h.call(he,h)}catch{return!0}return he instanceof WeakMap}catch{}return!1}function $e(he){if(!m||!he||typeof he!="object")return!1;try{return m.call(he),!0}catch{}return!1}function ke(he){if(!s||!he||typeof he!="object")return!1;try{s.call(he);try{t.call(he)}catch{return!0}return he instanceof Set}catch{}return!1}function Ne(he){if(!h||!he||typeof he!="object")return!1;try{h.call(he,h);try{c.call(he,c)}catch{return!0}return he instanceof WeakSet}catch{}return!1}function Ze(he){return!he||typeof he!="object"?!1:typeof HTMLElement<"u"&&he instanceof HTMLElement?!0:typeof he.nodeName=="string"&&typeof he.getAttribute=="function"}function tt(he,_e){if(he.length>_e.maxStringLength){var ve=he.length-_e.maxStringLength,Ie="... "+ve+" more character"+(ve>1?"s":"");return tt(E.call(he,0,_e.maxStringLength),_e)+Ie}var Z=_.call(_.call(he,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,it);return U(Z,"single",_e)}function it(he){var _e=he.charCodeAt(0),ve={8:"b",9:"t",10:"n",12:"f",13:"r"}[_e];return ve?"\\"+ve:"\\x"+(_e<16?"0":"")+S.call(_e.toString(16))}function T(he){return"Object("+he+")"}function g(he){return he+" { ? }"}function p(he,_e,ve,Ie){var Z=Ie?D(ve,Ie):q.call(ve,", ");return he+" ("+_e+") {"+Z+"}"}function R(he){for(var _e=0;_e<he.length;_e++)if(be(he[_e],`
|
|
75
|
-
`)>=0)return!1;return!0}function J(he,_e){var ve;if(he.indent===" ")ve=" ";else if(typeof he.indent=="number"&&he.indent>0)ve=q.call(Array(he.indent+1)," ");else return null;return{base:ve,prev:q.call(Array(_e+1),ve)}}function D(he,_e){if(he.length===0)return"";var ve=`
|
|
76
|
-
`+_e.prev+_e.base;return ve+q.call(he,","+ve)+`
|
|
77
|
-
`+_e.prev}function le(he,_e){var ve=Q(he),Ie=[];if(ve){Ie.length=he.length;for(var Z=0;Z<he.length;Z++)Ie[Z]=oe(he,Z)?_e(he[Z],he):""}var Me=typeof L=="function"?L(he):[],nt;if(Y){nt={};for(var N=0;N<Me.length;N++)nt["$"+Me[N]]=Me[N]}for(var Pe in he)oe(he,Pe)&&(ve&&String(Number(Pe))===Pe&&Pe<he.length||Y&&nt["$"+Pe]instanceof Symbol||(F.call(/[^\w$]/,Pe)?Ie.push(_e(Pe,he)+": "+_e(he[Pe],he)):Ie.push(Pe+": "+_e(he[Pe],he))));if(typeof L=="function")for(var je=0;je<Me.length;je++)re.call(he,Me[je])&&Ie.push("["+_e(Me[je])+"]: "+_e(he[Me[je]],he));return Ie}return $2}function bj(){if(JN)return z2;JN=!0;var r=sc(),e=sg(),t=yj(),n=dh(),i=r("%WeakMap%",!0),o=r("%Map%",!0),s=e("WeakMap.prototype.get",!0),a=e("WeakMap.prototype.set",!0),u=e("WeakMap.prototype.has",!0),c=e("Map.prototype.get",!0),f=e("Map.prototype.set",!0),h=e("Map.prototype.has",!0),d=function(w,b){for(var E=w,_;(_=E.next)!==null;E=_)if(_.key===b)return E.next=_.next,_.next=w.next,w.next=_,_},m=function(w,b){var E=d(w,b);return E&&E.value},y=function(w,b,E){var _=d(w,b);_?_.value=E:w.next={key:b,next:w.next,value:E}},v=function(w,b){return!!d(w,b)};return z2=function(){var b,E,_,S={assert:function(A){if(!S.has(A))throw new n("Side channel does not contain "+t(A))},get:function(A){if(i&&A&&(typeof A=="object"||typeof A=="function")){if(b)return s(b,A)}else if(o){if(E)return c(E,A)}else if(_)return m(_,A)},has:function(A){if(i&&A&&(typeof A=="object"||typeof A=="function")){if(b)return u(b,A)}else if(o){if(E)return h(E,A)}else if(_)return v(_,A);return!1},set:function(A,F){i&&A&&(typeof A=="object"||typeof A=="function")?(b||(b=new i),a(b,A,F)):o?(E||(E=new o),f(E,A,F)):(_||(_={key:{},next:null}),y(_,A,F))}};return S},z2}function K2(){if(QN)return H2;QN=!0;var r=String.prototype.replace,e=/%20/g,t={RFC1738:"RFC1738",RFC3986:"RFC3986"};return H2={default:t.RFC3986,formatters:{RFC1738:function(n){return r.call(n,e,"+")},RFC3986:function(n){return String(n)}},RFC1738:t.RFC1738,RFC3986:t.RFC3986},H2}function sO(){if(eO)return q2;eO=!0;var r=K2(),e=Object.prototype.hasOwnProperty,t=Array.isArray,n=(function(){for(var w=[],b=0;b<256;++b)w.push("%"+((b<16?"0":"")+b.toString(16)).toUpperCase());return w})(),i=function(b){for(;b.length>1;){var E=b.pop(),_=E.obj[E.prop];if(t(_)){for(var S=[],A=0;A<_.length;++A)typeof _[A]<"u"&&S.push(_[A]);E.obj[E.prop]=S}}},o=function(b,E){for(var _=E&&E.plainObjects?Object.create(null):{},S=0;S<b.length;++S)typeof b[S]<"u"&&(_[S]=b[S]);return _},s=function w(b,E,_){if(!E)return b;if(typeof E!="object"){if(t(b))b.push(E);else if(b&&typeof b=="object")(_&&(_.plainObjects||_.allowPrototypes)||!e.call(Object.prototype,E))&&(b[E]=!0);else return[b,E];return b}if(!b||typeof b!="object")return[b].concat(E);var S=b;return t(b)&&!t(E)&&(S=o(b,_)),t(b)&&t(E)?(E.forEach(function(A,F){if(e.call(b,F)){var I=b[F];I&&typeof I=="object"&&A&&typeof A=="object"?b[F]=w(I,A,_):b.push(A)}else b[F]=A}),b):Object.keys(E).reduce(function(A,F){var I=E[F];return e.call(A,F)?A[F]=w(A[F],I,_):A[F]=I,A},S)},a=function(b,E){return Object.keys(E).reduce(function(_,S){return _[S]=E[S],_},b)},u=function(w,b,E){var _=w.replace(/\+/g," ");if(E==="iso-8859-1")return _.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(_)}catch{return _}},c=1024,f=function(b,E,_,S,A){if(b.length===0)return b;var F=b;if(typeof b=="symbol"?F=Symbol.prototype.toString.call(b):typeof b!="string"&&(F=String(b)),_==="iso-8859-1")return escape(F).replace(/%u[0-9a-f]{4}/gi,function($){return"%26%23"+parseInt($.slice(2),16)+"%3B"});for(var I="",q=0;q<F.length;q+=c){for(var ee=F.length>=c?F.slice(q,q+c):F,K=[],ne=0;ne<ee.length;++ne){var L=ee.charCodeAt(ne);if(L===45||L===46||L===95||L===126||L>=48&&L<=57||L>=65&&L<=90||L>=97&&L<=122||A===r.RFC1738&&(L===40||L===41)){K[K.length]=ee.charAt(ne);continue}if(L<128){K[K.length]=n[L];continue}if(L<2048){K[K.length]=n[192|L>>6]+n[128|L&63];continue}if(L<55296||L>=57344){K[K.length]=n[224|L>>12]+n[128|L>>6&63]+n[128|L&63];continue}ne+=1,L=65536+((L&1023)<<10|ee.charCodeAt(ne)&1023),K[K.length]=n[240|L>>18]+n[128|L>>12&63]+n[128|L>>6&63]+n[128|L&63]}I+=K.join("")}return I},h=function(b){for(var E=[{obj:{o:b},prop:"o"}],_=[],S=0;S<E.length;++S)for(var A=E[S],F=A.obj[A.prop],I=Object.keys(F),q=0;q<I.length;++q){var ee=I[q],K=F[ee];typeof K=="object"&&K!==null&&_.indexOf(K)===-1&&(E.push({obj:F,prop:ee}),_.push(K))}return i(E),b},d=function(b){return Object.prototype.toString.call(b)==="[object RegExp]"},m=function(b){return!b||typeof b!="object"?!1:!!(b.constructor&&b.constructor.isBuffer&&b.constructor.isBuffer(b))},y=function(b,E){return[].concat(b,E)},v=function(b,E){if(t(b)){for(var _=[],S=0;S<b.length;S+=1)_.push(E(b[S]));return _}return E(b)};return q2={arrayToObject:o,assign:a,combine:y,compact:h,decode:u,encode:f,isBuffer:m,isRegExp:d,maybeMap:v,merge:s},q2}function wj(){if(tO)return G2;tO=!0;var r=bj(),e=sO(),t=K2(),n=Object.prototype.hasOwnProperty,i={brackets:function(w){return w+"[]"},comma:"comma",indices:function(w,b){return w+"["+b+"]"},repeat:function(w){return w}},o=Array.isArray,s=Array.prototype.push,a=function(v,w){s.apply(v,o(w)?w:[w])},u=Date.prototype.toISOString,c=t.default,f={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:e.encode,encodeValuesOnly:!1,format:c,formatter:t.formatters[c],indices:!1,serializeDate:function(w){return u.call(w)},skipNulls:!1,strictNullHandling:!1},h=function(w){return typeof w=="string"||typeof w=="number"||typeof w=="boolean"||typeof w=="symbol"||typeof w=="bigint"},d={},m=function v(w,b,E,_,S,A,F,I,q,ee,K,ne,L,$,Y,ie,re,k){for(var x=w,P=k,C=0,j=!1;(P=P.get(d))!==void 0&&!j;){var U=P.get(w);if(C+=1,typeof U<"u"){if(U===C)throw new RangeError("Cyclic object value");j=!0}typeof P.get(d)>"u"&&(C=0)}if(typeof ee=="function"?x=ee(b,x):x instanceof Date?x=L(x):E==="comma"&&o(x)&&(x=e.maybeMap(x,function(ge){return ge instanceof Date?L(ge):ge})),x===null){if(A)return q&&!ie?q(b,f.encoder,re,"key",$):b;x=""}if(h(x)||e.isBuffer(x)){if(q){var B=ie?b:q(b,f.encoder,re,"key",$);return[Y(B)+"="+Y(q(x,f.encoder,re,"value",$))]}return[Y(b)+"="+Y(String(x))]}var Q=[];if(typeof x>"u")return Q;var fe;if(E==="comma"&&o(x))ie&&q&&(x=e.maybeMap(x,q)),fe=[{value:x.length>0?x.join(",")||null:void 0}];else if(o(ee))fe=ee;else{var Ee=Object.keys(x);fe=K?Ee.sort(K):Ee}var te=I?b.replace(/\./g,"%2E"):b,H=_&&o(x)&&x.length===1?te+"[]":te;if(S&&o(x)&&x.length===0)return H+"[]";for(var ae=0;ae<fe.length;++ae){var we=fe[ae],xe=typeof we=="object"&&typeof we.value<"u"?we.value:x[we];if(!(F&&xe===null)){var V=ne&&I?we.replace(/\./g,"%2E"):we,M=o(x)?typeof E=="function"?E(H,V):H:H+(ne?"."+V:"["+V+"]");k.set(w,C);var oe=r();oe.set(d,k),a(Q,v(xe,M,E,_,S,A,F,I,E==="comma"&&ie&&o(x)?null:q,ee,K,ne,L,$,Y,ie,re,oe))}}return Q},y=function(w){if(!w)return f;if(typeof w.allowEmptyArrays<"u"&&typeof w.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof w.encodeDotInKeys<"u"&&typeof w.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(w.encoder!==null&&typeof w.encoder<"u"&&typeof w.encoder!="function")throw new TypeError("Encoder has to be a function.");var b=w.charset||f.charset;if(typeof w.charset<"u"&&w.charset!=="utf-8"&&w.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var E=t.default;if(typeof w.format<"u"){if(!n.call(t.formatters,w.format))throw new TypeError("Unknown format option provided.");E=w.format}var _=t.formatters[E],S=f.filter;(typeof w.filter=="function"||o(w.filter))&&(S=w.filter);var A;if(w.arrayFormat in i?A=w.arrayFormat:"indices"in w?A=w.indices?"indices":"repeat":A=f.arrayFormat,"commaRoundTrip"in w&&typeof w.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var F=typeof w.allowDots>"u"?w.encodeDotInKeys===!0?!0:f.allowDots:!!w.allowDots;return{addQueryPrefix:typeof w.addQueryPrefix=="boolean"?w.addQueryPrefix:f.addQueryPrefix,allowDots:F,allowEmptyArrays:typeof w.allowEmptyArrays=="boolean"?!!w.allowEmptyArrays:f.allowEmptyArrays,arrayFormat:A,charset:b,charsetSentinel:typeof w.charsetSentinel=="boolean"?w.charsetSentinel:f.charsetSentinel,commaRoundTrip:w.commaRoundTrip,delimiter:typeof w.delimiter>"u"?f.delimiter:w.delimiter,encode:typeof w.encode=="boolean"?w.encode:f.encode,encodeDotInKeys:typeof w.encodeDotInKeys=="boolean"?w.encodeDotInKeys:f.encodeDotInKeys,encoder:typeof w.encoder=="function"?w.encoder:f.encoder,encodeValuesOnly:typeof w.encodeValuesOnly=="boolean"?w.encodeValuesOnly:f.encodeValuesOnly,filter:S,format:E,formatter:_,serializeDate:typeof w.serializeDate=="function"?w.serializeDate:f.serializeDate,skipNulls:typeof w.skipNulls=="boolean"?w.skipNulls:f.skipNulls,sort:typeof w.sort=="function"?w.sort:null,strictNullHandling:typeof w.strictNullHandling=="boolean"?w.strictNullHandling:f.strictNullHandling}};return G2=function(v,w){var b=v,E=y(w),_,S;typeof E.filter=="function"?(S=E.filter,b=S("",b)):o(E.filter)&&(S=E.filter,_=S);var A=[];if(typeof b!="object"||b===null)return"";var F=i[E.arrayFormat],I=F==="comma"&&E.commaRoundTrip;_||(_=Object.keys(b)),E.sort&&_.sort(E.sort);for(var q=r(),ee=0;ee<_.length;++ee){var K=_[ee];E.skipNulls&&b[K]===null||a(A,m(b[K],K,F,I,E.allowEmptyArrays,E.strictNullHandling,E.skipNulls,E.encodeDotInKeys,E.encode?E.encoder:null,E.filter,E.sort,E.allowDots,E.serializeDate,E.format,E.formatter,E.encodeValuesOnly,E.charset,q))}var ne=A.join(E.delimiter),L=E.addQueryPrefix===!0?"?":"";return E.charsetSentinel&&(E.charset==="iso-8859-1"?L+="utf8=%26%2310003%3B&":L+="utf8=%E2%9C%93&"),ne.length>0?L+ne:""},G2}function vj(){if(rO)return V2;rO=!0;var r=sO(),e=Object.prototype.hasOwnProperty,t=Array.isArray,n={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:r.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1},i=function(d){return d.replace(/&#(\d+);/g,function(m,y){return String.fromCharCode(parseInt(y,10))})},o=function(d,m){return d&&typeof d=="string"&&m.comma&&d.indexOf(",")>-1?d.split(","):d},s="utf8=%26%2310003%3B",a="utf8=%E2%9C%93",u=function(m,y){var v={__proto__:null},w=y.ignoreQueryPrefix?m.replace(/^\?/,""):m;w=w.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var b=y.parameterLimit===1/0?void 0:y.parameterLimit,E=w.split(y.delimiter,b),_=-1,S,A=y.charset;if(y.charsetSentinel)for(S=0;S<E.length;++S)E[S].indexOf("utf8=")===0&&(E[S]===a?A="utf-8":E[S]===s&&(A="iso-8859-1"),_=S,S=E.length);for(S=0;S<E.length;++S)if(S!==_){var F=E[S],I=F.indexOf("]="),q=I===-1?F.indexOf("="):I+1,ee,K;q===-1?(ee=y.decoder(F,n.decoder,A,"key"),K=y.strictNullHandling?null:""):(ee=y.decoder(F.slice(0,q),n.decoder,A,"key"),K=r.maybeMap(o(F.slice(q+1),y),function(L){return y.decoder(L,n.decoder,A,"value")})),K&&y.interpretNumericEntities&&A==="iso-8859-1"&&(K=i(K)),F.indexOf("[]=")>-1&&(K=t(K)?[K]:K);var ne=e.call(v,ee);ne&&y.duplicates==="combine"?v[ee]=r.combine(v[ee],K):(!ne||y.duplicates==="last")&&(v[ee]=K)}return v},c=function(d,m,y,v){for(var w=v?m:o(m,y),b=d.length-1;b>=0;--b){var E,_=d[b];if(_==="[]"&&y.parseArrays)E=y.allowEmptyArrays&&(w===""||y.strictNullHandling&&w===null)?[]:[].concat(w);else{E=y.plainObjects?Object.create(null):{};var S=_.charAt(0)==="["&&_.charAt(_.length-1)==="]"?_.slice(1,-1):_,A=y.decodeDotInKeys?S.replace(/%2E/g,"."):S,F=parseInt(A,10);!y.parseArrays&&A===""?E={0:w}:!isNaN(F)&&_!==A&&String(F)===A&&F>=0&&y.parseArrays&&F<=y.arrayLimit?(E=[],E[F]=w):A!=="__proto__"&&(E[A]=w)}w=E}return w},f=function(m,y,v,w){if(m){var b=v.allowDots?m.replace(/\.([^.[]+)/g,"[$1]"):m,E=/(\[[^[\]]*])/,_=/(\[[^[\]]*])/g,S=v.depth>0&&E.exec(b),A=S?b.slice(0,S.index):b,F=[];if(A){if(!v.plainObjects&&e.call(Object.prototype,A)&&!v.allowPrototypes)return;F.push(A)}for(var I=0;v.depth>0&&(S=_.exec(b))!==null&&I<v.depth;){if(I+=1,!v.plainObjects&&e.call(Object.prototype,S[1].slice(1,-1))&&!v.allowPrototypes)return;F.push(S[1])}if(S){if(v.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+v.depth+" and strictDepth is true");F.push("["+b.slice(S.index)+"]")}return c(F,y,v,w)}},h=function(m){if(!m)return n;if(typeof m.allowEmptyArrays<"u"&&typeof m.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof m.decodeDotInKeys<"u"&&typeof m.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(m.decoder!==null&&typeof m.decoder<"u"&&typeof m.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof m.charset<"u"&&m.charset!=="utf-8"&&m.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var y=typeof m.charset>"u"?n.charset:m.charset,v=typeof m.duplicates>"u"?n.duplicates:m.duplicates;if(v!=="combine"&&v!=="first"&&v!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var w=typeof m.allowDots>"u"?m.decodeDotInKeys===!0?!0:n.allowDots:!!m.allowDots;return{allowDots:w,allowEmptyArrays:typeof m.allowEmptyArrays=="boolean"?!!m.allowEmptyArrays:n.allowEmptyArrays,allowPrototypes:typeof m.allowPrototypes=="boolean"?m.allowPrototypes:n.allowPrototypes,allowSparse:typeof m.allowSparse=="boolean"?m.allowSparse:n.allowSparse,arrayLimit:typeof m.arrayLimit=="number"?m.arrayLimit:n.arrayLimit,charset:y,charsetSentinel:typeof m.charsetSentinel=="boolean"?m.charsetSentinel:n.charsetSentinel,comma:typeof m.comma=="boolean"?m.comma:n.comma,decodeDotInKeys:typeof m.decodeDotInKeys=="boolean"?m.decodeDotInKeys:n.decodeDotInKeys,decoder:typeof m.decoder=="function"?m.decoder:n.decoder,delimiter:typeof m.delimiter=="string"||r.isRegExp(m.delimiter)?m.delimiter:n.delimiter,depth:typeof m.depth=="number"||m.depth===!1?+m.depth:n.depth,duplicates:v,ignoreQueryPrefix:m.ignoreQueryPrefix===!0,interpretNumericEntities:typeof m.interpretNumericEntities=="boolean"?m.interpretNumericEntities:n.interpretNumericEntities,parameterLimit:typeof m.parameterLimit=="number"?m.parameterLimit:n.parameterLimit,parseArrays:m.parseArrays!==!1,plainObjects:typeof m.plainObjects=="boolean"?m.plainObjects:n.plainObjects,strictDepth:typeof m.strictDepth=="boolean"?!!m.strictDepth:n.strictDepth,strictNullHandling:typeof m.strictNullHandling=="boolean"?m.strictNullHandling:n.strictNullHandling}};return V2=function(d,m){var y=h(m);if(d===""||d===null||typeof d>"u")return y.plainObjects?Object.create(null):{};for(var v=typeof d=="string"?u(d,y):d,w=y.plainObjects?Object.create(null):{},b=Object.keys(v),E=0;E<b.length;++E){var _=b[E],S=f(_,v[_],y,typeof d=="string");w=r.merge(w,S,y)}return y.allowSparse===!0?w:r.compact(w)},V2}function Ej(){if(nO)return Y2;nO=!0;var r=wj(),e=vj(),t=K2();return Y2={formats:t,parse:e,stringify:r},Y2}function _j(){if(iO)return oc;iO=!0;var r=Tl;function e(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var t=/^([a-z0-9.+-]+:)/i,n=/:[0-9]*$/,i=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,o=["<",">",'"',"`"," ","\r",`
|
|
78
|
-
`," "],s=["{","}","|","\\","^","`"].concat(o),a=["'"].concat(s),u=["%","/","?",";","#"].concat(a),c=["/","?","#"],f=255,h=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},y={javascript:!0,"javascript:":!0},v={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},w=Ej();function b(A,F,I){if(A&&typeof A=="object"&&A instanceof e)return A;var q=new e;return q.parse(A,F,I),q}e.prototype.parse=function(A,F,I){if(typeof A!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof A);var q=A.indexOf("?"),ee=q!==-1&&q<A.indexOf("#")?"?":"#",K=A.split(ee),ne=/\\/g;K[0]=K[0].replace(ne,"/"),A=K.join(ee);var L=A;if(L=L.trim(),!I&&A.split("#").length===1){var $=i.exec(L);if($)return this.path=L,this.href=L,this.pathname=$[1],$[2]?(this.search=$[2],F?this.query=w.parse(this.search.substr(1)):this.query=this.search.substr(1)):F&&(this.search="",this.query={}),this}var Y=t.exec(L);if(Y){Y=Y[0];var ie=Y.toLowerCase();this.protocol=ie,L=L.substr(Y.length)}if(I||Y||L.match(/^\/\/[^@/]+@[^@/]+/)){var re=L.substr(0,2)==="//";re&&!(Y&&y[Y])&&(L=L.substr(2),this.slashes=!0)}if(!y[Y]&&(re||Y&&!v[Y])){for(var k=-1,x=0;x<c.length;x++){var P=L.indexOf(c[x]);P!==-1&&(k===-1||P<k)&&(k=P)}var C,j;k===-1?j=L.lastIndexOf("@"):j=L.lastIndexOf("@",k),j!==-1&&(C=L.slice(0,j),L=L.slice(j+1),this.auth=decodeURIComponent(C)),k=-1;for(var x=0;x<u.length;x++){var P=L.indexOf(u[x]);P!==-1&&(k===-1||P<k)&&(k=P)}k===-1&&(k=L.length),this.host=L.slice(0,k),L=L.slice(k),this.parseHost(),this.hostname=this.hostname||"";var U=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!U)for(var B=this.hostname.split(/\./),x=0,Q=B.length;x<Q;x++){var fe=B[x];if(fe&&!fe.match(h)){for(var Ee="",te=0,H=fe.length;te<H;te++)fe.charCodeAt(te)>127?Ee+="x":Ee+=fe[te];if(!Ee.match(h)){var ae=B.slice(0,x),we=B.slice(x+1),xe=fe.match(d);xe&&(ae.push(xe[1]),we.unshift(xe[2])),we.length&&(L="/"+we.join(".")+L),this.hostname=ae.join(".");break}}}this.hostname.length>f?this.hostname="":this.hostname=this.hostname.toLowerCase(),U||(this.hostname=r.toASCII(this.hostname));var V=this.port?":"+this.port:"",M=this.hostname||"";this.host=M+V,this.href+=this.host,U&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),L[0]!=="/"&&(L="/"+L))}if(!m[ie])for(var x=0,Q=a.length;x<Q;x++){var oe=a[x];if(L.indexOf(oe)!==-1){var ge=encodeURIComponent(oe);ge===oe&&(ge=escape(oe)),L=L.split(oe).join(ge)}}var Se=L.indexOf("#");Se!==-1&&(this.hash=L.substr(Se),L=L.slice(0,Se));var be=L.indexOf("?");if(be!==-1?(this.search=L.substr(be),this.query=L.substr(be+1),F&&(this.query=w.parse(this.query)),L=L.slice(0,be)):F&&(this.search="",this.query={}),L&&(this.pathname=L),v[ie]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var V=this.pathname||"",pe=this.search||"";this.path=V+pe}return this.href=this.format(),this};function E(A){return typeof A=="string"&&(A=b(A)),A instanceof e?A.format():e.prototype.format.call(A)}e.prototype.format=function(){var A=this.auth||"";A&&(A=encodeURIComponent(A),A=A.replace(/%3A/i,":"),A+="@");var F=this.protocol||"",I=this.pathname||"",q=this.hash||"",ee=!1,K="";this.host?ee=A+this.host:this.hostname&&(ee=A+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(ee+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(K=w.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var ne=this.search||K&&"?"+K||"";return F&&F.substr(-1)!==":"&&(F+=":"),this.slashes||(!F||v[F])&&ee!==!1?(ee="//"+(ee||""),I&&I.charAt(0)!=="/"&&(I="/"+I)):ee||(ee=""),q&&q.charAt(0)!=="#"&&(q="#"+q),ne&&ne.charAt(0)!=="?"&&(ne="?"+ne),I=I.replace(/[?#]/g,function(L){return encodeURIComponent(L)}),ne=ne.replace("#","%23"),F+ee+I+ne+q};function _(A,F){return b(A,!1,!0).resolve(F)}e.prototype.resolve=function(A){return this.resolveObject(b(A,!1,!0)).format()};function S(A,F){return A?b(A,!1,!0).resolveObject(F):F}return e.prototype.resolveObject=function(A){if(typeof A=="string"){var F=new e;F.parse(A,!1,!0),A=F}for(var I=new e,q=Object.keys(this),ee=0;ee<q.length;ee++){var K=q[ee];I[K]=this[K]}if(I.hash=A.hash,A.href==="")return I.href=I.format(),I;if(A.slashes&&!A.protocol){for(var ne=Object.keys(A),L=0;L<ne.length;L++){var $=ne[L];$!=="protocol"&&(I[$]=A[$])}return v[I.protocol]&&I.hostname&&!I.pathname&&(I.pathname="/",I.path=I.pathname),I.href=I.format(),I}if(A.protocol&&A.protocol!==I.protocol){if(!v[A.protocol]){for(var Y=Object.keys(A),ie=0;ie<Y.length;ie++){var re=Y[ie];I[re]=A[re]}return I.href=I.format(),I}if(I.protocol=A.protocol,!A.host&&!y[A.protocol]){for(var Q=(A.pathname||"").split("/");Q.length&&!(A.host=Q.shift()););A.host||(A.host=""),A.hostname||(A.hostname=""),Q[0]!==""&&Q.unshift(""),Q.length<2&&Q.unshift(""),I.pathname=Q.join("/")}else I.pathname=A.pathname;if(I.search=A.search,I.query=A.query,I.host=A.host||"",I.auth=A.auth,I.hostname=A.hostname||A.host,I.port=A.port,I.pathname||I.search){var k=I.pathname||"",x=I.search||"";I.path=k+x}return I.slashes=I.slashes||A.slashes,I.href=I.format(),I}var P=I.pathname&&I.pathname.charAt(0)==="/",C=A.host||A.pathname&&A.pathname.charAt(0)==="/",j=C||P||I.host&&A.pathname,U=j,B=I.pathname&&I.pathname.split("/")||[],Q=A.pathname&&A.pathname.split("/")||[],fe=I.protocol&&!v[I.protocol];if(fe&&(I.hostname="",I.port=null,I.host&&(B[0]===""?B[0]=I.host:B.unshift(I.host)),I.host="",A.protocol&&(A.hostname=null,A.port=null,A.host&&(Q[0]===""?Q[0]=A.host:Q.unshift(A.host)),A.host=null),j=j&&(Q[0]===""||B[0]==="")),C)I.host=A.host||A.host===""?A.host:I.host,I.hostname=A.hostname||A.hostname===""?A.hostname:I.hostname,I.search=A.search,I.query=A.query,B=Q;else if(Q.length)B||(B=[]),B.pop(),B=B.concat(Q),I.search=A.search,I.query=A.query;else if(A.search!=null){if(fe){I.host=B.shift(),I.hostname=I.host;var Ee=I.host&&I.host.indexOf("@")>0?I.host.split("@"):!1;Ee&&(I.auth=Ee.shift(),I.hostname=Ee.shift(),I.host=I.hostname)}return I.search=A.search,I.query=A.query,(I.pathname!==null||I.search!==null)&&(I.path=(I.pathname?I.pathname:"")+(I.search?I.search:"")),I.href=I.format(),I}if(!B.length)return I.pathname=null,I.search?I.path="/"+I.search:I.path=null,I.href=I.format(),I;for(var te=B.slice(-1)[0],H=(I.host||A.host||B.length>1)&&(te==="."||te==="..")||te==="",ae=0,we=B.length;we>=0;we--)te=B[we],te==="."?B.splice(we,1):te===".."?(B.splice(we,1),ae++):ae&&(B.splice(we,1),ae--);if(!j&&!U)for(;ae--;ae)B.unshift("..");j&&B[0]!==""&&(!B[0]||B[0].charAt(0)!=="/")&&B.unshift(""),H&&B.join("/").substr(-1)!=="/"&&B.push("");var xe=B[0]===""||B[0]&&B[0].charAt(0)==="/";if(fe){I.hostname=xe?"":B.length?B.shift():"",I.host=I.hostname;var Ee=I.host&&I.host.indexOf("@")>0?I.host.split("@"):!1;Ee&&(I.auth=Ee.shift(),I.hostname=Ee.shift(),I.host=I.hostname)}return j=j||I.host&&B.length,j&&!xe&&B.unshift(""),B.length>0?I.pathname=B.join("/"):(I.pathname=null,I.path=null),(I.pathname!==null||I.search!==null)&&(I.path=(I.pathname?I.pathname:"")+(I.search?I.search:"")),I.auth=A.auth||I.auth,I.slashes=I.slashes||A.slashes,I.href=I.format(),I},e.prototype.parseHost=function(){var A=this.host,F=n.exec(A);F&&(F=F[0],F!==":"&&(this.port=F.substr(1)),A=A.substr(0,A.length-F.length)),A&&(this.hostname=A)},oc.parse=b,oc.resolve=_,oc.resolveObject=S,oc.format=E,oc.Url=e,oc}function Z2(r){if(typeof r=="string")r=new URL(r);else if(!(r instanceof URL))throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");if(r.protocol!=="file:")throw new Deno.errors.InvalidData("invalid url scheme");return X2?Lj(r):Pj(r)}function Lj(r){let e=r.hostname,t=r.pathname;for(let n=0;n<t.length;n++)if(t[n]==="%"){let i=t.codePointAt(n+2)||32;if(t[n+1]==="2"&&i===102||t[n+1]==="5"&&i===99)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(t=t.replace(Rj,"\\"),t=decodeURIComponent(t),e!=="")return`\\\\${e}${t}`;{let n=t.codePointAt(1)|32,i=t[2];if(n<Tj||n>Cj||i!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return t.slice(1)}}function Pj(r){if(r.hostname!=="")throw new Deno.errors.InvalidData("invalid file url hostname");let e=r.pathname;for(let t=0;t<e.length;t++)if(e[t]==="%"){let n=e.codePointAt(t+2)||32;if(e[t+1]==="2"&&n===102)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(e)}function Mj(r){let e=U2.resolve(r),t=r.charCodeAt(r.length-1);(t===Sj||X2&&t===xj)&&e[e.length-1]!==U2.sep&&(e+="/");let n=new URL("file://");return e.includes("%")&&(e=e.replace(Dj,"%25")),!X2&&e.includes("\\")&&(e=e.replace(Ij,"%5C")),e.includes(`
|
|
79
|
-
`)&&(e=e.replace(Nj,"%0A")),e.includes("\r")&&(e=e.replace(Oj,"%0D")),e.includes(" ")&&(e=e.replace(kj,"%09")),n.pathname=e,n}var mj,$2,ZN,W2,z2,JN,H2,QN,q2,eO,G2,tO,V2,rO,Y2,nO,oc,iO,ui,Aj,fK,hK,dK,pK,gK,mK,xj,Sj,Tj,Cj,X2,Rj,Dj,Ij,Nj,Oj,kj,oO=_t(()=>{Te();Re();Ce();d2();og();j2();Ju();mj=Object.freeze(Object.create(null)),$2={},ZN=!1,W2=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;z2={},JN=!1;H2={},QN=!1;q2={},eO=!1;G2={},tO=!1;V2={},rO=!1;Y2={},nO=!1;oc={},iO=!1;ui=_j();ui.parse;ui.resolve;ui.resolveObject;ui.format;ui.Url;Aj=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;ui.URL=typeof URL<"u"?URL:null;ui.pathToFileURL=Mj;ui.fileURLToPath=Z2;fK=ui.Url,hK=ui.format,dK=ui.resolve,pK=ui.resolveObject,gK=ui.parse,mK=ui.URL,xj=92,Sj=47,Tj=97,Cj=122,X2=Aj==="win32",Rj=/\//g,Dj=/%/g,Ij=/\\/g,Nj=/\n/g,Oj=/\r/g,kj=/\t/g});var Lb={};uo(Lb,{Dir:()=>x9,Dirent:()=>S9,F_OK:()=>O9,FileReadStream:()=>D9,FileWriteStream:()=>I9,R_OK:()=>k9,ReadStream:()=>C9,Stats:()=>T9,W_OK:()=>L9,WriteStream:()=>R9,X_OK:()=>P9,_toUnixTimestamp:()=>N9,access:()=>Qj,accessSync:()=>e$,appendFile:()=>Zj,appendFileSync:()=>Jj,chmod:()=>n$,chmodSync:()=>i$,chown:()=>t$,chownSync:()=>r$,close:()=>s$,closeSync:()=>o$,constants:()=>M9,copyFile:()=>a$,copyFileSync:()=>l$,cp:()=>u$,cpSync:()=>c$,createReadStream:()=>f$,createWriteStream:()=>h$,default:()=>vr,exists:()=>d$,existsSync:()=>kb,fchmod:()=>m$,fchmodSync:()=>y$,fchown:()=>p$,fchownSync:()=>g$,fdatasync:()=>b$,fdatasyncSync:()=>w$,fstat:()=>v$,fstatSync:()=>E$,fsync:()=>_$,fsyncSync:()=>A$,ftruncate:()=>x$,ftruncateSync:()=>S$,futimes:()=>T$,futimesSync:()=>C$,lchmod:()=>I$,lchmodSync:()=>N$,lchown:()=>R$,lchownSync:()=>D$,link:()=>O$,linkSync:()=>k$,lstat:()=>L$,lstatSync:()=>t_,mkdir:()=>P$,mkdirSync:()=>M$,mkdtemp:()=>B$,mkdtempSync:()=>F$,open:()=>U$,openSync:()=>j$,opendir:()=>$$,opendirSync:()=>W$,promises:()=>B9,read:()=>q$,readFile:()=>X$,readFileSync:()=>r_,readSync:()=>G$,readdir:()=>z$,readdirSync:()=>H$,readlink:()=>K$,readlinkSync:()=>Z$,readv:()=>V$,readvSync:()=>Y$,realpath:()=>J$,realpathSync:()=>Q$,rename:()=>e9,renameSync:()=>t9,rm:()=>r9,rmSync:()=>n9,rmdir:()=>i9,rmdirSync:()=>s9,stat:()=>o9,statSync:()=>a9,symlink:()=>l9,symlinkSync:()=>u9,truncate:()=>c9,truncateSync:()=>f9,unlink:()=>d9,unlinkSync:()=>p9,unwatchFile:()=>h9,utimes:()=>g9,utimesSync:()=>m9,watch:()=>y9,watchFile:()=>b9,write:()=>v9,writeFile:()=>w9,writeFileSync:()=>NO,writeSync:()=>E9,writev:()=>_9,writevSync:()=>A9});function ug(){return aO||(aO=!0,Object.defineProperty(ag,"__esModule",{value:!0}),ag.constants=void 0,ag.constants={O_RDONLY:0,O_WRONLY:1,O_RDWR:2,S_IFMT:61440,S_IFREG:32768,S_IFDIR:16384,S_IFCHR:8192,S_IFBLK:24576,S_IFIFO:4096,S_IFLNK:40960,S_IFSOCK:49152,O_CREAT:64,O_EXCL:128,O_NOCTTY:256,O_TRUNC:512,O_APPEND:1024,O_DIRECTORY:65536,O_NOATIME:262144,O_NOFOLLOW:131072,O_SYNC:1052672,O_DIRECT:16384,O_NONBLOCK:2048,S_IRWXU:448,S_IRUSR:256,S_IWUSR:128,S_IXUSR:64,S_IRWXG:56,S_IRGRP:32,S_IWGRP:16,S_IXGRP:8,S_IRWXO:7,S_IROTH:4,S_IWOTH:2,S_IXOTH:1,F_OK:0,R_OK:4,W_OK:2,X_OK:1,UV_FS_SYMLINK_DIR:1,UV_FS_SYMLINK_JUNCTION:2,UV_FS_COPYFILE_EXCL:1,UV_FS_COPYFILE_FICLONE:2,UV_FS_COPYFILE_FICLONE_FORCE:4,COPYFILE_EXCL:1,COPYFILE_FICLONE:2,COPYFILE_FICLONE_FORCE:4}),ag}function Bj(){return lO||(lO=!0,typeof BigInt=="function"?Ib.default=BigInt:Ib.default=function(){throw new Error("BigInt is not supported in this environment.")}),Ib}function J2(){if(uO)return ph;uO=!0,Object.defineProperty(ph,"__esModule",{value:!0}),ph.Stats=void 0;var r=ug(),e=Bj(),t=r.constants.S_IFMT,n=r.constants.S_IFDIR,i=r.constants.S_IFREG,o=r.constants.S_IFBLK,s=r.constants.S_IFCHR,a=r.constants.S_IFLNK,u=r.constants.S_IFIFO,c=r.constants.S_IFSOCK,f=(function(){function h(){}return h.build=function(d,m){m===void 0&&(m=!1);var y=new h,v=d.uid,w=d.gid,b=d.atime,E=d.mtime,_=d.ctime,S=m?e.default:function(F){return F};y.uid=S(v),y.gid=S(w),y.rdev=S(0),y.blksize=S(4096),y.ino=S(d.ino),y.size=S(d.getSize()),y.blocks=S(1),y.atime=b,y.mtime=E,y.ctime=_,y.birthtime=_,y.atimeMs=S(b.getTime()),y.mtimeMs=S(E.getTime());var A=S(_.getTime());return y.ctimeMs=A,y.birthtimeMs=A,y.dev=S(0),y.mode=S(d.mode),y.nlink=S(d.nlink),y},h.prototype._checkModeProperty=function(d){return(Number(this.mode)&t)===d},h.prototype.isDirectory=function(){return this._checkModeProperty(n)},h.prototype.isFile=function(){return this._checkModeProperty(i)},h.prototype.isBlockDevice=function(){return this._checkModeProperty(o)},h.prototype.isCharacterDevice=function(){return this._checkModeProperty(s)},h.prototype.isSymbolicLink=function(){return this._checkModeProperty(a)},h.prototype.isFIFO=function(){return this._checkModeProperty(u)},h.prototype.isSocket=function(){return this._checkModeProperty(c)},h})();return ph.Stats=f,ph.default=f,ph}function Q2(){if(cO)return Us;cO=!0;var r=Us&&Us.__spreadArray||function(o,s,a){if(a||arguments.length===2)for(var u=0,c=s.length,f;u<c;u++)(f||!(u in s))&&(f||(f=Array.prototype.slice.call(s,0,u)),f[u]=s[u]);return o.concat(f||Array.prototype.slice.call(s))};Object.defineProperty(Us,"__esModule",{value:!0}),Us.bufferFrom=Us.bufferAllocUnsafe=Us.Buffer=void 0;var e=gn();Object.defineProperty(Us,"Buffer",{enumerable:!0,get:function(){return e.Buffer}});function t(o){for(var s=[],a=1;a<arguments.length;a++)s[a-1]=arguments[a];return new(e.Buffer.bind.apply(e.Buffer,r([void 0,o],s,!1)))}var n=e.Buffer.allocUnsafe||t;Us.bufferAllocUnsafe=n;var i=e.Buffer.from||t;return Us.bufferFrom=i,Us}function xO(){if(fO)return un;fO=!0;var r=un&&un.__extends||(function(){var y=function(v,w){return y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,E){b.__proto__=E}||function(b,E){for(var _ in E)Object.prototype.hasOwnProperty.call(E,_)&&(b[_]=E[_])},y(v,w)};return function(v,w){if(typeof w!="function"&&w!==null)throw new TypeError("Class extends value "+String(w)+" is not a constructor or null");y(v,w);function b(){this.constructor=v}v.prototype=w===null?Object.create(w):(b.prototype=w.prototype,new b)}})();Object.defineProperty(un,"__esModule",{value:!0}),un.E=un.AssertionError=un.message=un.RangeError=un.TypeError=un.Error=void 0;var e=gt,t=qe,n=typeof Symbol>"u"?"_kCode":Symbol("code"),i={};function o(y){return(function(v){r(w,v);function w(b){for(var E=[],_=1;_<arguments.length;_++)E[_-1]=arguments[_];var S=v.call(this,u(b,E))||this;return S.code=b,S[n]=b,S.name="".concat(v.prototype.name," [").concat(S[n],"]"),S}return w})(y)}var s=typeof globalThis<"u"?globalThis:Fj,a=(function(y){r(v,y);function v(w){var b=this;if(typeof w!="object"||w===null)throw new un.TypeError("ERR_INVALID_ARG_TYPE","options","object");return w.message?b=y.call(this,w.message)||this:b=y.call(this,"".concat(t.inspect(w.actual).slice(0,128)," ")+"".concat(w.operator," ").concat(t.inspect(w.expected).slice(0,128)))||this,b.generatedMessage=!w.message,b.name="AssertionError [ERR_ASSERTION]",b.code="ERR_ASSERTION",b.actual=w.actual,b.expected=w.expected,b.operator=w.operator,un.Error.captureStackTrace(b,w.stackStartFunction),b}return v})(s.Error);un.AssertionError=a;function u(y,v){e.strictEqual(typeof y,"string");var w=i[y];e(w,"An invalid error message key was used: ".concat(y,"."));var b;if(typeof w=="function")b=w;else{if(b=t.format,v===void 0||v.length===0)return w;v.unshift(w)}return String(b.apply(null,v))}un.message=u;function c(y,v){i[y]=typeof v=="function"?v:String(v)}un.E=c,un.Error=o(s.Error),un.TypeError=o(s.TypeError),un.RangeError=o(s.RangeError),c("ERR_ARG_NOT_ITERABLE","%s must be iterable"),c("ERR_ASSERTION","%s"),c("ERR_BUFFER_OUT_OF_BOUNDS",m),c("ERR_CHILD_CLOSED_BEFORE_REPLY","Child closed before reply received"),c("ERR_CONSOLE_WRITABLE_STREAM","Console expects a writable stream instance for %s"),c("ERR_CPU_USAGE","Unable to obtain cpu usage %s"),c("ERR_DNS_SET_SERVERS_FAILED",function(y,v){return'c-ares failed to set servers: "'.concat(y,'" [').concat(v,"]")}),c("ERR_FALSY_VALUE_REJECTION","Promise was rejected with falsy value"),c("ERR_ENCODING_NOT_SUPPORTED",function(y){return'The "'.concat(y,'" encoding is not supported')}),c("ERR_ENCODING_INVALID_ENCODED_DATA",function(y){return"The encoded data was not valid for encoding ".concat(y)}),c("ERR_HTTP_HEADERS_SENT","Cannot render headers after they are sent to the client"),c("ERR_HTTP_INVALID_STATUS_CODE","Invalid status code: %s"),c("ERR_HTTP_TRAILER_INVALID","Trailers are invalid with this transfer encoding"),c("ERR_INDEX_OUT_OF_RANGE","Index out of range"),c("ERR_INVALID_ARG_TYPE",f),c("ERR_INVALID_ARRAY_LENGTH",function(y,v,w){return e.strictEqual(typeof w,"number"),'The array "'.concat(y,'" (length ').concat(w,") must be of length ").concat(v,".")}),c("ERR_INVALID_BUFFER_SIZE","Buffer size must be a multiple of %s"),c("ERR_INVALID_CALLBACK","Callback must be a function"),c("ERR_INVALID_CHAR","Invalid character in %s"),c("ERR_INVALID_CURSOR_POS","Cannot set cursor row without setting its column"),c("ERR_INVALID_FD",'"fd" must be a positive integer: %s'),c("ERR_INVALID_FILE_URL_HOST",'File URL host must be "localhost" or empty on %s'),c("ERR_INVALID_FILE_URL_PATH","File URL path %s"),c("ERR_INVALID_HANDLE_TYPE","This handle type cannot be sent"),c("ERR_INVALID_IP_ADDRESS","Invalid IP address: %s"),c("ERR_INVALID_OPT_VALUE",function(y,v){return'The value "'.concat(String(v),'" is invalid for option "').concat(y,'"')}),c("ERR_INVALID_OPT_VALUE_ENCODING",function(y){return'The value "'.concat(String(y),'" is invalid for option "encoding"')}),c("ERR_INVALID_REPL_EVAL_CONFIG",'Cannot specify both "breakEvalOnSigint" and "eval" for REPL'),c("ERR_INVALID_SYNC_FORK_INPUT","Asynchronous forks do not support Buffer, Uint8Array or string input: %s"),c("ERR_INVALID_THIS",'Value of "this" must be of type %s'),c("ERR_INVALID_TUPLE","%s must be an iterable %s tuple"),c("ERR_INVALID_URL","Invalid URL: %s"),c("ERR_INVALID_URL_SCHEME",function(y){return"The URL must be ".concat(d(y,"scheme"))}),c("ERR_IPC_CHANNEL_CLOSED","Channel closed"),c("ERR_IPC_DISCONNECTED","IPC channel is already disconnected"),c("ERR_IPC_ONE_PIPE","Child process can have only one IPC pipe"),c("ERR_IPC_SYNC_FORK","IPC cannot be used with synchronous forks"),c("ERR_MISSING_ARGS",h),c("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),c("ERR_NAPI_CONS_FUNCTION","Constructor must be a function"),c("ERR_NAPI_CONS_PROTOTYPE_OBJECT","Constructor.prototype must be an object"),c("ERR_NO_CRYPTO","Node.js is not compiled with OpenSSL crypto support"),c("ERR_NO_LONGER_SUPPORTED","%s is no longer supported"),c("ERR_PARSE_HISTORY_DATA","Could not parse history data in %s"),c("ERR_SOCKET_ALREADY_BOUND","Socket is already bound"),c("ERR_SOCKET_BAD_PORT","Port should be > 0 and < 65536"),c("ERR_SOCKET_BAD_TYPE","Bad socket type specified. Valid types are: udp4, udp6"),c("ERR_SOCKET_CANNOT_SEND","Unable to send data"),c("ERR_SOCKET_CLOSED","Socket is closed"),c("ERR_SOCKET_DGRAM_NOT_RUNNING","Not running"),c("ERR_STDERR_CLOSE","process.stderr cannot be closed"),c("ERR_STDOUT_CLOSE","process.stdout cannot be closed"),c("ERR_STREAM_WRAP","Stream has StringDecoder set or is in objectMode"),c("ERR_TLS_CERT_ALTNAME_INVALID","Hostname/IP does not match certificate's altnames: %s"),c("ERR_TLS_DH_PARAM_SIZE",function(y){return"DH parameter size ".concat(y," is less than 2048")}),c("ERR_TLS_HANDSHAKE_TIMEOUT","TLS handshake timeout"),c("ERR_TLS_RENEGOTIATION_FAILED","Failed to renegotiate"),c("ERR_TLS_REQUIRED_SERVER_NAME",'"servername" is required parameter for Server.addContext'),c("ERR_TLS_SESSION_ATTACK","TSL session renegotiation attack detected"),c("ERR_TRANSFORM_ALREADY_TRANSFORMING","Calling transform done when still transforming"),c("ERR_TRANSFORM_WITH_LENGTH_0","Calling transform done when writableState.length != 0"),c("ERR_UNKNOWN_ENCODING","Unknown encoding: %s"),c("ERR_UNKNOWN_SIGNAL","Unknown signal: %s"),c("ERR_UNKNOWN_STDIN_TYPE","Unknown stdin file type"),c("ERR_UNKNOWN_STREAM_TYPE","Unknown stream file type"),c("ERR_V8BREAKITERATOR","Full ICU data not installed. See https://github.com/nodejs/node/wiki/Intl");function f(y,v,w){e(y,"name is required");var b;v.includes("not ")?(b="must not be",v=v.split("not ")[1]):b="must be";var E;if(Array.isArray(y)){var _=y.map(function(A){return'"'.concat(A,'"')}).join(", ");E="The ".concat(_," arguments ").concat(b," ").concat(d(v,"type"))}else if(y.includes(" argument"))E="The ".concat(y," ").concat(b," ").concat(d(v,"type"));else{var S=y.includes(".")?"property":"argument";E='The "'.concat(y,'" ').concat(S," ").concat(b," ").concat(d(v,"type"))}return arguments.length>=3&&(E+=". Received type ".concat(w!==null?typeof w:"null")),E}function h(){for(var y=[],v=0;v<arguments.length;v++)y[v]=arguments[v];e(y.length>0,"At least one arg needs to be specified");var w="The ",b=y.length;switch(y=y.map(function(E){return'"'.concat(E,'"')}),b){case 1:w+="".concat(y[0]," argument");break;case 2:w+="".concat(y[0]," and ").concat(y[1]," arguments");break;default:w+=y.slice(0,b-1).join(", "),w+=", and ".concat(y[b-1]," arguments");break}return"".concat(w," must be specified")}function d(y,v){if(e(y,"expected is required"),e(typeof v=="string","thing is required"),Array.isArray(y)){var w=y.length;return e(w>0,"At least one expected value needs to be specified"),y=y.map(function(b){return String(b)}),w>2?"one of ".concat(v," ").concat(y.slice(0,w-1).join(", "),", or ")+y[w-1]:w===2?"one of ".concat(v," ").concat(y[0]," or ").concat(y[1]):"of ".concat(v," ").concat(y[0])}else return"of ".concat(v," ").concat(String(y))}function m(y,v){return v?"Attempt to write outside buffer bounds":'"'.concat(y,'" is outside of buffer bounds')}return un}function SO(){if(hO)return go;hO=!0,Object.defineProperty(go,"__esModule",{value:!0}),go.strToEncoding=go.assertEncoding=go.ENCODING_UTF8=void 0;var r=Q2(),e=xO();go.ENCODING_UTF8="utf8";function t(i){if(i&&!r.Buffer.isEncoding(i))throw new e.TypeError("ERR_INVALID_OPT_VALUE_ENCODING",i)}go.assertEncoding=t;function n(i,o){return!o||o===go.ENCODING_UTF8?i:o==="buffer"?new r.Buffer(i):new r.Buffer(i).toString(o)}return go.strToEncoding=n,go}function TO(){if(dO)return gh;dO=!0,Object.defineProperty(gh,"__esModule",{value:!0}),gh.Dirent=void 0;var r=ug(),e=SO(),t=r.constants.S_IFMT,n=r.constants.S_IFDIR,i=r.constants.S_IFREG,o=r.constants.S_IFBLK,s=r.constants.S_IFCHR,a=r.constants.S_IFLNK,u=r.constants.S_IFIFO,c=r.constants.S_IFSOCK,f=(function(){function h(){this.name="",this.mode=0}return h.build=function(d,m){var y=new h,v=d.getNode().mode;return y.name=(0,e.strToEncoding)(d.getName(),m),y.mode=v,y},h.prototype._checkModeProperty=function(d){return(this.mode&t)===d},h.prototype.isDirectory=function(){return this._checkModeProperty(n)},h.prototype.isFile=function(){return this._checkModeProperty(i)},h.prototype.isBlockDevice=function(){return this._checkModeProperty(o)},h.prototype.isCharacterDevice=function(){return this._checkModeProperty(s)},h.prototype.isSymbolicLink=function(){return this._checkModeProperty(a)},h.prototype.isFIFO=function(){return this._checkModeProperty(u)},h.prototype.isSocket=function(){return this._checkModeProperty(c)},h})();return gh.Dirent=f,gh.default=f,gh}function CO(){if(pO)return Nb;pO=!0;var r=qr;Object.defineProperty(Nb,"__esModule",{value:!0});var e;return typeof r.nextTick=="function"?e=r.nextTick.bind(typeof globalThis<"u"?globalThis:gO):e=setTimeout.bind(typeof globalThis<"u"?globalThis:gO),Nb.default=e,Nb}function RO(){if(mO)return mh;mO=!0;var r=qr;Object.defineProperty(mh,"__esModule",{value:!0}),mh.createProcess=void 0;var e=function(){if(typeof r<"u")return r;try{return qr}catch{return}};function t(){var n=e()||{};return n.cwd||(n.cwd=function(){return"/"}),n.nextTick||(n.nextTick=CO().default),n.emitWarning||(n.emitWarning=function(i,o){console.warn("".concat(o).concat(o?": ":"").concat(i))}),n.env||(n.env={}),n}return mh.createProcess=t,mh.default=t(),mh}function Uj(){if(yO)return ci;yO=!0;var r=ci&&ci.__extends||(function(){var w=function(b,E){return w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,S){_.__proto__=S}||function(_,S){for(var A in S)Object.prototype.hasOwnProperty.call(S,A)&&(_[A]=S[A])},w(b,E)};return function(b,E){if(typeof E!="function"&&E!==null)throw new TypeError("Class extends value "+String(E)+" is not a constructor or null");w(b,E);function _(){this.constructor=b}b.prototype=E===null?Object.create(E):(_.prototype=E.prototype,new _)}})();Object.defineProperty(ci,"__esModule",{value:!0}),ci.File=ci.Link=ci.Node=ci.SEP=void 0;var e=RO(),t=Q2(),n=ug(),i=ln,o=J2(),s=n.constants.S_IFMT,a=n.constants.S_IFDIR,u=n.constants.S_IFREG,c=n.constants.S_IFLNK,f=n.constants.O_APPEND,h=function(){var w,b;return(b=(w=e.default.getuid)===null||w===void 0?void 0:w.call(e.default))!==null&&b!==void 0?b:0},d=function(){var w,b;return(b=(w=e.default.getgid)===null||w===void 0?void 0:w.call(e.default))!==null&&b!==void 0?b:0};ci.SEP="/";var m=(function(w){r(b,w);function b(E,_){_===void 0&&(_=438);var S=w.call(this)||this;return S._uid=h(),S._gid=d(),S._atime=new Date,S._mtime=new Date,S._ctime=new Date,S._perm=438,S.mode=u,S._nlink=1,S._perm=_,S.mode|=_,S.ino=E,S}return Object.defineProperty(b.prototype,"ctime",{get:function(){return this._ctime},set:function(E){this._ctime=E},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"uid",{get:function(){return this._uid},set:function(E){this._uid=E,this.ctime=new Date},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"gid",{get:function(){return this._gid},set:function(E){this._gid=E,this.ctime=new Date},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"atime",{get:function(){return this._atime},set:function(E){this._atime=E,this.ctime=new Date},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"mtime",{get:function(){return this._mtime},set:function(E){this._mtime=E,this.ctime=new Date},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"perm",{get:function(){return this._perm},set:function(E){this._perm=E,this.ctime=new Date},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"nlink",{get:function(){return this._nlink},set:function(E){this._nlink=E,this.ctime=new Date},enumerable:!1,configurable:!0}),b.prototype.getString=function(E){return E===void 0&&(E="utf8"),this.atime=new Date,this.getBuffer().toString(E)},b.prototype.setString=function(E){this.buf=(0,t.bufferFrom)(E,"utf8"),this.touch()},b.prototype.getBuffer=function(){return this.atime=new Date,this.buf||this.setBuffer((0,t.bufferAllocUnsafe)(0)),(0,t.bufferFrom)(this.buf)},b.prototype.setBuffer=function(E){this.buf=(0,t.bufferFrom)(E),this.touch()},b.prototype.getSize=function(){return this.buf?this.buf.length:0},b.prototype.setModeProperty=function(E){this.mode=this.mode&~s|E},b.prototype.setIsFile=function(){this.setModeProperty(u)},b.prototype.setIsDirectory=function(){this.setModeProperty(a)},b.prototype.setIsSymlink=function(){this.setModeProperty(c)},b.prototype.isFile=function(){return(this.mode&s)===u},b.prototype.isDirectory=function(){return(this.mode&s)===a},b.prototype.isSymlink=function(){return(this.mode&s)===c},b.prototype.makeSymlink=function(E){this.symlink=E,this.setIsSymlink()},b.prototype.write=function(E,_,S,A){if(_===void 0&&(_=0),S===void 0&&(S=E.length),A===void 0&&(A=0),this.buf||(this.buf=(0,t.bufferAllocUnsafe)(0)),A+S>this.buf.length){var F=(0,t.bufferAllocUnsafe)(A+S);this.buf.copy(F,0,0,this.buf.length),this.buf=F}return E.copy(this.buf,A,_,_+S),this.touch(),S},b.prototype.read=function(E,_,S,A){_===void 0&&(_=0),S===void 0&&(S=E.byteLength),A===void 0&&(A=0),this.atime=new Date,this.buf||(this.buf=(0,t.bufferAllocUnsafe)(0));var F=S;return F>E.byteLength&&(F=E.byteLength),F+A>this.buf.length&&(F=this.buf.length-A),this.buf.copy(E,_,A,A+F),F},b.prototype.truncate=function(E){if(E===void 0&&(E=0),!E)this.buf=(0,t.bufferAllocUnsafe)(0);else if(this.buf||(this.buf=(0,t.bufferAllocUnsafe)(0)),E<=this.buf.length)this.buf=this.buf.slice(0,E);else{var _=(0,t.bufferAllocUnsafe)(E);this.buf.copy(_),_.fill(0,this.buf.length),this.buf=_}this.touch()},b.prototype.chmod=function(E){this.perm=E,this.mode=this.mode&-512|E,this.touch()},b.prototype.chown=function(E,_){this.uid=E,this.gid=_,this.touch()},b.prototype.touch=function(){this.mtime=new Date,this.emit("change",this)},b.prototype.canRead=function(E,_){return E===void 0&&(E=h()),_===void 0&&(_=d()),!!(this.perm&4||_===this.gid&&this.perm&32||E===this.uid&&this.perm&256)},b.prototype.canWrite=function(E,_){return E===void 0&&(E=h()),_===void 0&&(_=d()),!!(this.perm&2||_===this.gid&&this.perm&16||E===this.uid&&this.perm&128)},b.prototype.del=function(){this.emit("delete",this)},b.prototype.toJSON=function(){return{ino:this.ino,uid:this.uid,gid:this.gid,atime:this.atime.getTime(),mtime:this.mtime.getTime(),ctime:this.ctime.getTime(),perm:this.perm,mode:this.mode,nlink:this.nlink,symlink:this.symlink,data:this.getString()}},b})(i.EventEmitter);ci.Node=m;var y=(function(w){r(b,w);function b(E,_,S){var A=w.call(this)||this;return A.children={},A._steps=[],A.ino=0,A.length=0,A.vol=E,A.parent=_,A.name=S,A.syncSteps(),A}return Object.defineProperty(b.prototype,"steps",{get:function(){return this._steps},set:function(E){this._steps=E;for(var _=0,S=Object.entries(this.children);_<S.length;_++){var A=S[_],F=A[0],I=A[1];F==="."||F===".."||I?.syncSteps()}},enumerable:!1,configurable:!0}),b.prototype.setNode=function(E){this.node=E,this.ino=E.ino},b.prototype.getNode=function(){return this.node},b.prototype.createChild=function(E,_){_===void 0&&(_=this.vol.createNode());var S=new b(this.vol,this,E);return S.setNode(_),_.isDirectory()&&(S.children["."]=S,S.getNode().nlink++),this.setChild(E,S),S},b.prototype.setChild=function(E,_){_===void 0&&(_=new b(this.vol,this,E)),this.children[E]=_,_.parent=this,this.length++;var S=_.getNode();return S.isDirectory()&&(_.children[".."]=this,this.getNode().nlink++),this.getNode().mtime=new Date,this.emit("child:add",_,this),_},b.prototype.deleteChild=function(E){var _=E.getNode();_.isDirectory()&&(delete E.children[".."],this.getNode().nlink--),delete this.children[E.getName()],this.length--,this.getNode().mtime=new Date,this.emit("child:delete",E,this)},b.prototype.getChild=function(E){if(this.getNode().mtime=new Date,Object.hasOwnProperty.call(this.children,E))return this.children[E]},b.prototype.getPath=function(){return this.steps.join(ci.SEP)},b.prototype.getName=function(){return this.steps[this.steps.length-1]},b.prototype.walk=function(E,_,S){if(_===void 0&&(_=E.length),S===void 0&&(S=0),S>=E.length)return this;if(S>=_)return this;var A=E[S],F=this.getChild(A);return F?F.walk(E,_,S+1):null},b.prototype.toJSON=function(){return{steps:this.steps,ino:this.ino,children:Object.keys(this.children)}},b.prototype.syncSteps=function(){this.steps=this.parent?this.parent.steps.concat([this.name]):[this.name]},b})(i.EventEmitter);ci.Link=y;var v=(function(){function w(b,E,_,S){this.position=0,this.link=b,this.node=E,this.flags=_,this.fd=S}return w.prototype.getString=function(b){return this.node.getString()},w.prototype.setString=function(b){this.node.setString(b)},w.prototype.getBuffer=function(){return this.node.getBuffer()},w.prototype.setBuffer=function(b){this.node.setBuffer(b)},w.prototype.getSize=function(){return this.node.getSize()},w.prototype.truncate=function(b){this.node.truncate(b)},w.prototype.seekTo=function(b){this.position=b},w.prototype.stats=function(){return o.default.build(this.node)},w.prototype.write=function(b,E,_,S){E===void 0&&(E=0),_===void 0&&(_=b.length),typeof S!="number"&&(S=this.position),this.flags&f&&(S=this.getSize());var A=this.node.write(b,E,_,S);return this.position=S+A,A},w.prototype.read=function(b,E,_,S){E===void 0&&(E=0),_===void 0&&(_=b.byteLength),typeof S!="number"&&(S=this.position);var A=this.node.read(b,E,_,S);return this.position=S+A,A},w.prototype.chmod=function(b){this.node.chmod(b)},w.prototype.chown=function(b,E){this.node.chown(b,E)},w})();return ci.File=v,ci}function $j(){if(bO)return Ob;bO=!0,Object.defineProperty(Ob,"__esModule",{value:!0});function r(e,t,n){var i=setTimeout.apply(typeof globalThis<"u"?globalThis:jj,arguments);return i&&typeof i=="object"&&typeof i.unref=="function"&&i.unref(),i}return Ob.default=r,Ob}function Wj(){if(wO)return Cl;wO=!0;var r=Cl&&Cl.__spreadArray||function(i,o,s){if(s||arguments.length===2)for(var a=0,u=o.length,c;a<u;a++)(c||!(a in o))&&(c||(c=Array.prototype.slice.call(o,0,a)),c[a]=o[a]);return i.concat(c||Array.prototype.slice.call(o))};Object.defineProperty(Cl,"__esModule",{value:!0}),Cl.FileHandle=void 0;function e(i,o,s){return s===void 0&&(s=function(a){return a}),function(){for(var a=[],u=0;u<arguments.length;u++)a[u]=arguments[u];return new Promise(function(c,f){i[o].bind(i).apply(void 0,r(r([],a,!1),[function(h,d){return h?f(h):c(s(d))}],!1))})}}var t=(function(){function i(o,s){this.vol=o,this.fd=s}return i.prototype.appendFile=function(o,s){return e(this.vol,"appendFile")(this.fd,o,s)},i.prototype.chmod=function(o){return e(this.vol,"fchmod")(this.fd,o)},i.prototype.chown=function(o,s){return e(this.vol,"fchown")(this.fd,o,s)},i.prototype.close=function(){return e(this.vol,"close")(this.fd)},i.prototype.datasync=function(){return e(this.vol,"fdatasync")(this.fd)},i.prototype.read=function(o,s,a,u){return e(this.vol,"read",function(c){return{bytesRead:c,buffer:o}})(this.fd,o,s,a,u)},i.prototype.readFile=function(o){return e(this.vol,"readFile")(this.fd,o)},i.prototype.stat=function(o){return e(this.vol,"fstat")(this.fd,o)},i.prototype.sync=function(){return e(this.vol,"fsync")(this.fd)},i.prototype.truncate=function(o){return e(this.vol,"ftruncate")(this.fd,o)},i.prototype.utimes=function(o,s){return e(this.vol,"futimes")(this.fd,o,s)},i.prototype.write=function(o,s,a,u){return e(this.vol,"write",function(c){return{bytesWritten:c,buffer:o}})(this.fd,o,s,a,u)},i.prototype.writeFile=function(o,s){return e(this.vol,"writeFile")(this.fd,o,s)},i})();Cl.FileHandle=t;function n(i){return typeof Promise>"u"?null:{FileHandle:t,access:function(o,s){return e(i,"access")(o,s)},appendFile:function(o,s,a){return e(i,"appendFile")(o instanceof t?o.fd:o,s,a)},chmod:function(o,s){return e(i,"chmod")(o,s)},chown:function(o,s,a){return e(i,"chown")(o,s,a)},copyFile:function(o,s,a){return e(i,"copyFile")(o,s,a)},lchmod:function(o,s){return e(i,"lchmod")(o,s)},lchown:function(o,s,a){return e(i,"lchown")(o,s,a)},link:function(o,s){return e(i,"link")(o,s)},lstat:function(o,s){return e(i,"lstat")(o,s)},mkdir:function(o,s){return e(i,"mkdir")(o,s)},mkdtemp:function(o,s){return e(i,"mkdtemp")(o,s)},open:function(o,s,a){return e(i,"open",function(u){return new t(i,u)})(o,s,a)},readdir:function(o,s){return e(i,"readdir")(o,s)},readFile:function(o,s){return e(i,"readFile")(o instanceof t?o.fd:o,s)},readlink:function(o,s){return e(i,"readlink")(o,s)},realpath:function(o,s){return e(i,"realpath")(o,s)},rename:function(o,s){return e(i,"rename")(o,s)},rmdir:function(o){return e(i,"rmdir")(o)},rm:function(o,s){return e(i,"rm")(o,s)},stat:function(o,s){return e(i,"stat")(o,s)},symlink:function(o,s,a){return e(i,"symlink")(o,s,a)},truncate:function(o,s){return e(i,"truncate")(o,s)},unlink:function(o){return e(i,"unlink")(o)},utimes:function(o,s,a){return e(i,"utimes")(o,s,a)},writeFile:function(o,s,a){return e(i,"writeFile")(o instanceof t?o.fd:o,s,a)}}}return Cl.default=n,Cl}function zj(){if(vO)return lg;vO=!0;var r=qr;Object.defineProperty(lg,"__esModule",{value:!0}),lg.correctPath=s,lg.unixify=o;var e=r.platform==="win32";function t(a){var u=a.length-1;if(u<2)return a;for(;n(a,u);)u--;return a.substr(0,u+1)}function n(a,u){var c=a[u];return u>0&&(c==="/"||e&&c==="\\")}function i(a,u){if(typeof a!="string")throw new TypeError("expected a string");return a=a.replace(/[\\\/]+/g,"/"),u!==!1&&(a=t(a)),a}function o(a){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return e?(a=i(a,u),a.replace(/^([a-zA-Z]+:|\.\/)/,"")):a}function s(a){return o(a.replace(/^\\\\\?\\.:\\/,"\\"))}return lg}function DO(){if(EO)return Ut;EO=!0;var r=Ut&&Ut.__extends||(function(){var ce=function(W,G){return ce=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(se,ye){se.__proto__=ye}||function(se,ye){for(var Oe in ye)Object.prototype.hasOwnProperty.call(ye,Oe)&&(se[Oe]=ye[Oe])},ce(W,G)};return function(W,G){if(typeof G!="function"&&G!==null)throw new TypeError("Class extends value "+String(G)+" is not a constructor or null");ce(W,G);function se(){this.constructor=W}W.prototype=G===null?Object.create(G):(se.prototype=G.prototype,new se)}})(),e=Ut&&Ut.__spreadArray||function(ce,W,G){if(G||arguments.length===2)for(var se=0,ye=W.length,Oe;se<ye;se++)(Oe||!(se in W))&&(Oe||(Oe=Array.prototype.slice.call(W,0,se)),Oe[se]=W[se]);return ce.concat(Oe||Array.prototype.slice.call(W))};Object.defineProperty(Ut,"__esModule",{value:!0}),Ut.FSWatcher=Ut.StatWatcher=Ut.Volume=Ut.toUnixTimestamp=Ut.bufferToEncoding=Ut.dataToBuffer=Ut.dataToStr=Ut.pathToSteps=Ut.filenameToSteps=Ut.pathToFilename=Ut.flagsToNumber=Ut.FLAGS=void 0;var t=an,n=Uj(),i=J2(),o=TO(),s=Q2(),a=CO(),u=RO(),c=$j(),f=li,h=ug(),d=ln,m=SO(),y=xO(),v=qe,w=Wj(),b=t.resolve,E=h.constants.O_RDONLY,_=h.constants.O_WRONLY,S=h.constants.O_RDWR,A=h.constants.O_CREAT,F=h.constants.O_EXCL,I=h.constants.O_TRUNC,q=h.constants.O_APPEND,ee=h.constants.O_SYNC,K=h.constants.O_DIRECTORY,ne=h.constants.F_OK,L=h.constants.COPYFILE_EXCL,$=h.constants.COPYFILE_FICLONE_FORCE,Y=t.posix?t.posix:t,ie=Y.sep,re=Y.relative,k=Y.join,x=Y.dirname,P=u.default.platform==="win32",C=128,j={PATH_STR:"path must be a string or Buffer",FD:"fd must be a file descriptor",MODE_INT:"mode must be an int",CB:"callback must be a function",UID:"uid must be an unsigned int",GID:"gid must be an unsigned int",LEN:"len must be an integer",ATIME:"atime must be an integer",MTIME:"mtime must be an integer",PREFIX:"filename prefix is required",BUFFER:"buffer must be an instance of Buffer or StaticBuffer",OFFSET:"offset must be an integer",LENGTH:"length must be an integer",POSITION:"position must be an integer"},U=function(ce){return"Expected options to be either an object or a string, but got ".concat(ce," instead")},B="ENOENT",Q="EBADF",fe="EINVAL",Ee="EPERM",te="EPROTO",H="EEXIST",ae="ENOTDIR",we="EMFILE",xe="EACCES",V="EISDIR",M="ENOTEMPTY",oe="ENOSYS",ge="ERR_FS_EISDIR";function Se(ce,W,G,se){W===void 0&&(W=""),G===void 0&&(G=""),se===void 0&&(se="");var ye="";switch(G&&(ye=" '".concat(G,"'")),se&&(ye+=" -> '".concat(se,"'")),ce){case B:return"ENOENT: no such file or directory, ".concat(W).concat(ye);case Q:return"EBADF: bad file descriptor, ".concat(W).concat(ye);case fe:return"EINVAL: invalid argument, ".concat(W).concat(ye);case Ee:return"EPERM: operation not permitted, ".concat(W).concat(ye);case te:return"EPROTO: protocol error, ".concat(W).concat(ye);case H:return"EEXIST: file already exists, ".concat(W).concat(ye);case ae:return"ENOTDIR: not a directory, ".concat(W).concat(ye);case V:return"EISDIR: illegal operation on a directory, ".concat(W).concat(ye);case xe:return"EACCES: permission denied, ".concat(W).concat(ye);case M:return"ENOTEMPTY: directory not empty, ".concat(W).concat(ye);case we:return"EMFILE: too many open files, ".concat(W).concat(ye);case oe:return"ENOSYS: function not implemented, ".concat(W).concat(ye);case ge:return"[ERR_FS_EISDIR]: Path is a directory: ".concat(W," returned EISDIR (is a directory) ").concat(G);default:return"".concat(ce,": error occurred, ").concat(W).concat(ye)}}function be(ce,W,G,se,ye){W===void 0&&(W=""),G===void 0&&(G=""),se===void 0&&(se=""),ye===void 0&&(ye=Error);var Oe=new ye(Se(ce,W,G,se));return Oe.code=ce,G&&(Oe.path=G),Oe}var pe;(function(ce){ce[ce.r=E]="r",ce[ce["r+"]=S]="r+",ce[ce.rs=E|ee]="rs",ce[ce.sr=ce.rs]="sr",ce[ce["rs+"]=S|ee]="rs+",ce[ce["sr+"]=ce["rs+"]]="sr+",ce[ce.w=_|A|I]="w",ce[ce.wx=_|A|I|F]="wx",ce[ce.xw=ce.wx]="xw",ce[ce["w+"]=S|A|I]="w+",ce[ce["wx+"]=S|A|I|F]="wx+",ce[ce["xw+"]=ce["wx+"]]="xw+",ce[ce.a=_|q|A]="a",ce[ce.ax=_|q|A|F]="ax",ce[ce.xa=ce.ax]="xa",ce[ce["a+"]=S|q|A]="a+",ce[ce["ax+"]=S|q|A|F]="ax+",ce[ce["xa+"]=ce["ax+"]]="xa+"})(pe=Ut.FLAGS||(Ut.FLAGS={}));function Ae(ce){if(typeof ce=="number")return ce;if(typeof ce=="string"){var W=pe[ce];if(typeof W<"u")return W}throw new y.TypeError("ERR_INVALID_OPT_VALUE","flags",ce)}Ut.flagsToNumber=Ae;function $e(ce,W){var G;if(W){var se=typeof W;switch(se){case"string":G=Object.assign({},ce,{encoding:W});break;case"object":G=Object.assign({},ce,W);break;default:throw TypeError(U(se))}}else return ce;return G.encoding!=="buffer"&&(0,m.assertEncoding)(G.encoding),G}function ke(ce){return function(W){return $e(ce,W)}}function Ne(ce){if(typeof ce!="function")throw TypeError(j.CB);return ce}function Ze(ce){return function(W,G){return typeof W=="function"?[ce(),W]:[ce(W),Ne(G)]}}var tt={encoding:"utf8"},it=ke(tt),T=Ze(it),g={flag:"r"},p=ke(g),R={encoding:"utf8",mode:438,flag:pe[pe.w]},J=ke(R),D={encoding:"utf8",mode:438,flag:pe[pe.a]},le=ke(D),he=Ze(le),_e=tt,ve=ke(_e),Ie=Ze(ve),Z={mode:511,recursive:!1},Me=function(ce){return typeof ce=="number"?Object.assign({},Z,{mode:ce}):Object.assign({},Z,ce)},nt={recursive:!1},N=function(ce){return Object.assign({},nt,ce)},Pe=ke(tt),je=Ze(Pe),de={encoding:"utf8",withFileTypes:!1},De=ke(de),Be=Ze(De),ft={bigint:!1},ue=function(ce){return ce===void 0&&(ce={}),Object.assign({},ft,ce)},me=function(ce,W){return typeof ce=="function"?[ue(),ce]:[ue(ce),Ne(W)]};function Ge(ce){if(ce.hostname!=="")throw new y.TypeError("ERR_INVALID_FILE_URL_HOST",u.default.platform);for(var W=ce.pathname,G=0;G<W.length;G++)if(W[G]==="%"){var se=W.codePointAt(G+2)|32;if(W[G+1]==="2"&&se===102)throw new y.TypeError("ERR_INVALID_FILE_URL_PATH","must not include encoded / characters")}return decodeURIComponent(W)}function Ue(ce){if(typeof ce!="string"&&!s.Buffer.isBuffer(ce)){try{if(!(ce instanceof nr.URL))throw new TypeError(j.PATH_STR)}catch{throw new TypeError(j.PATH_STR)}ce=Ge(ce)}var W=String(ce);return Or(W),W}Ut.pathToFilename=Ue;var et=function(ce,W){return W===void 0&&(W=u.default.cwd()),b(W,ce)};if(P){var pt=et,It=zj().unixify;et=function(ce,W){return It(pt(ce,W))}}function xt(ce,W){var G=et(ce,W),se=G.substring(1);return se?se.split(ie):[]}Ut.filenameToSteps=xt;function fr(ce){return xt(Ue(ce))}Ut.pathToSteps=fr;function Ri(ce,W){return W===void 0&&(W=m.ENCODING_UTF8),s.Buffer.isBuffer(ce)?ce.toString(W):ce instanceof Uint8Array?(0,s.bufferFrom)(ce).toString(W):String(ce)}Ut.dataToStr=Ri;function Yn(ce,W){return W===void 0&&(W=m.ENCODING_UTF8),s.Buffer.isBuffer(ce)?ce:ce instanceof Uint8Array?(0,s.bufferFrom)(ce):(0,s.bufferFrom)(String(ce),W)}Ut.dataToBuffer=Yn;function Yt(ce,W){return!W||W==="buffer"?ce:ce.toString(W)}Ut.bufferToEncoding=Yt;function Or(ce,W){if((""+ce).indexOf("\0")!==-1){var G=new Error("Path must be a string without null bytes");throw G.code=B,G}return!0}function wr(ce,W){if(typeof ce=="number")return ce;if(typeof ce=="string")return parseInt(ce,8);if(W)return Ht(W)}function Ht(ce,W){var G=wr(ce,W);if(typeof G!="number"||isNaN(G))throw new TypeError(j.MODE_INT);return G}function Zt(ce){return ce>>>0===ce}function tn(ce){if(!Zt(ce))throw TypeError(j.FD)}function rn(ce){if(typeof ce=="string"&&+ce==ce)return+ce;if(ce instanceof Date)return ce.getTime()/1e3;if(isFinite(ce))return ce<0?Date.now()/1e3:ce;throw new Error("Cannot parse time: "+ce)}Ut.toUnixTimestamp=rn;function nn(ce){if(typeof ce!="number")throw TypeError(j.UID)}function Kf(ce){if(typeof ce!="number")throw TypeError(j.GID)}function L8(ce){var W={};function G(se,ye){for(var Oe in ye){var Fe=ye[Oe],Xe=k(se,Oe);typeof Fe=="string"?W[Xe]=Fe:typeof Fe=="object"&&Fe!==null&&Object.keys(Fe).length>0?G(Xe,Fe):W[Xe]=null}}return G("",ce),W}var P8=(function(){function ce(W){W===void 0&&(W={}),this.ino=0,this.inodes={},this.releasedInos=[],this.fds={},this.releasedFds=[],this.maxFiles=1e4,this.openFiles=0,this.promisesApi=(0,w.default)(this),this.statWatchers={},this.props=Object.assign({Node:n.Node,Link:n.Link,File:n.File},W);var G=this.createLink();G.setNode(this.createNode(!0));var se=this;this.StatWatcher=(function(Fe){r(Xe,Fe);function Xe(){return Fe.call(this,se)||this}return Xe})(aC);var ye=ao;this.ReadStream=(function(Fe){r(Xe,Fe);function Xe(){for(var ot=[],lt=0;lt<arguments.length;lt++)ot[lt]=arguments[lt];return Fe.apply(this,e([se],ot,!1))||this}return Xe})(ye);var Oe=as;this.WriteStream=(function(Fe){r(Xe,Fe);function Xe(){for(var ot=[],lt=0;lt<arguments.length;lt++)ot[lt]=arguments[lt];return Fe.apply(this,e([se],ot,!1))||this}return Xe})(Oe),this.FSWatcher=(function(Fe){r(Xe,Fe);function Xe(){return Fe.call(this,se)||this}return Xe})(uC),G.setChild(".",G),G.getNode().nlink++,G.setChild("..",G),G.getNode().nlink++,this.root=G}return ce.fromJSON=function(W,G){var se=new ce;return se.fromJSON(W,G),se},ce.fromNestedJSON=function(W,G){var se=new ce;return se.fromNestedJSON(W,G),se},Object.defineProperty(ce.prototype,"promises",{get:function(){if(this.promisesApi===null)throw new Error("Promise is not supported in this environment.");return this.promisesApi},enumerable:!1,configurable:!0}),ce.prototype.createLink=function(W,G,se,ye){if(se===void 0&&(se=!1),!W)return new this.props.Link(this,null,"");if(!G)throw new Error("createLink: name cannot be empty");return W.createChild(G,this.createNode(se,ye))},ce.prototype.deleteLink=function(W){var G=W.parent;return G?(G.deleteChild(W),!0):!1},ce.prototype.newInoNumber=function(){var W=this.releasedInos.pop();return W||(this.ino=(this.ino+1)%4294967295,this.ino)},ce.prototype.newFdNumber=function(){var W=this.releasedFds.pop();return typeof W=="number"?W:ce.fd--},ce.prototype.createNode=function(W,G){W===void 0&&(W=!1);var se=new this.props.Node(this.newInoNumber(),G);return W&&se.setIsDirectory(),this.inodes[se.ino]=se,se},ce.prototype.getNode=function(W){return this.inodes[W]},ce.prototype.deleteNode=function(W){W.del(),delete this.inodes[W.ino],this.releasedInos.push(W.ino)},ce.prototype.genRndStr=function(){var W=(Math.random()+1).toString(36).substring(2,8);return W.length===6?W:this.genRndStr()},ce.prototype.getLink=function(W){return this.root.walk(W)},ce.prototype.getLinkOrThrow=function(W,G){var se=xt(W),ye=this.getLink(se);if(!ye)throw be(B,G,W);return ye},ce.prototype.getResolvedLink=function(W){for(var G=typeof W=="string"?xt(W):W,se=this.root,ye=0;ye<G.length;){var Oe=G[ye];if(se=se.getChild(Oe),!se)return null;var Fe=se.getNode();if(Fe.isSymlink()){G=Fe.symlink.concat(G.slice(ye+1)),se=this.root,ye=0;continue}ye++}return se},ce.prototype.getResolvedLinkOrThrow=function(W,G){var se=this.getResolvedLink(W);if(!se)throw be(B,G,W);return se},ce.prototype.resolveSymlinks=function(W){return this.getResolvedLink(W.steps.slice(1))},ce.prototype.getLinkAsDirOrThrow=function(W,G){var se=this.getLinkOrThrow(W,G);if(!se.getNode().isDirectory())throw be(ae,G,W);return se},ce.prototype.getLinkParent=function(W){return this.root.walk(W,W.length-1)},ce.prototype.getLinkParentAsDirOrThrow=function(W,G){var se=W instanceof Array?W:xt(W),ye=this.getLinkParent(se);if(!ye)throw be(B,G,ie+se.join(ie));if(!ye.getNode().isDirectory())throw be(ae,G,ie+se.join(ie));return ye},ce.prototype.getFileByFd=function(W){return this.fds[String(W)]},ce.prototype.getFileByFdOrThrow=function(W,G){if(!Zt(W))throw TypeError(j.FD);var se=this.getFileByFd(W);if(!se)throw be(Q,G);return se},ce.prototype.wrapAsync=function(W,G,se){var ye=this;Ne(se),(0,a.default)(function(){var Oe;try{Oe=W.apply(ye,G)}catch(Fe){se(Fe);return}se(null,Oe)})},ce.prototype._toJSON=function(W,G,se){var ye;W===void 0&&(W=this.root),G===void 0&&(G={});var Oe=!0,Fe=W.children;W.getNode().isFile()&&(Fe=(ye={},ye[W.getName()]=W.parent.getChild(W.getName()),ye),W=W.parent);for(var Xe in Fe)if(!(Xe==="."||Xe==="..")){Oe=!1;var ot=W.getChild(Xe);if(!ot)throw new Error("_toJSON: unexpected undefined");var lt=ot.getNode();if(lt.isFile()){var wt=ot.getPath();se&&(wt=re(se,wt)),G[wt]=lt.getString()}else lt.isDirectory()&&this._toJSON(ot,G,se)}var Mt=W.getPath();return se&&(Mt=re(se,Mt)),Mt&&Oe&&(G[Mt]=null),G},ce.prototype.toJSON=function(W,G,se){G===void 0&&(G={}),se===void 0&&(se=!1);var ye=[];if(W){W instanceof Array||(W=[W]);for(var Oe=0,Fe=W;Oe<Fe.length;Oe++){var Xe=Fe[Oe],ot=Ue(Xe),lt=this.getResolvedLink(ot);lt&&ye.push(lt)}}else ye.push(this.root);if(!ye.length)return G;for(var wt=0,Mt=ye;wt<Mt.length;wt++){var lt=Mt[wt];this._toJSON(lt,G,se?lt.getPath():"")}return G},ce.prototype.fromJSON=function(W,G){G===void 0&&(G=u.default.cwd());for(var se in W){var ye=W[se];if(se=et(se,G),typeof ye=="string"){var Oe=x(se);this.mkdirpBase(Oe,511),this.writeFileSync(se,ye)}else this.mkdirpBase(se,511)}},ce.prototype.fromNestedJSON=function(W,G){this.fromJSON(L8(W),G)},ce.prototype.reset=function(){this.ino=0,this.inodes={},this.releasedInos=[],this.fds={},this.releasedFds=[],this.openFiles=0,this.root=this.createLink(),this.root.setNode(this.createNode(!0))},ce.prototype.mountSync=function(W,G){this.fromJSON(G,W)},ce.prototype.openLink=function(W,G,se){if(se===void 0&&(se=!0),this.openFiles>=this.maxFiles)throw be(we,"open",W.getPath());var ye=W;if(se&&(ye=this.resolveSymlinks(W)),!ye)throw be(B,"open",W.getPath());var Oe=ye.getNode();if(Oe.isDirectory()){if((G&(E|S|_))!==E)throw be(V,"open",W.getPath())}else if(G&K)throw be(ae,"open",W.getPath());if(!(G&_)&&!Oe.canRead())throw be(xe,"open",W.getPath());var Fe=new this.props.File(W,Oe,G,this.newFdNumber());return this.fds[Fe.fd]=Fe,this.openFiles++,G&I&&Fe.truncate(),Fe},ce.prototype.openFile=function(W,G,se,ye){ye===void 0&&(ye=!0);var Oe=xt(W),Fe=ye?this.getResolvedLink(Oe):this.getLink(Oe);if(Fe&&G&F)throw be(H,"open",W);if(!Fe&&G&A){var Xe=this.getResolvedLink(Oe.slice(0,Oe.length-1));if(!Xe)throw be(B,"open",ie+Oe.join(ie));G&A&&typeof se=="number"&&(Fe=this.createLink(Xe,Oe[Oe.length-1],!1,se))}if(Fe)return this.openLink(Fe,G,ye);throw be(B,"open",W)},ce.prototype.openBase=function(W,G,se,ye){ye===void 0&&(ye=!0);var Oe=this.openFile(W,G,se,ye);if(!Oe)throw be(B,"open",W);return Oe.fd},ce.prototype.openSync=function(W,G,se){se===void 0&&(se=438);var ye=Ht(se),Oe=Ue(W),Fe=Ae(G);return this.openBase(Oe,Fe,ye)},ce.prototype.open=function(W,G,se,ye){var Oe=se,Fe=ye;typeof se=="function"&&(Oe=438,Fe=se),Oe=Oe||438;var Xe=Ht(Oe),ot=Ue(W),lt=Ae(G);this.wrapAsync(this.openBase,[ot,lt,Xe],Fe)},ce.prototype.closeFile=function(W){this.fds[W.fd]&&(this.openFiles--,delete this.fds[W.fd],this.releasedFds.push(W.fd))},ce.prototype.closeSync=function(W){tn(W);var G=this.getFileByFdOrThrow(W,"close");this.closeFile(G)},ce.prototype.close=function(W,G){tn(W),this.wrapAsync(this.closeSync,[W],G)},ce.prototype.openFileOrGetById=function(W,G,se){if(typeof W=="number"){var ye=this.fds[W];if(!ye)throw be(B);return ye}else return this.openFile(Ue(W),G,se)},ce.prototype.readBase=function(W,G,se,ye,Oe){var Fe=this.getFileByFdOrThrow(W);return Fe.read(G,Number(se),Number(ye),Oe)},ce.prototype.readSync=function(W,G,se,ye,Oe){return tn(W),this.readBase(W,G,se,ye,Oe)},ce.prototype.read=function(W,G,se,ye,Oe,Fe){var Xe=this;if(Ne(Fe),ye===0)return u.default.nextTick(function(){Fe&&Fe(null,0,G)});(0,a.default)(function(){try{var ot=Xe.readBase(W,G,se,ye,Oe);Fe(null,ot,G)}catch(lt){Fe(lt)}})},ce.prototype.readFileBase=function(W,G,se){var ye,Oe=typeof W=="number",Fe=Oe&&Zt(W),Xe;if(Fe)Xe=W;else{var ot=Ue(W),lt=xt(ot),wt=this.getResolvedLink(lt);if(wt){var Mt=wt.getNode();if(Mt.isDirectory())throw be(V,"open",wt.getPath())}Xe=this.openSync(W,G)}try{ye=Yt(this.getFileByFdOrThrow(Xe).getBuffer(),se)}finally{Fe||this.closeSync(Xe)}return ye},ce.prototype.readFileSync=function(W,G){var se=p(G),ye=Ae(se.flag);return this.readFileBase(W,ye,se.encoding)},ce.prototype.readFile=function(W,G,se){var ye=Ze(p)(G,se),Oe=ye[0],Fe=ye[1],Xe=Ae(Oe.flag);this.wrapAsync(this.readFileBase,[W,Xe,Oe.encoding],Fe)},ce.prototype.writeBase=function(W,G,se,ye,Oe){var Fe=this.getFileByFdOrThrow(W,"write");return Fe.write(G,se,ye,Oe)},ce.prototype.writeSync=function(W,G,se,ye,Oe){tn(W);var Fe,Xe,ot,lt,wt=typeof G!="string";wt?(Xe=(se||0)|0,ot=ye,lt=Oe):(lt=se,Fe=ye);var Mt=Yn(G,Fe);return wt?typeof ot>"u"&&(ot=Mt.length):(Xe=0,ot=Mt.length),this.writeBase(W,Mt,Xe,ot,lt)},ce.prototype.write=function(W,G,se,ye,Oe,Fe){var Xe=this;tn(W);var ot,lt,wt,Mt,sn,Bu=typeof G,lo=typeof se,bl=typeof ye,Fu=typeof Oe;Bu!=="string"?lo==="function"?sn=se:bl==="function"?(ot=se|0,sn=ye):Fu==="function"?(ot=se|0,lt=ye,sn=Oe):(ot=se|0,lt=ye,wt=Oe,sn=Fe):lo==="function"?sn=se:bl==="function"?(wt=se,sn=ye):Fu==="function"&&(wt=se,Mt=ye,sn=Oe);var Wr=Yn(G,Mt);Bu!=="string"?typeof lt>"u"&&(lt=Wr.length):(ot=0,lt=Wr.length);var ls=Ne(sn);(0,a.default)(function(){try{var Ms=Xe.writeBase(W,Wr,ot,lt,wt);Bu!=="string"?ls(null,Ms,Wr):ls(null,Ms,G)}catch($y){ls($y)}})},ce.prototype.writeFileBase=function(W,G,se,ye){var Oe=typeof W=="number",Fe;Oe?Fe=W:Fe=this.openBase(Ue(W),se,ye);var Xe=0,ot=G.length,lt=se&q?void 0:0;try{for(;ot>0;){var wt=this.writeSync(Fe,G,Xe,ot,lt);Xe+=wt,ot-=wt,lt!==void 0&&(lt+=wt)}}finally{Oe||this.closeSync(Fe)}},ce.prototype.writeFileSync=function(W,G,se){var ye=J(se),Oe=Ae(ye.flag),Fe=Ht(ye.mode),Xe=Yn(G,ye.encoding);this.writeFileBase(W,Xe,Oe,Fe)},ce.prototype.writeFile=function(W,G,se,ye){var Oe=se,Fe=ye;typeof se=="function"&&(Oe=R,Fe=se);var Xe=Ne(Fe),ot=J(Oe),lt=Ae(ot.flag),wt=Ht(ot.mode),Mt=Yn(G,ot.encoding);this.wrapAsync(this.writeFileBase,[W,Mt,lt,wt],Xe)},ce.prototype.linkBase=function(W,G){var se=xt(W),ye=this.getLink(se);if(!ye)throw be(B,"link",W,G);var Oe=xt(G),Fe=this.getLinkParent(Oe);if(!Fe)throw be(B,"link",W,G);var Xe=Oe[Oe.length-1];if(Fe.getChild(Xe))throw be(H,"link",W,G);var ot=ye.getNode();ot.nlink++,Fe.createChild(Xe,ot)},ce.prototype.copyFileBase=function(W,G,se){var ye=this.readFileSync(W);if(se&L&&this.existsSync(G))throw be(H,"copyFile",W,G);if(se&$)throw be(oe,"copyFile",W,G);this.writeFileBase(G,ye,pe.w,438)},ce.prototype.copyFileSync=function(W,G,se){var ye=Ue(W),Oe=Ue(G);return this.copyFileBase(ye,Oe,(se||0)|0)},ce.prototype.copyFile=function(W,G,se,ye){var Oe=Ue(W),Fe=Ue(G),Xe,ot;typeof se=="function"?(Xe=0,ot=se):(Xe=se,ot=ye),Ne(ot),this.wrapAsync(this.copyFileBase,[Oe,Fe,Xe],ot)},ce.prototype.linkSync=function(W,G){var se=Ue(W),ye=Ue(G);this.linkBase(se,ye)},ce.prototype.link=function(W,G,se){var ye=Ue(W),Oe=Ue(G);this.wrapAsync(this.linkBase,[ye,Oe],se)},ce.prototype.unlinkBase=function(W){var G=xt(W),se=this.getLink(G);if(!se)throw be(B,"unlink",W);if(se.length)throw Error("Dir not empty...");this.deleteLink(se);var ye=se.getNode();ye.nlink--,ye.nlink<=0&&this.deleteNode(ye)},ce.prototype.unlinkSync=function(W){var G=Ue(W);this.unlinkBase(G)},ce.prototype.unlink=function(W,G){var se=Ue(W);this.wrapAsync(this.unlinkBase,[se],G)},ce.prototype.symlinkBase=function(W,G){var se=xt(G),ye=this.getLinkParent(se);if(!ye)throw be(B,"symlink",W,G);var Oe=se[se.length-1];if(ye.getChild(Oe))throw be(H,"symlink",W,G);var Fe=ye.createChild(Oe);return Fe.getNode().makeSymlink(xt(W)),Fe},ce.prototype.symlinkSync=function(W,G,se){var ye=Ue(W),Oe=Ue(G);this.symlinkBase(ye,Oe)},ce.prototype.symlink=function(W,G,se,ye){var Oe=Ne(typeof se=="function"?se:ye),Fe=Ue(W),Xe=Ue(G);this.wrapAsync(this.symlinkBase,[Fe,Xe],Oe)},ce.prototype.realpathBase=function(W,G){var se=xt(W),ye=this.getResolvedLink(se);if(!ye)throw be(B,"realpath",W);return(0,m.strToEncoding)(ye.getPath()||"/",G)},ce.prototype.realpathSync=function(W,G){return this.realpathBase(Ue(W),ve(G).encoding)},ce.prototype.realpath=function(W,G,se){var ye=Ie(G,se),Oe=ye[0],Fe=ye[1],Xe=Ue(W);this.wrapAsync(this.realpathBase,[Xe,Oe.encoding],Fe)},ce.prototype.lstatBase=function(W,G,se){G===void 0&&(G=!1),se===void 0&&(se=!1);var ye=this.getLink(xt(W));if(ye)return i.default.build(ye.getNode(),G);if(se)throw be(B,"lstat",W)},ce.prototype.lstatSync=function(W,G){var se=ue(G),ye=se.throwIfNoEntry,Oe=ye===void 0?!0:ye,Fe=se.bigint,Xe=Fe===void 0?!1:Fe;return this.lstatBase(Ue(W),Xe,Oe)},ce.prototype.lstat=function(W,G,se){var ye=me(G,se),Oe=ye[0],Fe=Oe.throwIfNoEntry,Xe=Fe===void 0?!0:Fe,ot=Oe.bigint,lt=ot===void 0?!1:ot,wt=ye[1];this.wrapAsync(this.lstatBase,[Ue(W),lt,Xe],wt)},ce.prototype.statBase=function(W,G,se){G===void 0&&(G=!1),se===void 0&&(se=!0);var ye=this.getResolvedLink(xt(W));if(ye)return i.default.build(ye.getNode(),G);if(se)throw be(B,"stat",W)},ce.prototype.statSync=function(W,G){var se=ue(G),ye=se.bigint,Oe=ye===void 0?!0:ye,Fe=se.throwIfNoEntry,Xe=Fe===void 0?!0:Fe;return this.statBase(Ue(W),Oe,Xe)},ce.prototype.stat=function(W,G,se){var ye=me(G,se),Oe=ye[0],Fe=Oe.bigint,Xe=Fe===void 0?!1:Fe,ot=Oe.throwIfNoEntry,lt=ot===void 0?!0:ot,wt=ye[1];this.wrapAsync(this.statBase,[Ue(W),Xe,lt],wt)},ce.prototype.fstatBase=function(W,G){G===void 0&&(G=!1);var se=this.getFileByFd(W);if(!se)throw be(Q,"fstat");return i.default.build(se.node,G)},ce.prototype.fstatSync=function(W,G){return this.fstatBase(W,ue(G).bigint)},ce.prototype.fstat=function(W,G,se){var ye=me(G,se),Oe=ye[0],Fe=ye[1];this.wrapAsync(this.fstatBase,[W,Oe.bigint],Fe)},ce.prototype.renameBase=function(W,G){var se=this.getLink(xt(W));if(!se)throw be(B,"rename",W,G);var ye=xt(G),Oe=this.getLinkParent(ye);if(!Oe)throw be(B,"rename",W,G);var Fe=se.parent;Fe&&Fe.deleteChild(se);var Xe=ye[ye.length-1];se.name=Xe,se.steps=e(e([],Oe.steps,!0),[Xe],!1),Oe.setChild(se.getName(),se)},ce.prototype.renameSync=function(W,G){var se=Ue(W),ye=Ue(G);this.renameBase(se,ye)},ce.prototype.rename=function(W,G,se){var ye=Ue(W),Oe=Ue(G);this.wrapAsync(this.renameBase,[ye,Oe],se)},ce.prototype.existsBase=function(W){return!!this.statBase(W)},ce.prototype.existsSync=function(W){try{return this.existsBase(Ue(W))}catch{return!1}},ce.prototype.exists=function(W,G){var se=this,ye=Ue(W);if(typeof G!="function")throw Error(j.CB);(0,a.default)(function(){try{G(se.existsBase(ye))}catch{G(!1)}})},ce.prototype.accessBase=function(W,G){this.getLinkOrThrow(W,"access")},ce.prototype.accessSync=function(W,G){G===void 0&&(G=ne);var se=Ue(W);G=G|0,this.accessBase(se,G)},ce.prototype.access=function(W,G,se){var ye=ne,Oe;typeof G!="function"?(ye=G|0,Oe=Ne(se)):Oe=G;var Fe=Ue(W);this.wrapAsync(this.accessBase,[Fe,ye],Oe)},ce.prototype.appendFileSync=function(W,G,se){se===void 0&&(se=D);var ye=le(se);(!ye.flag||Zt(W))&&(ye.flag="a"),this.writeFileSync(W,G,ye)},ce.prototype.appendFile=function(W,G,se,ye){var Oe=he(se,ye),Fe=Oe[0],Xe=Oe[1];(!Fe.flag||Zt(W))&&(Fe.flag="a"),this.writeFile(W,G,Fe,Xe)},ce.prototype.readdirBase=function(W,G){var se=xt(W),ye=this.getResolvedLink(se);if(!ye)throw be(B,"readdir",W);var Oe=ye.getNode();if(!Oe.isDirectory())throw be(ae,"scandir",W);if(G.withFileTypes){var Fe=[];for(var Xe in ye.children){var ot=ye.getChild(Xe);!ot||Xe==="."||Xe===".."||Fe.push(o.default.build(ot,G.encoding))}return!P&&G.encoding!=="buffer"&&Fe.sort(function(Mt,sn){return Mt.name<sn.name?-1:Mt.name>sn.name?1:0}),Fe}var lt=[];for(var wt in ye.children)wt==="."||wt===".."||lt.push((0,m.strToEncoding)(wt,G.encoding));return!P&&G.encoding!=="buffer"&<.sort(),lt},ce.prototype.readdirSync=function(W,G){var se=De(G),ye=Ue(W);return this.readdirBase(ye,se)},ce.prototype.readdir=function(W,G,se){var ye=Be(G,se),Oe=ye[0],Fe=ye[1],Xe=Ue(W);this.wrapAsync(this.readdirBase,[Xe,Oe],Fe)},ce.prototype.readlinkBase=function(W,G){var se=this.getLinkOrThrow(W,"readlink"),ye=se.getNode();if(!ye.isSymlink())throw be(fe,"readlink",W);var Oe=ie+ye.symlink.join(ie);return(0,m.strToEncoding)(Oe,G)},ce.prototype.readlinkSync=function(W,G){var se=it(G),ye=Ue(W);return this.readlinkBase(ye,se.encoding)},ce.prototype.readlink=function(W,G,se){var ye=T(G,se),Oe=ye[0],Fe=ye[1],Xe=Ue(W);this.wrapAsync(this.readlinkBase,[Xe,Oe.encoding],Fe)},ce.prototype.fsyncBase=function(W){this.getFileByFdOrThrow(W,"fsync")},ce.prototype.fsyncSync=function(W){this.fsyncBase(W)},ce.prototype.fsync=function(W,G){this.wrapAsync(this.fsyncBase,[W],G)},ce.prototype.fdatasyncBase=function(W){this.getFileByFdOrThrow(W,"fdatasync")},ce.prototype.fdatasyncSync=function(W){this.fdatasyncBase(W)},ce.prototype.fdatasync=function(W,G){this.wrapAsync(this.fdatasyncBase,[W],G)},ce.prototype.ftruncateBase=function(W,G){var se=this.getFileByFdOrThrow(W,"ftruncate");se.truncate(G)},ce.prototype.ftruncateSync=function(W,G){this.ftruncateBase(W,G)},ce.prototype.ftruncate=function(W,G,se){var ye=typeof G=="number"?G:0,Oe=Ne(typeof G=="number"?se:G);this.wrapAsync(this.ftruncateBase,[W,ye],Oe)},ce.prototype.truncateBase=function(W,G){var se=this.openSync(W,"r+");try{this.ftruncateSync(se,G)}finally{this.closeSync(se)}},ce.prototype.truncateSync=function(W,G){if(Zt(W))return this.ftruncateSync(W,G);this.truncateBase(W,G)},ce.prototype.truncate=function(W,G,se){var ye=typeof G=="number"?G:0,Oe=Ne(typeof G=="number"?se:G);if(Zt(W))return this.ftruncate(W,ye,Oe);this.wrapAsync(this.truncateBase,[W,ye],Oe)},ce.prototype.futimesBase=function(W,G,se){var ye=this.getFileByFdOrThrow(W,"futimes"),Oe=ye.node;Oe.atime=new Date(G*1e3),Oe.mtime=new Date(se*1e3)},ce.prototype.futimesSync=function(W,G,se){this.futimesBase(W,rn(G),rn(se))},ce.prototype.futimes=function(W,G,se,ye){this.wrapAsync(this.futimesBase,[W,rn(G),rn(se)],ye)},ce.prototype.utimesBase=function(W,G,se){var ye=this.openSync(W,"r");try{this.futimesBase(ye,G,se)}finally{this.closeSync(ye)}},ce.prototype.utimesSync=function(W,G,se){this.utimesBase(Ue(W),rn(G),rn(se))},ce.prototype.utimes=function(W,G,se,ye){this.wrapAsync(this.utimesBase,[Ue(W),rn(G),rn(se)],ye)},ce.prototype.mkdirBase=function(W,G){var se=xt(W);if(!se.length)throw be(H,"mkdir",W);var ye=this.getLinkParentAsDirOrThrow(W,"mkdir"),Oe=se[se.length-1];if(ye.getChild(Oe))throw be(H,"mkdir",W);ye.createChild(Oe,this.createNode(!0,G))},ce.prototype.mkdirpBase=function(W,G){for(var se=et(W),ye=se.substring(1),Oe=ye?ye.split(ie):[],Fe=this.root,Xe=!1,ot=0;ot<Oe.length;ot++){var lt=Oe[ot];if(!Fe.getNode().isDirectory())throw be(ae,"mkdir",Fe.getPath());var wt=Fe.getChild(lt);if(wt)if(wt.getNode().isDirectory())Fe=wt;else throw be(ae,"mkdir",wt.getPath());else Fe=Fe.createChild(lt,this.createNode(!0,G)),Xe=!0}return Xe?se:void 0},ce.prototype.mkdirSync=function(W,G){var se=Me(G),ye=Ht(se.mode,511),Oe=Ue(W);if(se.recursive)return this.mkdirpBase(Oe,ye);this.mkdirBase(Oe,ye)},ce.prototype.mkdir=function(W,G,se){var ye=Me(G),Oe=Ne(typeof G=="function"?G:se),Fe=Ht(ye.mode,511),Xe=Ue(W);ye.recursive?this.wrapAsync(this.mkdirpBase,[Xe,Fe],Oe):this.wrapAsync(this.mkdirBase,[Xe,Fe],Oe)},ce.prototype.mkdirpSync=function(W,G){return this.mkdirSync(W,{mode:G,recursive:!0})},ce.prototype.mkdirp=function(W,G,se){var ye=typeof G=="function"?void 0:G,Oe=Ne(typeof G=="function"?G:se);this.mkdir(W,{mode:ye,recursive:!0},Oe)},ce.prototype.mkdtempBase=function(W,G,se){se===void 0&&(se=5);var ye=W+this.genRndStr();try{return this.mkdirBase(ye,511),(0,m.strToEncoding)(ye,G)}catch(Oe){if(Oe.code===H){if(se>1)return this.mkdtempBase(W,G,se-1);throw Error("Could not create temp dir.")}else throw Oe}},ce.prototype.mkdtempSync=function(W,G){var se=it(G).encoding;if(!W||typeof W!="string")throw new TypeError("filename prefix is required");return Or(W),this.mkdtempBase(W,se)},ce.prototype.mkdtemp=function(W,G,se){var ye=T(G,se),Oe=ye[0].encoding,Fe=ye[1];if(!W||typeof W!="string")throw new TypeError("filename prefix is required");Or(W)&&this.wrapAsync(this.mkdtempBase,[W,Oe],Fe)},ce.prototype.rmdirBase=function(W,G){var se=N(G),ye=this.getLinkAsDirOrThrow(W,"rmdir");if(ye.length&&!se.recursive)throw be(M,"rmdir",W);this.deleteLink(ye)},ce.prototype.rmdirSync=function(W,G){this.rmdirBase(Ue(W),G)},ce.prototype.rmdir=function(W,G,se){var ye=N(G),Oe=Ne(typeof G=="function"?G:se);this.wrapAsync(this.rmdirBase,[Ue(W),ye],Oe)},ce.prototype.rmBase=function(W,G){G===void 0&&(G={});var se=this.getResolvedLink(W);if(!se){if(!G.force)throw be(B,"stat",W);return}if(se.getNode().isDirectory()&&!G.recursive)throw be(ge,"rm",W);this.deleteLink(se)},ce.prototype.rmSync=function(W,G){this.rmBase(Ue(W),G)},ce.prototype.rm=function(W,G,se){var ye=je(G,se),Oe=ye[0],Fe=ye[1];this.wrapAsync(this.rmBase,[Ue(W),Oe],Fe)},ce.prototype.fchmodBase=function(W,G){var se=this.getFileByFdOrThrow(W,"fchmod");se.chmod(G)},ce.prototype.fchmodSync=function(W,G){this.fchmodBase(W,Ht(G))},ce.prototype.fchmod=function(W,G,se){this.wrapAsync(this.fchmodBase,[W,Ht(G)],se)},ce.prototype.chmodBase=function(W,G){var se=this.openSync(W,"r");try{this.fchmodBase(se,G)}finally{this.closeSync(se)}},ce.prototype.chmodSync=function(W,G){var se=Ht(G),ye=Ue(W);this.chmodBase(ye,se)},ce.prototype.chmod=function(W,G,se){var ye=Ht(G),Oe=Ue(W);this.wrapAsync(this.chmodBase,[Oe,ye],se)},ce.prototype.lchmodBase=function(W,G){var se=this.openBase(W,S,0,!1);try{this.fchmodBase(se,G)}finally{this.closeSync(se)}},ce.prototype.lchmodSync=function(W,G){var se=Ht(G),ye=Ue(W);this.lchmodBase(ye,se)},ce.prototype.lchmod=function(W,G,se){var ye=Ht(G),Oe=Ue(W);this.wrapAsync(this.lchmodBase,[Oe,ye],se)},ce.prototype.fchownBase=function(W,G,se){this.getFileByFdOrThrow(W,"fchown").chown(G,se)},ce.prototype.fchownSync=function(W,G,se){nn(G),Kf(se),this.fchownBase(W,G,se)},ce.prototype.fchown=function(W,G,se,ye){nn(G),Kf(se),this.wrapAsync(this.fchownBase,[W,G,se],ye)},ce.prototype.chownBase=function(W,G,se){var ye=this.getResolvedLinkOrThrow(W,"chown"),Oe=ye.getNode();Oe.chown(G,se)},ce.prototype.chownSync=function(W,G,se){nn(G),Kf(se),this.chownBase(Ue(W),G,se)},ce.prototype.chown=function(W,G,se,ye){nn(G),Kf(se),this.wrapAsync(this.chownBase,[Ue(W),G,se],ye)},ce.prototype.lchownBase=function(W,G,se){this.getLinkOrThrow(W,"lchown").getNode().chown(G,se)},ce.prototype.lchownSync=function(W,G,se){nn(G),Kf(se),this.lchownBase(Ue(W),G,se)},ce.prototype.lchown=function(W,G,se,ye){nn(G),Kf(se),this.wrapAsync(this.lchownBase,[Ue(W),G,se],ye)},ce.prototype.watchFile=function(W,G,se){var ye=Ue(W),Oe=G,Fe=se;if(typeof Oe=="function"&&(Fe=G,Oe=null),typeof Fe!="function")throw Error('"watchFile()" requires a listener function');var Xe=5007,ot=!0;Oe&&typeof Oe=="object"&&(typeof Oe.interval=="number"&&(Xe=Oe.interval),typeof Oe.persistent=="boolean"&&(ot=Oe.persistent));var lt=this.statWatchers[ye];return lt||(lt=new this.StatWatcher,lt.start(ye,ot,Xe),this.statWatchers[ye]=lt),lt.addListener("change",Fe),lt},ce.prototype.unwatchFile=function(W,G){var se=Ue(W),ye=this.statWatchers[se];ye&&(typeof G=="function"?ye.removeListener("change",G):ye.removeAllListeners("change"),ye.listenerCount("change")===0&&(ye.stop(),delete this.statWatchers[se]))},ce.prototype.createReadStream=function(W,G){return new this.ReadStream(W,G)},ce.prototype.createWriteStream=function(W,G){return new this.WriteStream(W,G)},ce.prototype.watch=function(W,G,se){var ye=Ue(W),Oe=G;typeof G=="function"&&(se=G,Oe=null);var Fe=it(Oe),Xe=Fe.persistent,ot=Fe.recursive,lt=Fe.encoding;Xe===void 0&&(Xe=!0),ot===void 0&&(ot=!1);var wt=new this.FSWatcher;return wt.start(ye,Xe,ot,lt),se&&wt.addListener("change",se),wt},ce.fd=2147483647,ce})();Ut.Volume=P8;function M8(ce){ce.emit("stop")}var aC=(function(ce){r(W,ce);function W(G){var se=ce.call(this)||this;return se.onInterval=function(){try{var ye=se.vol.statSync(se.filename);se.hasChanged(ye)&&(se.emit("change",ye,se.prev),se.prev=ye)}finally{se.loop()}},se.vol=G,se}return W.prototype.loop=function(){this.timeoutRef=this.setTimeout(this.onInterval,this.interval)},W.prototype.hasChanged=function(G){return G.mtimeMs>this.prev.mtimeMs||G.nlink!==this.prev.nlink},W.prototype.start=function(G,se,ye){se===void 0&&(se=!0),ye===void 0&&(ye=5007),this.filename=Ue(G),this.setTimeout=se?setTimeout.bind(typeof globalThis<"u"?globalThis:Hj):c.default,this.interval=ye,this.prev=this.vol.statSync(this.filename),this.loop()},W.prototype.stop=function(){clearTimeout(this.timeoutRef),u.default.nextTick(M8,this)},W})(d.EventEmitter);Ut.StatWatcher=aC;var os;function B8(ce){os=(0,s.bufferAllocUnsafe)(ce),os.used=0}v.inherits(ao,f.Readable),Ut.ReadStream=ao;function ao(ce,W,G){if(!(this instanceof ao))return new ao(ce,W,G);if(this._vol=ce,G=Object.assign({},$e(G,{})),G.highWaterMark===void 0&&(G.highWaterMark=64*1024),f.Readable.call(this,G),this.path=Ue(W),this.fd=G.fd===void 0?null:G.fd,this.flags=G.flags===void 0?"r":G.flags,this.mode=G.mode===void 0?438:G.mode,this.start=G.start,this.end=G.end,this.autoClose=G.autoClose===void 0?!0:G.autoClose,this.pos=void 0,this.bytesRead=0,this.start!==void 0){if(typeof this.start!="number")throw new TypeError('"start" option must be a Number');if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw new TypeError('"end" option must be a Number');if(this.start>this.end)throw new Error('"start" option must be <= "end" option');this.pos=this.start}typeof this.fd!="number"&&this.open(),this.on("end",function(){this.autoClose&&this.destroy&&this.destroy()})}ao.prototype.open=function(){var ce=this;this._vol.open(this.path,this.flags,this.mode,function(W,G){if(W){ce.autoClose&&ce.destroy&&ce.destroy(),ce.emit("error",W);return}ce.fd=G,ce.emit("open",G),ce.read()})},ao.prototype._read=function(ce){if(typeof this.fd!="number")return this.once("open",function(){this._read(ce)});if(this.destroyed)return;(!os||os.length-os.used<C)&&B8(this._readableState.highWaterMark);var W=os,G=Math.min(os.length-os.used,ce),se=os.used;if(this.pos!==void 0&&(G=Math.min(this.end-this.pos+1,G)),G<=0)return this.push(null);var ye=this;this._vol.read(this.fd,os,os.used,G,this.pos,Oe),this.pos!==void 0&&(this.pos+=G),os.used+=G;function Oe(Fe,Xe){if(Fe)ye.autoClose&&ye.destroy&&ye.destroy(),ye.emit("error",Fe);else{var ot=null;Xe>0&&(ye.bytesRead+=Xe,ot=W.slice(se,se+Xe)),ye.push(ot)}}},ao.prototype._destroy=function(ce,W){this.close(function(G){W(ce||G)})},ao.prototype.close=function(ce){var W=this,G;if(ce&&this.once("close",ce),this.closed||typeof this.fd!="number"){if(typeof this.fd!="number"){this.once("open",lC);return}return u.default.nextTick(function(){return W.emit("close")})}typeof((G=this._readableState)===null||G===void 0?void 0:G.closed)=="boolean"?this._readableState.closed=!0:this.closed=!0,this._vol.close(this.fd,function(se){se?W.emit("error",se):W.emit("close")}),this.fd=null};function lC(ce){this.close()}v.inherits(as,f.Writable),Ut.WriteStream=as;function as(ce,W,G){if(!(this instanceof as))return new as(ce,W,G);if(this._vol=ce,G=Object.assign({},$e(G,{})),f.Writable.call(this,G),this.path=Ue(W),this.fd=G.fd===void 0?null:G.fd,this.flags=G.flags===void 0?"w":G.flags,this.mode=G.mode===void 0?438:G.mode,this.start=G.start,this.autoClose=G.autoClose===void 0?!0:!!G.autoClose,this.pos=void 0,this.bytesWritten=0,this.start!==void 0){if(typeof this.start!="number")throw new TypeError('"start" option must be a Number');if(this.start<0)throw new Error('"start" must be >= zero');this.pos=this.start}G.encoding&&this.setDefaultEncoding(G.encoding),typeof this.fd!="number"&&this.open(),this.once("finish",function(){this.autoClose&&this.close()})}as.prototype.open=function(){this._vol.open(this.path,this.flags,this.mode,function(ce,W){if(ce){this.autoClose&&this.destroy&&this.destroy(),this.emit("error",ce);return}this.fd=W,this.emit("open",W)}.bind(this))},as.prototype._write=function(ce,W,G){if(!(ce instanceof s.Buffer||ce instanceof Uint8Array))return this.emit("error",new Error("Invalid data"));if(typeof this.fd!="number")return this.once("open",function(){this._write(ce,W,G)});var se=this;this._vol.write(this.fd,ce,0,ce.length,this.pos,function(ye,Oe){if(ye)return se.autoClose&&se.destroy&&se.destroy(),G(ye);se.bytesWritten+=Oe,G()}),this.pos!==void 0&&(this.pos+=ce.length)},as.prototype._writev=function(ce,W){if(typeof this.fd!="number")return this.once("open",function(){this._writev(ce,W)});for(var G=this,se=ce.length,ye=new Array(se),Oe=0,Fe=0;Fe<se;Fe++){var Xe=ce[Fe].chunk;ye[Fe]=Xe,Oe+=Xe.length}var ot=s.Buffer.concat(ye);this._vol.write(this.fd,ot,0,ot.length,this.pos,function(lt,wt){if(lt)return G.destroy&&G.destroy(),W(lt);G.bytesWritten+=wt,W()}),this.pos!==void 0&&(this.pos+=Oe)},as.prototype.close=function(ce){var W=this,G;if(ce&&this.once("close",ce),this.closed||typeof this.fd!="number"){if(typeof this.fd!="number"){this.once("open",lC);return}return u.default.nextTick(function(){return W.emit("close")})}typeof((G=this._writableState)===null||G===void 0?void 0:G.closed)=="boolean"?this._writableState.closed=!0:this.closed=!0,this._vol.close(this.fd,function(se){se?W.emit("error",se):W.emit("close")}),this.fd=null},as.prototype._destroy=ao.prototype._destroy,as.prototype.destroySoon=as.prototype.end;var uC=(function(ce){r(W,ce);function W(G){var se=ce.call(this)||this;return se._filename="",se._filenameEncoded="",se._recursive=!1,se._encoding=m.ENCODING_UTF8,se._listenerRemovers=new Map,se._onParentChild=function(ye){ye.getName()===se._getName()&&se._emit("rename")},se._emit=function(ye){se.emit("change",ye,se._filenameEncoded)},se._persist=function(){se._timer=setTimeout(se._persist,1e6)},se._vol=G,se}return W.prototype._getName=function(){return this._steps[this._steps.length-1]},W.prototype.start=function(G,se,ye,Oe){var Fe=this;se===void 0&&(se=!0),ye===void 0&&(ye=!1),Oe===void 0&&(Oe=m.ENCODING_UTF8),this._filename=Ue(G),this._steps=xt(this._filename),this._filenameEncoded=(0,m.strToEncoding)(this._filename),this._recursive=ye,this._encoding=Oe;try{this._link=this._vol.getLinkOrThrow(this._filename,"FSWatcher")}catch(Mt){var Xe=new Error("watch ".concat(this._filename," ").concat(Mt.code));throw Xe.code=Mt.code,Xe.errno=Mt.code,Xe}var ot=function(Mt){var sn,Bu=Mt.getPath(),lo=Mt.getNode(),bl=function(){var Wr=re(Fe._filename,Bu);return Wr||(Wr=Fe._getName()),Fe.emit("change","change",Wr)};lo.on("change",bl);var Fu=(sn=Fe._listenerRemovers.get(lo.ino))!==null&&sn!==void 0?sn:[];Fu.push(function(){return lo.removeListener("change",bl)}),Fe._listenerRemovers.set(lo.ino,Fu)},lt=function(Mt){var sn,Bu=Mt.getNode(),lo=function(Wr){Fe.emit("change","rename",re(Fe._filename,Wr.getPath())),setTimeout(function(){ot(Wr),lt(Wr)})},bl=function(Wr){var ls=function(Ms){var $y=Ms.getNode().ino,cC=Fe._listenerRemovers.get($y);cC&&(cC.forEach(function(Wy){return Wy()}),Fe._listenerRemovers.delete($y)),Object.values(Ms.children).forEach(function(Wy){Wy&&ls(Wy)})};ls(Wr),Fe.emit("change","rename",re(Fe._filename,Wr.getPath()))};Object.entries(Mt.children).forEach(function(Wr){var ls=Wr[0],Ms=Wr[1];Ms&&ls!=="."&&ls!==".."&&ot(Ms)}),Mt.on("child:add",lo),Mt.on("child:delete",bl);var Fu=(sn=Fe._listenerRemovers.get(Bu.ino))!==null&&sn!==void 0?sn:[];Fu.push(function(){Mt.removeListener("child:add",lo),Mt.removeListener("child:delete",bl)}),ye&&Object.entries(Mt.children).forEach(function(Wr){var ls=Wr[0],Ms=Wr[1];Ms&&ls!=="."&&ls!==".."&<(Ms)})};ot(this._link),lt(this._link);var wt=this._link.parent;wt&&(wt.setMaxListeners(wt.getMaxListeners()+1),wt.on("child:delete",this._onParentChild)),se&&this._persist()},W.prototype.close=function(){clearTimeout(this._timer),this._listenerRemovers.forEach(function(se){se.forEach(function(ye){return ye()})}),this._listenerRemovers.clear();var G=this._link.parent;G&&G.removeListener("child:delete",this._onParentChild)},W})(d.EventEmitter);return Ut.FSWatcher=uC,Ut}function qj(){return _O||(_O=!0,Object.defineProperty(fa,"__esModule",{value:!0}),fa.fsSyncMethods=fa.fsProps=fa.fsAsyncMethods=void 0,fa.fsProps=["constants","F_OK","R_OK","W_OK","X_OK","Stats"],fa.fsSyncMethods=["renameSync","ftruncateSync","truncateSync","chownSync","fchownSync","lchownSync","chmodSync","fchmodSync","lchmodSync","statSync","lstatSync","fstatSync","linkSync","symlinkSync","readlinkSync","realpathSync","unlinkSync","rmdirSync","mkdirSync","mkdirpSync","readdirSync","closeSync","openSync","utimesSync","futimesSync","fsyncSync","writeSync","readSync","readFileSync","writeFileSync","appendFileSync","existsSync","accessSync","fdatasyncSync","mkdtempSync","copyFileSync","rmSync","createReadStream","createWriteStream"],fa.fsAsyncMethods=["rename","ftruncate","truncate","chown","fchown","lchown","chmod","fchmod","lchmod","stat","lstat","fstat","link","symlink","readlink","realpath","unlink","rmdir","mkdir","mkdirp","readdir","close","open","utimes","futimes","fsync","write","read","readFile","writeFile","appendFile","exists","access","fdatasync","mkdtemp","copyFile","rm","watchFile","unwatchFile","watch"]),fa}function Gj(){if(AO)return yn;AO=!0;var r=yn&&yn.__assign||function(){return r=Object.assign||function(m){for(var y,v=1,w=arguments.length;v<w;v++){y=arguments[v];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(m[b]=y[b])}return m},r.apply(this,arguments)};Object.defineProperty(yn,"__esModule",{value:!0}),yn.fs=yn.createFsFromVolume=yn.vol=yn.Volume=void 0;var e=J2(),t=TO(),n=DO(),i=qj(),o=i.fsSyncMethods,s=i.fsAsyncMethods,a=ug(),u=a.constants.F_OK,c=a.constants.R_OK,f=a.constants.W_OK,h=a.constants.X_OK;yn.Volume=n.Volume,yn.vol=new n.Volume;function d(m){for(var y={F_OK:u,R_OK:c,W_OK:f,X_OK:h,constants:a.constants,Stats:e.default,Dirent:t.default},v=0,w=o;v<w.length;v++){var b=w[v];typeof m[b]=="function"&&(y[b]=m[b].bind(m))}for(var E=0,_=s;E<_.length;E++){var b=_[E];typeof m[b]=="function"&&(y[b]=m[b].bind(m))}return y.StatWatcher=m.StatWatcher,y.FSWatcher=m.FSWatcher,y.WriteStream=m.WriteStream,y.ReadStream=m.ReadStream,y.promises=m.promises,y._toUnixTimestamp=n.toUnixTimestamp,y}return yn.createFsFromVolume=d,yn.fs=d(yn.vol),yn=r(r({},yn),yn.fs),yn.semantic=!0,yn}function Oi(r){throw new Error(`Node.js fs ${r} is not supported by JSPM core in the browser`)}function IO(r,e,t){let n=0,i=new TextDecoder;ha.watch(r,"utf8",()=>{let{size:o}=ha.fstatSync(e),s=He.alloc(o-n);ha.readSync(e,s,0,s.length,n),n=o,t(i.decode(s,{stream:!0}))})}function e_(r,e){if(r.protocol==="file:")return Z2(r);if(r.protocol==="https:"||r.protocol==="http:"){let t="\\\\url\\"+r.href.replaceAll(/\//g,"\\\\");if(kb(t))return t;if(e)throw new Error(`Cannot sync request URL ${r} via FS. JSPM FS support for network URLs requires using async FS methods or priming the MemFS cache first with an async request before a sync request.`);return(async()=>{let n=await fetch(r);if(!n.ok)throw new Error(`Unable to fetch ${r.href}, ${n.status}`);let i=await n.arrayBuffer();return NO(t,He.from(i)),t})()}throw new Error("URL "+r+" not supported in JSPM FS implementation.")}function Yj(r){return function(e,...t){return e instanceof URL?r(e_(e,!0),...t):r(e,...t)}}function Xj(r){return async function(e,...t){return e instanceof URL?r(await e_(e),...t):r(e,...t)}}function Kj(r){return function(e,...t){let n=t[t.length-1];e instanceof URL&&typeof n=="function"?e_(e).then(i=>{r(i,...t)},n):r(e,...t)}}var ag,aO,Ib,lO,ph,uO,Us,cO,un,fO,Fj,go,hO,gh,dO,Nb,pO,gO,mh,mO,ci,yO,Ob,bO,jj,Cl,wO,lg,vO,Ut,EO,Hj,fa,_O,yn,AO,ac,Kn,ha,Vj,vr,Zj,Jj,Qj,e$,t$,r$,n$,i$,s$,o$,a$,l$,u$,c$,f$,h$,d$,kb,p$,g$,m$,y$,b$,w$,v$,E$,_$,A$,x$,S$,T$,C$,R$,D$,I$,N$,O$,k$,L$,t_,P$,M$,B$,F$,U$,j$,$$,W$,z$,H$,q$,G$,V$,Y$,X$,r_,K$,Z$,J$,Q$,e9,t9,r9,n9,i9,s9,o9,a9,l9,u9,c9,f9,h9,d9,p9,g9,m9,y9,b9,w9,NO,v9,E9,_9,A9,x9,S9,T9,C9,R9,D9,I9,N9,O9,k9,L9,P9,M9,B9,Pb=_t(()=>{Te();Re();Ce();Jf();w1();yb();Al();_I();ih();Ju();vb();uh();f2();El();oO();Rb();d2();og();j2();ag={},aO=!1;Ib={},lO=!1;ph={},uO=!1;Us={},cO=!1;un={},fO=!1,Fj=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;go={},hO=!1;gh={},dO=!1;an._makeLong;an.basename;an.delimiter;an.dirname;an.extname;an.format;an.isAbsolute;an.join;an.normalize;an.parse;an.posix;an.relative;an.resolve;an.sep;an.win32;Nb={},pO=!1,gO=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;mh={},mO=!1;ci={},yO=!1;Ob={},bO=!1,jj=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;Cl={},wO=!1;lg={},vO=!1;Ut={},EO=!1,Hj=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;fa={},_O=!1;yn={},AO=!1;ac=Gj();ac.__esModule;ac.fs;ac.createFsFromVolume;ac.vol;ac.Volume;ac.semantic;Kn=DO();Kn.__esModule;Kn.FSWatcher;Kn.StatWatcher;Kn.Volume;Kn.toUnixTimestamp;Kn.bufferToEncoding;Kn.dataToBuffer;Kn.dataToStr;Kn.pathToSteps;Kn.filenameToSteps;Kn.pathToFilename;Kn.flagsToNumber;Kn.FLAGS;Kn.ReadStream;Kn.WriteStream;({vol:ha,createFsFromVolume:Vj}=ac);ha.fromNestedJSON({"/dev":{stdin:"",stdout:"",stderr:""},"/usr/bin":{},"/home":{},"/tmp":{}});ha.releasedFds=[2,1,0];ha.openSync("/dev/stdin","w");ha.openSync("/dev/stdout","r");ha.openSync("/dev/stderr","r");IO("/dev/stdout",1,console.log);IO("/dev/stderr",2,console.error);vr=Vj(ha);vr.opendir=()=>Oi("opendir");vr.opendirSync=()=>Oi("opendirSync");vr.promises.opendir=()=>Oi("promises.opendir");vr.cp=()=>Oi("cp");vr.cpSync=()=>Oi("cpSync");vr.promises.cp=()=>Oi("promises.cp");vr.readv=()=>Oi("readv");vr.readvSync=()=>Oi("readvSync");vr.rm=()=>Oi("rm");vr.rmSync=()=>Oi("rmSync");vr.promises.rm=()=>Oi("promises.rm");vr.Dir=()=>Oi("Dir");vr.promises.watch=()=>Oi("promises.watch");vr.FileReadStream=vr.ReadStream;vr.FileWriteStream=vr.WriteStream;vr.promises.readFile=Xj(vr.promises.readFile);vr.readFile=Kj(vr.readFile);vr.readFileSync=Yj(vr.readFileSync);({appendFile:Zj,appendFileSync:Jj,access:Qj,accessSync:e$,chown:t$,chownSync:r$,chmod:n$,chmodSync:i$,close:s$,closeSync:o$,copyFile:a$,copyFileSync:l$,cp:u$,cpSync:c$,createReadStream:f$,createWriteStream:h$,exists:d$,existsSync:kb,fchown:p$,fchownSync:g$,fchmod:m$,fchmodSync:y$,fdatasync:b$,fdatasyncSync:w$,fstat:v$,fstatSync:E$,fsync:_$,fsyncSync:A$,ftruncate:x$,ftruncateSync:S$,futimes:T$,futimesSync:C$,lchown:R$,lchownSync:D$,lchmod:I$,lchmodSync:N$,link:O$,linkSync:k$,lstat:L$,lstatSync:t_,mkdir:P$,mkdirSync:M$,mkdtemp:B$,mkdtempSync:F$,open:U$,openSync:j$,opendir:$$,opendirSync:W$,readdir:z$,readdirSync:H$,read:q$,readSync:G$,readv:V$,readvSync:Y$,readFile:X$,readFileSync:r_,readlink:K$,readlinkSync:Z$,realpath:J$,realpathSync:Q$,rename:e9,renameSync:t9,rm:r9,rmSync:n9,rmdir:i9,rmdirSync:s9,stat:o9,statSync:a9,symlink:l9,symlinkSync:u9,truncate:c9,truncateSync:f9,unwatchFile:h9,unlink:d9,unlinkSync:p9,utimes:g9,utimesSync:m9,watch:y9,watchFile:b9,writeFile:w9,writeFileSync:NO,write:v9,writeSync:E9,writev:_9,writevSync:A9,Dir:x9,Dirent:S9,Stats:T9,ReadStream:C9,WriteStream:R9,FileReadStream:D9,FileWriteStream:I9,_toUnixTimestamp:N9,constants:{F_OK:O9,R_OK:k9,W_OK:L9,X_OK:P9},constants:M9,promises:B9}=vr)});var cg=mt(yh=>{"use strict";Te();Re();Ce();function F9(r,e,t){if(t===void 0&&(t=Array.prototype),r&&typeof t.find=="function")return t.find.call(r,e);for(var n=0;n<r.length;n++)if(Object.prototype.hasOwnProperty.call(r,n)){var i=r[n];if(e.call(void 0,i,n,r))return i}}function n_(r,e){return e===void 0&&(e=Object),e&&typeof e.freeze=="function"?e.freeze(r):r}function U9(r,e){if(r===null||typeof r!="object")throw new TypeError("target is not an object");for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t]);return r}var OO=n_({HTML:"text/html",isHTML:function(r){return r===OO.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),kO=n_({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(r){return r===kO.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});yh.assign=U9;yh.find=F9;yh.freeze=n_;yh.MIME_TYPE=OO;yh.NAMESPACE=kO});var p_=mt(Rl=>{Te();Re();Ce();var $O=cg(),mo=$O.find,fg=$O.NAMESPACE;function j9(r){return r!==""}function $9(r){return r?r.split(/[\t\n\f\r ]+/).filter(j9):[]}function W9(r,e){return r.hasOwnProperty(e)||(r[e]=!0),r}function LO(r){if(!r)return[];var e=$9(r);return Object.keys(e.reduce(W9,{}))}function z9(r){return function(e){return r&&r.indexOf(e)!==-1}}function pg(r,e){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])}function hi(r,e){var t=r.prototype;if(!(t instanceof e)){let i=function(){};var n=i;i.prototype=e.prototype,i=new i,pg(t,i),r.prototype=t=i}t.constructor!=r&&(typeof r!="function"&&console.error("unknown Class:"+r),t.constructor=r)}var di={},fs=di.ELEMENT_NODE=1,wh=di.ATTRIBUTE_NODE=2,Mb=di.TEXT_NODE=3,WO=di.CDATA_SECTION_NODE=4,zO=di.ENTITY_REFERENCE_NODE=5,H9=di.ENTITY_NODE=6,HO=di.PROCESSING_INSTRUCTION_NODE=7,qO=di.COMMENT_NODE=8,GO=di.DOCUMENT_NODE=9,VO=di.DOCUMENT_TYPE_NODE=10,pa=di.DOCUMENT_FRAGMENT_NODE=11,q9=di.NOTATION_NODE=12,Un={},bn={},HK=Un.INDEX_SIZE_ERR=(bn[1]="Index size error",1),qK=Un.DOMSTRING_SIZE_ERR=(bn[2]="DOMString size error",2),fi=Un.HIERARCHY_REQUEST_ERR=(bn[3]="Hierarchy request error",3),GK=Un.WRONG_DOCUMENT_ERR=(bn[4]="Wrong document",4),VK=Un.INVALID_CHARACTER_ERR=(bn[5]="Invalid character",5),YK=Un.NO_DATA_ALLOWED_ERR=(bn[6]="No data allowed",6),XK=Un.NO_MODIFICATION_ALLOWED_ERR=(bn[7]="No modification allowed",7),YO=Un.NOT_FOUND_ERR=(bn[8]="Not found",8),KK=Un.NOT_SUPPORTED_ERR=(bn[9]="Not supported",9),PO=Un.INUSE_ATTRIBUTE_ERR=(bn[10]="Attribute in use",10),ZK=Un.INVALID_STATE_ERR=(bn[11]="Invalid state",11),JK=Un.SYNTAX_ERR=(bn[12]="Syntax error",12),QK=Un.INVALID_MODIFICATION_ERR=(bn[13]="Invalid modification",13),eZ=Un.NAMESPACE_ERR=(bn[14]="Invalid namespace",14),tZ=Un.INVALID_ACCESS_ERR=(bn[15]="Invalid access",15);function Gr(r,e){if(e instanceof Error)var t=e;else t=this,Error.call(this,bn[r]),this.message=bn[r],Error.captureStackTrace&&Error.captureStackTrace(this,Gr);return t.code=r,e&&(this.message=this.message+": "+e),t}Gr.prototype=Error.prototype;pg(Un,Gr);function da(){}da.prototype={length:0,item:function(r){return r>=0&&r<this.length?this[r]:null},toString:function(r,e){for(var t=[],n=0;n<this.length;n++)bh(this[n],t,r,e);return t.join("")},filter:function(r){return Array.prototype.filter.call(this,r)},indexOf:function(r){return Array.prototype.indexOf.call(this,r)}};function vh(r,e){this._node=r,this._refresh=e,o_(this)}function o_(r){var e=r._node._inc||r._node.ownerDocument._inc;if(r._inc!==e){var t=r._refresh(r._node);if(ok(r,"length",t.length),!r.$$length||t.length<r.$$length)for(var n=t.length;n in r;n++)Object.prototype.hasOwnProperty.call(r,n)&&delete r[n];pg(t,r),r._inc=e}}vh.prototype.item=function(r){return o_(this),this[r]||null};hi(vh,da);function Bb(){}function XO(r,e){for(var t=r.length;t--;)if(r[t]===e)return t}function MO(r,e,t,n){if(n?e[XO(e,n)]=t:e[e.length++]=t,r){t.ownerElement=r;var i=r.ownerDocument;i&&(n&&JO(i,r,n),G9(i,r,t))}}function BO(r,e,t){var n=XO(e,t);if(n>=0){for(var i=e.length-1;n<i;)e[n]=e[++n];if(e.length=i,r){var o=r.ownerDocument;o&&(JO(o,r,t),t.ownerElement=null)}}else throw new Gr(YO,new Error(r.tagName+"@"+t))}Bb.prototype={length:0,item:da.prototype.item,getNamedItem:function(r){for(var e=this.length;e--;){var t=this[e];if(t.nodeName==r)return t}},setNamedItem:function(r){var e=r.ownerElement;if(e&&e!=this._ownerElement)throw new Gr(PO);var t=this.getNamedItem(r.nodeName);return MO(this._ownerElement,this,r,t),t},setNamedItemNS:function(r){var e=r.ownerElement,t;if(e&&e!=this._ownerElement)throw new Gr(PO);return t=this.getNamedItemNS(r.namespaceURI,r.localName),MO(this._ownerElement,this,r,t),t},removeNamedItem:function(r){var e=this.getNamedItem(r);return BO(this._ownerElement,this,e),e},removeNamedItemNS:function(r,e){var t=this.getNamedItemNS(r,e);return BO(this._ownerElement,this,t),t},getNamedItemNS:function(r,e){for(var t=this.length;t--;){var n=this[t];if(n.localName==e&&n.namespaceURI==r)return n}return null}};function KO(){}KO.prototype={hasFeature:function(r,e){return!0},createDocument:function(r,e,t){var n=new gg;if(n.implementation=this,n.childNodes=new da,n.doctype=t||null,t&&n.appendChild(t),e){var i=n.createElementNS(r,e);n.appendChild(i)}return n},createDocumentType:function(r,e,t){var n=new jb;return n.name=r,n.nodeName=r,n.publicId=e||"",n.systemId=t||"",n}};function Jt(){}Jt.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(r,e){return Fb(this,r,e)},replaceChild:function(r,e){Fb(this,r,e,ek),e&&this.removeChild(e)},removeChild:function(r){return QO(this,r)},appendChild:function(r){return this.insertBefore(r,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(r){return s_(this.ownerDocument||this,this,r)},normalize:function(){for(var r=this.firstChild;r;){var e=r.nextSibling;e&&e.nodeType==Mb&&r.nodeType==Mb?(this.removeChild(e),r.appendData(e.data)):(r.normalize(),r=e)}},isSupported:function(r,e){return this.ownerDocument.implementation.hasFeature(r,e)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(r){for(var e=this;e;){var t=e._nsMap;if(t){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&t[n]===r)return n}e=e.nodeType==wh?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(r){for(var e=this;e;){var t=e._nsMap;if(t&&Object.prototype.hasOwnProperty.call(t,r))return t[r];e=e.nodeType==wh?e.ownerDocument:e.parentNode}return null},isDefaultNamespace:function(r){var e=this.lookupPrefix(r);return e==null}};function ZO(r){return r=="<"&&"<"||r==">"&&">"||r=="&"&&"&"||r=='"'&&"""||"&#"+r.charCodeAt()+";"}pg(di,Jt);pg(di,Jt.prototype);function hg(r,e){if(e(r))return!0;if(r=r.firstChild)do if(hg(r,e))return!0;while(r=r.nextSibling)}function gg(){this.ownerDocument=this}function G9(r,e,t){r&&r._inc++;var n=t.namespaceURI;n===fg.XMLNS&&(e._nsMap[t.prefix?t.localName:""]=t.value)}function JO(r,e,t,n){r&&r._inc++;var i=t.namespaceURI;i===fg.XMLNS&&delete e._nsMap[t.prefix?t.localName:""]}function a_(r,e,t){if(r&&r._inc){r._inc++;var n=e.childNodes;if(t)n[n.length++]=t;else{for(var i=e.firstChild,o=0;i;)n[o++]=i,i=i.nextSibling;n.length=o,delete n[n.length]}}}function QO(r,e){var t=e.previousSibling,n=e.nextSibling;return t?t.nextSibling=n:r.firstChild=n,n?n.previousSibling=t:r.lastChild=t,e.parentNode=null,e.previousSibling=null,e.nextSibling=null,a_(r.ownerDocument,r),e}function V9(r){return r&&(r.nodeType===Jt.DOCUMENT_NODE||r.nodeType===Jt.DOCUMENT_FRAGMENT_NODE||r.nodeType===Jt.ELEMENT_NODE)}function Y9(r){return r&&(yo(r)||l_(r)||ga(r)||r.nodeType===Jt.DOCUMENT_FRAGMENT_NODE||r.nodeType===Jt.COMMENT_NODE||r.nodeType===Jt.PROCESSING_INSTRUCTION_NODE)}function ga(r){return r&&r.nodeType===Jt.DOCUMENT_TYPE_NODE}function yo(r){return r&&r.nodeType===Jt.ELEMENT_NODE}function l_(r){return r&&r.nodeType===Jt.TEXT_NODE}function FO(r,e){var t=r.childNodes||[];if(mo(t,yo)||ga(e))return!1;var n=mo(t,ga);return!(e&&n&&t.indexOf(n)>t.indexOf(e))}function UO(r,e){var t=r.childNodes||[];function n(o){return yo(o)&&o!==e}if(mo(t,n))return!1;var i=mo(t,ga);return!(e&&i&&t.indexOf(i)>t.indexOf(e))}function X9(r,e,t){if(!V9(r))throw new Gr(fi,"Unexpected parent node type "+r.nodeType);if(t&&t.parentNode!==r)throw new Gr(YO,"child not in parent");if(!Y9(e)||ga(e)&&r.nodeType!==Jt.DOCUMENT_NODE)throw new Gr(fi,"Unexpected node type "+e.nodeType+" for parent node type "+r.nodeType)}function K9(r,e,t){var n=r.childNodes||[],i=e.childNodes||[];if(e.nodeType===Jt.DOCUMENT_FRAGMENT_NODE){var o=i.filter(yo);if(o.length>1||mo(i,l_))throw new Gr(fi,"More than one element or text in fragment");if(o.length===1&&!FO(r,t))throw new Gr(fi,"Element in fragment can not be inserted before doctype")}if(yo(e)&&!FO(r,t))throw new Gr(fi,"Only one element can be added and only after doctype");if(ga(e)){if(mo(n,ga))throw new Gr(fi,"Only one doctype is allowed");var s=mo(n,yo);if(t&&n.indexOf(s)<n.indexOf(t))throw new Gr(fi,"Doctype can only be inserted before an element");if(!t&&s)throw new Gr(fi,"Doctype can not be appended since element is present")}}function ek(r,e,t){var n=r.childNodes||[],i=e.childNodes||[];if(e.nodeType===Jt.DOCUMENT_FRAGMENT_NODE){var o=i.filter(yo);if(o.length>1||mo(i,l_))throw new Gr(fi,"More than one element or text in fragment");if(o.length===1&&!UO(r,t))throw new Gr(fi,"Element in fragment can not be inserted before doctype")}if(yo(e)&&!UO(r,t))throw new Gr(fi,"Only one element can be added and only after doctype");if(ga(e)){let u=function(c){return ga(c)&&c!==t};var a=u;if(mo(n,u))throw new Gr(fi,"Only one doctype is allowed");var s=mo(n,yo);if(t&&n.indexOf(s)<n.indexOf(t))throw new Gr(fi,"Doctype can only be inserted before an element")}}function Fb(r,e,t,n){X9(r,e,t),r.nodeType===Jt.DOCUMENT_NODE&&(n||K9)(r,e,t);var i=e.parentNode;if(i&&i.removeChild(e),e.nodeType===pa){var o=e.firstChild;if(o==null)return e;var s=e.lastChild}else o=s=e;var a=t?t.previousSibling:r.lastChild;o.previousSibling=a,s.nextSibling=t,a?a.nextSibling=o:r.firstChild=o,t==null?r.lastChild=s:t.previousSibling=s;do{o.parentNode=r;var u=r.ownerDocument||r;dg(o,u)}while(o!==s&&(o=o.nextSibling));return a_(r.ownerDocument||r,r),e.nodeType==pa&&(e.firstChild=e.lastChild=null),e}function dg(r,e){if(r.ownerDocument!==e){if(r.ownerDocument=e,r.nodeType===fs&&r.attributes)for(var t=0;t<r.attributes.length;t++){var n=r.attributes.item(t);n&&(n.ownerDocument=e)}for(var i=r.firstChild;i;)dg(i,e),i=i.nextSibling}}function Z9(r,e){e.parentNode&&e.parentNode.removeChild(e),e.parentNode=r,e.previousSibling=r.lastChild,e.nextSibling=null,e.previousSibling?e.previousSibling.nextSibling=e:r.firstChild=e,r.lastChild=e,a_(r.ownerDocument,r,e);var t=r.ownerDocument||r;return dg(e,t),e}gg.prototype={nodeName:"#document",nodeType:GO,doctype:null,documentElement:null,_inc:1,insertBefore:function(r,e){if(r.nodeType==pa){for(var t=r.firstChild;t;){var n=t.nextSibling;this.insertBefore(t,e),t=n}return r}return Fb(this,r,e),dg(r,this),this.documentElement===null&&r.nodeType===fs&&(this.documentElement=r),r},removeChild:function(r){return this.documentElement==r&&(this.documentElement=null),QO(this,r)},replaceChild:function(r,e){Fb(this,r,e,ek),dg(r,this),e&&this.removeChild(e),yo(r)&&(this.documentElement=r)},importNode:function(r,e){return sk(this,r,e)},getElementById:function(r){var e=null;return hg(this.documentElement,function(t){if(t.nodeType==fs&&t.getAttribute("id")==r)return e=t,!0}),e},getElementsByClassName:function(r){var e=LO(r);return new vh(this,function(t){var n=[];return e.length>0&&hg(t.documentElement,function(i){if(i!==t&&i.nodeType===fs){var o=i.getAttribute("class");if(o){var s=r===o;if(!s){var a=LO(o);s=e.every(z9(a))}s&&n.push(i)}}}),n})},createElement:function(r){var e=new lc;e.ownerDocument=this,e.nodeName=r,e.tagName=r,e.localName=r,e.childNodes=new da;var t=e.attributes=new Bb;return t._ownerElement=e,e},createDocumentFragment:function(){var r=new $b;return r.ownerDocument=this,r.childNodes=new da,r},createTextNode:function(r){var e=new u_;return e.ownerDocument=this,e.appendData(r),e},createComment:function(r){var e=new c_;return e.ownerDocument=this,e.appendData(r),e},createCDATASection:function(r){var e=new f_;return e.ownerDocument=this,e.appendData(r),e},createProcessingInstruction:function(r,e){var t=new d_;return t.ownerDocument=this,t.tagName=t.nodeName=t.target=r,t.nodeValue=t.data=e,t},createAttribute:function(r){var e=new Ub;return e.ownerDocument=this,e.name=r,e.nodeName=r,e.localName=r,e.specified=!0,e},createEntityReference:function(r){var e=new h_;return e.ownerDocument=this,e.nodeName=r,e},createElementNS:function(r,e){var t=new lc,n=e.split(":"),i=t.attributes=new Bb;return t.childNodes=new da,t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.namespaceURI=r,n.length==2?(t.prefix=n[0],t.localName=n[1]):t.localName=e,i._ownerElement=t,t},createAttributeNS:function(r,e){var t=new Ub,n=e.split(":");return t.ownerDocument=this,t.nodeName=e,t.name=e,t.namespaceURI=r,t.specified=!0,n.length==2?(t.prefix=n[0],t.localName=n[1]):t.localName=e,t}};hi(gg,Jt);function lc(){this._nsMap={}}lc.prototype={nodeType:fs,hasAttribute:function(r){return this.getAttributeNode(r)!=null},getAttribute:function(r){var e=this.getAttributeNode(r);return e&&e.value||""},getAttributeNode:function(r){return this.attributes.getNamedItem(r)},setAttribute:function(r,e){var t=this.ownerDocument.createAttribute(r);t.value=t.nodeValue=""+e,this.setAttributeNode(t)},removeAttribute:function(r){var e=this.getAttributeNode(r);e&&this.removeAttributeNode(e)},appendChild:function(r){return r.nodeType===pa?this.insertBefore(r,null):Z9(this,r)},setAttributeNode:function(r){return this.attributes.setNamedItem(r)},setAttributeNodeNS:function(r){return this.attributes.setNamedItemNS(r)},removeAttributeNode:function(r){return this.attributes.removeNamedItem(r.nodeName)},removeAttributeNS:function(r,e){var t=this.getAttributeNodeNS(r,e);t&&this.removeAttributeNode(t)},hasAttributeNS:function(r,e){return this.getAttributeNodeNS(r,e)!=null},getAttributeNS:function(r,e){var t=this.getAttributeNodeNS(r,e);return t&&t.value||""},setAttributeNS:function(r,e,t){var n=this.ownerDocument.createAttributeNS(r,e);n.value=n.nodeValue=""+t,this.setAttributeNode(n)},getAttributeNodeNS:function(r,e){return this.attributes.getNamedItemNS(r,e)},getElementsByTagName:function(r){return new vh(this,function(e){var t=[];return hg(e,function(n){n!==e&&n.nodeType==fs&&(r==="*"||n.tagName==r)&&t.push(n)}),t})},getElementsByTagNameNS:function(r,e){return new vh(this,function(t){var n=[];return hg(t,function(i){i!==t&&i.nodeType===fs&&(r==="*"||i.namespaceURI===r)&&(e==="*"||i.localName==e)&&n.push(i)}),n})}};gg.prototype.getElementsByTagName=lc.prototype.getElementsByTagName;gg.prototype.getElementsByTagNameNS=lc.prototype.getElementsByTagNameNS;hi(lc,Jt);function Ub(){}Ub.prototype.nodeType=wh;hi(Ub,Jt);function mg(){}mg.prototype={data:"",substringData:function(r,e){return this.data.substring(r,r+e)},appendData:function(r){r=this.data+r,this.nodeValue=this.data=r,this.length=r.length},insertData:function(r,e){this.replaceData(r,0,e)},appendChild:function(r){throw new Error(bn[fi])},deleteData:function(r,e){this.replaceData(r,e,"")},replaceData:function(r,e,t){var n=this.data.substring(0,r),i=this.data.substring(r+e);t=n+t+i,this.nodeValue=this.data=t,this.length=t.length}};hi(mg,Jt);function u_(){}u_.prototype={nodeName:"#text",nodeType:Mb,splitText:function(r){var e=this.data,t=e.substring(r);e=e.substring(0,r),this.data=this.nodeValue=e,this.length=e.length;var n=this.ownerDocument.createTextNode(t);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n}};hi(u_,mg);function c_(){}c_.prototype={nodeName:"#comment",nodeType:qO};hi(c_,mg);function f_(){}f_.prototype={nodeName:"#cdata-section",nodeType:WO};hi(f_,mg);function jb(){}jb.prototype.nodeType=VO;hi(jb,Jt);function tk(){}tk.prototype.nodeType=q9;hi(tk,Jt);function rk(){}rk.prototype.nodeType=H9;hi(rk,Jt);function h_(){}h_.prototype.nodeType=zO;hi(h_,Jt);function $b(){}$b.prototype.nodeName="#document-fragment";$b.prototype.nodeType=pa;hi($b,Jt);function d_(){}d_.prototype.nodeType=HO;hi(d_,Jt);function nk(){}nk.prototype.serializeToString=function(r,e,t){return ik.call(r,e,t)};Jt.prototype.toString=ik;function ik(r,e){var t=[],n=this.nodeType==9&&this.documentElement||this,i=n.prefix,o=n.namespaceURI;if(o&&i==null){var i=n.lookupPrefix(o);if(i==null)var s=[{namespace:o,prefix:null}]}return bh(this,t,r,e,s),t.join("")}function jO(r,e,t){var n=r.prefix||"",i=r.namespaceURI;if(!i||n==="xml"&&i===fg.XML||i===fg.XMLNS)return!1;for(var o=t.length;o--;){var s=t[o];if(s.prefix===n)return s.namespace!==i}return!0}function i_(r,e,t){r.push(" ",e,'="',t.replace(/[<>&"\t\n\r]/g,ZO),'"')}function bh(r,e,t,n,i){if(i||(i=[]),n)if(r=n(r),r){if(typeof r=="string"){e.push(r);return}}else return;switch(r.nodeType){case fs:var o=r.attributes,s=o.length,b=r.firstChild,a=r.tagName;t=fg.isHTML(r.namespaceURI)||t;var u=a;if(!t&&!r.prefix&&r.namespaceURI){for(var c,f=0;f<o.length;f++)if(o.item(f).name==="xmlns"){c=o.item(f).value;break}if(!c)for(var h=i.length-1;h>=0;h--){var d=i[h];if(d.prefix===""&&d.namespace===r.namespaceURI){c=d.namespace;break}}if(c!==r.namespaceURI)for(var h=i.length-1;h>=0;h--){var d=i[h];if(d.namespace===r.namespaceURI){d.prefix&&(u=d.prefix+":"+a);break}}}e.push("<",u);for(var m=0;m<s;m++){var y=o.item(m);y.prefix=="xmlns"?i.push({prefix:y.localName,namespace:y.value}):y.nodeName=="xmlns"&&i.push({prefix:"",namespace:y.value})}for(var m=0;m<s;m++){var y=o.item(m);if(jO(y,t,i)){var v=y.prefix||"",w=y.namespaceURI;i_(e,v?"xmlns:"+v:"xmlns",w),i.push({prefix:v,namespace:w})}bh(y,e,t,n,i)}if(a===u&&jO(r,t,i)){var v=r.prefix||"",w=r.namespaceURI;i_(e,v?"xmlns:"+v:"xmlns",w),i.push({prefix:v,namespace:w})}if(b||t&&!/^(?:meta|link|img|br|hr|input)$/i.test(a)){if(e.push(">"),t&&/^script$/i.test(a))for(;b;)b.data?e.push(b.data):bh(b,e,t,n,i.slice()),b=b.nextSibling;else for(;b;)bh(b,e,t,n,i.slice()),b=b.nextSibling;e.push("</",u,">")}else e.push("/>");return;case GO:case pa:for(var b=r.firstChild;b;)bh(b,e,t,n,i.slice()),b=b.nextSibling;return;case wh:return i_(e,r.name,r.value);case Mb:return e.push(r.data.replace(/[<&>]/g,ZO));case WO:return e.push("<![CDATA[",r.data,"]]>");case qO:return e.push("<!--",r.data,"-->");case VO:var E=r.publicId,_=r.systemId;if(e.push("<!DOCTYPE ",r.name),E)e.push(" PUBLIC ",E),_&&_!="."&&e.push(" ",_),e.push(">");else if(_&&_!=".")e.push(" SYSTEM ",_,">");else{var S=r.internalSubset;S&&e.push(" [",S,"]"),e.push(">")}return;case HO:return e.push("<?",r.target," ",r.data,"?>");case zO:return e.push("&",r.nodeName,";");default:e.push("??",r.nodeName)}}function sk(r,e,t){var n;switch(e.nodeType){case fs:n=e.cloneNode(!1),n.ownerDocument=r;case pa:break;case wh:t=!0;break}if(n||(n=e.cloneNode(!1)),n.ownerDocument=r,n.parentNode=null,t)for(var i=e.firstChild;i;)n.appendChild(sk(r,i,t)),i=i.nextSibling;return n}function s_(r,e,t){var n=new e.constructor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var o=e[i];typeof o!="object"&&o!=n[i]&&(n[i]=o)}switch(e.childNodes&&(n.childNodes=new da),n.ownerDocument=r,n.nodeType){case fs:var s=e.attributes,a=n.attributes=new Bb,u=s.length;a._ownerElement=n;for(var c=0;c<u;c++)n.setAttributeNode(s_(r,s.item(c),!0));break;case wh:t=!0}if(t)for(var f=e.firstChild;f;)n.appendChild(s_(r,f,t)),f=f.nextSibling;return n}function ok(r,e,t){r[e]=t}try{if(Object.defineProperty){let r=function(e){switch(e.nodeType){case fs:case pa:var t=[];for(e=e.firstChild;e;)e.nodeType!==7&&e.nodeType!==8&&t.push(r(e)),e=e.nextSibling;return t.join("");default:return e.nodeValue}};J9=r,Object.defineProperty(vh.prototype,"length",{get:function(){return o_(this),this.$$length}}),Object.defineProperty(Jt.prototype,"textContent",{get:function(){return r(this)},set:function(e){switch(this.nodeType){case fs:case pa:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),ok=function(e,t,n){e["$$"+t]=n}}}catch{}var J9;Rl.DocumentType=jb;Rl.DOMException=Gr;Rl.DOMImplementation=KO;Rl.Element=lc;Rl.Node=Jt;Rl.NodeList=da;Rl.XMLSerializer=nk});var lk=mt(yg=>{"use strict";Te();Re();Ce();var ak=cg().freeze;yg.XML_ENTITIES=ak({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'});yg.HTML_ENTITIES=ak({Aacute:"\xC1",aacute:"\xE1",Abreve:"\u0102",abreve:"\u0103",ac:"\u223E",acd:"\u223F",acE:"\u223E\u0333",Acirc:"\xC2",acirc:"\xE2",acute:"\xB4",Acy:"\u0410",acy:"\u0430",AElig:"\xC6",aelig:"\xE6",af:"\u2061",Afr:"\u{1D504}",afr:"\u{1D51E}",Agrave:"\xC0",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",Alpha:"\u0391",alpha:"\u03B1",Amacr:"\u0100",amacr:"\u0101",amalg:"\u2A3F",AMP:"&",amp:"&",And:"\u2A53",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",Aogon:"\u0104",aogon:"\u0105",Aopf:"\u{1D538}",aopf:"\u{1D552}",ap:"\u2248",apacir:"\u2A6F",apE:"\u2A70",ape:"\u224A",apid:"\u224B",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224A",Aring:"\xC5",aring:"\xE5",Ascr:"\u{1D49C}",ascr:"\u{1D4B6}",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224D",Atilde:"\xC3",atilde:"\xE3",Auml:"\xC4",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",Backslash:"\u2216",Barv:"\u2AE7",barvee:"\u22BD",Barwed:"\u2306",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",Bcy:"\u0411",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",Because:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",Bernoullis:"\u212C",Beta:"\u0392",beta:"\u03B2",beth:"\u2136",between:"\u226C",Bfr:"\u{1D505}",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bNot:"\u2AED",bnot:"\u2310",Bopf:"\u{1D539}",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxbox:"\u29C9",boxDL:"\u2557",boxDl:"\u2556",boxdL:"\u2555",boxdl:"\u2510",boxDR:"\u2554",boxDr:"\u2553",boxdR:"\u2552",boxdr:"\u250C",boxH:"\u2550",boxh:"\u2500",boxHD:"\u2566",boxHd:"\u2564",boxhD:"\u2565",boxhd:"\u252C",boxHU:"\u2569",boxHu:"\u2567",boxhU:"\u2568",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxUL:"\u255D",boxUl:"\u255C",boxuL:"\u255B",boxul:"\u2518",boxUR:"\u255A",boxUr:"\u2559",boxuR:"\u2558",boxur:"\u2514",boxV:"\u2551",boxv:"\u2502",boxVH:"\u256C",boxVh:"\u256B",boxvH:"\u256A",boxvh:"\u253C",boxVL:"\u2563",boxVl:"\u2562",boxvL:"\u2561",boxvl:"\u2524",boxVR:"\u2560",boxVr:"\u255F",boxvR:"\u255E",boxvr:"\u251C",bprime:"\u2035",Breve:"\u02D8",breve:"\u02D8",brvbar:"\xA6",Bscr:"\u212C",bscr:"\u{1D4B7}",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",Bumpeq:"\u224E",bumpeq:"\u224F",Cacute:"\u0106",cacute:"\u0107",Cap:"\u22D2",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",CapitalDifferentialD:"\u2145",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",Cayleys:"\u212D",ccaps:"\u2A4D",Ccaron:"\u010C",ccaron:"\u010D",Ccedil:"\xC7",ccedil:"\xE7",Ccirc:"\u0108",ccirc:"\u0109",Cconint:"\u2230",ccups:"\u2A4C",ccupssm:"\u2A50",Cdot:"\u010A",cdot:"\u010B",cedil:"\xB8",Cedilla:"\xB8",cemptyv:"\u29B2",cent:"\xA2",CenterDot:"\xB7",centerdot:"\xB7",Cfr:"\u212D",cfr:"\u{1D520}",CHcy:"\u0427",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",Chi:"\u03A7",chi:"\u03C7",cir:"\u25CB",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",CircleDot:"\u2299",circledR:"\xAE",circledS:"\u24C8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cirE:"\u29C3",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",Colon:"\u2237",colon:":",Colone:"\u2A74",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",Congruent:"\u2261",Conint:"\u222F",conint:"\u222E",ContourIntegral:"\u222E",Copf:"\u2102",copf:"\u{1D554}",coprod:"\u2210",Coproduct:"\u2210",COPY:"\xA9",copy:"\xA9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21B5",Cross:"\u2A2F",cross:"\u2717",Cscr:"\u{1D49E}",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",Cup:"\u22D3",cup:"\u222A",cupbrcap:"\u2A48",CupCap:"\u224D",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",Dagger:"\u2021",dagger:"\u2020",daleth:"\u2138",Darr:"\u21A1",dArr:"\u21D3",darr:"\u2193",dash:"\u2010",Dashv:"\u2AE4",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",Dcaron:"\u010E",dcaron:"\u010F",Dcy:"\u0414",dcy:"\u0434",DD:"\u2145",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",DDotrahd:"\u2911",ddotseq:"\u2A77",deg:"\xB0",Del:"\u2207",Delta:"\u0394",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",Dfr:"\u{1D507}",dfr:"\u{1D521}",dHar:"\u2965",dharl:"\u21C3",dharr:"\u21C2",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",diam:"\u22C4",Diamond:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",DifferentialD:"\u2146",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",DJcy:"\u0402",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",Dopf:"\u{1D53B}",dopf:"\u{1D555}",Dot:"\xA8",dot:"\u02D9",DotDot:"\u20DC",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",Downarrow:"\u21D3",downarrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",Dscr:"\u{1D49F}",dscr:"\u{1D4B9}",DScy:"\u0405",dscy:"\u0455",dsol:"\u29F6",Dstrok:"\u0110",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",DZcy:"\u040F",dzcy:"\u045F",dzigrarr:"\u27FF",Eacute:"\xC9",eacute:"\xE9",easter:"\u2A6E",Ecaron:"\u011A",ecaron:"\u011B",ecir:"\u2256",Ecirc:"\xCA",ecirc:"\xEA",ecolon:"\u2255",Ecy:"\u042D",ecy:"\u044D",eDDot:"\u2A77",Edot:"\u0116",eDot:"\u2251",edot:"\u0117",ee:"\u2147",efDot:"\u2252",Efr:"\u{1D508}",efr:"\u{1D522}",eg:"\u2A9A",Egrave:"\xC8",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",Element:"\u2208",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",Emacr:"\u0112",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25FB",emptyv:"\u2205",EmptyVerySmallSquare:"\u25AB",emsp:"\u2003",emsp13:"\u2004",emsp14:"\u2005",ENG:"\u014A",eng:"\u014B",ensp:"\u2002",Eogon:"\u0118",eogon:"\u0119",Eopf:"\u{1D53C}",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",Epsilon:"\u0395",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",Equal:"\u2A75",equals:"=",EqualTilde:"\u2242",equest:"\u225F",Equilibrium:"\u21CC",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erarr:"\u2971",erDot:"\u2253",Escr:"\u2130",escr:"\u212F",esdot:"\u2250",Esim:"\u2A73",esim:"\u2242",Eta:"\u0397",eta:"\u03B7",ETH:"\xD0",eth:"\xF0",Euml:"\xCB",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",ExponentialE:"\u2147",exponentiale:"\u2147",fallingdotseq:"\u2252",Fcy:"\u0424",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",Ffr:"\u{1D509}",ffr:"\u{1D523}",filig:"\uFB01",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",Fopf:"\u{1D53D}",fopf:"\u{1D557}",ForAll:"\u2200",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",Fouriertrf:"\u2131",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",Fscr:"\u2131",fscr:"\u{1D4BB}",gacute:"\u01F5",Gamma:"\u0393",gamma:"\u03B3",Gammad:"\u03DC",gammad:"\u03DD",gap:"\u2A86",Gbreve:"\u011E",gbreve:"\u011F",Gcedil:"\u0122",Gcirc:"\u011C",gcirc:"\u011D",Gcy:"\u0413",gcy:"\u0433",Gdot:"\u0120",gdot:"\u0121",gE:"\u2267",ge:"\u2265",gEl:"\u2A8C",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",Gfr:"\u{1D50A}",gfr:"\u{1D524}",Gg:"\u22D9",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",GJcy:"\u0403",gjcy:"\u0453",gl:"\u2277",gla:"\u2AA5",glE:"\u2A92",glj:"\u2AA4",gnap:"\u2A8A",gnapprox:"\u2A8A",gnE:"\u2269",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",Gopf:"\u{1D53E}",gopf:"\u{1D558}",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\u{1D4A2}",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",Gt:"\u226B",GT:">",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",Hacek:"\u02C7",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",HARDcy:"\u042A",hardcy:"\u044A",hArr:"\u21D4",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",Hat:"^",hbar:"\u210F",Hcirc:"\u0124",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",Hfr:"\u210C",hfr:"\u{1D525}",HilbertSpace:"\u210B",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",Hopf:"\u210D",hopf:"\u{1D559}",horbar:"\u2015",HorizontalLine:"\u2500",Hscr:"\u210B",hscr:"\u{1D4BD}",hslash:"\u210F",Hstrok:"\u0126",hstrok:"\u0127",HumpDownHump:"\u224E",HumpEqual:"\u224F",hybull:"\u2043",hyphen:"\u2010",Iacute:"\xCD",iacute:"\xED",ic:"\u2063",Icirc:"\xCE",icirc:"\xEE",Icy:"\u0418",icy:"\u0438",Idot:"\u0130",IEcy:"\u0415",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",Ifr:"\u2111",ifr:"\u{1D526}",Igrave:"\xCC",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",IJlig:"\u0132",ijlig:"\u0133",Im:"\u2111",Imacr:"\u012A",imacr:"\u012B",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",Implies:"\u21D2",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",Int:"\u222C",int:"\u222B",intcal:"\u22BA",integers:"\u2124",Integral:"\u222B",intercal:"\u22BA",Intersection:"\u22C2",intlarhk:"\u2A17",intprod:"\u2A3C",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",IOcy:"\u0401",iocy:"\u0451",Iogon:"\u012E",iogon:"\u012F",Iopf:"\u{1D540}",iopf:"\u{1D55A}",Iota:"\u0399",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",Iscr:"\u2110",iscr:"\u{1D4BE}",isin:"\u2208",isindot:"\u22F5",isinE:"\u22F9",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",Itilde:"\u0128",itilde:"\u0129",Iukcy:"\u0406",iukcy:"\u0456",Iuml:"\xCF",iuml:"\xEF",Jcirc:"\u0134",jcirc:"\u0135",Jcy:"\u0419",jcy:"\u0439",Jfr:"\u{1D50D}",jfr:"\u{1D527}",jmath:"\u0237",Jopf:"\u{1D541}",jopf:"\u{1D55B}",Jscr:"\u{1D4A5}",jscr:"\u{1D4BF}",Jsercy:"\u0408",jsercy:"\u0458",Jukcy:"\u0404",jukcy:"\u0454",Kappa:"\u039A",kappa:"\u03BA",kappav:"\u03F0",Kcedil:"\u0136",kcedil:"\u0137",Kcy:"\u041A",kcy:"\u043A",Kfr:"\u{1D50E}",kfr:"\u{1D528}",kgreen:"\u0138",KHcy:"\u0425",khcy:"\u0445",KJcy:"\u040C",kjcy:"\u045C",Kopf:"\u{1D542}",kopf:"\u{1D55C}",Kscr:"\u{1D4A6}",kscr:"\u{1D4C0}",lAarr:"\u21DA",Lacute:"\u0139",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",Lambda:"\u039B",lambda:"\u03BB",Lang:"\u27EA",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",Laplacetrf:"\u2112",laquo:"\xAB",Larr:"\u219E",lArr:"\u21D0",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",lAtail:"\u291B",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lBarr:"\u290E",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",Lcaron:"\u013D",lcaron:"\u013E",Lcedil:"\u013B",lcedil:"\u013C",lceil:"\u2308",lcub:"{",Lcy:"\u041B",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",lE:"\u2266",le:"\u2264",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",Leftarrow:"\u21D0",leftarrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",leftarrowtail:"\u21A2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",LeftRightArrow:"\u2194",Leftrightarrow:"\u21D4",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",leftthreetimes:"\u22CB",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",lEg:"\u2A8B",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2AA1",lesssim:"\u2272",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",lfisht:"\u297C",lfloor:"\u230A",Lfr:"\u{1D50F}",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lHar:"\u2962",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",LJcy:"\u0409",ljcy:"\u0459",Ll:"\u22D8",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",Lleftarrow:"\u21DA",llhard:"\u296B",lltri:"\u25FA",Lmidot:"\u013F",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnap:"\u2A89",lnapprox:"\u2A89",lnE:"\u2268",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",LongLeftArrow:"\u27F5",Longleftarrow:"\u27F8",longleftarrow:"\u27F5",LongLeftRightArrow:"\u27F7",Longleftrightarrow:"\u27FA",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",LongRightArrow:"\u27F6",Longrightarrow:"\u27F9",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",Lopf:"\u{1D543}",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",Lscr:"\u2112",lscr:"\u{1D4C1}",Lsh:"\u21B0",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",Lstrok:"\u0141",lstrok:"\u0142",Lt:"\u226A",LT:"<",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",ltrPar:"\u2996",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",Map:"\u2905",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",Mcy:"\u041C",mcy:"\u043C",mdash:"\u2014",mDDot:"\u223A",measuredangle:"\u2221",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\u{1D510}",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",MinusPlus:"\u2213",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",Mopf:"\u{1D544}",mopf:"\u{1D55E}",mp:"\u2213",Mscr:"\u2133",mscr:"\u{1D4C2}",mstpos:"\u223E",Mu:"\u039C",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nabla:"\u2207",Nacute:"\u0143",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",Ncaron:"\u0147",ncaron:"\u0148",Ncedil:"\u0145",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",Ncy:"\u041D",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",nearhk:"\u2924",neArr:"\u21D7",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:`
|
|
80
|
-
`,nexist:"\u2204",nexists:"\u2204",Nfr:"\u{1D511}",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",nGg:"\u22D9\u0338",ngsim:"\u2275",nGt:"\u226B\u20D2",ngt:"\u226F",ngtr:"\u226F",nGtv:"\u226B\u0338",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",NJcy:"\u040A",njcy:"\u045A",nlArr:"\u21CD",nlarr:"\u219A",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nLeftarrow:"\u21CD",nleftarrow:"\u219A",nLeftrightarrow:"\u21CE",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nLl:"\u22D8\u0338",nlsim:"\u2274",nLt:"\u226A\u20D2",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nLtv:"\u226A\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",nopf:"\u{1D55F}",Not:"\u2AEC",not:"\xAC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",notin:"\u2209",notindot:"\u22F5\u0338",notinE:"\u22F9\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nRightarrow:"\u21CF",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",Nscr:"\u{1D4A9}",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",Ntilde:"\xD1",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",Nu:"\u039D",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224D\u20D2",nVDash:"\u22AF",nVdash:"\u22AE",nvDash:"\u22AD",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvHarr:"\u2904",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwarhk:"\u2923",nwArr:"\u21D6",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xD3",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",Ocirc:"\xD4",ocirc:"\xF4",Ocy:"\u041E",ocy:"\u043E",odash:"\u229D",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",OElig:"\u0152",oelig:"\u0153",ofcir:"\u29BF",Ofr:"\u{1D512}",ofr:"\u{1D52C}",ogon:"\u02DB",Ograve:"\xD2",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",Omacr:"\u014C",omacr:"\u014D",Omega:"\u03A9",omega:"\u03C9",Omicron:"\u039F",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",Oopf:"\u{1D546}",oopf:"\u{1D560}",opar:"\u29B7",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",operp:"\u29B9",oplus:"\u2295",Or:"\u2A54",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oS:"\u24C8",Oscr:"\u{1D4AA}",oscr:"\u2134",Oslash:"\xD8",oslash:"\xF8",osol:"\u2298",Otilde:"\xD5",otilde:"\xF5",Otimes:"\u2A37",otimes:"\u2297",otimesas:"\u2A36",Ouml:"\xD6",ouml:"\xF6",ovbar:"\u233D",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",PartialD:"\u2202",Pcy:"\u041F",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",Pfr:"\u{1D513}",pfr:"\u{1D52D}",Phi:"\u03A6",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",Pi:"\u03A0",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",PlusMinus:"\xB1",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",Poincareplane:"\u210C",pointint:"\u2A15",Popf:"\u2119",popf:"\u{1D561}",pound:"\xA3",Pr:"\u2ABB",pr:"\u227A",prap:"\u2AB7",prcue:"\u227C",prE:"\u2AB3",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",Prime:"\u2033",prime:"\u2032",primes:"\u2119",prnap:"\u2AB9",prnE:"\u2AB5",prnsim:"\u22E8",prod:"\u220F",Product:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",Proportion:"\u2237",Proportional:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",Pscr:"\u{1D4AB}",pscr:"\u{1D4C5}",Psi:"\u03A8",psi:"\u03C8",puncsp:"\u2008",Qfr:"\u{1D514}",qfr:"\u{1D52E}",qint:"\u2A0C",Qopf:"\u211A",qopf:"\u{1D562}",qprime:"\u2057",Qscr:"\u{1D4AC}",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",QUOT:'"',quot:'"',rAarr:"\u21DB",race:"\u223D\u0331",Racute:"\u0154",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",Rang:"\u27EB",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",Rarr:"\u21A0",rArr:"\u21D2",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",Rarrtl:"\u2916",rarrtl:"\u21A3",rarrw:"\u219D",rAtail:"\u291C",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",RBarr:"\u2910",rBarr:"\u290F",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",Rcaron:"\u0158",rcaron:"\u0159",Rcedil:"\u0156",rcedil:"\u0157",rceil:"\u2309",rcub:"}",Rcy:"\u0420",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",Re:"\u211C",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",REG:"\xAE",reg:"\xAE",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",rfisht:"\u297D",rfloor:"\u230B",Rfr:"\u211C",rfr:"\u{1D52F}",rHar:"\u2964",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",Rho:"\u03A1",rho:"\u03C1",rhov:"\u03F1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",Rightarrow:"\u21D2",rightarrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",rightarrowtail:"\u21A3",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",rightthreetimes:"\u22CC",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",Ropf:"\u211D",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",Rrightarrow:"\u21DB",rsaquo:"\u203A",Rscr:"\u211B",rscr:"\u{1D4C7}",Rsh:"\u21B1",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",RuleDelayed:"\u29F4",ruluhar:"\u2968",rx:"\u211E",Sacute:"\u015A",sacute:"\u015B",sbquo:"\u201A",Sc:"\u2ABC",sc:"\u227B",scap:"\u2AB8",Scaron:"\u0160",scaron:"\u0161",sccue:"\u227D",scE:"\u2AB4",sce:"\u2AB0",Scedil:"\u015E",scedil:"\u015F",Scirc:"\u015C",scirc:"\u015D",scnap:"\u2ABA",scnE:"\u2AB6",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",Scy:"\u0421",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",searhk:"\u2925",seArr:"\u21D8",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",Sfr:"\u{1D516}",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",SHCHcy:"\u0429",shchcy:"\u0449",SHcy:"\u0428",shcy:"\u0448",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xAD",Sigma:"\u03A3",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",SOFTcy:"\u042C",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",Sopf:"\u{1D54A}",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",Sqrt:"\u221A",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",Square:"\u25A1",square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",Sscr:"\u{1D4AE}",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",Star:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",Sub:"\u22D0",sub:"\u2282",subdot:"\u2ABD",subE:"\u2AC5",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",Subset:"\u22D0",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",SubsetEqual:"\u2286",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",SuchThat:"\u220B",Sum:"\u2211",sum:"\u2211",sung:"\u266A",Sup:"\u22D1",sup:"\u2283",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",supdot:"\u2ABE",supdsub:"\u2AD8",supE:"\u2AC6",supe:"\u2287",supedot:"\u2AC4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",Supset:"\u22D1",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swarhk:"\u2926",swArr:"\u21D9",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",Tab:" ",target:"\u2316",Tau:"\u03A4",tau:"\u03C4",tbrk:"\u23B4",Tcaron:"\u0164",tcaron:"\u0165",Tcedil:"\u0162",tcedil:"\u0163",Tcy:"\u0422",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",Tfr:"\u{1D517}",tfr:"\u{1D531}",there4:"\u2234",Therefore:"\u2234",therefore:"\u2234",Theta:"\u0398",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",ThickSpace:"\u205F\u200A",thinsp:"\u2009",ThinSpace:"\u2009",thkap:"\u2248",thksim:"\u223C",THORN:"\xDE",thorn:"\xFE",Tilde:"\u223C",tilde:"\u02DC",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",Topf:"\u{1D54B}",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",TRADE:"\u2122",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",TripleDot:"\u20DB",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",Tscr:"\u{1D4AF}",tscr:"\u{1D4C9}",TScy:"\u0426",tscy:"\u0446",TSHcy:"\u040B",tshcy:"\u045B",Tstrok:"\u0166",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",Uacute:"\xDA",uacute:"\xFA",Uarr:"\u219F",uArr:"\u21D1",uarr:"\u2191",Uarrocir:"\u2949",Ubrcy:"\u040E",ubrcy:"\u045E",Ubreve:"\u016C",ubreve:"\u016D",Ucirc:"\xDB",ucirc:"\xFB",Ucy:"\u0423",ucy:"\u0443",udarr:"\u21C5",Udblac:"\u0170",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",Ufr:"\u{1D518}",ufr:"\u{1D532}",Ugrave:"\xD9",ugrave:"\xF9",uHar:"\u2963",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",Umacr:"\u016A",umacr:"\u016B",uml:"\xA8",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",uogon:"\u0173",Uopf:"\u{1D54C}",uopf:"\u{1D566}",UpArrow:"\u2191",Uparrow:"\u21D1",uparrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",Updownarrow:"\u21D5",updownarrow:"\u2195",UpEquilibrium:"\u296E",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",upsi:"\u03C5",upsih:"\u03D2",Upsilon:"\u03A5",upsilon:"\u03C5",UpTee:"\u22A5",UpTeeArrow:"\u21A5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",Uring:"\u016E",uring:"\u016F",urtri:"\u25F9",Uscr:"\u{1D4B0}",uscr:"\u{1D4CA}",utdot:"\u22F0",Utilde:"\u0168",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",Uuml:"\xDC",uuml:"\xFC",uwangle:"\u29A7",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",vArr:"\u21D5",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",Vbar:"\u2AEB",vBar:"\u2AE8",vBarv:"\u2AE9",Vcy:"\u0412",vcy:"\u0432",VDash:"\u22AB",Vdash:"\u22A9",vDash:"\u22A8",vdash:"\u22A2",Vdashl:"\u2AE6",Vee:"\u22C1",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",Verbar:"\u2016",verbar:"|",Vert:"\u2016",vert:"|",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",Vopf:"\u{1D54D}",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",Vscr:"\u{1D4B1}",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",Vvdash:"\u22AA",vzigzag:"\u299A",Wcirc:"\u0174",wcirc:"\u0175",wedbar:"\u2A5F",Wedge:"\u22C0",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",Wfr:"\u{1D51A}",wfr:"\u{1D534}",Wopf:"\u{1D54E}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",Wscr:"\u{1D4B2}",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",Xfr:"\u{1D51B}",xfr:"\u{1D535}",xhArr:"\u27FA",xharr:"\u27F7",Xi:"\u039E",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",Xopf:"\u{1D54F}",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",Xscr:"\u{1D4B3}",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",Yacute:"\xDD",yacute:"\xFD",YAcy:"\u042F",yacy:"\u044F",Ycirc:"\u0176",ycirc:"\u0177",Ycy:"\u042B",ycy:"\u044B",yen:"\xA5",Yfr:"\u{1D51C}",yfr:"\u{1D536}",YIcy:"\u0407",yicy:"\u0457",Yopf:"\u{1D550}",yopf:"\u{1D56A}",Yscr:"\u{1D4B4}",yscr:"\u{1D4CE}",YUcy:"\u042E",yucy:"\u044E",Yuml:"\u0178",yuml:"\xFF",Zacute:"\u0179",zacute:"\u017A",Zcaron:"\u017D",zcaron:"\u017E",Zcy:"\u0417",zcy:"\u0437",Zdot:"\u017B",zdot:"\u017C",zeetrf:"\u2128",ZeroWidthSpace:"\u200B",Zeta:"\u0396",zeta:"\u03B6",Zfr:"\u2128",zfr:"\u{1D537}",ZHcy:"\u0416",zhcy:"\u0436",zigrarr:"\u21DD",Zopf:"\u2124",zopf:"\u{1D56B}",Zscr:"\u{1D4B5}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"});yg.entityMap=yg.HTML_ENTITIES});var mk=mt(m_=>{Te();Re();Ce();var Eg=cg().NAMESPACE,g_=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,uk=new RegExp("[\\-\\.0-9"+g_.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),ck=new RegExp("^"+g_.source+uk.source+"*(?::"+g_.source+uk.source+"*)?$"),bg=0,Dl=1,Eh=2,wg=3,_h=4,Ah=5,vg=6,Wb=7;function xh(r,e){this.message=r,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,xh)}xh.prototype=new Error;xh.prototype.name=xh.name;function dk(){}dk.prototype={parse:function(r,e,t){var n=this.domBuilder;n.startDocument(),pk(e,e={}),Q9(r,e,t,n,this.errorHandler),n.endDocument()}};function Q9(r,e,t,n,i){function o(re){if(re>65535){re-=65536;var k=55296+(re>>10),x=56320+(re&1023);return String.fromCharCode(k,x)}else return String.fromCharCode(re)}function s(re){var k=re.slice(1,-1);return Object.hasOwnProperty.call(t,k)?t[k]:k.charAt(0)==="#"?o(parseInt(k.substr(1).replace("x","0x"))):(i.error("entity not found:"+re),re)}function a(re){if(re>v){var k=r.substring(v,re).replace(/&#?\w+;/g,s);d&&u(v),n.characters(k,0,re-v),v=re}}function u(re,k){for(;re>=f&&(k=h.exec(r));)c=k.index,f=c+k[0].length,d.lineNumber++;d.columnNumber=re-c+1}for(var c=0,f=0,h=/.*(?:\r\n?|\n)|.*$/g,d=n.locator,m=[{currentNSMap:e}],y={},v=0;;){try{var w=r.indexOf("<",v);if(w<0){if(!r.substr(v).match(/^\s*$/)){var b=n.doc,E=b.createTextNode(r.substr(v));b.appendChild(E),n.currentElement=E}return}switch(w>v&&a(w),r.charAt(w+1)){case"/":var ne=r.indexOf(">",w+3),_=r.substring(w+2,ne).replace(/[ \t\n\r]+$/g,""),S=m.pop();ne<0?(_=r.substring(w+2).replace(/[\s<].*/,""),i.error("end tag name: "+_+" is not complete:"+S.tagName),ne=w+1+_.length):_.match(/\s</)&&(_=_.replace(/[\s<].*/,""),i.error("end tag name: "+_+" maybe not complete"),ne=w+1+_.length);var A=S.localNSMap,F=S.tagName==_,I=F||S.tagName&&S.tagName.toLowerCase()==_.toLowerCase();if(I){if(n.endElement(S.uri,S.localName,_),A)for(var q in A)Object.prototype.hasOwnProperty.call(A,q)&&n.endPrefixMapping(q);F||i.fatalError("end tag name: "+_+" is not match the current start tagName:"+S.tagName)}else m.push(S);ne++;break;case"?":d&&u(w),ne=i7(r,w,n);break;case"!":d&&u(w),ne=n7(r,w,n,i);break;default:d&&u(w);var ee=new gk,K=m[m.length-1].currentNSMap,ne=e7(r,w,ee,K,s,i),L=ee.length;if(!ee.closed&&r7(r,ne,ee.tagName,y)&&(ee.closed=!0,t.nbsp||i.warning("unclosed xml attribute")),d&&L){for(var $=fk(d,{}),Y=0;Y<L;Y++){var ie=ee[Y];u(ie.offset),ie.locator=fk(d,{})}n.locator=$,hk(ee,n,K)&&m.push(ee),n.locator=d}else hk(ee,n,K)&&m.push(ee);Eg.isHTML(ee.uri)&&!ee.closed?ne=t7(r,ne,ee.tagName,s,n):ne++}}catch(re){if(re instanceof xh)throw re;i.error("element parse error: "+re),ne=-1}ne>v?v=ne:a(Math.max(w,v)+1)}}function fk(r,e){return e.lineNumber=r.lineNumber,e.columnNumber=r.columnNumber,e}function e7(r,e,t,n,i,o){function s(m,y,v){t.attributeNames.hasOwnProperty(m)&&o.fatalError("Attribute "+m+" redefined"),t.addValue(m,y.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,i),v)}for(var a,u,c=++e,f=bg;;){var h=r.charAt(c);switch(h){case"=":if(f===Dl)a=r.slice(e,c),f=wg;else if(f===Eh)f=wg;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(f===wg||f===Dl)if(f===Dl&&(o.warning('attribute value must after "="'),a=r.slice(e,c)),e=c+1,c=r.indexOf(h,e),c>0)u=r.slice(e,c),s(a,u,e-1),f=Ah;else throw new Error("attribute value no end '"+h+"' match");else if(f==_h)u=r.slice(e,c),s(a,u,e),o.warning('attribute "'+a+'" missed start quot('+h+")!!"),e=c+1,f=Ah;else throw new Error('attribute value must after "="');break;case"/":switch(f){case bg:t.setTagName(r.slice(e,c));case Ah:case vg:case Wb:f=Wb,t.closed=!0;case _h:case Dl:break;case Eh:t.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return o.error("unexpected end of input"),f==bg&&t.setTagName(r.slice(e,c)),c;case">":switch(f){case bg:t.setTagName(r.slice(e,c));case Ah:case vg:case Wb:break;case _h:case Dl:u=r.slice(e,c),u.slice(-1)==="/"&&(t.closed=!0,u=u.slice(0,-1));case Eh:f===Eh&&(u=a),f==_h?(o.warning('attribute "'+u+'" missed quot(")!'),s(a,u,e)):((!Eg.isHTML(n[""])||!u.match(/^(?:disabled|checked|selected)$/i))&&o.warning('attribute "'+u+'" missed value!! "'+u+'" instead!!'),s(u,u,e));break;case wg:throw new Error("attribute value missed!!")}return c;case"\x80":h=" ";default:if(h<=" ")switch(f){case bg:t.setTagName(r.slice(e,c)),f=vg;break;case Dl:a=r.slice(e,c),f=Eh;break;case _h:var u=r.slice(e,c);o.warning('attribute "'+u+'" missed quot(")!!'),s(a,u,e);case Ah:f=vg;break}else switch(f){case Eh:var d=t.tagName;(!Eg.isHTML(n[""])||!a.match(/^(?:disabled|checked|selected)$/i))&&o.warning('attribute "'+a+'" missed value!! "'+a+'" instead2!!'),s(a,a,e),e=c,f=Dl;break;case Ah:o.warning('attribute space is required"'+a+'"!!');case vg:f=Dl,e=c;break;case wg:f=_h,e=c;break;case Wb:throw new Error("elements closed character '/' and '>' must be connected to")}}c++}}function hk(r,e,t){for(var n=r.tagName,i=null,h=r.length;h--;){var o=r[h],s=o.qName,a=o.value,d=s.indexOf(":");if(d>0)var u=o.prefix=s.slice(0,d),c=s.slice(d+1),f=u==="xmlns"&&c;else c=s,u=null,f=s==="xmlns"&&"";o.localName=c,f!==!1&&(i==null&&(i={},pk(t,t={})),t[f]=i[f]=a,o.uri=Eg.XMLNS,e.startPrefixMapping(f,a))}for(var h=r.length;h--;){o=r[h];var u=o.prefix;u&&(u==="xml"&&(o.uri=Eg.XML),u!=="xmlns"&&(o.uri=t[u||""]))}var d=n.indexOf(":");d>0?(u=r.prefix=n.slice(0,d),c=r.localName=n.slice(d+1)):(u=null,c=r.localName=n);var m=r.uri=t[u||""];if(e.startElement(m,c,n,r),r.closed){if(e.endElement(m,c,n),i)for(u in i)Object.prototype.hasOwnProperty.call(i,u)&&e.endPrefixMapping(u)}else return r.currentNSMap=t,r.localNSMap=i,!0}function t7(r,e,t,n,i){if(/^(?:script|textarea)$/i.test(t)){var o=r.indexOf("</"+t+">",e),s=r.substring(e+1,o);if(/[&<]/.test(s))return/^script$/i.test(t)?(i.characters(s,0,s.length),o):(s=s.replace(/&#?\w+;/g,n),i.characters(s,0,s.length),o)}return e+1}function r7(r,e,t,n){var i=n[t];return i==null&&(i=r.lastIndexOf("</"+t+">"),i<e&&(i=r.lastIndexOf("</"+t)),n[t]=i),i<e}function pk(r,e){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])}function n7(r,e,t,n){var i=r.charAt(e+2);switch(i){case"-":if(r.charAt(e+3)==="-"){var o=r.indexOf("-->",e+4);return o>e?(t.comment(r,e+4,o-e-4),o+3):(n.error("Unclosed comment"),-1)}else return-1;default:if(r.substr(e+3,6)=="CDATA["){var o=r.indexOf("]]>",e+9);return t.startCDATA(),t.characters(r,e+9,o-e-9),t.endCDATA(),o+3}var s=s7(r,e),a=s.length;if(a>1&&/!doctype/i.test(s[0][0])){var u=s[1][0],c=!1,f=!1;a>3&&(/^public$/i.test(s[2][0])?(c=s[3][0],f=a>4&&s[4][0]):/^system$/i.test(s[2][0])&&(f=s[3][0]));var h=s[a-1];return t.startDTD(u,c,f),t.endDTD(),h.index+h[0].length}}return-1}function i7(r,e,t){var n=r.indexOf("?>",e);if(n){var i=r.substring(e,n).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(i){var o=i[0].length;return t.processingInstruction(i[1],i[2]),n+2}else return-1}return-1}function gk(){this.attributeNames={}}gk.prototype={setTagName:function(r){if(!ck.test(r))throw new Error("invalid tagName:"+r);this.tagName=r},addValue:function(r,e,t){if(!ck.test(r))throw new Error("invalid attribute:"+r);this.attributeNames[r]=this.length,this[this.length++]={qName:r,value:e,offset:t}},length:0,getLocalName:function(r){return this[r].localName},getLocator:function(r){return this[r].locator},getQName:function(r){return this[r].qName},getURI:function(r){return this[r].uri},getValue:function(r){return this[r].value}};function s7(r,e){var t,n=[],i=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(i.lastIndex=e,i.exec(r);t=i.exec(r);)if(n.push(t),t[1])return n}m_.XMLReader=dk;m_.ParseError=xh});var Ak=mt(Hb=>{Te();Re();Ce();var o7=cg(),a7=p_(),yk=lk(),vk=mk(),l7=a7.DOMImplementation,bk=o7.NAMESPACE,u7=vk.ParseError,c7=vk.XMLReader;function Ek(r){return r.replace(/\r[\n\u0085]/g,`
|
|
81
|
-
`).replace(/[\r\u0085\u2028]/g,`
|
|
82
|
-
`)}function _k(r){this.options=r||{locator:{}}}_k.prototype.parseFromString=function(r,e){var t=this.options,n=new c7,i=t.domBuilder||new _g,o=t.errorHandler,s=t.locator,a=t.xmlns||{},u=/\/x?html?$/.test(e),c=u?yk.HTML_ENTITIES:yk.XML_ENTITIES;s&&i.setDocumentLocator(s),n.errorHandler=f7(o,i,s),n.domBuilder=t.domBuilder||i,u&&(a[""]=bk.HTML),a.xml=a.xml||bk.XML;var f=t.normalizeLineEndings||Ek;return r&&typeof r=="string"?n.parse(f(r),a,c):n.errorHandler.error("invalid doc source"),i.doc};function f7(r,e,t){if(!r){if(e instanceof _g)return e;r=e}var n={},i=r instanceof Function;t=t||{};function o(s){var a=r[s];!a&&i&&(a=r.length==2?function(u){r(s,u)}:r),n[s]=a&&function(u){a("[xmldom "+s+"] "+u+y_(t))}||function(){}}return o("warning"),o("error"),o("fatalError"),n}function _g(){this.cdata=!1}function Sh(r,e){e.lineNumber=r.lineNumber,e.columnNumber=r.columnNumber}_g.prototype={startDocument:function(){this.doc=new l7().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(r,e,t,n){var i=this.doc,o=i.createElementNS(r,t||e),s=n.length;zb(this,o),this.currentElement=o,this.locator&&Sh(this.locator,o);for(var a=0;a<s;a++){var r=n.getURI(a),u=n.getValue(a),t=n.getQName(a),c=i.createAttributeNS(r,t);this.locator&&Sh(n.getLocator(a),c),c.value=c.nodeValue=u,o.setAttributeNode(c)}},endElement:function(r,e,t){var n=this.currentElement,i=n.tagName;this.currentElement=n.parentNode},startPrefixMapping:function(r,e){},endPrefixMapping:function(r){},processingInstruction:function(r,e){var t=this.doc.createProcessingInstruction(r,e);this.locator&&Sh(this.locator,t),zb(this,t)},ignorableWhitespace:function(r,e,t){},characters:function(r,e,t){if(r=wk.apply(this,arguments),r){if(this.cdata)var n=this.doc.createCDATASection(r);else var n=this.doc.createTextNode(r);this.currentElement?this.currentElement.appendChild(n):/^\s*$/.test(r)&&this.doc.appendChild(n),this.locator&&Sh(this.locator,n)}},skippedEntity:function(r){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(r){(this.locator=r)&&(r.lineNumber=0)},comment:function(r,e,t){r=wk.apply(this,arguments);var n=this.doc.createComment(r);this.locator&&Sh(this.locator,n),zb(this,n)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(r,e,t){var n=this.doc.implementation;if(n&&n.createDocumentType){var i=n.createDocumentType(r,e,t);this.locator&&Sh(this.locator,i),zb(this,i),this.doc.doctype=i}},warning:function(r){console.warn("[xmldom warning] "+r,y_(this.locator))},error:function(r){console.error("[xmldom error] "+r,y_(this.locator))},fatalError:function(r){throw new u7(r,this.locator)}};function y_(r){if(r)return`
|
|
83
|
-
@`+(r.systemId||"")+"#[line:"+r.lineNumber+",col:"+r.columnNumber+"]"}function wk(r,e,t){return typeof r=="string"?r.substr(e,t):r.length>=e+t||e?new java.lang.String(r,e,t)+"":r}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(r){_g.prototype[r]=function(){return null}});function zb(r,e){r.currentElement?r.currentElement.appendChild(e):r.doc.appendChild(e)}Hb.__DOMHandler=_g;Hb.normalizeLineEndings=Ek;Hb.DOMParser=_k});var Gb=mt(qb=>{Te();Re();Ce();var xk=p_();qb.DOMImplementation=xk.DOMImplementation;qb.XMLSerializer=xk.XMLSerializer;qb.DOMParser=Ak().DOMParser});var Rk=mt((UZ,w_)=>{Te();Re();Ce();var b_=(function(r){"use strict";var e=Object.prototype,t=e.hasOwnProperty,n=Object.defineProperty||function(k,x,P){k[x]=P.value},i,o=typeof Symbol=="function"?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(k,x,P){return Object.defineProperty(k,x,{value:P,enumerable:!0,configurable:!0,writable:!0}),k[x]}try{c({},"")}catch{c=function(x,P,C){return x[P]=C}}function f(k,x,P,C){var j=x&&x.prototype instanceof b?x:b,U=Object.create(j.prototype),B=new Y(C||[]);return n(U,"_invoke",{value:K(k,P,B)}),U}r.wrap=f;function h(k,x,P){try{return{type:"normal",arg:k.call(x,P)}}catch(C){return{type:"throw",arg:C}}}var d="suspendedStart",m="suspendedYield",y="executing",v="completed",w={};function b(){}function E(){}function _(){}var S={};c(S,s,function(){return this});var A=Object.getPrototypeOf,F=A&&A(A(ie([])));F&&F!==e&&t.call(F,s)&&(S=F);var I=_.prototype=b.prototype=Object.create(S);E.prototype=_,n(I,"constructor",{value:_,configurable:!0}),n(_,"constructor",{value:E,configurable:!0}),E.displayName=c(_,u,"GeneratorFunction");function q(k){["next","throw","return"].forEach(function(x){c(k,x,function(P){return this._invoke(x,P)})})}r.isGeneratorFunction=function(k){var x=typeof k=="function"&&k.constructor;return x?x===E||(x.displayName||x.name)==="GeneratorFunction":!1},r.mark=function(k){return Object.setPrototypeOf?Object.setPrototypeOf(k,_):(k.__proto__=_,c(k,u,"GeneratorFunction")),k.prototype=Object.create(I),k},r.awrap=function(k){return{__await:k}};function ee(k,x){function P(U,B,Q,fe){var Ee=h(k[U],k,B);if(Ee.type==="throw")fe(Ee.arg);else{var te=Ee.arg,H=te.value;return H&&typeof H=="object"&&t.call(H,"__await")?x.resolve(H.__await).then(function(ae){P("next",ae,Q,fe)},function(ae){P("throw",ae,Q,fe)}):x.resolve(H).then(function(ae){te.value=ae,Q(te)},function(ae){return P("throw",ae,Q,fe)})}}var C;function j(U,B){function Q(){return new x(function(fe,Ee){P(U,B,fe,Ee)})}return C=C?C.then(Q,Q):Q()}n(this,"_invoke",{value:j})}q(ee.prototype),c(ee.prototype,a,function(){return this}),r.AsyncIterator=ee,r.async=function(k,x,P,C,j){j===void 0&&(j=Promise);var U=new ee(f(k,x,P,C),j);return r.isGeneratorFunction(x)?U:U.next().then(function(B){return B.done?B.value:U.next()})};function K(k,x,P){var C=d;return function(U,B){if(C===y)throw new Error("Generator is already running");if(C===v){if(U==="throw")throw B;return re()}for(P.method=U,P.arg=B;;){var Q=P.delegate;if(Q){var fe=ne(Q,P);if(fe){if(fe===w)continue;return fe}}if(P.method==="next")P.sent=P._sent=P.arg;else if(P.method==="throw"){if(C===d)throw C=v,P.arg;P.dispatchException(P.arg)}else P.method==="return"&&P.abrupt("return",P.arg);C=y;var Ee=h(k,x,P);if(Ee.type==="normal"){if(C=P.done?v:m,Ee.arg===w)continue;return{value:Ee.arg,done:P.done}}else Ee.type==="throw"&&(C=v,P.method="throw",P.arg=Ee.arg)}}}function ne(k,x){var P=x.method,C=k.iterator[P];if(C===i)return x.delegate=null,P==="throw"&&k.iterator.return&&(x.method="return",x.arg=i,ne(k,x),x.method==="throw")||P!=="return"&&(x.method="throw",x.arg=new TypeError("The iterator does not provide a '"+P+"' method")),w;var j=h(C,k.iterator,x.arg);if(j.type==="throw")return x.method="throw",x.arg=j.arg,x.delegate=null,w;var U=j.arg;if(!U)return x.method="throw",x.arg=new TypeError("iterator result is not an object"),x.delegate=null,w;if(U.done)x[k.resultName]=U.value,x.next=k.nextLoc,x.method!=="return"&&(x.method="next",x.arg=i);else return U;return x.delegate=null,w}q(I),c(I,u,"Generator"),c(I,s,function(){return this}),c(I,"toString",function(){return"[object Generator]"});function L(k){var x={tryLoc:k[0]};1 in k&&(x.catchLoc=k[1]),2 in k&&(x.finallyLoc=k[2],x.afterLoc=k[3]),this.tryEntries.push(x)}function $(k){var x=k.completion||{};x.type="normal",delete x.arg,k.completion=x}function Y(k){this.tryEntries=[{tryLoc:"root"}],k.forEach(L,this),this.reset(!0)}r.keys=function(k){var x=Object(k),P=[];for(var C in x)P.push(C);return P.reverse(),function j(){for(;P.length;){var U=P.pop();if(U in x)return j.value=U,j.done=!1,j}return j.done=!0,j}};function ie(k){if(k){var x=k[s];if(x)return x.call(k);if(typeof k.next=="function")return k;if(!isNaN(k.length)){var P=-1,C=function j(){for(;++P<k.length;)if(t.call(k,P))return j.value=k[P],j.done=!1,j;return j.value=i,j.done=!0,j};return C.next=C}}return{next:re}}r.values=ie;function re(){return{value:i,done:!0}}return Y.prototype={constructor:Y,reset:function(k){if(this.prev=0,this.next=0,this.sent=this._sent=i,this.done=!1,this.delegate=null,this.method="next",this.arg=i,this.tryEntries.forEach($),!k)for(var x in this)x.charAt(0)==="t"&&t.call(this,x)&&!isNaN(+x.slice(1))&&(this[x]=i)},stop:function(){this.done=!0;var k=this.tryEntries[0],x=k.completion;if(x.type==="throw")throw x.arg;return this.rval},dispatchException:function(k){if(this.done)throw k;var x=this;function P(fe,Ee){return U.type="throw",U.arg=k,x.next=fe,Ee&&(x.method="next",x.arg=i),!!Ee}for(var C=this.tryEntries.length-1;C>=0;--C){var j=this.tryEntries[C],U=j.completion;if(j.tryLoc==="root")return P("end");if(j.tryLoc<=this.prev){var B=t.call(j,"catchLoc"),Q=t.call(j,"finallyLoc");if(B&&Q){if(this.prev<j.catchLoc)return P(j.catchLoc,!0);if(this.prev<j.finallyLoc)return P(j.finallyLoc)}else if(B){if(this.prev<j.catchLoc)return P(j.catchLoc,!0)}else if(Q){if(this.prev<j.finallyLoc)return P(j.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(k,x){for(var P=this.tryEntries.length-1;P>=0;--P){var C=this.tryEntries[P];if(C.tryLoc<=this.prev&&t.call(C,"finallyLoc")&&this.prev<C.finallyLoc){var j=C;break}}j&&(k==="break"||k==="continue")&&j.tryLoc<=x&&x<=j.finallyLoc&&(j=null);var U=j?j.completion:{};return U.type=k,U.arg=x,j?(this.method="next",this.next=j.finallyLoc,w):this.complete(U)},complete:function(k,x){if(k.type==="throw")throw k.arg;return k.type==="break"||k.type==="continue"?this.next=k.arg:k.type==="return"?(this.rval=this.arg=k.arg,this.method="return",this.next="end"):k.type==="normal"&&x&&(this.next=x),w},finish:function(k){for(var x=this.tryEntries.length-1;x>=0;--x){var P=this.tryEntries[x];if(P.finallyLoc===k)return this.complete(P.completion,P.afterLoc),$(P),w}},catch:function(k){for(var x=this.tryEntries.length-1;x>=0;--x){var P=this.tryEntries[x];if(P.tryLoc===k){var C=P.completion;if(C.type==="throw"){var j=C.arg;$(P)}return j}}throw new Error("illegal catch attempt")},delegateYield:function(k,x,P){return this.delegate={iterator:ie(k),resultName:x,nextLoc:P},this.method==="next"&&(this.arg=i),w}},r})(typeof w_=="object"?w_.exports:{});try{regeneratorRuntime=b_}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=b_:Function("r","regeneratorRuntime = r")(b_)}});var Vb=mt((zZ,Dk)=>{"use strict";Te();Re();Ce();Dk.exports=(r,e)=>`${r}-${e}-${Math.random().toString(16).slice(3,8)}`});var v_=mt((VZ,Nk)=>{"use strict";Te();Re();Ce();var y7=Vb(),Ik=0;Nk.exports=({id:r,action:e,payload:t={}})=>{let n=r;return typeof n>"u"&&(n=y7("Job",Ik),Ik+=1),{id:n,action:e,payload:t}}});var Yb=mt(xg=>{"use strict";Te();Re();Ce();var E_=!1;xg.logging=E_;xg.setLogging=r=>{E_=r};xg.log=(...r)=>E_?console.log.apply(xg,r):null});var Pk=mt((kk,Lk)=>{"use strict";Te();Re();Ce();var b7=v_(),{log:Xb}=Yb(),w7=Vb(),Ok=0;Lk.exports=()=>{let r=w7("Scheduler",Ok),e={},t={},n=[];Ok+=1;let i=()=>n.length,o=()=>Object.keys(e).length,s=()=>{if(n.length!==0){let h=Object.keys(e);for(let d=0;d<h.length;d+=1)if(typeof t[h[d]]>"u"){n[0](e[h[d]]);break}}},a=(h,d)=>new Promise((m,y)=>{let v=b7({action:h,payload:d});n.push(async w=>{n.shift(),t[w.id]=v;try{m(await w[h].apply(kk,[...d,v.id]))}catch(b){y(b)}finally{delete t[w.id],s()}}),Xb(`[${r}]: Add ${v.id} to JobQueue`),Xb(`[${r}]: JobQueue length=${n.length}`),s()});return{addWorker:h=>(e[h.id]=h,Xb(`[${r}]: Add ${h.id}`),Xb(`[${r}]: Number of workers=${o()}`),s(),h.id),addJob:async(h,...d)=>{if(o()===0)throw Error(`[${r}]: You need to have at least one worker before adding jobs`);return a(h,d)},terminate:async()=>{Object.keys(e).forEach(async h=>{await e[h].terminate()}),n=[]},getQueueLen:i,getNumWorkers:o}}});var Bk=mt((iJ,Mk)=>{"use strict";Te();Re();Ce();Mk.exports=r=>{let e={};return typeof WorkerGlobalScope<"u"?e.type="webworker":typeof document=="object"?e.type="browser":typeof We=="object"&&typeof Uu=="function"&&(e.type="node"),typeof r>"u"?e:e[r]}});var Uk=mt((uJ,Fk)=>{"use strict";Te();Re();Ce();var v7=Bk()("type")==="browser",E7=v7?r=>new URL(r,window.location.href).href:r=>r;Fk.exports=r=>{let e={...r};return["corePath","workerPath","langPath"].forEach(t=>{r[t]&&(e[t]=E7(e[t]))}),e}});var __=mt((dJ,jk)=>{"use strict";Te();Re();Ce();jk.exports={TESSERACT_ONLY:0,LSTM_ONLY:1,TESSERACT_LSTM_COMBINED:2,DEFAULT:3}});var $k=mt((yJ,_7)=>{_7.exports={name:"tesseract.js",version:"7.0.0",description:"Pure Javascript Multilingual OCR",main:"src/index.js",type:"commonjs",types:"src/index.d.ts",unpkg:"dist/tesseract.min.js",jsdelivr:"dist/tesseract.min.js",scripts:{start:"node scripts/server.js",build:"rimraf dist && webpack --config scripts/webpack.config.prod.js && rollup -c scripts/rollup.esm.mjs","profile:tesseract":"webpack-bundle-analyzer dist/tesseract-stats.json","profile:worker":"webpack-bundle-analyzer dist/worker-stats.json",prepublishOnly:"npm run build",wait:"rimraf dist && wait-on http://localhost:3000/dist/tesseract.min.js",test:"npm-run-all -p -r start test:all","test:all":"npm-run-all wait test:browser test:node:all","test:browser":"karma start karma.conf.js","test:node":"nyc mocha --exit --bail --require ./scripts/test-helper.mjs","test:node:all":"npm run test:node -- ./tests/*.test.mjs",lint:"eslint src","lint:fix":"eslint --fix src",postinstall:"opencollective-postinstall || true"},browser:{"./src/worker/node/index.js":"./src/worker/browser/index.js"},author:"",contributors:["jeromewu"],license:"Apache-2.0",devDependencies:{"@babel/core":"^7.21.4","@babel/eslint-parser":"^7.21.3","@babel/preset-env":"^7.21.4","@rollup/plugin-commonjs":"^24.1.0",acorn:"^8.8.2","babel-loader":"^9.1.2",buffer:"^6.0.3",cors:"^2.8.5",eslint:"^7.32.0","eslint-config-airbnb-base":"^14.2.1","eslint-plugin-import":"^2.27.5","expect.js":"^0.3.1",express:"^4.18.2",mocha:"^10.2.0","npm-run-all":"^4.1.5",karma:"^6.4.2","karma-chrome-launcher":"^3.2.0","karma-firefox-launcher":"^2.1.2","karma-mocha":"^2.0.1","karma-webpack":"^5.0.0",nyc:"^15.1.0",rimraf:"^5.0.0",rollup:"^3.20.7","wait-on":"^7.0.1",webpack:"^5.79.0","webpack-bundle-analyzer":"^4.8.0","webpack-cli":"^5.0.1","webpack-dev-middleware":"^6.0.2","rollup-plugin-sourcemaps":"^0.6.3"},dependencies:{"bmp-js":"^0.1.0","idb-keyval":"^6.2.0","is-url":"^1.2.4","node-fetch":"^2.6.9","opencollective-postinstall":"^2.0.3","regenerator-runtime":"^0.13.3","tesseract.js-core":"^7.0.0","wasm-feature-detect":"^1.8.0",zlibjs:"^0.3.1"},overrides:{"@rollup/pluginutils":"^5.0.2"},repository:{type:"git",url:"https://github.com/naptha/tesseract.js.git"},bugs:{url:"https://github.com/naptha/tesseract.js/issues"},homepage:"https://github.com/naptha/tesseract.js",collective:{type:"opencollective",url:"https://opencollective.com/tesseractjs"}}});var zk=mt((bJ,Wk)=>{"use strict";Te();Re();Ce();Wk.exports={workerBlobURL:!0,logger:()=>{}}});var qk=mt((_J,Hk)=>{"use strict";Te();Re();Ce();var A7=$k().version,x7=zk();Hk.exports={...x7,workerPath:`https://cdn.jsdelivr.net/npm/tesseract.js@v${A7}/dist/worker.min.js`}});var Vk=mt((TJ,Gk)=>{"use strict";Te();Re();Ce();Gk.exports=({workerPath:r,workerBlobURL:e})=>{let t;if(Blob&&URL&&e){let n=new Blob([`importScripts("${r}");`],{type:"application/javascript"});t=new Worker(URL.createObjectURL(n))}else t=new Worker(r);return t}});var Xk=mt((IJ,Yk)=>{"use strict";Te();Re();Ce();Yk.exports=r=>{r.terminate()}});var Zk=mt((LJ,Kk)=>{"use strict";Te();Re();Ce();Kk.exports=(r,e)=>{r.onmessage=({data:t})=>{e(t)}}});var Qk=mt((FJ,Jk)=>{"use strict";Te();Re();Ce();Jk.exports=async(r,e)=>{r.postMessage(e)}});var tL=mt((WJ,eL)=>{"use strict";Te();Re();Ce();var A_=r=>new Promise((e,t)=>{let n=new FileReader;n.onload=()=>{e(n.result)},n.onerror=({target:{error:{code:i}}})=>{t(Error(`File could not be read! Code=${i}`))},n.readAsArrayBuffer(r)}),x_=async r=>{let e=r;if(typeof r>"u")return"undefined";if(typeof r=="string")/data:image\/([a-zA-Z]*);base64,([^"]*)/.test(r)?e=atob(r.split(",")[1]).split("").map(t=>t.charCodeAt(0)):e=await(await fetch(r)).arrayBuffer();else if(typeof HTMLElement<"u"&&r instanceof HTMLElement)r.tagName==="IMG"&&(e=await x_(r.src)),r.tagName==="VIDEO"&&(e=await x_(r.poster)),r.tagName==="CANVAS"&&await new Promise(t=>{r.toBlob(async n=>{e=await A_(n),t()})});else if(typeof OffscreenCanvas<"u"&&r instanceof OffscreenCanvas){let t=await r.convertToBlob();e=await A_(t)}else(r instanceof File||r instanceof Blob)&&(e=await A_(r));return new Uint8Array(e)};eL.exports=x_});var nL=mt((GJ,rL)=>{"use strict";Te();Re();Ce();var S7=qk(),T7=Vk(),C7=Xk(),R7=Zk(),D7=Qk(),I7=tL();rL.exports={defaultOptions:S7,spawnWorker:T7,terminateWorker:C7,onMessage:R7,send:D7,loadImage:I7}});var S_=mt((KJ,aL)=>{"use strict";Te();Re();Ce();var N7=Uk(),bo=v_(),{log:iL}=Yb(),O7=Vb(),cc=__(),{defaultOptions:k7,spawnWorker:L7,terminateWorker:P7,onMessage:M7,loadImage:sL,send:B7}=nL(),oL=0;aL.exports=async(r="eng",e=cc.LSTM_ONLY,t={},n={})=>{let i=O7("Worker",oL),{logger:o,errorHandler:s,...a}=N7({...k7,...t}),u={},c=typeof r=="string"?r.split("+"):r,f=e,h=n,d=[cc.DEFAULT,cc.LSTM_ONLY].includes(e)&&!a.legacyCore,m,y,v=new Promise((k,x)=>{y=k,m=x}),w=k=>{m(k.message)},b=L7(a);b.onerror=w,oL+=1;let E=({id:k,action:x,payload:P})=>new Promise((C,j)=>{iL(`[${i}]: Start ${k}, action=${x}`);let U=`${x}-${k}`;u[U]={resolve:C,reject:j},B7(b,{workerId:i,jobId:k,action:x,payload:P})}),_=()=>console.warn("`load` is depreciated and should be removed from code (workers now come pre-loaded)"),S=k=>E(bo({id:k,action:"load",payload:{options:{lstmOnly:d,corePath:a.corePath,logging:a.logging}}})),A=(k,x,P)=>E(bo({id:P,action:"FS",payload:{method:"writeFile",args:[k,x]}})),F=(k,x)=>E(bo({id:x,action:"FS",payload:{method:"readFile",args:[k,{encoding:"utf8"}]}})),I=(k,x)=>E(bo({id:x,action:"FS",payload:{method:"unlink",args:[k]}})),q=(k,x,P)=>E(bo({id:P,action:"FS",payload:{method:k,args:x}})),ee=(k,x)=>E(bo({id:x,action:"loadLanguage",payload:{langs:k,options:{langPath:a.langPath,dataPath:a.dataPath,cachePath:a.cachePath,cacheMethod:a.cacheMethod,gzip:a.gzip,lstmOnly:[cc.DEFAULT,cc.LSTM_ONLY].includes(f)&&!a.legacyLang}}})),K=(k,x,P,C)=>E(bo({id:C,action:"initialize",payload:{langs:k,oem:x,config:P}})),ne=(k="eng",x,P,C)=>{if(d&&[cc.TESSERACT_ONLY,cc.TESSERACT_LSTM_COMBINED].includes(x))throw Error("Legacy model requested but code missing.");let j=x||f;f=j;let U=P||h;h=U;let Q=(typeof k=="string"?k.split("+"):k).filter(fe=>!c.includes(fe));return c.push(...Q),Q.length>0?ee(Q,C).then(()=>K(k,j,U,C)):K(k,j,U,C)},L=(k={},x)=>E(bo({id:x,action:"setParameters",payload:{params:k}})),$=async(k,x={},P={text:!0},C)=>E(bo({id:C,action:"recognize",payload:{image:await sL(k),options:x,output:P}})),Y=async(k,x)=>{if(d)throw Error("`worker.detect` requires Legacy model, which was not loaded.");return E(bo({id:x,action:"detect",payload:{image:await sL(k)}}))},ie=async()=>(b!==null&&(P7(b),b=null),Promise.resolve());M7(b,({workerId:k,jobId:x,status:P,action:C,data:j})=>{let U=`${C}-${x}`;if(P==="resolve")iL(`[${k}]: Complete ${x}`),u[U].resolve({jobId:x,data:j}),delete u[U];else if(P==="reject")if(u[U].reject(j),delete u[U],C==="load"&&m(j),s)s(j);else throw Error(j);else P==="progress"&&o({...j,userJobId:x})});let re={id:i,worker:b,load:_,writeText:A,readText:F,removeFile:I,FS:q,reinitialize:ne,setParameters:L,recognize:$,detect:Y,terminate:ie};return S().then(()=>ee(r)).then(()=>K(r,e,n)).then(()=>y(re)).catch(()=>{}),v}});var cL=mt((eQ,uL)=>{"use strict";Te();Re();Ce();var lL=S_(),F7=async(r,e,t)=>{let n=await lL(e,1,t);return n.recognize(r).finally(async()=>{await n.terminate()})},U7=async(r,e)=>{let t=await lL("osd",0,e);return t.detect(r).finally(async()=>{await t.terminate()})};uL.exports={recognize:F7,detect:U7}});var hL=mt((iQ,fL)=>{"use strict";Te();Re();Ce();fL.exports={AFR:"afr",AMH:"amh",ARA:"ara",ASM:"asm",AZE:"aze",AZE_CYRL:"aze_cyrl",BEL:"bel",BEN:"ben",BOD:"bod",BOS:"bos",BUL:"bul",CAT:"cat",CEB:"ceb",CES:"ces",CHI_SIM:"chi_sim",CHI_TRA:"chi_tra",CHR:"chr",CYM:"cym",DAN:"dan",DEU:"deu",DZO:"dzo",ELL:"ell",ENG:"eng",ENM:"enm",EPO:"epo",EST:"est",EUS:"eus",FAS:"fas",FIN:"fin",FRA:"fra",FRK:"frk",FRM:"frm",GLE:"gle",GLG:"glg",GRC:"grc",GUJ:"guj",HAT:"hat",HEB:"heb",HIN:"hin",HRV:"hrv",HUN:"hun",IKU:"iku",IND:"ind",ISL:"isl",ITA:"ita",ITA_OLD:"ita_old",JAV:"jav",JPN:"jpn",KAN:"kan",KAT:"kat",KAT_OLD:"kat_old",KAZ:"kaz",KHM:"khm",KIR:"kir",KOR:"kor",KUR:"kur",LAO:"lao",LAT:"lat",LAV:"lav",LIT:"lit",MAL:"mal",MAR:"mar",MKD:"mkd",MLT:"mlt",MSA:"msa",MYA:"mya",NEP:"nep",NLD:"nld",NOR:"nor",ORI:"ori",PAN:"pan",POL:"pol",POR:"por",PUS:"pus",RON:"ron",RUS:"rus",SAN:"san",SIN:"sin",SLK:"slk",SLV:"slv",SPA:"spa",SPA_OLD:"spa_old",SQI:"sqi",SRP:"srp",SRP_LATN:"srp_latn",SWA:"swa",SWE:"swe",SYR:"syr",TAM:"tam",TEL:"tel",TGK:"tgk",TGL:"tgl",THA:"tha",TIR:"tir",TUR:"tur",UIG:"uig",UKR:"ukr",URD:"urd",UZB:"uzb",UZB_CYRL:"uzb_cyrl",VIE:"vie",YID:"yid"}});var pL=mt((lQ,dL)=>{"use strict";Te();Re();Ce();dL.exports={OSD_ONLY:"0",AUTO_OSD:"1",AUTO_ONLY:"2",AUTO:"3",SINGLE_COLUMN:"4",SINGLE_BLOCK_VERT_TEXT:"5",SINGLE_BLOCK:"6",SINGLE_LINE:"7",SINGLE_WORD:"8",CIRCLE_WORD:"9",SINGLE_CHAR:"10",SPARSE_TEXT:"11",SPARSE_TEXT_OSD:"12",RAW_LINE:"13"}});var mL=mt((hQ,gL)=>{"use strict";Te();Re();Ce();Rk();var j7=Pk(),$7=S_(),W7=cL(),z7=hL(),H7=__(),q7=pL(),{setLogging:G7}=Yb();gL.exports={languages:z7,OEM:H7,PSM:q7,createScheduler:j7,createWorker:$7,setLogging:G7,...W7}});var kL={};uo(kL,{Deflate:()=>nW,DeflateRaw:()=>iW,Gunzip:()=>sW,Gzip:()=>oW,Inflate:()=>aW,InflateRaw:()=>lW,Unzip:()=>uW,Z_BEST_COMPRESSION:()=>cW,Z_BEST_SPEED:()=>fW,Z_BINARY:()=>hW,Z_BLOCK:()=>dW,Z_BUF_ERROR:()=>pW,Z_DATA_ERROR:()=>gW,Z_DEFAULT_CHUNK:()=>mW,Z_DEFAULT_COMPRESSION:()=>yW,Z_DEFAULT_LEVEL:()=>bW,Z_DEFAULT_MEMLEVEL:()=>wW,Z_DEFAULT_STRATEGY:()=>vW,Z_DEFAULT_WINDOWBITS:()=>EW,Z_DEFLATED:()=>_W,Z_ERRNO:()=>AW,Z_FILTERED:()=>xW,Z_FINISH:()=>SW,Z_FIXED:()=>TW,Z_FULL_FLUSH:()=>CW,Z_HUFFMAN_ONLY:()=>RW,Z_MAX_CHUNK:()=>DW,Z_MAX_LEVEL:()=>IW,Z_MAX_MEMLEVEL:()=>NW,Z_MAX_WINDOWBITS:()=>OW,Z_MIN_CHUNK:()=>kW,Z_MIN_LEVEL:()=>LW,Z_MIN_MEMLEVEL:()=>PW,Z_MIN_WINDOWBITS:()=>MW,Z_NEED_DICT:()=>BW,Z_NO_COMPRESSION:()=>FW,Z_NO_FLUSH:()=>UW,Z_OK:()=>jW,Z_PARTIAL_FLUSH:()=>$W,Z_RLE:()=>WW,Z_STREAM_END:()=>zW,Z_STREAM_ERROR:()=>HW,Z_SYNC_FLUSH:()=>qW,Z_TEXT:()=>GW,Z_TREES:()=>VW,Z_UNKNOWN:()=>YW,Zlib:()=>XW,codes:()=>KW,createDeflate:()=>ZW,createDeflateRaw:()=>JW,createGunzip:()=>QW,createGzip:()=>ez,createInflate:()=>tz,createInflateRaw:()=>rz,createUnzip:()=>nz,default:()=>Je,deflate:()=>iz,deflateRaw:()=>sz,deflateRawSync:()=>oz,deflateSync:()=>az,gunzip:()=>lz,gunzipSync:()=>uz,gzip:()=>cz,gzipSync:()=>fz,inflate:()=>hz,inflateRaw:()=>dz,inflateRawSync:()=>pz,inflateSync:()=>gz,unzip:()=>mz,unzipSync:()=>yz});function V7(){if(bL)return T_;bL=!0;function r(){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}return T_=r,T_}function Kb(){if(wL)return jn;wL=!0;var r=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function e(i,o){return Object.prototype.hasOwnProperty.call(i,o)}jn.assign=function(i){for(var o=Array.prototype.slice.call(arguments,1);o.length;){var s=o.shift();if(s){if(typeof s!="object")throw new TypeError(s+"must be non-object");for(var a in s)e(s,a)&&(i[a]=s[a])}}return i},jn.shrinkBuf=function(i,o){return i.length===o?i:i.subarray?i.subarray(0,o):(i.length=o,i)};var t={arraySet:function(i,o,s,a,u){if(o.subarray&&i.subarray){i.set(o.subarray(s,s+a),u);return}for(var c=0;c<a;c++)i[u+c]=o[s+c]},flattenChunks:function(i){var o,s,a,u,c,f;for(a=0,o=0,s=i.length;o<s;o++)a+=i[o].length;for(f=new Uint8Array(a),u=0,o=0,s=i.length;o<s;o++)c=i[o],f.set(c,u),u+=c.length;return f}},n={arraySet:function(i,o,s,a,u){for(var c=0;c<a;c++)i[u+c]=o[s+c]},flattenChunks:function(i){return[].concat.apply([],i)}};return jn.setTyped=function(i){i?(jn.Buf8=Uint8Array,jn.Buf16=Uint16Array,jn.Buf32=Int32Array,jn.assign(jn,t)):(jn.Buf8=Array,jn.Buf16=Array,jn.Buf32=Array,jn.assign(jn,n))},jn.setTyped(r),jn}function Y7(){if(vL)return fc;vL=!0;var r=Kb(),e=4,t=0,n=1,i=2;function o(D){for(var le=D.length;--le>=0;)D[le]=0}var s=0,a=1,u=2,c=3,f=258,h=29,d=256,m=d+1+h,y=30,v=19,w=2*m+1,b=15,E=16,_=7,S=256,A=16,F=17,I=18,q=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],ee=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],K=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],ne=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],L=512,$=new Array((m+2)*2);o($);var Y=new Array(y*2);o(Y);var ie=new Array(L);o(ie);var re=new Array(f-c+1);o(re);var k=new Array(h);o(k);var x=new Array(y);o(x);function P(D,le,he,_e,ve){this.static_tree=D,this.extra_bits=le,this.extra_base=he,this.elems=_e,this.max_length=ve,this.has_stree=D&&D.length}var C,j,U;function B(D,le){this.dyn_tree=D,this.max_code=0,this.stat_desc=le}function Q(D){return D<256?ie[D]:ie[256+(D>>>7)]}function fe(D,le){D.pending_buf[D.pending++]=le&255,D.pending_buf[D.pending++]=le>>>8&255}function Ee(D,le,he){D.bi_valid>E-he?(D.bi_buf|=le<<D.bi_valid&65535,fe(D,D.bi_buf),D.bi_buf=le>>E-D.bi_valid,D.bi_valid+=he-E):(D.bi_buf|=le<<D.bi_valid&65535,D.bi_valid+=he)}function te(D,le,he){Ee(D,he[le*2],he[le*2+1])}function H(D,le){var he=0;do he|=D&1,D>>>=1,he<<=1;while(--le>0);return he>>>1}function ae(D){D.bi_valid===16?(fe(D,D.bi_buf),D.bi_buf=0,D.bi_valid=0):D.bi_valid>=8&&(D.pending_buf[D.pending++]=D.bi_buf&255,D.bi_buf>>=8,D.bi_valid-=8)}function we(D,le){var he=le.dyn_tree,_e=le.max_code,ve=le.stat_desc.static_tree,Ie=le.stat_desc.has_stree,Z=le.stat_desc.extra_bits,Me=le.stat_desc.extra_base,nt=le.stat_desc.max_length,N,Pe,je,de,De,Be,ft=0;for(de=0;de<=b;de++)D.bl_count[de]=0;for(he[D.heap[D.heap_max]*2+1]=0,N=D.heap_max+1;N<w;N++)Pe=D.heap[N],de=he[he[Pe*2+1]*2+1]+1,de>nt&&(de=nt,ft++),he[Pe*2+1]=de,!(Pe>_e)&&(D.bl_count[de]++,De=0,Pe>=Me&&(De=Z[Pe-Me]),Be=he[Pe*2],D.opt_len+=Be*(de+De),Ie&&(D.static_len+=Be*(ve[Pe*2+1]+De)));if(ft!==0){do{for(de=nt-1;D.bl_count[de]===0;)de--;D.bl_count[de]--,D.bl_count[de+1]+=2,D.bl_count[nt]--,ft-=2}while(ft>0);for(de=nt;de!==0;de--)for(Pe=D.bl_count[de];Pe!==0;)je=D.heap[--N],!(je>_e)&&(he[je*2+1]!==de&&(D.opt_len+=(de-he[je*2+1])*he[je*2],he[je*2+1]=de),Pe--)}}function xe(D,le,he){var _e=new Array(b+1),ve=0,Ie,Z;for(Ie=1;Ie<=b;Ie++)_e[Ie]=ve=ve+he[Ie-1]<<1;for(Z=0;Z<=le;Z++){var Me=D[Z*2+1];Me!==0&&(D[Z*2]=H(_e[Me]++,Me))}}function V(){var D,le,he,_e,ve,Ie=new Array(b+1);for(he=0,_e=0;_e<h-1;_e++)for(k[_e]=he,D=0;D<1<<q[_e];D++)re[he++]=_e;for(re[he-1]=_e,ve=0,_e=0;_e<16;_e++)for(x[_e]=ve,D=0;D<1<<ee[_e];D++)ie[ve++]=_e;for(ve>>=7;_e<y;_e++)for(x[_e]=ve<<7,D=0;D<1<<ee[_e]-7;D++)ie[256+ve++]=_e;for(le=0;le<=b;le++)Ie[le]=0;for(D=0;D<=143;)$[D*2+1]=8,D++,Ie[8]++;for(;D<=255;)$[D*2+1]=9,D++,Ie[9]++;for(;D<=279;)$[D*2+1]=7,D++,Ie[7]++;for(;D<=287;)$[D*2+1]=8,D++,Ie[8]++;for(xe($,m+1,Ie),D=0;D<y;D++)Y[D*2+1]=5,Y[D*2]=H(D,5);C=new P($,q,d+1,m,b),j=new P(Y,ee,0,y,b),U=new P(new Array(0),K,0,v,_)}function M(D){var le;for(le=0;le<m;le++)D.dyn_ltree[le*2]=0;for(le=0;le<y;le++)D.dyn_dtree[le*2]=0;for(le=0;le<v;le++)D.bl_tree[le*2]=0;D.dyn_ltree[S*2]=1,D.opt_len=D.static_len=0,D.last_lit=D.matches=0}function oe(D){D.bi_valid>8?fe(D,D.bi_buf):D.bi_valid>0&&(D.pending_buf[D.pending++]=D.bi_buf),D.bi_buf=0,D.bi_valid=0}function ge(D,le,he,_e){oe(D),fe(D,he),fe(D,~he),r.arraySet(D.pending_buf,D.window,le,he,D.pending),D.pending+=he}function Se(D,le,he,_e){var ve=le*2,Ie=he*2;return D[ve]<D[Ie]||D[ve]===D[Ie]&&_e[le]<=_e[he]}function be(D,le,he){for(var _e=D.heap[he],ve=he<<1;ve<=D.heap_len&&(ve<D.heap_len&&Se(le,D.heap[ve+1],D.heap[ve],D.depth)&&ve++,!Se(le,_e,D.heap[ve],D.depth));)D.heap[he]=D.heap[ve],he=ve,ve<<=1;D.heap[he]=_e}function pe(D,le,he){var _e,ve,Ie=0,Z,Me;if(D.last_lit!==0)do _e=D.pending_buf[D.d_buf+Ie*2]<<8|D.pending_buf[D.d_buf+Ie*2+1],ve=D.pending_buf[D.l_buf+Ie],Ie++,_e===0?te(D,ve,le):(Z=re[ve],te(D,Z+d+1,le),Me=q[Z],Me!==0&&(ve-=k[Z],Ee(D,ve,Me)),_e--,Z=Q(_e),te(D,Z,he),Me=ee[Z],Me!==0&&(_e-=x[Z],Ee(D,_e,Me)));while(Ie<D.last_lit);te(D,S,le)}function Ae(D,le){var he=le.dyn_tree,_e=le.stat_desc.static_tree,ve=le.stat_desc.has_stree,Ie=le.stat_desc.elems,Z,Me,nt=-1,N;for(D.heap_len=0,D.heap_max=w,Z=0;Z<Ie;Z++)he[Z*2]!==0?(D.heap[++D.heap_len]=nt=Z,D.depth[Z]=0):he[Z*2+1]=0;for(;D.heap_len<2;)N=D.heap[++D.heap_len]=nt<2?++nt:0,he[N*2]=1,D.depth[N]=0,D.opt_len--,ve&&(D.static_len-=_e[N*2+1]);for(le.max_code=nt,Z=D.heap_len>>1;Z>=1;Z--)be(D,he,Z);N=Ie;do Z=D.heap[1],D.heap[1]=D.heap[D.heap_len--],be(D,he,1),Me=D.heap[1],D.heap[--D.heap_max]=Z,D.heap[--D.heap_max]=Me,he[N*2]=he[Z*2]+he[Me*2],D.depth[N]=(D.depth[Z]>=D.depth[Me]?D.depth[Z]:D.depth[Me])+1,he[Z*2+1]=he[Me*2+1]=N,D.heap[1]=N++,be(D,he,1);while(D.heap_len>=2);D.heap[--D.heap_max]=D.heap[1],we(D,le),xe(he,nt,D.bl_count)}function $e(D,le,he){var _e,ve=-1,Ie,Z=le[1],Me=0,nt=7,N=4;for(Z===0&&(nt=138,N=3),le[(he+1)*2+1]=65535,_e=0;_e<=he;_e++)Ie=Z,Z=le[(_e+1)*2+1],!(++Me<nt&&Ie===Z)&&(Me<N?D.bl_tree[Ie*2]+=Me:Ie!==0?(Ie!==ve&&D.bl_tree[Ie*2]++,D.bl_tree[A*2]++):Me<=10?D.bl_tree[F*2]++:D.bl_tree[I*2]++,Me=0,ve=Ie,Z===0?(nt=138,N=3):Ie===Z?(nt=6,N=3):(nt=7,N=4))}function ke(D,le,he){var _e,ve=-1,Ie,Z=le[1],Me=0,nt=7,N=4;for(Z===0&&(nt=138,N=3),_e=0;_e<=he;_e++)if(Ie=Z,Z=le[(_e+1)*2+1],!(++Me<nt&&Ie===Z)){if(Me<N)do te(D,Ie,D.bl_tree);while(--Me!==0);else Ie!==0?(Ie!==ve&&(te(D,Ie,D.bl_tree),Me--),te(D,A,D.bl_tree),Ee(D,Me-3,2)):Me<=10?(te(D,F,D.bl_tree),Ee(D,Me-3,3)):(te(D,I,D.bl_tree),Ee(D,Me-11,7));Me=0,ve=Ie,Z===0?(nt=138,N=3):Ie===Z?(nt=6,N=3):(nt=7,N=4)}}function Ne(D){var le;for($e(D,D.dyn_ltree,D.l_desc.max_code),$e(D,D.dyn_dtree,D.d_desc.max_code),Ae(D,D.bl_desc),le=v-1;le>=3&&D.bl_tree[ne[le]*2+1]===0;le--);return D.opt_len+=3*(le+1)+5+5+4,le}function Ze(D,le,he,_e){var ve;for(Ee(D,le-257,5),Ee(D,he-1,5),Ee(D,_e-4,4),ve=0;ve<_e;ve++)Ee(D,D.bl_tree[ne[ve]*2+1],3);ke(D,D.dyn_ltree,le-1),ke(D,D.dyn_dtree,he-1)}function tt(D){var le=4093624447,he;for(he=0;he<=31;he++,le>>>=1)if(le&1&&D.dyn_ltree[he*2]!==0)return t;if(D.dyn_ltree[18]!==0||D.dyn_ltree[20]!==0||D.dyn_ltree[26]!==0)return n;for(he=32;he<d;he++)if(D.dyn_ltree[he*2]!==0)return n;return t}var it=!1;function T(D){it||(V(),it=!0),D.l_desc=new B(D.dyn_ltree,C),D.d_desc=new B(D.dyn_dtree,j),D.bl_desc=new B(D.bl_tree,U),D.bi_buf=0,D.bi_valid=0,M(D)}function g(D,le,he,_e){Ee(D,(s<<1)+(_e?1:0),3),ge(D,le,he)}function p(D){Ee(D,a<<1,3),te(D,S,$),ae(D)}function R(D,le,he,_e){var ve,Ie,Z=0;D.level>0?(D.strm.data_type===i&&(D.strm.data_type=tt(D)),Ae(D,D.l_desc),Ae(D,D.d_desc),Z=Ne(D),ve=D.opt_len+3+7>>>3,Ie=D.static_len+3+7>>>3,Ie<=ve&&(ve=Ie)):ve=Ie=he+5,he+4<=ve&&le!==-1?g(D,le,he,_e):D.strategy===e||Ie===ve?(Ee(D,(a<<1)+(_e?1:0),3),pe(D,$,Y)):(Ee(D,(u<<1)+(_e?1:0),3),Ze(D,D.l_desc.max_code+1,D.d_desc.max_code+1,Z+1),pe(D,D.dyn_ltree,D.dyn_dtree)),M(D),_e&&oe(D)}function J(D,le,he){return D.pending_buf[D.d_buf+D.last_lit*2]=le>>>8&255,D.pending_buf[D.d_buf+D.last_lit*2+1]=le&255,D.pending_buf[D.l_buf+D.last_lit]=he&255,D.last_lit++,le===0?D.dyn_ltree[he*2]++:(D.matches++,le--,D.dyn_ltree[(re[he]+d+1)*2]++,D.dyn_dtree[Q(le)*2]++),D.last_lit===D.lit_bufsize-1}return fc._tr_init=T,fc._tr_stored_block=g,fc._tr_flush_block=R,fc._tr_tally=J,fc._tr_align=p,fc}function NL(){if(EL)return C_;EL=!0;function r(e,t,n,i){for(var o=e&65535|0,s=e>>>16&65535|0,a=0;n!==0;){a=n>2e3?2e3:n,n-=a;do o=o+t[i++]|0,s=s+o|0;while(--a);o%=65521,s%=65521}return o|s<<16|0}return C_=r,C_}function OL(){if(_L)return R_;_L=!0;function r(){for(var n,i=[],o=0;o<256;o++){n=o;for(var s=0;s<8;s++)n=n&1?3988292384^n>>>1:n>>>1;i[o]=n}return i}var e=r();function t(n,i,o,s){var a=e,u=s+o;n^=-1;for(var c=s;c<u;c++)n=n>>>8^a[(n^i[c])&255];return n^-1}return R_=t,R_}function X7(){return AL||(AL=!0,D_={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"}),D_}function K7(){if(xL)return $s;xL=!0;var r=Kb(),e=Y7(),t=NL(),n=OL(),i=X7(),o=0,s=1,a=3,u=4,c=5,f=0,h=1,d=-2,m=-3,y=-5,v=-1,w=1,b=2,E=3,_=4,S=0,A=2,F=8,I=9,q=15,ee=8,K=29,ne=256,L=ne+1+K,$=30,Y=19,ie=2*L+1,re=15,k=3,x=258,P=x+k+1,C=32,j=42,U=69,B=73,Q=91,fe=103,Ee=113,te=666,H=1,ae=2,we=3,xe=4,V=3;function M(N,Pe){return N.msg=i[Pe],Pe}function oe(N){return(N<<1)-(N>4?9:0)}function ge(N){for(var Pe=N.length;--Pe>=0;)N[Pe]=0}function Se(N){var Pe=N.state,je=Pe.pending;je>N.avail_out&&(je=N.avail_out),je!==0&&(r.arraySet(N.output,Pe.pending_buf,Pe.pending_out,je,N.next_out),N.next_out+=je,Pe.pending_out+=je,N.total_out+=je,N.avail_out-=je,Pe.pending-=je,Pe.pending===0&&(Pe.pending_out=0))}function be(N,Pe){e._tr_flush_block(N,N.block_start>=0?N.block_start:-1,N.strstart-N.block_start,Pe),N.block_start=N.strstart,Se(N.strm)}function pe(N,Pe){N.pending_buf[N.pending++]=Pe}function Ae(N,Pe){N.pending_buf[N.pending++]=Pe>>>8&255,N.pending_buf[N.pending++]=Pe&255}function $e(N,Pe,je,de){var De=N.avail_in;return De>de&&(De=de),De===0?0:(N.avail_in-=De,r.arraySet(Pe,N.input,N.next_in,De,je),N.state.wrap===1?N.adler=t(N.adler,Pe,De,je):N.state.wrap===2&&(N.adler=n(N.adler,Pe,De,je)),N.next_in+=De,N.total_in+=De,De)}function ke(N,Pe){var je=N.max_chain_length,de=N.strstart,De,Be,ft=N.prev_length,ue=N.nice_match,me=N.strstart>N.w_size-P?N.strstart-(N.w_size-P):0,Ge=N.window,Ue=N.w_mask,et=N.prev,pt=N.strstart+x,It=Ge[de+ft-1],xt=Ge[de+ft];N.prev_length>=N.good_match&&(je>>=2),ue>N.lookahead&&(ue=N.lookahead);do if(De=Pe,!(Ge[De+ft]!==xt||Ge[De+ft-1]!==It||Ge[De]!==Ge[de]||Ge[++De]!==Ge[de+1])){de+=2,De++;do;while(Ge[++de]===Ge[++De]&&Ge[++de]===Ge[++De]&&Ge[++de]===Ge[++De]&&Ge[++de]===Ge[++De]&&Ge[++de]===Ge[++De]&&Ge[++de]===Ge[++De]&&Ge[++de]===Ge[++De]&&Ge[++de]===Ge[++De]&&de<pt);if(Be=x-(pt-de),de=pt-x,Be>ft){if(N.match_start=Pe,ft=Be,Be>=ue)break;It=Ge[de+ft-1],xt=Ge[de+ft]}}while((Pe=et[Pe&Ue])>me&&--je!==0);return ft<=N.lookahead?ft:N.lookahead}function Ne(N){var Pe=N.w_size,je,de,De,Be,ft;do{if(Be=N.window_size-N.lookahead-N.strstart,N.strstart>=Pe+(Pe-P)){r.arraySet(N.window,N.window,Pe,Pe,0),N.match_start-=Pe,N.strstart-=Pe,N.block_start-=Pe,de=N.hash_size,je=de;do De=N.head[--je],N.head[je]=De>=Pe?De-Pe:0;while(--de);de=Pe,je=de;do De=N.prev[--je],N.prev[je]=De>=Pe?De-Pe:0;while(--de);Be+=Pe}if(N.strm.avail_in===0)break;if(de=$e(N.strm,N.window,N.strstart+N.lookahead,Be),N.lookahead+=de,N.lookahead+N.insert>=k)for(ft=N.strstart-N.insert,N.ins_h=N.window[ft],N.ins_h=(N.ins_h<<N.hash_shift^N.window[ft+1])&N.hash_mask;N.insert&&(N.ins_h=(N.ins_h<<N.hash_shift^N.window[ft+k-1])&N.hash_mask,N.prev[ft&N.w_mask]=N.head[N.ins_h],N.head[N.ins_h]=ft,ft++,N.insert--,!(N.lookahead+N.insert<k)););}while(N.lookahead<P&&N.strm.avail_in!==0)}function Ze(N,Pe){var je=65535;for(je>N.pending_buf_size-5&&(je=N.pending_buf_size-5);;){if(N.lookahead<=1){if(Ne(N),N.lookahead===0&&Pe===o)return H;if(N.lookahead===0)break}N.strstart+=N.lookahead,N.lookahead=0;var de=N.block_start+je;if((N.strstart===0||N.strstart>=de)&&(N.lookahead=N.strstart-de,N.strstart=de,be(N,!1),N.strm.avail_out===0)||N.strstart-N.block_start>=N.w_size-P&&(be(N,!1),N.strm.avail_out===0))return H}return N.insert=0,Pe===u?(be(N,!0),N.strm.avail_out===0?we:xe):(N.strstart>N.block_start&&(be(N,!1),N.strm.avail_out===0),H)}function tt(N,Pe){for(var je,de;;){if(N.lookahead<P){if(Ne(N),N.lookahead<P&&Pe===o)return H;if(N.lookahead===0)break}if(je=0,N.lookahead>=k&&(N.ins_h=(N.ins_h<<N.hash_shift^N.window[N.strstart+k-1])&N.hash_mask,je=N.prev[N.strstart&N.w_mask]=N.head[N.ins_h],N.head[N.ins_h]=N.strstart),je!==0&&N.strstart-je<=N.w_size-P&&(N.match_length=ke(N,je)),N.match_length>=k)if(de=e._tr_tally(N,N.strstart-N.match_start,N.match_length-k),N.lookahead-=N.match_length,N.match_length<=N.max_lazy_match&&N.lookahead>=k){N.match_length--;do N.strstart++,N.ins_h=(N.ins_h<<N.hash_shift^N.window[N.strstart+k-1])&N.hash_mask,je=N.prev[N.strstart&N.w_mask]=N.head[N.ins_h],N.head[N.ins_h]=N.strstart;while(--N.match_length!==0);N.strstart++}else N.strstart+=N.match_length,N.match_length=0,N.ins_h=N.window[N.strstart],N.ins_h=(N.ins_h<<N.hash_shift^N.window[N.strstart+1])&N.hash_mask;else de=e._tr_tally(N,0,N.window[N.strstart]),N.lookahead--,N.strstart++;if(de&&(be(N,!1),N.strm.avail_out===0))return H}return N.insert=N.strstart<k-1?N.strstart:k-1,Pe===u?(be(N,!0),N.strm.avail_out===0?we:xe):N.last_lit&&(be(N,!1),N.strm.avail_out===0)?H:ae}function it(N,Pe){for(var je,de,De;;){if(N.lookahead<P){if(Ne(N),N.lookahead<P&&Pe===o)return H;if(N.lookahead===0)break}if(je=0,N.lookahead>=k&&(N.ins_h=(N.ins_h<<N.hash_shift^N.window[N.strstart+k-1])&N.hash_mask,je=N.prev[N.strstart&N.w_mask]=N.head[N.ins_h],N.head[N.ins_h]=N.strstart),N.prev_length=N.match_length,N.prev_match=N.match_start,N.match_length=k-1,je!==0&&N.prev_length<N.max_lazy_match&&N.strstart-je<=N.w_size-P&&(N.match_length=ke(N,je),N.match_length<=5&&(N.strategy===w||N.match_length===k&&N.strstart-N.match_start>4096)&&(N.match_length=k-1)),N.prev_length>=k&&N.match_length<=N.prev_length){De=N.strstart+N.lookahead-k,de=e._tr_tally(N,N.strstart-1-N.prev_match,N.prev_length-k),N.lookahead-=N.prev_length-1,N.prev_length-=2;do++N.strstart<=De&&(N.ins_h=(N.ins_h<<N.hash_shift^N.window[N.strstart+k-1])&N.hash_mask,je=N.prev[N.strstart&N.w_mask]=N.head[N.ins_h],N.head[N.ins_h]=N.strstart);while(--N.prev_length!==0);if(N.match_available=0,N.match_length=k-1,N.strstart++,de&&(be(N,!1),N.strm.avail_out===0))return H}else if(N.match_available){if(de=e._tr_tally(N,0,N.window[N.strstart-1]),de&&be(N,!1),N.strstart++,N.lookahead--,N.strm.avail_out===0)return H}else N.match_available=1,N.strstart++,N.lookahead--}return N.match_available&&(de=e._tr_tally(N,0,N.window[N.strstart-1]),N.match_available=0),N.insert=N.strstart<k-1?N.strstart:k-1,Pe===u?(be(N,!0),N.strm.avail_out===0?we:xe):N.last_lit&&(be(N,!1),N.strm.avail_out===0)?H:ae}function T(N,Pe){for(var je,de,De,Be,ft=N.window;;){if(N.lookahead<=x){if(Ne(N),N.lookahead<=x&&Pe===o)return H;if(N.lookahead===0)break}if(N.match_length=0,N.lookahead>=k&&N.strstart>0&&(De=N.strstart-1,de=ft[De],de===ft[++De]&&de===ft[++De]&&de===ft[++De])){Be=N.strstart+x;do;while(de===ft[++De]&&de===ft[++De]&&de===ft[++De]&&de===ft[++De]&&de===ft[++De]&&de===ft[++De]&&de===ft[++De]&&de===ft[++De]&&De<Be);N.match_length=x-(Be-De),N.match_length>N.lookahead&&(N.match_length=N.lookahead)}if(N.match_length>=k?(je=e._tr_tally(N,1,N.match_length-k),N.lookahead-=N.match_length,N.strstart+=N.match_length,N.match_length=0):(je=e._tr_tally(N,0,N.window[N.strstart]),N.lookahead--,N.strstart++),je&&(be(N,!1),N.strm.avail_out===0))return H}return N.insert=0,Pe===u?(be(N,!0),N.strm.avail_out===0?we:xe):N.last_lit&&(be(N,!1),N.strm.avail_out===0)?H:ae}function g(N,Pe){for(var je;;){if(N.lookahead===0&&(Ne(N),N.lookahead===0)){if(Pe===o)return H;break}if(N.match_length=0,je=e._tr_tally(N,0,N.window[N.strstart]),N.lookahead--,N.strstart++,je&&(be(N,!1),N.strm.avail_out===0))return H}return N.insert=0,Pe===u?(be(N,!0),N.strm.avail_out===0?we:xe):N.last_lit&&(be(N,!1),N.strm.avail_out===0)?H:ae}function p(N,Pe,je,de,De){this.good_length=N,this.max_lazy=Pe,this.nice_length=je,this.max_chain=de,this.func=De}var R;R=[new p(0,0,0,0,Ze),new p(4,4,8,4,tt),new p(4,5,16,8,tt),new p(4,6,32,32,tt),new p(4,4,16,16,it),new p(8,16,32,32,it),new p(8,16,128,128,it),new p(8,32,128,256,it),new p(32,128,258,1024,it),new p(32,258,258,4096,it)];function J(N){N.window_size=2*N.w_size,ge(N.head),N.max_lazy_match=R[N.level].max_lazy,N.good_match=R[N.level].good_length,N.nice_match=R[N.level].nice_length,N.max_chain_length=R[N.level].max_chain,N.strstart=0,N.block_start=0,N.lookahead=0,N.insert=0,N.match_length=N.prev_length=k-1,N.match_available=0,N.ins_h=0}function D(){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=F,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 r.Buf16(ie*2),this.dyn_dtree=new r.Buf16((2*$+1)*2),this.bl_tree=new r.Buf16((2*Y+1)*2),ge(this.dyn_ltree),ge(this.dyn_dtree),ge(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new r.Buf16(re+1),this.heap=new r.Buf16(2*L+1),ge(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new r.Buf16(2*L+1),ge(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 le(N){var Pe;return!N||!N.state?M(N,d):(N.total_in=N.total_out=0,N.data_type=A,Pe=N.state,Pe.pending=0,Pe.pending_out=0,Pe.wrap<0&&(Pe.wrap=-Pe.wrap),Pe.status=Pe.wrap?j:Ee,N.adler=Pe.wrap===2?0:1,Pe.last_flush=o,e._tr_init(Pe),f)}function he(N){var Pe=le(N);return Pe===f&&J(N.state),Pe}function _e(N,Pe){return!N||!N.state||N.state.wrap!==2?d:(N.state.gzhead=Pe,f)}function ve(N,Pe,je,de,De,Be){if(!N)return d;var ft=1;if(Pe===v&&(Pe=6),de<0?(ft=0,de=-de):de>15&&(ft=2,de-=16),De<1||De>I||je!==F||de<8||de>15||Pe<0||Pe>9||Be<0||Be>_)return M(N,d);de===8&&(de=9);var ue=new D;return N.state=ue,ue.strm=N,ue.wrap=ft,ue.gzhead=null,ue.w_bits=de,ue.w_size=1<<ue.w_bits,ue.w_mask=ue.w_size-1,ue.hash_bits=De+7,ue.hash_size=1<<ue.hash_bits,ue.hash_mask=ue.hash_size-1,ue.hash_shift=~~((ue.hash_bits+k-1)/k),ue.window=new r.Buf8(ue.w_size*2),ue.head=new r.Buf16(ue.hash_size),ue.prev=new r.Buf16(ue.w_size),ue.lit_bufsize=1<<De+6,ue.pending_buf_size=ue.lit_bufsize*4,ue.pending_buf=new r.Buf8(ue.pending_buf_size),ue.d_buf=1*ue.lit_bufsize,ue.l_buf=3*ue.lit_bufsize,ue.level=Pe,ue.strategy=Be,ue.method=je,he(N)}function Ie(N,Pe){return ve(N,Pe,F,q,ee,S)}function Z(N,Pe){var je,de,De,Be;if(!N||!N.state||Pe>c||Pe<0)return N?M(N,d):d;if(de=N.state,!N.output||!N.input&&N.avail_in!==0||de.status===te&&Pe!==u)return M(N,N.avail_out===0?y:d);if(de.strm=N,je=de.last_flush,de.last_flush=Pe,de.status===j)if(de.wrap===2)N.adler=0,pe(de,31),pe(de,139),pe(de,8),de.gzhead?(pe(de,(de.gzhead.text?1:0)+(de.gzhead.hcrc?2:0)+(de.gzhead.extra?4:0)+(de.gzhead.name?8:0)+(de.gzhead.comment?16:0)),pe(de,de.gzhead.time&255),pe(de,de.gzhead.time>>8&255),pe(de,de.gzhead.time>>16&255),pe(de,de.gzhead.time>>24&255),pe(de,de.level===9?2:de.strategy>=b||de.level<2?4:0),pe(de,de.gzhead.os&255),de.gzhead.extra&&de.gzhead.extra.length&&(pe(de,de.gzhead.extra.length&255),pe(de,de.gzhead.extra.length>>8&255)),de.gzhead.hcrc&&(N.adler=n(N.adler,de.pending_buf,de.pending,0)),de.gzindex=0,de.status=U):(pe(de,0),pe(de,0),pe(de,0),pe(de,0),pe(de,0),pe(de,de.level===9?2:de.strategy>=b||de.level<2?4:0),pe(de,V),de.status=Ee);else{var ft=F+(de.w_bits-8<<4)<<8,ue=-1;de.strategy>=b||de.level<2?ue=0:de.level<6?ue=1:de.level===6?ue=2:ue=3,ft|=ue<<6,de.strstart!==0&&(ft|=C),ft+=31-ft%31,de.status=Ee,Ae(de,ft),de.strstart!==0&&(Ae(de,N.adler>>>16),Ae(de,N.adler&65535)),N.adler=1}if(de.status===U)if(de.gzhead.extra){for(De=de.pending;de.gzindex<(de.gzhead.extra.length&65535)&&!(de.pending===de.pending_buf_size&&(de.gzhead.hcrc&&de.pending>De&&(N.adler=n(N.adler,de.pending_buf,de.pending-De,De)),Se(N),De=de.pending,de.pending===de.pending_buf_size));)pe(de,de.gzhead.extra[de.gzindex]&255),de.gzindex++;de.gzhead.hcrc&&de.pending>De&&(N.adler=n(N.adler,de.pending_buf,de.pending-De,De)),de.gzindex===de.gzhead.extra.length&&(de.gzindex=0,de.status=B)}else de.status=B;if(de.status===B)if(de.gzhead.name){De=de.pending;do{if(de.pending===de.pending_buf_size&&(de.gzhead.hcrc&&de.pending>De&&(N.adler=n(N.adler,de.pending_buf,de.pending-De,De)),Se(N),De=de.pending,de.pending===de.pending_buf_size)){Be=1;break}de.gzindex<de.gzhead.name.length?Be=de.gzhead.name.charCodeAt(de.gzindex++)&255:Be=0,pe(de,Be)}while(Be!==0);de.gzhead.hcrc&&de.pending>De&&(N.adler=n(N.adler,de.pending_buf,de.pending-De,De)),Be===0&&(de.gzindex=0,de.status=Q)}else de.status=Q;if(de.status===Q)if(de.gzhead.comment){De=de.pending;do{if(de.pending===de.pending_buf_size&&(de.gzhead.hcrc&&de.pending>De&&(N.adler=n(N.adler,de.pending_buf,de.pending-De,De)),Se(N),De=de.pending,de.pending===de.pending_buf_size)){Be=1;break}de.gzindex<de.gzhead.comment.length?Be=de.gzhead.comment.charCodeAt(de.gzindex++)&255:Be=0,pe(de,Be)}while(Be!==0);de.gzhead.hcrc&&de.pending>De&&(N.adler=n(N.adler,de.pending_buf,de.pending-De,De)),Be===0&&(de.status=fe)}else de.status=fe;if(de.status===fe&&(de.gzhead.hcrc?(de.pending+2>de.pending_buf_size&&Se(N),de.pending+2<=de.pending_buf_size&&(pe(de,N.adler&255),pe(de,N.adler>>8&255),N.adler=0,de.status=Ee)):de.status=Ee),de.pending!==0){if(Se(N),N.avail_out===0)return de.last_flush=-1,f}else if(N.avail_in===0&&oe(Pe)<=oe(je)&&Pe!==u)return M(N,y);if(de.status===te&&N.avail_in!==0)return M(N,y);if(N.avail_in!==0||de.lookahead!==0||Pe!==o&&de.status!==te){var me=de.strategy===b?g(de,Pe):de.strategy===E?T(de,Pe):R[de.level].func(de,Pe);if((me===we||me===xe)&&(de.status=te),me===H||me===we)return N.avail_out===0&&(de.last_flush=-1),f;if(me===ae&&(Pe===s?e._tr_align(de):Pe!==c&&(e._tr_stored_block(de,0,0,!1),Pe===a&&(ge(de.head),de.lookahead===0&&(de.strstart=0,de.block_start=0,de.insert=0))),Se(N),N.avail_out===0))return de.last_flush=-1,f}return Pe!==u?f:de.wrap<=0?h:(de.wrap===2?(pe(de,N.adler&255),pe(de,N.adler>>8&255),pe(de,N.adler>>16&255),pe(de,N.adler>>24&255),pe(de,N.total_in&255),pe(de,N.total_in>>8&255),pe(de,N.total_in>>16&255),pe(de,N.total_in>>24&255)):(Ae(de,N.adler>>>16),Ae(de,N.adler&65535)),Se(N),de.wrap>0&&(de.wrap=-de.wrap),de.pending!==0?f:h)}function Me(N){var Pe;return!N||!N.state?d:(Pe=N.state.status,Pe!==j&&Pe!==U&&Pe!==B&&Pe!==Q&&Pe!==fe&&Pe!==Ee&&Pe!==te?M(N,d):(N.state=null,Pe===Ee?M(N,m):f))}function nt(N,Pe){var je=Pe.length,de,De,Be,ft,ue,me,Ge,Ue;if(!N||!N.state||(de=N.state,ft=de.wrap,ft===2||ft===1&&de.status!==j||de.lookahead))return d;for(ft===1&&(N.adler=t(N.adler,Pe,je,0)),de.wrap=0,je>=de.w_size&&(ft===0&&(ge(de.head),de.strstart=0,de.block_start=0,de.insert=0),Ue=new r.Buf8(de.w_size),r.arraySet(Ue,Pe,je-de.w_size,de.w_size,0),Pe=Ue,je=de.w_size),ue=N.avail_in,me=N.next_in,Ge=N.input,N.avail_in=je,N.next_in=0,N.input=Pe,Ne(de);de.lookahead>=k;){De=de.strstart,Be=de.lookahead-(k-1);do de.ins_h=(de.ins_h<<de.hash_shift^de.window[De+k-1])&de.hash_mask,de.prev[De&de.w_mask]=de.head[de.ins_h],de.head[de.ins_h]=De,De++;while(--Be);de.strstart=De,de.lookahead=k-1,Ne(de)}return de.strstart+=de.lookahead,de.block_start=de.strstart,de.insert=de.lookahead,de.lookahead=0,de.match_length=de.prev_length=k-1,de.match_available=0,N.next_in=me,N.input=Ge,N.avail_in=ue,de.wrap=ft,f}return $s.deflateInit=Ie,$s.deflateInit2=ve,$s.deflateReset=he,$s.deflateResetKeep=le,$s.deflateSetHeader=_e,$s.deflate=Z,$s.deflateEnd=Me,$s.deflateSetDictionary=nt,$s.deflateInfo="pako deflate (from Nodeca project)",$s}function Z7(){if(SL)return I_;SL=!0;var r=30,e=12;return I_=function(n,i){var o,s,a,u,c,f,h,d,m,y,v,w,b,E,_,S,A,F,I,q,ee,K,ne,L,$;o=n.state,s=n.next_in,L=n.input,a=s+(n.avail_in-5),u=n.next_out,$=n.output,c=u-(i-n.avail_out),f=u+(n.avail_out-257),h=o.dmax,d=o.wsize,m=o.whave,y=o.wnext,v=o.window,w=o.hold,b=o.bits,E=o.lencode,_=o.distcode,S=(1<<o.lenbits)-1,A=(1<<o.distbits)-1;e:do{b<15&&(w+=L[s++]<<b,b+=8,w+=L[s++]<<b,b+=8),F=E[w&S];t:for(;;){if(I=F>>>24,w>>>=I,b-=I,I=F>>>16&255,I===0)$[u++]=F&65535;else if(I&16){q=F&65535,I&=15,I&&(b<I&&(w+=L[s++]<<b,b+=8),q+=w&(1<<I)-1,w>>>=I,b-=I),b<15&&(w+=L[s++]<<b,b+=8,w+=L[s++]<<b,b+=8),F=_[w&A];r:for(;;){if(I=F>>>24,w>>>=I,b-=I,I=F>>>16&255,I&16){if(ee=F&65535,I&=15,b<I&&(w+=L[s++]<<b,b+=8,b<I&&(w+=L[s++]<<b,b+=8)),ee+=w&(1<<I)-1,ee>h){n.msg="invalid distance too far back",o.mode=r;break e}if(w>>>=I,b-=I,I=u-c,ee>I){if(I=ee-I,I>m&&o.sane){n.msg="invalid distance too far back",o.mode=r;break e}if(K=0,ne=v,y===0){if(K+=d-I,I<q){q-=I;do $[u++]=v[K++];while(--I);K=u-ee,ne=$}}else if(y<I){if(K+=d+y-I,I-=y,I<q){q-=I;do $[u++]=v[K++];while(--I);if(K=0,y<q){I=y,q-=I;do $[u++]=v[K++];while(--I);K=u-ee,ne=$}}}else if(K+=y-I,I<q){q-=I;do $[u++]=v[K++];while(--I);K=u-ee,ne=$}for(;q>2;)$[u++]=ne[K++],$[u++]=ne[K++],$[u++]=ne[K++],q-=3;q&&($[u++]=ne[K++],q>1&&($[u++]=ne[K++]))}else{K=u-ee;do $[u++]=$[K++],$[u++]=$[K++],$[u++]=$[K++],q-=3;while(q>2);q&&($[u++]=$[K++],q>1&&($[u++]=$[K++]))}}else if((I&64)===0){F=_[(F&65535)+(w&(1<<I)-1)];continue r}else{n.msg="invalid distance code",o.mode=r;break e}break}}else if((I&64)===0){F=E[(F&65535)+(w&(1<<I)-1)];continue t}else if(I&32){o.mode=e;break e}else{n.msg="invalid literal/length code",o.mode=r;break e}break}}while(s<a&&u<f);q=b>>3,s-=q,b-=q<<3,w&=(1<<b)-1,n.next_in=s,n.next_out=u,n.avail_in=s<a?5+(a-s):5-(s-a),n.avail_out=u<f?257+(f-u):257-(u-f),o.hold=w,o.bits=b},I_}function J7(){if(TL)return N_;TL=!0;var r=Kb(),e=15,t=852,n=592,i=0,o=1,s=2,a=[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],u=[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],c=[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],f=[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];return N_=function(d,m,y,v,w,b,E,_){var S=_.bits,A=0,F=0,I=0,q=0,ee=0,K=0,ne=0,L=0,$=0,Y=0,ie,re,k,x,P,C=null,j=0,U,B=new r.Buf16(e+1),Q=new r.Buf16(e+1),fe=null,Ee=0,te,H,ae;for(A=0;A<=e;A++)B[A]=0;for(F=0;F<v;F++)B[m[y+F]]++;for(ee=S,q=e;q>=1&&B[q]===0;q--);if(ee>q&&(ee=q),q===0)return w[b++]=1<<24|64<<16|0,w[b++]=1<<24|64<<16|0,_.bits=1,0;for(I=1;I<q&&B[I]===0;I++);for(ee<I&&(ee=I),L=1,A=1;A<=e;A++)if(L<<=1,L-=B[A],L<0)return-1;if(L>0&&(d===i||q!==1))return-1;for(Q[1]=0,A=1;A<e;A++)Q[A+1]=Q[A]+B[A];for(F=0;F<v;F++)m[y+F]!==0&&(E[Q[m[y+F]]++]=F);if(d===i?(C=fe=E,U=19):d===o?(C=a,j-=257,fe=u,Ee-=257,U=256):(C=c,fe=f,U=-1),Y=0,F=0,A=I,P=b,K=ee,ne=0,k=-1,$=1<<ee,x=$-1,d===o&&$>t||d===s&&$>n)return 1;for(;;){te=A-ne,E[F]<U?(H=0,ae=E[F]):E[F]>U?(H=fe[Ee+E[F]],ae=C[j+E[F]]):(H=96,ae=0),ie=1<<A-ne,re=1<<K,I=re;do re-=ie,w[P+(Y>>ne)+re]=te<<24|H<<16|ae|0;while(re!==0);for(ie=1<<A-1;Y&ie;)ie>>=1;if(ie!==0?(Y&=ie-1,Y+=ie):Y=0,F++,--B[A]===0){if(A===q)break;A=m[y+E[F]]}if(A>ee&&(Y&x)!==k){for(ne===0&&(ne=ee),P+=I,K=A-ne,L=1<<K;K+ne<q&&(L-=B[K+ne],!(L<=0));)K++,L<<=1;if($+=1<<K,d===o&&$>t||d===s&&$>n)return 1;k=Y&x,w[k]=ee<<24|K<<16|P-b|0}}return Y!==0&&(w[P+Y]=A-ne<<24|64<<16|0),_.bits=ee,0},N_}function Q7(){if(CL)return ds;CL=!0;var r=Kb(),e=NL(),t=OL(),n=Z7(),i=J7(),o=0,s=1,a=2,u=4,c=5,f=6,h=0,d=1,m=2,y=-2,v=-3,w=-4,b=-5,E=8,_=1,S=2,A=3,F=4,I=5,q=6,ee=7,K=8,ne=9,L=10,$=11,Y=12,ie=13,re=14,k=15,x=16,P=17,C=18,j=19,U=20,B=21,Q=22,fe=23,Ee=24,te=25,H=26,ae=27,we=28,xe=29,V=30,M=31,oe=32,ge=852,Se=592,be=15,pe=be;function Ae(ve){return(ve>>>24&255)+(ve>>>8&65280)+((ve&65280)<<8)+((ve&255)<<24)}function $e(){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 r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function ke(ve){var Ie;return!ve||!ve.state?y:(Ie=ve.state,ve.total_in=ve.total_out=Ie.total=0,ve.msg="",Ie.wrap&&(ve.adler=Ie.wrap&1),Ie.mode=_,Ie.last=0,Ie.havedict=0,Ie.dmax=32768,Ie.head=null,Ie.hold=0,Ie.bits=0,Ie.lencode=Ie.lendyn=new r.Buf32(ge),Ie.distcode=Ie.distdyn=new r.Buf32(Se),Ie.sane=1,Ie.back=-1,h)}function Ne(ve){var Ie;return!ve||!ve.state?y:(Ie=ve.state,Ie.wsize=0,Ie.whave=0,Ie.wnext=0,ke(ve))}function Ze(ve,Ie){var Z,Me;return!ve||!ve.state||(Me=ve.state,Ie<0?(Z=0,Ie=-Ie):(Z=(Ie>>4)+1,Ie<48&&(Ie&=15)),Ie&&(Ie<8||Ie>15))?y:(Me.window!==null&&Me.wbits!==Ie&&(Me.window=null),Me.wrap=Z,Me.wbits=Ie,Ne(ve))}function tt(ve,Ie){var Z,Me;return ve?(Me=new $e,ve.state=Me,Me.window=null,Z=Ze(ve,Ie),Z!==h&&(ve.state=null),Z):y}function it(ve){return tt(ve,pe)}var T=!0,g,p;function R(ve){if(T){var Ie;for(g=new r.Buf32(512),p=new r.Buf32(32),Ie=0;Ie<144;)ve.lens[Ie++]=8;for(;Ie<256;)ve.lens[Ie++]=9;for(;Ie<280;)ve.lens[Ie++]=7;for(;Ie<288;)ve.lens[Ie++]=8;for(i(s,ve.lens,0,288,g,0,ve.work,{bits:9}),Ie=0;Ie<32;)ve.lens[Ie++]=5;i(a,ve.lens,0,32,p,0,ve.work,{bits:5}),T=!1}ve.lencode=g,ve.lenbits=9,ve.distcode=p,ve.distbits=5}function J(ve,Ie,Z,Me){var nt,N=ve.state;return N.window===null&&(N.wsize=1<<N.wbits,N.wnext=0,N.whave=0,N.window=new r.Buf8(N.wsize)),Me>=N.wsize?(r.arraySet(N.window,Ie,Z-N.wsize,N.wsize,0),N.wnext=0,N.whave=N.wsize):(nt=N.wsize-N.wnext,nt>Me&&(nt=Me),r.arraySet(N.window,Ie,Z-Me,nt,N.wnext),Me-=nt,Me?(r.arraySet(N.window,Ie,Z-Me,Me,0),N.wnext=Me,N.whave=N.wsize):(N.wnext+=nt,N.wnext===N.wsize&&(N.wnext=0),N.whave<N.wsize&&(N.whave+=nt))),0}function D(ve,Ie){var Z,Me,nt,N,Pe,je,de,De,Be,ft,ue,me,Ge,Ue,et=0,pt,It,xt,fr,Ri,Yn,Yt,Or,wr=new r.Buf8(4),Ht,Zt,tn=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!ve||!ve.state||!ve.output||!ve.input&&ve.avail_in!==0)return y;Z=ve.state,Z.mode===Y&&(Z.mode=ie),Pe=ve.next_out,nt=ve.output,de=ve.avail_out,N=ve.next_in,Me=ve.input,je=ve.avail_in,De=Z.hold,Be=Z.bits,ft=je,ue=de,Or=h;e:for(;;)switch(Z.mode){case _:if(Z.wrap===0){Z.mode=ie;break}for(;Be<16;){if(je===0)break e;je--,De+=Me[N++]<<Be,Be+=8}if(Z.wrap&2&&De===35615){Z.check=0,wr[0]=De&255,wr[1]=De>>>8&255,Z.check=t(Z.check,wr,2,0),De=0,Be=0,Z.mode=S;break}if(Z.flags=0,Z.head&&(Z.head.done=!1),!(Z.wrap&1)||(((De&255)<<8)+(De>>8))%31){ve.msg="incorrect header check",Z.mode=V;break}if((De&15)!==E){ve.msg="unknown compression method",Z.mode=V;break}if(De>>>=4,Be-=4,Yt=(De&15)+8,Z.wbits===0)Z.wbits=Yt;else if(Yt>Z.wbits){ve.msg="invalid window size",Z.mode=V;break}Z.dmax=1<<Yt,ve.adler=Z.check=1,Z.mode=De&512?L:Y,De=0,Be=0;break;case S:for(;Be<16;){if(je===0)break e;je--,De+=Me[N++]<<Be,Be+=8}if(Z.flags=De,(Z.flags&255)!==E){ve.msg="unknown compression method",Z.mode=V;break}if(Z.flags&57344){ve.msg="unknown header flags set",Z.mode=V;break}Z.head&&(Z.head.text=De>>8&1),Z.flags&512&&(wr[0]=De&255,wr[1]=De>>>8&255,Z.check=t(Z.check,wr,2,0)),De=0,Be=0,Z.mode=A;case A:for(;Be<32;){if(je===0)break e;je--,De+=Me[N++]<<Be,Be+=8}Z.head&&(Z.head.time=De),Z.flags&512&&(wr[0]=De&255,wr[1]=De>>>8&255,wr[2]=De>>>16&255,wr[3]=De>>>24&255,Z.check=t(Z.check,wr,4,0)),De=0,Be=0,Z.mode=F;case F:for(;Be<16;){if(je===0)break e;je--,De+=Me[N++]<<Be,Be+=8}Z.head&&(Z.head.xflags=De&255,Z.head.os=De>>8),Z.flags&512&&(wr[0]=De&255,wr[1]=De>>>8&255,Z.check=t(Z.check,wr,2,0)),De=0,Be=0,Z.mode=I;case I:if(Z.flags&1024){for(;Be<16;){if(je===0)break e;je--,De+=Me[N++]<<Be,Be+=8}Z.length=De,Z.head&&(Z.head.extra_len=De),Z.flags&512&&(wr[0]=De&255,wr[1]=De>>>8&255,Z.check=t(Z.check,wr,2,0)),De=0,Be=0}else Z.head&&(Z.head.extra=null);Z.mode=q;case q:if(Z.flags&1024&&(me=Z.length,me>je&&(me=je),me&&(Z.head&&(Yt=Z.head.extra_len-Z.length,Z.head.extra||(Z.head.extra=new Array(Z.head.extra_len)),r.arraySet(Z.head.extra,Me,N,me,Yt)),Z.flags&512&&(Z.check=t(Z.check,Me,me,N)),je-=me,N+=me,Z.length-=me),Z.length))break e;Z.length=0,Z.mode=ee;case ee:if(Z.flags&2048){if(je===0)break e;me=0;do Yt=Me[N+me++],Z.head&&Yt&&Z.length<65536&&(Z.head.name+=String.fromCharCode(Yt));while(Yt&&me<je);if(Z.flags&512&&(Z.check=t(Z.check,Me,me,N)),je-=me,N+=me,Yt)break e}else Z.head&&(Z.head.name=null);Z.length=0,Z.mode=K;case K:if(Z.flags&4096){if(je===0)break e;me=0;do Yt=Me[N+me++],Z.head&&Yt&&Z.length<65536&&(Z.head.comment+=String.fromCharCode(Yt));while(Yt&&me<je);if(Z.flags&512&&(Z.check=t(Z.check,Me,me,N)),je-=me,N+=me,Yt)break e}else Z.head&&(Z.head.comment=null);Z.mode=ne;case ne:if(Z.flags&512){for(;Be<16;){if(je===0)break e;je--,De+=Me[N++]<<Be,Be+=8}if(De!==(Z.check&65535)){ve.msg="header crc mismatch",Z.mode=V;break}De=0,Be=0}Z.head&&(Z.head.hcrc=Z.flags>>9&1,Z.head.done=!0),ve.adler=Z.check=0,Z.mode=Y;break;case L:for(;Be<32;){if(je===0)break e;je--,De+=Me[N++]<<Be,Be+=8}ve.adler=Z.check=Ae(De),De=0,Be=0,Z.mode=$;case $:if(Z.havedict===0)return ve.next_out=Pe,ve.avail_out=de,ve.next_in=N,ve.avail_in=je,Z.hold=De,Z.bits=Be,m;ve.adler=Z.check=1,Z.mode=Y;case Y:if(Ie===c||Ie===f)break e;case ie:if(Z.last){De>>>=Be&7,Be-=Be&7,Z.mode=ae;break}for(;Be<3;){if(je===0)break e;je--,De+=Me[N++]<<Be,Be+=8}switch(Z.last=De&1,De>>>=1,Be-=1,De&3){case 0:Z.mode=re;break;case 1:if(R(Z),Z.mode=U,Ie===f){De>>>=2,Be-=2;break e}break;case 2:Z.mode=P;break;case 3:ve.msg="invalid block type",Z.mode=V}De>>>=2,Be-=2;break;case re:for(De>>>=Be&7,Be-=Be&7;Be<32;){if(je===0)break e;je--,De+=Me[N++]<<Be,Be+=8}if((De&65535)!==(De>>>16^65535)){ve.msg="invalid stored block lengths",Z.mode=V;break}if(Z.length=De&65535,De=0,Be=0,Z.mode=k,Ie===f)break e;case k:Z.mode=x;case x:if(me=Z.length,me){if(me>je&&(me=je),me>de&&(me=de),me===0)break e;r.arraySet(nt,Me,N,me,Pe),je-=me,N+=me,de-=me,Pe+=me,Z.length-=me;break}Z.mode=Y;break;case P:for(;Be<14;){if(je===0)break e;je--,De+=Me[N++]<<Be,Be+=8}if(Z.nlen=(De&31)+257,De>>>=5,Be-=5,Z.ndist=(De&31)+1,De>>>=5,Be-=5,Z.ncode=(De&15)+4,De>>>=4,Be-=4,Z.nlen>286||Z.ndist>30){ve.msg="too many length or distance symbols",Z.mode=V;break}Z.have=0,Z.mode=C;case C:for(;Z.have<Z.ncode;){for(;Be<3;){if(je===0)break e;je--,De+=Me[N++]<<Be,Be+=8}Z.lens[tn[Z.have++]]=De&7,De>>>=3,Be-=3}for(;Z.have<19;)Z.lens[tn[Z.have++]]=0;if(Z.lencode=Z.lendyn,Z.lenbits=7,Ht={bits:Z.lenbits},Or=i(o,Z.lens,0,19,Z.lencode,0,Z.work,Ht),Z.lenbits=Ht.bits,Or){ve.msg="invalid code lengths set",Z.mode=V;break}Z.have=0,Z.mode=j;case j:for(;Z.have<Z.nlen+Z.ndist;){for(;et=Z.lencode[De&(1<<Z.lenbits)-1],pt=et>>>24,It=et>>>16&255,xt=et&65535,!(pt<=Be);){if(je===0)break e;je--,De+=Me[N++]<<Be,Be+=8}if(xt<16)De>>>=pt,Be-=pt,Z.lens[Z.have++]=xt;else{if(xt===16){for(Zt=pt+2;Be<Zt;){if(je===0)break e;je--,De+=Me[N++]<<Be,Be+=8}if(De>>>=pt,Be-=pt,Z.have===0){ve.msg="invalid bit length repeat",Z.mode=V;break}Yt=Z.lens[Z.have-1],me=3+(De&3),De>>>=2,Be-=2}else if(xt===17){for(Zt=pt+3;Be<Zt;){if(je===0)break e;je--,De+=Me[N++]<<Be,Be+=8}De>>>=pt,Be-=pt,Yt=0,me=3+(De&7),De>>>=3,Be-=3}else{for(Zt=pt+7;Be<Zt;){if(je===0)break e;je--,De+=Me[N++]<<Be,Be+=8}De>>>=pt,Be-=pt,Yt=0,me=11+(De&127),De>>>=7,Be-=7}if(Z.have+me>Z.nlen+Z.ndist){ve.msg="invalid bit length repeat",Z.mode=V;break}for(;me--;)Z.lens[Z.have++]=Yt}}if(Z.mode===V)break;if(Z.lens[256]===0){ve.msg="invalid code -- missing end-of-block",Z.mode=V;break}if(Z.lenbits=9,Ht={bits:Z.lenbits},Or=i(s,Z.lens,0,Z.nlen,Z.lencode,0,Z.work,Ht),Z.lenbits=Ht.bits,Or){ve.msg="invalid literal/lengths set",Z.mode=V;break}if(Z.distbits=6,Z.distcode=Z.distdyn,Ht={bits:Z.distbits},Or=i(a,Z.lens,Z.nlen,Z.ndist,Z.distcode,0,Z.work,Ht),Z.distbits=Ht.bits,Or){ve.msg="invalid distances set",Z.mode=V;break}if(Z.mode=U,Ie===f)break e;case U:Z.mode=B;case B:if(je>=6&&de>=258){ve.next_out=Pe,ve.avail_out=de,ve.next_in=N,ve.avail_in=je,Z.hold=De,Z.bits=Be,n(ve,ue),Pe=ve.next_out,nt=ve.output,de=ve.avail_out,N=ve.next_in,Me=ve.input,je=ve.avail_in,De=Z.hold,Be=Z.bits,Z.mode===Y&&(Z.back=-1);break}for(Z.back=0;et=Z.lencode[De&(1<<Z.lenbits)-1],pt=et>>>24,It=et>>>16&255,xt=et&65535,!(pt<=Be);){if(je===0)break e;je--,De+=Me[N++]<<Be,Be+=8}if(It&&(It&240)===0){for(fr=pt,Ri=It,Yn=xt;et=Z.lencode[Yn+((De&(1<<fr+Ri)-1)>>fr)],pt=et>>>24,It=et>>>16&255,xt=et&65535,!(fr+pt<=Be);){if(je===0)break e;je--,De+=Me[N++]<<Be,Be+=8}De>>>=fr,Be-=fr,Z.back+=fr}if(De>>>=pt,Be-=pt,Z.back+=pt,Z.length=xt,It===0){Z.mode=H;break}if(It&32){Z.back=-1,Z.mode=Y;break}if(It&64){ve.msg="invalid literal/length code",Z.mode=V;break}Z.extra=It&15,Z.mode=Q;case Q:if(Z.extra){for(Zt=Z.extra;Be<Zt;){if(je===0)break e;je--,De+=Me[N++]<<Be,Be+=8}Z.length+=De&(1<<Z.extra)-1,De>>>=Z.extra,Be-=Z.extra,Z.back+=Z.extra}Z.was=Z.length,Z.mode=fe;case fe:for(;et=Z.distcode[De&(1<<Z.distbits)-1],pt=et>>>24,It=et>>>16&255,xt=et&65535,!(pt<=Be);){if(je===0)break e;je--,De+=Me[N++]<<Be,Be+=8}if((It&240)===0){for(fr=pt,Ri=It,Yn=xt;et=Z.distcode[Yn+((De&(1<<fr+Ri)-1)>>fr)],pt=et>>>24,It=et>>>16&255,xt=et&65535,!(fr+pt<=Be);){if(je===0)break e;je--,De+=Me[N++]<<Be,Be+=8}De>>>=fr,Be-=fr,Z.back+=fr}if(De>>>=pt,Be-=pt,Z.back+=pt,It&64){ve.msg="invalid distance code",Z.mode=V;break}Z.offset=xt,Z.extra=It&15,Z.mode=Ee;case Ee:if(Z.extra){for(Zt=Z.extra;Be<Zt;){if(je===0)break e;je--,De+=Me[N++]<<Be,Be+=8}Z.offset+=De&(1<<Z.extra)-1,De>>>=Z.extra,Be-=Z.extra,Z.back+=Z.extra}if(Z.offset>Z.dmax){ve.msg="invalid distance too far back",Z.mode=V;break}Z.mode=te;case te:if(de===0)break e;if(me=ue-de,Z.offset>me){if(me=Z.offset-me,me>Z.whave&&Z.sane){ve.msg="invalid distance too far back",Z.mode=V;break}me>Z.wnext?(me-=Z.wnext,Ge=Z.wsize-me):Ge=Z.wnext-me,me>Z.length&&(me=Z.length),Ue=Z.window}else Ue=nt,Ge=Pe-Z.offset,me=Z.length;me>de&&(me=de),de-=me,Z.length-=me;do nt[Pe++]=Ue[Ge++];while(--me);Z.length===0&&(Z.mode=B);break;case H:if(de===0)break e;nt[Pe++]=Z.length,de--,Z.mode=B;break;case ae:if(Z.wrap){for(;Be<32;){if(je===0)break e;je--,De|=Me[N++]<<Be,Be+=8}if(ue-=de,ve.total_out+=ue,Z.total+=ue,ue&&(ve.adler=Z.check=Z.flags?t(Z.check,nt,ue,Pe-ue):e(Z.check,nt,ue,Pe-ue)),ue=de,(Z.flags?De:Ae(De))!==Z.check){ve.msg="incorrect data check",Z.mode=V;break}De=0,Be=0}Z.mode=we;case we:if(Z.wrap&&Z.flags){for(;Be<32;){if(je===0)break e;je--,De+=Me[N++]<<Be,Be+=8}if(De!==(Z.total&4294967295)){ve.msg="incorrect length check",Z.mode=V;break}De=0,Be=0}Z.mode=xe;case xe:Or=d;break e;case V:Or=v;break e;case M:return w;case oe:default:return y}return ve.next_out=Pe,ve.avail_out=de,ve.next_in=N,ve.avail_in=je,Z.hold=De,Z.bits=Be,(Z.wsize||ue!==ve.avail_out&&Z.mode<V&&(Z.mode<ae||Ie!==u))&&J(ve,ve.output,ve.next_out,ue-ve.avail_out),ft-=ve.avail_in,ue-=ve.avail_out,ve.total_in+=ft,ve.total_out+=ue,Z.total+=ue,Z.wrap&&ue&&(ve.adler=Z.check=Z.flags?t(Z.check,nt,ue,ve.next_out-ue):e(Z.check,nt,ue,ve.next_out-ue)),ve.data_type=Z.bits+(Z.last?64:0)+(Z.mode===Y?128:0)+(Z.mode===U||Z.mode===k?256:0),(ft===0&&ue===0||Ie===u)&&Or===h&&(Or=b),Or}function le(ve){if(!ve||!ve.state)return y;var Ie=ve.state;return Ie.window&&(Ie.window=null),ve.state=null,h}function he(ve,Ie){var Z;return!ve||!ve.state||(Z=ve.state,(Z.wrap&2)===0)?y:(Z.head=Ie,Ie.done=!1,h)}function _e(ve,Ie){var Z=Ie.length,Me,nt,N;return!ve||!ve.state||(Me=ve.state,Me.wrap!==0&&Me.mode!==$)?y:Me.mode===$&&(nt=1,nt=e(nt,Ie,Z,0),nt!==Me.check)?v:(N=J(ve,Ie,Z,Z),N?(Me.mode=M,w):(Me.havedict=1,h))}return ds.inflateReset=Ne,ds.inflateReset2=Ze,ds.inflateResetKeep=ke,ds.inflateInit=it,ds.inflateInit2=tt,ds.inflate=D,ds.inflateEnd=le,ds.inflateGetHeader=he,ds.inflateSetDictionary=_e,ds.inflateInfo="pako inflate (from Nodeca project)",ds}function eW(){return RL||(RL=!0,O_={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}),O_}function tW(){if(DL)return rt;DL=!0;var r=gn().Buffer,e=qr,t=gt,n=V7(),i=K7(),o=Q7(),s=eW();for(var a in s)rt[a]=s[a];rt.NONE=0,rt.DEFLATE=1,rt.INFLATE=2,rt.GZIP=3,rt.GUNZIP=4,rt.DEFLATERAW=5,rt.INFLATERAW=6,rt.UNZIP=7;var u=31,c=139;function f(h){if(typeof h!="number"||h<rt.DEFLATE||h>rt.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=h,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}return f.prototype.close=function(){if(this.write_in_progress){this.pending_close=!0;return}this.pending_close=!1,t(this.init_done,"close before init"),t(this.mode<=rt.UNZIP),this.mode===rt.DEFLATE||this.mode===rt.GZIP||this.mode===rt.DEFLATERAW?i.deflateEnd(this.strm):(this.mode===rt.INFLATE||this.mode===rt.GUNZIP||this.mode===rt.INFLATERAW||this.mode===rt.UNZIP)&&o.inflateEnd(this.strm),this.mode=rt.NONE,this.dictionary=null},f.prototype.write=function(h,d,m,y,v,w,b){return this._write(!0,h,d,m,y,v,w,b)},f.prototype.writeSync=function(h,d,m,y,v,w,b){return this._write(!1,h,d,m,y,v,w,b)},f.prototype._write=function(h,d,m,y,v,w,b,E){if(t.equal(arguments.length,8),t(this.init_done,"write before init"),t(this.mode!==rt.NONE,"already finalized"),t.equal(!1,this.write_in_progress,"write already in progress"),t.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,t.equal(!1,d===void 0,"must provide flush value"),this.write_in_progress=!0,d!==rt.Z_NO_FLUSH&&d!==rt.Z_PARTIAL_FLUSH&&d!==rt.Z_SYNC_FLUSH&&d!==rt.Z_FULL_FLUSH&&d!==rt.Z_FINISH&&d!==rt.Z_BLOCK)throw new Error("Invalid flush value");if(m==null&&(m=r.alloc(0),v=0,y=0),this.strm.avail_in=v,this.strm.input=m,this.strm.next_in=y,this.strm.avail_out=E,this.strm.output=w,this.strm.next_out=b,this.flush=d,!h)return this._process(),this._checkError()?this._afterSync():void 0;var _=this;return e.nextTick(function(){_._process(),_._after()}),this},f.prototype._afterSync=function(){var h=this.strm.avail_out,d=this.strm.avail_in;return this.write_in_progress=!1,[d,h]},f.prototype._process=function(){var h=null;switch(this.mode){case rt.DEFLATE:case rt.GZIP:case rt.DEFLATERAW:this.err=i.deflate(this.strm,this.flush);break;case rt.UNZIP:switch(this.strm.avail_in>0&&(h=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(h===null)break;if(this.strm.input[h]===u){if(this.gzip_id_bytes_read=1,h++,this.strm.avail_in===1)break}else{this.mode=rt.INFLATE;break}case 1:if(h===null)break;this.strm.input[h]===c?(this.gzip_id_bytes_read=2,this.mode=rt.GUNZIP):this.mode=rt.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case rt.INFLATE:case rt.GUNZIP:case rt.INFLATERAW:for(this.err=o.inflate(this.strm,this.flush),this.err===rt.Z_NEED_DICT&&this.dictionary&&(this.err=o.inflateSetDictionary(this.strm,this.dictionary),this.err===rt.Z_OK?this.err=o.inflate(this.strm,this.flush):this.err===rt.Z_DATA_ERROR&&(this.err=rt.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===rt.GUNZIP&&this.err===rt.Z_STREAM_END&&this.strm.next_in[0]!==0;)this.reset(),this.err=o.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},f.prototype._checkError=function(){switch(this.err){case rt.Z_OK:case rt.Z_BUF_ERROR:if(this.strm.avail_out!==0&&this.flush===rt.Z_FINISH)return this._error("unexpected end of file"),!1;break;case rt.Z_STREAM_END:break;case rt.Z_NEED_DICT:return this.dictionary==null?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},f.prototype._after=function(){if(this._checkError()){var h=this.strm.avail_out,d=this.strm.avail_in;this.write_in_progress=!1,this.callback(d,h),this.pending_close&&this.close()}},f.prototype._error=function(h){this.strm.msg&&(h=this.strm.msg),this.onerror(h,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},f.prototype.init=function(h,d,m,y,v){t(arguments.length===4||arguments.length===5,"init(windowBits, level, memLevel, strategy, [dictionary])"),t(h>=8&&h<=15,"invalid windowBits"),t(d>=-1&&d<=9,"invalid compression level"),t(m>=1&&m<=9,"invalid memlevel"),t(y===rt.Z_FILTERED||y===rt.Z_HUFFMAN_ONLY||y===rt.Z_RLE||y===rt.Z_FIXED||y===rt.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(d,h,m,y,v),this._setDictionary()},f.prototype.params=function(){throw new Error("deflateParams Not supported")},f.prototype.reset=function(){this._reset(),this._setDictionary()},f.prototype._init=function(h,d,m,y,v){switch(this.level=h,this.windowBits=d,this.memLevel=m,this.strategy=y,this.flush=rt.Z_NO_FLUSH,this.err=rt.Z_OK,(this.mode===rt.GZIP||this.mode===rt.GUNZIP)&&(this.windowBits+=16),this.mode===rt.UNZIP&&(this.windowBits+=32),(this.mode===rt.DEFLATERAW||this.mode===rt.INFLATERAW)&&(this.windowBits=-1*this.windowBits),this.strm=new n,this.mode){case rt.DEFLATE:case rt.GZIP:case rt.DEFLATERAW:this.err=i.deflateInit2(this.strm,this.level,rt.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case rt.INFLATE:case rt.GUNZIP:case rt.INFLATERAW:case rt.UNZIP:this.err=o.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==rt.Z_OK&&this._error("Init error"),this.dictionary=v,this.write_in_progress=!1,this.init_done=!0},f.prototype._setDictionary=function(){if(this.dictionary!=null){switch(this.err=rt.Z_OK,this.mode){case rt.DEFLATE:case rt.DEFLATERAW:this.err=i.deflateSetDictionary(this.strm,this.dictionary);break}this.err!==rt.Z_OK&&this._error("Failed to set dictionary")}},f.prototype._reset=function(){switch(this.err=rt.Z_OK,this.mode){case rt.DEFLATE:case rt.DEFLATERAW:case rt.GZIP:this.err=i.deflateReset(this.strm);break;case rt.INFLATE:case rt.INFLATERAW:case rt.GUNZIP:this.err=o.inflateReset(this.strm);break}this.err!==rt.Z_OK&&this._error("Failed to reset stream")},rt.Zlib=f,rt}function rW(){if(IL)return dt;IL=!0;var r=qr,e=gn().Buffer,t=li.Transform,n=tW(),i=qe,o=gt.ok,s=gn().kMaxLength,a="Cannot create final Buffer. It would be larger than 0x"+s.toString(16)+" bytes";n.Z_MIN_WINDOWBITS=8,n.Z_MAX_WINDOWBITS=15,n.Z_DEFAULT_WINDOWBITS=15,n.Z_MIN_CHUNK=64,n.Z_MAX_CHUNK=1/0,n.Z_DEFAULT_CHUNK=16*1024,n.Z_MIN_MEMLEVEL=1,n.Z_MAX_MEMLEVEL=9,n.Z_DEFAULT_MEMLEVEL=8,n.Z_MIN_LEVEL=-1,n.Z_MAX_LEVEL=9,n.Z_DEFAULT_LEVEL=n.Z_DEFAULT_COMPRESSION;for(var u=Object.keys(n),c=0;c<u.length;c++){var f=u[c];f.match(/^Z/)&&Object.defineProperty(dt,f,{enumerable:!0,value:n[f],writable:!1})}for(var h={Z_OK:n.Z_OK,Z_STREAM_END:n.Z_STREAM_END,Z_NEED_DICT:n.Z_NEED_DICT,Z_ERRNO:n.Z_ERRNO,Z_STREAM_ERROR:n.Z_STREAM_ERROR,Z_DATA_ERROR:n.Z_DATA_ERROR,Z_MEM_ERROR:n.Z_MEM_ERROR,Z_BUF_ERROR:n.Z_BUF_ERROR,Z_VERSION_ERROR:n.Z_VERSION_ERROR},d=Object.keys(h),m=0;m<d.length;m++){var y=d[m];h[h[y]]=y}Object.defineProperty(dt,"codes",{enumerable:!0,value:Object.freeze(h),writable:!1}),dt.Deflate=b,dt.Inflate=E,dt.Gzip=_,dt.Gunzip=S,dt.DeflateRaw=A,dt.InflateRaw=F,dt.Unzip=I,dt.createDeflate=function(L){return new b(L)},dt.createInflate=function(L){return new E(L)},dt.createDeflateRaw=function(L){return new A(L)},dt.createInflateRaw=function(L){return new F(L)},dt.createGzip=function(L){return new _(L)},dt.createGunzip=function(L){return new S(L)},dt.createUnzip=function(L){return new I(L)},dt.deflate=function(L,$,Y){return typeof $=="function"&&(Y=$,$={}),v(new b($),L,Y)},dt.deflateSync=function(L,$){return w(new b($),L)},dt.gzip=function(L,$,Y){return typeof $=="function"&&(Y=$,$={}),v(new _($),L,Y)},dt.gzipSync=function(L,$){return w(new _($),L)},dt.deflateRaw=function(L,$,Y){return typeof $=="function"&&(Y=$,$={}),v(new A($),L,Y)},dt.deflateRawSync=function(L,$){return w(new A($),L)},dt.unzip=function(L,$,Y){return typeof $=="function"&&(Y=$,$={}),v(new I($),L,Y)},dt.unzipSync=function(L,$){return w(new I($),L)},dt.inflate=function(L,$,Y){return typeof $=="function"&&(Y=$,$={}),v(new E($),L,Y)},dt.inflateSync=function(L,$){return w(new E($),L)},dt.gunzip=function(L,$,Y){return typeof $=="function"&&(Y=$,$={}),v(new S($),L,Y)},dt.gunzipSync=function(L,$){return w(new S($),L)},dt.inflateRaw=function(L,$,Y){return typeof $=="function"&&(Y=$,$={}),v(new F($),L,Y)},dt.inflateRawSync=function(L,$){return w(new F($),L)};function v(L,$,Y){var ie=[],re=0;L.on("error",x),L.on("end",P),L.end($),k();function k(){for(var C;(C=L.read())!==null;)ie.push(C),re+=C.length;L.once("readable",k)}function x(C){L.removeListener("end",P),L.removeListener("readable",k),Y(C)}function P(){var C,j=null;re>=s?j=new RangeError(a):C=e.concat(ie,re),ie=[],L.close(),Y(j,C)}}function w(L,$){if(typeof $=="string"&&($=e.from($)),!e.isBuffer($))throw new TypeError("Not a string or buffer");var Y=L._finishFlushFlag;return L._processChunk($,Y)}function b(L){if(!(this instanceof b))return new b(L);ee.call(this,L,n.DEFLATE)}function E(L){if(!(this instanceof E))return new E(L);ee.call(this,L,n.INFLATE)}function _(L){if(!(this instanceof _))return new _(L);ee.call(this,L,n.GZIP)}function S(L){if(!(this instanceof S))return new S(L);ee.call(this,L,n.GUNZIP)}function A(L){if(!(this instanceof A))return new A(L);ee.call(this,L,n.DEFLATERAW)}function F(L){if(!(this instanceof F))return new F(L);ee.call(this,L,n.INFLATERAW)}function I(L){if(!(this instanceof I))return new I(L);ee.call(this,L,n.UNZIP)}function q(L){return L===n.Z_NO_FLUSH||L===n.Z_PARTIAL_FLUSH||L===n.Z_SYNC_FLUSH||L===n.Z_FULL_FLUSH||L===n.Z_FINISH||L===n.Z_BLOCK}function ee(L,$){var Y=this;if(this._opts=L=L||{},this._chunkSize=L.chunkSize||dt.Z_DEFAULT_CHUNK,t.call(this,L),L.flush&&!q(L.flush))throw new Error("Invalid flush flag: "+L.flush);if(L.finishFlush&&!q(L.finishFlush))throw new Error("Invalid flush flag: "+L.finishFlush);if(this._flushFlag=L.flush||n.Z_NO_FLUSH,this._finishFlushFlag=typeof L.finishFlush<"u"?L.finishFlush:n.Z_FINISH,L.chunkSize&&(L.chunkSize<dt.Z_MIN_CHUNK||L.chunkSize>dt.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+L.chunkSize);if(L.windowBits&&(L.windowBits<dt.Z_MIN_WINDOWBITS||L.windowBits>dt.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+L.windowBits);if(L.level&&(L.level<dt.Z_MIN_LEVEL||L.level>dt.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+L.level);if(L.memLevel&&(L.memLevel<dt.Z_MIN_MEMLEVEL||L.memLevel>dt.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+L.memLevel);if(L.strategy&&L.strategy!=dt.Z_FILTERED&&L.strategy!=dt.Z_HUFFMAN_ONLY&&L.strategy!=dt.Z_RLE&&L.strategy!=dt.Z_FIXED&&L.strategy!=dt.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+L.strategy);if(L.dictionary&&!e.isBuffer(L.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new n.Zlib($);var ie=this;this._hadError=!1,this._handle.onerror=function(x,P){K(ie),ie._hadError=!0;var C=new Error(x);C.errno=P,C.code=dt.codes[P],ie.emit("error",C)};var re=dt.Z_DEFAULT_COMPRESSION;typeof L.level=="number"&&(re=L.level);var k=dt.Z_DEFAULT_STRATEGY;typeof L.strategy=="number"&&(k=L.strategy),this._handle.init(L.windowBits||dt.Z_DEFAULT_WINDOWBITS,re,L.memLevel||dt.Z_DEFAULT_MEMLEVEL,k,L.dictionary),this._buffer=e.allocUnsafe(this._chunkSize),this._offset=0,this._level=re,this._strategy=k,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!Y._handle},configurable:!0,enumerable:!0})}i.inherits(ee,t),ee.prototype.params=function(L,$,Y){if(L<dt.Z_MIN_LEVEL||L>dt.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+L);if($!=dt.Z_FILTERED&&$!=dt.Z_HUFFMAN_ONLY&&$!=dt.Z_RLE&&$!=dt.Z_FIXED&&$!=dt.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+$);if(this._level!==L||this._strategy!==$){var ie=this;this.flush(n.Z_SYNC_FLUSH,function(){o(ie._handle,"zlib binding closed"),ie._handle.params(L,$),ie._hadError||(ie._level=L,ie._strategy=$,Y&&Y())})}else r.nextTick(Y)},ee.prototype.reset=function(){return o(this._handle,"zlib binding closed"),this._handle.reset()},ee.prototype._flush=function(L){this._transform(e.alloc(0),"",L)},ee.prototype.flush=function(L,$){var Y=this,ie=this._writableState;(typeof L=="function"||L===void 0&&!$)&&($=L,L=n.Z_FULL_FLUSH),ie.ended?$&&r.nextTick($):ie.ending?$&&this.once("end",$):ie.needDrain?$&&this.once("drain",function(){return Y.flush(L,$)}):(this._flushFlag=L,this.write(e.alloc(0),"",$))},ee.prototype.close=function(L){K(this,L),r.nextTick(ne,this)};function K(L,$){$&&r.nextTick($),L._handle&&(L._handle.close(),L._handle=null)}function ne(L){L.emit("close")}return ee.prototype._transform=function(L,$,Y){var ie,re=this._writableState,k=re.ending||re.ended,x=k&&(!L||re.length===L.length);if(L!==null&&!e.isBuffer(L))return Y(new Error("invalid input"));if(!this._handle)return Y(new Error("zlib binding closed"));x?ie=this._finishFlushFlag:(ie=this._flushFlag,L.length>=re.length&&(this._flushFlag=this._opts.flush||n.Z_NO_FLUSH)),this._processChunk(L,ie,Y)},ee.prototype._processChunk=function(L,$,Y){var ie=L&&L.length,re=this._chunkSize-this._offset,k=0,x=this,P=typeof Y=="function";if(!P){var C=[],j=0,U;this.on("error",function(te){U=te}),o(this._handle,"zlib binding closed");do var B=this._handle.writeSync($,L,k,ie,this._buffer,this._offset,re);while(!this._hadError&&Ee(B[0],B[1]));if(this._hadError)throw U;if(j>=s)throw K(this),new RangeError(a);var Q=e.concat(C,j);return K(this),Q}o(this._handle,"zlib binding closed");var fe=this._handle.write($,L,k,ie,this._buffer,this._offset,re);fe.buffer=L,fe.callback=Ee;function Ee(te,H){if(this&&(this.buffer=null,this.callback=null),!x._hadError){var ae=re-H;if(o(ae>=0,"have should not go down"),ae>0){var we=x._buffer.slice(x._offset,x._offset+ae);x._offset+=ae,P?x.push(we):(C.push(we),j+=we.length)}if((H===0||x._offset>=x._chunkSize)&&(re=x._chunkSize,x._offset=0,x._buffer=e.allocUnsafe(x._chunkSize)),H===0){if(k+=ie-te,ie=te,!P)return!0;var xe=x._handle.write($,L,k,ie,x._buffer,x._offset,x._chunkSize);xe.callback=Ee,xe.buffer=L;return}if(!P)return!1;Y()}}},i.inherits(b,ee),i.inherits(E,ee),i.inherits(_,ee),i.inherits(S,ee),i.inherits(A,ee),i.inherits(F,ee),i.inherits(I,ee),dt}var T_,bL,jn,wL,fc,vL,C_,EL,R_,_L,D_,AL,$s,xL,I_,SL,N_,TL,ds,CL,O_,RL,rt,DL,dt,IL,Je,nW,iW,sW,oW,aW,lW,uW,cW,fW,hW,dW,pW,gW,mW,yW,bW,wW,vW,EW,_W,AW,xW,SW,TW,CW,RW,DW,IW,NW,OW,kW,LW,PW,MW,BW,FW,UW,jW,$W,WW,zW,HW,qW,GW,VW,YW,XW,KW,ZW,JW,QW,ez,tz,rz,nz,iz,sz,oz,az,lz,uz,cz,fz,hz,dz,pz,gz,mz,yz,LL=_t(()=>{Te();Re();Ce();Jf();f2();w1();Ju();yb();Al();vb();uh();Rb();ih();T_={},bL=!1;jn={},wL=!1;fc={},vL=!1;C_={},EL=!1;R_={},_L=!1;D_={},AL=!1;$s={},xL=!1;I_={},SL=!1;N_={},TL=!1;ds={},CL=!1;O_={},RL=!1;rt={},DL=!1;dt={},IL=!1;Je=rW();Je.codes;Je.Deflate;Je.Inflate;Je.Gzip;Je.Gunzip;Je.DeflateRaw;Je.InflateRaw;Je.Unzip;Je.createDeflate;Je.createInflate;Je.createDeflateRaw;Je.createInflateRaw;Je.createGzip;Je.createGunzip;Je.createUnzip;Je.deflate;Je.deflateSync;Je.gzip;Je.gzipSync;Je.deflateRaw;Je.deflateRawSync;Je.unzip;Je.unzipSync;Je.inflate;Je.inflateSync;Je.gunzip;Je.gunzipSync;Je.inflateRaw;Je.inflateRawSync;nW=Je.Deflate,iW=Je.DeflateRaw,sW=Je.Gunzip,oW=Je.Gzip,aW=Je.Inflate,lW=Je.InflateRaw,uW=Je.Unzip,cW=Je.Z_BEST_COMPRESSION,fW=Je.Z_BEST_SPEED,hW=Je.Z_BINARY,dW=Je.Z_BLOCK,pW=Je.Z_BUF_ERROR,gW=Je.Z_DATA_ERROR,mW=Je.Z_DEFAULT_CHUNK,yW=Je.Z_DEFAULT_COMPRESSION,bW=Je.Z_DEFAULT_LEVEL,wW=Je.Z_DEFAULT_MEMLEVEL,vW=Je.Z_DEFAULT_STRATEGY,EW=Je.Z_DEFAULT_WINDOWBITS,_W=Je.Z_DEFLATED,AW=Je.Z_ERRNO,xW=Je.Z_FILTERED,SW=Je.Z_FINISH,TW=Je.Z_FIXED,CW=Je.Z_FULL_FLUSH,RW=Je.Z_HUFFMAN_ONLY,DW=Je.Z_MAX_CHUNK,IW=Je.Z_MAX_LEVEL,NW=Je.Z_MAX_MEMLEVEL,OW=Je.Z_MAX_WINDOWBITS,kW=Je.Z_MIN_CHUNK,LW=Je.Z_MIN_LEVEL,PW=Je.Z_MIN_MEMLEVEL,MW=Je.Z_MIN_WINDOWBITS,BW=Je.Z_NEED_DICT,FW=Je.Z_NO_COMPRESSION,UW=Je.Z_NO_FLUSH,jW=Je.Z_OK,$W=Je.Z_PARTIAL_FLUSH,WW=Je.Z_RLE,zW=Je.Z_STREAM_END,HW=Je.Z_STREAM_ERROR,qW=Je.Z_SYNC_FLUSH,GW=Je.Z_TEXT,VW=Je.Z_TREES,YW=Je.Z_UNKNOWN,XW=Je.Zlib,KW=Je.codes,ZW=Je.createDeflate,JW=Je.createDeflateRaw,QW=Je.createGunzip,ez=Je.createGzip,tz=Je.createInflate,rz=Je.createInflateRaw,nz=Je.createUnzip,iz=Je.deflate,sz=Je.deflateRaw,oz=Je.deflateRawSync,az=Je.deflateSync,lz=Je.gunzip,uz=Je.gunzipSync,cz=Je.gzip,fz=Je.gzipSync,hz=Je.inflate,dz=Je.inflateRaw,pz=Je.inflateRawSync,gz=Je.inflateSync,mz=Je.unzip,yz=Je.unzipSync});function ML(){return PL||(PL=!0,typeof Object.create=="function"?Zb=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Zb=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}),Zb}var Zb,PL,k_=_t(()=>{Te();Re();Ce();Zb={},PL=!1});var Tg={};uo(Tg,{TextDecoder:()=>tH,TextEncoder:()=>eH,_extend:()=>Iz,callbackify:()=>Nz,debuglog:()=>Oz,default:()=>yt,deprecate:()=>kz,format:()=>Lz,inherits:()=>Pz,inspect:()=>Mz,isArray:()=>Bz,isBoolean:()=>Fz,isBuffer:()=>Uz,isDate:()=>jz,isError:()=>$z,isFunction:()=>Wz,isNull:()=>zz,isNullOrUndefined:()=>Hz,isNumber:()=>qz,isObject:()=>Gz,isPrimitive:()=>Vz,isRegExp:()=>Yz,isString:()=>Xz,isSymbol:()=>Kz,isUndefined:()=>Zz,log:()=>Jz,promisify:()=>Jb,types:()=>Qz});function H_(){if(BL)return L_;BL=!0;var r=L2();return L_=function(){return r()&&!!Symbol.toStringTag},L_}function bz(){if(FL)return P_;FL=!0;var r=H_()(),e=sg(),t=e("Object.prototype.toString"),n=function(a){return r&&a&&typeof a=="object"&&Symbol.toStringTag in a?!1:t(a)==="[object Arguments]"},i=function(a){return n(a)?!0:a!==null&&typeof a=="object"&&typeof a.length=="number"&&a.length>=0&&t(a)!=="[object Array]"&&t(a.callee)==="[object Function]"},o=(function(){return n(arguments)})();return n.isLegacyArguments=i,P_=o?n:i,P_}function wz(){if(UL)return M_;UL=!0;var r=Object.prototype.toString,e=Function.prototype.toString,t=/^\s*(?:function)?\*/,n=H_()(),i=Object.getPrototypeOf,o=function(){if(!n)return!1;try{return Function("return function*() {}")()}catch{}},s;return M_=function(u){if(typeof u!="function")return!1;if(t.test(e.call(u)))return!0;if(!n){var c=r.call(u);return c==="[object GeneratorFunction]"}if(!i)return!1;if(typeof s>"u"){var f=o();s=f?i(f):!1}return i(u)===s},M_}function vz(){if(jL)return B_;jL=!0;var r=Function.prototype.toString,e=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,t,n;if(typeof e=="function"&&typeof Object.defineProperty=="function")try{t=Object.defineProperty({},"length",{get:function(){throw n}}),n={},e(function(){throw 42},null,t)}catch(E){E!==n&&(e=null)}else e=null;var i=/^\s*class\b/,o=function(_){try{var S=r.call(_);return i.test(S)}catch{return!1}},s=function(_){try{return o(_)?!1:(r.call(_),!0)}catch{return!1}},a=Object.prototype.toString,u="[object Object]",c="[object Function]",f="[object GeneratorFunction]",h="[object HTMLAllCollection]",d="[object HTML document.all class]",m="[object HTMLCollection]",y=typeof Symbol=="function"&&!!Symbol.toStringTag,v=!(0 in[,]),w=function(){return!1};if(typeof document=="object"){var b=document.all;a.call(b)===a.call(document.all)&&(w=function(_){if((v||!_)&&(typeof _>"u"||typeof _=="object"))try{var S=a.call(_);return(S===h||S===d||S===m||S===u)&&_("")==null}catch{}return!1})}return B_=e?function(_){if(w(_))return!0;if(!_||typeof _!="function"&&typeof _!="object")return!1;try{e(_,null,t)}catch(S){if(S!==n)return!1}return!o(_)&&s(_)}:function(_){if(w(_))return!0;if(!_||typeof _!="function"&&typeof _!="object")return!1;if(y)return s(_);if(o(_))return!1;var S=a.call(_);return S!==c&&S!==f&&!/^\[object HTML/.test(S)?!1:s(_)},B_}function Ez(){if($L)return F_;$L=!0;var r=vz(),e=Object.prototype.toString,t=Object.prototype.hasOwnProperty,n=function(u,c,f){for(var h=0,d=u.length;h<d;h++)t.call(u,h)&&(f==null?c(u[h],h,u):c.call(f,u[h],h,u))},i=function(u,c,f){for(var h=0,d=u.length;h<d;h++)f==null?c(u.charAt(h),h,u):c.call(f,u.charAt(h),h,u)},o=function(u,c,f){for(var h in u)t.call(u,h)&&(f==null?c(u[h],h,u):c.call(f,u[h],h,u))},s=function(u,c,f){if(!r(c))throw new TypeError("iterator must be a function");var h;arguments.length>=3&&(h=f),e.call(u)==="[object Array]"?n(u,c,h):typeof u=="string"?i(u,c,h):o(u,c,h)};return F_=s,F_}function _z(){return WL||(WL=!0,U_=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),U_}function xz(){if(zL)return j_;zL=!0;var r=_z(),e=typeof globalThis>"u"?Az:globalThis;return j_=function(){for(var n=[],i=0;i<r.length;i++)typeof e[r[i]]=="function"&&(n[n.length]=r[i]);return n},j_}function XL(){if(HL)return $_;HL=!0;var r=Ez(),e=xz(),t=B2(),n=sg(),i=Db(),o=n("Object.prototype.toString"),s=H_()(),a=typeof globalThis>"u"?Sz:globalThis,u=e(),c=n("String.prototype.slice"),f=Object.getPrototypeOf,h=n("Array.prototype.indexOf",!0)||function(w,b){for(var E=0;E<w.length;E+=1)if(w[E]===b)return E;return-1},d={__proto__:null};s&&i&&f?r(u,function(v){var w=new a[v];if(Symbol.toStringTag in w){var b=f(w),E=i(b,Symbol.toStringTag);if(!E){var _=f(b);E=i(_,Symbol.toStringTag)}d["$"+v]=t(E.get)}}):r(u,function(v){var w=new a[v],b=w.slice||w.set;b&&(d["$"+v]=t(b))});var m=function(w){var b=!1;return r(d,function(E,_){if(!b)try{"$"+E(w)===_&&(b=c(_,1))}catch{}}),b},y=function(w){var b=!1;return r(d,function(E,_){if(!b)try{E(w),b=c(_,1)}catch{}}),b};return $_=function(w){if(!w||typeof w!="object")return!1;if(!s){var b=c(o(w),8,-1);return h(u,b)>-1?b:b!=="Object"?!1:y(w)}return i?m(w):null},$_}function Tz(){if(qL)return W_;qL=!0;var r=XL();return W_=function(t){return!!r(t)},W_}function Cz(){if(GL)return Nt;GL=!0;var r=bz(),e=wz(),t=XL(),n=Tz();function i(pe){return pe.call.bind(pe)}var o=typeof BigInt<"u",s=typeof Symbol<"u",a=i(Object.prototype.toString),u=i(Number.prototype.valueOf),c=i(String.prototype.valueOf),f=i(Boolean.prototype.valueOf);if(o)var h=i(BigInt.prototype.valueOf);if(s)var d=i(Symbol.prototype.valueOf);function m(pe,Ae){if(typeof pe!="object")return!1;try{return Ae(pe),!0}catch{return!1}}Nt.isArgumentsObject=r,Nt.isGeneratorFunction=e,Nt.isTypedArray=n;function y(pe){return typeof Promise<"u"&&pe instanceof Promise||pe!==null&&typeof pe=="object"&&typeof pe.then=="function"&&typeof pe.catch=="function"}Nt.isPromise=y;function v(pe){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(pe):n(pe)||U(pe)}Nt.isArrayBufferView=v;function w(pe){return t(pe)==="Uint8Array"}Nt.isUint8Array=w;function b(pe){return t(pe)==="Uint8ClampedArray"}Nt.isUint8ClampedArray=b;function E(pe){return t(pe)==="Uint16Array"}Nt.isUint16Array=E;function _(pe){return t(pe)==="Uint32Array"}Nt.isUint32Array=_;function S(pe){return t(pe)==="Int8Array"}Nt.isInt8Array=S;function A(pe){return t(pe)==="Int16Array"}Nt.isInt16Array=A;function F(pe){return t(pe)==="Int32Array"}Nt.isInt32Array=F;function I(pe){return t(pe)==="Float32Array"}Nt.isFloat32Array=I;function q(pe){return t(pe)==="Float64Array"}Nt.isFloat64Array=q;function ee(pe){return t(pe)==="BigInt64Array"}Nt.isBigInt64Array=ee;function K(pe){return t(pe)==="BigUint64Array"}Nt.isBigUint64Array=K;function ne(pe){return a(pe)==="[object Map]"}ne.working=typeof Map<"u"&&ne(new Map);function L(pe){return typeof Map>"u"?!1:ne.working?ne(pe):pe instanceof Map}Nt.isMap=L;function $(pe){return a(pe)==="[object Set]"}$.working=typeof Set<"u"&&$(new Set);function Y(pe){return typeof Set>"u"?!1:$.working?$(pe):pe instanceof Set}Nt.isSet=Y;function ie(pe){return a(pe)==="[object WeakMap]"}ie.working=typeof WeakMap<"u"&&ie(new WeakMap);function re(pe){return typeof WeakMap>"u"?!1:ie.working?ie(pe):pe instanceof WeakMap}Nt.isWeakMap=re;function k(pe){return a(pe)==="[object WeakSet]"}k.working=typeof WeakSet<"u"&&k(new WeakSet);function x(pe){return k(pe)}Nt.isWeakSet=x;function P(pe){return a(pe)==="[object ArrayBuffer]"}P.working=typeof ArrayBuffer<"u"&&P(new ArrayBuffer);function C(pe){return typeof ArrayBuffer>"u"?!1:P.working?P(pe):pe instanceof ArrayBuffer}Nt.isArrayBuffer=C;function j(pe){return a(pe)==="[object DataView]"}j.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&j(new DataView(new ArrayBuffer(1),0,1));function U(pe){return typeof DataView>"u"?!1:j.working?j(pe):pe instanceof DataView}Nt.isDataView=U;var B=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function Q(pe){return a(pe)==="[object SharedArrayBuffer]"}function fe(pe){return typeof B>"u"?!1:(typeof Q.working>"u"&&(Q.working=Q(new B)),Q.working?Q(pe):pe instanceof B)}Nt.isSharedArrayBuffer=fe;function Ee(pe){return a(pe)==="[object AsyncFunction]"}Nt.isAsyncFunction=Ee;function te(pe){return a(pe)==="[object Map Iterator]"}Nt.isMapIterator=te;function H(pe){return a(pe)==="[object Set Iterator]"}Nt.isSetIterator=H;function ae(pe){return a(pe)==="[object Generator]"}Nt.isGeneratorObject=ae;function we(pe){return a(pe)==="[object WebAssembly.Module]"}Nt.isWebAssemblyCompiledModule=we;function xe(pe){return m(pe,u)}Nt.isNumberObject=xe;function V(pe){return m(pe,c)}Nt.isStringObject=V;function M(pe){return m(pe,f)}Nt.isBooleanObject=M;function oe(pe){return o&&m(pe,h)}Nt.isBigIntObject=oe;function ge(pe){return s&&m(pe,d)}Nt.isSymbolObject=ge;function Se(pe){return xe(pe)||V(pe)||M(pe)||oe(pe)||ge(pe)}Nt.isBoxedPrimitive=Se;function be(pe){return typeof Uint8Array<"u"&&(C(pe)||fe(pe))}return Nt.isAnyArrayBuffer=be,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(pe){Object.defineProperty(Nt,pe,{enumerable:!1,value:function(){throw new Error(pe+" is not supported in userland")}})}),Nt}function Rz(){return VL||(VL=!0,z_=function(e){return e&&typeof e=="object"&&typeof e.copy=="function"&&typeof e.fill=="function"&&typeof e.readUInt8=="function"}),z_}function Dz(){if(YL)return Ot;YL=!0;var r=qr,e=Object.getOwnPropertyDescriptors||function(B){for(var Q=Object.keys(B),fe={},Ee=0;Ee<Q.length;Ee++)fe[Q[Ee]]=Object.getOwnPropertyDescriptor(B,Q[Ee]);return fe},t=/%[sdj%]/g;Ot.format=function(U){if(!A(U)){for(var B=[],Q=0;Q<arguments.length;Q++)B.push(s(arguments[Q]));return B.join(" ")}for(var Q=1,fe=arguments,Ee=fe.length,te=String(U).replace(t,function(ae){if(ae==="%%")return"%";if(Q>=Ee)return ae;switch(ae){case"%s":return String(fe[Q++]);case"%d":return Number(fe[Q++]);case"%j":try{return JSON.stringify(fe[Q++])}catch{return"[Circular]"}default:return ae}}),H=fe[Q];Q<Ee;H=fe[++Q])E(H)||!ee(H)?te+=" "+H:te+=" "+s(H);return te},Ot.deprecate=function(U,B){if(typeof r<"u"&&r.noDeprecation===!0)return U;if(typeof r>"u")return function(){return Ot.deprecate(U,B).apply(this||Sg,arguments)};var Q=!1;function fe(){if(!Q){if(r.throwDeprecation)throw new Error(B);r.traceDeprecation?console.trace(B):console.error(B),Q=!0}return U.apply(this||Sg,arguments)}return fe};var n={},i=/^$/;if(r.env.NODE_DEBUG){var o=r.env.NODE_DEBUG;o=o.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),i=new RegExp("^"+o+"$","i")}Ot.debuglog=function(U){if(U=U.toUpperCase(),!n[U])if(i.test(U)){var B=r.pid;n[U]=function(){var Q=Ot.format.apply(Ot,arguments);console.error("%s %d: %s",U,B,Q)}}else n[U]=function(){};return n[U]};function s(U,B){var Q={seen:[],stylize:u};return arguments.length>=3&&(Q.depth=arguments[2]),arguments.length>=4&&(Q.colors=arguments[3]),b(B)?Q.showHidden=B:B&&Ot._extend(Q,B),I(Q.showHidden)&&(Q.showHidden=!1),I(Q.depth)&&(Q.depth=2),I(Q.colors)&&(Q.colors=!1),I(Q.customInspect)&&(Q.customInspect=!0),Q.colors&&(Q.stylize=a),f(Q,U,Q.depth)}Ot.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function a(U,B){var Q=s.styles[B];return Q?"\x1B["+s.colors[Q][0]+"m"+U+"\x1B["+s.colors[Q][1]+"m":U}function u(U,B){return U}function c(U){var B={};return U.forEach(function(Q,fe){B[Q]=!0}),B}function f(U,B,Q){if(U.customInspect&&B&&L(B.inspect)&&B.inspect!==Ot.inspect&&!(B.constructor&&B.constructor.prototype===B)){var fe=B.inspect(Q,U);return A(fe)||(fe=f(U,fe,Q)),fe}var Ee=h(U,B);if(Ee)return Ee;var te=Object.keys(B),H=c(te);if(U.showHidden&&(te=Object.getOwnPropertyNames(B)),ne(B)&&(te.indexOf("message")>=0||te.indexOf("description")>=0))return d(B);if(te.length===0){if(L(B)){var ae=B.name?": "+B.name:"";return U.stylize("[Function"+ae+"]","special")}if(q(B))return U.stylize(RegExp.prototype.toString.call(B),"regexp");if(K(B))return U.stylize(Date.prototype.toString.call(B),"date");if(ne(B))return d(B)}var we="",xe=!1,V=["{","}"];if(w(B)&&(xe=!0,V=["[","]"]),L(B)){var M=B.name?": "+B.name:"";we=" [Function"+M+"]"}if(q(B)&&(we=" "+RegExp.prototype.toString.call(B)),K(B)&&(we=" "+Date.prototype.toUTCString.call(B)),ne(B)&&(we=" "+d(B)),te.length===0&&(!xe||B.length==0))return V[0]+we+V[1];if(Q<0)return q(B)?U.stylize(RegExp.prototype.toString.call(B),"regexp"):U.stylize("[Object]","special");U.seen.push(B);var oe;return xe?oe=m(U,B,Q,H,te):oe=te.map(function(ge){return y(U,B,Q,H,ge,xe)}),U.seen.pop(),v(oe,we,V)}function h(U,B){if(I(B))return U.stylize("undefined","undefined");if(A(B)){var Q="'"+JSON.stringify(B).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return U.stylize(Q,"string")}if(S(B))return U.stylize(""+B,"number");if(b(B))return U.stylize(""+B,"boolean");if(E(B))return U.stylize("null","null")}function d(U){return"["+Error.prototype.toString.call(U)+"]"}function m(U,B,Q,fe,Ee){for(var te=[],H=0,ae=B.length;H<ae;++H)x(B,String(H))?te.push(y(U,B,Q,fe,String(H),!0)):te.push("");return Ee.forEach(function(we){we.match(/^\d+$/)||te.push(y(U,B,Q,fe,we,!0))}),te}function y(U,B,Q,fe,Ee,te){var H,ae,we;if(we=Object.getOwnPropertyDescriptor(B,Ee)||{value:B[Ee]},we.get?we.set?ae=U.stylize("[Getter/Setter]","special"):ae=U.stylize("[Getter]","special"):we.set&&(ae=U.stylize("[Setter]","special")),x(fe,Ee)||(H="["+Ee+"]"),ae||(U.seen.indexOf(we.value)<0?(E(Q)?ae=f(U,we.value,null):ae=f(U,we.value,Q-1),ae.indexOf(`
|
|
84
|
-
`)>-1&&(te?ae=ae.split(`
|
|
85
|
-
`).map(function(xe){return" "+xe}).join(`
|
|
86
|
-
`).slice(2):ae=`
|
|
87
|
-
`+ae.split(`
|
|
88
|
-
`).map(function(xe){return" "+xe}).join(`
|
|
89
|
-
`))):ae=U.stylize("[Circular]","special")),I(H)){if(te&&Ee.match(/^\d+$/))return ae;H=JSON.stringify(""+Ee),H.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(H=H.slice(1,-1),H=U.stylize(H,"name")):(H=H.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),H=U.stylize(H,"string"))}return H+": "+ae}function v(U,B,Q){var fe=U.reduce(function(Ee,te){return te.indexOf(`
|
|
90
|
-
`)>=0,Ee+te.replace(/\u001b\[\d\d?m/g,"").length+1},0);return fe>60?Q[0]+(B===""?"":B+`
|
|
91
|
-
`)+" "+U.join(`,
|
|
92
|
-
`)+" "+Q[1]:Q[0]+B+" "+U.join(", ")+" "+Q[1]}Ot.types=Cz();function w(U){return Array.isArray(U)}Ot.isArray=w;function b(U){return typeof U=="boolean"}Ot.isBoolean=b;function E(U){return U===null}Ot.isNull=E;function _(U){return U==null}Ot.isNullOrUndefined=_;function S(U){return typeof U=="number"}Ot.isNumber=S;function A(U){return typeof U=="string"}Ot.isString=A;function F(U){return typeof U=="symbol"}Ot.isSymbol=F;function I(U){return U===void 0}Ot.isUndefined=I;function q(U){return ee(U)&&Y(U)==="[object RegExp]"}Ot.isRegExp=q,Ot.types.isRegExp=q;function ee(U){return typeof U=="object"&&U!==null}Ot.isObject=ee;function K(U){return ee(U)&&Y(U)==="[object Date]"}Ot.isDate=K,Ot.types.isDate=K;function ne(U){return ee(U)&&(Y(U)==="[object Error]"||U instanceof Error)}Ot.isError=ne,Ot.types.isNativeError=ne;function L(U){return typeof U=="function"}Ot.isFunction=L;function $(U){return U===null||typeof U=="boolean"||typeof U=="number"||typeof U=="string"||typeof U=="symbol"||typeof U>"u"}Ot.isPrimitive=$,Ot.isBuffer=Rz();function Y(U){return Object.prototype.toString.call(U)}function ie(U){return U<10?"0"+U.toString(10):U.toString(10)}var re=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function k(){var U=new Date,B=[ie(U.getHours()),ie(U.getMinutes()),ie(U.getSeconds())].join(":");return[U.getDate(),re[U.getMonth()],B].join(" ")}Ot.log=function(){console.log("%s - %s",k(),Ot.format.apply(Ot,arguments))},Ot.inherits=ML(),Ot._extend=function(U,B){if(!B||!ee(B))return U;for(var Q=Object.keys(B),fe=Q.length;fe--;)U[Q[fe]]=B[Q[fe]];return U};function x(U,B){return Object.prototype.hasOwnProperty.call(U,B)}var P=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;Ot.promisify=function(B){if(typeof B!="function")throw new TypeError('The "original" argument must be of type Function');if(P&&B[P]){if(Q=B[P],typeof Q!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(Q,P,{value:Q,enumerable:!1,writable:!1,configurable:!0}),Q}function Q(){for(var fe,Ee,te=new Promise(function(we,xe){fe=we,Ee=xe}),H=[],ae=0;ae<arguments.length;ae++)H.push(arguments[ae]);H.push(function(we,xe){we?Ee(we):fe(xe)});try{B.apply(this||Sg,H)}catch(we){Ee(we)}return te}return Object.setPrototypeOf(Q,Object.getPrototypeOf(B)),P&&Object.defineProperty(Q,P,{value:Q,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(Q,e(B))},Ot.promisify.custom=P;function C(U,B){if(!U){var Q=new Error("Promise was rejected with a falsy value");Q.reason=U,U=Q}return B(U)}function j(U){if(typeof U!="function")throw new TypeError('The "original" argument must be of type Function');function B(){for(var Q=[],fe=0;fe<arguments.length;fe++)Q.push(arguments[fe]);var Ee=Q.pop();if(typeof Ee!="function")throw new TypeError("The last argument must be of type Function");var te=this||Sg,H=function(){return Ee.apply(te,arguments)};U.apply(this||Sg,Q).then(function(ae){r.nextTick(H.bind(null,null,ae))},function(ae){r.nextTick(C.bind(null,ae,H))})}return Object.setPrototypeOf(B,Object.getPrototypeOf(U)),Object.defineProperties(B,e(U)),B}return Ot.callbackify=j,Ot}var L_,BL,P_,FL,M_,UL,B_,jL,F_,$L,U_,WL,j_,zL,Az,$_,HL,Sz,W_,qL,Nt,GL,z_,VL,Ot,YL,Sg,yt,Iz,Nz,Oz,kz,Lz,Pz,Mz,Bz,Fz,Uz,jz,$z,Wz,zz,Hz,qz,Gz,Vz,Yz,Xz,Kz,Zz,Jz,Jb,Qz,eH,tH,Ch=_t(()=>{Te();Re();Ce();og();k_();Ju();L_={},BL=!1;P_={},FL=!1;M_={},UL=!1;B_={},jL=!1;F_={},$L=!1;U_={},WL=!1;j_={},zL=!1,Az=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;$_={},HL=!1,Sz=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;W_={},qL=!1;Nt={},GL=!1;z_={},VL=!1;Ot={},YL=!1,Sg=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;yt=Dz();yt.format;yt.deprecate;yt.debuglog;yt.inspect;yt.types;yt.isArray;yt.isBoolean;yt.isNull;yt.isNullOrUndefined;yt.isNumber;yt.isString;yt.isSymbol;yt.isUndefined;yt.isRegExp;yt.isObject;yt.isDate;yt.isError;yt.isFunction;yt.isPrimitive;yt.isBuffer;yt.log;yt.inherits;yt._extend;yt.promisify;yt.callbackify;Iz=yt._extend,Nz=yt.callbackify,Oz=yt.debuglog,kz=yt.deprecate,Lz=yt.format,Pz=yt.inherits,Mz=yt.inspect,Bz=yt.isArray,Fz=yt.isBoolean,Uz=yt.isBuffer,jz=yt.isDate,$z=yt.isError,Wz=yt.isFunction,zz=yt.isNull,Hz=yt.isNullOrUndefined,qz=yt.isNumber,Gz=yt.isObject,Vz=yt.isPrimitive,Yz=yt.isRegExp,Xz=yt.isString,Kz=yt.isSymbol,Zz=yt.isUndefined,Jz=yt.log,Jb=yt.promisify,Qz=yt.types,eH=yt.TextEncoder=globalThis.TextEncoder,tH=yt.TextDecoder=globalThis.TextDecoder});var Cg={};uo(Cg,{EventEmitter:()=>nH,default:()=>wo,defaultMaxListeners:()=>iH,init:()=>sH,listenerCount:()=>oH,on:()=>aH,once:()=>lH});function rH(){if(KL)return Qb;KL=!0;var r=typeof Reflect=="object"?Reflect:null,e=r&&typeof r.apply=="function"?r.apply:function(A,F,I){return Function.prototype.apply.call(A,F,I)},t;r&&typeof r.ownKeys=="function"?t=r.ownKeys:Object.getOwnPropertySymbols?t=function(A){return Object.getOwnPropertyNames(A).concat(Object.getOwnPropertySymbols(A))}:t=function(A){return Object.getOwnPropertyNames(A)};function n(S){console&&console.warn&&console.warn(S)}var i=Number.isNaN||function(A){return A!==A};function o(){o.init.call(this)}Qb=o,Qb.once=b,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(S){if(typeof S!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof S)}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(S){if(typeof S!="number"||S<0||i(S))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+S+".");s=S}}),o.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(A){if(typeof A!="number"||A<0||i(A))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+A+".");return this._maxListeners=A,this};function u(S){return S._maxListeners===void 0?o.defaultMaxListeners:S._maxListeners}o.prototype.getMaxListeners=function(){return u(this)},o.prototype.emit=function(A){for(var F=[],I=1;I<arguments.length;I++)F.push(arguments[I]);var q=A==="error",ee=this._events;if(ee!==void 0)q=q&&ee.error===void 0;else if(!q)return!1;if(q){var K;if(F.length>0&&(K=F[0]),K instanceof Error)throw K;var ne=new Error("Unhandled error."+(K?" ("+K.message+")":""));throw ne.context=K,ne}var L=ee[A];if(L===void 0)return!1;if(typeof L=="function")e(L,this,F);else for(var $=L.length,Y=y(L,$),I=0;I<$;++I)e(Y[I],this,F);return!0};function c(S,A,F,I){var q,ee,K;if(a(F),ee=S._events,ee===void 0?(ee=S._events=Object.create(null),S._eventsCount=0):(ee.newListener!==void 0&&(S.emit("newListener",A,F.listener?F.listener:F),ee=S._events),K=ee[A]),K===void 0)K=ee[A]=F,++S._eventsCount;else if(typeof K=="function"?K=ee[A]=I?[F,K]:[K,F]:I?K.unshift(F):K.push(F),q=u(S),q>0&&K.length>q&&!K.warned){K.warned=!0;var ne=new Error("Possible EventEmitter memory leak detected. "+K.length+" "+String(A)+" listeners added. Use emitter.setMaxListeners() to increase limit");ne.name="MaxListenersExceededWarning",ne.emitter=S,ne.type=A,ne.count=K.length,n(ne)}return S}o.prototype.addListener=function(A,F){return c(this,A,F,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(A,F){return c(this,A,F,!0)};function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(S,A,F){var I={fired:!1,wrapFn:void 0,target:S,type:A,listener:F},q=f.bind(I);return q.listener=F,I.wrapFn=q,q}o.prototype.once=function(A,F){return a(F),this.on(A,h(this,A,F)),this},o.prototype.prependOnceListener=function(A,F){return a(F),this.prependListener(A,h(this,A,F)),this},o.prototype.removeListener=function(A,F){var I,q,ee,K,ne;if(a(F),q=this._events,q===void 0)return this;if(I=q[A],I===void 0)return this;if(I===F||I.listener===F)--this._eventsCount===0?this._events=Object.create(null):(delete q[A],q.removeListener&&this.emit("removeListener",A,I.listener||F));else if(typeof I!="function"){for(ee=-1,K=I.length-1;K>=0;K--)if(I[K]===F||I[K].listener===F){ne=I[K].listener,ee=K;break}if(ee<0)return this;ee===0?I.shift():v(I,ee),I.length===1&&(q[A]=I[0]),q.removeListener!==void 0&&this.emit("removeListener",A,ne||F)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(A){var F,I,q;if(I=this._events,I===void 0)return this;if(I.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):I[A]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete I[A]),this;if(arguments.length===0){var ee=Object.keys(I),K;for(q=0;q<ee.length;++q)K=ee[q],K!=="removeListener"&&this.removeAllListeners(K);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(F=I[A],typeof F=="function")this.removeListener(A,F);else if(F!==void 0)for(q=F.length-1;q>=0;q--)this.removeListener(A,F[q]);return this};function d(S,A,F){var I=S._events;if(I===void 0)return[];var q=I[A];return q===void 0?[]:typeof q=="function"?F?[q.listener||q]:[q]:F?w(q):y(q,q.length)}o.prototype.listeners=function(A){return d(this,A,!0)},o.prototype.rawListeners=function(A){return d(this,A,!1)},o.listenerCount=function(S,A){return typeof S.listenerCount=="function"?S.listenerCount(A):m.call(S,A)},o.prototype.listenerCount=m;function m(S){var A=this._events;if(A!==void 0){var F=A[S];if(typeof F=="function")return 1;if(F!==void 0)return F.length}return 0}o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]};function y(S,A){for(var F=new Array(A),I=0;I<A;++I)F[I]=S[I];return F}function v(S,A){for(;A+1<S.length;A++)S[A]=S[A+1];S.pop()}function w(S){for(var A=new Array(S.length),F=0;F<A.length;++F)A[F]=S[F].listener||S[F];return A}function b(S,A){return new Promise(function(F,I){function q(K){S.removeListener(A,ee),I(K)}function ee(){typeof S.removeListener=="function"&&S.removeListener("error",q),F([].slice.call(arguments))}_(S,A,ee,{once:!0}),A!=="error"&&E(S,q,{once:!0})})}function E(S,A,F){typeof S.on=="function"&&_(S,"error",A,F)}function _(S,A,F,I){if(typeof S.on=="function")I.once?S.once(A,F):S.on(A,F);else if(typeof S.addEventListener=="function")S.addEventListener(A,function q(ee){I.once&&S.removeEventListener(A,q),F(ee)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof S)}return Qb}var Qb,KL,wo,nH,iH,sH,oH,aH,lH,Rh=_t(()=>{Te();Re();Ce();Qb={},KL=!1;wo=rH();wo.once;wo.once=function(r,e){return new Promise((t,n)=>{function i(...s){o!==void 0&&r.removeListener("error",o),t(s)}let o;e!=="error"&&(o=s=>{r.removeListener(name,i),n(s)},r.once("error",o)),r.once(e,i)})};wo.on=function(r,e){let t=[],n=[],i=null,o=!1,s={async next(){let c=t.shift();if(c)return createIterResult(c,!1);if(i){let f=Promise.reject(i);return i=null,f}return o?createIterResult(void 0,!0):new Promise((f,h)=>n.push({resolve:f,reject:h}))},async return(){r.removeListener(e,a),r.removeListener("error",u),o=!0;for(let c of n)c.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)},throw(c){i=c,r.removeListener(e,a),r.removeListener("error",u)},[Symbol.asyncIterator](){return this}};return r.on(e,a),r.on("error",u),s;function a(...c){let f=n.shift();f?f.resolve(createIterResult(c,!1)):t.push(c)}function u(c){o=!0;let f=n.shift();f?f.reject(c):i=c,s.return()}};({EventEmitter:nH,defaultMaxListeners:iH,init:sH,listenerCount:oH,on:aH,once:lH}=wo)});function uH(){if(ZL)return Rg;ZL=!0;var r=gn(),e=r.Buffer;function t(i,o){for(var s in i)o[s]=i[s]}e.from&&e.alloc&&e.allocUnsafe&&e.allocUnsafeSlow?Rg=r:(t(r,Rg),Rg.Buffer=n);function n(i,o,s){return e(i,o,s)}return n.prototype=Object.create(e.prototype),t(e,n),n.from=function(i,o,s){if(typeof i=="number")throw new TypeError("Argument must not be a number");return e(i,o,s)},n.alloc=function(i,o,s){if(typeof i!="number")throw new TypeError("Argument must be a number");var a=e(i);return o!==void 0?typeof s=="string"?a.fill(o,s):a.fill(o):a.fill(0),a},n.allocUnsafe=function(i){if(typeof i!="number")throw new TypeError("Argument must be a number");return e(i)},n.allocUnsafeSlow=function(i){if(typeof i!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(i)},Rg}function cH(){if(JL)return q_;JL=!0;var r=uH().Buffer,e=r.isEncoding||function(b){switch(b=""+b,b&&b.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 t(b){if(!b)return"utf8";for(var E;;)switch(b){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 b;default:if(E)return;b=(""+b).toLowerCase(),E=!0}}function n(b){var E=t(b);if(typeof E!="string"&&(r.isEncoding===e||!e(b)))throw new Error("Unknown encoding: "+b);return E||b}q_.StringDecoder=i;function i(b){this.encoding=n(b);var E;switch(this.encoding){case"utf16le":this.text=h,this.end=d,E=4;break;case"utf8":this.fillLast=u,E=4;break;case"base64":this.text=m,this.end=y,E=3;break;default:this.write=v,this.end=w;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(E)}i.prototype.write=function(b){if(b.length===0)return"";var E,_;if(this.lastNeed){if(E=this.fillLast(b),E===void 0)return"";_=this.lastNeed,this.lastNeed=0}else _=0;return _<b.length?E?E+this.text(b,_):this.text(b,_):E||""},i.prototype.end=f,i.prototype.text=c,i.prototype.fillLast=function(b){if(this.lastNeed<=b.length)return b.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);b.copy(this.lastChar,this.lastTotal-this.lastNeed,0,b.length),this.lastNeed-=b.length};function o(b){return b<=127?0:b>>5===6?2:b>>4===14?3:b>>3===30?4:b>>6===2?-1:-2}function s(b,E,_){var S=E.length-1;if(S<_)return 0;var A=o(E[S]);return A>=0?(A>0&&(b.lastNeed=A-1),A):--S<_||A===-2?0:(A=o(E[S]),A>=0?(A>0&&(b.lastNeed=A-2),A):--S<_||A===-2?0:(A=o(E[S]),A>=0?(A>0&&(A===2?A=0:b.lastNeed=A-3),A):0))}function a(b,E,_){if((E[0]&192)!==128)return b.lastNeed=0,"\uFFFD";if(b.lastNeed>1&&E.length>1){if((E[1]&192)!==128)return b.lastNeed=1,"\uFFFD";if(b.lastNeed>2&&E.length>2&&(E[2]&192)!==128)return b.lastNeed=2,"\uFFFD"}}function u(b){var E=this.lastTotal-this.lastNeed,_=a(this,b);if(_!==void 0)return _;if(this.lastNeed<=b.length)return b.copy(this.lastChar,E,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);b.copy(this.lastChar,E,0,b.length),this.lastNeed-=b.length}function c(b,E){var _=s(this,b,E);if(!this.lastNeed)return b.toString("utf8",E);this.lastTotal=_;var S=b.length-(_-this.lastNeed);return b.copy(this.lastChar,0,S),b.toString("utf8",E,S)}function f(b){var E=b&&b.length?this.write(b):"";return this.lastNeed?E+"\uFFFD":E}function h(b,E){if((b.length-E)%2===0){var _=b.toString("utf16le",E);if(_){var S=_.charCodeAt(_.length-1);if(S>=55296&&S<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=b[b.length-2],this.lastChar[1]=b[b.length-1],_.slice(0,-1)}return _}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=b[b.length-1],b.toString("utf16le",E,b.length-1)}function d(b){var E=b&&b.length?this.write(b):"";if(this.lastNeed){var _=this.lastTotal-this.lastNeed;return E+this.lastChar.toString("utf16le",0,_)}return E}function m(b,E){var _=(b.length-E)%3;return _===0?b.toString("base64",E):(this.lastNeed=3-_,this.lastTotal=3,_===1?this.lastChar[0]=b[b.length-1]:(this.lastChar[0]=b[b.length-2],this.lastChar[1]=b[b.length-1]),b.toString("base64",E,b.length-_))}function y(b){var E=b&&b.length?this.write(b):"";return this.lastNeed?E+this.lastChar.toString("base64",0,3-this.lastNeed):E}function v(b){return b.toString(this.encoding)}function w(b){return b&&b.length?this.write(b):""}return q_}var Rg,ZL,q_,JL,ew,VQ,QL=_t(()=>{Te();Re();Ce();Jf();Rg={},ZL=!1;q_={},JL=!1;ew=cH();ew.StringDecoder;VQ=ew.StringDecoder});var kg={};uo(kg,{Duplex:()=>mH,PassThrough:()=>bH,Readable:()=>fA,Stream:()=>EH,Transform:()=>yH,Writable:()=>gH,default:()=>dr,finished:()=>wH,pipeline:()=>vH,promises:()=>_H});function Lr(){return eP||(eP=!0,G_={ArrayIsArray(r){return Array.isArray(r)},ArrayPrototypeIncludes(r,e){return r.includes(e)},ArrayPrototypeIndexOf(r,e){return r.indexOf(e)},ArrayPrototypeJoin(r,e){return r.join(e)},ArrayPrototypeMap(r,e){return r.map(e)},ArrayPrototypePop(r,e){return r.pop(e)},ArrayPrototypePush(r,e){return r.push(e)},ArrayPrototypeSlice(r,e,t){return r.slice(e,t)},Error,FunctionPrototypeCall(r,e,...t){return r.call(e,...t)},FunctionPrototypeSymbolHasInstance(r,e){return Function.prototype[Symbol.hasInstance].call(r,e)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(r,e){return Object.defineProperties(r,e)},ObjectDefineProperty(r,e,t){return Object.defineProperty(r,e,t)},ObjectGetOwnPropertyDescriptor(r,e){return Object.getOwnPropertyDescriptor(r,e)},ObjectKeys(r){return Object.keys(r)},ObjectSetPrototypeOf(r,e){return Object.setPrototypeOf(r,e)},Promise,PromisePrototypeCatch(r,e){return r.catch(e)},PromisePrototypeThen(r,e,t){return r.then(e,t)},PromiseReject(r){return Promise.reject(r)},PromiseResolve(r){return Promise.resolve(r)},ReflectApply:Reflect.apply,RegExpPrototypeTest(r,e){return r.test(e)},SafeSet:Set,String,StringPrototypeSlice(r,e,t){return r.slice(e,t)},StringPrototypeToLowerCase(r){return r.toLowerCase()},StringPrototypeToUpperCase(r){return r.toUpperCase()},StringPrototypeTrim(r){return r.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(r,e,t){return r.set(e,t)},Boolean,Uint8Array}),G_}function Ng(){if(tP)return Dg;tP=!0;let{AbortController:r,AbortSignal:e}=typeof self<"u"?self:typeof window<"u"?window:void 0;return Dg=r,Dg.AbortSignal=e,Dg.default=r,Dg}function Zn(){if(rP)return tw;rP=!0;let r=gn(),{kResistStopPropagation:e,SymbolDispose:t}=Lr(),n=globalThis.AbortSignal||Ng().AbortSignal,i=globalThis.AbortController||Ng().AbortController,o=Object.getPrototypeOf(async function(){}).constructor,s=globalThis.Blob||r.Blob,a=typeof s<"u"?function(d){return d instanceof s}:function(d){return!1},u=(h,d)=>{if(h!==void 0&&(h===null||typeof h!="object"||!("aborted"in h)))throw new ERR_INVALID_ARG_TYPE(d,"AbortSignal",h)},c=(h,d)=>{if(typeof h!="function")throw new ERR_INVALID_ARG_TYPE(d,"Function",h)};class f extends Error{constructor(d){if(!Array.isArray(d))throw new TypeError(`Expected input to be an Array, got ${typeof d}`);let m="";for(let y=0;y<d.length;y++)m+=` ${d[y].stack}
|
|
93
|
-
`;super(m),this.name="AggregateError",this.errors=d}}return tw={AggregateError:f,kEmptyObject:Object.freeze({}),once(h){let d=!1;return function(...m){d||(d=!0,h.apply(this,m))}},createDeferredPromise:function(){let h,d;return{promise:new Promise((y,v)=>{h=y,d=v}),resolve:h,reject:d}},promisify(h){return new Promise((d,m)=>{h((y,...v)=>y?m(y):d(...v))})},debuglog(){return function(){}},format(h,...d){return h.replace(/%([sdifj])/g,function(...[m,y]){let v=d.shift();return y==="f"?v.toFixed(6):y==="j"?JSON.stringify(v):y==="s"&&typeof v=="object"?`${v.constructor!==Object?v.constructor.name:""} {}`.trim():v.toString()})},inspect(h){switch(typeof h){case"string":if(h.includes("'"))if(h.includes('"')){if(!h.includes("`")&&!h.includes("${"))return`\`${h}\``}else return`"${h}"`;return`'${h}'`;case"number":return isNaN(h)?"NaN":Object.is(h,-0)?String(h):h;case"bigint":return`${String(h)}n`;case"boolean":case"undefined":return String(h);case"object":return"{}"}},types:{isAsyncFunction(h){return h instanceof o},isArrayBufferView(h){return ArrayBuffer.isView(h)}},isBlob:a,deprecate(h,d){return h},addAbortListener:wo.addAbortListener||function(d,m){if(d===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",d);u(d,"signal"),c(m,"listener");let y;return d.aborted?queueMicrotask(()=>m()):(d.addEventListener("abort",m,{__proto__:null,once:!0,[e]:!0}),y=()=>{d.removeEventListener("abort",m)}),{__proto__:null,[t](){var v;(v=y)===null||v===void 0||v()}}},AbortSignalAny:n.any||function(d){if(d.length===1)return d[0];let m=new i,y=()=>m.abort();return d.forEach(v=>{u(v,"signals"),v.addEventListener("abort",y,{once:!0})}),m.signal.addEventListener("abort",()=>{d.forEach(v=>v.removeEventListener("abort",y))},{once:!0}),m.signal}},tw.promisify.custom=Symbol.for("nodejs.util.promisify.custom"),tw}function gi(){if(nP)return V_;nP=!0;let{format:r,inspect:e,AggregateError:t}=Zn(),n=globalThis.AggregateError||t,i=Symbol("kIsNodeError"),o=["string","function","number","object","Function","Object","boolean","bigint","symbol"],s=/^([A-Z][a-z0-9]*)+$/,a="__node_internal_",u={};function c(w,b){if(!w)throw new u.ERR_INTERNAL_ASSERTION(b)}function f(w){let b="",E=w.length,_=w[0]==="-"?1:0;for(;E>=_+4;E-=3)b=`_${w.slice(E-3,E)}${b}`;return`${w.slice(0,E)}${b}`}function h(w,b,E){if(typeof b=="function")return c(b.length<=E.length,`Code: ${w}; The provided arguments length (${E.length}) does not match the required ones (${b.length}).`),b(...E);let _=(b.match(/%[dfijoOs]/g)||[]).length;return c(_===E.length,`Code: ${w}; The provided arguments length (${E.length}) does not match the required ones (${_}).`),E.length===0?b:r(b,...E)}function d(w,b,E){E||(E=Error);class _ extends E{constructor(...A){super(h(w,b,A))}toString(){return`${this.name} [${w}]: ${this.message}`}}Object.defineProperties(_.prototype,{name:{value:E.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${w}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),_.prototype.code=w,_.prototype[i]=!0,u[w]=_}function m(w){let b=a+w.name;return Object.defineProperty(w,"name",{value:b}),w}function y(w,b){if(w&&b&&w!==b){if(Array.isArray(b.errors))return b.errors.push(w),b;let E=new n([b,w],b.message);return E.code=b.code,E}return w||b}class v extends Error{constructor(b="The operation was aborted",E=void 0){if(E!==void 0&&typeof E!="object")throw new u.ERR_INVALID_ARG_TYPE("options","Object",E);super(b,E),this.code="ABORT_ERR",this.name="AbortError"}}return d("ERR_ASSERTION","%s",Error),d("ERR_INVALID_ARG_TYPE",(w,b,E)=>{c(typeof w=="string","'name' must be a string"),Array.isArray(b)||(b=[b]);let _="The ";w.endsWith(" argument")?_+=`${w} `:_+=`"${w}" ${w.includes(".")?"property":"argument"} `,_+="must be ";let S=[],A=[],F=[];for(let q of b)c(typeof q=="string","All expected entries have to be of type string"),o.includes(q)?S.push(q.toLowerCase()):s.test(q)?A.push(q):(c(q!=="object",'The value "object" should be written as "Object"'),F.push(q));if(A.length>0){let q=S.indexOf("object");q!==-1&&(S.splice(S,q,1),A.push("Object"))}if(S.length>0){switch(S.length){case 1:_+=`of type ${S[0]}`;break;case 2:_+=`one of type ${S[0]} or ${S[1]}`;break;default:{let q=S.pop();_+=`one of type ${S.join(", ")}, or ${q}`}}(A.length>0||F.length>0)&&(_+=" or ")}if(A.length>0){switch(A.length){case 1:_+=`an instance of ${A[0]}`;break;case 2:_+=`an instance of ${A[0]} or ${A[1]}`;break;default:{let q=A.pop();_+=`an instance of ${A.join(", ")}, or ${q}`}}F.length>0&&(_+=" or ")}switch(F.length){case 0:break;case 1:F[0].toLowerCase()!==F[0]&&(_+="an "),_+=`${F[0]}`;break;case 2:_+=`one of ${F[0]} or ${F[1]}`;break;default:{let q=F.pop();_+=`one of ${F.join(", ")}, or ${q}`}}if(E==null)_+=`. Received ${E}`;else if(typeof E=="function"&&E.name)_+=`. Received function ${E.name}`;else if(typeof E=="object"){var I;if((I=E.constructor)!==null&&I!==void 0&&I.name)_+=`. Received an instance of ${E.constructor.name}`;else{let q=e(E,{depth:-1});_+=`. Received ${q}`}}else{let q=e(E,{colors:!1});q.length>25&&(q=`${q.slice(0,25)}...`),_+=`. Received type ${typeof E} (${q})`}return _},TypeError),d("ERR_INVALID_ARG_VALUE",(w,b,E="is invalid")=>{let _=e(b);return _.length>128&&(_=_.slice(0,128)+"..."),`The ${w.includes(".")?"property":"argument"} '${w}' ${E}. Received ${_}`},TypeError),d("ERR_INVALID_RETURN_VALUE",(w,b,E)=>{var _;let S=E!=null&&(_=E.constructor)!==null&&_!==void 0&&_.name?`instance of ${E.constructor.name}`:`type ${typeof E}`;return`Expected ${w} to be returned from the "${b}" function but got ${S}.`},TypeError),d("ERR_MISSING_ARGS",(...w)=>{c(w.length>0,"At least one arg needs to be specified");let b,E=w.length;switch(w=(Array.isArray(w)?w:[w]).map(_=>`"${_}"`).join(" or "),E){case 1:b+=`The ${w[0]} argument`;break;case 2:b+=`The ${w[0]} and ${w[1]} arguments`;break;default:{let _=w.pop();b+=`The ${w.join(", ")}, and ${_} arguments`}break}return`${b} must be specified`},TypeError),d("ERR_OUT_OF_RANGE",(w,b,E)=>{c(b,'Missing "range" argument');let _;return Number.isInteger(E)&&Math.abs(E)>2**32?_=f(String(E)):typeof E=="bigint"?(_=String(E),(E>2n**32n||E<-(2n**32n))&&(_=f(_)),_+="n"):_=e(E),`The value of "${w}" is out of range. It must be ${b}. Received ${_}`},RangeError),d("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),d("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),d("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),d("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),d("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),d("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),d("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),d("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),d("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),d("ERR_STREAM_WRITE_AFTER_END","write after end",Error),d("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),V_={AbortError:v,aggregateTwoErrors:m(y),hideStackFrames:m,codes:u},V_}function Og(){if(iP)return Y_;iP=!0;let{ArrayIsArray:r,ArrayPrototypeIncludes:e,ArrayPrototypeJoin:t,ArrayPrototypeMap:n,NumberIsInteger:i,NumberIsNaN:o,NumberMAX_SAFE_INTEGER:s,NumberMIN_SAFE_INTEGER:a,NumberParseInt:u,ObjectPrototypeHasOwnProperty:c,RegExpPrototypeExec:f,String:h,StringPrototypeToUpperCase:d,StringPrototypeTrim:m}=Lr(),{hideStackFrames:y,codes:{ERR_SOCKET_BAD_PORT:v,ERR_INVALID_ARG_TYPE:w,ERR_INVALID_ARG_VALUE:b,ERR_OUT_OF_RANGE:E,ERR_UNKNOWN_SIGNAL:_}}=gi(),{normalizeEncoding:S}=Zn(),{isAsyncFunction:A,isArrayBufferView:F}=Zn().types,I={};function q(Ae){return Ae===(Ae|0)}function ee(Ae){return Ae===Ae>>>0}let K=/^[0-7]+$/,ne="must be a 32-bit unsigned integer or an octal string";function L(Ae,$e,ke){if(typeof Ae>"u"&&(Ae=ke),typeof Ae=="string"){if(f(K,Ae)===null)throw new b($e,Ae,ne);Ae=u(Ae,8)}return ie(Ae,$e),Ae}let $=y((Ae,$e,ke=a,Ne=s)=>{if(typeof Ae!="number")throw new w($e,"number",Ae);if(!i(Ae))throw new E($e,"an integer",Ae);if(Ae<ke||Ae>Ne)throw new E($e,`>= ${ke} && <= ${Ne}`,Ae)}),Y=y((Ae,$e,ke=-2147483648,Ne=2147483647)=>{if(typeof Ae!="number")throw new w($e,"number",Ae);if(!i(Ae))throw new E($e,"an integer",Ae);if(Ae<ke||Ae>Ne)throw new E($e,`>= ${ke} && <= ${Ne}`,Ae)}),ie=y((Ae,$e,ke=!1)=>{if(typeof Ae!="number")throw new w($e,"number",Ae);if(!i(Ae))throw new E($e,"an integer",Ae);let Ne=ke?1:0,Ze=4294967295;if(Ae<Ne||Ae>Ze)throw new E($e,`>= ${Ne} && <= ${Ze}`,Ae)});function re(Ae,$e){if(typeof Ae!="string")throw new w($e,"string",Ae)}function k(Ae,$e,ke=void 0,Ne){if(typeof Ae!="number")throw new w($e,"number",Ae);if(ke!=null&&Ae<ke||Ne!=null&&Ae>Ne||(ke!=null||Ne!=null)&&o(Ae))throw new E($e,`${ke!=null?`>= ${ke}`:""}${ke!=null&&Ne!=null?" && ":""}${Ne!=null?`<= ${Ne}`:""}`,Ae)}let x=y((Ae,$e,ke)=>{if(!e(ke,Ae)){let Ze="must be one of: "+t(n(ke,tt=>typeof tt=="string"?`'${tt}'`:h(tt)),", ");throw new b($e,Ae,Ze)}});function P(Ae,$e){if(typeof Ae!="boolean")throw new w($e,"boolean",Ae)}function C(Ae,$e,ke){return Ae==null||!c(Ae,$e)?ke:Ae[$e]}let j=y((Ae,$e,ke=null)=>{let Ne=C(ke,"allowArray",!1),Ze=C(ke,"allowFunction",!1);if(!C(ke,"nullable",!1)&&Ae===null||!Ne&&r(Ae)||typeof Ae!="object"&&(!Ze||typeof Ae!="function"))throw new w($e,"Object",Ae)}),U=y((Ae,$e)=>{if(Ae!=null&&typeof Ae!="object"&&typeof Ae!="function")throw new w($e,"a dictionary",Ae)}),B=y((Ae,$e,ke=0)=>{if(!r(Ae))throw new w($e,"Array",Ae);if(Ae.length<ke){let Ne=`must be longer than ${ke}`;throw new b($e,Ae,Ne)}});function Q(Ae,$e){B(Ae,$e);for(let ke=0;ke<Ae.length;ke++)re(Ae[ke],`${$e}[${ke}]`)}function fe(Ae,$e){B(Ae,$e);for(let ke=0;ke<Ae.length;ke++)P(Ae[ke],`${$e}[${ke}]`)}function Ee(Ae,$e){B(Ae,$e);for(let ke=0;ke<Ae.length;ke++){let Ne=Ae[ke],Ze=`${$e}[${ke}]`;if(Ne==null)throw new w(Ze,"AbortSignal",Ne);xe(Ne,Ze)}}function te(Ae,$e="signal"){if(re(Ae,$e),I[Ae]===void 0)throw I[d(Ae)]!==void 0?new _(Ae+" (signals must use all capital letters)"):new _(Ae)}let H=y((Ae,$e="buffer")=>{if(!F(Ae))throw new w($e,["Buffer","TypedArray","DataView"],Ae)});function ae(Ae,$e){let ke=S($e),Ne=Ae.length;if(ke==="hex"&&Ne%2!==0)throw new b("encoding",$e,`is invalid for data of length ${Ne}`)}function we(Ae,$e="Port",ke=!0){if(typeof Ae!="number"&&typeof Ae!="string"||typeof Ae=="string"&&m(Ae).length===0||+Ae!==+Ae>>>0||Ae>65535||Ae===0&&!ke)throw new v($e,Ae,ke);return Ae|0}let xe=y((Ae,$e)=>{if(Ae!==void 0&&(Ae===null||typeof Ae!="object"||!("aborted"in Ae)))throw new w($e,"AbortSignal",Ae)}),V=y((Ae,$e)=>{if(typeof Ae!="function")throw new w($e,"Function",Ae)}),M=y((Ae,$e)=>{if(typeof Ae!="function"||A(Ae))throw new w($e,"Function",Ae)}),oe=y((Ae,$e)=>{if(Ae!==void 0)throw new w($e,"undefined",Ae)});function ge(Ae,$e,ke){if(!e(ke,Ae))throw new w($e,`('${t(ke,"|")}')`,Ae)}let Se=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function be(Ae,$e){if(typeof Ae>"u"||!f(Se,Ae))throw new b($e,Ae,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function pe(Ae){if(typeof Ae=="string")return be(Ae,"hints"),Ae;if(r(Ae)){let $e=Ae.length,ke="";if($e===0)return ke;for(let Ne=0;Ne<$e;Ne++){let Ze=Ae[Ne];be(Ze,"hints"),ke+=Ze,Ne!==$e-1&&(ke+=", ")}return ke}throw new b("hints",Ae,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}return Y_={isInt32:q,isUint32:ee,parseFileMode:L,validateArray:B,validateStringArray:Q,validateBooleanArray:fe,validateAbortSignalArray:Ee,validateBoolean:P,validateBuffer:H,validateDictionary:U,validateEncoding:ae,validateFunction:V,validateInt32:Y,validateInteger:$,validateNumber:k,validateObject:j,validateOneOf:x,validatePlainFunction:M,validatePort:we,validateSignalName:te,validateString:re,validateUint32:ie,validateUndefined:oe,validateUnion:ge,validateAbortSignal:xe,validateLinkHeaderValue:pe},Y_}function ba(){if(sP)return X_;sP=!0;let{SymbolAsyncIterator:r,SymbolIterator:e,SymbolFor:t}=Lr(),n=t("nodejs.stream.destroyed"),i=t("nodejs.stream.errored"),o=t("nodejs.stream.readable"),s=t("nodejs.stream.writable"),a=t("nodejs.stream.disturbed"),u=t("nodejs.webstream.isClosedPromise"),c=t("nodejs.webstream.controllerErrorFunction");function f(C,j=!1){var U;return!!(C&&typeof C.pipe=="function"&&typeof C.on=="function"&&(!j||typeof C.pause=="function"&&typeof C.resume=="function")&&(!C._writableState||((U=C._readableState)===null||U===void 0?void 0:U.readable)!==!1)&&(!C._writableState||C._readableState))}function h(C){var j;return!!(C&&typeof C.write=="function"&&typeof C.on=="function"&&(!C._readableState||((j=C._writableState)===null||j===void 0?void 0:j.writable)!==!1))}function d(C){return!!(C&&typeof C.pipe=="function"&&C._readableState&&typeof C.on=="function"&&typeof C.write=="function")}function m(C){return C&&(C._readableState||C._writableState||typeof C.write=="function"&&typeof C.on=="function"||typeof C.pipe=="function"&&typeof C.on=="function")}function y(C){return!!(C&&!m(C)&&typeof C.pipeThrough=="function"&&typeof C.getReader=="function"&&typeof C.cancel=="function")}function v(C){return!!(C&&!m(C)&&typeof C.getWriter=="function"&&typeof C.abort=="function")}function w(C){return!!(C&&!m(C)&&typeof C.readable=="object"&&typeof C.writable=="object")}function b(C){return y(C)||v(C)||w(C)}function E(C,j){return C==null?!1:j===!0?typeof C[r]=="function":j===!1?typeof C[e]=="function":typeof C[r]=="function"||typeof C[e]=="function"}function _(C){if(!m(C))return null;let j=C._writableState,U=C._readableState,B=j||U;return!!(C.destroyed||C[n]||B!=null&&B.destroyed)}function S(C){if(!h(C))return null;if(C.writableEnded===!0)return!0;let j=C._writableState;return j!=null&&j.errored?!1:typeof j?.ended!="boolean"?null:j.ended}function A(C,j){if(!h(C))return null;if(C.writableFinished===!0)return!0;let U=C._writableState;return U!=null&&U.errored?!1:typeof U?.finished!="boolean"?null:!!(U.finished||j===!1&&U.ended===!0&&U.length===0)}function F(C){if(!f(C))return null;if(C.readableEnded===!0)return!0;let j=C._readableState;return!j||j.errored?!1:typeof j?.ended!="boolean"?null:j.ended}function I(C,j){if(!f(C))return null;let U=C._readableState;return U!=null&&U.errored?!1:typeof U?.endEmitted!="boolean"?null:!!(U.endEmitted||j===!1&&U.ended===!0&&U.length===0)}function q(C){return C&&C[o]!=null?C[o]:typeof C?.readable!="boolean"?null:_(C)?!1:f(C)&&C.readable&&!I(C)}function ee(C){return C&&C[s]!=null?C[s]:typeof C?.writable!="boolean"?null:_(C)?!1:h(C)&&C.writable&&!S(C)}function K(C,j){return m(C)?_(C)?!0:!(j?.readable!==!1&&q(C)||j?.writable!==!1&&ee(C)):null}function ne(C){var j,U;return m(C)?C.writableErrored?C.writableErrored:(j=(U=C._writableState)===null||U===void 0?void 0:U.errored)!==null&&j!==void 0?j:null:null}function L(C){var j,U;return m(C)?C.readableErrored?C.readableErrored:(j=(U=C._readableState)===null||U===void 0?void 0:U.errored)!==null&&j!==void 0?j:null:null}function $(C){if(!m(C))return null;if(typeof C.closed=="boolean")return C.closed;let j=C._writableState,U=C._readableState;return typeof j?.closed=="boolean"||typeof U?.closed=="boolean"?j?.closed||U?.closed:typeof C._closed=="boolean"&&Y(C)?C._closed:null}function Y(C){return typeof C._closed=="boolean"&&typeof C._defaultKeepAlive=="boolean"&&typeof C._removedConnection=="boolean"&&typeof C._removedContLen=="boolean"}function ie(C){return typeof C._sent100=="boolean"&&Y(C)}function re(C){var j;return typeof C._consuming=="boolean"&&typeof C._dumped=="boolean"&&((j=C.req)===null||j===void 0?void 0:j.upgradeOrConnect)===void 0}function k(C){if(!m(C))return null;let j=C._writableState,U=C._readableState,B=j||U;return!B&&ie(C)||!!(B&&B.autoDestroy&&B.emitClose&&B.closed===!1)}function x(C){var j;return!!(C&&((j=C[a])!==null&&j!==void 0?j:C.readableDidRead||C.readableAborted))}function P(C){var j,U,B,Q,fe,Ee,te,H,ae,we;return!!(C&&((j=(U=(B=(Q=(fe=(Ee=C[i])!==null&&Ee!==void 0?Ee:C.readableErrored)!==null&&fe!==void 0?fe:C.writableErrored)!==null&&Q!==void 0?Q:(te=C._readableState)===null||te===void 0?void 0:te.errorEmitted)!==null&&B!==void 0?B:(H=C._writableState)===null||H===void 0?void 0:H.errorEmitted)!==null&&U!==void 0?U:(ae=C._readableState)===null||ae===void 0?void 0:ae.errored)!==null&&j!==void 0?j:!((we=C._writableState)===null||we===void 0)&&we.errored))}return X_={isDestroyed:_,kIsDestroyed:n,isDisturbed:x,kIsDisturbed:a,isErrored:P,kIsErrored:i,isReadable:q,kIsReadable:o,kIsClosedPromise:u,kControllerErrorFunction:c,kIsWritable:s,isClosed:$,isDuplexNodeStream:d,isFinished:K,isIterable:E,isReadableNodeStream:f,isReadableStream:y,isReadableEnded:F,isReadableFinished:I,isReadableErrored:L,isNodeStream:m,isWebStream:b,isWritable:ee,isWritableNodeStream:h,isWritableStream:v,isWritableEnded:S,isWritableFinished:A,isWritableErrored:ne,isServerRequest:re,isServerResponse:ie,willEmitClose:k,isTransformStream:w},X_}function Nl(){if(oP)return rw;oP=!0;let r=qr,{AbortError:e,codes:t}=gi(),{ERR_INVALID_ARG_TYPE:n,ERR_STREAM_PREMATURE_CLOSE:i}=t,{kEmptyObject:o,once:s}=Zn(),{validateAbortSignal:a,validateFunction:u,validateObject:c,validateBoolean:f}=Og(),{Promise:h,PromisePrototypeThen:d,SymbolDispose:m}=Lr(),{isClosed:y,isReadable:v,isReadableNodeStream:w,isReadableStream:b,isReadableFinished:E,isReadableErrored:_,isWritable:S,isWritableNodeStream:A,isWritableStream:F,isWritableFinished:I,isWritableErrored:q,isNodeStream:ee,willEmitClose:K,kIsClosedPromise:ne}=ba(),L;function $(x){return x.setHeader&&typeof x.abort=="function"}let Y=()=>{};function ie(x,P,C){var j,U;if(arguments.length===2?(C=P,P=o):P==null?P=o:c(P,"options"),u(C,"callback"),a(P.signal,"options.signal"),C=s(C),b(x)||F(x))return re(x,P,C);if(!ee(x))throw new n("stream",["ReadableStream","WritableStream","Stream"],x);let B=(j=P.readable)!==null&&j!==void 0?j:w(x),Q=(U=P.writable)!==null&&U!==void 0?U:A(x),fe=x._writableState,Ee=x._readableState,te=()=>{x.writable||we()},H=K(x)&&w(x)===B&&A(x)===Q,ae=I(x,!1),we=()=>{ae=!0,x.destroyed&&(H=!1),!(H&&(!x.readable||B))&&(!B||xe)&&C.call(x)},xe=E(x,!1),V=()=>{xe=!0,x.destroyed&&(H=!1),!(H&&(!x.writable||Q))&&(!Q||ae)&&C.call(x)},M=Ae=>{C.call(x,Ae)},oe=y(x),ge=()=>{oe=!0;let Ae=q(x)||_(x);if(Ae&&typeof Ae!="boolean")return C.call(x,Ae);if(B&&!xe&&w(x,!0)&&!E(x,!1))return C.call(x,new i);if(Q&&!ae&&!I(x,!1))return C.call(x,new i);C.call(x)},Se=()=>{oe=!0;let Ae=q(x)||_(x);if(Ae&&typeof Ae!="boolean")return C.call(x,Ae);C.call(x)},be=()=>{x.req.on("finish",we)};$(x)?(x.on("complete",we),H||x.on("abort",ge),x.req?be():x.on("request",be)):Q&&!fe&&(x.on("end",te),x.on("close",te)),!H&&typeof x.aborted=="boolean"&&x.on("aborted",ge),x.on("end",V),x.on("finish",we),P.error!==!1&&x.on("error",M),x.on("close",ge),oe?r.nextTick(ge):fe!=null&&fe.errorEmitted||Ee!=null&&Ee.errorEmitted?H||r.nextTick(Se):(!B&&(!H||v(x))&&(ae||S(x)===!1)||!Q&&(!H||S(x))&&(xe||v(x)===!1)||Ee&&x.req&&x.aborted)&&r.nextTick(Se);let pe=()=>{C=Y,x.removeListener("aborted",ge),x.removeListener("complete",we),x.removeListener("abort",ge),x.removeListener("request",be),x.req&&x.req.removeListener("finish",we),x.removeListener("end",te),x.removeListener("close",te),x.removeListener("finish",we),x.removeListener("end",V),x.removeListener("error",M),x.removeListener("close",ge)};if(P.signal&&!oe){let Ae=()=>{let $e=C;pe(),$e.call(x,new e(void 0,{cause:P.signal.reason}))};if(P.signal.aborted)r.nextTick(Ae);else{L=L||Zn().addAbortListener;let $e=L(P.signal,Ae),ke=C;C=s((...Ne)=>{$e[m](),ke.apply(x,Ne)})}}return pe}function re(x,P,C){let j=!1,U=Y;if(P.signal)if(U=()=>{j=!0,C.call(x,new e(void 0,{cause:P.signal.reason}))},P.signal.aborted)r.nextTick(U);else{L=L||Zn().addAbortListener;let Q=L(P.signal,U),fe=C;C=s((...Ee)=>{Q[m](),fe.apply(x,Ee)})}let B=(...Q)=>{j||r.nextTick(()=>C.apply(x,Q))};return d(x[ne].promise,B,B),Y}function k(x,P){var C;let j=!1;return P===null&&(P=o),(C=P)!==null&&C!==void 0&&C.cleanup&&(f(P.cleanup,"cleanup"),j=P.cleanup),new h((U,B)=>{let Q=ie(x,P,fe=>{j&&Q(),fe?B(fe):U()})})}return rw=ie,rw.finished=k,rw}function Dh(){if(aP)return K_;aP=!0;let r=qr,{aggregateTwoErrors:e,codes:{ERR_MULTIPLE_CALLBACK:t},AbortError:n}=gi(),{Symbol:i}=Lr(),{kIsDestroyed:o,isDestroyed:s,isFinished:a,isServerRequest:u}=ba(),c=i("kDestroy"),f=i("kConstruct");function h(K,ne,L){K&&(K.stack,ne&&!ne.errored&&(ne.errored=K),L&&!L.errored&&(L.errored=K))}function d(K,ne){let L=this._readableState,$=this._writableState,Y=$||L;return $!=null&&$.destroyed||L!=null&&L.destroyed?(typeof ne=="function"&&ne(),this):(h(K,$,L),$&&($.destroyed=!0),L&&(L.destroyed=!0),Y.constructed?m(this,K,ne):this.once(c,function(ie){m(this,e(ie,K),ne)}),this)}function m(K,ne,L){let $=!1;function Y(ie){if($)return;$=!0;let re=K._readableState,k=K._writableState;h(ie,k,re),k&&(k.closed=!0),re&&(re.closed=!0),typeof L=="function"&&L(ie),ie?r.nextTick(y,K,ie):r.nextTick(v,K)}try{K._destroy(ne||null,Y)}catch(ie){Y(ie)}}function y(K,ne){w(K,ne),v(K)}function v(K){let ne=K._readableState,L=K._writableState;L&&(L.closeEmitted=!0),ne&&(ne.closeEmitted=!0),(L!=null&&L.emitClose||ne!=null&&ne.emitClose)&&K.emit("close")}function w(K,ne){let L=K._readableState,$=K._writableState;$!=null&&$.errorEmitted||L!=null&&L.errorEmitted||($&&($.errorEmitted=!0),L&&(L.errorEmitted=!0),K.emit("error",ne))}function b(){let K=this._readableState,ne=this._writableState;K&&(K.constructed=!0,K.closed=!1,K.closeEmitted=!1,K.destroyed=!1,K.errored=null,K.errorEmitted=!1,K.reading=!1,K.ended=K.readable===!1,K.endEmitted=K.readable===!1),ne&&(ne.constructed=!0,ne.destroyed=!1,ne.closed=!1,ne.closeEmitted=!1,ne.errored=null,ne.errorEmitted=!1,ne.finalCalled=!1,ne.prefinished=!1,ne.ended=ne.writable===!1,ne.ending=ne.writable===!1,ne.finished=ne.writable===!1)}function E(K,ne,L){let $=K._readableState,Y=K._writableState;if(Y!=null&&Y.destroyed||$!=null&&$.destroyed)return this;$!=null&&$.autoDestroy||Y!=null&&Y.autoDestroy?K.destroy(ne):ne&&(ne.stack,Y&&!Y.errored&&(Y.errored=ne),$&&!$.errored&&($.errored=ne),L?r.nextTick(w,K,ne):w(K,ne))}function _(K,ne){if(typeof K._construct!="function")return;let L=K._readableState,$=K._writableState;L&&(L.constructed=!1),$&&($.constructed=!1),K.once(f,ne),!(K.listenerCount(f)>1)&&r.nextTick(S,K)}function S(K){let ne=!1;function L($){if(ne){E(K,$??new t);return}ne=!0;let Y=K._readableState,ie=K._writableState,re=ie||Y;Y&&(Y.constructed=!0),ie&&(ie.constructed=!0),re.destroyed?K.emit(c,$):$?E(K,$,!0):r.nextTick(A,K)}try{K._construct($=>{r.nextTick(L,$)})}catch($){r.nextTick(L,$)}}function A(K){K.emit(f)}function F(K){return K?.setHeader&&typeof K.abort=="function"}function I(K){K.emit("close")}function q(K,ne){K.emit("error",ne),r.nextTick(I,K)}function ee(K,ne){!K||s(K)||(!ne&&!a(K)&&(ne=new n),u(K)?(K.socket=null,K.destroy(ne)):F(K)?K.abort():F(K.req)?K.req.abort():typeof K.destroy=="function"?K.destroy(ne):typeof K.close=="function"?K.close():ne?r.nextTick(q,K,ne):r.nextTick(I,K),K.destroyed||(K[o]=!0))}return K_={construct:_,destroyer:ee,destroy:d,undestroy:b,errorOrDestroy:E},K_}function hA(){if(lP)return Z_;lP=!0;let{ArrayIsArray:r,ObjectSetPrototypeOf:e}=Lr(),{EventEmitter:t}=wo;function n(o){t.call(this,o)}e(n.prototype,t.prototype),e(n,t),n.prototype.pipe=function(o,s){let a=this;function u(v){o.writable&&o.write(v)===!1&&a.pause&&a.pause()}a.on("data",u);function c(){a.readable&&a.resume&&a.resume()}o.on("drain",c),!o._isStdio&&(!s||s.end!==!1)&&(a.on("end",h),a.on("close",d));let f=!1;function h(){f||(f=!0,o.end())}function d(){f||(f=!0,typeof o.destroy=="function"&&o.destroy())}function m(v){y(),t.listenerCount(this,"error")===0&&this.emit("error",v)}i(a,"error",m),i(o,"error",m);function y(){a.removeListener("data",u),o.removeListener("drain",c),a.removeListener("end",h),a.removeListener("close",d),a.removeListener("error",m),o.removeListener("error",m),a.removeListener("end",y),a.removeListener("close",y),o.removeListener("close",y)}return a.on("end",y),a.on("close",y),o.on("close",y),o.emit("pipe",a),o};function i(o,s,a){if(typeof o.prependListener=="function")return o.prependListener(s,a);!o._events||!o._events[s]?o.on(s,a):r(o._events[s])?o._events[s].unshift(a):o._events[s]=[a,o._events[s]]}return Z_={Stream:n,prependListener:i},Z_}function iw(){if(uP)return Ig;uP=!0;let{SymbolDispose:r}=Lr(),{AbortError:e,codes:t}=gi(),{isNodeStream:n,isWebStream:i,kControllerErrorFunction:o}=ba(),s=Nl(),{ERR_INVALID_ARG_TYPE:a}=t,u,c=(f,h)=>{if(typeof f!="object"||!("aborted"in f))throw new a(h,"AbortSignal",f)};return Ig.addAbortSignal=function(h,d){if(c(h,"signal"),!n(d)&&!i(d))throw new a("stream",["ReadableStream","WritableStream","Stream"],d);return Ig.addAbortSignalNoValidate(h,d)},Ig.addAbortSignalNoValidate=function(f,h){if(typeof f!="object"||!("aborted"in f))return h;let d=n(h)?()=>{h.destroy(new e(void 0,{cause:f.reason}))}:()=>{h[o](new e(void 0,{cause:f.reason}))};if(f.aborted)d();else{u=u||Zn().addAbortListener;let m=u(f,d);s(h,m[r])}return h},Ig}function fH(){if(cP)return J_;cP=!0;let{StringPrototypeSlice:r,SymbolIterator:e,TypedArrayPrototypeSet:t,Uint8Array:n}=Lr(),{Buffer:i}=gn(),{inspect:o}=Zn();return J_=class{constructor(){this.head=null,this.tail=null,this.length=0}push(a){let u={data:a,next:null};this.length>0?this.tail.next=u:this.head=u,this.tail=u,++this.length}unshift(a){let u={data:a,next:this.head};this.length===0&&(this.tail=u),this.head=u,++this.length}shift(){if(this.length===0)return;let a=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,a}clear(){this.head=this.tail=null,this.length=0}join(a){if(this.length===0)return"";let u=this.head,c=""+u.data;for(;(u=u.next)!==null;)c+=a+u.data;return c}concat(a){if(this.length===0)return i.alloc(0);let u=i.allocUnsafe(a>>>0),c=this.head,f=0;for(;c;)t(u,c.data,f),f+=c.data.length,c=c.next;return u}consume(a,u){let c=this.head.data;if(a<c.length){let f=c.slice(0,a);return this.head.data=c.slice(a),f}return a===c.length?this.shift():u?this._getString(a):this._getBuffer(a)}first(){return this.head.data}*[e](){for(let a=this.head;a;a=a.next)yield a.data}_getString(a){let u="",c=this.head,f=0;do{let h=c.data;if(a>h.length)u+=h,a-=h.length;else{a===h.length?(u+=h,++f,c.next?this.head=c.next:this.head=this.tail=null):(u+=r(h,0,a),this.head=c,c.data=r(h,a));break}++f}while((c=c.next)!==null);return this.length-=f,u}_getBuffer(a){let u=i.allocUnsafe(a),c=a,f=this.head,h=0;do{let d=f.data;if(a>d.length)t(u,d,c-a),a-=d.length;else{a===d.length?(t(u,d,c-a),++h,f.next?this.head=f.next:this.head=this.tail=null):(t(u,new n(d.buffer,d.byteOffset,a),c-a),this.head=f,f.data=d.slice(a));break}++h}while((f=f.next)!==null);return this.length-=h,u}[Symbol.for("nodejs.util.inspect.custom")](a,u){return o(this,{...u,depth:0,customInspect:!1})}},J_}function sw(){if(fP)return Q_;fP=!0;let{MathFloor:r,NumberIsInteger:e}=Lr(),{validateInteger:t}=Og(),{ERR_INVALID_ARG_VALUE:n}=gi().codes,i=16*1024,o=16;function s(f,h,d){return f.highWaterMark!=null?f.highWaterMark:h?f[d]:null}function a(f){return f?o:i}function u(f,h){t(h,"value",0),f?o=h:i=h}function c(f,h,d,m){let y=s(h,m,d);if(y!=null){if(!e(y)||y<0){let v=m?`options.${d}`:"options.highWaterMark";throw new n(v,y)}return r(y)}return a(f.objectMode)}return Q_={getHighWaterMark:c,getDefaultHighWaterMark:a,setDefaultHighWaterMark:u},Q_}function TP(){if(hP)return eA;hP=!0;let r=qr,{PromisePrototypeThen:e,SymbolAsyncIterator:t,SymbolIterator:n}=Lr(),{Buffer:i}=gn(),{ERR_INVALID_ARG_TYPE:o,ERR_STREAM_NULL_VALUES:s}=gi().codes;function a(u,c,f){let h;if(typeof c=="string"||c instanceof i)return new u({objectMode:!0,...f,read(){this.push(c),this.push(null)}});let d;if(c&&c[t])d=!0,h=c[t]();else if(c&&c[n])d=!1,h=c[n]();else throw new o("iterable",["Iterable"],c);let m=new u({objectMode:!0,highWaterMark:1,...f}),y=!1;m._read=function(){y||(y=!0,w())},m._destroy=function(b,E){e(v(b),()=>r.nextTick(E,b),_=>r.nextTick(E,_||b))};async function v(b){let E=b!=null,_=typeof h.throw=="function";if(E&&_){let{value:S,done:A}=await h.throw(b);if(await S,A)return}if(typeof h.return=="function"){let{value:S}=await h.return();await S}}async function w(){for(;;){try{let{value:b,done:E}=d?await h.next():h.next();if(E)m.push(null);else{let _=b&&typeof b.then=="function"?await b:b;if(_===null)throw y=!1,new s;if(m.push(_))continue;y=!1}}catch(b){m.destroy(b)}break}}return m}return eA=a,eA}function ow(){if(dP)return tA;dP=!0;let r=qr,{ArrayPrototypeIndexOf:e,NumberIsInteger:t,NumberIsNaN:n,NumberParseInt:i,ObjectDefineProperties:o,ObjectKeys:s,ObjectSetPrototypeOf:a,Promise:u,SafeSet:c,SymbolAsyncDispose:f,SymbolAsyncIterator:h,Symbol:d}=Lr();tA=Ne,Ne.ReadableState=ke;let{EventEmitter:m}=wo,{Stream:y,prependListener:v}=hA(),{Buffer:w}=gn(),{addAbortSignal:b}=iw(),E=Nl(),_=Zn().debuglog("stream",ue=>{_=ue}),S=fH(),A=Dh(),{getHighWaterMark:F,getDefaultHighWaterMark:I}=sw(),{aggregateTwoErrors:q,codes:{ERR_INVALID_ARG_TYPE:ee,ERR_METHOD_NOT_IMPLEMENTED:K,ERR_OUT_OF_RANGE:ne,ERR_STREAM_PUSH_AFTER_EOF:L,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:$},AbortError:Y}=gi(),{validateObject:ie}=Og(),re=d("kPaused"),{StringDecoder:k}=ew,x=TP();a(Ne.prototype,y.prototype),a(Ne,y);let P=()=>{},{errorOrDestroy:C}=A,j=1,U=2,B=4,Q=8,fe=16,Ee=32,te=64,H=128,ae=256,we=512,xe=1024,V=2048,M=4096,oe=8192,ge=16384,Se=32768,be=65536,pe=1<<17,Ae=1<<18;function $e(ue){return{enumerable:!1,get(){return((this||Ve).state&ue)!==0},set(me){me?(this||Ve).state|=ue:(this||Ve).state&=~ue}}}o(ke.prototype,{objectMode:$e(j),ended:$e(U),endEmitted:$e(B),reading:$e(Q),constructed:$e(fe),sync:$e(Ee),needReadable:$e(te),emittedReadable:$e(H),readableListening:$e(ae),resumeScheduled:$e(we),errorEmitted:$e(xe),emitClose:$e(V),autoDestroy:$e(M),destroyed:$e(oe),closed:$e(ge),closeEmitted:$e(Se),multiAwaitDrain:$e(be),readingMore:$e(pe),dataEmitted:$e(Ae)});function ke(ue,me,Ge){typeof Ge!="boolean"&&(Ge=me instanceof ya()),(this||Ve).state=V|M|fe|Ee,ue&&ue.objectMode&&((this||Ve).state|=j),Ge&&ue&&ue.readableObjectMode&&((this||Ve).state|=j),(this||Ve).highWaterMark=ue?F(this||Ve,ue,"readableHighWaterMark",Ge):I(!1),(this||Ve).buffer=new S,(this||Ve).length=0,(this||Ve).pipes=[],(this||Ve).flowing=null,(this||Ve)[re]=null,ue&&ue.emitClose===!1&&((this||Ve).state&=~V),ue&&ue.autoDestroy===!1&&((this||Ve).state&=~M),(this||Ve).errored=null,(this||Ve).defaultEncoding=ue&&ue.defaultEncoding||"utf8",(this||Ve).awaitDrainWriters=null,(this||Ve).decoder=null,(this||Ve).encoding=null,ue&&ue.encoding&&((this||Ve).decoder=new k(ue.encoding),(this||Ve).encoding=ue.encoding)}function Ne(ue){if(!((this||Ve)instanceof Ne))return new Ne(ue);let me=(this||Ve)instanceof ya();(this||Ve)._readableState=new ke(ue,this||Ve,me),ue&&(typeof ue.read=="function"&&((this||Ve)._read=ue.read),typeof ue.destroy=="function"&&((this||Ve)._destroy=ue.destroy),typeof ue.construct=="function"&&((this||Ve)._construct=ue.construct),ue.signal&&!me&&b(ue.signal,this||Ve)),y.call(this||Ve,ue),A.construct(this||Ve,()=>{(this||Ve)._readableState.needReadable&&D(this||Ve,(this||Ve)._readableState)})}Ne.prototype.destroy=A.destroy,Ne.prototype._undestroy=A.undestroy,Ne.prototype._destroy=function(ue,me){me(ue)},Ne.prototype[m.captureRejectionSymbol]=function(ue){this.destroy(ue)},Ne.prototype[f]=function(){let ue;return(this||Ve).destroyed||(ue=(this||Ve).readableEnded?null:new Y,this.destroy(ue)),new u((me,Ge)=>E(this||Ve,Ue=>Ue&&Ue!==ue?Ge(Ue):me(null)))},Ne.prototype.push=function(ue,me){return Ze(this||Ve,ue,me,!1)},Ne.prototype.unshift=function(ue,me){return Ze(this||Ve,ue,me,!0)};function Ze(ue,me,Ge,Ue){_("readableAddChunk",me);let et=ue._readableState,pt;if((et.state&j)===0&&(typeof me=="string"?(Ge=Ge||et.defaultEncoding,et.encoding!==Ge&&(Ue&&et.encoding?me=w.from(me,Ge).toString(et.encoding):(me=w.from(me,Ge),Ge=""))):me instanceof w?Ge="":y._isUint8Array(me)?(me=y._uint8ArrayToBuffer(me),Ge=""):me!=null&&(pt=new ee("chunk",["string","Buffer","Uint8Array"],me))),pt)C(ue,pt);else if(me===null)et.state&=~Q,p(ue,et);else if((et.state&j)!==0||me&&me.length>0)if(Ue)if((et.state&B)!==0)C(ue,new $);else{if(et.destroyed||et.errored)return!1;tt(ue,et,me,!0)}else if(et.ended)C(ue,new L);else{if(et.destroyed||et.errored)return!1;et.state&=~Q,et.decoder&&!Ge?(me=et.decoder.write(me),et.objectMode||me.length!==0?tt(ue,et,me,!1):D(ue,et)):tt(ue,et,me,!1)}else Ue||(et.state&=~Q,D(ue,et));return!et.ended&&(et.length<et.highWaterMark||et.length===0)}function tt(ue,me,Ge,Ue){me.flowing&&me.length===0&&!me.sync&&ue.listenerCount("data")>0?((me.state&be)!==0?me.awaitDrainWriters.clear():me.awaitDrainWriters=null,me.dataEmitted=!0,ue.emit("data",Ge)):(me.length+=me.objectMode?1:Ge.length,Ue?me.buffer.unshift(Ge):me.buffer.push(Ge),(me.state&te)!==0&&R(ue)),D(ue,me)}Ne.prototype.isPaused=function(){let ue=(this||Ve)._readableState;return ue[re]===!0||ue.flowing===!1},Ne.prototype.setEncoding=function(ue){let me=new k(ue);(this||Ve)._readableState.decoder=me,(this||Ve)._readableState.encoding=(this||Ve)._readableState.decoder.encoding;let Ge=(this||Ve)._readableState.buffer,Ue="";for(let et of Ge)Ue+=me.write(et);return Ge.clear(),Ue!==""&&Ge.push(Ue),(this||Ve)._readableState.length=Ue.length,this||Ve};let it=1073741824;function T(ue){if(ue>it)throw new ne("size","<= 1GiB",ue);return ue--,ue|=ue>>>1,ue|=ue>>>2,ue|=ue>>>4,ue|=ue>>>8,ue|=ue>>>16,ue++,ue}function g(ue,me){return ue<=0||me.length===0&&me.ended?0:(me.state&j)!==0?1:n(ue)?me.flowing&&me.length?me.buffer.first().length:me.length:ue<=me.length?ue:me.ended?me.length:0}Ne.prototype.read=function(ue){_("read",ue),ue===void 0?ue=NaN:t(ue)||(ue=i(ue,10));let me=(this||Ve)._readableState,Ge=ue;if(ue>me.highWaterMark&&(me.highWaterMark=T(ue)),ue!==0&&(me.state&=~H),ue===0&&me.needReadable&&((me.highWaterMark!==0?me.length>=me.highWaterMark:me.length>0)||me.ended))return _("read: emitReadable",me.length,me.ended),me.length===0&&me.ended?je(this||Ve):R(this||Ve),null;if(ue=g(ue,me),ue===0&&me.ended)return me.length===0&&je(this||Ve),null;let Ue=(me.state&te)!==0;if(_("need readable",Ue),(me.length===0||me.length-ue<me.highWaterMark)&&(Ue=!0,_("length less than watermark",Ue)),me.ended||me.reading||me.destroyed||me.errored||!me.constructed)Ue=!1,_("reading, ended or constructing",Ue);else if(Ue){_("do read"),me.state|=Q|Ee,me.length===0&&(me.state|=te);try{this._read(me.highWaterMark)}catch(pt){C(this||Ve,pt)}me.state&=~Ee,me.reading||(ue=g(Ge,me))}let et;return ue>0?et=Pe(ue,me):et=null,et===null?(me.needReadable=me.length<=me.highWaterMark,ue=0):(me.length-=ue,me.multiAwaitDrain?me.awaitDrainWriters.clear():me.awaitDrainWriters=null),me.length===0&&(me.ended||(me.needReadable=!0),Ge!==ue&&me.ended&&je(this||Ve)),et!==null&&!me.errorEmitted&&!me.closeEmitted&&(me.dataEmitted=!0,this.emit("data",et)),et};function p(ue,me){if(_("onEofChunk"),!me.ended){if(me.decoder){let Ge=me.decoder.end();Ge&&Ge.length&&(me.buffer.push(Ge),me.length+=me.objectMode?1:Ge.length)}me.ended=!0,me.sync?R(ue):(me.needReadable=!1,me.emittedReadable=!0,J(ue))}}function R(ue){let me=ue._readableState;_("emitReadable",me.needReadable,me.emittedReadable),me.needReadable=!1,me.emittedReadable||(_("emitReadable",me.flowing),me.emittedReadable=!0,r.nextTick(J,ue))}function J(ue){let me=ue._readableState;_("emitReadable_",me.destroyed,me.length,me.ended),!me.destroyed&&!me.errored&&(me.length||me.ended)&&(ue.emit("readable"),me.emittedReadable=!1),me.needReadable=!me.flowing&&!me.ended&&me.length<=me.highWaterMark,Me(ue)}function D(ue,me){!me.readingMore&&me.constructed&&(me.readingMore=!0,r.nextTick(le,ue,me))}function le(ue,me){for(;!me.reading&&!me.ended&&(me.length<me.highWaterMark||me.flowing&&me.length===0);){let Ge=me.length;if(_("maybeReadMore read 0"),ue.read(0),Ge===me.length)break}me.readingMore=!1}Ne.prototype._read=function(ue){throw new K("_read()")},Ne.prototype.pipe=function(ue,me){let Ge=this||Ve,Ue=(this||Ve)._readableState;Ue.pipes.length===1&&(Ue.multiAwaitDrain||(Ue.multiAwaitDrain=!0,Ue.awaitDrainWriters=new c(Ue.awaitDrainWriters?[Ue.awaitDrainWriters]:[]))),Ue.pipes.push(ue),_("pipe count=%d opts=%j",Ue.pipes.length,me);let pt=(!me||me.end!==!1)&&ue!==r.stdout&&ue!==r.stderr?xt:tn;Ue.endEmitted?r.nextTick(pt):Ge.once("end",pt),ue.on("unpipe",It);function It(rn,nn){_("onunpipe"),rn===Ge&&nn&&nn.hasUnpiped===!1&&(nn.hasUnpiped=!0,Yn())}function xt(){_("onend"),ue.end()}let fr,Ri=!1;function Yn(){_("cleanup"),ue.removeListener("close",Ht),ue.removeListener("finish",Zt),fr&&ue.removeListener("drain",fr),ue.removeListener("error",wr),ue.removeListener("unpipe",It),Ge.removeListener("end",xt),Ge.removeListener("end",tn),Ge.removeListener("data",Or),Ri=!0,fr&&Ue.awaitDrainWriters&&(!ue._writableState||ue._writableState.needDrain)&&fr()}function Yt(){Ri||(Ue.pipes.length===1&&Ue.pipes[0]===ue?(_("false write response, pause",0),Ue.awaitDrainWriters=ue,Ue.multiAwaitDrain=!1):Ue.pipes.length>1&&Ue.pipes.includes(ue)&&(_("false write response, pause",Ue.awaitDrainWriters.size),Ue.awaitDrainWriters.add(ue)),Ge.pause()),fr||(fr=he(Ge,ue),ue.on("drain",fr))}Ge.on("data",Or);function Or(rn){_("ondata");let nn=ue.write(rn);_("dest.write",nn),nn===!1&&Yt()}function wr(rn){if(_("onerror",rn),tn(),ue.removeListener("error",wr),ue.listenerCount("error")===0){let nn=ue._writableState||ue._readableState;nn&&!nn.errorEmitted?C(ue,rn):ue.emit("error",rn)}}v(ue,"error",wr);function Ht(){ue.removeListener("finish",Zt),tn()}ue.once("close",Ht);function Zt(){_("onfinish"),ue.removeListener("close",Ht),tn()}ue.once("finish",Zt);function tn(){_("unpipe"),Ge.unpipe(ue)}return ue.emit("pipe",Ge),ue.writableNeedDrain===!0?Yt():Ue.flowing||(_("pipe resume"),Ge.resume()),ue};function he(ue,me){return function(){let Ue=ue._readableState;Ue.awaitDrainWriters===me?(_("pipeOnDrain",1),Ue.awaitDrainWriters=null):Ue.multiAwaitDrain&&(_("pipeOnDrain",Ue.awaitDrainWriters.size),Ue.awaitDrainWriters.delete(me)),(!Ue.awaitDrainWriters||Ue.awaitDrainWriters.size===0)&&ue.listenerCount("data")&&ue.resume()}}Ne.prototype.unpipe=function(ue){let me=(this||Ve)._readableState,Ge={hasUnpiped:!1};if(me.pipes.length===0)return this||Ve;if(!ue){let et=me.pipes;me.pipes=[],this.pause();for(let pt=0;pt<et.length;pt++)et[pt].emit("unpipe",this||Ve,{hasUnpiped:!1});return this||Ve}let Ue=e(me.pipes,ue);return Ue===-1?this||Ve:(me.pipes.splice(Ue,1),me.pipes.length===0&&this.pause(),ue.emit("unpipe",this||Ve,Ge),this||Ve)},Ne.prototype.on=function(ue,me){let Ge=y.prototype.on.call(this||Ve,ue,me),Ue=(this||Ve)._readableState;return ue==="data"?(Ue.readableListening=this.listenerCount("readable")>0,Ue.flowing!==!1&&this.resume()):ue==="readable"&&!Ue.endEmitted&&!Ue.readableListening&&(Ue.readableListening=Ue.needReadable=!0,Ue.flowing=!1,Ue.emittedReadable=!1,_("on readable",Ue.length,Ue.reading),Ue.length?R(this||Ve):Ue.reading||r.nextTick(ve,this||Ve)),Ge},Ne.prototype.addListener=Ne.prototype.on,Ne.prototype.removeListener=function(ue,me){let Ge=y.prototype.removeListener.call(this||Ve,ue,me);return ue==="readable"&&r.nextTick(_e,this||Ve),Ge},Ne.prototype.off=Ne.prototype.removeListener,Ne.prototype.removeAllListeners=function(ue){let me=y.prototype.removeAllListeners.apply(this||Ve,arguments);return(ue==="readable"||ue===void 0)&&r.nextTick(_e,this||Ve),me};function _e(ue){let me=ue._readableState;me.readableListening=ue.listenerCount("readable")>0,me.resumeScheduled&&me[re]===!1?me.flowing=!0:ue.listenerCount("data")>0?ue.resume():me.readableListening||(me.flowing=null)}function ve(ue){_("readable nexttick read 0"),ue.read(0)}Ne.prototype.resume=function(){let ue=(this||Ve)._readableState;return ue.flowing||(_("resume"),ue.flowing=!ue.readableListening,Ie(this||Ve,ue)),ue[re]=!1,this||Ve};function Ie(ue,me){me.resumeScheduled||(me.resumeScheduled=!0,r.nextTick(Z,ue,me))}function Z(ue,me){_("resume",me.reading),me.reading||ue.read(0),me.resumeScheduled=!1,ue.emit("resume"),Me(ue),me.flowing&&!me.reading&&ue.read(0)}Ne.prototype.pause=function(){return _("call pause flowing=%j",(this||Ve)._readableState.flowing),(this||Ve)._readableState.flowing!==!1&&(_("pause"),(this||Ve)._readableState.flowing=!1,this.emit("pause")),(this||Ve)._readableState[re]=!0,this||Ve};function Me(ue){let me=ue._readableState;for(_("flow",me.flowing);me.flowing&&ue.read()!==null;);}Ne.prototype.wrap=function(ue){let me=!1;ue.on("data",Ue=>{!this.push(Ue)&&ue.pause&&(me=!0,ue.pause())}),ue.on("end",()=>{this.push(null)}),ue.on("error",Ue=>{C(this||Ve,Ue)}),ue.on("close",()=>{this.destroy()}),ue.on("destroy",()=>{this.destroy()}),(this||Ve)._read=()=>{me&&ue.resume&&(me=!1,ue.resume())};let Ge=s(ue);for(let Ue=1;Ue<Ge.length;Ue++){let et=Ge[Ue];(this||Ve)[et]===void 0&&typeof ue[et]=="function"&&((this||Ve)[et]=ue[et].bind(ue))}return this||Ve},Ne.prototype[h]=function(){return nt(this||Ve)},Ne.prototype.iterator=function(ue){return ue!==void 0&&ie(ue,"options"),nt(this||Ve,ue)};function nt(ue,me){typeof ue.read!="function"&&(ue=Ne.wrap(ue,{objectMode:!0}));let Ge=N(ue,me);return Ge.stream=ue,Ge}async function*N(ue,me){let Ge=P;function Ue(It){(this||Ve)===ue?(Ge(),Ge=P):Ge=It}ue.on("readable",Ue);let et,pt=E(ue,{writable:!1},It=>{et=It?q(et,It):null,Ge(),Ge=P});try{for(;;){let It=ue.destroyed?null:ue.read();if(It!==null)yield It;else{if(et)throw et;if(et===null)return;await new u(Ue)}}}catch(It){throw et=q(et,It),et}finally{(et||me?.destroyOnReturn!==!1)&&(et===void 0||ue._readableState.autoDestroy)?A.destroyer(ue,null):(ue.off("readable",Ue),pt())}}o(Ne.prototype,{readable:{__proto__:null,get(){let ue=(this||Ve)._readableState;return!!ue&&ue.readable!==!1&&!ue.destroyed&&!ue.errorEmitted&&!ue.endEmitted},set(ue){(this||Ve)._readableState&&((this||Ve)._readableState.readable=!!ue)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return(this||Ve)._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!((this||Ve)._readableState.readable!==!1&&((this||Ve)._readableState.destroyed||(this||Ve)._readableState.errored)&&!(this||Ve)._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return(this||Ve)._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return(this||Ve)._readableState&&(this||Ve)._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return(this||Ve)._readableState.flowing},set:function(ue){(this||Ve)._readableState&&((this||Ve)._readableState.flowing=ue)}},readableLength:{__proto__:null,enumerable:!1,get(){return(this||Ve)._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return(this||Ve)._readableState?(this||Ve)._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return(this||Ve)._readableState?(this||Ve)._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return(this||Ve)._readableState?(this||Ve)._readableState.errored:null}},closed:{__proto__:null,get(){return(this||Ve)._readableState?(this||Ve)._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return(this||Ve)._readableState?(this||Ve)._readableState.destroyed:!1},set(ue){(this||Ve)._readableState&&((this||Ve)._readableState.destroyed=ue)}},readableEnded:{__proto__:null,enumerable:!1,get(){return(this||Ve)._readableState?(this||Ve)._readableState.endEmitted:!1}}}),o(ke.prototype,{pipesCount:{__proto__:null,get(){return(this||Ve).pipes.length}},paused:{__proto__:null,get(){return(this||Ve)[re]!==!1},set(ue){(this||Ve)[re]=!!ue}}}),Ne._fromList=Pe;function Pe(ue,me){if(me.length===0)return null;let Ge;return me.objectMode?Ge=me.buffer.shift():!ue||ue>=me.length?(me.decoder?Ge=me.buffer.join(""):me.buffer.length===1?Ge=me.buffer.first():Ge=me.buffer.concat(me.length),me.buffer.clear()):Ge=me.buffer.consume(ue,me.decoder),Ge}function je(ue){let me=ue._readableState;_("endReadable",me.endEmitted),me.endEmitted||(me.ended=!0,r.nextTick(de,me,ue))}function de(ue,me){if(_("endReadableNT",ue.endEmitted,ue.length),!ue.errored&&!ue.closeEmitted&&!ue.endEmitted&&ue.length===0){if(ue.endEmitted=!0,me.emit("end"),me.writable&&me.allowHalfOpen===!1)r.nextTick(De,me);else if(ue.autoDestroy){let Ge=me._writableState;(!Ge||Ge.autoDestroy&&(Ge.finished||Ge.writable===!1))&&me.destroy()}}}function De(ue){ue.writable&&!ue.writableEnded&&!ue.destroyed&&ue.end()}Ne.from=function(ue,me){return x(Ne,ue,me)};let Be;function ft(){return Be===void 0&&(Be={}),Be}return Ne.fromWeb=function(ue,me){return ft().newStreamReadableFromReadableStream(ue,me)},Ne.toWeb=function(ue,me){return ft().newReadableStreamFromStreamReadable(ue,me)},Ne.wrap=function(ue,me){var Ge,Ue;return new Ne({objectMode:(Ge=(Ue=ue.readableObjectMode)!==null&&Ue!==void 0?Ue:ue.objectMode)!==null&&Ge!==void 0?Ge:!0,...me,destroy(et,pt){A.destroyer(ue,et),pt(et)}}).wrap(ue)},tA}function dA(){if(pP)return rA;pP=!0;let r=qr,{ArrayPrototypeSlice:e,Error:t,FunctionPrototypeSymbolHasInstance:n,ObjectDefineProperty:i,ObjectDefineProperties:o,ObjectSetPrototypeOf:s,StringPrototypeToLowerCase:a,Symbol:u,SymbolHasInstance:c}=Lr();rA=ie,ie.WritableState=$;let{EventEmitter:f}=wo,h=hA().Stream,{Buffer:d}=gn(),m=Dh(),{addAbortSignal:y}=iw(),{getHighWaterMark:v,getDefaultHighWaterMark:w}=sw(),{ERR_INVALID_ARG_TYPE:b,ERR_METHOD_NOT_IMPLEMENTED:E,ERR_MULTIPLE_CALLBACK:_,ERR_STREAM_CANNOT_PIPE:S,ERR_STREAM_DESTROYED:A,ERR_STREAM_ALREADY_FINISHED:F,ERR_STREAM_NULL_VALUES:I,ERR_STREAM_WRITE_AFTER_END:q,ERR_UNKNOWN_ENCODING:ee}=gi().codes,{errorOrDestroy:K}=m;s(ie.prototype,h.prototype),s(ie,h);function ne(){}let L=u("kOnFinished");function $(M,oe,ge){typeof ge!="boolean"&&(ge=oe instanceof ya()),(this||Qe).objectMode=!!(M&&M.objectMode),ge&&((this||Qe).objectMode=(this||Qe).objectMode||!!(M&&M.writableObjectMode)),(this||Qe).highWaterMark=M?v(this||Qe,M,"writableHighWaterMark",ge):w(!1),(this||Qe).finalCalled=!1,(this||Qe).needDrain=!1,(this||Qe).ending=!1,(this||Qe).ended=!1,(this||Qe).finished=!1,(this||Qe).destroyed=!1;let Se=!!(M&&M.decodeStrings===!1);(this||Qe).decodeStrings=!Se,(this||Qe).defaultEncoding=M&&M.defaultEncoding||"utf8",(this||Qe).length=0,(this||Qe).writing=!1,(this||Qe).corked=0,(this||Qe).sync=!0,(this||Qe).bufferProcessing=!1,(this||Qe).onwrite=C.bind(void 0,oe),(this||Qe).writecb=null,(this||Qe).writelen=0,(this||Qe).afterWriteTickInfo=null,Y(this||Qe),(this||Qe).pendingcb=0,(this||Qe).constructed=!0,(this||Qe).prefinished=!1,(this||Qe).errorEmitted=!1,(this||Qe).emitClose=!M||M.emitClose!==!1,(this||Qe).autoDestroy=!M||M.autoDestroy!==!1,(this||Qe).errored=null,(this||Qe).closed=!1,(this||Qe).closeEmitted=!1,(this||Qe)[L]=[]}function Y(M){M.buffered=[],M.bufferedIndex=0,M.allBuffers=!0,M.allNoop=!0}$.prototype.getBuffer=function(){return e((this||Qe).buffered,(this||Qe).bufferedIndex)},i($.prototype,"bufferedRequestCount",{__proto__:null,get(){return(this||Qe).buffered.length-(this||Qe).bufferedIndex}});function ie(M){let oe=(this||Qe)instanceof ya();if(!oe&&!n(ie,this||Qe))return new ie(M);(this||Qe)._writableState=new $(M,this||Qe,oe),M&&(typeof M.write=="function"&&((this||Qe)._write=M.write),typeof M.writev=="function"&&((this||Qe)._writev=M.writev),typeof M.destroy=="function"&&((this||Qe)._destroy=M.destroy),typeof M.final=="function"&&((this||Qe)._final=M.final),typeof M.construct=="function"&&((this||Qe)._construct=M.construct),M.signal&&y(M.signal,this||Qe)),h.call(this||Qe,M),m.construct(this||Qe,()=>{let ge=(this||Qe)._writableState;ge.writing||Q(this||Qe,ge),H(this||Qe,ge)})}i(ie,c,{__proto__:null,value:function(M){return n(this||Qe,M)?!0:(this||Qe)!==ie?!1:M&&M._writableState instanceof $}}),ie.prototype.pipe=function(){K(this||Qe,new S)};function re(M,oe,ge,Se){let be=M._writableState;if(typeof ge=="function")Se=ge,ge=be.defaultEncoding;else{if(!ge)ge=be.defaultEncoding;else if(ge!=="buffer"&&!d.isEncoding(ge))throw new ee(ge);typeof Se!="function"&&(Se=ne)}if(oe===null)throw new I;if(!be.objectMode)if(typeof oe=="string")be.decodeStrings!==!1&&(oe=d.from(oe,ge),ge="buffer");else if(oe instanceof d)ge="buffer";else if(h._isUint8Array(oe))oe=h._uint8ArrayToBuffer(oe),ge="buffer";else throw new b("chunk",["string","Buffer","Uint8Array"],oe);let pe;return be.ending?pe=new q:be.destroyed&&(pe=new A("write")),pe?(r.nextTick(Se,pe),K(M,pe,!0),pe):(be.pendingcb++,k(M,be,oe,ge,Se))}ie.prototype.write=function(M,oe,ge){return re(this||Qe,M,oe,ge)===!0},ie.prototype.cork=function(){(this||Qe)._writableState.corked++},ie.prototype.uncork=function(){let M=(this||Qe)._writableState;M.corked&&(M.corked--,M.writing||Q(this||Qe,M))},ie.prototype.setDefaultEncoding=function(oe){if(typeof oe=="string"&&(oe=a(oe)),!d.isEncoding(oe))throw new ee(oe);return(this||Qe)._writableState.defaultEncoding=oe,this||Qe};function k(M,oe,ge,Se,be){let pe=oe.objectMode?1:ge.length;oe.length+=pe;let Ae=oe.length<oe.highWaterMark;return Ae||(oe.needDrain=!0),oe.writing||oe.corked||oe.errored||!oe.constructed?(oe.buffered.push({chunk:ge,encoding:Se,callback:be}),oe.allBuffers&&Se!=="buffer"&&(oe.allBuffers=!1),oe.allNoop&&be!==ne&&(oe.allNoop=!1)):(oe.writelen=pe,oe.writecb=be,oe.writing=!0,oe.sync=!0,M._write(ge,Se,oe.onwrite),oe.sync=!1),Ae&&!oe.errored&&!oe.destroyed}function x(M,oe,ge,Se,be,pe,Ae){oe.writelen=Se,oe.writecb=Ae,oe.writing=!0,oe.sync=!0,oe.destroyed?oe.onwrite(new A("write")):ge?M._writev(be,oe.onwrite):M._write(be,pe,oe.onwrite),oe.sync=!1}function P(M,oe,ge,Se){--oe.pendingcb,Se(ge),B(oe),K(M,ge)}function C(M,oe){let ge=M._writableState,Se=ge.sync,be=ge.writecb;if(typeof be!="function"){K(M,new _);return}ge.writing=!1,ge.writecb=null,ge.length-=ge.writelen,ge.writelen=0,oe?(oe.stack,ge.errored||(ge.errored=oe),M._readableState&&!M._readableState.errored&&(M._readableState.errored=oe),Se?r.nextTick(P,M,ge,oe,be):P(M,ge,oe,be)):(ge.buffered.length>ge.bufferedIndex&&Q(M,ge),Se?ge.afterWriteTickInfo!==null&&ge.afterWriteTickInfo.cb===be?ge.afterWriteTickInfo.count++:(ge.afterWriteTickInfo={count:1,cb:be,stream:M,state:ge},r.nextTick(j,ge.afterWriteTickInfo)):U(M,ge,1,be))}function j({stream:M,state:oe,count:ge,cb:Se}){return oe.afterWriteTickInfo=null,U(M,oe,ge,Se)}function U(M,oe,ge,Se){for(!oe.ending&&!M.destroyed&&oe.length===0&&oe.needDrain&&(oe.needDrain=!1,M.emit("drain"));ge-- >0;)oe.pendingcb--,Se();oe.destroyed&&B(oe),H(M,oe)}function B(M){if(M.writing)return;for(let be=M.bufferedIndex;be<M.buffered.length;++be){var oe;let{chunk:pe,callback:Ae}=M.buffered[be],$e=M.objectMode?1:pe.length;M.length-=$e,Ae((oe=M.errored)!==null&&oe!==void 0?oe:new A("write"))}let ge=M[L].splice(0);for(let be=0;be<ge.length;be++){var Se;ge[be]((Se=M.errored)!==null&&Se!==void 0?Se:new A("end"))}Y(M)}function Q(M,oe){if(oe.corked||oe.bufferProcessing||oe.destroyed||!oe.constructed)return;let{buffered:ge,bufferedIndex:Se,objectMode:be}=oe,pe=ge.length-Se;if(!pe)return;let Ae=Se;if(oe.bufferProcessing=!0,pe>1&&M._writev){oe.pendingcb-=pe-1;let $e=oe.allNoop?ne:Ne=>{for(let Ze=Ae;Ze<ge.length;++Ze)ge[Ze].callback(Ne)},ke=oe.allNoop&&Ae===0?ge:e(ge,Ae);ke.allBuffers=oe.allBuffers,x(M,oe,!0,oe.length,ke,"",$e),Y(oe)}else{do{let{chunk:$e,encoding:ke,callback:Ne}=ge[Ae];ge[Ae++]=null;let Ze=be?1:$e.length;x(M,oe,!1,Ze,$e,ke,Ne)}while(Ae<ge.length&&!oe.writing);Ae===ge.length?Y(oe):Ae>256?(ge.splice(0,Ae),oe.bufferedIndex=0):oe.bufferedIndex=Ae}oe.bufferProcessing=!1}ie.prototype._write=function(M,oe,ge){if((this||Qe)._writev)this._writev([{chunk:M,encoding:oe}],ge);else throw new E("_write()")},ie.prototype._writev=null,ie.prototype.end=function(M,oe,ge){let Se=(this||Qe)._writableState;typeof M=="function"?(ge=M,M=null,oe=null):typeof oe=="function"&&(ge=oe,oe=null);let be;if(M!=null){let pe=re(this||Qe,M,oe);pe instanceof t&&(be=pe)}return Se.corked&&(Se.corked=1,this.uncork()),be||(!Se.errored&&!Se.ending?(Se.ending=!0,H(this||Qe,Se,!0),Se.ended=!0):Se.finished?be=new F("end"):Se.destroyed&&(be=new A("end"))),typeof ge=="function"&&(be||Se.finished?r.nextTick(ge,be):Se[L].push(ge)),this||Qe};function fe(M){return M.ending&&!M.destroyed&&M.constructed&&M.length===0&&!M.errored&&M.buffered.length===0&&!M.finished&&!M.writing&&!M.errorEmitted&&!M.closeEmitted}function Ee(M,oe){let ge=!1;function Se(be){if(ge){K(M,be??_());return}if(ge=!0,oe.pendingcb--,be){let pe=oe[L].splice(0);for(let Ae=0;Ae<pe.length;Ae++)pe[Ae](be);K(M,be,oe.sync)}else fe(oe)&&(oe.prefinished=!0,M.emit("prefinish"),oe.pendingcb++,r.nextTick(ae,M,oe))}oe.sync=!0,oe.pendingcb++;try{M._final(Se)}catch(be){Se(be)}oe.sync=!1}function te(M,oe){!oe.prefinished&&!oe.finalCalled&&(typeof M._final=="function"&&!oe.destroyed?(oe.finalCalled=!0,Ee(M,oe)):(oe.prefinished=!0,M.emit("prefinish")))}function H(M,oe,ge){fe(oe)&&(te(M,oe),oe.pendingcb===0&&(ge?(oe.pendingcb++,r.nextTick((Se,be)=>{fe(be)?ae(Se,be):be.pendingcb--},M,oe)):fe(oe)&&(oe.pendingcb++,ae(M,oe))))}function ae(M,oe){oe.pendingcb--,oe.finished=!0;let ge=oe[L].splice(0);for(let Se=0;Se<ge.length;Se++)ge[Se]();if(M.emit("finish"),oe.autoDestroy){let Se=M._readableState;(!Se||Se.autoDestroy&&(Se.endEmitted||Se.readable===!1))&&M.destroy()}}o(ie.prototype,{closed:{__proto__:null,get(){return(this||Qe)._writableState?(this||Qe)._writableState.closed:!1}},destroyed:{__proto__:null,get(){return(this||Qe)._writableState?(this||Qe)._writableState.destroyed:!1},set(M){(this||Qe)._writableState&&((this||Qe)._writableState.destroyed=M)}},writable:{__proto__:null,get(){let M=(this||Qe)._writableState;return!!M&&M.writable!==!1&&!M.destroyed&&!M.errored&&!M.ending&&!M.ended},set(M){(this||Qe)._writableState&&((this||Qe)._writableState.writable=!!M)}},writableFinished:{__proto__:null,get(){return(this||Qe)._writableState?(this||Qe)._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return(this||Qe)._writableState?(this||Qe)._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return(this||Qe)._writableState&&(this||Qe)._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return(this||Qe)._writableState?(this||Qe)._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let M=(this||Qe)._writableState;return M?!M.destroyed&&!M.ending&&M.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return(this||Qe)._writableState&&(this||Qe)._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return(this||Qe)._writableState?(this||Qe)._writableState.corked:0}},writableLength:{__proto__:null,get(){return(this||Qe)._writableState&&(this||Qe)._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return(this||Qe)._writableState?(this||Qe)._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!((this||Qe)._writableState.writable!==!1&&((this||Qe)._writableState.destroyed||(this||Qe)._writableState.errored)&&!(this||Qe)._writableState.finished)}}});let we=m.destroy;ie.prototype.destroy=function(M,oe){let ge=(this||Qe)._writableState;return!ge.destroyed&&(ge.bufferedIndex<ge.buffered.length||ge[L].length)&&r.nextTick(B,ge),we.call(this||Qe,M,oe),this||Qe},ie.prototype._undestroy=m.undestroy,ie.prototype._destroy=function(M,oe){oe(M)},ie.prototype[f.captureRejectionSymbol]=function(M){this.destroy(M)};let xe;function V(){return xe===void 0&&(xe={}),xe}return ie.fromWeb=function(M,oe){return V().newStreamWritableFromWritableStream(M,oe)},ie.toWeb=function(M){return V().newWritableStreamFromStreamWritable(M)},rA}function hH(){if(gP)return nA;gP=!0;let r=qr,e=gn(),{isReadable:t,isWritable:n,isIterable:i,isNodeStream:o,isReadableNodeStream:s,isWritableNodeStream:a,isDuplexNodeStream:u,isReadableStream:c,isWritableStream:f}=ba(),h=Nl(),{AbortError:d,codes:{ERR_INVALID_ARG_TYPE:m,ERR_INVALID_RETURN_VALUE:y}}=gi(),{destroyer:v}=Dh(),w=ya(),b=ow(),E=dA(),{createDeferredPromise:_}=Zn(),S=TP(),A=globalThis.Blob||e.Blob,F=typeof A<"u"?function($){return $ instanceof A}:function($){return!1},I=globalThis.AbortController||Ng().AbortController,{FunctionPrototypeCall:q}=Lr();class ee extends w{constructor($){super($),$?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),$?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}nA=function L($,Y){if(u($))return $;if(s($))return ne({readable:$});if(a($))return ne({writable:$});if(o($))return ne({writable:!1,readable:!1});if(c($))return ne({readable:b.fromWeb($)});if(f($))return ne({writable:E.fromWeb($)});if(typeof $=="function"){let{value:re,write:k,final:x,destroy:P}=K($);if(i(re))return S(ee,re,{objectMode:!0,write:k,final:x,destroy:P});let C=re?.then;if(typeof C=="function"){let j,U=q(C,re,B=>{if(B!=null)throw new y("nully","body",B)},B=>{v(j,B)});return j=new ee({objectMode:!0,readable:!1,write:k,final(B){x(async()=>{try{await U,r.nextTick(B,null)}catch(Q){r.nextTick(B,Q)}})},destroy:P})}throw new y("Iterable, AsyncIterable or AsyncFunction",Y,re)}if(F($))return L($.arrayBuffer());if(i($))return S(ee,$,{objectMode:!0,writable:!1});if(c($?.readable)&&f($?.writable))return ee.fromWeb($);if(typeof $?.writable=="object"||typeof $?.readable=="object"){let re=$!=null&&$.readable?s($?.readable)?$?.readable:L($.readable):void 0,k=$!=null&&$.writable?a($?.writable)?$?.writable:L($.writable):void 0;return ne({readable:re,writable:k})}let ie=$?.then;if(typeof ie=="function"){let re;return q(ie,$,k=>{k!=null&&re.push(k),re.push(null)},k=>{v(re,k)}),re=new ee({objectMode:!0,writable:!1,read(){}})}throw new m(Y,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],$)};function K(L){let{promise:$,resolve:Y}=_(),ie=new I,re=ie.signal;return{value:L((async function*(){for(;;){let x=$;$=null;let{chunk:P,done:C,cb:j}=await x;if(r.nextTick(j),C)return;if(re.aborted)throw new d(void 0,{cause:re.reason});({promise:$,resolve:Y}=_()),yield P}})(),{signal:re}),write(x,P,C){let j=Y;Y=null,j({chunk:x,done:!1,cb:C})},final(x){let P=Y;Y=null,P({done:!0,cb:x})},destroy(x,P){ie.abort(),P(x)}}}function ne(L){let $=L.readable&&typeof L.readable.read!="function"?b.wrap(L.readable):L.readable,Y=L.writable,ie=!!t($),re=!!n(Y),k,x,P,C,j;function U(B){let Q=C;C=null,Q?Q(B):B&&j.destroy(B)}return j=new ee({readableObjectMode:!!($!=null&&$.readableObjectMode),writableObjectMode:!!(Y!=null&&Y.writableObjectMode),readable:ie,writable:re}),re&&(h(Y,B=>{re=!1,B&&v($,B),U(B)}),j._write=function(B,Q,fe){Y.write(B,Q)?fe():k=fe},j._final=function(B){Y.end(),x=B},Y.on("drain",function(){if(k){let B=k;k=null,B()}}),Y.on("finish",function(){if(x){let B=x;x=null,B()}})),ie&&(h($,B=>{ie=!1,B&&v($,B),U(B)}),$.on("readable",function(){if(P){let B=P;P=null,B()}}),$.on("end",function(){j.push(null)}),j._read=function(){for(;;){let B=$.read();if(B===null){P=j._read;return}if(!j.push(B))return}}),j._destroy=function(B,Q){!B&&C!==null&&(B=new d),P=null,k=null,x=null,C===null?Q(B):(C=Q,v(Y,B),v($,B))},j}return nA}function ya(){if(mP)return iA;mP=!0;let{ObjectDefineProperties:r,ObjectGetOwnPropertyDescriptor:e,ObjectKeys:t,ObjectSetPrototypeOf:n}=Lr();iA=s;let i=ow(),o=dA();n(s.prototype,i.prototype),n(s,i);{let f=t(o.prototype);for(let h=0;h<f.length;h++){let d=f[h];s.prototype[d]||(s.prototype[d]=o.prototype[d])}}function s(f){if(!(this instanceof s))return new s(f);i.call(this,f),o.call(this,f),f?(this.allowHalfOpen=f.allowHalfOpen!==!1,f.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),f.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}r(s.prototype,{writable:{__proto__:null,...e(o.prototype,"writable")},writableHighWaterMark:{__proto__:null,...e(o.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...e(o.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...e(o.prototype,"writableBuffer")},writableLength:{__proto__:null,...e(o.prototype,"writableLength")},writableFinished:{__proto__:null,...e(o.prototype,"writableFinished")},writableCorked:{__proto__:null,...e(o.prototype,"writableCorked")},writableEnded:{__proto__:null,...e(o.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...e(o.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(f){this._readableState&&this._writableState&&(this._readableState.destroyed=f,this._writableState.destroyed=f)}}});let a;function u(){return a===void 0&&(a={}),a}s.fromWeb=function(f,h){return u().newStreamDuplexFromReadableWritablePair(f,h)},s.toWeb=function(f){return u().newReadableWritablePairFromDuplex(f)};let c;return s.from=function(f){return c||(c=hH()),c(f,"body")},iA}function CP(){if(yP)return sA;yP=!0;let{ObjectSetPrototypeOf:r,Symbol:e}=Lr();sA=s;let{ERR_METHOD_NOT_IMPLEMENTED:t}=gi().codes,n=ya(),{getHighWaterMark:i}=sw();r(s.prototype,n.prototype),r(s,n);let o=e("kCallback");function s(c){if(!(this instanceof s))return new s(c);let f=c?i(this,c,"readableHighWaterMark",!0):null;f===0&&(c={...c,highWaterMark:null,readableHighWaterMark:f,writableHighWaterMark:c.writableHighWaterMark||0}),n.call(this,c),this._readableState.sync=!1,this[o]=null,c&&(typeof c.transform=="function"&&(this._transform=c.transform),typeof c.flush=="function"&&(this._flush=c.flush)),this.on("prefinish",u)}function a(c){typeof this._flush=="function"&&!this.destroyed?this._flush((f,h)=>{if(f){c?c(f):this.destroy(f);return}h!=null&&this.push(h),this.push(null),c&&c()}):(this.push(null),c&&c())}function u(){this._final!==a&&a.call(this)}return s.prototype._final=a,s.prototype._transform=function(c,f,h){throw new t("_transform()")},s.prototype._write=function(c,f,h){let d=this._readableState,m=this._writableState,y=d.length;this._transform(c,f,(v,w)=>{if(v){h(v);return}w!=null&&this.push(w),m.ended||y===d.length||d.length<d.highWaterMark?h():this[o]=h})},s.prototype._read=function(){if(this[o]){let c=this[o];this[o]=null,c()}},sA}function RP(){if(bP)return oA;bP=!0;let{ObjectSetPrototypeOf:r}=Lr();oA=t;let e=CP();r(t.prototype,e.prototype),r(t,e);function t(n){if(!(this instanceof t))return new t(n);e.call(this,n)}return t.prototype._transform=function(n,i,o){o(null,n)},oA}function pA(){if(wP)return aA;wP=!0;let r=qr,{ArrayIsArray:e,Promise:t,SymbolAsyncIterator:n,SymbolDispose:i}=Lr(),o=Nl(),{once:s}=Zn(),a=Dh(),u=ya(),{aggregateTwoErrors:c,codes:{ERR_INVALID_ARG_TYPE:f,ERR_INVALID_RETURN_VALUE:h,ERR_MISSING_ARGS:d,ERR_STREAM_DESTROYED:m,ERR_STREAM_PREMATURE_CLOSE:y},AbortError:v}=gi(),{validateFunction:w,validateAbortSignal:b}=Og(),{isIterable:E,isReadable:_,isReadableNodeStream:S,isNodeStream:A,isTransformStream:F,isWebStream:I,isReadableStream:q,isReadableFinished:ee}=ba(),K=globalThis.AbortController||Ng().AbortController,ne,L,$;function Y(B,Q,fe){let Ee=!1;B.on("close",()=>{Ee=!0});let te=o(B,{readable:Q,writable:fe},H=>{Ee=!H});return{destroy:H=>{Ee||(Ee=!0,a.destroyer(B,H||new m("pipe")))},cleanup:te}}function ie(B){return w(B[B.length-1],"streams[stream.length - 1]"),B.pop()}function re(B){if(E(B))return B;if(S(B))return k(B);throw new f("val",["Readable","Iterable","AsyncIterable"],B)}async function*k(B){L||(L=ow()),yield*L.prototype[n].call(B)}async function x(B,Q,fe,{end:Ee}){let te,H=null,ae=V=>{if(V&&(te=V),H){let M=H;H=null,M()}},we=()=>new t((V,M)=>{te?M(te):H=()=>{te?M(te):V()}});Q.on("drain",ae);let xe=o(Q,{readable:!1},ae);try{Q.writableNeedDrain&&await we();for await(let V of B)Q.write(V)||await we();Ee&&(Q.end(),await we()),fe()}catch(V){fe(te!==V?c(te,V):V)}finally{xe(),Q.off("drain",ae)}}async function P(B,Q,fe,{end:Ee}){F(Q)&&(Q=Q.writable);let te=Q.getWriter();try{for await(let H of B)await te.ready,te.write(H).catch(()=>{});await te.ready,Ee&&await te.close(),fe()}catch(H){try{await te.abort(H),fe(H)}catch(ae){fe(ae)}}}function C(...B){return j(B,s(ie(B)))}function j(B,Q,fe){if(B.length===1&&e(B[0])&&(B=B[0]),B.length<2)throw new d("streams");let Ee=new K,te=Ee.signal,H=fe?.signal,ae=[];b(H,"options.signal");function we(){be(new v)}$=$||Zn().addAbortListener;let xe;H&&(xe=$(H,we));let V,M,oe=[],ge=0;function Se(ke){be(ke,--ge===0)}function be(ke,Ne){var Ze;if(ke&&(!V||V.code==="ERR_STREAM_PREMATURE_CLOSE")&&(V=ke),!(!V&&!Ne)){for(;oe.length;)oe.shift()(V);(Ze=xe)===null||Ze===void 0||Ze[i](),Ee.abort(),Ne&&(V||ae.forEach(tt=>tt()),r.nextTick(Q,V,M))}}let pe;for(let ke=0;ke<B.length;ke++){let Ne=B[ke],Ze=ke<B.length-1,tt=ke>0,it=Ze||fe?.end!==!1,T=ke===B.length-1;if(A(Ne)){let g=function(p){p&&p.name!=="AbortError"&&p.code!=="ERR_STREAM_PREMATURE_CLOSE"&&Se(p)};if(it){let{destroy:p,cleanup:R}=Y(Ne,Ze,tt);oe.push(p),_(Ne)&&T&&ae.push(R)}Ne.on("error",g),_(Ne)&&T&&ae.push(()=>{Ne.removeListener("error",g)})}if(ke===0)if(typeof Ne=="function"){if(pe=Ne({signal:te}),!E(pe))throw new h("Iterable, AsyncIterable or Stream","source",pe)}else E(Ne)||S(Ne)||F(Ne)?pe=Ne:pe=u.from(Ne);else if(typeof Ne=="function"){if(F(pe)){var Ae;pe=re((Ae=pe)===null||Ae===void 0?void 0:Ae.readable)}else pe=re(pe);if(pe=Ne(pe,{signal:te}),Ze){if(!E(pe,!0))throw new h("AsyncIterable",`transform[${ke-1}]`,pe)}else{var $e;ne||(ne=RP());let g=new ne({objectMode:!0}),p=($e=pe)===null||$e===void 0?void 0:$e.then;if(typeof p=="function")ge++,p.call(pe,D=>{M=D,D!=null&&g.write(D),it&&g.end(),r.nextTick(Se)},D=>{g.destroy(D),r.nextTick(Se,D)});else if(E(pe,!0))ge++,x(pe,g,Se,{end:it});else if(q(pe)||F(pe)){let D=pe.readable||pe;ge++,x(D,g,Se,{end:it})}else throw new h("AsyncIterable or Promise","destination",pe);pe=g;let{destroy:R,cleanup:J}=Y(pe,!1,!0);oe.push(R),T&&ae.push(J)}}else if(A(Ne)){if(S(pe)){ge+=2;let g=U(pe,Ne,Se,{end:it});_(Ne)&&T&&ae.push(g)}else if(F(pe)||q(pe)){let g=pe.readable||pe;ge++,x(g,Ne,Se,{end:it})}else if(E(pe))ge++,x(pe,Ne,Se,{end:it});else throw new f("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],pe);pe=Ne}else if(I(Ne)){if(S(pe))ge++,P(re(pe),Ne,Se,{end:it});else if(q(pe)||E(pe))ge++,P(pe,Ne,Se,{end:it});else if(F(pe))ge++,P(pe.readable,Ne,Se,{end:it});else throw new f("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],pe);pe=Ne}else pe=u.from(Ne)}return(te!=null&&te.aborted||H!=null&&H.aborted)&&r.nextTick(we),pe}function U(B,Q,fe,{end:Ee}){let te=!1;if(Q.on("close",()=>{te||fe(new y)}),B.pipe(Q,{end:!1}),Ee){let H=function(){te=!0,Q.end()};ee(B)?r.nextTick(H):B.once("end",H)}else fe();return o(B,{readable:!0,writable:!1},H=>{let ae=B._readableState;H&&H.code==="ERR_STREAM_PREMATURE_CLOSE"&&ae&&ae.ended&&!ae.errored&&!ae.errorEmitted?B.once("end",fe).once("error",fe):fe(H)}),o(Q,{readable:!1,writable:!0},fe)}return aA={pipelineImpl:j,pipeline:C},aA}function DP(){if(vP)return lA;vP=!0;let{pipeline:r}=pA(),e=ya(),{destroyer:t}=Dh(),{isNodeStream:n,isReadable:i,isWritable:o,isWebStream:s,isTransformStream:a,isWritableStream:u,isReadableStream:c}=ba(),{AbortError:f,codes:{ERR_INVALID_ARG_VALUE:h,ERR_MISSING_ARGS:d}}=gi(),m=Nl();return lA=function(...v){if(v.length===0)throw new d("streams");if(v.length===1)return e.from(v[0]);let w=[...v];if(typeof v[0]=="function"&&(v[0]=e.from(v[0])),typeof v[v.length-1]=="function"){let ne=v.length-1;v[ne]=e.from(v[ne])}for(let ne=0;ne<v.length;++ne)if(!(!n(v[ne])&&!s(v[ne]))){if(ne<v.length-1&&!(i(v[ne])||c(v[ne])||a(v[ne])))throw new h(`streams[${ne}]`,w[ne],"must be readable");if(ne>0&&!(o(v[ne])||u(v[ne])||a(v[ne])))throw new h(`streams[${ne}]`,w[ne],"must be writable")}let b,E,_,S,A;function F(ne){let L=S;S=null,L?L(ne):ne?A.destroy(ne):!K&&!ee&&A.destroy()}let I=v[0],q=r(v,F),ee=!!(o(I)||u(I)||a(I)),K=!!(i(q)||c(q)||a(q));if(A=new e({writableObjectMode:!!(I!=null&&I.writableObjectMode),readableObjectMode:!!(q!=null&&q.readableObjectMode),writable:ee,readable:K}),ee){if(n(I))A._write=function(L,$,Y){I.write(L,$)?Y():b=Y},A._final=function(L){I.end(),E=L},I.on("drain",function(){if(b){let L=b;b=null,L()}});else if(s(I)){let $=(a(I)?I.writable:I).getWriter();A._write=async function(Y,ie,re){try{await $.ready,$.write(Y).catch(()=>{}),re()}catch(k){re(k)}},A._final=async function(Y){try{await $.ready,$.close().catch(()=>{}),E=Y}catch(ie){Y(ie)}}}let ne=a(q)?q.readable:q;m(ne,()=>{if(E){let L=E;E=null,L()}})}if(K){if(n(q))q.on("readable",function(){if(_){let ne=_;_=null,ne()}}),q.on("end",function(){A.push(null)}),A._read=function(){for(;;){let ne=q.read();if(ne===null){_=A._read;return}if(!A.push(ne))return}};else if(s(q)){let L=(a(q)?q.readable:q).getReader();A._read=async function(){for(;;)try{let{value:$,done:Y}=await L.read();if(!A.push($))return;if(Y){A.push(null);return}}catch{return}}}}return A._destroy=function(ne,L){!ne&&S!==null&&(ne=new f),_=null,b=null,E=null,S===null?L(ne):(S=L,n(q)&&t(q,ne))},A},lA}function dH(){if(EP)return nw;EP=!0;let r=globalThis.AbortController||Ng().AbortController,{codes:{ERR_INVALID_ARG_VALUE:e,ERR_INVALID_ARG_TYPE:t,ERR_MISSING_ARGS:n,ERR_OUT_OF_RANGE:i},AbortError:o}=gi(),{validateAbortSignal:s,validateInteger:a,validateObject:u}=Og(),c=Lr().Symbol("kWeak"),f=Lr().Symbol("kResistStopPropagation"),{finished:h}=Nl(),d=DP(),{addAbortSignalNoValidate:m}=iw(),{isWritable:y,isNodeStream:v}=ba(),{deprecate:w}=Zn(),{ArrayPrototypePush:b,Boolean:E,MathFloor:_,Number:S,NumberIsNaN:A,Promise:F,PromiseReject:I,PromiseResolve:q,PromisePrototypeThen:ee,Symbol:K}=Lr(),ne=K("kEmpty"),L=K("kEof");function $(H,ae){if(ae!=null&&u(ae,"options"),ae?.signal!=null&&s(ae.signal,"options.signal"),v(H)&&!y(H))throw new e("stream",H,"must be writable");let we=d(this,H);return ae!=null&&ae.signal&&m(ae.signal,we),we}function Y(H,ae){if(typeof H!="function")throw new t("fn",["Function","AsyncFunction"],H);ae!=null&&u(ae,"options"),ae?.signal!=null&&s(ae.signal,"options.signal");let we=1;ae?.concurrency!=null&&(we=_(ae.concurrency));let xe=we-1;return ae?.highWaterMark!=null&&(xe=_(ae.highWaterMark)),a(we,"options.concurrency",1),a(xe,"options.highWaterMark",0),xe+=we,async function*(){let M=Zn().AbortSignalAny([ae?.signal].filter(E)),oe=this,ge=[],Se={signal:M},be,pe,Ae=!1,$e=0;function ke(){Ae=!0,Ne()}function Ne(){$e-=1,Ze()}function Ze(){pe&&!Ae&&$e<we&&ge.length<xe&&(pe(),pe=null)}async function tt(){try{for await(let it of oe){if(Ae)return;if(M.aborted)throw new o;try{if(it=H(it,Se),it===ne)continue;it=q(it)}catch(T){it=I(T)}$e+=1,ee(it,Ne,ke),ge.push(it),be&&(be(),be=null),!Ae&&(ge.length>=xe||$e>=we)&&await new F(T=>{pe=T})}ge.push(L)}catch(it){let T=I(it);ee(T,Ne,ke),ge.push(T)}finally{Ae=!0,be&&(be(),be=null)}}tt();try{for(;;){for(;ge.length>0;){let it=await ge[0];if(it===L)return;if(M.aborted)throw new o;it!==ne&&(yield it),ge.shift(),Ze()}await new F(it=>{be=it})}}finally{Ae=!0,pe&&(pe(),pe=null)}}.call(this)}function ie(H=void 0){return H!=null&&u(H,"options"),H?.signal!=null&&s(H.signal,"options.signal"),async function*(){let we=0;for await(let V of this){var xe;if(H!=null&&(xe=H.signal)!==null&&xe!==void 0&&xe.aborted)throw new o({cause:H.signal.reason});yield[we++,V]}}.call(this)}async function re(H,ae=void 0){for await(let we of C.call(this,H,ae))return!0;return!1}async function k(H,ae=void 0){if(typeof H!="function")throw new t("fn",["Function","AsyncFunction"],H);return!await re.call(this,async(...we)=>!await H(...we),ae)}async function x(H,ae){for await(let we of C.call(this,H,ae))return we}async function P(H,ae){if(typeof H!="function")throw new t("fn",["Function","AsyncFunction"],H);async function we(xe,V){return await H(xe,V),ne}for await(let xe of Y.call(this,we,ae));}function C(H,ae){if(typeof H!="function")throw new t("fn",["Function","AsyncFunction"],H);async function we(xe,V){return await H(xe,V)?xe:ne}return Y.call(this,we,ae)}class j extends n{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}async function U(H,ae,we){var xe;if(typeof H!="function")throw new t("reducer",["Function","AsyncFunction"],H);we!=null&&u(we,"options"),we?.signal!=null&&s(we.signal,"options.signal");let V=arguments.length>1;if(we!=null&&(xe=we.signal)!==null&&xe!==void 0&&xe.aborted){let be=new o(void 0,{cause:we.signal.reason});throw this.once("error",()=>{}),await h(this.destroy(be)),be}let M=new r,oe=M.signal;if(we!=null&&we.signal){let be={once:!0,[c]:this,[f]:!0};we.signal.addEventListener("abort",()=>M.abort(),be)}let ge=!1;try{for await(let be of this){var Se;if(ge=!0,we!=null&&(Se=we.signal)!==null&&Se!==void 0&&Se.aborted)throw new o;V?ae=await H(ae,be,{signal:oe}):(ae=be,V=!0)}if(!ge&&!V)throw new j}finally{M.abort()}return ae}async function B(H){H!=null&&u(H,"options"),H?.signal!=null&&s(H.signal,"options.signal");let ae=[];for await(let xe of this){var we;if(H!=null&&(we=H.signal)!==null&&we!==void 0&&we.aborted)throw new o(void 0,{cause:H.signal.reason});b(ae,xe)}return ae}function Q(H,ae){let we=Y.call(this,H,ae);return async function*(){for await(let V of we)yield*V}.call(this)}function fe(H){if(H=S(H),A(H))return 0;if(H<0)throw new i("number",">= 0",H);return H}function Ee(H,ae=void 0){return ae!=null&&u(ae,"options"),ae?.signal!=null&&s(ae.signal,"options.signal"),H=fe(H),async function*(){var xe;if(ae!=null&&(xe=ae.signal)!==null&&xe!==void 0&&xe.aborted)throw new o;for await(let M of this){var V;if(ae!=null&&(V=ae.signal)!==null&&V!==void 0&&V.aborted)throw new o;H--<=0&&(yield M)}}.call(this)}function te(H,ae=void 0){return ae!=null&&u(ae,"options"),ae?.signal!=null&&s(ae.signal,"options.signal"),H=fe(H),async function*(){var xe;if(ae!=null&&(xe=ae.signal)!==null&&xe!==void 0&&xe.aborted)throw new o;for await(let M of this){var V;if(ae!=null&&(V=ae.signal)!==null&&V!==void 0&&V.aborted)throw new o;if(H-- >0&&(yield M),H<=0)return}}.call(this)}return nw.streamReturningOperators={asIndexedPairs:w(ie,"readable.asIndexedPairs will be removed in a future version."),drop:Ee,filter:C,flatMap:Q,map:Y,take:te,compose:$},nw.promiseReturningOperators={every:k,forEach:P,reduce:U,toArray:B,some:re,find:x},nw}function IP(){if(_P)return uA;_P=!0;let{ArrayPrototypePop:r,Promise:e}=Lr(),{isIterable:t,isNodeStream:n,isWebStream:i}=ba(),{pipelineImpl:o}=pA(),{finished:s}=Nl();NP();function a(...u){return new e((c,f)=>{let h,d,m=u[u.length-1];if(m&&typeof m=="object"&&!n(m)&&!t(m)&&!i(m)){let y=r(u);h=y.signal,d=y.end}o(u,(y,v)=>{y?f(y):c(v)},{signal:h,end:d})})}return uA={finished:s,pipeline:a},uA}function NP(){if(AP)return cA;AP=!0;let{Buffer:r}=gn(),{ObjectDefineProperty:e,ObjectKeys:t,ReflectApply:n}=Lr(),{promisify:{custom:i}}=Zn(),{streamReturningOperators:o,promiseReturningOperators:s}=dH(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:a}}=gi(),u=DP(),{setDefaultHighWaterMark:c,getDefaultHighWaterMark:f}=sw(),{pipeline:h}=pA(),{destroyer:d}=Dh(),m=Nl(),y=IP(),v=ba(),w=cA=hA().Stream;w.isDestroyed=v.isDestroyed,w.isDisturbed=v.isDisturbed,w.isErrored=v.isErrored,w.isReadable=v.isReadable,w.isWritable=v.isWritable,w.Readable=ow();for(let E of t(o)){let S=function(...A){if(new.target)throw a();return w.Readable.from(n(_,this||xP,A))},_=o[E];e(S,"name",{__proto__:null,value:_.name}),e(S,"length",{__proto__:null,value:_.length}),e(w.Readable.prototype,E,{__proto__:null,value:S,enumerable:!1,configurable:!0,writable:!0})}for(let E of t(s)){let S=function(...A){if(new.target)throw a();return n(_,this||xP,A)},_=s[E];e(S,"name",{__proto__:null,value:_.name}),e(S,"length",{__proto__:null,value:_.length}),e(w.Readable.prototype,E,{__proto__:null,value:S,enumerable:!1,configurable:!0,writable:!0})}w.Writable=dA(),w.Duplex=ya(),w.Transform=CP(),w.PassThrough=RP(),w.pipeline=h;let{addAbortSignal:b}=iw();return w.addAbortSignal=b,w.finished=m,w.destroy=d,w.compose=u,w.setDefaultHighWaterMark=c,w.getDefaultHighWaterMark=f,e(w,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return y}}),e(h,i,{__proto__:null,enumerable:!0,get(){return y.pipeline}}),e(m,i,{__proto__:null,enumerable:!0,get(){return y.finished}}),w.Stream=w,w._isUint8Array=function(_){return _ instanceof Uint8Array},w._uint8ArrayToBuffer=function(_){return r.from(_.buffer,_.byteOffset,_.byteLength)},cA}function pH(){if(SP)return kr;SP=!0;let r=NP(),e=IP(),t=r.Readable.destroy;return kr=r.Readable,kr._uint8ArrayToBuffer=r._uint8ArrayToBuffer,kr._isUint8Array=r._isUint8Array,kr.isDisturbed=r.isDisturbed,kr.isErrored=r.isErrored,kr.isReadable=r.isReadable,kr.Readable=r.Readable,kr.Writable=r.Writable,kr.Duplex=r.Duplex,kr.Transform=r.Transform,kr.PassThrough=r.PassThrough,kr.addAbortSignal=r.addAbortSignal,kr.finished=r.finished,kr.destroy=r.destroy,kr.destroy=t,kr.pipeline=r.pipeline,kr.compose=r.compose,Object.defineProperty(r,"promises",{configurable:!0,enumerable:!0,get(){return e}}),kr.Stream=r.Stream,kr.default=kr,kr}var G_,eP,Dg,tP,tw,rP,V_,nP,Y_,iP,X_,sP,rw,oP,K_,aP,Z_,lP,Ig,uP,J_,cP,Q_,fP,eA,hP,tA,dP,Ve,rA,pP,Qe,nA,gP,iA,mP,sA,yP,oA,bP,aA,wP,lA,vP,nw,EP,uA,_P,cA,AP,xP,kr,SP,dr,fA,gH,mH,yH,bH,wH,vH,EH,_H,Lg=_t(()=>{Te();Re();Ce();Jf();Rh();Ju();QL();Ch();og();k_();G_={},eP=!1;Dg={},tP=!1;tw={},rP=!1;V_={},nP=!1;Y_={},iP=!1;X_={},sP=!1;rw={},oP=!1;K_={},aP=!1;Z_={},lP=!1;Ig={},uP=!1;J_={},cP=!1;Q_={},fP=!1;eA={},hP=!1;tA={},dP=!1,Ve=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;rA={},pP=!1,Qe=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;nA={},gP=!1;iA={},mP=!1;sA={},yP=!1;oA={},bP=!1;aA={},wP=!1;lA={},vP=!1;nw={},EP=!1;uA={},_P=!1;cA={},AP=!1,xP=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;kr={},SP=!1;dr=pH();dr._uint8ArrayToBuffer;dr._isUint8Array;dr.isDisturbed;dr.isErrored;dr.isReadable;dr.Readable;dr.Writable;dr.Duplex;dr.Transform;dr.PassThrough;dr.addAbortSignal;dr.finished;dr.destroy;dr.pipeline;dr.compose;dr.Stream;fA=dr.Readable;fA.wrap=function(r,e){return e=Object.assign({objectMode:r.readableObjectMode!=null||r.objectMode!=null||!0},e),e.destroy=function(t,n){r.destroy(t),n(t)},new fA(e).wrap(r)};gH=dr.Writable,mH=dr.Duplex,yH=dr.Transform,bH=dr.PassThrough,wH=dr.finished,vH=dr.pipeline,EH=dr.Stream,_H={finished:Jb(dr.finished),pipeline:Jb(dr.pipeline)}});var PP=mt((uee,LP)=>{Te();Re();Ce();LP.exports=aw;function aw(){this.pending=0,this.max=1/0,this.listeners=[],this.waiting=[],this.error=null}aw.prototype.go=function(r){this.pending<this.max?kP(this,r):this.waiting.push(r)};aw.prototype.wait=function(r){this.pending===0?r(this.error):this.listeners.push(r)};aw.prototype.hold=function(){return OP(this)};function OP(r){r.pending+=1;var e=!1;return t;function t(i){if(e)throw new Error("callback called twice");if(e=!0,r.error=r.error||i,r.pending-=1,r.waiting.length>0&&r.pending<r.max)kP(r,r.waiting.shift());else if(r.pending===0){var o=r.listeners;r.listeners=[],o.forEach(n)}}function n(i){i(r.error)}}function kP(r,e){e(OP(r))}});var BP=mt(Mg=>{Te();Re();Ce();var Pg=(Pb(),zr(Lb)),lw=(Ch(),zr(Tg)),gA=(Lg(),zr(kg)),MP=gA.Readable,mA=gA.Writable,AH=gA.PassThrough,xH=PP(),uw=(Rh(),zr(Cg)).EventEmitter;Mg.createFromBuffer=SH;Mg.createFromFd=TH;Mg.BufferSlicer=va;Mg.FdSlicer=wa;lw.inherits(wa,uw);function wa(r,e){e=e||{},uw.call(this),this.fd=r,this.pend=new xH,this.pend.max=1,this.refCount=0,this.autoClose=!!e.autoClose}wa.prototype.read=function(r,e,t,n,i){var o=this;o.pend.go(function(s){Pg.read(o.fd,r,e,t,n,function(a,u,c){s(),i(a,u,c)})})};wa.prototype.write=function(r,e,t,n,i){var o=this;o.pend.go(function(s){Pg.write(o.fd,r,e,t,n,function(a,u,c){s(),i(a,u,c)})})};wa.prototype.createReadStream=function(r){return new cw(this,r)};wa.prototype.createWriteStream=function(r){return new fw(this,r)};wa.prototype.ref=function(){this.refCount+=1};wa.prototype.unref=function(){var r=this;if(r.refCount-=1,r.refCount>0)return;if(r.refCount<0)throw new Error("invalid unref");r.autoClose&&Pg.close(r.fd,e);function e(t){t?r.emit("error",t):r.emit("close")}};lw.inherits(cw,MP);function cw(r,e){e=e||{},MP.call(this,e),this.context=r,this.context.ref(),this.start=e.start||0,this.endOffset=e.end,this.pos=this.start,this.destroyed=!1}cw.prototype._read=function(r){var e=this;if(!e.destroyed){var t=Math.min(e._readableState.highWaterMark,r);if(e.endOffset!=null&&(t=Math.min(t,e.endOffset-e.pos)),t<=0){e.destroyed=!0,e.push(null),e.context.unref();return}e.context.pend.go(function(n){if(e.destroyed)return n();var i=He.allocUnsafe(t);Pg.read(e.context.fd,i,0,t,e.pos,function(o,s){o?e.destroy(o):s===0?(e.destroyed=!0,e.push(null),e.context.unref()):(e.pos+=s,e.push(i.slice(0,s))),n()})})}};cw.prototype.destroy=function(r){this.destroyed||(r=r||new Error("stream destroyed"),this.destroyed=!0,this.emit("error",r),this.context.unref())};lw.inherits(fw,mA);function fw(r,e){e=e||{},mA.call(this,e),this.context=r,this.context.ref(),this.start=e.start||0,this.endOffset=e.end==null?1/0:+e.end,this.bytesWritten=0,this.pos=this.start,this.destroyed=!1,this.on("finish",this.destroy.bind(this))}fw.prototype._write=function(r,e,t){var n=this;if(!n.destroyed){if(n.pos+r.length>n.endOffset){var i=new Error("maximum file length exceeded");i.code="ETOOBIG",n.destroy(),t(i);return}n.context.pend.go(function(o){if(n.destroyed)return o();Pg.write(n.context.fd,r,0,r.length,n.pos,function(s,a){s?(n.destroy(),o(),t(s)):(n.bytesWritten+=a,n.pos+=a,n.emit("progress"),o(),t())})})}};fw.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.context.unref())};lw.inherits(va,uw);function va(r,e){uw.call(this),e=e||{},this.refCount=0,this.buffer=r,this.maxChunkSize=e.maxChunkSize||Number.MAX_SAFE_INTEGER}va.prototype.read=function(r,e,t,n,i){if(!(0<=e&&e<=r.length))throw new RangeError("offset outside buffer: 0 <= "+e+" <= "+r.length);if(n<0)throw new RangeError("position is negative: "+n);if(e+t>r.length&&(t=r.length-e),n+t>this.buffer.length&&(t=this.buffer.length-n),t<=0){setImmediate(function(){i(null,0)});return}this.buffer.copy(r,e,n,n+t),setImmediate(function(){i(null,t)})};va.prototype.write=function(r,e,t,n,i){r.copy(this.buffer,n,e,e+t),setImmediate(function(){i(null,t,r)})};va.prototype.createReadStream=function(r){r=r||{};var e=new AH(r);e.destroyed=!1,e.start=r.start||0,e.endOffset=r.end,e.pos=e.endOffset||this.buffer.length;for(var t=this.buffer.slice(e.start,e.pos),n=0;;){var i=n+this.maxChunkSize;if(i>=t.length){n<t.length&&e.write(t.slice(n,t.length));break}e.write(t.slice(n,i)),n=i}return e.end(),e.destroy=function(){e.destroyed=!0},e};va.prototype.createWriteStream=function(r){var e=this;r=r||{};var t=new mA(r);return t.start=r.start||0,t.endOffset=r.end==null?this.buffer.length:+r.end,t.bytesWritten=0,t.pos=t.start,t.destroyed=!1,t._write=function(n,i,o){if(!t.destroyed){var s=t.pos+n.length;if(s>t.endOffset){var a=new Error("maximum file length exceeded");a.code="ETOOBIG",t.destroyed=!0,o(a);return}n.copy(e.buffer,t.pos,0,n.length),t.bytesWritten+=n.length,t.pos=s,t.emit("progress"),o()}},t.destroy=function(){t.destroyed=!0},t};va.prototype.ref=function(){this.refCount+=1};va.prototype.unref=function(){if(this.refCount-=1,this.refCount<0)throw new Error("invalid unref")};function SH(r,e){return new va(r,e)}function TH(r,e){return new wa(r,e)}});var jP=mt((yee,UP)=>{Te();Re();Ce();var Ol=(El(),zr(Qf)).Buffer,yA=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];typeof Int32Array<"u"&&(yA=new Int32Array(yA));function FP(r){if(Ol.isBuffer(r))return r;var e=typeof Ol.alloc=="function"&&typeof Ol.from=="function";if(typeof r=="number")return e?Ol.alloc(r):new Ol(r);if(typeof r=="string")return e?Ol.from(r):new Ol(r);throw new Error("input must be buffer, number, or string, received "+typeof r)}function CH(r){var e=FP(4);return e.writeInt32BE(r,0),e}function bA(r,e){r=FP(r),Ol.isBuffer(e)&&(e=e.readUInt32BE(0));for(var t=~~e^-1,n=0;n<r.length;n++)t=yA[(t^r[n])&255]^t>>>8;return t^-1}function wA(){return CH(bA.apply(null,arguments))}wA.signed=function(){return bA.apply(null,arguments)};wA.unsigned=function(){return bA.apply(null,arguments)>>>0};UP.exports=wA});var KP=mt(ki=>{Te();Re();Ce();var vA=(Pb(),zr(Lb)),RH=(LL(),zr(kL)),$P=BP(),DH=jP(),pw=(Ch(),zr(Tg)),gw=(Rh(),zr(Cg)).EventEmitter,WP=(Lg(),zr(kg)).Transform,_A=(Lg(),zr(kg)).PassThrough,IH=(Lg(),zr(kg)).Writable;ki.open=NH;ki.fromFd=zP;ki.fromBuffer=OH;ki.fromRandomAccessReader=AA;ki.dosDateTimeToDate=GP;ki.getFileNameLowLevel=VP;ki.validateFileName=YP;ki.parseExtraFields=XP;ki.ZipFile=Eo;ki.Entry=Bg;ki.LocalFileHeader=qP;ki.RandomAccessReader=kl;function NH(r,e,t){typeof e=="function"&&(t=e,e=null),e==null&&(e={}),e.autoClose==null&&(e.autoClose=!0),e.lazyEntries==null&&(e.lazyEntries=!1),e.decodeStrings==null&&(e.decodeStrings=!0),e.validateEntrySizes==null&&(e.validateEntrySizes=!0),e.strictFileNames==null&&(e.strictFileNames=!1),t==null&&(t=dw),vA.open(r,"r",function(n,i){if(n)return t(n);zP(i,e,function(o,s){o&&vA.close(i,dw),t(o,s)})})}function zP(r,e,t){typeof e=="function"&&(t=e,e=null),e==null&&(e={}),e.autoClose==null&&(e.autoClose=!1),e.lazyEntries==null&&(e.lazyEntries=!1),e.decodeStrings==null&&(e.decodeStrings=!0),e.validateEntrySizes==null&&(e.validateEntrySizes=!0),e.strictFileNames==null&&(e.strictFileNames=!1),t==null&&(t=dw),vA.fstat(r,function(n,i){if(n)return t(n);var o=$P.createFromFd(r,{autoClose:!0});AA(o,i.size,e,t)})}function OH(r,e,t){typeof e=="function"&&(t=e,e=null),e==null&&(e={}),e.autoClose=!1,e.lazyEntries==null&&(e.lazyEntries=!1),e.decodeStrings==null&&(e.decodeStrings=!0),e.validateEntrySizes==null&&(e.validateEntrySizes=!0),e.strictFileNames==null&&(e.strictFileNames=!1);var n=$P.createFromBuffer(r,{maxChunkSize:65536});AA(n,r.length,e,t)}function AA(r,e,t,n){typeof t=="function"&&(n=t,t=null),t==null&&(t={}),t.autoClose==null&&(t.autoClose=!0),t.lazyEntries==null&&(t.lazyEntries=!1),t.decodeStrings==null&&(t.decodeStrings=!0);var i=!!t.decodeStrings;if(t.validateEntrySizes==null&&(t.validateEntrySizes=!0),t.strictFileNames==null&&(t.strictFileNames=!1),n==null&&(n=dw),typeof e!="number")throw new Error("expected totalSize parameter to be a number");if(e>Number.MAX_SAFE_INTEGER)throw new Error("zip file too large. only file sizes up to 2^52 are supported due to JavaScript's Number type being an IEEE 754 double.");r.ref();var o=22,s=20,a=65535,u=Math.min(s+o+a,e),c=Ea(u),f=e-c.length;Nh(r,c,0,u,f,function(h){if(h)return n(h);for(var d=u-o;d>=0;d-=1)if(c.readUInt32LE(d)===101010256){var m=c.subarray(d),y=m.readUInt16LE(4),v=m.readUInt16LE(10),w=m.readUInt32LE(16),b=m.readUInt16LE(20),E=m.length-o;if(b!==E)return n(new Error("Invalid comment length. Expected: "+E+". Found: "+b+". Are there extra bytes at the end of the file? Or is the end of central dir signature `PK\u263A\u263B` in the comment?"));var _=i?hw(m.subarray(22),!1):m.subarray(22);if(d-s>=0&&c.readUInt32LE(d-s)===117853008){var S=c.subarray(d-s,d-s+s),A=Ih(S,8),F=Ea(56);return Nh(r,F,0,F.length,A,function(I){return I?n(I):F.readUInt32LE(0)!==101075792?n(new Error("invalid zip64 end of central directory record signature")):(y=F.readUInt32LE(16),y!==0?n(new Error("multi-disk zip files are not supported: found disk number: "+y)):(v=Ih(F,32),w=Ih(F,48),n(null,new Eo(r,w,e,v,_,t.autoClose,t.lazyEntries,i,t.validateEntrySizes,t.strictFileNames))))})}return y!==0?n(new Error("multi-disk zip files are not supported: found disk number: "+y)):n(null,new Eo(r,w,e,v,_,t.autoClose,t.lazyEntries,i,t.validateEntrySizes,t.strictFileNames))}n(new Error("End of central directory record signature not found. Either not a zip file, or file is truncated."))})}pw.inherits(Eo,gw);function Eo(r,e,t,n,i,o,s,a,u,c){var f=this;gw.call(f),f.reader=r,f.reader.on("error",function(h){HP(f,h)}),f.reader.once("close",function(){f.emit("close")}),f.readEntryCursor=e,f.fileSize=t,f.entryCount=n,f.comment=i,f.entriesRead=0,f.autoClose=!!o,f.lazyEntries=!!s,f.decodeStrings=!!a,f.validateEntrySizes=!!u,f.strictFileNames=!!c,f.isOpen=!0,f.emittedError=!1,f.lazyEntries||f._readEntry()}Eo.prototype.close=function(){this.isOpen&&(this.isOpen=!1,this.reader.unref())};function vo(r,e){r.autoClose&&r.close(),HP(r,e)}function HP(r,e){r.emittedError||(r.emittedError=!0,r.emit("error",e))}Eo.prototype.readEntry=function(){if(!this.lazyEntries)throw new Error("readEntry() called without lazyEntries:true");this._readEntry()};Eo.prototype._readEntry=function(){var r=this;if(r.entryCount===r.entriesRead){setImmediate(function(){r.autoClose&&r.close(),!r.emittedError&&r.emit("end")});return}if(!r.emittedError){var e=Ea(46);Nh(r.reader,e,0,e.length,r.readEntryCursor,function(t){if(t)return vo(r,t);if(!r.emittedError){var n=new Bg,i=e.readUInt32LE(0);if(i!==33639248)return vo(r,new Error("invalid central directory file header signature: 0x"+i.toString(16)));if(n.versionMadeBy=e.readUInt16LE(4),n.versionNeededToExtract=e.readUInt16LE(6),n.generalPurposeBitFlag=e.readUInt16LE(8),n.compressionMethod=e.readUInt16LE(10),n.lastModFileTime=e.readUInt16LE(12),n.lastModFileDate=e.readUInt16LE(14),n.crc32=e.readUInt32LE(16),n.compressedSize=e.readUInt32LE(20),n.uncompressedSize=e.readUInt32LE(24),n.fileNameLength=e.readUInt16LE(28),n.extraFieldLength=e.readUInt16LE(30),n.fileCommentLength=e.readUInt16LE(32),n.internalFileAttributes=e.readUInt16LE(36),n.externalFileAttributes=e.readUInt32LE(38),n.relativeOffsetOfLocalHeader=e.readUInt32LE(42),n.generalPurposeBitFlag&64)return vo(r,new Error("strong encryption is not supported"));r.readEntryCursor+=46,e=Ea(n.fileNameLength+n.extraFieldLength+n.fileCommentLength),Nh(r.reader,e,0,e.length,r.readEntryCursor,function(o){if(o)return vo(r,o);if(!r.emittedError){n.fileNameRaw=e.subarray(0,n.fileNameLength);var s=n.fileNameLength+n.extraFieldLength;n.extraFieldRaw=e.subarray(n.fileNameLength,s),n.fileCommentRaw=e.subarray(s,s+n.fileCommentLength);try{n.extraFields=XP(n.extraFieldRaw)}catch(v){return vo(r,v)}if(r.decodeStrings){var a=(n.generalPurposeBitFlag&2048)!==0;n.fileComment=hw(n.fileCommentRaw,a),n.fileName=VP(n.generalPurposeBitFlag,n.fileNameRaw,n.extraFields,r.strictFileNames);var u=YP(n.fileName);if(u!=null)return vo(r,new Error(u))}else n.fileComment=n.fileCommentRaw,n.fileName=n.fileNameRaw;n.comment=n.fileComment,r.readEntryCursor+=e.length,r.entriesRead+=1;for(var c=0;c<n.extraFields.length;c++){var f=n.extraFields[c];if(f.id===1){var h=f.data,d=0;if(n.uncompressedSize===4294967295){if(d+8>h.length)return vo(r,new Error("zip64 extended information extra field does not include uncompressed size"));n.uncompressedSize=Ih(h,d),d+=8}if(n.compressedSize===4294967295){if(d+8>h.length)return vo(r,new Error("zip64 extended information extra field does not include compressed size"));n.compressedSize=Ih(h,d),d+=8}if(n.relativeOffsetOfLocalHeader===4294967295){if(d+8>h.length)return vo(r,new Error("zip64 extended information extra field does not include relative header offset"));n.relativeOffsetOfLocalHeader=Ih(h,d),d+=8}break}}if(r.validateEntrySizes&&n.compressionMethod===0){var m=n.uncompressedSize;if(n.isEncrypted()&&(m+=12),n.compressedSize!==m){var y="compressed/uncompressed size mismatch for stored file: "+n.compressedSize+" != "+n.uncompressedSize;return vo(r,new Error(y))}}r.emit("entry",n),r.lazyEntries||r._readEntry()}})}})}};Eo.prototype.openReadStream=function(r,e,t){var n=this,i=0,o=r.compressedSize;if(t==null&&(t=e,e=null),e==null)e={};else{if(e.decrypt!=null){if(!r.isEncrypted())throw new Error("options.decrypt can only be specified for encrypted entries");if(e.decrypt!==!1)throw new Error("invalid options.decrypt value: "+e.decrypt);if(r.isCompressed()&&e.decompress!==!1)throw new Error("entry is encrypted and compressed, and options.decompress !== false")}if(e.decompress!=null){if(!r.isCompressed())throw new Error("options.decompress can only be specified for compressed entries");if(!(e.decompress===!1||e.decompress===!0))throw new Error("invalid options.decompress value: "+e.decompress)}if(e.start!=null||e.end!=null){if(r.isCompressed()&&e.decompress!==!1)throw new Error("start/end range not allowed for compressed entry without options.decompress === false");if(r.isEncrypted()&&e.decrypt!==!1)throw new Error("start/end range not allowed for encrypted entry without options.decrypt === false")}if(e.start!=null){if(i=e.start,i<0)throw new Error("options.start < 0");if(i>r.compressedSize)throw new Error("options.start > entry.compressedSize")}if(e.end!=null){if(o=e.end,o<0)throw new Error("options.end < 0");if(o>r.compressedSize)throw new Error("options.end > entry.compressedSize");if(o<i)throw new Error("options.end < options.start")}}if(!n.isOpen)return t(new Error("closed"));if(r.isEncrypted()&&e.decrypt!==!1)return t(new Error("entry is encrypted, and options.decrypt !== false"));var s;if(r.compressionMethod===0)s=!1;else if(r.compressionMethod===8)s=e.decompress!=null?e.decompress:!0;else return t(new Error("unsupported compression method: "+r.compressionMethod));n.readLocalFileHeader(r,{minimal:!0},function(a,u){if(a)return t(a);n.openReadStreamLowLevel(u.fileDataStart,r.compressedSize,i,o,s,r.uncompressedSize,t)})};Eo.prototype.openReadStreamLowLevel=function(r,e,t,n,i,o,s){var a=this,u=r+e,c=a.reader.createReadStream({start:r+t,end:r+n}),f=c;if(i){var h=!1,d=RH.createInflateRaw();c.on("error",function(m){setImmediate(function(){h||d.emit("error",m)})}),c.pipe(d),a.validateEntrySizes?(f=new Fg(o),d.on("error",function(m){setImmediate(function(){h||f.emit("error",m)})}),d.pipe(f)):f=d,EA(f,function(){h=!0,d!==f&&d.unpipe(f),c.unpipe(d),c.destroy()})}s(null,f)};Eo.prototype.readLocalFileHeader=function(r,e,t){var n=this;t==null&&(t=e,e=null),e==null&&(e={}),n.reader.ref();var i=Ea(30);Nh(n.reader,i,0,i.length,r.relativeOffsetOfLocalHeader,function(o){try{if(o)return t(o);var s=i.readUInt32LE(0);if(s!==67324752)return t(new Error("invalid local file header signature: 0x"+s.toString(16)));var a=i.readUInt16LE(26),u=i.readUInt16LE(28),c=r.relativeOffsetOfLocalHeader+30+a+u;if(c+r.compressedSize>n.fileSize)return t(new Error("file data overflows file bounds: "+c+" + "+r.compressedSize+" > "+n.fileSize));if(e.minimal)return t(null,{fileDataStart:c});var f=new qP;f.fileDataStart=c,f.versionNeededToExtract=i.readUInt16LE(4),f.generalPurposeBitFlag=i.readUInt16LE(6),f.compressionMethod=i.readUInt16LE(8),f.lastModFileTime=i.readUInt16LE(10),f.lastModFileDate=i.readUInt16LE(12),f.crc32=i.readUInt32LE(14),f.compressedSize=i.readUInt32LE(18),f.uncompressedSize=i.readUInt32LE(22),f.fileNameLength=a,f.extraFieldLength=u,i=Ea(a+u),n.reader.ref(),Nh(n.reader,i,0,i.length,r.relativeOffsetOfLocalHeader+30,function(h){try{return h?t(h):(f.fileName=i.subarray(0,a),f.extraField=i.subarray(a),t(null,f))}finally{n.reader.unref()}})}finally{n.reader.unref()}})};function Bg(){}Bg.prototype.getLastModDate=function(r){if(r==null&&(r={}),!r.forceDosFormat)for(var e=0;e<this.extraFields.length;e++){var t=this.extraFields[e];if(t.id===21589){var n=t.data;if(n.length<5)continue;var i=n[0],o=1;if(!(i&o))continue;var s=n.readInt32LE(1);return new Date(s*1e3)}else if(t.id===10){var n=t.data;if(n.length!==32||n.readUInt16LE(4)!==1||n.readUInt16LE(6)!==24)continue;var a=n.readUInt32LE(8)+4294967296*n.readInt32LE(12),u=a/1e4-116444736e5;return new Date(u)}}return GP(this.lastModFileDate,this.lastModFileTime,r.timezone)};Bg.prototype.isEncrypted=function(){return(this.generalPurposeBitFlag&1)!==0};Bg.prototype.isCompressed=function(){return this.compressionMethod===8};function qP(){}function GP(r,e,t){var n=r&31,i=(r>>5&15)-1,o=(r>>9&127)+1980,s=0,a=(e&31)*2,u=e>>5&63,c=e>>11&31;if(t==null||t==="local")return new Date(o,i,n,c,u,a,s);if(t==="UTC")return new Date(Date.UTC(o,i,n,c,u,a,s));throw new Error("unrecognized options.timezone: "+options.timezone)}function VP(r,e,t,n){for(var i=null,o=0;o<t.length;o++){var s=t[o];if(s.id===28789){if(s.data.length<6||s.data.readUInt8(0)!==1)continue;var a=s.data.readUInt32LE(1);if(DH.unsigned(e)!==a)continue;i=hw(s.data.subarray(5),!0);break}}if(i==null){var u=(r&2048)!==0;i=hw(e,u)}return n||(i=i.replace(/\\/g,"/")),i}function YP(r){return r.indexOf("\\")!==-1?"invalid characters in fileName: "+r:/^[a-zA-Z]:/.test(r)||/^\//.test(r)?"absolute path: "+r:r.split("/").indexOf("..")!==-1?"invalid relative path: "+r:null}function XP(r){for(var e=[],t=0;t<r.length-3;){var n=r.readUInt16LE(t+0),i=r.readUInt16LE(t+2),o=t+4,s=o+i;if(s>r.length)throw new Error("extra field length exceeds extra field buffer size");var a=r.subarray(o,s);e.push({id:n,data:a}),t=s}return e}function Nh(r,e,t,n,i,o){if(n===0)return setImmediate(function(){o(null,Ea(0))});r.read(e,t,n,i,function(s,a){if(s)return o(s);if(a<n)return o(new Error("unexpected EOF"));o()})}pw.inherits(Fg,WP);function Fg(r){WP.call(this),this.actualByteCount=0,this.expectedByteCount=r}Fg.prototype._transform=function(r,e,t){if(this.actualByteCount+=r.length,this.actualByteCount>this.expectedByteCount){var n="too many bytes in the stream. expected "+this.expectedByteCount+". got at least "+this.actualByteCount;return t(new Error(n))}t(null,r)};Fg.prototype._flush=function(r){if(this.actualByteCount<this.expectedByteCount){var e="not enough bytes in the stream. expected "+this.expectedByteCount+". got only "+this.actualByteCount;return r(new Error(e))}r()};pw.inherits(kl,gw);function kl(){gw.call(this),this.refCount=0}kl.prototype.ref=function(){this.refCount+=1};kl.prototype.unref=function(){var r=this;if(r.refCount-=1,r.refCount>0)return;if(r.refCount<0)throw new Error("invalid unref");r.close(e);function e(t){if(t)return r.emit("error",t);r.emit("close")}};kl.prototype.createReadStream=function(r){r==null&&(r={});var e=r.start,t=r.end;if(e===t){var n=new _A;return setImmediate(function(){n.end()}),n}var i=this._readStreamForRange(e,t),o=!1,s=new mw(this);i.on("error",function(u){setImmediate(function(){o||s.emit("error",u)})}),EA(s,function(){i.unpipe(s),s.unref(),i.destroy()});var a=new Fg(t-e);return s.on("error",function(u){setImmediate(function(){o||a.emit("error",u)})}),EA(a,function(){o=!0,s.unpipe(a),s.destroy()}),i.pipe(s).pipe(a)};kl.prototype._readStreamForRange=function(r,e){throw new Error("not implemented")};kl.prototype.read=function(r,e,t,n,i){var o=this.createReadStream({start:n,end:n+t}),s=new IH,a=0;s._write=function(u,c,f){u.copy(r,e+a,0,u.length),a+=u.length,f()},s.on("finish",i),o.on("error",function(u){i(u)}),o.pipe(s)};kl.prototype.close=function(r){setImmediate(r)};pw.inherits(mw,_A);function mw(r){_A.call(this),this.context=r,this.context.ref(),this.unreffedYet=!1}mw.prototype._flush=function(r){this.unref(),r()};mw.prototype.unref=function(r){this.unreffedYet||(this.unreffedYet=!0,this.context.unref())};var kH="\0\u263A\u263B\u2665\u2666\u2663\u2660\u2022\u25D8\u25CB\u25D9\u2642\u2640\u266A\u266B\u263C\u25BA\u25C4\u2195\u203C\xB6\xA7\u25AC\u21A8\u2191\u2193\u2192\u2190\u221F\u2194\u25B2\u25BC !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0";function hw(r,e){if(e)return r.toString("utf8");for(var t="",n=0;n<r.length;n++)t+=kH[r[n]];return t}function Ih(r,e){var t=r.readUInt32LE(e),n=r.readUInt32LE(e+4);return n*4294967296+t}var Ea;typeof He.allocUnsafe=="function"?Ea=function(r){return He.allocUnsafe(r)}:Ea=function(r){return new He(r)};function EA(r,e){typeof r.destroy=="function"?r._destroy=function(t,n){e(),n?.(t)}:r.destroy=e}function dw(r){if(r)throw r}});var xA=mt((See,ZP)=>{Te();Re();Ce();ZP.exports=(Rh(),zr(Cg)).EventEmitter});var nM=mt((Dee,rM)=>{"use strict";Te();Re();Ce();function JP(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function QP(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?JP(Object(t),!0).forEach(function(n){LH(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):JP(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function LH(r,e,t){return e=tM(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function PH(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function eM(r,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,tM(n.key),n)}}function MH(r,e,t){return e&&eM(r.prototype,e),t&&eM(r,t),Object.defineProperty(r,"prototype",{writable:!1}),r}function tM(r){var e=BH(r,"string");return typeof e=="symbol"?e:String(e)}function BH(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var FH=(El(),zr(Qf)),yw=FH.Buffer,UH=(Ch(),zr(Tg)),SA=UH.inspect,jH=SA&&SA.custom||"inspect";function $H(r,e,t){yw.prototype.copy.call(r,e,t)}rM.exports=(function(){function r(){PH(this,r),this.head=null,this.tail=null,this.length=0}return MH(r,[{key:"push",value:function(t){var n={data:t,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length}},{key:"unshift",value:function(t){var n={data:t,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length}},{key:"shift",value:function(){if(this.length!==0){var t=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(this.length===0)return"";for(var n=this.head,i=""+n.data;n=n.next;)i+=t+n.data;return i}},{key:"concat",value:function(t){if(this.length===0)return yw.alloc(0);for(var n=yw.allocUnsafe(t>>>0),i=this.head,o=0;i;)$H(i.data,n,o),o+=i.data.length,i=i.next;return n}},{key:"consume",value:function(t,n){var i;return t<this.head.data.length?(i=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):t===this.head.data.length?i=this.shift():i=n?this._getString(t):this._getBuffer(t),i}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var n=this.head,i=1,o=n.data;for(t-=o.length;n=n.next;){var s=n.data,a=t>s.length?s.length:t;if(a===s.length?o+=s:o+=s.slice(0,t),t-=a,t===0){a===s.length?(++i,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=s.slice(a));break}++i}return this.length-=i,o}},{key:"_getBuffer",value:function(t){var n=yw.allocUnsafe(t),i=this.head,o=1;for(i.data.copy(n),t-=i.data.length;i=i.next;){var s=i.data,a=t>s.length?s.length:t;if(s.copy(n,n.length-t,0,a),t-=a,t===0){a===s.length?(++o,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=s.slice(a));break}++o}return this.length-=o,n}},{key:jH,value:function(t,n){return SA(this,QP(QP({},n),{},{depth:0,customInspect:!1}))}}]),r})()});var CA=mt((kee,sM)=>{"use strict";Te();Re();Ce();function WH(r,e){var t=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(e?e(r):r&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,We.nextTick(TA,this,r)):We.nextTick(TA,this,r)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(r||null,function(o){!e&&o?t._writableState?t._writableState.errorEmitted?We.nextTick(bw,t):(t._writableState.errorEmitted=!0,We.nextTick(iM,t,o)):We.nextTick(iM,t,o):e?(We.nextTick(bw,t),e(o)):We.nextTick(bw,t)}),this)}function iM(r,e){TA(r,e),bw(r)}function bw(r){r._writableState&&!r._writableState.emitClose||r._readableState&&!r._readableState.emitClose||r.emit("close")}function zH(){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 TA(r,e){r.emit("error",e)}function HH(r,e){var t=r._readableState,n=r._writableState;t&&t.autoDestroy||n&&n.autoDestroy?r.destroy(e):r.emit("error",e)}sM.exports={destroy:WH,undestroy:zH,errorOrDestroy:HH}});var hc=mt((Bee,lM)=>{"use strict";Te();Re();Ce();function qH(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.__proto__=e}var aM={};function ps(r,e,t){t||(t=Error);function n(o,s,a){return typeof e=="string"?e:e(o,s,a)}var i=(function(o){qH(s,o);function s(a,u,c){return o.call(this,n(a,u,c))||this}return s})(t);i.prototype.name=t.name,i.prototype.code=r,aM[r]=i}function oM(r,e){if(Array.isArray(r)){var t=r.length;return r=r.map(function(n){return String(n)}),t>2?"one of ".concat(e," ").concat(r.slice(0,t-1).join(", "),", or ")+r[t-1]:t===2?"one of ".concat(e," ").concat(r[0]," or ").concat(r[1]):"of ".concat(e," ").concat(r[0])}else return"of ".concat(e," ").concat(String(r))}function GH(r,e,t){return r.substr(!t||t<0?0:+t,e.length)===e}function VH(r,e,t){return(t===void 0||t>r.length)&&(t=r.length),r.substring(t-e.length,t)===e}function YH(r,e,t){return typeof t!="number"&&(t=0),t+e.length>r.length?!1:r.indexOf(e,t)!==-1}ps("ERR_INVALID_OPT_VALUE",function(r,e){return'The value "'+e+'" is invalid for option "'+r+'"'},TypeError);ps("ERR_INVALID_ARG_TYPE",function(r,e,t){var n;typeof e=="string"&&GH(e,"not ")?(n="must not be",e=e.replace(/^not /,"")):n="must be";var i;if(VH(r," argument"))i="The ".concat(r," ").concat(n," ").concat(oM(e,"type"));else{var o=YH(r,".")?"property":"argument";i='The "'.concat(r,'" ').concat(o," ").concat(n," ").concat(oM(e,"type"))}return i+=". Received type ".concat(typeof t),i},TypeError);ps("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");ps("ERR_METHOD_NOT_IMPLEMENTED",function(r){return"The "+r+" method is not implemented"});ps("ERR_STREAM_PREMATURE_CLOSE","Premature close");ps("ERR_STREAM_DESTROYED",function(r){return"Cannot call "+r+" after a stream was destroyed"});ps("ERR_MULTIPLE_CALLBACK","Callback called multiple times");ps("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");ps("ERR_STREAM_WRITE_AFTER_END","write after end");ps("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);ps("ERR_UNKNOWN_ENCODING",function(r){return"Unknown encoding: "+r},TypeError);ps("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");lM.exports.codes=aM});var RA=mt(($ee,uM)=>{"use strict";Te();Re();Ce();var XH=hc().codes.ERR_INVALID_OPT_VALUE;function KH(r,e,t){return r.highWaterMark!=null?r.highWaterMark:e?r[t]:null}function ZH(r,e,t,n){var i=KH(e,n,t);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var o=n?t:"highWaterMark";throw new XH(o,i)}return Math.floor(i)}return r.objectMode?16:16*1024}uM.exports={getHighWaterMark:ZH}});var dc=mt((qee,DA)=>{Te();Re();Ce();typeof Object.create=="function"?DA.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:DA.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}});var fM=mt((Xee,cM)=>{Te();Re();Ce();cM.exports=JH;function JH(r,e){if(IA("noDeprecation"))return r;var t=!1;function n(){if(!t){if(IA("throwDeprecation"))throw new Error(e);IA("traceDeprecation")?console.trace(e):console.warn(e),t=!0}return r.apply(this,arguments)}return n}function IA(r){try{if(!window.localStorage)return!1}catch{return!1}var e=window.localStorage[r];return e==null?!1:String(e).toLowerCase()==="true"}});var kA=mt((Qee,yM)=>{"use strict";Te();Re();Ce();yM.exports=Pr;function dM(r){var e=this;this.next=null,this.entry=null,this.finish=function(){Sq(e,r)}}var Oh;Pr.WritableState=jg;var QH={deprecate:fM()},pM=xA(),vw=(El(),zr(Qf)).Buffer,eq=(typeof window<"u"||typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function tq(r){return vw.from(r)}function rq(r){return vw.isBuffer(r)||r instanceof eq}var OA=CA(),nq=RA(),iq=nq.getHighWaterMark,Ll=hc().codes,sq=Ll.ERR_INVALID_ARG_TYPE,oq=Ll.ERR_METHOD_NOT_IMPLEMENTED,aq=Ll.ERR_MULTIPLE_CALLBACK,lq=Ll.ERR_STREAM_CANNOT_PIPE,uq=Ll.ERR_STREAM_DESTROYED,cq=Ll.ERR_STREAM_NULL_VALUES,fq=Ll.ERR_STREAM_WRITE_AFTER_END,hq=Ll.ERR_UNKNOWN_ENCODING,kh=OA.errorOrDestroy;dc()(Pr,pM);function dq(){}function jg(r,e,t){Oh=Oh||pc(),r=r||{},typeof t!="boolean"&&(t=e instanceof Oh),this.objectMode=!!r.objectMode,t&&(this.objectMode=this.objectMode||!!r.writableObjectMode),this.highWaterMark=iq(this,r,"writableHighWaterMark",t),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var n=r.decodeStrings===!1;this.decodeStrings=!n,this.defaultEncoding=r.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(i){vq(e,i)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=r.emitClose!==!1,this.autoDestroy=!!r.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new dM(this)}jg.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t};(function(){try{Object.defineProperty(jg.prototype,"buffer",{get:QH.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var ww;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(ww=Function.prototype[Symbol.hasInstance],Object.defineProperty(Pr,Symbol.hasInstance,{value:function(e){return ww.call(this,e)?!0:this!==Pr?!1:e&&e._writableState instanceof jg}})):ww=function(e){return e instanceof this};function Pr(r){Oh=Oh||pc();var e=this instanceof Oh;if(!e&&!ww.call(Pr,this))return new Pr(r);this._writableState=new jg(r,this,e),this.writable=!0,r&&(typeof r.write=="function"&&(this._write=r.write),typeof r.writev=="function"&&(this._writev=r.writev),typeof r.destroy=="function"&&(this._destroy=r.destroy),typeof r.final=="function"&&(this._final=r.final)),pM.call(this)}Pr.prototype.pipe=function(){kh(this,new lq)};function pq(r,e){var t=new fq;kh(r,t),We.nextTick(e,t)}function gq(r,e,t,n){var i;return t===null?i=new cq:typeof t!="string"&&!e.objectMode&&(i=new sq("chunk",["string","Buffer"],t)),i?(kh(r,i),We.nextTick(n,i),!1):!0}Pr.prototype.write=function(r,e,t){var n=this._writableState,i=!1,o=!n.objectMode&&rq(r);return o&&!vw.isBuffer(r)&&(r=tq(r)),typeof e=="function"&&(t=e,e=null),o?e="buffer":e||(e=n.defaultEncoding),typeof t!="function"&&(t=dq),n.ending?pq(this,t):(o||gq(this,n,r,t))&&(n.pendingcb++,i=yq(this,n,o,r,e,t)),i};Pr.prototype.cork=function(){this._writableState.corked++};Pr.prototype.uncork=function(){var r=this._writableState;r.corked&&(r.corked--,!r.writing&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&gM(this,r))};Pr.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 hq(e);return this._writableState.defaultEncoding=e,this};Object.defineProperty(Pr.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function mq(r,e,t){return!r.objectMode&&r.decodeStrings!==!1&&typeof e=="string"&&(e=vw.from(e,t)),e}Object.defineProperty(Pr.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function yq(r,e,t,n,i,o){if(!t){var s=mq(e,n,i);n!==s&&(t=!0,i="buffer",n=s)}var a=e.objectMode?1:n.length;e.length+=a;var u=e.length<e.highWaterMark;if(u||(e.needDrain=!0),e.writing||e.corked){var c=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:t,callback:o,next:null},c?c.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else NA(r,e,!1,a,n,i,o);return u}function NA(r,e,t,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new uq("write")):t?r._writev(i,e.onwrite):r._write(i,o,e.onwrite),e.sync=!1}function bq(r,e,t,n,i){--e.pendingcb,t?(We.nextTick(i,n),We.nextTick(Ug,r,e),r._writableState.errorEmitted=!0,kh(r,n)):(i(n),r._writableState.errorEmitted=!0,kh(r,n),Ug(r,e))}function wq(r){r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0}function vq(r,e){var t=r._writableState,n=t.sync,i=t.writecb;if(typeof i!="function")throw new aq;if(wq(t),e)bq(r,t,n,e,i);else{var o=mM(t)||r.destroyed;!o&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&gM(r,t),n?We.nextTick(hM,r,t,o,i):hM(r,t,o,i)}}function hM(r,e,t,n){t||Eq(r,e),e.pendingcb--,n(),Ug(r,e)}function Eq(r,e){e.length===0&&e.needDrain&&(e.needDrain=!1,r.emit("drain"))}function gM(r,e){e.bufferProcessing=!0;var t=e.bufferedRequest;if(r._writev&&t&&t.next){var n=e.bufferedRequestCount,i=new Array(n),o=e.corkedRequestsFree;o.entry=t;for(var s=0,a=!0;t;)i[s]=t,t.isBuf||(a=!1),t=t.next,s+=1;i.allBuffers=a,NA(r,e,!0,e.length,i,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new dM(e),e.bufferedRequestCount=0}else{for(;t;){var u=t.chunk,c=t.encoding,f=t.callback,h=e.objectMode?1:u.length;if(NA(r,e,!1,h,u,c,f),t=t.next,e.bufferedRequestCount--,e.writing)break}t===null&&(e.lastBufferedRequest=null)}e.bufferedRequest=t,e.bufferProcessing=!1}Pr.prototype._write=function(r,e,t){t(new oq("_write()"))};Pr.prototype._writev=null;Pr.prototype.end=function(r,e,t){var n=this._writableState;return typeof r=="function"?(t=r,r=null,e=null):typeof e=="function"&&(t=e,e=null),r!=null&&this.write(r,e),n.corked&&(n.corked=1,this.uncork()),n.ending||xq(this,n,t),this};Object.defineProperty(Pr.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function mM(r){return r.ending&&r.length===0&&r.bufferedRequest===null&&!r.finished&&!r.writing}function _q(r,e){r._final(function(t){e.pendingcb--,t&&kh(r,t),e.prefinished=!0,r.emit("prefinish"),Ug(r,e)})}function Aq(r,e){!e.prefinished&&!e.finalCalled&&(typeof r._final=="function"&&!e.destroyed?(e.pendingcb++,e.finalCalled=!0,We.nextTick(_q,r,e)):(e.prefinished=!0,r.emit("prefinish")))}function Ug(r,e){var t=mM(e);if(t&&(Aq(r,e),e.pendingcb===0&&(e.finished=!0,r.emit("finish"),e.autoDestroy))){var n=r._readableState;(!n||n.autoDestroy&&n.endEmitted)&&r.destroy()}return t}function xq(r,e,t){e.ending=!0,Ug(r,e),t&&(e.finished?We.nextTick(t):r.once("finish",t)),e.ended=!0,r.writable=!1}function Sq(r,e,t){var n=r.entry;for(r.entry=null;n;){var i=n.callback;e.pendingcb--,i(t),n=n.next}e.corkedRequestsFree.next=r}Object.defineProperty(Pr.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}});Pr.prototype.destroy=OA.destroy;Pr.prototype._undestroy=OA.undestroy;Pr.prototype._destroy=function(r,e){e(r)}});var pc=mt((nte,wM)=>{"use strict";Te();Re();Ce();var Tq=Object.keys||function(r){var e=[];for(var t in r)e.push(t);return e};wM.exports=_o;var bM=MA(),PA=kA();dc()(_o,bM);for(LA=Tq(PA.prototype),Ew=0;Ew<LA.length;Ew++)_w=LA[Ew],_o.prototype[_w]||(_o.prototype[_w]=PA.prototype[_w]);var LA,_w,Ew;function _o(r){if(!(this instanceof _o))return new _o(r);bM.call(this,r),PA.call(this,r),this.allowHalfOpen=!0,r&&(r.readable===!1&&(this.readable=!1),r.writable===!1&&(this.writable=!1),r.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",Cq)))}Object.defineProperty(_o.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(_o.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(_o.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function Cq(){this._writableState.ended||We.nextTick(Rq,this)}function Rq(r){r.end()}Object.defineProperty(_o.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}})});var _M=mt((BA,EM)=>{Te();Re();Ce();var Aw=(El(),zr(Qf)),_a=Aw.Buffer;function vM(r,e){for(var t in r)e[t]=r[t]}_a.from&&_a.alloc&&_a.allocUnsafe&&_a.allocUnsafeSlow?EM.exports=Aw:(vM(Aw,BA),BA.Buffer=Lh);function Lh(r,e,t){return _a(r,e,t)}vM(_a,Lh);Lh.from=function(r,e,t){if(typeof r=="number")throw new TypeError("Argument must not be a number");return _a(r,e,t)};Lh.alloc=function(r,e,t){if(typeof r!="number")throw new TypeError("Argument must be a number");var n=_a(r);return e!==void 0?typeof t=="string"?n.fill(e,t):n.fill(e):n.fill(0),n};Lh.allocUnsafe=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return _a(r)};Lh.allocUnsafeSlow=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return Aw.SlowBuffer(r)}});var jA=mt(xM=>{"use strict";Te();Re();Ce();var UA=_M().Buffer,AM=UA.isEncoding||function(r){switch(r=""+r,r&&r.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 Dq(r){if(!r)return"utf8";for(var e;;)switch(r){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 r;default:if(e)return;r=(""+r).toLowerCase(),e=!0}}function Iq(r){var e=Dq(r);if(typeof e!="string"&&(UA.isEncoding===AM||!AM(r)))throw new Error("Unknown encoding: "+r);return e||r}xM.StringDecoder=$g;function $g(r){this.encoding=Iq(r);var e;switch(this.encoding){case"utf16le":this.text=Mq,this.end=Bq,e=4;break;case"utf8":this.fillLast=kq,e=4;break;case"base64":this.text=Fq,this.end=Uq,e=3;break;default:this.write=jq,this.end=$q;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=UA.allocUnsafe(e)}$g.prototype.write=function(r){if(r.length===0)return"";var e,t;if(this.lastNeed){if(e=this.fillLast(r),e===void 0)return"";t=this.lastNeed,this.lastNeed=0}else t=0;return t<r.length?e?e+this.text(r,t):this.text(r,t):e||""};$g.prototype.end=Pq;$g.prototype.text=Lq;$g.prototype.fillLast=function(r){if(this.lastNeed<=r.length)return r.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);r.copy(this.lastChar,this.lastTotal-this.lastNeed,0,r.length),this.lastNeed-=r.length};function FA(r){return r<=127?0:r>>5===6?2:r>>4===14?3:r>>3===30?4:r>>6===2?-1:-2}function Nq(r,e,t){var n=e.length-1;if(n<t)return 0;var i=FA(e[n]);return i>=0?(i>0&&(r.lastNeed=i-1),i):--n<t||i===-2?0:(i=FA(e[n]),i>=0?(i>0&&(r.lastNeed=i-2),i):--n<t||i===-2?0:(i=FA(e[n]),i>=0?(i>0&&(i===2?i=0:r.lastNeed=i-3),i):0))}function Oq(r,e,t){if((e[0]&192)!==128)return r.lastNeed=0,"\uFFFD";if(r.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return r.lastNeed=1,"\uFFFD";if(r.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return r.lastNeed=2,"\uFFFD"}}function kq(r){var e=this.lastTotal-this.lastNeed,t=Oq(this,r,e);if(t!==void 0)return t;if(this.lastNeed<=r.length)return r.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);r.copy(this.lastChar,e,0,r.length),this.lastNeed-=r.length}function Lq(r,e){var t=Nq(this,r,e);if(!this.lastNeed)return r.toString("utf8",e);this.lastTotal=t;var n=r.length-(t-this.lastNeed);return r.copy(this.lastChar,0,n),r.toString("utf8",e,n)}function Pq(r){var e=r&&r.length?this.write(r):"";return this.lastNeed?e+"\uFFFD":e}function Mq(r,e){if((r.length-e)%2===0){var t=r.toString("utf16le",e);if(t){var n=t.charCodeAt(t.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=r[r.length-2],this.lastChar[1]=r[r.length-1],t.slice(0,-1)}return t}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=r[r.length-1],r.toString("utf16le",e,r.length-1)}function Bq(r){var e=r&&r.length?this.write(r):"";if(this.lastNeed){var t=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,t)}return e}function Fq(r,e){var t=(r.length-e)%3;return t===0?r.toString("base64",e):(this.lastNeed=3-t,this.lastTotal=3,t===1?this.lastChar[0]=r[r.length-1]:(this.lastChar[0]=r[r.length-2],this.lastChar[1]=r[r.length-1]),r.toString("base64",e,r.length-t))}function Uq(r){var e=r&&r.length?this.write(r):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function jq(r){return r.toString(this.encoding)}function $q(r){return r&&r.length?this.write(r):""}});var xw=mt((pte,CM)=>{"use strict";Te();Re();Ce();var SM=hc().codes.ERR_STREAM_PREMATURE_CLOSE;function Wq(r){var e=!1;return function(){if(!e){e=!0;for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];r.apply(this,n)}}}function zq(){}function Hq(r){return r.setHeader&&typeof r.abort=="function"}function TM(r,e,t){if(typeof e=="function")return TM(r,null,e);e||(e={}),t=Wq(t||zq);var n=e.readable||e.readable!==!1&&r.readable,i=e.writable||e.writable!==!1&&r.writable,o=function(){r.writable||a()},s=r._writableState&&r._writableState.finished,a=function(){i=!1,s=!0,n||t.call(r)},u=r._readableState&&r._readableState.endEmitted,c=function(){n=!1,u=!0,i||t.call(r)},f=function(y){t.call(r,y)},h=function(){var y;if(n&&!u)return(!r._readableState||!r._readableState.ended)&&(y=new SM),t.call(r,y);if(i&&!s)return(!r._writableState||!r._writableState.ended)&&(y=new SM),t.call(r,y)},d=function(){r.req.on("finish",a)};return Hq(r)?(r.on("complete",a),r.on("abort",h),r.req?d():r.on("request",d)):i&&!r._writableState&&(r.on("end",o),r.on("close",o)),r.on("end",c),r.on("finish",a),e.error!==!1&&r.on("error",f),r.on("close",h),function(){r.removeListener("complete",a),r.removeListener("abort",h),r.removeListener("request",d),r.req&&r.req.removeListener("finish",a),r.removeListener("end",o),r.removeListener("close",o),r.removeListener("finish",a),r.removeListener("end",c),r.removeListener("error",f),r.removeListener("close",h)}}CM.exports=TM});var DM=mt((bte,RM)=>{"use strict";Te();Re();Ce();var Sw;function Pl(r,e,t){return e=qq(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function qq(r){var e=Gq(r,"string");return typeof e=="symbol"?e:String(e)}function Gq(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Vq=xw(),Ml=Symbol("lastResolve"),gc=Symbol("lastReject"),Wg=Symbol("error"),Tw=Symbol("ended"),mc=Symbol("lastPromise"),$A=Symbol("handlePromise"),yc=Symbol("stream");function Bl(r,e){return{value:r,done:e}}function Yq(r){var e=r[Ml];if(e!==null){var t=r[yc].read();t!==null&&(r[mc]=null,r[Ml]=null,r[gc]=null,e(Bl(t,!1)))}}function Xq(r){We.nextTick(Yq,r)}function Kq(r,e){return function(t,n){r.then(function(){if(e[Tw]){t(Bl(void 0,!0));return}e[$A](t,n)},n)}}var Zq=Object.getPrototypeOf(function(){}),Jq=Object.setPrototypeOf((Sw={get stream(){return this[yc]},next:function(){var e=this,t=this[Wg];if(t!==null)return Promise.reject(t);if(this[Tw])return Promise.resolve(Bl(void 0,!0));if(this[yc].destroyed)return new Promise(function(s,a){We.nextTick(function(){e[Wg]?a(e[Wg]):s(Bl(void 0,!0))})});var n=this[mc],i;if(n)i=new Promise(Kq(n,this));else{var o=this[yc].read();if(o!==null)return Promise.resolve(Bl(o,!1));i=new Promise(this[$A])}return this[mc]=i,i}},Pl(Sw,Symbol.asyncIterator,function(){return this}),Pl(Sw,"return",function(){var e=this;return new Promise(function(t,n){e[yc].destroy(null,function(i){if(i){n(i);return}t(Bl(void 0,!0))})})}),Sw),Zq),Qq=function(e){var t,n=Object.create(Jq,(t={},Pl(t,yc,{value:e,writable:!0}),Pl(t,Ml,{value:null,writable:!0}),Pl(t,gc,{value:null,writable:!0}),Pl(t,Wg,{value:null,writable:!0}),Pl(t,Tw,{value:e._readableState.endEmitted,writable:!0}),Pl(t,$A,{value:function(o,s){var a=n[yc].read();a?(n[mc]=null,n[Ml]=null,n[gc]=null,o(Bl(a,!1))):(n[Ml]=o,n[gc]=s)},writable:!0}),t));return n[mc]=null,Vq(e,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var o=n[gc];o!==null&&(n[mc]=null,n[Ml]=null,n[gc]=null,o(i)),n[Wg]=i;return}var s=n[Ml];s!==null&&(n[mc]=null,n[Ml]=null,n[gc]=null,s(Bl(void 0,!0))),n[Tw]=!0}),e.on("readable",Xq.bind(null,n)),n};RM.exports=Qq});var NM=mt((_te,IM)=>{Te();Re();Ce();IM.exports=function(){throw new Error("Readable.from is not available in the browser")}});var MA=mt((Cte,$M)=>{"use strict";Te();Re();Ce();$M.exports=jt;var Ph;jt.ReadableState=PM;var Tte=(Rh(),zr(Cg)).EventEmitter,LM=function(e,t){return e.listeners(t).length},Hg=xA(),Cw=(El(),zr(Qf)).Buffer,eG=(typeof window<"u"||typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function tG(r){return Cw.from(r)}function rG(r){return Cw.isBuffer(r)||r instanceof eG}var WA=(Ch(),zr(Tg)),kt;WA&&WA.debuglog?kt=WA.debuglog("stream"):kt=function(){};var nG=nM(),XA=CA(),iG=RA(),sG=iG.getHighWaterMark,Rw=hc().codes,oG=Rw.ERR_INVALID_ARG_TYPE,aG=Rw.ERR_STREAM_PUSH_AFTER_EOF,lG=Rw.ERR_METHOD_NOT_IMPLEMENTED,uG=Rw.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Mh,zA,HA;dc()(jt,Hg);var zg=XA.errorOrDestroy,qA=["error","close","destroy","pause","resume"];function cG(r,e,t){if(typeof r.prependListener=="function")return r.prependListener(e,t);!r._events||!r._events[e]?r.on(e,t):Array.isArray(r._events[e])?r._events[e].unshift(t):r._events[e]=[t,r._events[e]]}function PM(r,e,t){Ph=Ph||pc(),r=r||{},typeof t!="boolean"&&(t=e instanceof Ph),this.objectMode=!!r.objectMode,t&&(this.objectMode=this.objectMode||!!r.readableObjectMode),this.highWaterMark=sG(this,r,"readableHighWaterMark",t),this.buffer=new nG,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=r.emitClose!==!1,this.autoDestroy=!!r.autoDestroy,this.destroyed=!1,this.defaultEncoding=r.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,r.encoding&&(Mh||(Mh=jA().StringDecoder),this.decoder=new Mh(r.encoding),this.encoding=r.encoding)}function jt(r){if(Ph=Ph||pc(),!(this instanceof jt))return new jt(r);var e=this instanceof Ph;this._readableState=new PM(r,this,e),this.readable=!0,r&&(typeof r.read=="function"&&(this._read=r.read),typeof r.destroy=="function"&&(this._destroy=r.destroy)),Hg.call(this)}Object.defineProperty(jt.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}});jt.prototype.destroy=XA.destroy;jt.prototype._undestroy=XA.undestroy;jt.prototype._destroy=function(r,e){e(r)};jt.prototype.push=function(r,e){var t=this._readableState,n;return t.objectMode?n=!0:typeof r=="string"&&(e=e||t.defaultEncoding,e!==t.encoding&&(r=Cw.from(r,e),e=""),n=!0),MM(this,r,e,!1,n)};jt.prototype.unshift=function(r){return MM(this,r,null,!0,!1)};function MM(r,e,t,n,i){kt("readableAddChunk",e);var o=r._readableState;if(e===null)o.reading=!1,dG(r,o);else{var s;if(i||(s=fG(o,e)),s)zg(r,s);else if(o.objectMode||e&&e.length>0)if(typeof e!="string"&&!o.objectMode&&Object.getPrototypeOf(e)!==Cw.prototype&&(e=tG(e)),n)o.endEmitted?zg(r,new uG):GA(r,o,e,!0);else if(o.ended)zg(r,new aG);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!t?(e=o.decoder.write(e),o.objectMode||e.length!==0?GA(r,o,e,!1):YA(r,o)):GA(r,o,e,!1)}else n||(o.reading=!1,YA(r,o))}return!o.ended&&(o.length<o.highWaterMark||o.length===0)}function GA(r,e,t,n){e.flowing&&e.length===0&&!e.sync?(e.awaitDrain=0,r.emit("data",t)):(e.length+=e.objectMode?1:t.length,n?e.buffer.unshift(t):e.buffer.push(t),e.needReadable&&Dw(r)),YA(r,e)}function fG(r,e){var t;return!rG(e)&&typeof e!="string"&&e!==void 0&&!r.objectMode&&(t=new oG("chunk",["string","Buffer","Uint8Array"],e)),t}jt.prototype.isPaused=function(){return this._readableState.flowing===!1};jt.prototype.setEncoding=function(r){Mh||(Mh=jA().StringDecoder);var e=new Mh(r);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var t=this._readableState.buffer.head,n="";t!==null;)n+=e.write(t.data),t=t.next;return this._readableState.buffer.clear(),n!==""&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var OM=1073741824;function hG(r){return r>=OM?r=OM:(r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++),r}function kM(r,e){return r<=0||e.length===0&&e.ended?0:e.objectMode?1:r!==r?e.flowing&&e.length?e.buffer.head.data.length:e.length:(r>e.highWaterMark&&(e.highWaterMark=hG(r)),r<=e.length?r:e.ended?e.length:(e.needReadable=!0,0))}jt.prototype.read=function(r){kt("read",r),r=parseInt(r,10);var e=this._readableState,t=r;if(r!==0&&(e.emittedReadable=!1),r===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return kt("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?VA(this):Dw(this),null;if(r=kM(r,e),r===0&&e.ended)return e.length===0&&VA(this),null;var n=e.needReadable;kt("need readable",n),(e.length===0||e.length-r<e.highWaterMark)&&(n=!0,kt("length less than watermark",n)),e.ended||e.reading?(n=!1,kt("reading or ended",n)):n&&(kt("do read"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(r=kM(t,e)));var i;return r>0?i=UM(r,e):i=null,i===null?(e.needReadable=e.length<=e.highWaterMark,r=0):(e.length-=r,e.awaitDrain=0),e.length===0&&(e.ended||(e.needReadable=!0),t!==r&&e.ended&&VA(this)),i!==null&&this.emit("data",i),i};function dG(r,e){if(kt("onEofChunk"),!e.ended){if(e.decoder){var t=e.decoder.end();t&&t.length&&(e.buffer.push(t),e.length+=e.objectMode?1:t.length)}e.ended=!0,e.sync?Dw(r):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,BM(r)))}}function Dw(r){var e=r._readableState;kt("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(kt("emitReadable",e.flowing),e.emittedReadable=!0,We.nextTick(BM,r))}function BM(r){var e=r._readableState;kt("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(r.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,KA(r)}function YA(r,e){e.readingMore||(e.readingMore=!0,We.nextTick(pG,r,e))}function pG(r,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){var t=e.length;if(kt("maybeReadMore read 0"),r.read(0),t===e.length)break}e.readingMore=!1}jt.prototype._read=function(r){zg(this,new lG("_read()"))};jt.prototype.pipe=function(r,e){var t=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=r;break;case 1:n.pipes=[n.pipes,r];break;default:n.pipes.push(r);break}n.pipesCount+=1,kt("pipe count=%d opts=%j",n.pipesCount,e);var i=(!e||e.end!==!1)&&r!==We.stdout&&r!==We.stderr,o=i?a:v;n.endEmitted?We.nextTick(o):t.once("end",o),r.on("unpipe",s);function s(w,b){kt("onunpipe"),w===t&&b&&b.hasUnpiped===!1&&(b.hasUnpiped=!0,f())}function a(){kt("onend"),r.end()}var u=gG(t);r.on("drain",u);var c=!1;function f(){kt("cleanup"),r.removeListener("close",m),r.removeListener("finish",y),r.removeListener("drain",u),r.removeListener("error",d),r.removeListener("unpipe",s),t.removeListener("end",a),t.removeListener("end",v),t.removeListener("data",h),c=!0,n.awaitDrain&&(!r._writableState||r._writableState.needDrain)&&u()}t.on("data",h);function h(w){kt("ondata");var b=r.write(w);kt("dest.write",b),b===!1&&((n.pipesCount===1&&n.pipes===r||n.pipesCount>1&&jM(n.pipes,r)!==-1)&&!c&&(kt("false write response, pause",n.awaitDrain),n.awaitDrain++),t.pause())}function d(w){kt("onerror",w),v(),r.removeListener("error",d),LM(r,"error")===0&&zg(r,w)}cG(r,"error",d);function m(){r.removeListener("finish",y),v()}r.once("close",m);function y(){kt("onfinish"),r.removeListener("close",m),v()}r.once("finish",y);function v(){kt("unpipe"),t.unpipe(r)}return r.emit("pipe",t),n.flowing||(kt("pipe resume"),t.resume()),r};function gG(r){return function(){var t=r._readableState;kt("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,t.awaitDrain===0&&LM(r,"data")&&(t.flowing=!0,KA(r))}}jt.prototype.unpipe=function(r){var e=this._readableState,t={hasUnpiped:!1};if(e.pipesCount===0)return this;if(e.pipesCount===1)return r&&r!==e.pipes?this:(r||(r=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,r&&r.emit("unpipe",this,t),this);if(!r){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=jM(e.pipes,r);return s===-1?this:(e.pipes.splice(s,1),e.pipesCount-=1,e.pipesCount===1&&(e.pipes=e.pipes[0]),r.emit("unpipe",this,t),this)};jt.prototype.on=function(r,e){var t=Hg.prototype.on.call(this,r,e),n=this._readableState;return r==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):r==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,kt("on readable",n.length,n.reading),n.length?Dw(this):n.reading||We.nextTick(mG,this)),t};jt.prototype.addListener=jt.prototype.on;jt.prototype.removeListener=function(r,e){var t=Hg.prototype.removeListener.call(this,r,e);return r==="readable"&&We.nextTick(FM,this),t};jt.prototype.removeAllListeners=function(r){var e=Hg.prototype.removeAllListeners.apply(this,arguments);return(r==="readable"||r===void 0)&&We.nextTick(FM,this),e};function FM(r){var e=r._readableState;e.readableListening=r.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:r.listenerCount("data")>0&&r.resume()}function mG(r){kt("readable nexttick read 0"),r.read(0)}jt.prototype.resume=function(){var r=this._readableState;return r.flowing||(kt("resume"),r.flowing=!r.readableListening,yG(this,r)),r.paused=!1,this};function yG(r,e){e.resumeScheduled||(e.resumeScheduled=!0,We.nextTick(bG,r,e))}function bG(r,e){kt("resume",e.reading),e.reading||r.read(0),e.resumeScheduled=!1,r.emit("resume"),KA(r),e.flowing&&!e.reading&&r.read(0)}jt.prototype.pause=function(){return kt("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(kt("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function KA(r){var e=r._readableState;for(kt("flow",e.flowing);e.flowing&&r.read()!==null;);}jt.prototype.wrap=function(r){var e=this,t=this._readableState,n=!1;r.on("end",function(){if(kt("wrapped end"),t.decoder&&!t.ended){var s=t.decoder.end();s&&s.length&&e.push(s)}e.push(null)}),r.on("data",function(s){if(kt("wrapped data"),t.decoder&&(s=t.decoder.write(s)),!(t.objectMode&&s==null)&&!(!t.objectMode&&(!s||!s.length))){var a=e.push(s);a||(n=!0,r.pause())}});for(var i in r)this[i]===void 0&&typeof r[i]=="function"&&(this[i]=(function(a){return function(){return r[a].apply(r,arguments)}})(i));for(var o=0;o<qA.length;o++)r.on(qA[o],this.emit.bind(this,qA[o]));return this._read=function(s){kt("wrapped _read",s),n&&(n=!1,r.resume())},this};typeof Symbol=="function"&&(jt.prototype[Symbol.asyncIterator]=function(){return zA===void 0&&(zA=DM()),zA(this)});Object.defineProperty(jt.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(jt.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(jt.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}});jt._fromList=UM;Object.defineProperty(jt.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function UM(r,e){if(e.length===0)return null;var t;return e.objectMode?t=e.buffer.shift():!r||r>=e.length?(e.decoder?t=e.buffer.join(""):e.buffer.length===1?t=e.buffer.first():t=e.buffer.concat(e.length),e.buffer.clear()):t=e.buffer.consume(r,e.decoder),t}function VA(r){var e=r._readableState;kt("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,We.nextTick(wG,e,r))}function wG(r,e){if(kt("endReadableNT",r.endEmitted,r.length),!r.endEmitted&&r.length===0&&(r.endEmitted=!0,e.readable=!1,e.emit("end"),r.autoDestroy)){var t=e._writableState;(!t||t.autoDestroy&&t.finished)&&e.destroy()}}typeof Symbol=="function"&&(jt.from=function(r,e){return HA===void 0&&(HA=NM()),HA(jt,r,e)});function jM(r,e){for(var t=0,n=r.length;t<n;t++)if(r[t]===e)return t;return-1}});var ZA=mt((Nte,zM)=>{"use strict";Te();Re();Ce();zM.exports=Aa;var Iw=hc().codes,vG=Iw.ERR_METHOD_NOT_IMPLEMENTED,EG=Iw.ERR_MULTIPLE_CALLBACK,_G=Iw.ERR_TRANSFORM_ALREADY_TRANSFORMING,AG=Iw.ERR_TRANSFORM_WITH_LENGTH_0,Nw=pc();dc()(Aa,Nw);function xG(r,e){var t=this._transformState;t.transforming=!1;var n=t.writecb;if(n===null)return this.emit("error",new EG);t.writechunk=null,t.writecb=null,e!=null&&this.push(e),n(r);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function Aa(r){if(!(this instanceof Aa))return new Aa(r);Nw.call(this,r),this._transformState={afterTransform:xG.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,r&&(typeof r.transform=="function"&&(this._transform=r.transform),typeof r.flush=="function"&&(this._flush=r.flush)),this.on("prefinish",SG)}function SG(){var r=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(e,t){WM(r,e,t)}):WM(this,null,null)}Aa.prototype.push=function(r,e){return this._transformState.needTransform=!1,Nw.prototype.push.call(this,r,e)};Aa.prototype._transform=function(r,e,t){t(new vG("_transform()"))};Aa.prototype._write=function(r,e,t){var n=this._transformState;if(n.writecb=t,n.writechunk=r,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};Aa.prototype._read=function(r){var e=this._transformState;e.writechunk!==null&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0};Aa.prototype._destroy=function(r,e){Nw.prototype._destroy.call(this,r,function(t){e(t)})};function WM(r,e,t){if(e)return r.emit("error",e);if(t!=null&&r.push(t),r._writableState.length)throw new AG;if(r._transformState.transforming)throw new _G;return r.push(null)}});var GM=mt((Pte,qM)=>{"use strict";Te();Re();Ce();qM.exports=qg;var HM=ZA();dc()(qg,HM);function qg(r){if(!(this instanceof qg))return new qg(r);HM.call(this,r)}qg.prototype._transform=function(r,e,t){t(null,r)}});var ZM=mt((Ute,KM)=>{"use strict";Te();Re();Ce();var JA;function TG(r){var e=!1;return function(){e||(e=!0,r.apply(void 0,arguments))}}var XM=hc().codes,CG=XM.ERR_MISSING_ARGS,RG=XM.ERR_STREAM_DESTROYED;function VM(r){if(r)throw r}function DG(r){return r.setHeader&&typeof r.abort=="function"}function IG(r,e,t,n){n=TG(n);var i=!1;r.on("close",function(){i=!0}),JA===void 0&&(JA=xw()),JA(r,{readable:e,writable:t},function(s){if(s)return n(s);i=!0,n()});var o=!1;return function(s){if(!i&&!o){if(o=!0,DG(r))return r.abort();if(typeof r.destroy=="function")return r.destroy();n(s||new RG("pipe"))}}}function YM(r){r()}function NG(r,e){return r.pipe(e)}function OG(r){return!r.length||typeof r[r.length-1]!="function"?VM:r.pop()}function kG(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];var n=OG(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new CG("streams");var i,o=e.map(function(s,a){var u=a<e.length-1,c=a>0;return IG(s,u,c,function(f){i||(i=f),f&&o.forEach(YM),!u&&(o.forEach(YM),n(i))})});return e.reduce(NG)}KM.exports=kG});var QM=mt((gs,JM)=>{Te();Re();Ce();gs=JM.exports=MA();gs.Stream=gs;gs.Readable=gs;gs.Writable=kA();gs.Duplex=pc();gs.Transform=ZA();gs.PassThrough=GM();gs.finished=xw();gs.pipeline=ZM()});var tB=mt((Gte,eB)=>{Te();Re();Ce();var LG=Object.prototype.toString,QA=typeof He<"u"&&typeof He.alloc=="function"&&typeof He.allocUnsafe=="function"&&typeof He.from=="function";function PG(r){return LG.call(r).slice(8,-1)==="ArrayBuffer"}function MG(r,e,t){e>>>=0;var n=r.byteLength-e;if(n<0)throw new RangeError("'offset' is out of bounds");if(t===void 0)t=n;else if(t>>>=0,t>n)throw new RangeError("'length' is out of bounds");return QA?He.from(r.slice(e,e+t)):new He(new Uint8Array(r.slice(e,e+t)))}function BG(r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!He.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');return QA?He.from(r,e):new He(r,e)}function FG(r,e,t){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return PG(r)?MG(r,e,t):typeof r=="string"?BG(r,e):QA?He.from(r):new He(r)}eB.exports=FG});var aB=mt(vt=>{Te();Re();Ce();var rB=void 0,UG=1e5,Ar=(function(){var r=Object.prototype.toString,e=Object.prototype.hasOwnProperty;return{Class:function(t){return r.call(t).replace(/^\[object *|\]$/g,"")},HasProperty:function(t,n){return n in t},HasOwnProperty:function(t,n){return e.call(t,n)},IsCallable:function(t){return typeof t=="function"},ToInt32:function(t){return t>>0},ToUint32:function(t){return t>>>0}}})(),jG=Math.LN2,$G=Math.abs,Ow=Math.floor,WG=Math.log,zG=Math.min,Ws=Math.pow,HG=Math.round;function ex(r){if(nB&&Bh){var e=nB(r),t;for(t=0;t<e.length;t+=1)Bh(r,e[t],{value:r[e[t]],writable:!1,enumerable:!1,configurable:!1})}}var Bh;Object.defineProperty&&(function(){try{return Object.defineProperty({},"x",{}),!0}catch{return!1}})()?Bh=Object.defineProperty:Bh=function(r,e,t){if(!r===Object(r))throw new TypeError("Object.defineProperty called on non-object");return Ar.HasProperty(t,"get")&&Object.prototype.__defineGetter__&&Object.prototype.__defineGetter__.call(r,e,t.get),Ar.HasProperty(t,"set")&&Object.prototype.__defineSetter__&&Object.prototype.__defineSetter__.call(r,e,t.set),Ar.HasProperty(t,"value")&&(r[e]=t.value),r};var nB=Object.getOwnPropertyNames||function(r){if(r!==Object(r))throw new TypeError("Object.getOwnPropertyNames called on non-object");var e=[],t;for(t in r)Ar.HasOwnProperty(r,t)&&e.push(t);return e};function qG(r){if(!Bh)return;if(r.length>UG)throw new RangeError("Array too large for polyfill");function e(n){Bh(r,n,{get:function(){return r._getter(n)},set:function(i){r._setter(n,i)},enumerable:!0,configurable:!1})}var t;for(t=0;t<r.length;t+=1)e(t)}function tx(r,e){var t=32-e;return r<<t>>t}function rx(r,e){var t=32-e;return r<<t>>>t}function GG(r){return[r&255]}function VG(r){return tx(r[0],8)}function YG(r){return[r&255]}function iB(r){return rx(r[0],8)}function XG(r){return r=HG(Number(r)),[r<0?0:r>255?255:r&255]}function KG(r){return[r>>8&255,r&255]}function ZG(r){return tx(r[0]<<8|r[1],16)}function JG(r){return[r>>8&255,r&255]}function QG(r){return rx(r[0]<<8|r[1],16)}function eV(r){return[r>>24&255,r>>16&255,r>>8&255,r&255]}function tV(r){return tx(r[0]<<24|r[1]<<16|r[2]<<8|r[3],32)}function rV(r){return[r>>24&255,r>>16&255,r>>8&255,r&255]}function nV(r){return rx(r[0]<<24|r[1]<<16|r[2]<<8|r[3],32)}function sB(r,e,t){var n=(1<<e-1)-1,i,o,s,a,u,c,f,h;function d(m){var y=Ow(m),v=m-y;return v<.5?y:v>.5||y%2?y+1:y}for(r!==r?(o=(1<<e)-1,s=Ws(2,t-1),i=0):r===1/0||r===-1/0?(o=(1<<e)-1,s=0,i=r<0?1:0):r===0?(o=0,s=0,i=1/r===-1/0?1:0):(i=r<0,r=$G(r),r>=Ws(2,1-n)?(o=zG(Ow(WG(r)/jG),1023),s=d(r/Ws(2,o)*Ws(2,t)),s/Ws(2,t)>=2&&(o=o+1,s=1),o>n?(o=(1<<e)-1,s=0):(o=o+n,s=s-Ws(2,t))):(o=0,s=d(r/Ws(2,1-n-t)))),c=[],u=t;u;u-=1)c.push(s%2?1:0),s=Ow(s/2);for(u=e;u;u-=1)c.push(o%2?1:0),o=Ow(o/2);for(c.push(i?1:0),c.reverse(),f=c.join(""),h=[];f.length;)h.push(parseInt(f.substring(0,8),2)),f=f.substring(8);return h}function oB(r,e,t){var n=[],i,o,s,a,u,c,f,h;for(i=r.length;i;i-=1)for(s=r[i-1],o=8;o;o-=1)n.push(s%2?1:0),s=s>>1;return n.reverse(),a=n.join(""),u=(1<<e-1)-1,c=parseInt(a.substring(0,1),2)?-1:1,f=parseInt(a.substring(1,1+e),2),h=parseInt(a.substring(1+e),2),f===(1<<e)-1?h!==0?NaN:c*(1/0):f>0?c*Ws(2,f-u)*(1+h/Ws(2,t)):h!==0?c*Ws(2,-(u-1))*(h/Ws(2,t)):c<0?-0:0}function iV(r){return oB(r,11,52)}function sV(r){return sB(r,11,52)}function oV(r){return oB(r,8,23)}function aV(r){return sB(r,8,23)}(function(){var r=function(m){if(m=Ar.ToInt32(m),m<0)throw new RangeError("ArrayBuffer size is not a small enough positive integer");this.byteLength=m,this._bytes=[],this._bytes.length=m;var y;for(y=0;y<this.byteLength;y+=1)this._bytes[y]=0;ex(this)};vt.ArrayBuffer=vt.ArrayBuffer||r;var e=function(){};function t(d,m,y){var v;return v=function(w,b,E){var _,S,A,F;if(!arguments.length||typeof arguments[0]=="number"){if(this.length=Ar.ToInt32(arguments[0]),E<0)throw new RangeError("ArrayBufferView size is not a small enough positive integer");this.byteLength=this.length*this.BYTES_PER_ELEMENT,this.buffer=new r(this.byteLength),this.byteOffset=0}else if(typeof arguments[0]=="object"&&arguments[0].constructor===v)for(_=arguments[0],this.length=_.length,this.byteLength=this.length*this.BYTES_PER_ELEMENT,this.buffer=new r(this.byteLength),this.byteOffset=0,A=0;A<this.length;A+=1)this._setter(A,_._getter(A));else if(typeof arguments[0]=="object"&&!(arguments[0]instanceof r||Ar.Class(arguments[0])==="ArrayBuffer"))for(S=arguments[0],this.length=Ar.ToUint32(S.length),this.byteLength=this.length*this.BYTES_PER_ELEMENT,this.buffer=new r(this.byteLength),this.byteOffset=0,A=0;A<this.length;A+=1)F=S[A],this._setter(A,Number(F));else if(typeof arguments[0]=="object"&&(arguments[0]instanceof r||Ar.Class(arguments[0])==="ArrayBuffer")){if(this.buffer=w,this.byteOffset=Ar.ToUint32(b),this.byteOffset>this.buffer.byteLength)throw new RangeError("byteOffset out of range");if(this.byteOffset%this.BYTES_PER_ELEMENT)throw new RangeError("ArrayBuffer length minus the byteOffset is not a multiple of the element size.");if(arguments.length<3){if(this.byteLength=this.buffer.byteLength-this.byteOffset,this.byteLength%this.BYTES_PER_ELEMENT)throw new RangeError("length of buffer minus byteOffset not a multiple of the element size");this.length=this.byteLength/this.BYTES_PER_ELEMENT}else this.length=Ar.ToUint32(E),this.byteLength=this.length*this.BYTES_PER_ELEMENT;if(this.byteOffset+this.byteLength>this.buffer.byteLength)throw new RangeError("byteOffset and length reference an area beyond the end of the buffer")}else throw new TypeError("Unexpected argument type(s)");this.constructor=v,ex(this),qG(this)},v.prototype=new e,v.prototype.BYTES_PER_ELEMENT=d,v.prototype._pack=m,v.prototype._unpack=y,v.BYTES_PER_ELEMENT=d,v.prototype._getter=function(w){if(arguments.length<1)throw new SyntaxError("Not enough arguments");if(w=Ar.ToUint32(w),w>=this.length)return rB;var b=[],E,_;for(E=0,_=this.byteOffset+w*this.BYTES_PER_ELEMENT;E<this.BYTES_PER_ELEMENT;E+=1,_+=1)b.push(this.buffer._bytes[_]);return this._unpack(b)},v.prototype.get=v.prototype._getter,v.prototype._setter=function(w,b){if(arguments.length<2)throw new SyntaxError("Not enough arguments");if(w=Ar.ToUint32(w),w>=this.length)return rB;var E=this._pack(b),_,S;for(_=0,S=this.byteOffset+w*this.BYTES_PER_ELEMENT;_<this.BYTES_PER_ELEMENT;_+=1,S+=1)this.buffer._bytes[S]=E[_]},v.prototype.set=function(w,b){if(arguments.length<1)throw new SyntaxError("Not enough arguments");var E,_,S,A,F,I,q,ee,K,ne;if(typeof arguments[0]=="object"&&arguments[0].constructor===this.constructor){if(E=arguments[0],S=Ar.ToUint32(arguments[1]),S+E.length>this.length)throw new RangeError("Offset plus length of array is out of range");if(ee=this.byteOffset+S*this.BYTES_PER_ELEMENT,K=E.length*this.BYTES_PER_ELEMENT,E.buffer===this.buffer){for(ne=[],F=0,I=E.byteOffset;F<K;F+=1,I+=1)ne[F]=E.buffer._bytes[I];for(F=0,q=ee;F<K;F+=1,q+=1)this.buffer._bytes[q]=ne[F]}else for(F=0,I=E.byteOffset,q=ee;F<K;F+=1,I+=1,q+=1)this.buffer._bytes[q]=E.buffer._bytes[I]}else if(typeof arguments[0]=="object"&&typeof arguments[0].length<"u"){if(_=arguments[0],A=Ar.ToUint32(_.length),S=Ar.ToUint32(arguments[1]),S+A>this.length)throw new RangeError("Offset plus length of array is out of range");for(F=0;F<A;F+=1)I=_[F],this._setter(S+F,Number(I))}else throw new TypeError("Unexpected argument type(s)")},v.prototype.subarray=function(w,b){function E(S,A,F){return S<A?A:S>F?F:S}w=Ar.ToInt32(w),b=Ar.ToInt32(b),arguments.length<1&&(w=0),arguments.length<2&&(b=this.length),w<0&&(w=this.length+w),b<0&&(b=this.length+b),w=E(w,0,this.length),b=E(b,0,this.length);var _=b-w;return _<0&&(_=0),new this.constructor(this.buffer,this.byteOffset+w*this.BYTES_PER_ELEMENT,_)},v}var n=t(1,GG,VG),i=t(1,YG,iB),o=t(1,XG,iB),s=t(2,KG,ZG),a=t(2,JG,QG),u=t(4,eV,tV),c=t(4,rV,nV),f=t(4,aV,oV),h=t(8,sV,iV);vt.Int8Array=vt.Int8Array||n,vt.Uint8Array=vt.Uint8Array||i,vt.Uint8ClampedArray=vt.Uint8ClampedArray||o,vt.Int16Array=vt.Int16Array||s,vt.Uint16Array=vt.Uint16Array||a,vt.Int32Array=vt.Int32Array||u,vt.Uint32Array=vt.Uint32Array||c,vt.Float32Array=vt.Float32Array||f,vt.Float64Array=vt.Float64Array||h})();(function(){function r(o,s){return Ar.IsCallable(o.get)?o.get(s):o[s]}var e=(function(){var o=new vt.Uint16Array([4660]),s=new vt.Uint8Array(o.buffer);return r(s,0)===18})(),t=function(s,a,u){if(arguments.length===0)s=new vt.ArrayBuffer(0);else if(!(s instanceof vt.ArrayBuffer||Ar.Class(s)==="ArrayBuffer"))throw new TypeError("TypeError");if(this.buffer=s||new vt.ArrayBuffer(0),this.byteOffset=Ar.ToUint32(a),this.byteOffset>this.buffer.byteLength)throw new RangeError("byteOffset out of range");if(arguments.length<3?this.byteLength=this.buffer.byteLength-this.byteOffset:this.byteLength=Ar.ToUint32(u),this.byteOffset+this.byteLength>this.buffer.byteLength)throw new RangeError("byteOffset and length reference an area beyond the end of the buffer");ex(this)};function n(o){return function(s,a){if(s=Ar.ToUint32(s),s+o.BYTES_PER_ELEMENT>this.byteLength)throw new RangeError("Array index out of range");s+=this.byteOffset;var u=new vt.Uint8Array(this.buffer,s,o.BYTES_PER_ELEMENT),c=[],f;for(f=0;f<o.BYTES_PER_ELEMENT;f+=1)c.push(r(u,f));return!!a==!!e&&c.reverse(),r(new o(new vt.Uint8Array(c).buffer),0)}}t.prototype.getUint8=n(vt.Uint8Array),t.prototype.getInt8=n(vt.Int8Array),t.prototype.getUint16=n(vt.Uint16Array),t.prototype.getInt16=n(vt.Int16Array),t.prototype.getUint32=n(vt.Uint32Array),t.prototype.getInt32=n(vt.Int32Array),t.prototype.getFloat32=n(vt.Float32Array),t.prototype.getFloat64=n(vt.Float64Array);function i(o){return function(s,a,u){if(s=Ar.ToUint32(s),s+o.BYTES_PER_ELEMENT>this.byteLength)throw new RangeError("Array index out of range");var c=new o([a]),f=new vt.Uint8Array(c.buffer),h=[],d,m;for(d=0;d<o.BYTES_PER_ELEMENT;d+=1)h.push(r(f,d));!!u==!!e&&h.reverse(),m=new vt.Uint8Array(this.buffer,s,o.BYTES_PER_ELEMENT),m.set(h)}}t.prototype.setUint8=i(vt.Uint8Array),t.prototype.setInt8=i(vt.Int8Array),t.prototype.setUint16=i(vt.Uint16Array),t.prototype.setInt16=i(vt.Int16Array),t.prototype.setUint32=i(vt.Uint32Array),t.prototype.setInt32=i(vt.Int32Array),t.prototype.setFloat32=i(vt.Float32Array),t.prototype.setFloat64=i(vt.Float64Array),vt.DataView=vt.DataView||t})()});var fB=mt((ere,cB)=>{Te();Re();Ce();var lB=QM().Writable,lV=dc(),Gg=tB();typeof Uint8Array>"u"?kw=aB().Uint8Array:kw=Uint8Array;var kw;function bc(r,e){if(!(this instanceof bc))return new bc(r,e);typeof r=="function"&&(e=r,r={}),r||(r={});var t=r.encoding,n=!1;t?(t=String(t).toLowerCase(),(t==="u8"||t==="uint8")&&(t="uint8array")):n=!0,lB.call(this,{objectMode:!0}),this.encoding=t,this.shouldInferEncoding=n,e&&this.on("finish",function(){e(this.getBody())}),this.body=[]}cB.exports=bc;lV(bc,lB);bc.prototype._write=function(r,e,t){this.body.push(r),t()};bc.prototype.inferEncoding=function(r){var e=r===void 0?this.body[0]:r;return He.isBuffer(e)?"buffer":typeof Uint8Array<"u"&&e instanceof Uint8Array?"uint8array":Array.isArray(e)?"array":typeof e=="string"?"string":Object.prototype.toString.call(e)==="[object Object]"?"object":"buffer"};bc.prototype.getBody=function(){return!this.encoding&&this.body.length===0?[]:(this.shouldInferEncoding&&(this.encoding=this.inferEncoding()),this.encoding==="array"?hV(this.body):this.encoding==="string"?cV(this.body):this.encoding==="buffer"?fV(this.body):this.encoding==="uint8array"?dV(this.body):this.body)};function uV(r){return/Array\]$/.test(Object.prototype.toString.call(r))}function uB(r){return typeof r=="string"||uV(r)||r&&typeof r.subarray=="function"}function cV(r){for(var e=[],t=!1,n=0;n<r.length;n++){var i=r[n];typeof i=="string"||He.isBuffer(i)?e.push(i):uB(i)?e.push(Gg(i)):e.push(Gg(String(i)))}return He.isBuffer(r[0])?(e=He.concat(e),e=e.toString("utf8")):e=e.join(""),e}function fV(r){for(var e=[],t=0;t<r.length;t++){var n=r[t];He.isBuffer(n)?e.push(n):uB(n)?e.push(Gg(n)):e.push(Gg(String(n)))}return He.concat(e)}function hV(r){for(var e=[],t=0;t<r.length;t++)e.push.apply(e,r[t]);return e}function dV(r){for(var e=0,t=0;t<r.length;t++)typeof r[t]=="string"&&(r[t]=Gg(r[t])),e+=r[t].length;for(var n=new kw(e),t=0,i=0;t<r.length;t++)for(var o=r[t],s=0;s<o.length;s++)n[i++]=o[s];return n}});var mB=mt(nx=>{Te();Re();Ce();nx.read=function(r,e,t,n,i){var o,s,a=i*8-n-1,u=(1<<a)-1,c=u>>1,f=-7,h=t?i-1:0,d=t?-1:1,m=r[e+h];for(h+=d,o=m&(1<<-f)-1,m>>=-f,f+=a;f>0;o=o*256+r[e+h],h+=d,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=s*256+r[e+h],h+=d,f-=8);if(o===0)o=1-c;else{if(o===u)return s?NaN:(m?-1:1)*(1/0);s=s+Math.pow(2,n),o=o-c}return(m?-1:1)*s*Math.pow(2,o-n)};nx.write=function(r,e,t,n,i,o){var s,a,u,c=o*8-i-1,f=(1<<c)-1,h=f>>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=n?0:o-1,y=n?1:-1,v=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),s+h>=1?e+=d/u:e+=d*Math.pow(2,1-h),e*u>=2&&(s++,u/=2),s+h>=f?(a=0,s=f):s+h>=1?(a=(e*u-1)*Math.pow(2,i),s=s+h):(a=e*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;r[t+m]=a&255,m+=y,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;r[t+m]=s&255,m+=y,s/=256,c-=8);r[t+m-y]|=v*128}});function gV(){if(!(typeof globalThis.TextDecoder>"u"))return Lw??(Lw=new globalThis.TextDecoder("utf-8"))}function bB(r,e="utf-8"){switch(e.toLowerCase()){case"utf-8":case"utf8":{let t=gV();return t?t.decode(r):yV(r)}case"utf-16le":return bV(r);case"us-ascii":case"ascii":return wV(r);case"latin1":case"iso-8859-1":return vV(r);case"windows-1252":return EV(r);default:throw new RangeError(`Encoding '${e}' not supported`)}}function ix(r,e){e.length!==0&&(r.push(String.fromCharCode.apply(null,e)),e.length=0)}function Kr(r,e,t){e.push(t),e.length>=Fh&&ix(r,e)}function mV(r,e,t){if(t<=65535){Kr(r,e,t);return}t-=65536,Kr(r,e,55296+(t>>10)),Kr(r,e,56320+(t&1023))}function yV(r){let e=[],t=[],n=0;for(r.length>=3&&r[0]===239&&r[1]===187&&r[2]===191&&(n=3);n<r.length;){let i=r[n];if(i<=127){Kr(e,t,i),n++;continue}if(i<194||i>244){Kr(e,t,zs),n++;continue}if(i<=223){if(n+1>=r.length){Kr(e,t,zs),n++;continue}let f=r[n+1];if((f&192)!==128){Kr(e,t,zs),n++;continue}let h=(i&31)<<6|f&63;Kr(e,t,h),n+=2;continue}if(i<=239){if(n+2>=r.length){Kr(e,t,zs),n++;continue}let f=r[n+1],h=r[n+2];if(!((f&192)===128&&(h&192)===128&&!(i===224&&f<160)&&!(i===237&&f>=160))){Kr(e,t,zs),n++;continue}let m=(i&15)<<12|(f&63)<<6|h&63;Kr(e,t,m),n+=3;continue}if(n+3>=r.length){Kr(e,t,zs),n++;continue}let o=r[n+1],s=r[n+2],a=r[n+3];if(!((o&192)===128&&(s&192)===128&&(a&192)===128&&!(i===240&&o<144)&&!(i===244&&o>143))){Kr(e,t,zs),n++;continue}let c=(i&7)<<18|(o&63)<<12|(s&63)<<6|a&63;mV(e,t,c),n+=4}return ix(e,t),e.join("")}function bV(r){let e=[],t=[],n=r.length,i=0;for(;i+1<n;){let o=r[i]|r[i+1]<<8;if(i+=2,o>=55296&&o<=56319){if(i+1<n){let s=r[i]|r[i+1]<<8;s>=56320&&s<=57343?(Kr(e,t,o),Kr(e,t,s),i+=2):Kr(e,t,zs)}else Kr(e,t,zs);continue}if(o>=56320&&o<=57343){Kr(e,t,zs);continue}Kr(e,t,o)}return i<n&&Kr(e,t,zs),ix(e,t),e.join("")}function wV(r){let e=[];for(let t=0;t<r.length;t+=Fh){let n=Math.min(r.length,t+Fh),i=new Array(n-t);for(let o=t,s=0;o<n;o++,s++)i[s]=r[o]&127;e.push(String.fromCharCode.apply(null,i))}return e.join("")}function vV(r){let e=[];for(let t=0;t<r.length;t+=Fh){let n=Math.min(r.length,t+Fh),i=new Array(n-t);for(let o=t,s=0;o<n;o++,s++)i[s]=r[o];e.push(String.fromCharCode.apply(null,i))}return e.join("")}function EV(r){let e=[],t="";for(let n=0;n<r.length;n++){let i=r[n],o=i>=128&&i<=159?yB[i]:void 0;t+=o??String.fromCharCode(i),t.length>=Fh&&(e.push(t),t="")}return t&&e.push(t),e.join("")}var yB,pV,Lw,Fh,zs,wB=_t(()=>{Te();Re();Ce();yB={128:"\u20AC",130:"\u201A",131:"\u0192",132:"\u201E",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02C6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017D",145:"\u2018",146:"\u2019",147:"\u201C",148:"\u201D",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02DC",153:"\u2122",154:"\u0161",155:"\u203A",156:"\u0153",158:"\u017E",159:"\u0178"},pV={};for(let[r,e]of Object.entries(yB))pV[e]=Number.parseInt(r,10);Fh=32*1024,zs=65533});function mi(r){return new DataView(r.buffer,r.byteOffset)}var vB,EB,Pw,Mw,_B,AB,xB,SB,Li,sx=_t(()=>{Te();Re();Ce();vB=ju(mB(),1);wB();EB={len:1,get(r,e){return mi(r).getUint8(e)},put(r,e,t){return mi(r).setUint8(e,t),e+1}},Pw={len:2,get(r,e){return mi(r).getUint16(e,!0)},put(r,e,t){return mi(r).setUint16(e,t,!0),e+2}},Mw={len:2,get(r,e){return mi(r).getUint16(e)},put(r,e,t){return mi(r).setUint16(e,t),e+2}},_B={len:4,get(r,e){return mi(r).getUint32(e,!0)},put(r,e,t){return mi(r).setUint32(e,t,!0),e+4}},AB={len:4,get(r,e){return mi(r).getUint32(e)},put(r,e,t){return mi(r).setUint32(e,t),e+4}},xB={len:4,get(r,e){return mi(r).getInt32(e)},put(r,e,t){return mi(r).setInt32(e,t),e+4}},SB={len:8,get(r,e){return mi(r).getBigUint64(e,!0)},put(r,e,t){return mi(r).setBigUint64(e,t,!0),e+8}},Li=class{constructor(e,t){this.len=e,this.encoding=t}get(e,t=0){let n=e.subarray(t,t+this.len);return bB(n,this.encoding)}}});var AV,gr,wc=_t(()=>{Te();Re();Ce();AV="End-Of-Stream",gr=class extends Error{constructor(){super(AV)}}});var TB=_t(()=>{Te();Re();Ce()});var Vg,ox=_t(()=>{Te();Re();Ce();wc();Vg=class{constructor(){this.maxStreamReadSize=1*1024*1024,this.endOfStream=!1,this.peekQueue=[]}async peek(e,t,n){let i=await this.read(e,t,n);return this.peekQueue.push(e.subarray(t,t+i)),i}async read(e,t,n){if(n===0)return 0;let i=this.readFromPeekBuffer(e,t,n);if(i+=await this.readRemainderFromStream(e,t+i,n-i),i===0)throw new gr;return i}readFromPeekBuffer(e,t,n){let i=n,o=0;for(;this.peekQueue.length>0&&i>0;){let s=this.peekQueue.pop();if(!s)throw new Error("peekData should be defined");let a=Math.min(s.length,i);e.set(s.subarray(0,a),t+o),o+=a,i-=a,a<s.length&&this.peekQueue.push(s.subarray(a))}return o}async readRemainderFromStream(e,t,n){let i=n,o=0;for(;i>0&&!this.endOfStream;){let s=Math.min(i,this.maxStreamReadSize),a=await this.readFromStream(e,t+o,s);if(a===0)break;o+=a,i-=a}return o}}});var CB=_t(()=>{Te();Re();Ce();wc();TB();ox();wc()});var Yg,RB=_t(()=>{Te();Re();Ce();wc();wc();ox();Yg=class extends Vg{constructor(e){super(),this.reader=e.getReader({mode:"byob"})}async readFromStream(e,t,n){if(this.endOfStream)throw new gr;let i=await this.reader.read(new Uint8Array(n));return i.done&&(this.endOfStream=i.done),i.value?(e.set(i.value,t),i.value.byteLength):0}abort(){return this.reader.cancel()}async close(){await this.abort(),this.reader.releaseLock()}}});var Uh=_t(()=>{Te();Re();Ce();wc();CB();RB()});var vc,Bw=_t(()=>{Te();Re();Ce();Uh();vc=class{constructor(e){this.numBuffer=new Uint8Array(8),this.position=0,this.onClose=e?.onClose,e?.abortSignal&&e.abortSignal.addEventListener("abort",()=>{this.abort()})}async readToken(e,t=this.position){let n=new Uint8Array(e.len);if(await this.readBuffer(n,{position:t})<e.len)throw new gr;return e.get(n,0)}async peekToken(e,t=this.position){let n=new Uint8Array(e.len);if(await this.peekBuffer(n,{position:t})<e.len)throw new gr;return e.get(n,0)}async readNumber(e){if(await this.readBuffer(this.numBuffer,{length:e.len})<e.len)throw new gr;return e.get(this.numBuffer,0)}async peekNumber(e){if(await this.peekBuffer(this.numBuffer,{length:e.len})<e.len)throw new gr;return e.get(this.numBuffer,0)}async ignore(e){if(this.fileInfo.size!==void 0){let t=this.fileInfo.size-this.position;if(e>t)return this.position+=t,t}return this.position+=e,e}async close(){await this.abort(),await this.onClose?.()}normalizeOptions(e,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:e.length-(t.offset?t.offset:0),position:t.position?t.position:this.position}:{mayBeLess:!1,offset:0,length:e.length,position:this.position}}abort(){return Promise.resolve()}}});var SV,Fw,DB=_t(()=>{Te();Re();Ce();Bw();Uh();SV=256e3,Fw=class extends vc{constructor(e,t){super(t),this.streamReader=e,this.fileInfo=t?.fileInfo??{}}async readBuffer(e,t){let n=this.normalizeOptions(e,t),i=n.position-this.position;if(i>0)return await this.ignore(i),this.readBuffer(e,t);if(i<0)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");if(n.length===0)return 0;let o=await this.streamReader.read(e,n.offset,n.length);if(this.position+=o,(!t||!t.mayBeLess)&&o<n.length)throw new gr;return o}async peekBuffer(e,t){let n=this.normalizeOptions(e,t),i=0;if(n.position){let o=n.position-this.position;if(o>0){let s=new Uint8Array(n.length+o);return i=await this.peekBuffer(s,{mayBeLess:n.mayBeLess}),e.set(s.subarray(o),n.offset),i-o}if(o<0)throw new Error("Cannot peek from a negative offset in a stream")}if(n.length>0){try{i=await this.streamReader.peek(e,n.offset,n.length)}catch(o){if(t?.mayBeLess&&o instanceof gr)return 0;throw o}if(!n.mayBeLess&&i<n.length)throw new gr}return i}async ignore(e){let t=Math.min(SV,e),n=new Uint8Array(t),i=0;for(;i<e;){let o=e-i,s=await this.readBuffer(n,{length:Math.min(t,o)});if(s<0)return s;i+=s}return i}abort(){return this.streamReader.abort()}supportsRandomAccess(){return!1}}});var Uw,IB=_t(()=>{Te();Re();Ce();Uh();Bw();Uw=class extends vc{constructor(e,t){super(t),this.uint8Array=e,this.fileInfo={...t?.fileInfo??{},size:e.length}}async readBuffer(e,t){if(t?.position){if(t.position<this.position)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");this.position=t.position}let n=await this.peekBuffer(e,t);return this.position+=n,n}async peekBuffer(e,t){let n=this.normalizeOptions(e,t),i=Math.min(this.uint8Array.length-n.position,n.length);if(!n.mayBeLess&&i<n.length)throw new gr;return e.set(this.uint8Array.subarray(n.position,n.position+i),n.offset),i}close(){return super.close()}supportsRandomAccess(){return!0}setPosition(e){this.position=e}}});function NB(r,e){return new Fw(new Yg(r),e)}function OB(r,e){return new Uw(r,e)}var kB=_t(()=>{Te();Re();Ce();Uh();DB();IB();Uh();Bw()});function ax(r){let{byteLength:e}=r;if(e===6)return r.getUint16(0)*2**32+r.getUint32(2);if(e===5)return r.getUint8(0)*2**32+r.getUint32(1);if(e===4)return r.getUint32(0);if(e===3)return r.getUint8(0)*2**16+r.getUint16(1);if(e===2)return r.getUint16(0);if(e===1)return r.getUint8(0)}function lx(r,e){let t=r.length,n=e.length;if(n===0||n>t)return-1;let i=t-n;for(let o=0;o<=i;o++){let s=!0;for(let a=0;a<n;a++)if(r[o+a]!==e[a]){s=!1;break}if(s)return o}return-1}function LB(r,e){return lx(r,e)!==-1}var Vne,Yne,Xne,PB=_t(()=>{Te();Re();Ce();Vne={utf8:new globalThis.TextDecoder("utf8")},Yne=new globalThis.TextEncoder,Xne=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"))});function MB(r){return[...r].map(e=>e.charCodeAt(0))}function BB(r,e=0){let t=Number.parseInt(new Li(6).get(r,148).replace(/\0.*$/,"").trim(),8);if(Number.isNaN(t))return!1;let n=256;for(let i=e;i<e+148;i++)n+=r[i];for(let i=e+156;i<e+512;i++)n+=r[i];return t===n}var FB,UB=_t(()=>{Te();Re();Ce();sx();FB={get:(r,e)=>r[e+3]&127|r[e+2]<<7|r[e+1]<<14|r[e]<<21,len:4}});var jB,$B,WB=_t(()=>{Te();Re();Ce();jB=["jpg","png","apng","gif","webp","flif","xcf","cr2","cr3","orf","arw","dng","nef","rw2","raf","tif","bmp","icns","jxr","psd","indd","zip","tar","rar","gz","bz2","7z","dmg","mp4","mid","mkv","webm","mov","avi","mpg","mp2","mp3","m4a","oga","ogg","ogv","opus","flac","wav","spx","amr","pdf","epub","elf","macho","exe","swf","rtf","wasm","woff","woff2","eot","ttf","otf","ico","flv","ps","xz","sqlite","nes","crx","xpi","cab","deb","ar","rpm","Z","lz","cfb","mxf","mts","blend","bpg","docx","pptx","xlsx","3gp","3g2","j2c","jp2","jpm","jpx","mj2","aif","qcp","odt","ods","odp","xml","mobi","heic","cur","ktx","ape","wv","dcm","ics","glb","pcap","dsf","lnk","alias","voc","ac3","m4v","m4p","m4b","f4v","f4p","f4b","f4a","mie","asf","ogm","ogx","mpc","arrow","shp","aac","mp1","it","s3m","xm","ai","skp","avif","eps","lzh","pgp","asar","stl","chm","3mf","zst","jxl","vcf","jls","pst","dwg","parquet","class","arj","cpio","ace","avro","icc","fbx","vsdx","vtt","apk"],$B=["image/jpeg","image/png","image/gif","image/webp","image/flif","image/x-xcf","image/x-canon-cr2","image/x-canon-cr3","image/tiff","image/bmp","image/vnd.ms-photo","image/vnd.adobe.photoshop","application/x-indesign","application/epub+zip","application/x-xpinstall","application/vnd.oasis.opendocument.text","application/vnd.oasis.opendocument.spreadsheet","application/vnd.oasis.opendocument.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/zip","application/x-tar","application/x-rar-compressed","application/gzip","application/x-bzip2","application/x-7z-compressed","application/x-apple-diskimage","application/x-apache-arrow","video/mp4","audio/midi","video/x-matroska","video/webm","video/quicktime","video/vnd.avi","audio/wav","audio/qcelp","audio/x-ms-asf","video/x-ms-asf","application/vnd.ms-asf","video/mpeg","video/3gpp","audio/mpeg","audio/mp4","video/ogg","audio/ogg","audio/ogg; codecs=opus","application/ogg","audio/x-flac","audio/ape","audio/wavpack","audio/amr","application/pdf","application/x-elf","application/x-mach-binary","application/x-msdownload","application/x-shockwave-flash","application/rtf","application/wasm","font/woff","font/woff2","application/vnd.ms-fontobject","font/ttf","font/otf","image/x-icon","video/x-flv","application/postscript","application/eps","application/x-xz","application/x-sqlite3","application/x-nintendo-nes-rom","application/x-google-chrome-extension","application/vnd.ms-cab-compressed","application/x-deb","application/x-unix-archive","application/x-rpm","application/x-compress","application/x-lzip","application/x-cfb","application/x-mie","application/mxf","video/mp2t","application/x-blender","image/bpg","image/j2c","image/jp2","image/jpx","image/jpm","image/mj2","audio/aiff","application/xml","application/x-mobipocket-ebook","image/heif","image/heif-sequence","image/heic","image/heic-sequence","image/icns","image/ktx","application/dicom","audio/x-musepack","text/calendar","text/vcard","text/vtt","model/gltf-binary","application/vnd.tcpdump.pcap","audio/x-dsf","application/x.ms.shortcut","application/x.apple.alias","audio/x-voc","audio/vnd.dolby.dd-raw","audio/x-m4a","image/apng","image/x-olympus-orf","image/x-sony-arw","image/x-adobe-dng","image/x-nikon-nef","image/x-panasonic-rw2","image/x-fujifilm-raf","video/x-m4v","video/3gpp2","application/x-esri-shape","audio/aac","audio/x-it","audio/x-s3m","audio/x-xm","video/MP1S","video/MP2P","application/vnd.sketchup.skp","image/avif","application/x-lzh-compressed","application/pgp-encrypted","application/x-asar","model/stl","application/vnd.ms-htmlhelp","model/3mf","image/jxl","application/zstd","image/jls","application/vnd.ms-outlook","image/vnd.dwg","application/x-parquet","application/java-vm","application/x-arj","application/x-cpio","application/x-ace-compressed","application/avro","application/vnd.iccprofile","application/x.autodesk.fbx","application/vnd.visio","application/vnd.android.package-archive"]});var zB={};uo(zB,{FileTypeParser:()=>Ul,fileTypeFromBlob:()=>DV,fileTypeFromBuffer:()=>RV,fileTypeFromStream:()=>CV,fileTypeFromTokenizer:()=>IV,fileTypeStream:()=>NV,reasonableDetectionSizeInBytes:()=>ux,supportedExtensions:()=>OV,supportedMimeTypes:()=>kV});async function CV(r){return new Ul().fromStream(r)}async function RV(r){return new Ul().fromBuffer(r)}async function DV(r){return new Ul().fromBlob(r)}function Ao(r,e,t){t={offset:0,...t};for(let[n,i]of e.entries())if(t.mask){if(i!==(t.mask[n]&r[n+t.offset]))return!1}else if(i!==r[n+t.offset])return!1;return!0}async function IV(r){return new Ul().fromTokenizer(r)}async function NV(r,e){return new Ul(e).toDetectionStream(r,e)}var ux,Ul,OV,kV,HB=_t(()=>{Te();Re();Ce();sx();kB();PB();UB();WB();ux=4100;Ul=class{constructor(e){this.detectors=e?.customDetectors,this.tokenizerOptions={abortSignal:e?.signal},this.fromTokenizer=this.fromTokenizer.bind(this),this.fromBuffer=this.fromBuffer.bind(this),this.parse=this.parse.bind(this)}async fromTokenizer(e){let t=e.position;for(let n of this.detectors||[]){let i=await n(e);if(i)return i;if(t!==e.position)return}return this.parse(e)}async fromBuffer(e){if(!(e instanceof Uint8Array||e instanceof ArrayBuffer))throw new TypeError(`Expected the \`input\` argument to be of type \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof e}\``);let t=e instanceof Uint8Array?e:new Uint8Array(e);if(t?.length>1)return this.fromTokenizer(OB(t,this.tokenizerOptions))}async fromBlob(e){return this.fromStream(e.stream())}async fromStream(e){let t=await NB(e,this.tokenizerOptions);try{return await this.fromTokenizer(t)}finally{await t.close()}}async toDetectionStream(e,t){let{sampleSize:n=ux}=t,i,o,s=e.getReader({mode:"byob"});try{let{value:c,done:f}=await s.read(new Uint8Array(n));if(o=c,!f&&c)try{i=await this.fromBuffer(c.slice(0,n))}catch(h){if(!(h instanceof gr))throw h;i=void 0}o=c}finally{s.releaseLock()}let a=new TransformStream({async start(c){c.enqueue(o)},transform(c,f){f.enqueue(c)}}),u=e.pipeThrough(a);return u.fileType=i,u}check(e,t){return Ao(this.buffer,e,t)}checkString(e,t){return this.check(MB(e),t)}async parse(e){if(this.buffer=new Uint8Array(ux),e.fileInfo.size===void 0&&(e.fileInfo.size=Number.MAX_SAFE_INTEGER),this.tokenizer=e,await e.peekBuffer(this.buffer,{length:12,mayBeLess:!0}),this.check([66,77]))return{ext:"bmp",mime:"image/bmp"};if(this.check([11,119]))return{ext:"ac3",mime:"audio/vnd.dolby.dd-raw"};if(this.check([120,1]))return{ext:"dmg",mime:"application/x-apple-diskimage"};if(this.check([77,90]))return{ext:"exe",mime:"application/x-msdownload"};if(this.check([37,33]))return await e.peekBuffer(this.buffer,{length:24,mayBeLess:!0}),this.checkString("PS-Adobe-",{offset:2})&&this.checkString(" EPSF-",{offset:14})?{ext:"eps",mime:"application/eps"}:{ext:"ps",mime:"application/postscript"};if(this.check([31,160])||this.check([31,157]))return{ext:"Z",mime:"application/x-compress"};if(this.check([199,113]))return{ext:"cpio",mime:"application/x-cpio"};if(this.check([96,234]))return{ext:"arj",mime:"application/x-arj"};if(this.check([239,187,191]))return this.tokenizer.ignore(3),this.parse(e);if(this.check([71,73,70]))return{ext:"gif",mime:"image/gif"};if(this.check([73,73,188]))return{ext:"jxr",mime:"image/vnd.ms-photo"};if(this.check([31,139,8]))return{ext:"gz",mime:"application/gzip"};if(this.check([66,90,104]))return{ext:"bz2",mime:"application/x-bzip2"};if(this.checkString("ID3")){await e.ignore(6);let t=await e.readToken(FB);return e.position+t>e.fileInfo.size?{ext:"mp3",mime:"audio/mpeg"}:(await e.ignore(t),this.fromTokenizer(e))}if(this.checkString("MP+"))return{ext:"mpc",mime:"audio/x-musepack"};if((this.buffer[0]===67||this.buffer[0]===70)&&this.check([87,83],{offset:1}))return{ext:"swf",mime:"application/x-shockwave-flash"};if(this.check([255,216,255]))return this.check([247],{offset:3})?{ext:"jls",mime:"image/jls"}:{ext:"jpg",mime:"image/jpeg"};if(this.check([79,98,106,1]))return{ext:"avro",mime:"application/avro"};if(this.checkString("FLIF"))return{ext:"flif",mime:"image/flif"};if(this.checkString("8BPS"))return{ext:"psd",mime:"image/vnd.adobe.photoshop"};if(this.checkString("WEBP",{offset:8}))return{ext:"webp",mime:"image/webp"};if(this.checkString("MPCK"))return{ext:"mpc",mime:"audio/x-musepack"};if(this.checkString("FORM"))return{ext:"aif",mime:"audio/aiff"};if(this.checkString("icns",{offset:0}))return{ext:"icns",mime:"image/icns"};if(this.check([80,75,3,4])){try{for(;e.position+30<e.fileInfo.size;){await e.readBuffer(this.buffer,{length:30});let t=new DataView(this.buffer.buffer),n={compressedSize:t.getUint32(18,!0),uncompressedSize:t.getUint32(22,!0),filenameLength:t.getUint16(26,!0),extraFieldLength:t.getUint16(28,!0)};if(n.filename=await e.readToken(new Li(n.filenameLength,"utf-8")),await e.ignore(n.extraFieldLength),/classes\d*\.dex/.test(n.filename))return{ext:"apk",mime:"application/vnd.android.package-archive"};if(n.filename==="META-INF/mozilla.rsa")return{ext:"xpi",mime:"application/x-xpinstall"};if(n.filename.endsWith(".rels")||n.filename.endsWith(".xml"))switch(n.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"};case"visio":return{ext:"vsdx",mime:"application/vnd.visio"};default:break}if(n.filename.startsWith("xl/"))return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};if(n.filename.startsWith("3D/")&&n.filename.endsWith(".model"))return{ext:"3mf",mime:"model/3mf"};if(n.filename==="mimetype"&&n.compressedSize===n.uncompressedSize){let i=await e.readToken(new Li(n.compressedSize,"utf-8"));switch(i=i.trim(),i){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:}}if(n.compressedSize===0){let i=-1;for(;i<0&&e.position<e.fileInfo.size;)await e.peekBuffer(this.buffer,{mayBeLess:!0}),i=lx(this.buffer,new Uint8Array([80,75,3,4])),await e.ignore(i>=0?i:this.buffer.length)}else await e.ignore(n.compressedSize)}}catch(t){if(!(t instanceof gr))throw t}return{ext:"zip",mime:"application/zip"}}if(this.checkString("OggS")){await e.ignore(28);let t=new Uint8Array(8);return await e.readBuffer(t),Ao(t,[79,112,117,115,72,101,97,100])?{ext:"opus",mime:"audio/ogg; codecs=opus"}:Ao(t,[128,116,104,101,111,114,97])?{ext:"ogv",mime:"video/ogg"}:Ao(t,[1,118,105,100,101,111,0])?{ext:"ogm",mime:"video/ogg"}:Ao(t,[127,70,76,65,67])?{ext:"oga",mime:"audio/ogg"}:Ao(t,[83,112,101,101,120,32,32])?{ext:"spx",mime:"audio/ogg"}:Ao(t,[1,118,111,114,98,105,115])?{ext:"ogg",mime:"audio/ogg"}:{ext:"ogx",mime:"application/ogg"}}if(this.check([80,75])&&(this.buffer[2]===3||this.buffer[2]===5||this.buffer[2]===7)&&(this.buffer[3]===4||this.buffer[3]===6||this.buffer[3]===8))return{ext:"zip",mime:"application/zip"};if(this.checkString("ftyp",{offset:4})&&(this.buffer[8]&96)!==0){let t=new Li(4,"latin1").get(this.buffer,8).replace("\0"," ").trim();switch(t){case"avif":case"avis":return{ext:"avif",mime:"image/avif"};case"mif1":return{ext:"heic",mime:"image/heif"};case"msf1":return{ext:"heic",mime:"image/heif-sequence"};case"heic":case"heix":return{ext:"heic",mime:"image/heic"};case"hevc":case"hevx":return{ext:"heic",mime:"image/heic-sequence"};case"qt":return{ext:"mov",mime:"video/quicktime"};case"M4V":case"M4VH":case"M4VP":return{ext:"m4v",mime:"video/x-m4v"};case"M4P":return{ext:"m4p",mime:"video/mp4"};case"M4B":return{ext:"m4b",mime:"audio/mp4"};case"M4A":return{ext:"m4a",mime:"audio/x-m4a"};case"F4V":return{ext:"f4v",mime:"video/mp4"};case"F4P":return{ext:"f4p",mime:"video/mp4"};case"F4A":return{ext:"f4a",mime:"audio/mp4"};case"F4B":return{ext:"f4b",mime:"audio/mp4"};case"crx":return{ext:"cr3",mime:"image/x-canon-cr3"};default:return t.startsWith("3g")?t.startsWith("3g2")?{ext:"3g2",mime:"video/3gpp2"}:{ext:"3gp",mime:"video/3gpp"}:{ext:"mp4",mime:"video/mp4"}}}if(this.checkString("MThd"))return{ext:"mid",mime:"audio/midi"};if(this.checkString("wOFF")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff",mime:"font/woff"};if(this.checkString("wOF2")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff2",mime:"font/woff2"};if(this.check([212,195,178,161])||this.check([161,178,195,212]))return{ext:"pcap",mime:"application/vnd.tcpdump.pcap"};if(this.checkString("DSD "))return{ext:"dsf",mime:"audio/x-dsf"};if(this.checkString("LZIP"))return{ext:"lz",mime:"application/x-lzip"};if(this.checkString("fLaC"))return{ext:"flac",mime:"audio/x-flac"};if(this.check([66,80,71,251]))return{ext:"bpg",mime:"image/bpg"};if(this.checkString("wvpk"))return{ext:"wv",mime:"audio/wavpack"};if(this.checkString("%PDF")){try{await e.ignore(1350);let t=10*1024*1024,n=new Uint8Array(Math.min(t,e.fileInfo.size));if(await e.readBuffer(n,{mayBeLess:!0}),LB(n,new TextEncoder().encode("AIPrivateData")))return{ext:"ai",mime:"application/postscript"}}catch(t){if(!(t instanceof gr))throw t}return{ext:"pdf",mime:"application/pdf"}}if(this.check([0,97,115,109]))return{ext:"wasm",mime:"application/wasm"};if(this.check([73,73])){let t=await this.readTiffHeader(!1);if(t)return t}if(this.check([77,77])){let t=await this.readTiffHeader(!0);if(t)return t}if(this.checkString("MAC "))return{ext:"ape",mime:"audio/ape"};if(this.check([26,69,223,163])){async function t(){let a=await e.peekNumber(EB),u=128,c=0;for(;(a&u)===0&&u!==0;)++c,u>>=1;let f=new Uint8Array(c+1);return await e.readBuffer(f),f}async function n(){let a=await t(),u=await t();u[0]^=128>>u.length-1;let c=Math.min(6,u.length),f=new DataView(a.buffer),h=new DataView(u.buffer,u.length-c,c);return{id:ax(f),len:ax(h)}}async function i(a){for(;a>0;){let u=await n();if(u.id===17026)return(await e.readToken(new Li(u.len))).replaceAll(/\00.*$/g,"");await e.ignore(u.len),--a}}let o=await n();switch(await i(o.len)){case"webm":return{ext:"webm",mime:"video/webm"};case"matroska":return{ext:"mkv",mime:"video/x-matroska"};default:return}}if(this.check([82,73,70,70])){if(this.check([65,86,73],{offset:8}))return{ext:"avi",mime:"video/vnd.avi"};if(this.check([87,65,86,69],{offset:8}))return{ext:"wav",mime:"audio/wav"};if(this.check([81,76,67,77],{offset:8}))return{ext:"qcp",mime:"audio/qcelp"}}if(this.checkString("SQLi"))return{ext:"sqlite",mime:"application/x-sqlite3"};if(this.check([78,69,83,26]))return{ext:"nes",mime:"application/x-nintendo-nes-rom"};if(this.checkString("Cr24"))return{ext:"crx",mime:"application/x-google-chrome-extension"};if(this.checkString("MSCF")||this.checkString("ISc("))return{ext:"cab",mime:"application/vnd.ms-cab-compressed"};if(this.check([237,171,238,219]))return{ext:"rpm",mime:"application/x-rpm"};if(this.check([197,208,211,198]))return{ext:"eps",mime:"application/eps"};if(this.check([40,181,47,253]))return{ext:"zst",mime:"application/zstd"};if(this.check([127,69,76,70]))return{ext:"elf",mime:"application/x-elf"};if(this.check([33,66,68,78]))return{ext:"pst",mime:"application/vnd.ms-outlook"};if(this.checkString("PAR1"))return{ext:"parquet",mime:"application/x-parquet"};if(this.check([207,250,237,254]))return{ext:"macho",mime:"application/x-mach-binary"};if(this.check([79,84,84,79,0]))return{ext:"otf",mime:"font/otf"};if(this.checkString("#!AMR"))return{ext:"amr",mime:"audio/amr"};if(this.checkString("{\\rtf"))return{ext:"rtf",mime:"application/rtf"};if(this.check([70,76,86,1]))return{ext:"flv",mime:"video/x-flv"};if(this.checkString("IMPM"))return{ext:"it",mime:"audio/x-it"};if(this.checkString("-lh0-",{offset:2})||this.checkString("-lh1-",{offset:2})||this.checkString("-lh2-",{offset:2})||this.checkString("-lh3-",{offset:2})||this.checkString("-lh4-",{offset:2})||this.checkString("-lh5-",{offset:2})||this.checkString("-lh6-",{offset:2})||this.checkString("-lh7-",{offset:2})||this.checkString("-lzs-",{offset:2})||this.checkString("-lz4-",{offset:2})||this.checkString("-lz5-",{offset:2})||this.checkString("-lhd-",{offset:2}))return{ext:"lzh",mime:"application/x-lzh-compressed"};if(this.check([0,0,1,186])){if(this.check([33],{offset:4,mask:[241]}))return{ext:"mpg",mime:"video/MP1S"};if(this.check([68],{offset:4,mask:[196]}))return{ext:"mpg",mime:"video/MP2P"}}if(this.checkString("ITSF"))return{ext:"chm",mime:"application/vnd.ms-htmlhelp"};if(this.check([202,254,186,190]))return{ext:"class",mime:"application/java-vm"};if(this.check([253,55,122,88,90,0]))return{ext:"xz",mime:"application/x-xz"};if(this.checkString("<?xml "))return{ext:"xml",mime:"application/xml"};if(this.check([55,122,188,175,39,28]))return{ext:"7z",mime:"application/x-7z-compressed"};if(this.check([82,97,114,33,26,7])&&(this.buffer[6]===0||this.buffer[6]===1))return{ext:"rar",mime:"application/x-rar-compressed"};if(this.checkString("solid "))return{ext:"stl",mime:"model/stl"};if(this.checkString("AC")){let t=new Li(4,"latin1").get(this.buffer,2);if(t.match("^d*")&&t>=1e3&&t<=1050)return{ext:"dwg",mime:"image/vnd.dwg"}}if(this.checkString("070707"))return{ext:"cpio",mime:"application/x-cpio"};if(this.checkString("BLENDER"))return{ext:"blend",mime:"application/x-blender"};if(this.checkString("!<arch>"))return await e.ignore(8),await e.readToken(new Li(13,"ascii"))==="debian-binary"?{ext:"deb",mime:"application/x-deb"}:{ext:"ar",mime:"application/x-unix-archive"};if(this.checkString("WEBVTT")&&[`
|
|
94
|
-
`,"\r"," "," ","\0"].some(t=>this.checkString(t,{offset:6})))return{ext:"vtt",mime:"text/vtt"};if(this.check([137,80,78,71,13,10,26,10])){await e.ignore(8);async function t(){return{length:await e.readToken(xB),type:await e.readToken(new Li(4,"latin1"))}}do{let n=await t();if(n.length<0)return;switch(n.type){case"IDAT":return{ext:"png",mime:"image/png"};case"acTL":return{ext:"apng",mime:"image/apng"};default:await e.ignore(n.length+4)}}while(e.position+8<e.fileInfo.size);return{ext:"png",mime:"image/png"}}if(this.check([65,82,82,79,87,49,0,0]))return{ext:"arrow",mime:"application/x-apache-arrow"};if(this.check([103,108,84,70,2,0,0,0]))return{ext:"glb",mime:"model/gltf-binary"};if(this.check([102,114,101,101],{offset:4})||this.check([109,100,97,116],{offset:4})||this.check([109,111,111,118],{offset:4})||this.check([119,105,100,101],{offset:4}))return{ext:"mov",mime:"video/quicktime"};if(this.check([73,73,82,79,8,0,0,0,24]))return{ext:"orf",mime:"image/x-olympus-orf"};if(this.checkString("gimp xcf "))return{ext:"xcf",mime:"image/x-xcf"};if(this.check([73,73,85,0,24,0,0,0,136,231,116,216]))return{ext:"rw2",mime:"image/x-panasonic-rw2"};if(this.check([48,38,178,117,142,102,207,17,166,217])){async function t(){let n=new Uint8Array(16);return await e.readBuffer(n),{id:n,size:Number(await e.readToken(SB))}}for(await e.ignore(30);e.position+24<e.fileInfo.size;){let n=await t(),i=n.size-24;if(Ao(n.id,[145,7,220,183,183,169,207,17,142,230,0,192,12,32,83,101])){let o=new Uint8Array(16);if(i-=await e.readBuffer(o),Ao(o,[64,158,105,248,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"audio/x-ms-asf"};if(Ao(o,[192,239,25,188,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"video/x-ms-asf"};break}await e.ignore(i)}return{ext:"asf",mime:"application/vnd.ms-asf"}}if(this.check([171,75,84,88,32,49,49,187,13,10,26,10]))return{ext:"ktx",mime:"image/ktx"};if((this.check([126,16,4])||this.check([126,24,4]))&&this.check([48,77,73,69],{offset:4}))return{ext:"mie",mime:"application/x-mie"};if(this.check([39,10,0,0,0,0,0,0,0,0,0,0],{offset:2}))return{ext:"shp",mime:"application/x-esri-shape"};if(this.check([255,79,255,81]))return{ext:"j2c",mime:"image/j2c"};if(this.check([0,0,0,12,106,80,32,32,13,10,135,10]))switch(await e.ignore(20),await e.readToken(new Li(4,"ascii"))){case"jp2 ":return{ext:"jp2",mime:"image/jp2"};case"jpx ":return{ext:"jpx",mime:"image/jpx"};case"jpm ":return{ext:"jpm",mime:"image/jpm"};case"mjp2":return{ext:"mj2",mime:"image/mj2"};default:return}if(this.check([255,10])||this.check([0,0,0,12,74,88,76,32,13,10,135,10]))return{ext:"jxl",mime:"image/jxl"};if(this.check([254,255]))return this.check([0,60,0,63,0,120,0,109,0,108],{offset:2})?{ext:"xml",mime:"application/xml"}:void 0;if(this.check([0,0,1,186])||this.check([0,0,1,179]))return{ext:"mpg",mime:"video/mpeg"};if(this.check([0,1,0,0,0]))return{ext:"ttf",mime:"font/ttf"};if(this.check([0,0,1,0]))return{ext:"ico",mime:"image/x-icon"};if(this.check([0,0,2,0]))return{ext:"cur",mime:"image/x-icon"};if(this.check([208,207,17,224,161,177,26,225]))return{ext:"cfb",mime:"application/x-cfb"};if(await e.peekBuffer(this.buffer,{length:Math.min(256,e.fileInfo.size),mayBeLess:!0}),this.check([97,99,115,112],{offset:36}))return{ext:"icc",mime:"application/vnd.iccprofile"};if(this.checkString("**ACE",{offset:7})&&this.checkString("**",{offset:12}))return{ext:"ace",mime:"application/x-ace-compressed"};if(this.checkString("BEGIN:")){if(this.checkString("VCARD",{offset:6}))return{ext:"vcf",mime:"text/vcard"};if(this.checkString("VCALENDAR",{offset:6}))return{ext:"ics",mime:"text/calendar"}}if(this.checkString("FUJIFILMCCD-RAW"))return{ext:"raf",mime:"image/x-fujifilm-raf"};if(this.checkString("Extended Module:"))return{ext:"xm",mime:"audio/x-xm"};if(this.checkString("Creative Voice File"))return{ext:"voc",mime:"audio/x-voc"};if(this.check([4,0,0,0])&&this.buffer.length>=16){let t=new DataView(this.buffer.buffer).getUint32(12,!0);if(t>12&&this.buffer.length>=t+16)try{let n=new TextDecoder().decode(this.buffer.slice(16,t+16));if(JSON.parse(n).files)return{ext:"asar",mime:"application/x-asar"}}catch{}}if(this.check([6,14,43,52,2,5,1,1,13,1,2,1,1,2]))return{ext:"mxf",mime:"application/mxf"};if(this.checkString("SCRM",{offset:44}))return{ext:"s3m",mime:"audio/x-s3m"};if(this.check([71])&&this.check([71],{offset:188}))return{ext:"mts",mime:"video/mp2t"};if(this.check([71],{offset:4})&&this.check([71],{offset:196}))return{ext:"mts",mime:"video/mp2t"};if(this.check([66,79,79,75,77,79,66,73],{offset:60}))return{ext:"mobi",mime:"application/x-mobipocket-ebook"};if(this.check([68,73,67,77],{offset:128}))return{ext:"dcm",mime:"application/dicom"};if(this.check([76,0,0,0,1,20,2,0,0,0,0,0,192,0,0,0,0,0,0,70]))return{ext:"lnk",mime:"application/x.ms.shortcut"};if(this.check([98,111,111,107,0,0,0,0,109,97,114,107,0,0,0,0]))return{ext:"alias",mime:"application/x.apple.alias"};if(this.checkString("Kaydara FBX Binary \0"))return{ext:"fbx",mime:"application/x.autodesk.fbx"};if(this.check([76,80],{offset:34})&&(this.check([0,0,1],{offset:8})||this.check([1,0,2],{offset:8})||this.check([2,0,2],{offset:8})))return{ext:"eot",mime:"application/vnd.ms-fontobject"};if(this.check([6,6,237,245,216,29,70,229,189,49,239,231,254,116,183,29]))return{ext:"indd",mime:"application/x-indesign"};if(await e.peekBuffer(this.buffer,{length:Math.min(512,e.fileInfo.size),mayBeLess:!0}),BB(this.buffer))return{ext:"tar",mime:"application/x-tar"};if(this.check([255,254]))return this.check([60,0,63,0,120,0,109,0,108,0],{offset:2})?{ext:"xml",mime:"application/xml"}:this.check([255,14,83,0,107,0,101,0,116,0,99,0,104,0,85,0,112,0,32,0,77,0,111,0,100,0,101,0,108,0],{offset:2})?{ext:"skp",mime:"application/vnd.sketchup.skp"}:void 0;if(this.checkString("-----BEGIN PGP MESSAGE-----"))return{ext:"pgp",mime:"application/pgp-encrypted"};if(this.buffer.length>=2&&this.check([255,224],{offset:0,mask:[255,224]})){if(this.check([16],{offset:1,mask:[22]}))return this.check([8],{offset:1,mask:[8]})?{ext:"aac",mime:"audio/aac"}:{ext:"aac",mime:"audio/aac"};if(this.check([2],{offset:1,mask:[6]}))return{ext:"mp3",mime:"audio/mpeg"};if(this.check([4],{offset:1,mask:[6]}))return{ext:"mp2",mime:"audio/mpeg"};if(this.check([6],{offset:1,mask:[6]}))return{ext:"mp1",mime:"audio/mpeg"}}}async readTiffTag(e){let t=await this.tokenizer.readToken(e?Mw:Pw);switch(this.tokenizer.ignore(10),t){case 50341:return{ext:"arw",mime:"image/x-sony-arw"};case 50706:return{ext:"dng",mime:"image/x-adobe-dng"};default:}}async readTiffIFD(e){let t=await this.tokenizer.readToken(e?Mw:Pw);for(let n=0;n<t;++n){let i=await this.readTiffTag(e);if(i)return i}}async readTiffHeader(e){let t=(e?Mw:Pw).get(this.buffer,2),n=(e?AB:_B).get(this.buffer,4);if(t===42){if(n>=6){if(this.checkString("CR",{offset:8}))return{ext:"cr2",mime:"image/x-canon-cr2"};if(n>=8&&(this.check([28,0,254,0],{offset:8})||this.check([31,0,11,0],{offset:8})))return{ext:"nef",mime:"image/x-nikon-nef"}}return await this.tokenizer.ignore(n),await this.readTiffIFD(e)??{ext:"tif",mime:"image/tiff"}}if(t===43)return{ext:"tif",mime:"image/tiff"}}},OV=new Set(jB),kV=new Set($B)});var A8={};uo(A8,{AbortException:()=>so,AnnotationEditorLayer:()=>dE,AnnotationEditorParamsType:()=>Ft,AnnotationEditorType:()=>At,AnnotationEditorUIManager:()=>Pu,AnnotationLayer:()=>oE,AnnotationMode:()=>ul,AnnotationType:()=>Vr,CSSConstants:()=>Mv,ColorPicker:()=>Pm,DOMSVGFactory:()=>qf,DrawLayer:()=>pE,FeatureTest:()=>$r,GlobalWorkerOptions:()=>Os,ImageKind:()=>Am,InvalidPDFException:()=>kp,MathClamp:()=>dn,OPS:()=>Op,OutputScale:()=>Zo,PDFDataRangeTransport:()=>Lm,PDFDateString:()=>Wf,PDFWorker:()=>Up,PasswordResponses:()=>dF,PermissionFlag:()=>hF,PixelsPerInch:()=>dl,RenderingCancelledException:()=>Lp,ResponseException:()=>zf,SignatureExtractor:()=>ks,SupportedImageMimeTypes:()=>Pv,TextLayer:()=>Fp,TouchManager:()=>Im,Util:()=>at,VerbosityLevel:()=>Uy,XfaLayer:()=>Rm,applyOpacity:()=>wF,build:()=>I3,createValidAbsoluteUrl:()=>VT,fetchData:()=>$p,findContrastColor:()=>vF,getDocument:()=>S3,getFilenameFromUrl:()=>gF,getPdfFilenameFromUrl:()=>mF,getRGB:()=>Wp,getUuid:()=>XT,getXfaPageViewport:()=>bF,isDataScheme:()=>jy,isPdfFile:()=>FE,isValidExplicitDest:()=>t3,makeArr:()=>KT,makeMap:()=>BE,makeObj:()=>kv,noContextMenu:()=>ss,normalizeUnicode:()=>pF,renderRichText:()=>ZT,setLayerDimensions:()=>Lu,shadow:()=>Et,stopEvent:()=>Ir,updateUrlHash:()=>YT,version:()=>D3});function PV(r){Number.isInteger(r)&&(LE=r)}function MV(){return LE}function PE(r){LE>=Uy.INFOS&&console.info(`Info: ${r}`)}function Tt(r){LE>=Uy.WARNINGS&&console.warn(`Warning: ${r}`)}function Vt(r){throw new Error(r)}function zt(r,e){r||Vt(e)}function BV(r){switch(r?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function VT(r,e=null,t=null){if(!r)return null;if(t&&typeof r=="string"&&(t.addDefaultProtocol&&r.startsWith("www.")&&r.match(/\./g)?.length>=2&&(r=`http://${r}`),t.tryConvertEncoding))try{r=WV(r)}catch{}let n=e?URL.parse(r,e):URL.parse(r);return BV(n)?n:null}function YT(r,e,t=!1){let n=URL.parse(r);return n?(n.hash=e,n.href):t&&VT(r,"http://example.com")?r.split("#",1)[0]+`${e?`#${e}`:""}`:""}function yx(r){return r.substring(r.lastIndexOf("/")+1)}function Et(r,e,t,n=!1){return Object.defineProperty(r,e,{value:t,enumerable:!n,configurable:!0,writable:!1}),t}function FV(r){(typeof r!="object"||r?.length===void 0)&&Vt("Invalid argument for bytesToString");let e=r.length,t=8192;if(e<t)return String.fromCharCode.apply(null,r);let n=[];for(let i=0;i<e;i+=t){let o=Math.min(i+t,e),s=r.subarray(i,o);n.push(String.fromCharCode.apply(null,s))}return n.join("")}function ME(r){typeof r!="string"&&Vt("Invalid argument for stringToBytes");let e=r.length,t=new Uint8Array(e);for(let n=0;n<e;++n)t[n]=r.charCodeAt(n)&255;return t}function UV(r){return String.fromCharCode(r>>24&255,r>>16&255,r>>8&255,r&255)}function jV(){let r=new Uint8Array(4);return r[0]=1,new Uint32Array(r.buffer,0,1)[0]===1}function $V(){try{return new Function(""),!0}catch{return!1}}function WV(r){return decodeURIComponent(escape(r))}function pF(r){return fx||(fx=/([\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,qB=new Map([["\uFB05","\u017Ft"]])),r.replaceAll(fx,(e,t,n)=>t?t.normalize("NFKC"):qB.get(n))}function XT(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();let r=new Uint8Array(32);return crypto.getRandomValues(r),FV(r)}function zV(r,e,t){if(!Array.isArray(t)||t.length<2)return!1;let[n,i,...o]=t;if(!r(n)&&!Number.isInteger(n)||!e(i))return!1;let s=o.length,a=!0;switch(i.name){case"XYZ":if(s<2||s>3)return!1;break;case"Fit":case"FitB":return s===0;case"FitH":case"FitBH":case"FitV":case"FitBV":if(s>1)return!1;break;case"FitR":if(s!==4)return!1;a=!1;break;default:return!1}for(let u of o)if(!(typeof u=="number"||a&&u===null))return!1;return!0}function dn(r,e,t){return Math.min(Math.max(r,e),t)}async function $p(r,e="text"){if(Qg(r,document.baseURI)){let t=await fetch(r);if(!t.ok)throw new Error(t.statusText);switch(e){case"blob":return t.blob();case"bytes":return t.bytes();case"json":return t.json()}return t.text()}return new Promise((t,n)=>{let i=new XMLHttpRequest;i.open("GET",r,!0),i.responseType=e==="bytes"?"arraybuffer":e,i.onreadystatechange=()=>{if(i.readyState===XMLHttpRequest.DONE){if(i.status===200||i.status===0){switch(e){case"bytes":t(new Uint8Array(i.response));return;case"blob":case"json":t(i.response);return}t(i.responseText);return}n(new Error(i.statusText))}},i.send(null)})}function jy(r){let e=r.length,t=0;for(;t<e&&r[t].trim()==="";)t++;return r.substring(t,t+5).toLowerCase()==="data:"}function FE(r){return typeof r=="string"&&/\.pdf$/i.test(r)}function gF(r){return[r]=r.split(/[#?]/,1),yx(r)}function mF(r,e="document.pdf"){if(typeof r!="string")return e;if(jy(r))return Tt('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),e;let n=(a=>{try{return new URL(a)}catch{try{return new URL(decodeURIComponent(a))}catch{try{return new URL(a,"https://foo.bar")}catch{try{return new URL(decodeURIComponent(a),"https://foo.bar")}catch{return null}}}}})(r);if(!n)return e;let i=a=>{try{let u=decodeURIComponent(a);return u.includes("/")&&(u=yx(u),/^\.pdf$/i.test(u))?a:u}catch{return a}},o=/\.pdf$/i,s=yx(n.pathname);if(o.test(s))return i(s);if(n.searchParams.size>0){let a=c=>[...c].findLast(f=>o.test(f)),u=a(n.searchParams.values())??a(n.searchParams.keys());if(u)return i(u)}if(n.hash){let u=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i.exec(n.hash);if(u)return i(u[0])}return e}function Qg(r,e){let t=e?URL.parse(r,e):URL.parse(r);return/https?:/.test(t?.protocol??"")}function ss(r){r.preventDefault()}function Ir(r){r.preventDefault(),r.stopPropagation()}function yF(r){console.log("Deprecated API usage: "+r)}function bF(r,{scale:e=1,rotation:t=0}){let{width:n,height:i}=r.attributes.style,o=[0,0,parseInt(n),parseInt(i)];return new Dm({viewBox:o,userUnit:1,scale:e,rotation:t})}function Wp(r){if(r.startsWith("#")){let e=parseInt(r.slice(1),16);return[(e&16711680)>>16,(e&65280)>>8,e&255]}return r.startsWith("rgb(")?r.slice(4,-1).split(",").map(e=>parseInt(e)):r.startsWith("rgba(")?r.slice(5,-1).split(",").map(e=>parseInt(e)).slice(0,3):(Tt(`Not a valid color format: "${r}"`),[0,0,0])}function HV(r){let e=document.createElement("span");e.style.visibility="hidden",e.style.colorScheme="only light",document.body.append(e);for(let t of r.keys()){e.style.color=t;let n=window.getComputedStyle(e).color;r.set(t,Wp(n))}e.remove()}function Dr(r){let{a:e,b:t,c:n,d:i,e:o,f:s}=r.getTransform();return[e,t,n,i,o,s]}function xo(r){let{a:e,b:t,c:n,d:i,e:o,f:s}=r.getTransform().invertSelf();return[e,t,n,i,o,s]}function Lu(r,e,t=!1,n=!0){if(e instanceof Dm){let{pageWidth:i,pageHeight:o}=e.rawDims,{style:s}=r,a=$r.isCSSRoundSupported,u=`var(--total-scale-factor) * ${i}px`,c=`var(--total-scale-factor) * ${o}px`,f=a?`round(down, ${u}, var(--scale-round-x))`:`calc(${u})`,h=a?`round(down, ${c}, var(--scale-round-y))`:`calc(${c})`;!t||e.rotation%180===0?(s.width=f,s.height=h):(s.width=h,s.height=f)}n&&r.setAttribute("data-main-rotation",e.rotation)}function wF(r,e,t,n){n=dn(n??1,0,1);let i=255*(1-n);return r=Math.round(r*n+i),e=Math.round(e*n+i),t=Math.round(t*n+i),[r,e,t]}function GB(r,e){let t=r[0]/255,n=r[1]/255,i=r[2]/255,o=Math.max(t,n,i),s=Math.min(t,n,i),a=(o+s)/2;if(o===s)e[0]=e[1]=0;else{let u=o-s;switch(e[1]=a<.5?u/(o+s):u/(2-o-s),o){case t:e[0]=((n-i)/u+(n<i?6:0))*60;break;case n:e[0]=((i-t)/u+2)*60;break;case i:e[0]=((t-n)/u+4)*60;break}}e[2]=a}function Ex(r,e){let t=r[0],n=r[1],i=r[2],o=(1-Math.abs(2*i-1))*n,s=o*(1-Math.abs(t/60%2-1)),a=i-o/2;switch(Math.floor(t/60)){case 0:e[0]=o+a,e[1]=s+a,e[2]=a;break;case 1:e[0]=s+a,e[1]=o+a,e[2]=a;break;case 2:e[0]=a,e[1]=o+a,e[2]=s+a;break;case 3:e[0]=a,e[1]=s+a,e[2]=o+a;break;case 4:e[0]=s+a,e[1]=a,e[2]=o+a;break;case 5:case 6:e[0]=o+a,e[1]=a,e[2]=s+a;break}}function VB(r){return r<=.03928?r/12.92:((r+.055)/1.055)**2.4}function YB(r,e,t){Ex(r,t),t.map(VB);let n=.2126*t[0]+.7152*t[1]+.0722*t[2];Ex(e,t),t.map(VB);let i=.2126*t[0]+.7152*t[1]+.0722*t[2];return n>i?(n+.05)/(i+.05):(i+.05)/(n+.05)}function vF(r,e){let t=r[0]+r[1]*256+r[2]*65536+e[0]*16777216+e[1]*4294967296+e[2]*1099511627776,n=XB.get(t);if(n)return n;let i=new Float32Array(9),o=i.subarray(0,3),s=i.subarray(3,6);GB(r,s);let a=i.subarray(6,9);GB(e,a);let u=a[2]<.5,c=u?12:4.5;if(s[2]=u?Math.sqrt(s[2]):1-Math.sqrt(1-s[2]),YB(s,a,o)<c){let f,h;u?(f=s[2],h=1):(f=0,h=s[2]);let d=.005;for(;h-f>d;){let m=s[2]=(f+h)/2;u===YB(s,a,o)<c?f=m:h=m}s[2]=u?h:f}return Ex(s,o),n=at.makeHexColor(Math.round(o[0]*255),Math.round(o[1]*255),Math.round(o[2]*255)),XB.set(t,n),n}function ZT({html:r,dir:e,className:t},n){let i=document.createDocumentFragment();if(typeof r=="string"){let o=document.createElement("p");o.dir=e||"auto";let s=r.split(/(?:\r\n?|\n)/);for(let a=0,u=s.length;a<u;++a){let c=s[a];o.append(document.createTextNode(c)),a<u-1&&o.append(document.createElement("br"))}i.append(o)}else Rm.render({xfaHtml:r,div:i,intent:"richText"});i.firstElementChild.classList.add("richText",t),n.append(i)}function EF(r){let e=new Path2D;if(!r)return e;for(let t=0,n=r.length;t<n;)switch(r[t++]){case Xg.moveTo:e.moveTo(r[t++],r[t++]);break;case Xg.lineTo:e.lineTo(r[t++],r[t++]);break;case Xg.curveTo:e.bezierCurveTo(r[t++],r[t++],r[t++],r[t++],r[t++],r[t++]);break;case Xg.quadraticCurveTo:e.quadraticCurveTo(r[t++],r[t++],r[t++],r[t++]);break;case Xg.closePath:e.closePath();break;default:Tt(`Unrecognized drawing path operator: ${r[t-1]}`);break}return e}function CF(r,e,t){for(let n of t)e.addEventListener(n,r[n].bind(r))}function qV(r){if(r instanceof URL)return r;if(typeof r=="string"){if(ni){if(/^[a-z][a-z0-9\-+.]+:/i.test(r))return new URL(r);let t=We.getBuiltinModule("url");return new URL(t.pathToFileURL(r))}let e=URL.parse(r,window.location);if(e)return e}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function GV(r){if(ni&&typeof He<"u"&&r instanceof He)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(r instanceof Uint8Array&&r.byteLength===r.buffer.byteLength)return r;if(typeof r=="string")return ME(r);if(r instanceof ArrayBuffer||ArrayBuffer.isView(r)||typeof r=="object"&&!isNaN(r?.length))return new Uint8Array(r);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}function jw(r){if(typeof r!="string")return null;if(r.endsWith("/"))return r;throw new Error(`Invalid factory url: "${r}" must include trailing slash.`)}function ZB(){}function yi(r){if(r instanceof so||r instanceof kp||r instanceof Ov||r instanceof zf||r instanceof xm)return r;switch(r instanceof Error||typeof r=="object"&&r!==null||Vt('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),r.name){case"AbortException":return new so(r.message);case"InvalidPDFException":return new kp(r.message);case"PasswordException":return new Ov(r.message,r.code);case"ResponseException":return new zf(r.message,r.status,r.missing);case"UnknownErrorException":return new xm(r.message,r.details)}return new xm(r.message,r.toString())}async function JT(r){let t=await We.getBuiltinModule("fs").promises.readFile(r);return new Uint8Array(t)}function Ww(r,e,t,n,i,o){r[e*4+0]=Math.min(r[e*4+0],t),r[e*4+1]=Math.min(r[e*4+1],n),r[e*4+2]=Math.max(r[e*4+2],i),r[e*4+3]=Math.max(r[e*4+3],o)}function cS(r,e){if(!e)return;let t=e[2]-e[0],n=e[3]-e[1],i=new Path2D;i.rect(e[0],e[1],t,n),r.clip(i)}function hx(r,e,t,n,i,o,s,a){let u=e.coords,c=e.colors,f=r.data,h=r.width*4,d;u[t+1]>u[n+1]&&(d=t,t=n,n=d,d=o,o=s,s=d),u[n+1]>u[i+1]&&(d=n,n=i,i=d,d=s,s=a,a=d),u[t+1]>u[n+1]&&(d=t,t=n,n=d,d=o,o=s,s=d);let m=(u[t]+e.offsetX)*e.scaleX,y=(u[t+1]+e.offsetY)*e.scaleY,v=(u[n]+e.offsetX)*e.scaleX,w=(u[n+1]+e.offsetY)*e.scaleY,b=(u[i]+e.offsetX)*e.scaleX,E=(u[i+1]+e.offsetY)*e.scaleY;if(y>=E)return;let _=c[o],S=c[o+1],A=c[o+2],F=c[s],I=c[s+1],q=c[s+2],ee=c[a],K=c[a+1],ne=c[a+2],L=Math.round(y),$=Math.round(E),Y,ie,re,k,x,P,C,j;for(let U=L;U<=$;U++){if(U<w){let te=U<y?0:(y-U)/(y-w);Y=m-(m-v)*te,ie=_-(_-F)*te,re=S-(S-I)*te,k=A-(A-q)*te}else{let te;U>E?te=1:w===E?te=0:te=(w-U)/(w-E),Y=v-(v-b)*te,ie=F-(F-ee)*te,re=I-(I-K)*te,k=q-(q-ne)*te}let B;U<y?B=0:U>E?B=1:B=(y-U)/(y-E),x=m-(m-b)*B,P=_-(_-ee)*B,C=S-(S-K)*B,j=A-(A-ne)*B;let Q=Math.round(Math.min(Y,x)),fe=Math.round(Math.max(Y,x)),Ee=h*U+Q*4;for(let te=Q;te<=fe;te++)B=(Y-te)/(Y-x),B<0?B=0:B>1&&(B=1),f[Ee++]=ie-(ie-P)*B|0,f[Ee++]=re-(re-C)*B|0,f[Ee++]=k-(k-j)*B|0,f[Ee++]=255}}function YV(r,e,t){let n=e.coords,i=e.colors,o,s;switch(e.type){case mx.LATTICE:let a=e.verticesPerRow,u=Math.floor(n.length/a)-1,c=a-1;for(o=0;o<u;o++){let f=o*a;for(let h=0;h<c;h++,f++)hx(r,t,n[f],n[f+1],n[f+a],i[f],i[f+1],i[f+a]),hx(r,t,n[f+a+1],n[f+1],n[f+a],i[f+a+1],i[f+1],i[f+a])}break;case mx.TRIANGLES:for(o=0,s=n.length;o<s;o+=3)hx(r,t,n[o],n[o+1],n[o+2],i[o],i[o+1],i[o+2]);break;default:throw new Error("illegal figure")}}function XV(r){switch(r[0]){case"RadialAxial":return new fS(r);case"Mesh":return new hS(r);case"Dummy":return new dS}throw new Error(`Unknown IR type: ${r[0]}`)}function KV({src:r,srcPos:e=0,dest:t,width:n,height:i,nonBlackColor:o=4294967295,inverseDecode:s=!1}){let a=$r.isLittleEndian?4278190080:255,[u,c]=s?[o,a]:[a,o],f=n>>3,h=n&7,d=u^c,m=r.length;t=new Uint32Array(t.buffer);let y=0;for(let v=0;v<i;++v){for(let b=e+f;e<b;++e,y+=8){let E=r[e];t[y]=u^-(E>>7&1)&d,t[y+1]=u^-(E>>6&1)&d,t[y+2]=u^-(E>>5&1)&d,t[y+3]=u^-(E>>4&1)&d,t[y+4]=u^-(E>>3&1)&d,t[y+5]=u^-(E>>2&1)&d,t[y+6]=u^-(E>>1&1)&d,t[y+7]=u^-(E&1)&d}if(h===0)continue;let w=e<m?r[e++]:255;for(let b=0;b<h;++b,++y)t[y]=u^-(w>>7-b&1)&d}return{srcPos:e,destPos:y}}function JV(r,e){if(r._removeMirroring)throw new Error("Context is already forwarding operations.");r.__originalSave=r.save,r.__originalRestore=r.restore,r.__originalRotate=r.rotate,r.__originalScale=r.scale,r.__originalTranslate=r.translate,r.__originalTransform=r.transform,r.__originalSetTransform=r.setTransform,r.__originalResetTransform=r.resetTransform,r.__originalClip=r.clip,r.__originalMoveTo=r.moveTo,r.__originalLineTo=r.lineTo,r.__originalBezierCurveTo=r.bezierCurveTo,r.__originalRect=r.rect,r.__originalClosePath=r.closePath,r.__originalBeginPath=r.beginPath,r._removeMirroring=()=>{r.save=r.__originalSave,r.restore=r.__originalRestore,r.rotate=r.__originalRotate,r.scale=r.__originalScale,r.translate=r.__originalTranslate,r.transform=r.__originalTransform,r.setTransform=r.__originalSetTransform,r.resetTransform=r.__originalResetTransform,r.clip=r.__originalClip,r.moveTo=r.__originalMoveTo,r.lineTo=r.__originalLineTo,r.bezierCurveTo=r.__originalBezierCurveTo,r.rect=r.__originalRect,r.closePath=r.__originalClosePath,r.beginPath=r.__originalBeginPath,delete r._removeMirroring},r.save=function(){e.save(),this.__originalSave()},r.restore=function(){e.restore(),this.__originalRestore()},r.translate=function(t,n){e.translate(t,n),this.__originalTranslate(t,n)},r.scale=function(t,n){e.scale(t,n),this.__originalScale(t,n)},r.transform=function(t,n,i,o,s,a){e.transform(t,n,i,o,s,a),this.__originalTransform(t,n,i,o,s,a)},r.setTransform=function(t,n,i,o,s,a){e.setTransform(t,n,i,o,s,a),this.__originalSetTransform(t,n,i,o,s,a)},r.resetTransform=function(){e.resetTransform(),this.__originalResetTransform()},r.rotate=function(t){e.rotate(t),this.__originalRotate(t)},r.clip=function(t){e.clip(t),this.__originalClip(t)},r.moveTo=function(t,n){e.moveTo(t,n),this.__originalMoveTo(t,n)},r.lineTo=function(t,n){e.lineTo(t,n),this.__originalLineTo(t,n)},r.bezierCurveTo=function(t,n,i,o,s,a){e.bezierCurveTo(t,n,i,o,s,a),this.__originalBezierCurveTo(t,n,i,o,s,a)},r.rect=function(t,n,i,o){e.rect(t,n,i,o),this.__originalRect(t,n,i,o)},r.closePath=function(){e.closePath(),this.__originalClosePath()},r.beginPath=function(){e.beginPath(),this.__originalBeginPath()}}function Hw(r,e,t,n,i,o,s,a,u,c){let[f,h,d,m,y,v]=Dr(r);if(h===0&&d===0){let E=s*f+y,_=Math.round(E),S=a*m+v,A=Math.round(S),F=(s+u)*f+y,I=Math.abs(Math.round(F)-_)||1,q=(a+c)*m+v,ee=Math.abs(Math.round(q)-A)||1;return r.setTransform(Math.sign(f),0,0,Math.sign(m),_,A),r.drawImage(e,t,n,i,o,0,0,I,ee),r.setTransform(f,h,d,m,y,v),[I,ee]}if(f===0&&m===0){let E=a*d+y,_=Math.round(E),S=s*h+v,A=Math.round(S),F=(a+c)*d+y,I=Math.abs(Math.round(F)-_)||1,q=(s+u)*h+v,ee=Math.abs(Math.round(q)-A)||1;return r.setTransform(0,Math.sign(h),Math.sign(d),0,_,A),r.drawImage(e,t,n,i,o,0,0,ee,I),r.setTransform(f,h,d,m,y,v),[ee,I]}r.drawImage(e,t,n,i,o,s,a,u,c);let w=Math.hypot(f,h),b=Math.hypot(d,m);return[w*u,b*c]}function iF(r,e){if(e instanceof ImageData){r.putImageData(e,0,0);return}let t=e.height,n=e.width,i=t%Ci,o=(t-i)/Ci,s=i===0?o:o+1,a=r.createImageData(n,Ci),u=0,c,f=e.data,h=a.data,d,m,y,v;if(e.kind===Am.GRAYSCALE_1BPP){let w=f.byteLength,b=new Uint32Array(h.buffer,0,h.byteLength>>2),E=b.length,_=n+7>>3,S=4294967295,A=$r.isLittleEndian?4278190080:255;for(d=0;d<s;d++){for(y=d<o?Ci:i,c=0,m=0;m<y;m++){let F=w-u,I=0,q=F>_?n:F*8-7,ee=q&-8,K=0,ne=0;for(;I<ee;I+=8)ne=f[u++],b[c++]=ne&128?S:A,b[c++]=ne&64?S:A,b[c++]=ne&32?S:A,b[c++]=ne&16?S:A,b[c++]=ne&8?S:A,b[c++]=ne&4?S:A,b[c++]=ne&2?S:A,b[c++]=ne&1?S:A;for(;I<q;I++)K===0&&(ne=f[u++],K=128),b[c++]=ne&K?S:A,K>>=1}for(;c<E;)b[c++]=0;r.putImageData(a,0,d*Ci)}}else if(e.kind===Am.RGBA_32BPP){for(m=0,v=n*Ci*4,d=0;d<o;d++)h.set(f.subarray(u,u+v)),u+=v,r.putImageData(a,0,m),m+=Ci;d<s&&(v=n*i*4,h.set(f.subarray(u,u+v)),r.putImageData(a,0,m))}else if(e.kind===Am.RGB_24BPP)for(y=Ci,v=n*y,d=0;d<s;d++){for(d>=o&&(y=i,v=n*y),c=0,m=v;m--;)h[c++]=f[u++],h[c++]=f[u++],h[c++]=f[u++],h[c++]=255;r.putImageData(a,0,d*Ci)}else throw new Error(`bad image kind: ${e.kind}`)}function sF(r,e){if(e.bitmap){r.drawImage(e.bitmap,0,0);return}let t=e.height,n=e.width,i=t%Ci,o=(t-i)/Ci,s=i===0?o:o+1,a=r.createImageData(n,Ci),u=0,c=e.data,f=a.data;for(let h=0;h<s;h++){let d=h<o?Ci:i;({srcPos:u}=KV({src:c,srcPos:u,dest:f,width:n,height:d,nonBlackColor:0})),r.putImageData(a,0,h*Ci)}}function Kg(r,e){let t=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(let n of t)r[n]!==void 0&&(e[n]=r[n]);r.setLineDash!==void 0&&(e.setLineDash(r.getLineDash()),e.lineDashOffset=r.lineDashOffset)}function qw(r){r.strokeStyle=r.fillStyle="#000000",r.fillRule="nonzero",r.globalAlpha=1,r.lineWidth=1,r.lineCap="butt",r.lineJoin="miter",r.miterLimit=10,r.globalCompositeOperation="source-over",r.font="10px sans-serif",r.setLineDash!==void 0&&(r.setLineDash([]),r.lineDashOffset=0);let{filter:e}=r;e!=="none"&&e!==""&&(r.filter="none")}function oF(r,e){if(e)return!0;at.singularValueDecompose2dScale(r,ts);let t=Math.fround(Zo.pixelRatio*dl.PDF_TO_CSS_UNITS);return ts[0]<=t&&ts[1]<=t}function lF(r){return r instanceof Uint8Array&&r.byteLength===r.buffer.byteLength?r.buffer:new Uint8Array(r).buffer}function UE(){for(let r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0}function rY(r){let e=!0,t=n("filename\\*","i").exec(r);if(t){t=t[1];let f=a(t);return f=unescape(f),f=u(f),f=c(f),o(f)}if(t=s(r),t){let f=c(t);return o(f)}if(t=n("filename","i").exec(r),t){t=t[1];let f=a(t);return f=c(f),o(f)}function n(f,h){return new RegExp("(?:^|;)\\s*"+f+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',h)}function i(f,h){if(f){if(!/^[\x00-\xFF]+$/.test(h))return h;try{let d=new TextDecoder(f,{fatal:!0}),m=ME(h);h=d.decode(m),e=!1}catch{}}return h}function o(f){return e&&/[\x80-\xff]/.test(f)&&(f=i("utf-8",f),e&&(f=i("iso-8859-1",f))),f}function s(f){let h=[],d,m=n("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(d=m.exec(f))!==null;){let[,v,w,b]=d;if(v=parseInt(v,10),v in h){if(v===0)break;continue}h[v]=[w,b]}let y=[];for(let v=0;v<h.length&&v in h;++v){let[w,b]=h[v];b=a(b),w&&(b=unescape(b),v===0&&(b=u(b))),y.push(b)}return y.join("")}function a(f){if(f.startsWith('"')){let h=f.slice(1).split('\\"');for(let d=0;d<h.length;++d){let m=h[d].indexOf('"');m!==-1&&(h[d]=h[d].slice(0,m),h.length=d+1),h[d]=h[d].replaceAll(/\\(.)/g,"$1")}f=h.join('"')}return f}function u(f){let h=f.indexOf("'");if(h===-1)return f;let d=f.slice(0,h),y=f.slice(h+1).replace(/^[^']*'/,"");return i(d,y)}function c(f){return!f.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(f)?f:f.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(h,d,m,y){if(m==="q"||m==="Q")return y=y.replaceAll("_"," "),y=y.replaceAll(/=([0-9a-fA-F]{2})/g,function(v,w){return String.fromCharCode(parseInt(w,16))}),i(d,y);try{y=atob(y)}catch{}return i(d,y)})}return""}function o3(r,e){let t=new Headers;if(!r||!e||typeof e!="object")return t;for(let n in e){let i=e[n];i!==void 0&&t.append(n,i)}return t}function jE(r){return URL.parse(r)?.origin??null}function a3({responseHeaders:r,isHttp:e,rangeChunkSize:t,disableRange:n}){let i={allowRangeRequests:!1,suggestedLength:void 0},o=parseInt(r.get("Content-Length"),10);return!Number.isInteger(o)||(i.suggestedLength=o,o<=2*t)||n||!e||r.get("Accept-Ranges")!=="bytes"||(r.get("Content-Encoding")||"identity")!=="identity"||(i.allowRangeRequests=!0),i}function l3(r){let e=r.get("Content-Disposition");if(e){let t=rY(e);if(t.includes("%"))try{t=decodeURIComponent(t)}catch{}if(FE(t))return t}return null}function $E(r,e){return new zf(`Unexpected server response (${r}) while retrieving PDF "${e.href}".`,r,r===404||r===0&&e.protocol==="file:")}function u3(r,e){if(r!==e)throw new Error(`Expected range response-origin "${r}" to match "${e}".`)}function c3(r,e,t,n){return fetch(r,{method:"GET",headers:e,signal:n.signal,mode:"cors",credentials:t?"include":"same-origin",redirect:"follow"})}function f3(r,e){if(r!==200&&r!==206)throw $E(r,e)}function WE(r){if(r instanceof Uint8Array)return r.buffer;if(r instanceof ArrayBuffer)return r;throw new Error(`getArrayBuffer - unexpected data: ${r}`)}function nY(r){return typeof r!="string"?r:ME(r).buffer}function v3(r){let{Readable:e}=We.getBuiltinModule("stream");return typeof e.toWeb=="function"?e.toWeb(r):We.getBuiltinModule("module").createRequire("")("node-readable-to-web-readable-stream").makeDefaultReadableStreamFromNodeReadable(r)}function S3(r={}){typeof r=="string"||r instanceof URL?r={url:r}:(r instanceof ArrayBuffer||ArrayBuffer.isView(r))&&(r={data:r});let e=new jS,{docId:t}=e,n=r.url?qV(r.url):null,i=r.data?GV(r.data):null,o=r.httpHeaders||null,s=r.withCredentials===!0,a=r.password??null,u=r.range instanceof Lm?r.range:null,c=Number.isInteger(r.rangeChunkSize)&&r.rangeChunkSize>0?r.rangeChunkSize:2**16,f=r.worker instanceof Up?r.worker:null,h=r.verbosity,d=typeof r.docBaseUrl=="string"&&!jy(r.docBaseUrl)?r.docBaseUrl:null,m=jw(r.cMapUrl),y=r.cMapPacked!==!1,v=r.CMapReaderFactory||(ni?nS:Hv),w=jw(r.iccUrl),b=jw(r.standardFontDataUrl),E=r.StandardFontDataFactory||(ni?iS:Vv),_=jw(r.wasmUrl),S=r.WasmFactory||(ni?sS:Xv),A=r.stopAtErrors!==!0,F=Number.isInteger(r.maxImageSize)&&r.maxImageSize>-1?r.maxImageSize:-1,I=r.isEvalSupported!==!1,q=typeof r.isOffscreenCanvasSupported=="boolean"?r.isOffscreenCanvasSupported:!ni,ee=typeof r.isImageDecoderSupported=="boolean"?r.isImageDecoderSupported:!ni&&($r.platform.isFirefox||!globalThis.chrome),K=Number.isInteger(r.canvasMaxAreaInBytes)?r.canvasMaxAreaInBytes:-1,ne=typeof r.disableFontFace=="boolean"?r.disableFontFace:ni,L=r.fontExtraProperties===!0,$=r.enableXfa===!0,Y=r.ownerDocument||globalThis.document,ie=r.disableRange===!0,re=r.disableStream===!0,k=r.disableAutoFetch===!0,x=r.pdfBug===!0,P=r.CanvasFactory||(ni?rS:Zx),C=r.FilterFactory||(ni?tS:Jx),j=r.enableHWA===!0,U=r.useWasm!==!1,B=r.pagesMapper||new _x,Q=u?u.length:r.length??NaN,fe=typeof r.useSystemFonts=="boolean"?r.useSystemFonts:!ni&&!ne,Ee=typeof r.useWorkerFetch=="boolean"?r.useWorkerFetch:!!(v===Hv&&E===Vv&&S===Xv&&m&&b&&_&&Qg(m,document.baseURI)&&Qg(b,document.baseURI)&&Qg(_,document.baseURI)),te=null;PV(h);let H={canvasFactory:new P({ownerDocument:Y,enableHWA:j}),filterFactory:new C({docId:t,ownerDocument:Y}),cMapReaderFactory:Ee?null:new v({baseUrl:m,isCompressed:y}),standardFontDataFactory:Ee?null:new E({baseUrl:b}),wasmFactory:Ee?null:new S({baseUrl:_})};f||(f=Up.create({verbosity:h,port:Os.workerPort}),e._worker=f);let ae={docId:t,apiVersion:"5.5.207",data:i,password:a,disableAutoFetch:k,rangeChunkSize:c,length:Q,docBaseUrl:d,enableXfa:$,evaluatorOptions:{maxImageSize:F,disableFontFace:ne,ignoreErrors:A,isEvalSupported:I,isOffscreenCanvasSupported:q,isImageDecoderSupported:ee,canvasMaxAreaInBytes:K,fontExtraProperties:L,useSystemFonts:fe,useWasm:U,useWorkerFetch:Ee,cMapUrl:m,iccUrl:w,standardFontDataUrl:b,wasmUrl:_}},we={ownerDocument:Y,pdfBug:x,styleElement:te,enableHWA:j,loadingParams:{disableAutoFetch:k,enableXfa:$}};return f.promise.then(function(){if(e.destroyed)throw new Error("Loading aborted");if(f.destroyed)throw new Error("Worker was destroyed");let xe=f.messageHandler.sendWithPromise("GetDocRequest",ae,i?[i.buffer]:null),V;if(u)V=new AS({pdfDataRangeTransport:u,disableRange:ie,disableStream:re});else if(!i){if(!n)throw new Error("getDocument - no `url` parameter provided.");let M=Qg(n)?CS:ni?LS:IS;V=new M({url:n,length:Q,httpHeaders:o,withCredentials:s,rangeChunkSize:c,disableRange:ie,disableStream:re})}return xe.then(M=>{if(e.destroyed)throw new Error("Loading aborted");if(f.destroyed)throw new Error("Worker was destroyed");let oe=new Rc(t,M,f.port),ge=new zS(oe,e,V,we,H,B);e._transport=ge,oe.send("Ready",null)})}).catch(e._capability.reject),e}function fF(r){return Math.floor(Math.max(0,Math.min(1,r))*255).toString(16).padStart(2,"0")}function Zg(r){return Math.max(0,Math.min(255,255*r))}var Yw,ni,gx,Xw,LV,gie,es,ul,Tm,At,Ft,hF,mx,cn,Am,Vr,$h,Uy,Op,Xg,dF,LE,Yf,Ov,xm,kp,zf,bx,so,$r,cx,cl,Kw,wx,at,fx,qB,Xh,KT,BE,kv,Cm,Rm,xa,Sc,dl,Dm,Lp,Lv,Wm,Wf,Zo,Pv,vx,Mv,XB,bs,Rn,nd,Co,Dc,id,zm,_r,Ax,em,Ec,Zw,Jw,_x,$l,Wl,ws,vs,Hm,zl,sd,od,qm,gE,_F,Mn,AF,xF,Wh,tm,Ca,xx,Gm,Ic,Da,gl,SF,TF,Tx,Sx,Nc,Oc,ad,kc,sr,Wn,mE,Cx,ld,Vm,zn,ud,Qw,QT,Rx,Yr,Hl,Ym,Rr,Dx,yE,RF,Hf,bE,Ix,cd,Mi,fd,Mr,Jr,hd,Es,dd,_s,Hn,ql,Gl,Vl,Yl,Ro,As,Lc,Xm,Km,pd,Zm,Do,Xl,gd,Kl,Io,wE,Zl,md,Jm,Jl,Pc,yd,Ql,Qm,Qr,Qt,Ia,eu,tu,e0,bd,t0,ru,No,Na,r0,n0,xs,st,ev,Nx,DF,IF,NF,rm,OF,kF,LF,Ox,PF,MF,BF,FF,Jn,Sa,UF,jF,kx,$F,nm,Lx,Jh,Pu,wn,Oo,Gs,wd,ko,Bi,vd,Lo,wi,Oa,Mc,Po,nu,io,im,tv,Qn,Bv,Dn,Ss,Bc,yr,i0,iu,Ts,su,ou,Fc,s0,Px,Kh,Ed,Uc,o0,a0,l0,u0,c0,ka,jc,La,$c,Pa,Mu,WF,zF,HF,eC,Im,Wc,Vs,Sr,er,Ma,_d,au,f0,In,zc,Ba,Cs,lu,h0,Hc,Fi,d0,qc,Fa,Mo,Ad,xd,Rs,Gc,p0,vE,bt,Mx,g0,Bx,rv,qF,GF,Fx,nv,Ux,VF,YF,XF,jx,KF,$x,ZF,JF,QF,Wx,sm,St,br,zx,KB,ms,So,Fv,Nm,Vc,Yc,Ua,Nn,EE,e3,Om,m0,Uv,Sd,Hx,or,qx,Td,Cd,y0,Rd,iv,Qh,jv,uu,Bo,Xc,Kc,om,ed,$v,Dd,Id,Nd,Od,Ui,Fo,b0,ar,jr,Hs,sv,am,Ct,Gx,w0,v0,E0,_0,A0,x0,S0,T0,mr,Vx,kd,Yx,Xx,VV,t3,ja,_E,Kx,$w,Zr,Ld,Ps,r3,n3,i3,ov,Rc,C0,Wv,Zx,zv,Hv,qv,Zc,Pd,$a,Wa,qn,Jc,Qc,ct,$n,lm,zh,av,Hh,s3,Qx,qh,um,cm,eS,fm,Jx,Gv,Vv,Yv,Xv,tS,rS,nS,iS,sS,jh,JB,QB,oS,Md,cu,aS,zw,vi,Ei,ef,Ys,tf,za,tr,lr,Ha,_i,R0,Bd,rf,nf,qa,Gn,Uo,D0,uS,lS,pr,Br,Xs,Fd,Ud,tC,Kv,ys,Ln,km,fS,hS,dS,eF,AE,pS,tF,rF,ZV,nF,Ci,dx,ts,Zh,gS,Zv,QV,eY,tY,aF,oo,mS,yS,bS,rC,rd,I0,N0,Os,jd,O0,wS,Gh,k0,L0,P0,$d,vS,fu,ur,Wd,zd,M0,_S,ES,B0,F0,Pp,Mp,Bp,U0,xS,AS,j0,SS,$0,TS,CS,RS,DS,px,uF,jo,jp,h3,d3,IS,W0,Jo,p3,g3,m3,y3,NS,z0,ml,b3,w3,kS,OS,LS,PS,MS,hm,iY,Ks,H0,BS,Jv,sY,cF,hu,Ai,q0,G0,sf,Ga,V0,Y0,of,X0,Hd,du,qd,K0,Gd,af,Z0,J0,Vd,lf,Q0,Yd,Xd,yl,E3,_3,FS,is,lv,US,A3,x3,Cn,Fp,oY,xE,SE,jS,Kd,ey,ty,ry,Lm,$S,Va,Zd,uf,dm,WS,pu,Zs,Ya,cf,TE,ff,hf,ii,uv,T3,C3,pm,Jd,cv,xr,Up,ji,df,Xa,xi,$o,Qd,Ka,ep,ns,R3,gm,fv,zS,HS,gu,pf,Tc,qS,D3,I3,$i,gf,tp,hn,ny,rp,Za,iy,mu,Js,sy,cr,GS,VS,YS,_c,N3,jl,bi,Pm,Wo,oy,np,ay,Cc,Qv,eE,XS,qf,aY,Gf,lY,Sm,mf,ip,Ds,ly,KS,nC,Nr,ZS,rs,Ac,O3,k3,Mm,JS,pl,QS,eT,tT,tE,rT,nT,uy,iT,Bm,Wi,yu,CE,RE,sp,op,Fr,zo,bu,yf,ap,lp,Ho,zi,Ja,Qa,Ur,el,wu,cy,tl,up,bf,vu,vn,Eu,Dt,hv,oT,aT,lT,dv,uT,L3,P3,M3,B3,pv,gv,cT,sT,rE,fy,fT,hy,hT,dy,dT,py,nE,pT,gT,gy,wf,my,mT,Fm,iE,yT,bT,wT,sE,yy,by,ET,vT,vf,Ef,cp,_u,wy,_f,Hi,vy,fl,mv,_T,iC,oE,Gw,qi,Ey,Af,Gi,en,F3,U3,j3,yv,hl,bv,wv,$3,xT,W3,Er,AT,ut,Vi,Qs,fp,hp,qo,Lt,xf,Sf,_y,Ay,dp,pp,Au,xy,DE,IE,pn,mm,z3,H3,q3,G3,V3,Y3,Ra,aE,gp,Tf,rl,Sy,Yi,Ty,Xr,NE,X3,lE,Cy,Ry,Dy,xu,eo,si,K3,vv,Z3,J3,ST,Um,Iy,mp,TT,jm,CT,yp,Ny,nl,Cf,Oy,Si,ky,Ly,Rf,Xi,Ki,On,bp,wp,Vn,vp,Is,Py,Rt,RT,Ev,Q3,e8,t8,DT,xc,Ls,Vh,r8,_v,Av,n8,i8,s8,o8,a8,Gt,uE,Df,cE,Zi,Ep,En,If,Nf,$t,IT,NT,OT,ym,l8,xv,bm,Yh,Bt,fE,Go,_n,An,Of,_p,ei,kn,Ns,kf,Lf,Pf,Ap,Sv,kT,ti,My,By,Ji,Vo,Yo,xp,Sp,Mf,Pn,Ta,u8,c8,f8,Vf,hE,OE,h8,td,LT,$m,Vw,Jg,Bf,Kt,PT,to,d8,p8,MT,Tv,g8,m8,y8,BT,FT,b8,ks,UT,jT,Su,Xo,Tu,Ff,Pi,$T,Tr,xn,Cu,il,Ru,Tp,sl,Uf,Ko,Qi,Cp,Wt,vm,Em,Cv,Rv,Dv,WT,Iv,w8,wm,jf,Rp,Du,Iu,ol,Ti,Nu,Dp,Ip,ro,al,Sn,ll,Ou,Np,ht,ku,rr,_m,v8,To,zT,HT,Nv,qs,dE,no,ri,$f,Fy,kE,E8,Qo,qT,_8,GT,fn,pE,x8=_t(()=>{Te();Re();Ce();Yw={};Yw.d=(r,e)=>{for(var t in e)Yw.o(e,t)&&!Yw.o(r,t)&&Object.defineProperty(r,t,{enumerable:!0,get:e[t]})};Yw.o=(r,e)=>Object.prototype.hasOwnProperty.call(r,e);ni=typeof We=="object"&&We+""=="[object process]"&&!We.versions.nw&&!(We.versions.electron&&We.type&&We.type!=="browser"),gx=[.001,0,0,.001,0,0],Xw=1.35,LV=.35,gie=LV/Xw,es={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,IS_EDITING:128,OPLIST:256},ul={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},Tm="pdfjs_internal_editor_",At={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,POPUP:16,SIGNATURE:101,COMMENT:102},Ft={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_THICKNESS:32,HIGHLIGHT_FREE:33,HIGHLIGHT_SHOW_ALL:34,DRAW_STEP:41},hF={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},mx={TRIANGLES:1,LATTICE:2,PATCH:3},cn={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},Am={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},Vr={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},$h={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},Uy={ERRORS:0,WARNINGS:1,INFOS:5},Op={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},Xg={moveTo:0,lineTo:1,curveTo:2,quadraticCurveTo:3,closePath:4},dF={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},LE=Uy.WARNINGS;Yf=(function(){function e(t,n){this.message=t,this.name=n}return e.prototype=new Error,e.constructor=e,e})(),Ov=class extends Yf{constructor(e,t){super(e,"PasswordException"),this.code=t}},xm=class extends Yf{constructor(e,t){super(e,"UnknownErrorException"),this.details=t}},kp=class extends Yf{constructor(e){super(e,"InvalidPDFException")}},zf=class extends Yf{constructor(e,t,n){super(e,"ResponseException"),this.status=t,this.missing=n}},bx=class extends Yf{constructor(e){super(e,"FormatError")}},so=class extends Yf{constructor(e){super(e,"AbortException")}};$r=class{static get isLittleEndian(){return Et(this,"isLittleEndian",jV())}static get isEvalSupported(){return Et(this,"isEvalSupported",$V())}static get isOffscreenCanvasSupported(){return Et(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get isImageDecoderSupported(){return Et(this,"isImageDecoderSupported",typeof ImageDecoder<"u")}static get isFloat16ArraySupported(){return Et(this,"isFloat16ArraySupported",typeof Float16Array<"u")}static get isSanitizerSupported(){return Et(this,"isSanitizerSupported",typeof Sanitizer<"u")}static get platform(){let{platform:e,userAgent:t}=navigator;return Et(this,"platform",{isAndroid:t.includes("Android"),isLinux:e.includes("Linux"),isMac:e.includes("Mac"),isWindows:e.includes("Win"),isFirefox:t.includes("Firefox")})}static get isCSSRoundSupported(){return Et(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}},cx=Array.from(Array(256).keys(),r=>r.toString(16).padStart(2,"0")),at=class{static makeHexColor(e,t,n){return`#${cx[e]}${cx[t]}${cx[n]}`}static domMatrixToTransform(e){return[e.a,e.b,e.c,e.d,e.e,e.f]}static scaleMinMax(e,t){let n;e[0]?(e[0]<0&&(n=t[0],t[0]=t[2],t[2]=n),t[0]*=e[0],t[2]*=e[0],e[3]<0&&(n=t[1],t[1]=t[3],t[3]=n),t[1]*=e[3],t[3]*=e[3]):(n=t[0],t[0]=t[1],t[1]=n,n=t[2],t[2]=t[3],t[3]=n,e[1]<0&&(n=t[1],t[1]=t[3],t[3]=n),t[1]*=e[1],t[3]*=e[1],e[2]<0&&(n=t[0],t[0]=t[2],t[2]=n),t[0]*=e[2],t[2]*=e[2]),t[0]+=e[4],t[1]+=e[5],t[2]+=e[4],t[3]+=e[5]}static transform(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}static multiplyByDOMMatrix(e,t){return[e[0]*t.a+e[2]*t.b,e[1]*t.a+e[3]*t.b,e[0]*t.c+e[2]*t.d,e[1]*t.c+e[3]*t.d,e[0]*t.e+e[2]*t.f+e[4],e[1]*t.e+e[3]*t.f+e[5]]}static applyTransform(e,t,n=0){let i=e[n],o=e[n+1];e[n]=i*t[0]+o*t[2]+t[4],e[n+1]=i*t[1]+o*t[3]+t[5]}static applyTransformToBezier(e,t,n=0){let i=t[0],o=t[1],s=t[2],a=t[3],u=t[4],c=t[5];for(let f=0;f<6;f+=2){let h=e[n+f],d=e[n+f+1];e[n+f]=h*i+d*s+u,e[n+f+1]=h*o+d*a+c}}static applyInverseTransform(e,t){let n=e[0],i=e[1],o=t[0]*t[3]-t[1]*t[2];e[0]=(n*t[3]-i*t[2]+t[2]*t[5]-t[4]*t[3])/o,e[1]=(-n*t[1]+i*t[0]+t[4]*t[1]-t[5]*t[0])/o}static axialAlignedBoundingBox(e,t,n){let i=t[0],o=t[1],s=t[2],a=t[3],u=t[4],c=t[5],f=e[0],h=e[1],d=e[2],m=e[3],y=i*f+u,v=y,w=i*d+u,b=w,E=a*h+c,_=E,S=a*m+c,A=S;if(o!==0||s!==0){let F=o*f,I=o*d,q=s*h,ee=s*m;y+=q,b+=q,w+=ee,v+=ee,E+=F,A+=F,S+=I,_+=I}n[0]=Math.min(n[0],y,w,v,b),n[1]=Math.min(n[1],E,S,_,A),n[2]=Math.max(n[2],y,w,v,b),n[3]=Math.max(n[3],E,S,_,A)}static inverseTransform(e){let t=e[0]*e[3]-e[1]*e[2];return[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t,(e[2]*e[5]-e[4]*e[3])/t,(e[4]*e[1]-e[5]*e[0])/t]}static singularValueDecompose2dScale(e,t){let n=e[0],i=e[1],o=e[2],s=e[3],a=n**2+i**2,u=n*o+i*s,c=o**2+s**2,f=(a+c)/2,h=Math.sqrt(f**2-(a*c-u**2));t[0]=Math.sqrt(f+h||1),t[1]=Math.sqrt(f-h||1)}static normalizeRect(e){let t=e.slice(0);return e[0]>e[2]&&(t[0]=e[2],t[2]=e[0]),e[1]>e[3]&&(t[1]=e[3],t[3]=e[1]),t}static intersect(e,t){let n=Math.max(Math.min(e[0],e[2]),Math.min(t[0],t[2])),i=Math.min(Math.max(e[0],e[2]),Math.max(t[0],t[2]));if(n>i)return null;let o=Math.max(Math.min(e[1],e[3]),Math.min(t[1],t[3])),s=Math.min(Math.max(e[1],e[3]),Math.max(t[1],t[3]));return o>s?null:[n,o,i,s]}static pointBoundingBox(e,t,n){n[0]=Math.min(n[0],e),n[1]=Math.min(n[1],t),n[2]=Math.max(n[2],e),n[3]=Math.max(n[3],t)}static rectBoundingBox(e,t,n,i,o){o[0]=Math.min(o[0],e,n),o[1]=Math.min(o[1],t,i),o[2]=Math.max(o[2],e,n),o[3]=Math.max(o[3],t,i)}static bezierBoundingBox(e,t,n,i,o,s,a,u,c){c[0]=Math.min(c[0],e,a),c[1]=Math.min(c[1],t,u),c[2]=Math.max(c[2],e,a),c[3]=Math.max(c[3],t,u),X(this,cl,wx).call(this,e,n,o,a,t,i,s,u,3*(-e+3*(n-o)+a),6*(e-2*n+o),3*(n-e),c),X(this,cl,wx).call(this,e,n,o,a,t,i,s,u,3*(-t+3*(i-s)+u),6*(t-2*i+s),3*(i-t),c)}};cl=new WeakSet,Kw=function(e,t,n,i,o,s,a,u,c,f){if(c<=0||c>=1)return;let h=1-c,d=c*c,m=d*c,y=h*(h*(h*e+3*c*t)+3*d*n)+m*i,v=h*(h*(h*o+3*c*s)+3*d*a)+m*u;f[0]=Math.min(f[0],y),f[1]=Math.min(f[1],v),f[2]=Math.max(f[2],y),f[3]=Math.max(f[3],v)},wx=function(e,t,n,i,o,s,a,u,c,f,h,d){if(Math.abs(c)<1e-12){Math.abs(f)>=1e-12&&X(this,cl,Kw).call(this,e,t,n,i,o,s,a,u,-h/f,d);return}let m=f**2-4*h*c;if(m<0)return;let y=Math.sqrt(m),v=2*c;X(this,cl,Kw).call(this,e,t,n,i,o,s,a,u,(-f+y)/v,d),X(this,cl,Kw).call(this,e,t,n,i,o,s,a,u,(-f-y)/v,d)},z(at,cl);fx=null,qB=null;Xh="pdfjs_internal_id_";KT=()=>[],BE=()=>new Map,kv=()=>Object.create(null);typeof Math.sumPrecise!="function"&&(Math.sumPrecise=function(r){return r.reduce((e,t)=>e+t,0)});Cm=class r{static textContent(e){let t=[],n={items:t,styles:Object.create(null)};function i(o){if(!o)return;let s=null,a=o.name;if(a==="#text")s=o.value;else if(r.shouldBuildText(a))o?.attributes?.textContent?s=o.attributes.textContent:o.value&&(s=o.value);else return;if(s!==null&&t.push({str:s}),!!o.children)for(let u of o.children)i(u)}return i(e),n}static shouldBuildText(e){return!(e==="textarea"||e==="input"||e==="option"||e==="select")}},Rm=class{static setupStorage(e,t,n,i,o){let s=i.getValue(t,{value:null});switch(n.name){case"textarea":if(s.value!==null&&(e.textContent=s.value),o==="print")break;e.addEventListener("input",a=>{i.setValue(t,{value:a.target.value})});break;case"input":if(n.attributes.type==="radio"||n.attributes.type==="checkbox"){if(s.value===n.attributes.xfaOn?e.setAttribute("checked",!0):s.value===n.attributes.xfaOff&&e.removeAttribute("checked"),o==="print")break;e.addEventListener("change",a=>{i.setValue(t,{value:a.target.checked?a.target.getAttribute("xfaOn"):a.target.getAttribute("xfaOff")})})}else{if(s.value!==null&&e.setAttribute("value",s.value),o==="print")break;e.addEventListener("input",a=>{i.setValue(t,{value:a.target.value})})}break;case"select":if(s.value!==null){e.setAttribute("value",s.value);for(let a of n.children)a.attributes.value===s.value?a.attributes.selected=!0:a.attributes.hasOwnProperty("selected")&&delete a.attributes.selected}e.addEventListener("input",a=>{let u=a.target.options,c=u.selectedIndex===-1?"":u[u.selectedIndex].value;i.setValue(t,{value:c})});break}}static setAttributes({html:e,element:t,storage:n=null,intent:i,linkService:o}){let{attributes:s}=t,a=e instanceof HTMLAnchorElement;s.type==="radio"&&(s.name=`${s.name}-${i}`);for(let[u,c]of Object.entries(s))if(c!=null)switch(u){case"class":c.length&&e.setAttribute(u,c.join(" "));break;case"dataId":break;case"id":e.setAttribute("data-element-id",c);break;case"style":Object.assign(e.style,c);break;case"textContent":e.textContent=c;break;default:(!a||u!=="href"&&u!=="newWindow")&&e.setAttribute(u,c)}a&&o.addLinkAttributes(e,s.href,s.newWindow),n&&s.dataId&&this.setupStorage(e,s.dataId,t,n)}static render(e){let t=e.annotationStorage,n=e.linkService,i=e.xfaHtml,o=e.intent||"display",s=document.createElement(i.name);i.attributes&&this.setAttributes({html:s,element:i,intent:o,linkService:n});let a=o!=="richText",u=e.div;if(u.append(s),e.viewport){let h=`matrix(${e.viewport.transform.join(",")})`;u.style.transform=h}a&&u.setAttribute("class","xfaLayer xfaFont");let c=[];if(i.children.length===0){if(i.value){let h=document.createTextNode(i.value);s.append(h),a&&Cm.shouldBuildText(i.name)&&c.push(h)}return{textDivs:c}}let f=[[i,-1,s]];for(;f.length>0;){let[h,d,m]=f.at(-1);if(d+1===h.children.length){f.pop();continue}let y=h.children[++f.at(-1)[1]];if(y===null)continue;let{name:v}=y;if(v==="#text"){let b=document.createTextNode(y.value);c.push(b),m.append(b);continue}let w=y?.attributes?.xmlns?document.createElementNS(y.attributes.xmlns,v):document.createElement(v);if(m.append(w),y.attributes&&this.setAttributes({html:w,element:y,storage:t,intent:o,linkService:n}),y.children?.length>0)f.push([y,-1,w]);else if(y.value){let b=document.createTextNode(y.value);a&&Cm.shouldBuildText(v)&&c.push(b),w.append(b)}}for(let h of u.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))h.setAttribute("readOnly",!0);return{textDivs:c}}static update(e){let t=`matrix(${e.viewport.transform.join(",")})`;e.div.style.transform=t,e.div.hidden=!1}},xa="http://www.w3.org/2000/svg",Sc=class Sc{};ze(Sc,"CSS",96),ze(Sc,"PDF",72),ze(Sc,"PDF_TO_CSS_UNITS",Sc.CSS/Sc.PDF);dl=Sc;Dm=class r{constructor({viewBox:e,userUnit:t,scale:n,rotation:i,offsetX:o=0,offsetY:s=0,dontFlip:a=!1}){this.viewBox=e,this.userUnit=t,this.scale=n,this.rotation=i,this.offsetX=o,this.offsetY=s,n*=t;let u=(e[2]+e[0])/2,c=(e[3]+e[1])/2,f,h,d,m;switch(i%=360,i<0&&(i+=360),i){case 180:f=-1,h=0,d=0,m=1;break;case 90:f=0,h=1,d=1,m=0;break;case 270:f=0,h=-1,d=-1,m=0;break;case 0:f=1,h=0,d=0,m=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}a&&(d=-d,m=-m);let y,v,w,b;f===0?(y=Math.abs(c-e[1])*n+o,v=Math.abs(u-e[0])*n+s,w=(e[3]-e[1])*n,b=(e[2]-e[0])*n):(y=Math.abs(u-e[0])*n+o,v=Math.abs(c-e[1])*n+s,w=(e[2]-e[0])*n,b=(e[3]-e[1])*n),this.transform=[f*n,h*n,d*n,m*n,y-f*n*u-d*n*c,v-h*n*u-m*n*c],this.width=w,this.height=b}get rawDims(){let e=this.viewBox;return Et(this,"rawDims",{pageWidth:e[2]-e[0],pageHeight:e[3]-e[1],pageX:e[0],pageY:e[1]})}clone({scale:e=this.scale,rotation:t=this.rotation,offsetX:n=this.offsetX,offsetY:i=this.offsetY,dontFlip:o=!1}={}){return new r({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:e,rotation:t,offsetX:n,offsetY:i,dontFlip:o})}convertToViewportPoint(e,t){let n=[e,t];return at.applyTransform(n,this.transform),n}convertToViewportRectangle(e){let t=[e[0],e[1]];at.applyTransform(t,this.transform);let n=[e[2],e[3]];return at.applyTransform(n,this.transform),[t[0],t[1],n[0],n[1]]}convertToPdfPoint(e,t){let n=[e,t];return at.applyInverseTransform(n,this.transform),n}},Lp=class extends Yf{constructor(e,t=0){super(e,"RenderingCancelledException"),this.extraDelay=t}};Lv=class{constructor(){ze(this,"started",Object.create(null));ze(this,"times",[])}time(e){e in this.started&&Tt(`Timer is already running for ${e}`),this.started[e]=Date.now()}timeEnd(e){e in this.started||Tt(`Timer has not been started for ${e}`),this.times.push({name:e,start:this.started[e],end:Date.now()}),delete this.started[e]}toString(){let e=[],t=0;for(let{name:n}of this.times)t=Math.max(n.length,t);for(let{name:n,start:i,end:o}of this.times)e.push(`${n.padEnd(t)} ${o-i}ms
|
|
95
|
-
`);return e.join("")}};Wf=class{static toDateObject(e){if(e instanceof Date)return e;if(!e||typeof e!="string")return null;l(this,Wm)||O(this,Wm,new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));let t=l(this,Wm).exec(e);if(!t)return null;let n=parseInt(t[1],10),i=parseInt(t[2],10);i=i>=1&&i<=12?i-1:0;let o=parseInt(t[3],10);o=o>=1&&o<=31?o:1;let s=parseInt(t[4],10);s=s>=0&&s<=23?s:0;let a=parseInt(t[5],10);a=a>=0&&a<=59?a:0;let u=parseInt(t[6],10);u=u>=0&&u<=59?u:0;let c=t[7]||"Z",f=parseInt(t[8],10);f=f>=0&&f<=23?f:0;let h=parseInt(t[9],10)||0;return h=h>=0&&h<=59?h:0,c==="-"?(s+=f,a+=h):c==="+"&&(s-=f,a-=h),new Date(Date.UTC(n,i,o,s,a,u))}};Wm=new WeakMap,z(Wf,Wm);Zo=class r{constructor(){let{pixelRatio:e}=r;this.sx=e,this.sy=e}get scaled(){return this.sx!==1||this.sy!==1}get symmetric(){return this.sx===this.sy}limitCanvas(e,t,n,i,o=-1){let s=1/0,a=1/0,u=1/0;n=r.capPixels(n,o),n>0&&(s=Math.sqrt(n/(e*t))),i!==-1&&(a=i/e,u=i/t);let c=Math.min(s,a,u);return this.sx>c||this.sy>c?(this.sx=c,this.sy=c,!0):!1}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(e,t){if(t>=0){let n=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+t/100));return e>0?Math.min(e,n):n}return e}},Pv=["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"],vx=class{static get isDarkMode(){return Et(this,"isDarkMode",!!window?.matchMedia?.("(prefers-color-scheme: dark)").matches)}},Mv=class{static get commentForegroundColor(){let e=document.createElement("span");e.classList.add("comment","sidebar");let{style:t}=e;t.width=t.height="0",t.display="none",t.color="var(--comment-fg-color)",document.body.append(e);let{color:n}=window.getComputedStyle(e);return e.remove(),Et(this,"commentForegroundColor",Wp(n))}};XB=new Map;_x=class{constructor(){z(this,_r);z(this,bs,null);z(this,Rn,null);z(this,nd,null);z(this,Co,0);z(this,Dc,[]);z(this,id,null);z(this,zm,null)}get pagesNumber(){return l(this,Co)}set pagesNumber(e){l(this,Co)!==e&&(O(this,Co,e),X(this,_r,Ax).call(this))}addListener(e){l(this,Dc).push(e)}removeListener(e){let t=l(this,Dc).indexOf(e);t>=0&&l(this,Dc).splice(t,1)}movePages(e,t,n){X(this,_r,Ec).call(this,!0);let i=l(this,Rn),o=l(this,bs),s=t.length,a=new Uint32Array(s),u=0;for(let d=0;d<s;d++){let m=t[d]-1;a[d]=i[m],m<n&&(u+=1)}let c=l(this,Co),f=n-u,h=c-s;f=dn(f,0,h);for(let d=0,m=0;d<c;d++)e.has(d+1)||(i[m++]=i[d]);i.copyWithin(f+s,f,h),i.set(a,f),X(this,_r,Jw).call(this,o,null),X(this,_r,Zw).call(this),X(this,_r,em).call(this,{type:"move"}),i.every((d,m)=>d===m+1)&&X(this,_r,Ax).call(this)}deletePages(e){X(this,_r,Ec).call(this,!0);let t=l(this,Rn),n=l(this,bs);this.pagesNumber-=e.length,X(this,_r,Ec).call(this,!1);let i=l(this,Rn),o=0,s=0;for(let a of e){let u=a-1;u!==o&&(i.set(t.subarray(o,u),s),s+=u-o),o=u+1}o<t.length&&i.set(t.subarray(o),s),X(this,_r,Jw).call(this,n,null),X(this,_r,Zw).call(this),X(this,_r,em).call(this,{type:"delete",pageNumbers:e})}copyPages(e){X(this,_r,Ec).call(this,!0),O(this,zm,e),O(this,id,e.map(t=>l(this,Rn)[t-1])),X(this,_r,em).call(this,{type:"copy",pageNumbers:e})}pastePages(e){X(this,_r,Ec).call(this,!0);let t=l(this,Rn),n=l(this,bs),i=l(this,zm),o=new Map,s=e;for(let u of i)o.set(++s,u);this.pagesNumber+=i.length,X(this,_r,Ec).call(this,!1);let a=l(this,Rn);a.set(t.subarray(0,e),0),a.set(l(this,id),e),a.set(t.subarray(e),e+i.length),X(this,_r,Jw).call(this,n,o),X(this,_r,Zw).call(this),X(this,_r,em).call(this,{type:"paste"}),O(this,id,null)}hasBeenAltered(){return l(this,Rn)!==null}getPageMappingForSaving(){let e=l(this,bs),t=0;for(let i of e.values())t=Math.max(t,i.length);let n=new Array(t);for(let i=0;i<t;i++)n[i]={document:null,pageIndices:[],includePages:[]};for(let[i,o]of e)for(let s=0,a=o.length;s<a;s++)n[s].includePages.push([i-1,o[s]-1]);for(let{includePages:i,pageIndices:o}of n){i.sort((s,a)=>s[0]-a[0]);for(let s=0,a=i.length;s<a;s++)o.push(i[s][1]),i[s]=i[s][0]}return n}getPrevPageNumber(e){return l(this,nd)[e-1]??0}getPageNumber(e){return l(this,bs)?l(this,bs).get(e)?.[0]??0:e}getPageId(e){return l(this,Rn)?.[e-1]??e}getMapping(){return l(this,Rn).subarray(0,this.pagesNumber)}};bs=new WeakMap,Rn=new WeakMap,nd=new WeakMap,Co=new WeakMap,Dc=new WeakMap,id=new WeakMap,zm=new WeakMap,_r=new WeakSet,Ax=function(){O(this,Rn,null),O(this,bs,null)},em=function(e){for(let t of l(this,Dc))t(e)},Ec=function(e){if(l(this,Rn))return;let t=l(this,Co),n=O(this,Rn,new Uint32Array(t));O(this,nd,new Int32Array(n));let i=O(this,bs,new Map);if(e)for(let o=1;o<=t;o++)n[o-1]=o,i.set(o,[o])},Zw=function(){let e=l(this,bs),t=l(this,Rn);e.clear();for(let n=0,i=l(this,Co);n<i;n++){let o=t[n],s=e.get(o);s?s.push(n+1):e.set(o,[n+1])}},Jw=function(e,t){let n=l(this,nd),i=l(this,Rn),o=new Map;for(let s=0,a=l(this,Co);s<a;s++){let u=t?.get(s+1);if(u){n[s]=-u;continue}let c=i[s],f=o.get(c)||0;n[s]=e.get(c)?.[f],o.set(c,f+1)}};Ca=class Ca{constructor(e){z(this,Mn);z(this,$l,null);z(this,Wl,null);z(this,ws);z(this,vs,null);z(this,Hm,null);z(this,zl,null);z(this,sd,null);z(this,od,null);O(this,ws,e),l(Ca,qm)||O(Ca,qm,Object.freeze({freetext:"pdfjs-editor-remove-freetext-button",highlight:"pdfjs-editor-remove-highlight-button",ink:"pdfjs-editor-remove-ink-button",stamp:"pdfjs-editor-remove-stamp-button",signature:"pdfjs-editor-remove-signature-button"}))}render(){let e=O(this,$l,document.createElement("div"));e.classList.add("editToolbar","hidden"),e.setAttribute("role","toolbar");let t=l(this,ws)._uiManager._signal;t instanceof AbortSignal&&!t.aborted&&(e.addEventListener("contextmenu",ss,{signal:t}),e.addEventListener("pointerdown",X(Ca,gE,_F),{signal:t}));let n=O(this,vs,document.createElement("div"));n.className="buttons",e.append(n);let i=l(this,ws).toolbarPosition;if(i){let{style:o}=e,s=l(this,ws)._uiManager.direction==="ltr"?1-i[0]:i[0];o.insetInlineEnd=`${100*s}%`,o.top=`calc(${100*i[1]}% + var(--editor-toolbar-vert-offset))`}return e}get div(){return l(this,$l)}hide(){l(this,$l).classList.add("hidden"),l(this,Wl)?.hideDropdown()}show(){l(this,$l).classList.remove("hidden"),l(this,Hm)?.shown(),l(this,zl)?.shown()}addDeleteButton(){let{editorType:e,_uiManager:t}=l(this,ws),n=document.createElement("button");n.classList.add("basic","deleteButton"),n.tabIndex=0,n.setAttribute("data-l10n-id",l(Ca,qm)[e]),X(this,Mn,Wh).call(this,n)&&n.addEventListener("click",i=>{t.delete()},{signal:t._signal}),l(this,vs).append(n)}async addAltText(e){let t=await e.render();X(this,Mn,Wh).call(this,t),l(this,vs).append(t,l(this,Mn,tm)),O(this,Hm,e)}addComment(e,t=null){if(l(this,zl))return;let n=e.renderForToolbar();if(!n)return;X(this,Mn,Wh).call(this,n);let i=O(this,sd,l(this,Mn,tm));t?(l(this,vs).insertBefore(n,t),l(this,vs).insertBefore(i,t)):l(this,vs).append(n,i),O(this,zl,e),e.toolbar=this}addColorPicker(e){if(l(this,Wl))return;O(this,Wl,e);let t=e.renderButton();X(this,Mn,Wh).call(this,t),l(this,vs).append(t,l(this,Mn,tm))}async addEditSignatureButton(e){let t=O(this,od,await e.renderEditButton(l(this,ws)));X(this,Mn,Wh).call(this,t),l(this,vs).append(t,l(this,Mn,tm))}removeButton(e){e==="comment"&&(l(this,zl)?.removeToolbarCommentButton(),O(this,zl,null),l(this,sd)?.remove(),O(this,sd,null))}async addButton(e,t){switch(e){case"colorPicker":t&&this.addColorPicker(t);break;case"altText":t&&await this.addAltText(t);break;case"editSignature":t&&await this.addEditSignatureButton(t);break;case"delete":this.addDeleteButton();break;case"comment":t&&this.addComment(t);break}}async addButtonBefore(e,t,n){if(!t&&e==="comment")return;let i=l(this,vs).querySelector(n);i&&e==="comment"&&this.addComment(t,i)}updateEditSignatureButton(e){l(this,od)&&(l(this,od).title=e)}remove(){l(this,$l).remove(),l(this,Wl)?.destroy(),O(this,Wl,null)}};$l=new WeakMap,Wl=new WeakMap,ws=new WeakMap,vs=new WeakMap,Hm=new WeakMap,zl=new WeakMap,sd=new WeakMap,od=new WeakMap,qm=new WeakMap,gE=new WeakSet,_F=function(e){e.stopPropagation()},Mn=new WeakSet,AF=function(e){l(this,ws)._focusEventsAllowed=!1,Ir(e)},xF=function(e){l(this,ws)._focusEventsAllowed=!0,Ir(e)},Wh=function(e){let t=l(this,ws)._uiManager._signal;return!(t instanceof AbortSignal)||t.aborted?!1:(e.addEventListener("focusin",X(this,Mn,AF).bind(this),{capture:!0,signal:t}),e.addEventListener("focusout",X(this,Mn,xF).bind(this),{capture:!0,signal:t}),e.addEventListener("contextmenu",ss,{signal:t}),!0)},tm=function(){let e=document.createElement("div");return e.className="divider",e},z(Ca,gE),z(Ca,qm,null);xx=Ca,Sx=class{constructor(e){z(this,gl);z(this,Gm,null);z(this,Ic,null);z(this,Da);O(this,Da,e)}show(e,t,n){let[i,o]=X(this,gl,TF).call(this,t,n),{style:s}=l(this,Ic)||O(this,Ic,X(this,gl,SF).call(this));e.append(l(this,Ic)),s.insetInlineEnd=`${100*i}%`,s.top=`calc(${100*o}% + var(--editor-toolbar-vert-offset))`}hide(){l(this,Ic).remove()}};Gm=new WeakMap,Ic=new WeakMap,Da=new WeakMap,gl=new WeakSet,SF=function(){let e=O(this,Ic,document.createElement("div"));e.className="editToolbar",e.setAttribute("role","toolbar");let t=l(this,Da)._signal;t instanceof AbortSignal&&!t.aborted&&e.addEventListener("contextmenu",ss,{signal:t});let n=O(this,Gm,document.createElement("div"));return n.className="buttons",e.append(n),l(this,Da).hasCommentManager()&&X(this,gl,Tx).call(this,"commentButton","pdfjs-comment-floating-button","pdfjs-comment-floating-button-label",()=>{l(this,Da).commentSelection("floating_button")}),X(this,gl,Tx).call(this,"highlightButton","pdfjs-highlight-floating-button1","pdfjs-highlight-floating-button-label",()=>{l(this,Da).highlightSelection("floating_button")}),e},TF=function(e,t){let n=0,i=0;for(let o of e){let s=o.y+o.height;if(s<n)continue;let a=o.x+(t?o.width:0);if(s>n){i=a,n=s;continue}t?a>i&&(i=a):a<i&&(i=a)}return[t?1-i:i,n]},Tx=function(e,t,n,i){let o=document.createElement("button");o.classList.add("basic",e),o.tabIndex=0,o.setAttribute("data-l10n-id",t);let s=document.createElement("span");o.append(s),s.className="visuallyHidden",s.setAttribute("data-l10n-id",n);let a=l(this,Da)._signal;a instanceof AbortSignal&&!a.aborted&&(o.addEventListener("contextmenu",ss,{signal:a}),o.addEventListener("click",i,{signal:a})),l(this,Gm).append(o)};sr=class sr{static initializeAndAddPointerId(e){(l(sr,Oc)||O(sr,Oc,new Set)).add(e)}static setPointer(e,t){l(sr,Nc)||O(sr,Nc,t),l(sr,kc)??O(sr,kc,e)}static setTimeStamp(e){O(sr,ad,e)}static isSamePointerId(e){return l(sr,Nc)===e}static isSamePointerIdOrRemove(e){return l(sr,Nc)===e?!0:(l(sr,Oc)?.delete(e),!1)}static isSamePointerType(e){return l(sr,kc)===e}static isInitializedAndDifferentPointerType(e){return l(sr,kc)!==null&&!sr.isSamePointerType(e)}static isSameTimeStamp(e){return l(sr,ad)===e}static isUsingMultiplePointers(){return l(sr,Oc)?.size>=1}static clearPointerType(){O(sr,kc,null)}static clearPointerIds(){O(sr,Nc,NaN),O(sr,Oc,null)}static clearTimeStamp(){O(sr,ad,NaN)}};Nc=new WeakMap,Oc=new WeakMap,ad=new WeakMap,kc=new WeakMap,z(sr,Nc,NaN),z(sr,Oc,null),z(sr,ad,NaN),z(sr,kc,null);Wn=sr,Cx=class{constructor(){z(this,mE,0)}get id(){return`${Tm}${on(this,mE)._++}`}};mE=new WeakMap;QT=class QT{constructor(){z(this,ud);z(this,ld,XT());z(this,Vm,0);z(this,zn,null)}static get _isSVGFittingCanvas(){let e='data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>',n=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),i=new Image;i.src=e;let o=i.decode().then(()=>(n.drawImage(i,0,0,1,1,0,0,1,3),new Uint32Array(n.getImageData(0,0,1,1).data.buffer)[0]===0));return Et(this,"_isSVGFittingCanvas",o)}async getFromFile(e){let{lastModified:t,name:n,size:i,type:o}=e;return X(this,ud,Qw).call(this,`${t}_${n}_${i}_${o}`,e)}async getFromUrl(e){return X(this,ud,Qw).call(this,e,e)}async getFromBlob(e,t){let n=await t;return X(this,ud,Qw).call(this,e,n)}async getFromId(e){l(this,zn)||O(this,zn,new Map);let t=l(this,zn).get(e);if(!t)return null;if(t.bitmap)return t.refCounter+=1,t;if(t.file)return this.getFromFile(t.file);if(t.blobPromise){let{blobPromise:n}=t;return delete t.blobPromise,this.getFromBlob(t.id,n)}return this.getFromUrl(t.url)}getFromCanvas(e,t){l(this,zn)||O(this,zn,new Map);let n=l(this,zn).get(e);if(n?.bitmap)return n.refCounter+=1,n;let i=new OffscreenCanvas(t.width,t.height);return i.getContext("2d").drawImage(t,0,0),n={bitmap:i.transferToImageBitmap(),id:`image_${l(this,ld)}_${on(this,Vm)._++}`,refCounter:1,isSvg:!1},l(this,zn).set(e,n),l(this,zn).set(n.id,n),n}getSvgUrl(e){let t=l(this,zn).get(e);return t?.isSvg?t.svgUrl:null}deleteId(e){l(this,zn)||O(this,zn,new Map);let t=l(this,zn).get(e);if(!t||(t.refCounter-=1,t.refCounter!==0))return;let{bitmap:n}=t;if(!t.url&&!t.file){let i=new OffscreenCanvas(n.width,n.height);i.getContext("bitmaprenderer").transferFromImageBitmap(n),t.blobPromise=i.convertToBlob()}n.close?.(),t.bitmap=null}isValidId(e){return e.startsWith(`image_${l(this,ld)}_`)}};ld=new WeakMap,Vm=new WeakMap,zn=new WeakMap,ud=new WeakSet,Qw=async function(e,t){l(this,zn)||O(this,zn,new Map);let n=l(this,zn).get(e);if(n===null)return null;if(n?.bitmap)return n.refCounter+=1,n;try{n||(n={bitmap:null,id:`image_${l(this,ld)}_${on(this,Vm)._++}`,refCounter:0,isSvg:!1});let i;if(typeof t=="string"?(n.url=t,i=await $p(t,"blob")):t instanceof File?i=n.file=t:t instanceof Blob&&(i=t),i.type==="image/svg+xml"){let o=QT._isSVGFittingCanvas,s=new FileReader,a=new Image,u=new Promise((c,f)=>{a.onload=()=>{n.bitmap=a,n.isSvg=!0,c()},s.onload=async()=>{let h=n.svgUrl=s.result;a.src=await o?`${h}#svgView(preserveAspectRatio(none))`:h},a.onerror=s.onerror=f});s.readAsDataURL(i),await u}else n.bitmap=await createImageBitmap(i);n.refCounter=1}catch(i){Tt(i),n=null}return l(this,zn).set(e,n),n&&l(this,zn).set(n.id,n),n};Rx=QT,Dx=class{constructor(e=128){z(this,Yr,[]);z(this,Hl,!1);z(this,Ym);z(this,Rr,-1);O(this,Ym,e)}add({cmd:e,undo:t,post:n,mustExec:i,type:o=NaN,overwriteIfSameType:s=!1,keepUndo:a=!1}){if(i&&e(),l(this,Hl))return;let u={cmd:e,undo:t,post:n,type:o};if(l(this,Rr)===-1){l(this,Yr).length>0&&(l(this,Yr).length=0),O(this,Rr,0),l(this,Yr).push(u);return}if(s&&l(this,Yr)[l(this,Rr)].type===o){a&&(u.undo=l(this,Yr)[l(this,Rr)].undo),l(this,Yr)[l(this,Rr)]=u;return}let c=l(this,Rr)+1;c===l(this,Ym)?l(this,Yr).splice(0,1):(O(this,Rr,c),c<l(this,Yr).length&&l(this,Yr).splice(c)),l(this,Yr).push(u)}undo(){if(l(this,Rr)===-1)return;O(this,Hl,!0);let{undo:e,post:t}=l(this,Yr)[l(this,Rr)];e(),t?.(),O(this,Hl,!1),O(this,Rr,l(this,Rr)-1)}redo(){if(l(this,Rr)<l(this,Yr).length-1){O(this,Rr,l(this,Rr)+1),O(this,Hl,!0);let{cmd:e,post:t}=l(this,Yr)[l(this,Rr)];e(),t?.(),O(this,Hl,!1)}}hasSomethingToUndo(){return l(this,Rr)!==-1}hasSomethingToRedo(){return l(this,Rr)<l(this,Yr).length-1}cleanType(e){if(l(this,Rr)!==-1){for(let t=l(this,Rr);t>=0;t--)if(l(this,Yr)[t].type!==e){l(this,Yr).splice(t+1,l(this,Rr)-t),O(this,Rr,t);return}l(this,Yr).length=0,O(this,Rr,-1)}}destroy(){O(this,Yr,null)}};Yr=new WeakMap,Hl=new WeakMap,Ym=new WeakMap,Rr=new WeakMap;Hf=class{constructor(e){z(this,yE);this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;let{isMac:t}=$r.platform;for(let[n,i,o={}]of e)for(let s of n){let a=s.startsWith("mac+");t&&a?(this.callbacks.set(s.slice(4),{callback:i,options:o}),this.allKeys.add(s.split("+").at(-1))):!t&&!a&&(this.callbacks.set(s,{callback:i,options:o}),this.allKeys.add(s.split("+").at(-1)))}}exec(e,t){if(!this.allKeys.has(t.key))return;let n=this.callbacks.get(X(this,yE,RF).call(this,t));if(!n)return;let{callback:i,options:{bubbles:o=!1,args:s=[],checker:a=null}}=n;a&&!a(e,t)||(i.bind(e,...s,t)(),o||Ir(t))}};yE=new WeakSet,RF=function(e){e.altKey&&this.buffer.push("alt"),e.ctrlKey&&this.buffer.push("ctrl"),e.metaKey&&this.buffer.push("meta"),e.shiftKey&&this.buffer.push("shift"),this.buffer.push(e.key);let t=this.buffer.join("+");return this.buffer.length=0,t};bE=class bE{get _colors(){let e=new Map([["CanvasText",null],["Canvas",null]]);return HV(e),Et(this,"_colors",e)}convert(e){let t=Wp(e);if(!window.matchMedia("(forced-colors: active)").matches)return t;for(let[n,i]of this._colors)if(i.every((o,s)=>o===t[s]))return bE._colorsMapping.get(n);return t}getHexCode(e){let t=this._colors.get(e);return t?at.makeHexColor(...t):e}};ze(bE,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));Ix=bE,Jh=class Jh{constructor(e,t,n,i,o,s,a,u,c,f,h,d,m,y,v,w){z(this,st);z(this,cd,new AbortController);z(this,Mi,null);z(this,fd,null);z(this,Mr,new Map);z(this,Jr,new Map);z(this,hd,null);z(this,Es,null);z(this,dd,null);z(this,_s,new Dx);z(this,Hn,null);z(this,ql,null);z(this,Gl,null);z(this,Vl,0);z(this,Yl,new Set);z(this,Ro,null);z(this,As,null);z(this,Lc,new Set);ze(this,"_editorUndoBar",null);z(this,Xm,!1);z(this,Km,!1);z(this,pd,!1);z(this,Zm,null);z(this,Do,null);z(this,Xl,null);z(this,gd,null);z(this,Kl,!1);z(this,Io,null);z(this,wE,new Cx);z(this,Zl,!1);z(this,md,!1);z(this,Jm,!1);z(this,Jl,null);z(this,Pc,null);z(this,yd,null);z(this,Ql,null);z(this,Qm,null);z(this,Qr,At.NONE);z(this,Qt,new Set);z(this,Ia,null);z(this,eu,null);z(this,tu,null);z(this,e0,null);z(this,bd,null);z(this,t0,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1});z(this,ru,[0,0]);z(this,No,null);z(this,Na,null);z(this,r0,null);z(this,n0,null);z(this,xs,null);let b=this._signal=l(this,cd).signal;O(this,Na,e),O(this,r0,t),O(this,n0,n),O(this,hd,i),O(this,Hn,o),O(this,eu,s),O(this,bd,u),this._eventBus=a,a._on("editingaction",this.onEditingAction.bind(this),{signal:b}),a._on("pagechanging",this.onPageChanging.bind(this),{signal:b}),a._on("scalechanging",this.onScaleChanging.bind(this),{signal:b}),a._on("rotationchanging",this.onRotationChanging.bind(this),{signal:b}),a._on("setpreference",this.onSetPreference.bind(this),{signal:b}),a._on("switchannotationeditorparams",E=>this.updateParams(E.type,E.value),{signal:b}),window.addEventListener("pointerdown",()=>{O(this,md,!0)},{capture:!0,signal:b}),window.addEventListener("pointerup",()=>{O(this,md,!1)},{capture:!0,signal:b}),window.addEventListener("beforeunload",X(this,st,DF).bind(this),{capture:!0,signal:b}),X(this,st,OF).call(this),X(this,st,FF).call(this),X(this,st,Ox).call(this),O(this,Es,u.annotationStorage),O(this,Zm,u.filterFactory),O(this,tu,c),O(this,gd,f||null),O(this,Xm,h),O(this,Km,d),O(this,pd,m),O(this,Qm,y||null),this.viewParameters={realScale:dl.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=v||null,this._supportsPinchToZoom=w!==!1,o?.setSidebarUiManager(this)}static get _keyboardManager(){let e=Jh.prototype,t=s=>l(s,Na).contains(document.activeElement)&&document.activeElement.tagName!=="BUTTON"&&s.hasSomethingToControl(),n=(s,{target:a})=>{if(a instanceof HTMLInputElement){let{type:u}=a;return u!=="text"&&u!=="number"}return!0},i=this.TRANSLATE_SMALL,o=this.TRANSLATE_BIG;return Et(this,"_keyboardManager",new Hf([[["ctrl+a","mac+meta+a"],e.selectAll,{checker:n}],[["ctrl+z","mac+meta+z"],e.undo,{checker:n}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],e.redo,{checker:n}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],e.delete,{checker:n}],[["Enter","mac+Enter"],e.addNewEditorFromKeyboard,{checker:(s,{target:a})=>!(a instanceof HTMLButtonElement)&&l(s,Na).contains(a)&&!s.isEnterHandled}],[[" ","mac+ "],e.addNewEditorFromKeyboard,{checker:(s,{target:a})=>!(a instanceof HTMLButtonElement)&&l(s,Na).contains(document.activeElement)}],[["Escape","mac+Escape"],e.unselectAll],[["ArrowLeft","mac+ArrowLeft"],e.translateSelectedEditors,{args:[-i,0],checker:t}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e.translateSelectedEditors,{args:[-o,0],checker:t}],[["ArrowRight","mac+ArrowRight"],e.translateSelectedEditors,{args:[i,0],checker:t}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e.translateSelectedEditors,{args:[o,0],checker:t}],[["ArrowUp","mac+ArrowUp"],e.translateSelectedEditors,{args:[0,-i],checker:t}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e.translateSelectedEditors,{args:[0,-o],checker:t}],[["ArrowDown","mac+ArrowDown"],e.translateSelectedEditors,{args:[0,i],checker:t}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e.translateSelectedEditors,{args:[0,o],checker:t}]]))}destroy(){l(this,xs)?.resolve(),O(this,xs,null),l(this,cd)?.abort(),O(this,cd,null),this._signal=null;for(let e of l(this,Jr).values())e.destroy();l(this,Jr).clear(),l(this,Mr).clear(),l(this,Lc).clear(),l(this,Ql)?.clear(),O(this,Mi,null),l(this,Qt).clear(),l(this,_s).destroy(),l(this,hd)?.destroy(),l(this,Hn)?.destroy(),l(this,eu)?.destroy(),l(this,Io)?.hide(),O(this,Io,null),l(this,yd)?.destroy(),O(this,yd,null),O(this,fd,null),l(this,Do)&&(clearTimeout(l(this,Do)),O(this,Do,null)),l(this,No)&&(clearTimeout(l(this,No)),O(this,No,null)),this._editorUndoBar?.destroy(),O(this,bd,null)}combinedSignal(e){return AbortSignal.any([this._signal,e.signal])}get mlManager(){return l(this,Qm)}get useNewAltTextFlow(){return l(this,Km)}get useNewAltTextWhenAddingImage(){return l(this,pd)}get hcmFilter(){return Et(this,"hcmFilter",l(this,tu)?l(this,Zm).addHCMFilter(l(this,tu).foreground,l(this,tu).background):"none")}get direction(){return Et(this,"direction",getComputedStyle(l(this,Na)).direction)}get _highlightColors(){return Et(this,"_highlightColors",l(this,gd)?new Map(l(this,gd).split(",").map(e=>(e=e.split("=").map(t=>t.trim()),e[1]=e[1].toUpperCase(),e))):null)}get highlightColors(){let{_highlightColors:e}=this;if(!e)return Et(this,"highlightColors",null);let t=new Map,n=!!l(this,tu);for(let[i,o]of e){let s=i.endsWith("_HCM");if(n&&s){t.set(i.replace("_HCM",""),o);continue}!n&&!s&&t.set(i,o)}return Et(this,"highlightColors",t)}get highlightColorNames(){return Et(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,e=>e.reverse())):null)}getNonHCMColor(e){if(!this._highlightColors)return e;let t=this.highlightColorNames.get(e);return this._highlightColors.get(t)||e}getNonHCMColorName(e){return this.highlightColorNames.get(e)||e}setCurrentDrawingSession(e){e?(this.unselectAll(),this.disableUserSelect(!0)):this.disableUserSelect(!1),O(this,Gl,e)}setMainHighlightColorPicker(e){O(this,yd,e)}editAltText(e,t=!1){l(this,hd)?.editAltText(this,e,t)}hasCommentManager(){return!!l(this,Hn)}editComment(e,t,n,i){l(this,Hn)?.showDialog(this,e,t,n,i)}selectComment(e,t){l(this,Jr).get(e)?.getEditorByUID(t)?.toggleComment(!0,!0)}updateComment(e){l(this,Hn)?.updateComment(e.getData())}updatePopupColor(e){l(this,Hn)?.updatePopupColor(e)}removeComment(e){l(this,Hn)?.removeComments([e.uid])}deleteComment(e,t){let n=()=>{e.comment=t},i=()=>{this._editorUndoBar?.show(n,"comment"),this.toggleComment(null),e.comment=null};this.addCommands({cmd:i,undo:n,mustExec:!0})}toggleComment(e,t,n=void 0){l(this,Hn)?.toggleCommentPopup(e,t,n)}makeCommentColor(e,t){return e&&l(this,Hn)?.makeCommentColor(e,t)||null}getCommentDialogElement(){return l(this,Hn)?.dialogElement||null}async waitForEditorsRendered(e){if(l(this,Jr).has(e-1))return;let{resolve:t,promise:n}=Promise.withResolvers(),i=o=>{o.pageNumber===e&&(this._eventBus._off("editorsrendered",i),t())};this._eventBus.on("editorsrendered",i),await n}getSignature(e){l(this,eu)?.getSignature({uiManager:this,editor:e})}get signatureManager(){return l(this,eu)}switchToMode(e,t){this._eventBus.on("annotationeditormodechanged",t,{once:!0,signal:this._signal}),this._eventBus.dispatch("showannotationeditorui",{source:this,mode:e})}setPreference(e,t){this._eventBus.dispatch("setpreference",{source:this,name:e,value:t})}onSetPreference({name:e,value:t}){e==="enableNewAltTextWhenAddingImage"&&O(this,pd,t)}onPageChanging({pageNumber:e}){O(this,Vl,e-1)}deletePage(e){for(let t of this.getEditors(e))t.remove();l(this,Jr).delete(e),l(this,Vl)===e&&O(this,Vl,0)}focusMainContainer(){l(this,Na).focus()}findParent(e,t){for(let n of l(this,Jr).values()){let{x:i,y:o,width:s,height:a}=n.div.getBoundingClientRect();if(e>=i&&e<=i+s&&t>=o&&t<=o+a)return n}return null}disableUserSelect(e=!1){l(this,r0).classList.toggle("noUserSelect",e)}addShouldRescale(e){l(this,Lc).add(e)}removeShouldRescale(e){l(this,Lc).delete(e)}onScaleChanging({scale:e}){this.commitOrRemove(),this.viewParameters.realScale=e*dl.PDF_TO_CSS_UNITS;for(let t of l(this,Lc))t.onScaleChanging();l(this,Gl)?.onScaleChanging()}onRotationChanging({pagesRotation:e}){this.commitOrRemove(),this.viewParameters.rotation=e}highlightSelection(e="",t=!1){let n=document.getSelection();if(!n||n.isCollapsed)return;let{anchorNode:i,anchorOffset:o,focusNode:s,focusOffset:a}=n,u=n.toString(),f=X(this,st,ev).call(this,n).closest(".textLayer"),h=this.getSelectionBoxes(f);if(!h)return;n.empty();let d=X(this,st,Nx).call(this,f),m=l(this,Qr)===At.NONE,y=()=>{let v=d?.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:e,boxes:h,anchorNode:i,anchorOffset:o,focusNode:s,focusOffset:a,text:u});m&&this.showAllEditors("highlight",!0,!0),t&&v?.editComment()};if(m){this.switchToMode(At.HIGHLIGHT,y);return}y()}commentSelection(e=""){this.highlightSelection(e,!0)}getAndRemoveDataFromAnnotationStorage(e){if(!l(this,Es))return null;let t=`${Tm}${e}`,n=l(this,Es).getRawValue(t);return n&&l(this,Es).remove(t),n}addToAnnotationStorage(e){!e.isEmpty()&&l(this,Es)&&!l(this,Es).has(e.id)&&l(this,Es).setValue(e.id,e)}a11yAlert(e,t=null){let n=l(this,n0);n&&(n.setAttribute("data-l10n-id",e),t?n.setAttribute("data-l10n-args",JSON.stringify(t)):n.removeAttribute("data-l10n-args"))}blur(){if(this.isShiftKeyDown=!1,l(this,Kl)&&(O(this,Kl,!1),X(this,st,rm).call(this,"main_toolbar")),!this.hasSelection)return;let{activeElement:e}=document;for(let t of l(this,Qt))if(t.div.contains(e)){O(this,Pc,[t,e]),t._focusEventsAllowed=!1;break}}focus(){if(!l(this,Pc))return;let[e,t]=l(this,Pc);O(this,Pc,null),t.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0,signal:this._signal}),t.focus()}addEditListeners(){X(this,st,Ox).call(this),this.setEditingState(!0)}removeEditListeners(){X(this,st,PF).call(this),this.setEditingState(!1)}dragOver(e){for(let{type:t}of e.dataTransfer.items)for(let n of l(this,As))if(n.isHandlingMimeForPasting(t)){e.dataTransfer.dropEffect="copy",e.preventDefault();return}}drop(e){for(let t of e.dataTransfer.items)for(let n of l(this,As))if(n.isHandlingMimeForPasting(t.type)){n.paste(t,this.currentLayer),e.preventDefault();return}}copy(e){if(e.preventDefault(),l(this,Mi)?.commitOrRemove(),!this.hasSelection)return;let t=[];for(let n of l(this,Qt)){let i=n.serialize(!0);i&&t.push(i)}t.length!==0&&e.clipboardData.setData("application/pdfjs",JSON.stringify(t))}cut(e){this.copy(e),this.delete()}async paste(e){e.preventDefault();let{clipboardData:t}=e;for(let o of t.items)for(let s of l(this,As))if(s.isHandlingMimeForPasting(o.type)){s.paste(o,this.currentLayer);return}let n=t.getData("application/pdfjs");if(!n)return;try{n=JSON.parse(n)}catch(o){Tt(`paste: "${o.message}".`);return}if(!Array.isArray(n))return;this.unselectAll();let i=this.currentLayer;try{let o=[];for(let u of n){let c=await i.deserialize(u);if(!c)return;o.push(c)}let s=()=>{for(let u of o)X(this,st,kx).call(this,u);X(this,st,Lx).call(this,o)},a=()=>{for(let u of o)u.remove()};this.addCommands({cmd:s,undo:a,mustExec:!0})}catch(o){Tt(`paste: "${o.message}".`)}}keydown(e){!this.isShiftKeyDown&&e.key==="Shift"&&(this.isShiftKeyDown=!0),l(this,Qr)!==At.NONE&&!this.isEditorHandlingKeyboard&&Jh._keyboardManager.exec(this,e)}keyup(e){this.isShiftKeyDown&&e.key==="Shift"&&(this.isShiftKeyDown=!1,l(this,Kl)&&(O(this,Kl,!1),X(this,st,rm).call(this,"main_toolbar")))}onEditingAction({name:e}){switch(e){case"undo":case"redo":case"delete":case"selectAll":this[e]();break;case"highlightSelection":this.highlightSelection("context_menu");break;case"commentSelection":this.commentSelection("context_menu");break}}setEditingState(e){e?(X(this,st,kF).call(this),X(this,st,MF).call(this),X(this,st,Jn).call(this,{isEditing:l(this,Qr)!==At.NONE,isEmpty:X(this,st,nm).call(this),hasSomethingToUndo:l(this,_s).hasSomethingToUndo(),hasSomethingToRedo:l(this,_s).hasSomethingToRedo(),hasSelectedEditor:!1})):(X(this,st,LF).call(this),X(this,st,BF).call(this),X(this,st,Jn).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(e){if(!l(this,As)){O(this,As,e);for(let t of l(this,As))X(this,st,Sa).call(this,t.defaultPropertiesToUpdate)}}getId(){return l(this,wE).id}get currentLayer(){return l(this,Jr).get(l(this,Vl))}getLayer(e){return l(this,Jr).get(e)}get currentPageIndex(){return l(this,Vl)}addLayer(e){l(this,Jr).set(e.pageIndex,e),l(this,Zl)?e.enable():e.disable()}removeLayer(e){l(this,Jr).delete(e.pageIndex)}async updateMode(e,t=null,n=!1,i=!1,o=!1,s=!1){if(l(this,Qr)!==e&&!(l(this,xs)&&(await l(this,xs).promise,!l(this,xs)))){if(O(this,xs,Promise.withResolvers()),l(this,Gl)?.commitOrRemove(),l(this,Qr)===At.POPUP&&l(this,Hn)?.hideSidebar(),l(this,Hn)?.destroyPopup(),O(this,Qr,e),e===At.NONE){this.setEditingState(!1),X(this,st,jF).call(this);for(let a of l(this,Mr).values())a.hideStandaloneCommentButton();this._editorUndoBar?.hide(),this.toggleComment(null),l(this,xs).resolve();return}for(let a of l(this,Mr).values())a.addStandaloneCommentButton();e===At.SIGNATURE&&await l(this,eu)?.loadSignatures(),n&&Wn.clearPointerType(),this.setEditingState(!0),await X(this,st,UF).call(this),this.unselectAll();for(let a of l(this,Jr).values())a.updateMode(e);if(e===At.POPUP){l(this,fd)||O(this,fd,await l(this,bd).getAnnotationsByType(new Set(l(this,As).map(c=>c._editorType))));let a=new Set,u=[];for(let c of l(this,Mr).values()){let{annotationElementId:f,hasComment:h,deleted:d}=c;f&&a.add(f),h&&!d&&u.push(c.getData())}for(let c of l(this,fd)){let{id:f,popupRef:h,contentsObj:d}=c;h&&d?.str&&!a.has(f)&&!l(this,Yl).has(f)&&u.push(c)}l(this,Hn)?.showSidebar(u)}if(!t){i&&this.addNewEditorFromKeyboard(),l(this,xs).resolve();return}for(let a of l(this,Mr).values())a.uid===t?(this.setSelected(a),s?a.editComment():o?a.enterInEditMode():a.focus()):a.unselect();l(this,xs).resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(e){e.mode!==l(this,Qr)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,...e})}updateParams(e,t){if(l(this,As)){switch(e){case Ft.CREATE:this.currentLayer.addNewEditor(t);return;case Ft.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(l(this,e0)||O(this,e0,new Map)).set(e,t),this.showAllEditors("highlight",t);break}if(this.hasSelection)for(let n of l(this,Qt))n.updateParams(e,t);else for(let n of l(this,As))n.updateDefaultParams(e,t)}}showAllEditors(e,t,n=!1){for(let o of l(this,Mr).values())o.editorType===e&&o.show(t);(l(this,e0)?.get(Ft.HIGHLIGHT_SHOW_ALL)??!0)!==t&&X(this,st,Sa).call(this,[[Ft.HIGHLIGHT_SHOW_ALL,t]])}enableWaiting(e=!1){if(l(this,Jm)!==e){O(this,Jm,e);for(let t of l(this,Jr).values())e?t.disableClick():t.enableClick(),t.div.classList.toggle("waiting",e)}}*getEditors(e){for(let t of l(this,Mr).values())t.pageIndex===e&&(yield t)}getEditor(e){return l(this,Mr).get(e)}addEditor(e){l(this,Mr).set(e.id,e)}removeEditor(e){e.div.contains(document.activeElement)&&(l(this,Do)&&clearTimeout(l(this,Do)),O(this,Do,setTimeout(()=>{this.focusMainContainer(),O(this,Do,null)},0))),l(this,Mr).delete(e.id),e.annotationElementId&&l(this,Ql)?.delete(e.annotationElementId),this.unselect(e),(!e.annotationElementId||!l(this,Yl).has(e.annotationElementId))&&l(this,Es)?.remove(e.id)}addDeletedAnnotationElement(e){l(this,Yl).add(e.annotationElementId),this.addChangedExistingAnnotation(e),e.deleted=!0}isDeletedAnnotationElement(e){return l(this,Yl).has(e)}removeDeletedAnnotationElement(e){l(this,Yl).delete(e.annotationElementId),this.removeChangedExistingAnnotation(e),e.deleted=!1}setActiveEditor(e){l(this,Mi)!==e&&(O(this,Mi,e),e&&X(this,st,Sa).call(this,e.propertiesToUpdate))}updateUI(e){l(this,st,$F)===e&&X(this,st,Sa).call(this,e.propertiesToUpdate)}updateUIForDefaultProperties(e){X(this,st,Sa).call(this,e.defaultPropertiesToUpdate)}toggleSelected(e){if(l(this,Qt).has(e)){l(this,Qt).delete(e),e.unselect(),X(this,st,Jn).call(this,{hasSelectedEditor:this.hasSelection});return}l(this,Qt).add(e),e.select(),X(this,st,Sa).call(this,e.propertiesToUpdate),X(this,st,Jn).call(this,{hasSelectedEditor:!0})}setSelected(e){this.updateToolbar({mode:e.mode,editId:e.uid}),l(this,Gl)?.commitOrRemove();for(let t of l(this,Qt))t!==e&&t.unselect();l(this,Qt).clear(),l(this,Qt).add(e),e.select(),X(this,st,Sa).call(this,e.propertiesToUpdate),X(this,st,Jn).call(this,{hasSelectedEditor:!0})}isSelected(e){return l(this,Qt).has(e)}get firstSelectedEditor(){return l(this,Qt).values().next().value}unselect(e){e.unselect(),l(this,Qt).delete(e),X(this,st,Jn).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return l(this,Qt).size!==0}get isEnterHandled(){return l(this,Qt).size===1&&this.firstSelectedEditor.isEnterHandled}undo(){l(this,_s).undo(),X(this,st,Jn).call(this,{hasSomethingToUndo:l(this,_s).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:X(this,st,nm).call(this)}),this._editorUndoBar?.hide()}redo(){l(this,_s).redo(),X(this,st,Jn).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:l(this,_s).hasSomethingToRedo(),isEmpty:X(this,st,nm).call(this)})}addCommands(e){l(this,_s).add(e),X(this,st,Jn).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:X(this,st,nm).call(this)})}cleanUndoStack(e){l(this,_s).cleanType(e)}delete(){this.commitOrRemove();let e=this.currentLayer?.endDrawingSession(!0);if(!this.hasSelection&&!e)return;let t=e?[e]:[...l(this,Qt)],n=()=>{this._editorUndoBar?.show(i,t.length===1?t[0].editorType:t.length);for(let o of t)o.remove()},i=()=>{for(let o of t)X(this,st,kx).call(this,o)};this.addCommands({cmd:n,undo:i,mustExec:!0})}commitOrRemove(){l(this,Mi)?.commitOrRemove()}hasSomethingToControl(){return l(this,Mi)||this.hasSelection}selectAll(){for(let e of l(this,Qt))e.commit();X(this,st,Lx).call(this,l(this,Mr).values())}unselectAll(){if(!(l(this,Mi)&&(l(this,Mi).commitOrRemove(),l(this,Qr)!==At.NONE))&&!l(this,Gl)?.commitOrRemove()&&this.hasSelection){for(let e of l(this,Qt))e.unselect();l(this,Qt).clear(),X(this,st,Jn).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(e,t,n=!1){if(n||this.commitOrRemove(),!this.hasSelection)return;l(this,ru)[0]+=e,l(this,ru)[1]+=t;let[i,o]=l(this,ru),s=[...l(this,Qt)],a=1e3;l(this,No)&&clearTimeout(l(this,No)),O(this,No,setTimeout(()=>{O(this,No,null),l(this,ru)[0]=l(this,ru)[1]=0,this.addCommands({cmd:()=>{for(let u of s)l(this,Mr).has(u.id)&&(u.translateInPage(i,o),u.translationDone())},undo:()=>{for(let u of s)l(this,Mr).has(u.id)&&(u.translateInPage(-i,-o),u.translationDone())},mustExec:!1})},a));for(let u of s)u.translateInPage(e,t),u.translationDone()}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),O(this,Ro,new Map);for(let e of l(this,Qt))l(this,Ro).set(e,{savedX:e.x,savedY:e.y,savedPageIndex:e.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!l(this,Ro))return!1;this.disableUserSelect(!1);let e=l(this,Ro);O(this,Ro,null);let t=!1;for(let[{x:i,y:o,pageIndex:s},a]of e)a.newX=i,a.newY=o,a.newPageIndex=s,t||(t=i!==a.savedX||o!==a.savedY||s!==a.savedPageIndex);if(!t)return!1;let n=(i,o,s,a)=>{if(l(this,Mr).has(i.id)){let u=l(this,Jr).get(a);u?i._setParentAndPosition(u,o,s):(i.pageIndex=a,i.x=o,i.y=s)}};return this.addCommands({cmd:()=>{for(let[i,{newX:o,newY:s,newPageIndex:a}]of e)n(i,o,s,a)},undo:()=>{for(let[i,{savedX:o,savedY:s,savedPageIndex:a}]of e)n(i,o,s,a)},mustExec:!0}),!0}dragSelectedEditors(e,t){if(l(this,Ro))for(let n of l(this,Ro).keys())n.drag(e,t)}rebuild(e){if(e.parent===null){let t=this.getLayer(e.pageIndex);t?(t.changeParent(e),t.addOrRebuild(e)):(this.addEditor(e),this.addToAnnotationStorage(e),e.rebuild())}else e.parent.addOrRebuild(e)}get isEditorHandlingKeyboard(){return this.getActive()?.shouldGetKeyboardEvents()||l(this,Qt).size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(e){return l(this,Mi)===e}getActive(){return l(this,Mi)}getMode(){return l(this,Qr)}isEditingMode(){return l(this,Qr)!==At.NONE}get imageManager(){return Et(this,"imageManager",new Rx)}getSelectionBoxes(e){if(!e)return null;let t=document.getSelection();for(let c=0,f=t.rangeCount;c<f;c++)if(!e.contains(t.getRangeAt(c).commonAncestorContainer))return null;let{x:n,y:i,width:o,height:s}=e.getBoundingClientRect(),a;switch(e.getAttribute("data-main-rotation")){case"90":a=(c,f,h,d)=>({x:(f-i)/s,y:1-(c+h-n)/o,width:d/s,height:h/o});break;case"180":a=(c,f,h,d)=>({x:1-(c+h-n)/o,y:1-(f+d-i)/s,width:h/o,height:d/s});break;case"270":a=(c,f,h,d)=>({x:1-(f+d-i)/s,y:(c-n)/o,width:d/s,height:h/o});break;default:a=(c,f,h,d)=>({x:(c-n)/o,y:(f-i)/s,width:h/o,height:d/s});break}let u=[];for(let c=0,f=t.rangeCount;c<f;c++){let h=t.getRangeAt(c);if(!h.collapsed)for(let{x:d,y:m,width:y,height:v}of h.getClientRects())y===0||v===0||u.push(a(d,m,y,v))}return u.length===0?null:u}addChangedExistingAnnotation({annotationElementId:e,id:t}){(l(this,dd)||O(this,dd,new Map)).set(e,t)}removeChangedExistingAnnotation({annotationElementId:e}){l(this,dd)?.delete(e)}renderAnnotationElement(e){let t=l(this,dd)?.get(e.data.id);if(!t)return;let n=l(this,Es).getRawValue(t);n&&(l(this,Qr)===At.NONE&&!n.hasBeenModified||n.renderAnnotationElement(e))}setMissingCanvas(e,t,n){let i=l(this,Ql)?.get(e);i&&(i.setCanvas(t,n),l(this,Ql).delete(e))}addMissingCanvas(e,t){(l(this,Ql)||O(this,Ql,new Map)).set(e,t)}};cd=new WeakMap,Mi=new WeakMap,fd=new WeakMap,Mr=new WeakMap,Jr=new WeakMap,hd=new WeakMap,Es=new WeakMap,dd=new WeakMap,_s=new WeakMap,Hn=new WeakMap,ql=new WeakMap,Gl=new WeakMap,Vl=new WeakMap,Yl=new WeakMap,Ro=new WeakMap,As=new WeakMap,Lc=new WeakMap,Xm=new WeakMap,Km=new WeakMap,pd=new WeakMap,Zm=new WeakMap,Do=new WeakMap,Xl=new WeakMap,gd=new WeakMap,Kl=new WeakMap,Io=new WeakMap,wE=new WeakMap,Zl=new WeakMap,md=new WeakMap,Jm=new WeakMap,Jl=new WeakMap,Pc=new WeakMap,yd=new WeakMap,Ql=new WeakMap,Qm=new WeakMap,Qr=new WeakMap,Qt=new WeakMap,Ia=new WeakMap,eu=new WeakMap,tu=new WeakMap,e0=new WeakMap,bd=new WeakMap,t0=new WeakMap,ru=new WeakMap,No=new WeakMap,Na=new WeakMap,r0=new WeakMap,n0=new WeakMap,xs=new WeakMap,st=new WeakSet,ev=function({anchorNode:e}){return e.nodeType===Node.TEXT_NODE?e.parentElement:e},Nx=function(e){let{currentLayer:t}=this;if(t.hasTextLayer(e))return t;for(let n of l(this,Jr).values())if(n.hasTextLayer(e))return n;return null},DF=function(e){this.commitOrRemove(),this.currentLayer?.endDrawingSession(!1)},IF=function(){let e=document.getSelection();if(!e||e.isCollapsed)return;let n=X(this,st,ev).call(this,e).closest(".textLayer"),i=this.getSelectionBoxes(n);i&&(l(this,Io)||O(this,Io,new Sx(this)),l(this,Io).show(n,i,this.direction==="ltr"))},NF=function(){let e=document.getSelection();if(!e||e.isCollapsed){l(this,Ia)&&(l(this,Io)?.hide(),O(this,Ia,null),X(this,st,Jn).call(this,{hasSelectedText:!1}));return}let{anchorNode:t}=e;if(t===l(this,Ia))return;let i=X(this,st,ev).call(this,e).closest(".textLayer");if(!i){l(this,Ia)&&(l(this,Io)?.hide(),O(this,Ia,null),X(this,st,Jn).call(this,{hasSelectedText:!1}));return}if(l(this,Io)?.hide(),O(this,Ia,t),X(this,st,Jn).call(this,{hasSelectedText:!0}),!(l(this,Qr)!==At.HIGHLIGHT&&l(this,Qr)!==At.NONE)&&(l(this,Qr)===At.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),O(this,Kl,this.isShiftKeyDown),!this.isShiftKeyDown)){let o=l(this,Qr)===At.HIGHLIGHT?X(this,st,Nx).call(this,i):null;if(o?.toggleDrawing(),l(this,md)){let s=new AbortController,a=this.combinedSignal(s),u=c=>{c.type==="pointerup"&&c.button!==0||(s.abort(),o?.toggleDrawing(!0),c.type==="pointerup"&&X(this,st,rm).call(this,"main_toolbar"))};window.addEventListener("pointerup",u,{signal:a}),window.addEventListener("blur",u,{signal:a})}else o?.toggleDrawing(!0),X(this,st,rm).call(this,"main_toolbar")}},rm=function(e=""){l(this,Qr)===At.HIGHLIGHT?this.highlightSelection(e):l(this,Xm)&&X(this,st,IF).call(this)},OF=function(){document.addEventListener("selectionchange",X(this,st,NF).bind(this),{signal:this._signal})},kF=function(){if(l(this,Xl))return;O(this,Xl,new AbortController);let e=this.combinedSignal(l(this,Xl));window.addEventListener("focus",this.focus.bind(this),{signal:e}),window.addEventListener("blur",this.blur.bind(this),{signal:e})},LF=function(){l(this,Xl)?.abort(),O(this,Xl,null)},Ox=function(){if(l(this,Jl))return;O(this,Jl,new AbortController);let e=this.combinedSignal(l(this,Jl));window.addEventListener("keydown",this.keydown.bind(this),{signal:e}),window.addEventListener("keyup",this.keyup.bind(this),{signal:e})},PF=function(){l(this,Jl)?.abort(),O(this,Jl,null)},MF=function(){if(l(this,ql))return;O(this,ql,new AbortController);let e=this.combinedSignal(l(this,ql));document.addEventListener("copy",this.copy.bind(this),{signal:e}),document.addEventListener("cut",this.cut.bind(this),{signal:e}),document.addEventListener("paste",this.paste.bind(this),{signal:e})},BF=function(){l(this,ql)?.abort(),O(this,ql,null)},FF=function(){let e=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:e}),document.addEventListener("drop",this.drop.bind(this),{signal:e})},Jn=function(e){Object.entries(e).some(([n,i])=>l(this,t0)[n]!==i)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(l(this,t0),e)}),l(this,Qr)===At.HIGHLIGHT&&e.hasSelectedEditor===!1&&X(this,st,Sa).call(this,[[Ft.HIGHLIGHT_FREE,!0]]))},Sa=function(e){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:e})},UF=async function(){if(!l(this,Zl)){O(this,Zl,!0);let e=[];for(let t of l(this,Jr).values())e.push(t.enable());await Promise.all(e);for(let t of l(this,Mr).values())t.enable()}},jF=function(){if(this.unselectAll(),l(this,Zl)){O(this,Zl,!1);for(let e of l(this,Jr).values())e.disable();for(let e of l(this,Mr).values())e.disable()}},kx=function(e){let t=l(this,Jr).get(e.pageIndex);t?t.addOrRebuild(e):(this.addEditor(e),this.addToAnnotationStorage(e))},$F=function(){let e=null;for(e of l(this,Qt));return e},nm=function(){if(l(this,Mr).size===0)return!0;if(l(this,Mr).size===1)for(let e of l(this,Mr).values())return e.isEmpty();return!1},Lx=function(e){for(let t of l(this,Qt))t.unselect();l(this,Qt).clear();for(let t of e)t.isEmpty()||(l(this,Qt).add(t),t.select());X(this,st,Jn).call(this,{hasSelectedEditor:this.hasSelection})},ze(Jh,"TRANSLATE_SMALL",1),ze(Jh,"TRANSLATE_BIG",10);Pu=Jh,Qn=class Qn{constructor(e){z(this,io);z(this,wn,null);z(this,Oo,!1);z(this,Gs,null);z(this,wd,null);z(this,ko,null);z(this,Bi,null);z(this,vd,!1);z(this,Lo,null);z(this,wi,null);z(this,Oa,null);z(this,Mc,null);z(this,Po,!1);O(this,wi,e),O(this,Po,e._uiManager.useNewAltTextFlow),l(Qn,nu)||O(Qn,nu,Object.freeze({added:"pdfjs-editor-new-alt-text-added-button","added-label":"pdfjs-editor-new-alt-text-added-button-label",missing:"pdfjs-editor-new-alt-text-missing-button","missing-label":"pdfjs-editor-new-alt-text-missing-button-label",review:"pdfjs-editor-new-alt-text-to-review-button","review-label":"pdfjs-editor-new-alt-text-to-review-button-label"}))}static initialize(e){Qn._l10n??(Qn._l10n=e)}async render(){let e=O(this,Gs,document.createElement("button"));e.className="altText",e.tabIndex="0";let t=O(this,wd,document.createElement("span"));e.append(t),l(this,Po)?(e.classList.add("new"),e.setAttribute("data-l10n-id",l(Qn,nu).missing),t.setAttribute("data-l10n-id",l(Qn,nu)["missing-label"])):(e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button"),t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button-label"));let n=l(this,wi)._uiManager._signal;e.addEventListener("contextmenu",ss,{signal:n}),e.addEventListener("pointerdown",o=>o.stopPropagation(),{signal:n});let i=o=>{o.preventDefault(),l(this,wi)._uiManager.editAltText(l(this,wi)),l(this,Po)&&l(this,wi)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:l(this,io,im)}})};return e.addEventListener("click",i,{capture:!0,signal:n}),e.addEventListener("keydown",o=>{o.target===e&&o.key==="Enter"&&(O(this,vd,!0),i(o))},{signal:n}),await X(this,io,tv).call(this),e}finish(){l(this,Gs)&&(l(this,Gs).focus({focusVisible:l(this,vd)}),O(this,vd,!1))}isEmpty(){return l(this,Po)?l(this,wn)===null:!l(this,wn)&&!l(this,Oo)}hasData(){return l(this,Po)?l(this,wn)!==null||!!l(this,Oa):this.isEmpty()}get guessedText(){return l(this,Oa)}async setGuessedText(e){l(this,wn)===null&&(O(this,Oa,e),O(this,Mc,await Qn._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:e})),X(this,io,tv).call(this))}toggleAltTextBadge(e=!1){if(!l(this,Po)||l(this,wn)){l(this,Lo)?.remove(),O(this,Lo,null);return}if(!l(this,Lo)){let t=O(this,Lo,document.createElement("div"));t.className="noAltTextBadge",l(this,wi).div.append(t)}l(this,Lo).classList.toggle("hidden",!e)}serialize(e){let t=l(this,wn);return!e&&l(this,Oa)===t&&(t=l(this,Mc)),{altText:t,decorative:l(this,Oo),guessedText:l(this,Oa),textWithDisclaimer:l(this,Mc)}}get data(){return{altText:l(this,wn),decorative:l(this,Oo)}}set data({altText:e,decorative:t,guessedText:n,textWithDisclaimer:i,cancel:o=!1}){n&&(O(this,Oa,n),O(this,Mc,i)),!(l(this,wn)===e&&l(this,Oo)===t)&&(o||(O(this,wn,e),O(this,Oo,t)),X(this,io,tv).call(this))}toggle(e=!1){l(this,Gs)&&(!e&&l(this,Bi)&&(clearTimeout(l(this,Bi)),O(this,Bi,null)),l(this,Gs).disabled=!e)}shown(){l(this,wi)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:l(this,io,im)}})}destroy(){l(this,Gs)?.remove(),O(this,Gs,null),O(this,wd,null),O(this,ko,null),l(this,Lo)?.remove(),O(this,Lo,null)}};wn=new WeakMap,Oo=new WeakMap,Gs=new WeakMap,wd=new WeakMap,ko=new WeakMap,Bi=new WeakMap,vd=new WeakMap,Lo=new WeakMap,wi=new WeakMap,Oa=new WeakMap,Mc=new WeakMap,Po=new WeakMap,nu=new WeakMap,io=new WeakSet,im=function(){return l(this,wn)&&"added"||l(this,wn)===null&&this.guessedText&&"review"||"missing"},tv=async function(){let e=l(this,Gs);if(!e)return;if(l(this,Po)){if(e.classList.toggle("done",!!l(this,wn)),e.setAttribute("data-l10n-id",l(Qn,nu)[l(this,io,im)]),l(this,wd)?.setAttribute("data-l10n-id",l(Qn,nu)[`${l(this,io,im)}-label`]),!l(this,wn)){l(this,ko)?.remove();return}}else{if(!l(this,wn)&&!l(this,Oo)){e.classList.remove("done"),l(this,ko)?.remove();return}e.classList.add("done"),e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let t=l(this,ko);if(!t){O(this,ko,t=document.createElement("span")),t.className="tooltip",t.setAttribute("role","tooltip"),t.id=`alt-text-tooltip-${l(this,wi).id}`;let i=100,o=l(this,wi)._uiManager._signal;o.addEventListener("abort",()=>{clearTimeout(l(this,Bi)),O(this,Bi,null)},{once:!0}),e.addEventListener("mouseenter",()=>{O(this,Bi,setTimeout(()=>{O(this,Bi,null),l(this,ko).classList.add("show"),l(this,wi)._reportTelemetry({action:"alt_text_tooltip"})},i))},{signal:o}),e.addEventListener("mouseleave",()=>{l(this,Bi)&&(clearTimeout(l(this,Bi)),O(this,Bi,null)),l(this,ko)?.classList.remove("show")},{signal:o})}l(this,Oo)?t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(t.removeAttribute("data-l10n-id"),t.textContent=l(this,wn)),t.parentNode||e.append(t),l(this,wi).getElementForAltText()?.setAttribute("aria-describedby",t.id)},z(Qn,nu,null),ze(Qn,"_l10n",null);Bv=Qn,Kh=class{constructor(e){z(this,s0);z(this,Dn,null);z(this,Ss,null);z(this,Bc,!1);z(this,yr,null);z(this,i0,null);z(this,iu,null);z(this,Ts,null);z(this,su,null);z(this,ou,!1);z(this,Fc,null);O(this,yr,e)}renderForToolbar(){let e=O(this,Ss,document.createElement("button"));return e.className="comment",X(this,s0,Px).call(this,e,!1)}renderForStandalone(){let e=O(this,Dn,document.createElement("button"));e.className="annotationCommentButton";let t=l(this,yr).commentButtonPosition;if(t){let{style:n}=e;n.insetInlineEnd=`calc(${100*(l(this,yr)._uiManager.direction==="ltr"?1-t[0]:t[0])}% - var(--comment-button-dim))`,n.top=`calc(${100*t[1]}% - var(--comment-button-dim))`;let i=l(this,yr).commentButtonColor;i&&(n.backgroundColor=i)}return X(this,s0,Px).call(this,e,!0)}focusButton(){setTimeout(()=>{(l(this,Dn)??l(this,Ss))?.focus()},0)}onUpdatedColor(){if(!l(this,Dn))return;let e=l(this,yr).commentButtonColor;e&&(l(this,Dn).style.backgroundColor=e),l(this,yr)._uiManager.updatePopupColor(l(this,yr))}get commentButtonWidth(){return(l(this,Dn)?.getBoundingClientRect().width??0)/l(this,yr).parent.boundingClientRect.width}get commentPopupPositionInLayer(){if(l(this,Fc))return l(this,Fc);if(!l(this,Dn))return null;let{x:e,y:t,height:n}=l(this,Dn).getBoundingClientRect(),{x:i,y:o,width:s,height:a}=l(this,yr).parent.boundingClientRect;return[(e-i)/s,(t+n-o)/a]}set commentPopupPositionInLayer(e){O(this,Fc,e)}hasDefaultPopupPosition(){return l(this,Fc)===null}removeStandaloneCommentButton(){l(this,Dn)?.remove(),O(this,Dn,null)}removeToolbarCommentButton(){l(this,Ss)?.remove(),O(this,Ss,null)}setCommentButtonStates({selected:e,hasPopup:t}){l(this,Dn)&&(l(this,Dn).classList.toggle("selected",e),l(this,Dn).ariaExpanded=t)}edit(e){let t=this.commentPopupPositionInLayer,n,i;if(t)[n,i]=t;else{[n,i]=l(this,yr).commentButtonPosition;let{width:f,height:h,x:d,y:m}=l(this,yr);n=d+n*f,i=m+i*h}let o=l(this,yr).parent.boundingClientRect,{x:s,y:a,width:u,height:c}=o;l(this,yr)._uiManager.editComment(l(this,yr),s+n*u,a+i*c,{...e,parentDimensions:o})}finish(){l(this,Ss)&&(l(this,Ss).focus({focusVisible:l(this,Bc)}),O(this,Bc,!1))}isDeleted(){return l(this,ou)||l(this,Ts)===""}isEmpty(){return l(this,Ts)===null}hasBeenEdited(){return this.isDeleted()||l(this,Ts)!==l(this,i0)}serialize(){return this.data}get data(){return{text:l(this,Ts),richText:l(this,iu),date:l(this,su),deleted:this.isDeleted()}}set data(e){if(e!==l(this,Ts)&&O(this,iu,null),e===null){O(this,Ts,""),O(this,ou,!0);return}O(this,Ts,e),O(this,su,new Date),O(this,ou,!1)}restoreData({text:e,richText:t,date:n}){O(this,Ts,e),O(this,iu,t),O(this,su,n),O(this,ou,!1)}setInitialText(e,t=null){O(this,i0,e),this.data=e,O(this,su,null),O(this,iu,t)}shown(){}destroy(){l(this,Ss)?.remove(),O(this,Ss,null),l(this,Dn)?.remove(),O(this,Dn,null),O(this,Ts,""),O(this,iu,null),O(this,su,null),O(this,yr,null),O(this,Bc,!1),O(this,ou,!1)}};Dn=new WeakMap,Ss=new WeakMap,Bc=new WeakMap,yr=new WeakMap,i0=new WeakMap,iu=new WeakMap,Ts=new WeakMap,su=new WeakMap,ou=new WeakMap,Fc=new WeakMap,s0=new WeakSet,Px=function(e,t){if(!l(this,yr)._uiManager.hasCommentManager())return null;e.tabIndex="0",e.ariaHasPopup="dialog",t?(e.ariaControls="commentPopup",e.setAttribute("data-l10n-id","pdfjs-show-comment-button")):(e.ariaControlsElements=[l(this,yr)._uiManager.getCommentDialogElement()],e.setAttribute("data-l10n-id","pdfjs-editor-add-comment-button"));let n=l(this,yr)._uiManager._signal;if(!(n instanceof AbortSignal)||n.aborted)return e;e.addEventListener("contextmenu",ss,{signal:n}),t&&(e.addEventListener("focusin",o=>{l(this,yr)._focusEventsAllowed=!1,Ir(o)},{capture:!0,signal:n}),e.addEventListener("focusout",o=>{l(this,yr)._focusEventsAllowed=!0,Ir(o)},{capture:!0,signal:n})),e.addEventListener("pointerdown",o=>o.stopPropagation(),{signal:n});let i=o=>{o.preventDefault(),e===l(this,Ss)?this.edit():l(this,yr).toggleComment(!0)};return e.addEventListener("click",i,{capture:!0,signal:n}),e.addEventListener("keydown",o=>{o.target===e&&o.key==="Enter"&&(O(this,Bc,!0),i(o))},{signal:n}),e.addEventListener("pointerenter",()=>{l(this,yr).toggleComment(!1,!0)},{signal:n}),e.addEventListener("pointerleave",()=>{l(this,yr).toggleComment(!1,!1)},{signal:n}),e};eC=class eC{constructor({container:e,isPinchingDisabled:t=null,isPinchingStopped:n=null,onPinchStart:i=null,onPinching:o=null,onPinchEnd:s=null,signal:a}){z(this,Mu);z(this,Ed);z(this,Uc,!1);z(this,o0,null);z(this,a0);z(this,l0);z(this,u0);z(this,c0);z(this,ka,null);z(this,jc);z(this,La,null);z(this,$c);z(this,Pa,null);O(this,Ed,e),O(this,o0,n),O(this,a0,t),O(this,l0,i),O(this,u0,o),O(this,c0,s),O(this,$c,new AbortController),O(this,jc,AbortSignal.any([a,l(this,$c).signal])),e.addEventListener("touchstart",X(this,Mu,WF).bind(this),{passive:!1,signal:l(this,jc)})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/Zo.pixelRatio}destroy(){l(this,$c)?.abort(),O(this,$c,null),l(this,ka)?.abort(),O(this,ka,null)}};Ed=new WeakMap,Uc=new WeakMap,o0=new WeakMap,a0=new WeakMap,l0=new WeakMap,u0=new WeakMap,c0=new WeakMap,ka=new WeakMap,jc=new WeakMap,La=new WeakMap,$c=new WeakMap,Pa=new WeakMap,Mu=new WeakSet,WF=function(e){var i,o,s;if((i=l(this,a0))!=null&&i.call(this))return;if(e.touches.length===1){if(l(this,ka))return;let a=O(this,ka,new AbortController),u=AbortSignal.any([l(this,jc),a.signal]),c=l(this,Ed),f={capture:!0,signal:u,passive:!1},h=d=>{d.pointerType==="touch"&&(l(this,ka)?.abort(),O(this,ka,null))};c.addEventListener("pointerdown",d=>{d.pointerType==="touch"&&(Ir(d),h(d))},f),c.addEventListener("pointerup",h,f),c.addEventListener("pointercancel",h,f);return}if(!l(this,Pa)){O(this,Pa,new AbortController);let a=AbortSignal.any([l(this,jc),l(this,Pa).signal]),u=l(this,Ed),c={signal:a,capture:!1,passive:!1};u.addEventListener("touchmove",X(this,Mu,zF).bind(this),c);let f=X(this,Mu,HF).bind(this);u.addEventListener("touchend",f,c),u.addEventListener("touchcancel",f,c),c.capture=!0,u.addEventListener("pointerdown",Ir,c),u.addEventListener("pointermove",Ir,c),u.addEventListener("pointercancel",Ir,c),u.addEventListener("pointerup",Ir,c),(o=l(this,l0))==null||o.call(this)}if(Ir(e),e.touches.length!==2||(s=l(this,o0))!=null&&s.call(this)){O(this,La,null);return}let[t,n]=e.touches;t.identifier>n.identifier&&([t,n]=[n,t]),O(this,La,{touch0X:t.screenX,touch0Y:t.screenY,touch1X:n.screenX,touch1Y:n.screenY})},zF=function(e){var S;if(!l(this,La)||e.touches.length!==2)return;Ir(e);let[t,n]=e.touches;t.identifier>n.identifier&&([t,n]=[n,t]);let{screenX:i,screenY:o}=t,{screenX:s,screenY:a}=n,u=l(this,La),{touch0X:c,touch0Y:f,touch1X:h,touch1Y:d}=u,m=h-c,y=d-f,v=s-i,w=a-o,b=Math.hypot(v,w)||1,E=Math.hypot(m,y)||1;if(!l(this,Uc)&&Math.abs(E-b)<=eC.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(u.touch0X=i,u.touch0Y=o,u.touch1X=s,u.touch1Y=a,!l(this,Uc)){O(this,Uc,!0);return}let _=[(i+s)/2,(o+a)/2];(S=l(this,u0))==null||S.call(this,_,E,b)},HF=function(e){var t;e.touches.length>=2||(l(this,Pa)&&(l(this,Pa).abort(),O(this,Pa,null),(t=l(this,c0))==null||t.call(this)),l(this,La)&&(Ir(e),O(this,La,null),O(this,Uc,!1)))};Im=eC,St=class St{constructor(e){z(this,bt);z(this,Wc,null);z(this,Vs,null);z(this,Sr,null);z(this,er,null);z(this,Ma,null);z(this,_d,!1);z(this,au,null);z(this,f0,"");z(this,In,null);z(this,zc,null);z(this,Ba,null);z(this,Cs,null);z(this,lu,null);z(this,h0,"");z(this,Hc,!1);z(this,Fi,null);z(this,d0,!1);z(this,qc,!1);z(this,Fa,!1);z(this,Mo,null);z(this,Ad,0);z(this,xd,0);z(this,Rs,null);z(this,Gc,null);ze(this,"isSelected",!1);ze(this,"_isCopy",!1);ze(this,"_editToolbar",null);ze(this,"_initialOptions",Object.create(null));ze(this,"_initialData",null);ze(this,"_isVisible",!0);ze(this,"_uiManager",null);ze(this,"_focusEventsAllowed",!0);z(this,p0,!1);z(this,vE,St._zIndex++);this.parent=e.parent,this.id=e.id,this.width=this.height=null,this.pageIndex=e.parent.pageIndex,this.name=e.name,this.div=null,this._uiManager=e.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=e.isCentered,this._structTreeParentId=null,this.annotationElementId=e.annotationElementId||null,this.creationDate=e.creationDate||new Date,this.modificationDate=e.modificationDate||null,this.canAddComment=!0;let{rotation:t,rawDims:{pageWidth:n,pageHeight:i,pageX:o,pageY:s}}=this.parent.viewport;this.rotation=t,this.pageRotation=(360+t-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[n,i],this.pageTranslation=[o,s];let[a,u]=this.parentDimensions;this.x=e.x/a,this.y=e.y/u,this.isAttachedToDOM=!1,this.deleted=!1}static get _resizerKeyboardManager(){let e=St.prototype._resizeWithKeyboard,t=Pu.TRANSLATE_SMALL,n=Pu.TRANSLATE_BIG;return Et(this,"_resizerKeyboardManager",new Hf([[["ArrowLeft","mac+ArrowLeft"],e,{args:[-t,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e,{args:[-n,0]}],[["ArrowRight","mac+ArrowRight"],e,{args:[t,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e,{args:[n,0]}],[["ArrowUp","mac+ArrowUp"],e,{args:[0,-t]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e,{args:[0,-n]}],[["ArrowDown","mac+ArrowDown"],e,{args:[0,t]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e,{args:[0,n]}],[["Escape","mac+Escape"],St.prototype._stopResizingWithKeyboard]]))}updatePageIndex(e){this.pageIndex=e}get editorType(){return Object.getPrototypeOf(this).constructor._type}get mode(){return Object.getPrototypeOf(this).constructor._editorType}static get isDrawer(){return!1}static get _defaultLineColor(){return Et(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(e){let t=new zx({id:e.parent.getNextId(),parent:e.parent,uiManager:e._uiManager});t.annotationElementId=e.annotationElementId,t.deleted=!0,t._uiManager.addToAnnotationStorage(t)}static initialize(e,t){if(St._l10n??(St._l10n=e),St._l10nResizer||(St._l10nResizer=Object.freeze({topLeft:"pdfjs-editor-resizer-top-left",topMiddle:"pdfjs-editor-resizer-top-middle",topRight:"pdfjs-editor-resizer-top-right",middleRight:"pdfjs-editor-resizer-middle-right",bottomRight:"pdfjs-editor-resizer-bottom-right",bottomMiddle:"pdfjs-editor-resizer-bottom-middle",bottomLeft:"pdfjs-editor-resizer-bottom-left",middleLeft:"pdfjs-editor-resizer-middle-left"})),St._borderLineWidth!==-1)return;let n=getComputedStyle(document.documentElement);St._borderLineWidth=parseFloat(n.getPropertyValue("--outline-width"))||0}static updateDefaultParams(e,t){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(e){return!1}static paste(e,t){Vt("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return l(this,p0)}set _isDraggable(e){O(this,p0,e),this.div?.classList.toggle("draggable",e)}get uid(){return this.annotationElementId||this.id}get isEnterHandled(){return!0}center(){let[e,t]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*t/(e*2),this.y+=this.width*e/(t*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*t/(e*2),this.y-=this.width*e/(t*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(e){this._uiManager.addCommands(e)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=l(this,vE)}setParent(e){e!==null?(this.pageIndex=e.pageIndex,this.pageDimensions=e.pageDimensions):(X(this,bt,sm).call(this),l(this,Cs)?.remove(),O(this,Cs,null)),this.parent=e}focusin(e){this._focusEventsAllowed&&(l(this,Hc)?O(this,Hc,!1):this.parent.setSelected(this))}focusout(e){!this._focusEventsAllowed||!this.isAttachedToDOM||e.relatedTarget?.closest(`#${this.id}`)||(e.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.isInEditMode()&&this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(e,t,n,i){let[o,s]=this.parentDimensions;[n,i]=this.screenToPageTranslation(n,i),this.x=(e+n)/o,this.y=(t+i)/s,this.fixAndSetPosition()}_moveAfterPaste(e,t){let[n,i]=this.parentDimensions;this.setAt(e*n,t*i,this.width*n,this.height*i),this._onTranslated()}translate(e,t){X(this,bt,Mx).call(this,this.parentDimensions,e,t)}translateInPage(e,t){l(this,Fi)||O(this,Fi,[this.x,this.y,this.width,this.height]),X(this,bt,Mx).call(this,this.pageDimensions,e,t),this.div.scrollIntoView({block:"nearest"})}translationDone(){this._onTranslated(this.x,this.y)}drag(e,t){l(this,Fi)||O(this,Fi,[this.x,this.y,this.width,this.height]);let{div:n,parentDimensions:[i,o]}=this;if(this.x+=e/i,this.y+=t/o,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){let{x:h,y:d}=this.div.getBoundingClientRect();this.parent.findNewParent(this,h,d)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:s,y:a}=this,[u,c]=this.getBaseTranslation();s+=u,a+=c;let{style:f}=n;f.left=`${(100*s).toFixed(2)}%`,f.top=`${(100*a).toFixed(2)}%`,this._onTranslating(s,a),n.scrollIntoView({block:"nearest"})}_onTranslating(e,t){}_onTranslated(e,t){}get _hasBeenMoved(){return!!l(this,Fi)&&(l(this,Fi)[0]!==this.x||l(this,Fi)[1]!==this.y)}get _hasBeenResized(){return!!l(this,Fi)&&(l(this,Fi)[2]!==this.width||l(this,Fi)[3]!==this.height)}getBaseTranslation(){let[e,t]=this.parentDimensions,{_borderLineWidth:n}=St,i=n/e,o=n/t;switch(this.rotation){case 90:return[-i,o];case 180:return[i,o];case 270:return[i,-o];default:return[-i,-o]}}get _mustFixPosition(){return!0}fixAndSetPosition(e=this.rotation){let{div:{style:t},pageDimensions:[n,i]}=this,{x:o,y:s,width:a,height:u}=this;if(a*=n,u*=i,o*=n,s*=i,this._mustFixPosition)switch(e){case 0:o=dn(o,0,n-a),s=dn(s,0,i-u);break;case 90:o=dn(o,0,n-u),s=dn(s,a,i);break;case 180:o=dn(o,a,n),s=dn(s,u,i);break;case 270:o=dn(o,u,n),s=dn(s,0,i-a);break}this.x=o/=n,this.y=s/=i;let[c,f]=this.getBaseTranslation();o+=c,s+=f,t.left=`${(100*o).toFixed(2)}%`,t.top=`${(100*s).toFixed(2)}%`,this.moveInDOM()}screenToPageTranslation(e,t){var n;return X(n=St,g0,Bx).call(n,e,t,this.parentRotation)}pageTranslationToScreen(e,t){var n;return X(n=St,g0,Bx).call(n,e,t,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){let{parentScale:e,pageDimensions:[t,n]}=this;return[t*e,n*e]}setDims(){let{div:{style:e},width:t,height:n}=this;e.width=`${(100*t).toFixed(2)}%`,e.height=`${(100*n).toFixed(2)}%`}getInitialTranslation(){return[0,0]}_onResized(){}static _round(e){return Math.round(e*1e4)/1e4}_onResizing(){}altTextFinish(){l(this,Sr)?.finish()}get toolbarButtons(){return null}async addEditToolbar(){if(this._editToolbar||l(this,qc))return this._editToolbar;this._editToolbar=new xx(this),this.div.append(this._editToolbar.render());let{toolbarButtons:e}=this;if(e)for(let[t,n]of e)await this._editToolbar.addButton(t,n);return this.hasComment||this._editToolbar.addButton("comment",this.addCommentButton()),this._editToolbar.addButton("delete"),this._editToolbar}addCommentButtonInToolbar(){this._editToolbar?.addButtonBefore("comment",this.addCommentButton(),".deleteButton")}removeCommentButtonFromToolbar(){this._editToolbar?.removeButton("comment")}removeEditToolbar(){this._editToolbar?.remove(),this._editToolbar=null,l(this,Sr)?.destroy()}addContainer(e){let t=this._editToolbar?.div;t?t.before(e):this.div.append(e)}getClientDimensions(){return this.div.getBoundingClientRect()}createAltText(){return l(this,Sr)||(Bv.initialize(St._l10n),O(this,Sr,new Bv(this)),l(this,Wc)&&(l(this,Sr).data=l(this,Wc),O(this,Wc,null))),l(this,Sr)}get altTextData(){return l(this,Sr)?.data}set altTextData(e){l(this,Sr)&&(l(this,Sr).data=e)}get guessedAltText(){return l(this,Sr)?.guessedText}async setGuessedAltText(e){await l(this,Sr)?.setGuessedText(e)}serializeAltText(e){return l(this,Sr)?.serialize(e)}hasAltText(){return!!l(this,Sr)&&!l(this,Sr).isEmpty()}hasAltTextData(){return l(this,Sr)?.hasData()??!1}focusCommentButton(){l(this,er)?.focusButton()}addCommentButton(){return this.canAddComment?l(this,er)||O(this,er,new Kh(this)):null}addStandaloneCommentButton(){if(this._uiManager.hasCommentManager()){if(l(this,Ma)){this._uiManager.isEditingMode()&&l(this,Ma).classList.remove("hidden");return}this.hasComment&&(O(this,Ma,l(this,er).renderForStandalone()),this.div.append(l(this,Ma)))}}removeStandaloneCommentButton(){l(this,er).removeStandaloneCommentButton(),O(this,Ma,null)}hideStandaloneCommentButton(){l(this,Ma)?.classList.add("hidden")}get comment(){if(!l(this,er))return null;let{data:{richText:e,text:t,date:n,deleted:i}}=l(this,er);return{text:t,richText:e,date:n,deleted:i,color:this.getNonHCMColor(),opacity:this.opacity??1}}set comment(e){l(this,er)||O(this,er,new Kh(this)),typeof e=="object"&&e!==null?l(this,er).restoreData(e):l(this,er).data=e,this.hasComment?(this.removeCommentButtonFromToolbar(),this.addStandaloneCommentButton(),this._uiManager.updateComment(this)):(this.addCommentButtonInToolbar(),this.removeStandaloneCommentButton(),this._uiManager.removeComment(this))}setCommentData({comment:e,popupRef:t,richText:n}){if(!t||(l(this,er)||O(this,er,new Kh(this)),l(this,er).setInitialText(e,n),!this.annotationElementId))return;let i=this._uiManager.getAndRemoveDataFromAnnotationStorage(this.annotationElementId);i&&this.updateFromAnnotationLayer(i)}get hasEditedComment(){return l(this,er)?.hasBeenEdited()}get hasDeletedComment(){return l(this,er)?.isDeleted()}get hasComment(){return!!l(this,er)&&!l(this,er).isEmpty()&&!l(this,er).isDeleted()}async editComment(e){l(this,er)||O(this,er,new Kh(this)),l(this,er).edit(e)}toggleComment(e,t=void 0){this.hasComment&&this._uiManager.toggleComment(this,e,t)}setSelectedCommentButton(e){l(this,er).setSelectedButton(e)}addComment(e){if(this.hasEditedComment){let[,,,i]=e.rect,[o]=this.pageDimensions,[s]=this.pageTranslation,a=s+o+1,u=i-100,c=a+180;e.popup={contents:this.comment.text,deleted:this.comment.deleted,rect:[a,u,c,i]}}}updateFromAnnotationLayer({popup:{contents:e,deleted:t}}){l(this,er).data=t?null:e}get parentBoundingClientRect(){return this.parent.boundingClientRect}render(){let e=this.div=document.createElement("div");e.setAttribute("data-editor-rotation",(360-this.rotation)%360),e.className=this.name,e.setAttribute("id",this.id),e.tabIndex=l(this,_d)?-1:0,e.setAttribute("role","application"),this.defaultL10nId&&e.setAttribute("data-l10n-id",this.defaultL10nId),this._isVisible||e.classList.add("hidden"),this.setInForeground(),X(this,bt,$x).call(this);let[t,n]=this.parentDimensions;this.parentRotation%180!==0&&(e.style.maxWidth=`${(100*n/t).toFixed(2)}%`,e.style.maxHeight=`${(100*t/n).toFixed(2)}%`);let[i,o]=this.getInitialTranslation();return this.translate(i,o),CF(this,e,["keydown","pointerdown","dblclick"]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(l(this,Gc)||O(this,Gc,new Im({container:e,isPinchingDisabled:()=>!this.isSelected,onPinchStart:X(this,bt,VF).bind(this),onPinching:X(this,bt,YF).bind(this),onPinchEnd:X(this,bt,XF).bind(this),signal:this._uiManager._signal}))),this.addStandaloneCommentButton(),this._uiManager._editorUndoBar?.hide(),e}pointerdown(e){let{isMac:t}=$r.platform;if(e.button!==0||e.ctrlKey&&t){e.preventDefault();return}if(O(this,Hc,!0),this._isDraggable){X(this,bt,KF).call(this,e);return}X(this,bt,jx).call(this,e)}_onStartDragging(){}_onStopDragging(){}moveInDOM(){l(this,Mo)&&clearTimeout(l(this,Mo)),O(this,Mo,setTimeout(()=>{O(this,Mo,null),this.parent?.moveEditorInDOM(this)},0))}_setParentAndPosition(e,t,n){e.changeParent(this),this.x=t,this.y=n,this.fixAndSetPosition(),this._onTranslated()}getRect(e,t,n=this.rotation){let i=this.parentScale,[o,s]=this.pageDimensions,[a,u]=this.pageTranslation,c=e/i,f=t/i,h=this.x*o,d=this.y*s,m=this.width*o,y=this.height*s;switch(n){case 0:return[h+c+a,s-d-f-y+u,h+c+m+a,s-d-f+u];case 90:return[h+f+a,s-d+c+u,h+f+y+a,s-d+c+m+u];case 180:return[h-c-m+a,s-d+f+u,h-c+a,s-d+f+y+u];case 270:return[h-f-y+a,s-d-c-m+u,h-f+a,s-d-c+u];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(e,t){let[n,i,o,s]=e,a=o-n,u=s-i;switch(this.rotation){case 0:return[n,t-s,a,u];case 90:return[n,t-i,u,a];case 180:return[o,t-i,a,u];case 270:return[o,t-s,u,a];default:throw new Error("Invalid rotation")}}getPDFRect(){return this.getRect(0,0)}getNonHCMColor(){return this.color&&St._colorManager.convert(this._uiManager.getNonHCMColor(this.color))}onUpdatedColor(){l(this,er)?.onUpdatedColor()}getData(){let{comment:{text:e,color:t,date:n,opacity:i,deleted:o,richText:s},uid:a,pageIndex:u,creationDate:c,modificationDate:f}=this;return{id:a,pageIndex:u,rect:this.getPDFRect(),richText:s,contentsObj:{str:e},creationDate:c,modificationDate:n||f,popupRef:!o,color:t,opacity:i}}onceAdded(e){}isEmpty(){return!1}enableEditMode(){return this.isInEditMode()?!1:(this.parent.setEditingState(!1),O(this,qc,!0),!0)}disableEditMode(){return this.isInEditMode()?(this.parent.setEditingState(!0),O(this,qc,!1),!0):!1}isInEditMode(){return l(this,qc)}shouldGetKeyboardEvents(){return l(this,Fa)}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){let{top:e,left:t,bottom:n,right:i}=this.getClientDimensions(),{innerHeight:o,innerWidth:s}=window;return t<s&&i>0&&e<o&&n>0}rebuild(){X(this,bt,$x).call(this)}rotate(e){}resize(){}serializeDeleted(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:this._initialData?.popupRef||""}}serialize(e=!1,t=null){return{annotationType:this.mode,pageIndex:this.pageIndex,rect:this.getPDFRect(),rotation:this.rotation,structTreeParentId:this._structTreeParentId,popupRef:this._initialData?.popupRef||""}}static async deserialize(e,t,n){let i=new this.prototype.constructor({parent:t,id:t.getNextId(),uiManager:n,annotationElementId:e.annotationElementId,creationDate:e.creationDate,modificationDate:e.modificationDate});i.rotation=e.rotation,O(i,Wc,e.accessibilityData),i._isCopy=e.isCopy||!1;let[o,s]=i.pageDimensions,[a,u,c,f]=i.getRectInCurrentCoords(e.rect,s);return i.x=a/o,i.y=u/s,i.width=c/o,i.height=f/s,i}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){if(l(this,lu)?.abort(),O(this,lu,null),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.hideCommentPopup(),l(this,Mo)&&(clearTimeout(l(this,Mo)),O(this,Mo,null)),X(this,bt,sm).call(this),this.removeEditToolbar(),l(this,Rs)){for(let e of l(this,Rs).values())clearTimeout(e);O(this,Rs,null)}this.parent=null,l(this,Gc)?.destroy(),O(this,Gc,null),l(this,Cs)?.remove(),O(this,Cs,null)}get isResizable(){return!1}makeResizable(){this.isResizable&&(X(this,bt,qF).call(this),l(this,In).classList.remove("hidden"))}get toolbarPosition(){return null}get commentButtonPosition(){return this._uiManager.direction==="ltr"?[1,0]:[0,0]}get commentButtonPositionInPage(){let{commentButtonPosition:[e,t]}=this,[n,i,o,s]=this.getPDFRect();return[St._round(n+(o-n)*e),St._round(i+(s-i)*(1-t))]}get commentButtonColor(){return this._uiManager.makeCommentColor(this.getNonHCMColor(),this.opacity)}get commentPopupPosition(){return l(this,er).commentPopupPositionInLayer}set commentPopupPosition(e){l(this,er).commentPopupPositionInLayer=e}hasDefaultPopupPosition(){return l(this,er).hasDefaultPopupPosition()}get commentButtonWidth(){return l(this,er).commentButtonWidth}get elementBeforePopup(){return this.div}setCommentButtonStates(e){l(this,er)?.setCommentButtonStates(e)}keydown(e){if(!this.isResizable||e.target!==this.div||e.key!=="Enter")return;this._uiManager.setSelected(this),O(this,Ba,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});let t=l(this,In).children;if(!l(this,Vs)){O(this,Vs,Array.from(t));let s=X(this,bt,ZF).bind(this),a=X(this,bt,JF).bind(this),u=this._uiManager._signal;for(let c of l(this,Vs)){let f=c.getAttribute("data-resizer-name");c.setAttribute("role","spinbutton"),c.addEventListener("keydown",s,{signal:u}),c.addEventListener("blur",a,{signal:u}),c.addEventListener("focus",X(this,bt,QF).bind(this,f),{signal:u}),c.setAttribute("data-l10n-id",St._l10nResizer[f])}}let n=l(this,Vs)[0],i=0;for(let s of t){if(s===n)break;i++}let o=(360-this.rotation+this.parentRotation)%360/90*(l(this,Vs).length/4);if(o!==i){if(o<i)for(let a=0;a<i-o;a++)l(this,In).append(l(this,In).firstElementChild);else if(o>i)for(let a=0;a<o-i;a++)l(this,In).firstElementChild.before(l(this,In).lastElementChild);let s=0;for(let a of t){let c=l(this,Vs)[s++].getAttribute("data-resizer-name");a.setAttribute("data-l10n-id",St._l10nResizer[c])}}X(this,bt,Wx).call(this,0),O(this,Fa,!0),l(this,In).firstElementChild.focus({focusVisible:!0}),e.preventDefault(),e.stopImmediatePropagation()}_resizeWithKeyboard(e,t){l(this,Fa)&&X(this,bt,Ux).call(this,l(this,h0),{deltaX:e,deltaY:t,fromKeyboard:!0})}_stopResizingWithKeyboard(){X(this,bt,sm).call(this),this.div.focus()}select(){if(this.isSelected&&this._editToolbar){this._editToolbar.show();return}if(this.isSelected=!0,this.makeResizable(),this.div?.classList.add("selectedEditor"),!this._editToolbar){this.addEditToolbar().then(()=>{this.div?.classList.contains("selectedEditor")&&this._editToolbar?.show()});return}this._editToolbar?.show(),l(this,Sr)?.toggleAltTextBadge(!1)}focus(){this.div&&!this.div.contains(document.activeElement)&&setTimeout(()=>this.div?.focus({preventScroll:!0}),0)}unselect(){this.isSelected&&(this.isSelected=!1,l(this,In)?.classList.add("hidden"),this.div?.classList.remove("selectedEditor"),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),this._editToolbar?.hide(),l(this,Sr)?.toggleAltTextBadge(!0),this.hideCommentPopup())}hideCommentPopup(){this.hasComment&&this._uiManager.toggleComment(null)}updateParams(e,t){}disableEditing(){}enableEditing(){}get canChangeContent(){return!1}enterInEditMode(){this.canChangeContent&&(this.enableEditMode(),this.div.focus())}dblclick(e){e.target.nodeName!=="BUTTON"&&(this.enterInEditMode(),this.parent.updateToolbar({mode:this.constructor._editorType,editId:this.uid}))}getElementForAltText(){return this.div}get contentDiv(){return this.div}get isEditing(){return l(this,d0)}set isEditing(e){O(this,d0,e),this.parent&&(e?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(e,t=!1){if(t){l(this,Rs)||O(this,Rs,new Map);let{action:n}=e,i=l(this,Rs).get(n);i&&clearTimeout(i),i=setTimeout(()=>{this._reportTelemetry(e),l(this,Rs).delete(n),l(this,Rs).size===0&&O(this,Rs,null)},St._telemetryTimeout),l(this,Rs).set(n,i);return}e.type||(e.type=this.editorType),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:e}})}show(e=this._isVisible){this.div.classList.toggle("hidden",!e),this._isVisible=e}enable(){this.div&&(this.div.tabIndex=0),O(this,_d,!1)}disable(){this.div&&(this.div.tabIndex=-1),O(this,_d,!0)}updateFakeAnnotationElement(e){if(!l(this,Cs)&&!this.deleted){O(this,Cs,e.addFakeAnnotation(this));return}if(this.deleted){l(this,Cs).remove(),O(this,Cs,null);return}(this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized)&&l(this,Cs).updateEdited({rect:this.getPDFRect(),popup:this.comment})}renderAnnotationElement(e){if(this.deleted)return e.hide(),null;let t=e.container.querySelector(".annotationContent");if(!t)t=document.createElement("div"),t.classList.add("annotationContent",this.editorType),e.container.prepend(t);else if(t.nodeName==="CANVAS"){let n=t;t=document.createElement("div"),t.classList.add("annotationContent",this.editorType),n.before(t)}return t}resetAnnotationElement(e){let{firstElementChild:t}=e.container;t?.nodeName==="DIV"&&t.classList.contains("annotationContent")&&t.remove()}};Wc=new WeakMap,Vs=new WeakMap,Sr=new WeakMap,er=new WeakMap,Ma=new WeakMap,_d=new WeakMap,au=new WeakMap,f0=new WeakMap,In=new WeakMap,zc=new WeakMap,Ba=new WeakMap,Cs=new WeakMap,lu=new WeakMap,h0=new WeakMap,Hc=new WeakMap,Fi=new WeakMap,d0=new WeakMap,qc=new WeakMap,Fa=new WeakMap,Mo=new WeakMap,Ad=new WeakMap,xd=new WeakMap,Rs=new WeakMap,Gc=new WeakMap,p0=new WeakMap,vE=new WeakMap,bt=new WeakSet,Mx=function([e,t],n,i){[n,i]=this.screenToPageTranslation(n,i),this.x+=n/e,this.y+=i/t,this._onTranslating(this.x,this.y),this.fixAndSetPosition()},g0=new WeakSet,Bx=function(e,t,n){switch(n){case 90:return[t,-e];case 180:return[-e,-t];case 270:return[-t,e];default:return[e,t]}},rv=function(e){switch(e){case 90:{let[t,n]=this.pageDimensions;return[0,-t/n,n/t,0]}case 180:return[-1,0,0,-1];case 270:{let[t,n]=this.pageDimensions;return[0,t/n,-n/t,0]}default:return[1,0,0,1]}},qF=function(){if(l(this,In))return;O(this,In,document.createElement("div")),l(this,In).classList.add("resizers");let e=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],t=this._uiManager._signal;for(let n of e){let i=document.createElement("div");l(this,In).append(i),i.classList.add("resizer",n),i.setAttribute("data-resizer-name",n),i.addEventListener("pointerdown",X(this,bt,GF).bind(this,n),{signal:t}),i.addEventListener("contextmenu",ss,{signal:t}),i.tabIndex=-1}this.div.prepend(l(this,In))},GF=function(e,t){t.preventDefault();let{isMac:n}=$r.platform;if(t.button!==0||t.ctrlKey&&n)return;l(this,Sr)?.toggle(!1);let i=this._isDraggable;this._isDraggable=!1,O(this,zc,[t.screenX,t.screenY]);let o=new AbortController,s=this._uiManager.combinedSignal(o);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",X(this,bt,Ux).bind(this,e),{passive:!0,capture:!0,signal:s}),window.addEventListener("touchmove",Ir,{passive:!1,signal:s}),window.addEventListener("contextmenu",ss,{signal:s}),O(this,Ba,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});let a=this.parent.div.style.cursor,u=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(t.target).cursor;let c=()=>{o.abort(),this.parent.togglePointerEvents(!0),l(this,Sr)?.toggle(!0),this._isDraggable=i,this.parent.div.style.cursor=a,this.div.style.cursor=u,X(this,bt,nv).call(this)};window.addEventListener("pointerup",c,{signal:s}),window.addEventListener("blur",c,{signal:s})},Fx=function(e,t,n,i){this.width=n,this.height=i,this.x=e,this.y=t,this.setDims(),this.fixAndSetPosition(),this._onResized()},nv=function(){if(!l(this,Ba))return;let{savedX:e,savedY:t,savedWidth:n,savedHeight:i}=l(this,Ba);O(this,Ba,null);let o=this.x,s=this.y,a=this.width,u=this.height;o===e&&s===t&&a===n&&u===i||this.addCommands({cmd:X(this,bt,Fx).bind(this,o,s,a,u),undo:X(this,bt,Fx).bind(this,e,t,n,i),mustExec:!0})},Ux=function(e,t){let[n,i]=this.parentDimensions,o=this.x,s=this.y,a=this.width,u=this.height,c=St.MIN_SIZE/n,f=St.MIN_SIZE/i,h=X(this,bt,rv).call(this,this.rotation),d=(re,k)=>[h[0]*re+h[2]*k,h[1]*re+h[3]*k],m=X(this,bt,rv).call(this,360-this.rotation),y=(re,k)=>[m[0]*re+m[2]*k,m[1]*re+m[3]*k],v,w,b=!1,E=!1;switch(e){case"topLeft":b=!0,v=(re,k)=>[0,0],w=(re,k)=>[re,k];break;case"topMiddle":v=(re,k)=>[re/2,0],w=(re,k)=>[re/2,k];break;case"topRight":b=!0,v=(re,k)=>[re,0],w=(re,k)=>[0,k];break;case"middleRight":E=!0,v=(re,k)=>[re,k/2],w=(re,k)=>[0,k/2];break;case"bottomRight":b=!0,v=(re,k)=>[re,k],w=(re,k)=>[0,0];break;case"bottomMiddle":v=(re,k)=>[re/2,k],w=(re,k)=>[re/2,0];break;case"bottomLeft":b=!0,v=(re,k)=>[0,k],w=(re,k)=>[re,0];break;case"middleLeft":E=!0,v=(re,k)=>[0,k/2],w=(re,k)=>[re,k/2];break}let _=v(a,u),S=w(a,u),A=d(...S),F=St._round(o+A[0]),I=St._round(s+A[1]),q=1,ee=1,K,ne;if(t.fromKeyboard)({deltaX:K,deltaY:ne}=t);else{let{screenX:re,screenY:k}=t,[x,P]=l(this,zc);[K,ne]=this.screenToPageTranslation(re-x,k-P),l(this,zc)[0]=re,l(this,zc)[1]=k}if([K,ne]=y(K/n,ne/i),b){let re=Math.hypot(a,u);q=ee=Math.max(Math.min(Math.hypot(S[0]-_[0]-K,S[1]-_[1]-ne)/re,1/a,1/u),c/a,f/u)}else E?q=dn(Math.abs(S[0]-_[0]-K),c,1)/a:ee=dn(Math.abs(S[1]-_[1]-ne),f,1)/u;let L=St._round(a*q),$=St._round(u*ee);A=d(...w(L,$));let Y=F-A[0],ie=I-A[1];l(this,Fi)||O(this,Fi,[this.x,this.y,this.width,this.height]),this.width=L,this.height=$,this.x=Y,this.y=ie,this.setDims(),this.fixAndSetPosition(),this._onResizing()},VF=function(){O(this,Ba,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height}),l(this,Sr)?.toggle(!1),this.parent.togglePointerEvents(!1)},YF=function(e,t,n){let o=.7*(n/t)+1-.7;if(o===1)return;let s=X(this,bt,rv).call(this,this.rotation),a=(F,I)=>[s[0]*F+s[2]*I,s[1]*F+s[3]*I],[u,c]=this.parentDimensions,f=this.x,h=this.y,d=this.width,m=this.height,y=St.MIN_SIZE/u,v=St.MIN_SIZE/c;o=Math.max(Math.min(o,1/d,1/m),y/d,v/m);let w=St._round(d*o),b=St._round(m*o);if(w===d&&b===m)return;l(this,Fi)||O(this,Fi,[f,h,d,m]);let E=a(d/2,m/2),_=St._round(f+E[0]),S=St._round(h+E[1]),A=a(w/2,b/2);this.x=_-A[0],this.y=S-A[1],this.width=w,this.height=b,this.setDims(),this.fixAndSetPosition(),this._onResizing()},XF=function(){l(this,Sr)?.toggle(!0),this.parent.togglePointerEvents(!0),X(this,bt,nv).call(this)},jx=function(e){let{isMac:t}=$r.platform;e.ctrlKey&&!t||e.shiftKey||e.metaKey&&t?this.parent.toggleSelected(this):this.parent.setSelected(this)},KF=function(e){let{isSelected:t}=this;this._uiManager.setUpDragSession();let n=!1,i=new AbortController,o=this._uiManager.combinedSignal(i),s={capture:!0,passive:!1,signal:o},a=c=>{i.abort(),O(this,au,null),O(this,Hc,!1),this._uiManager.endDragSession()||X(this,bt,jx).call(this,c),n&&this._onStopDragging()};t&&(O(this,Ad,e.clientX),O(this,xd,e.clientY),O(this,au,e.pointerId),O(this,f0,e.pointerType),window.addEventListener("pointermove",c=>{n||(n=!0,this._uiManager.toggleComment(this,!0,!1),this._onStartDragging());let{clientX:f,clientY:h,pointerId:d}=c;if(d!==l(this,au)){Ir(c);return}let[m,y]=this.screenToPageTranslation(f-l(this,Ad),h-l(this,xd));O(this,Ad,f),O(this,xd,h),this._uiManager.dragSelectedEditors(m,y)},s),window.addEventListener("touchmove",Ir,s),window.addEventListener("pointerdown",c=>{c.pointerType===l(this,f0)&&(l(this,Gc)||c.isPrimary)&&a(c),Ir(c)},s));let u=c=>{if(!l(this,au)||l(this,au)===c.pointerId){a(c);return}Ir(c)};window.addEventListener("pointerup",u,{signal:o}),window.addEventListener("blur",u,{signal:o})},$x=function(){if(l(this,lu)||!this.div)return;O(this,lu,new AbortController);let e=this._uiManager.combinedSignal(l(this,lu));this.div.addEventListener("focusin",this.focusin.bind(this),{signal:e}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:e})},ZF=function(e){St._resizerKeyboardManager.exec(this,e)},JF=function(e){l(this,Fa)&&e.relatedTarget?.parentNode!==l(this,In)&&X(this,bt,sm).call(this)},QF=function(e){O(this,h0,l(this,Fa)?e:"")},Wx=function(e){if(l(this,Vs))for(let t of l(this,Vs))t.tabIndex=e},sm=function(){O(this,Fa,!1),X(this,bt,Wx).call(this,-1),X(this,bt,nv).call(this)},z(St,g0),ze(St,"_l10n",null),ze(St,"_l10nResizer",null),ze(St,"_borderLineWidth",-1),ze(St,"_colorManager",new Ix),ze(St,"_zIndex",1),ze(St,"_telemetryTimeout",1e3);br=St,zx=class extends br{constructor(e){super(e),this.annotationElementId=e.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}},KB=3285377520,ms=4294901760,So=65535,Fv=class{constructor(e){this.h1=e?e&4294967295:KB,this.h2=e?e&4294967295:KB}update(e){let t,n;if(typeof e=="string"){t=new Uint8Array(e.length*2),n=0;for(let v=0,w=e.length;v<w;v++){let b=e.charCodeAt(v);b<=255?t[n++]=b:(t[n++]=b>>>8,t[n++]=b&255)}}else if(ArrayBuffer.isView(e))t=e.slice(),n=t.byteLength;else throw new Error("Invalid data format, must be a string or TypedArray.");let i=n>>2,o=n-i*4,s=new Uint32Array(t.buffer,0,i),a=0,u=0,c=this.h1,f=this.h2,h=3432918353,d=461845907,m=h&So,y=d&So;for(let v=0;v<i;v++)v&1?(a=s[v],a=a*h&ms|a*m&So,a=a<<15|a>>>17,a=a*d&ms|a*y&So,c^=a,c=c<<13|c>>>19,c=c*5+3864292196):(u=s[v],u=u*h&ms|u*m&So,u=u<<15|u>>>17,u=u*d&ms|u*y&So,f^=u,f=f<<13|f>>>19,f=f*5+3864292196);switch(a=0,o){case 3:a^=t[i*4+2]<<16;case 2:a^=t[i*4+1]<<8;case 1:a^=t[i*4],a=a*h&ms|a*m&So,a=a<<15|a>>>17,a=a*d&ms|a*y&So,i&1?c^=a:f^=a}this.h1=c,this.h2=f}hexdigest(){let e=this.h1,t=this.h2;return e^=t>>>1,e=e*3981806797&ms|e*36045&So,t=t*4283543511&ms|((t<<16|e>>>16)*2950163797&ms)>>>16,e^=t>>>1,e=e*444984403&ms|e*60499&So,t=t*3301882366&ms|((t<<16|e>>>16)*3120437893&ms)>>>16,e^=t>>>1,(e>>>0).toString(16).padStart(8,"0")+(t>>>0).toString(16).padStart(8,"0")}},Nm=Object.freeze({map:null,hash:"",transfer:void 0}),Om=class{constructor(){z(this,EE);z(this,Vc,!1);z(this,Yc,null);z(this,Ua,null);z(this,Nn,new Map);ze(this,"onSetModified",null);ze(this,"onResetModified",null);ze(this,"onAnnotationEditor",null)}getValue(e,t){let n=l(this,Nn).get(e);return n===void 0?t:Object.assign(t,n)}getRawValue(e){return l(this,Nn).get(e)}remove(e){let t=l(this,Nn).get(e);if(t!==void 0&&(t instanceof br&&l(this,Ua).delete(t.annotationElementId),l(this,Nn).delete(e),l(this,Nn).size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function")){for(let n of l(this,Nn).values())if(n instanceof br)return;this.onAnnotationEditor(null)}}setValue(e,t){let n=l(this,Nn).get(e),i=!1;if(n!==void 0)for(let[o,s]of Object.entries(t))n[o]!==s&&(i=!0,n[o]=s);else i=!0,l(this,Nn).set(e,t);i&&X(this,EE,e3).call(this),t instanceof br&&((l(this,Ua)||O(this,Ua,new Map)).set(t.annotationElementId,t),typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(t.constructor._type))}has(e){return l(this,Nn).has(e)}get size(){return l(this,Nn).size}resetModified(){l(this,Vc)&&(O(this,Vc,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new Uv(this)}get serializable(){if(l(this,Nn).size===0)return Nm;let e=new Map,t=new Fv,n=[],i=Object.create(null),o=!1;for(let[s,a]of l(this,Nn)){let u=a instanceof br?a.serialize(!1,i):a;a.page&&(a.pageIndex=a.page._pageIndex,delete a.page),u&&(e.set(s,u),t.update(`${s}:${JSON.stringify(u)}`),o||(o=!!u.bitmap))}if(o)for(let s of e.values())s.bitmap&&n.push(s.bitmap);return e.size>0?{map:e,hash:t.hexdigest(),transfer:n}:Nm}get editorStats(){let e=null,t=new Map,n=0,i=0;for(let o of l(this,Nn).values()){if(!(o instanceof br)){o.popup&&(o.popup.deleted?i+=1:n+=1);continue}o.isCommentDeleted?i+=1:o.hasEditedComment&&(n+=1);let s=o.telemetryFinalData;if(!s)continue;let{type:a}=s;t.has(a)||t.set(a,Object.getPrototypeOf(o).constructor),e||(e=Object.create(null));let u=e[a]||(e[a]=new Map);for(let[c,f]of Object.entries(s)){if(c==="type")continue;let h=u.getOrInsertComputed(c,BE);h.set(f,(h.get(f)??0)+1)}}if((i>0||n>0)&&(e||(e=Object.create(null)),e.comments={deleted:i,edited:n}),!e)return null;for(let[o,s]of t)e[o]=s.computeTelemetryFinalData(e[o]);return e}resetModifiedIds(){O(this,Yc,null)}updateEditor(e,t){let n=l(this,Ua)?.get(e);return n?(n.updateFromAnnotationLayer(t),!0):!1}getEditor(e){return l(this,Ua)?.get(e)||null}get modifiedIds(){if(l(this,Yc))return l(this,Yc);let e=[];if(l(this,Ua))for(let t of l(this,Ua).values())t.serialize()&&e.push(t.annotationElementId);return O(this,Yc,{ids:new Set(e),hash:e.join(",")})}[Symbol.iterator](){return l(this,Nn).entries()}};Vc=new WeakMap,Yc=new WeakMap,Ua=new WeakMap,Nn=new WeakMap,EE=new WeakSet,e3=function(){l(this,Vc)||(O(this,Vc,!0),typeof this.onSetModified=="function"&&this.onSetModified())};Uv=class extends Om{constructor(t){super();z(this,m0,Nm);let{serializable:n}=t;if(n===Nm)return;let{map:i,hash:o,transfer:s}=n,a=structuredClone(i,s?{transfer:s}:null);O(this,m0,{map:a,hash:o,transfer:[]})}get print(){Vt("Should not call PrintAnnotationStorage.print")}get serializable(){return l(this,m0)}get modifiedIds(){return Et(this,"modifiedIds",{ids:new Set,hash:""})}};m0=new WeakMap;Hx=class{constructor({ownerDocument:e=globalThis.document,styleElement:t=null}){z(this,Sd,new Set);this._document=e,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(e){this.nativeFontFaces.add(e),this._document.fonts.add(e)}removeNativeFontFace(e){this.nativeFontFaces.delete(e),this._document.fonts.delete(e)}insertRule(e){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));let t=this.styleElement.sheet;t.insertRule(e,t.cssRules.length)}clear(){for(let e of this.nativeFontFaces)this._document.fonts.delete(e);this.nativeFontFaces.clear(),l(this,Sd).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:e,disableFontFace:t,_inspectFont:n}){if(!(!e||l(this,Sd).has(e.loadedName))){if(zt(!t,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){let{loadedName:i,src:o,style:s}=e,a=new FontFace(i,o,s);this.addNativeFontFace(a);try{await a.load(),l(this,Sd).add(i),n?.(e)}catch{Tt(`Cannot load system font: ${e.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(a)}return}Vt("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(e){if(e.attached||e.missingFile&&!e.systemFontInfo)return;if(e.attached=!0,e.systemFontInfo){await this.loadSystemFont(e);return}if(this.isFontLoadingAPISupported){let n=e.createNativeFontFace();if(n){this.addNativeFontFace(n);try{await n.loaded}catch(i){throw Tt(`Failed to load font '${n.family}': '${i}'.`),e.disableFontFace=!0,i}}return}let t=e.createFontFaceRule();if(t){if(this.insertRule(t),this.isSyncFontLoadingSupported)return;await new Promise(n=>{let i=this._queueLoadingCallback(n);this._prepareFontLoadEvent(e,i)})}}get isFontLoadingAPISupported(){let e=!!this._document?.fonts;return Et(this,"isFontLoadingAPISupported",e)}get isSyncFontLoadingSupported(){return Et(this,"isSyncFontLoadingSupported",ni||$r.platform.isFirefox)}_queueLoadingCallback(e){function t(){for(zt(!i.done,"completeRequest() cannot be called twice."),i.done=!0;n.length>0&&n[0].done;){let o=n.shift();setTimeout(o.callback,0)}}let{loadingRequests:n}=this,i={done:!1,complete:t,callback:e};return n.push(i),i}get _loadTestFont(){let e=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return Et(this,"_loadTestFont",e)}_prepareFontLoadEvent(e,t){function n(S,A){return S.charCodeAt(A)<<24|S.charCodeAt(A+1)<<16|S.charCodeAt(A+2)<<8|S.charCodeAt(A+3)&255}function i(S,A,F,I){let q=S.substring(0,A),ee=S.substring(A+F);return q+I+ee}let o,s,a=this._document.createElement("canvas");a.width=1,a.height=1;let u=a.getContext("2d"),c=0;function f(S,A){if(++c>30){Tt("Load test font never loaded."),A();return}if(u.font="30px "+S,u.fillText(".",0,20),u.getImageData(0,0,1,1).data[3]>0){A();return}setTimeout(f.bind(null,S,A))}let h=`lt${Date.now()}${this.loadTestFontId++}`,d=this._loadTestFont;d=i(d,976,h.length,h);let y=16,v=1482184792,w=n(d,y);for(o=0,s=h.length-3;o<s;o+=4)w=w-v+n(h,o)|0;o<h.length&&(w=w-v+n(h+"XXX",o)|0),d=i(d,y,4,UV(w));let b=`url(data:font/opentype;base64,${btoa(d)});`,E=`@font-face {font-family:"${h}";src:${b}}`;this.insertRule(E);let _=this._document.createElement("div");_.style.visibility="hidden",_.style.width=_.style.height="10px",_.style.position="absolute",_.style.top=_.style.left="0px";for(let S of[e.loadedName,h]){let A=this._document.createElement("span");A.textContent="Hi",A.style.fontFamily=S,_.append(A)}this._document.body.append(_),f(h,()=>{_.remove(),t.complete()})}};Sd=new WeakMap;qx=class{constructor(e,t=null,n,i){z(this,or);this.compiledGlyphs=Object.create(null),O(this,or,e),this._inspectFont=t,n&&Object.assign(this,n),i&&(this.charProcOperatorList=i)}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let e;if(!this.cssFontInfo)e=new FontFace(this.loadedName,this.data,{});else{let t={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(t.style=`oblique ${this.cssFontInfo.italicAngle}deg`),e=new FontFace(this.cssFontInfo.fontFamily,this.data,t)}return this._inspectFont?.(this),e}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;let e=`url(data:${this.mimetype};base64,${this.data.toBase64()});`,t;if(!this.cssFontInfo)t=`@font-face {font-family:"${this.loadedName}";src:${e}}`;else{let n=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(n+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),t=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${n}src:${e}}`}return this._inspectFont?.(this,e),t}getPathGenerator(e,t){if(this.compiledGlyphs[t]!==void 0)return this.compiledGlyphs[t];let n=this.loadedName+"_path_"+t,i;try{i=e.get(n)}catch(s){Tt(`getPathGenerator - ignoring character: "${s}".`)}let o=EF(i?.path);return this.fontExtraProperties||e.delete(n),this.compiledGlyphs[t]=o}get black(){return l(this,or).black}get bold(){return l(this,or).bold}get disableFontFace(){return l(this,or).disableFontFace??!1}set disableFontFace(e){Et(this,"disableFontFace",!!e)}get fontExtraProperties(){return l(this,or).fontExtraProperties??!1}get isInvalidPDFjsFont(){return l(this,or).isInvalidPDFjsFont}get isType3Font(){return l(this,or).isType3Font}get italic(){return l(this,or).italic}get missingFile(){return l(this,or).missingFile}get remeasure(){return l(this,or).remeasure}get vertical(){return l(this,or).vertical}get ascent(){return l(this,or).ascent}get defaultWidth(){return l(this,or).defaultWidth}get descent(){return l(this,or).descent}get bbox(){return l(this,or).bbox}set bbox(e){Et(this,"bbox",e)}get fontMatrix(){return l(this,or).fontMatrix}get fallbackName(){return l(this,or).fallbackName}get loadedName(){return l(this,or).loadedName}get mimetype(){return l(this,or).mimetype}get name(){return l(this,or).name}get data(){return l(this,or).data}clearData(){l(this,or).clearData()}get cssFontInfo(){return l(this,or).cssFontInfo}get systemFontInfo(){return l(this,or).systemFontInfo}get defaultVMetrics(){return l(this,or).defaultVMetrics}};or=new WeakMap;Qh=class Qh{constructor(e){z(this,Rd);z(this,Td);z(this,Cd);z(this,y0);O(this,Td,e),O(this,Cd,new DataView(l(this,Td))),O(this,y0,new TextDecoder)}static write(e){let t=new TextEncoder,n={},i=0;for(let c of Qh.strings){let f=t.encode(e[c]);n[c]=f,i+=4+f.length}let o=new ArrayBuffer(i),s=new Uint8Array(o),a=new DataView(o),u=0;for(let c of Qh.strings){let f=n[c],h=f.length;a.setUint32(u,h),s.set(f,u+4),u+=4+h}return zt(u===o.byteLength,"CssFontInfo.write: Buffer overflow"),o}get fontFamily(){return X(this,Rd,iv).call(this,0)}get fontWeight(){return X(this,Rd,iv).call(this,1)}get italicAngle(){return X(this,Rd,iv).call(this,2)}};Td=new WeakMap,Cd=new WeakMap,y0=new WeakMap,Rd=new WeakSet,iv=function(e){zt(e<Qh.strings.length,"Invalid string index");let t=0;for(let i=0;i<e;i++)t+=l(this,Cd).getUint32(t)+4;let n=l(this,Cd).getUint32(t);return l(this,y0).decode(new Uint8Array(l(this,Td),t+4,n))},ze(Qh,"strings",["fontFamily","fontWeight","italicAngle"]);jv=Qh,ed=class ed{constructor(e){z(this,Kc);z(this,uu);z(this,Bo);z(this,Xc);O(this,uu,e),O(this,Bo,new DataView(l(this,uu))),O(this,Xc,new TextDecoder)}static write(e){let t=new TextEncoder,n={},i=0;for(let d of ed.strings){let m=t.encode(e[d]);n[d]=m,i+=4+m.length}i+=4;let o,s,a=1+i;e.style&&(o=t.encode(e.style.style),s=t.encode(e.style.weight),a+=4+o.length+4+s.length);let u=new ArrayBuffer(a),c=new Uint8Array(u),f=new DataView(u),h=0;f.setUint8(h++,e.guessFallback?1:0),f.setUint32(h,0),h+=4,i=0;for(let d of ed.strings){let m=n[d],y=m.length;i+=4+y,f.setUint32(h,y),c.set(m,h+4),h+=4+y}return f.setUint32(h-i-4,i),e.style&&(f.setUint32(h,o.length),c.set(o,h+4),h+=4+o.length,f.setUint32(h,s.length),c.set(s,h+4),h+=4+s.length),zt(h<=u.byteLength,"SubstitionInfo.write: Buffer overflow"),u.transferToFixedLength(h)}get guessFallback(){return l(this,Bo).getUint8(0)!==0}get css(){return X(this,Kc,om).call(this,0)}get loadedName(){return X(this,Kc,om).call(this,1)}get baseFontName(){return X(this,Kc,om).call(this,2)}get src(){return X(this,Kc,om).call(this,3)}get style(){let e=1;e+=4+l(this,Bo).getUint32(e);let t=l(this,Bo).getUint32(e),n=l(this,Xc).decode(new Uint8Array(l(this,uu),e+4,t));e+=4+t;let i=l(this,Bo).getUint32(e),o=l(this,Xc).decode(new Uint8Array(l(this,uu),e+4,i));return{style:n,weight:o}}};uu=new WeakMap,Bo=new WeakMap,Xc=new WeakMap,Kc=new WeakSet,om=function(e){zt(e<ed.strings.length,"Invalid string index");let t=5;for(let i=0;i<e;i++)t+=l(this,Bo).getUint32(t)+4;let n=l(this,Bo).getUint32(t);return l(this,Xc).decode(new Uint8Array(l(this,uu),t+4,n))},ze(ed,"strings",["css","loadedName","baseFontName","src"]);$v=ed,Ct=class Ct{constructor({data:e,extra:t}){z(this,jr);z(this,Fo);z(this,b0);z(this,ar);O(this,Fo,e),O(this,b0,new TextDecoder),O(this,ar,new DataView(l(this,Fo))),t&&Object.assign(this,t)}get black(){return X(this,jr,Hs).call(this,0)}get bold(){return X(this,jr,Hs).call(this,1)}get disableFontFace(){return X(this,jr,Hs).call(this,2)}get fontExtraProperties(){return X(this,jr,Hs).call(this,3)}get isInvalidPDFjsFont(){return X(this,jr,Hs).call(this,4)}get isType3Font(){return X(this,jr,Hs).call(this,5)}get italic(){return X(this,jr,Hs).call(this,6)}get missingFile(){return X(this,jr,Hs).call(this,7)}get remeasure(){return X(this,jr,Hs).call(this,8)}get vertical(){return X(this,jr,Hs).call(this,9)}get ascent(){return X(this,jr,sv).call(this,0)}get defaultWidth(){return X(this,jr,sv).call(this,1)}get descent(){return X(this,jr,sv).call(this,2)}get bbox(){let e=l(Ct,Id);if(l(this,ar).getUint8(e)===0)return;e+=1;let n=[];for(let i=0;i<4;i++)n.push(l(this,ar).getInt16(e,!0)),e+=2;return n}get fontMatrix(){let e=l(Ct,Nd);if(l(this,ar).getUint8(e)===0)return;e+=1;let n=[];for(let i=0;i<6;i++)n.push(l(this,ar).getFloat64(e,!0)),e+=8;return n}get defaultVMetrics(){let e=l(Ct,Od);if(l(this,ar).getUint8(e)===0)return;e+=1;let n=[];for(let i=0;i<3;i++)n.push(l(this,ar).getInt16(e,!0)),e+=2;return n}get fallbackName(){return X(this,jr,am).call(this,0)}get loadedName(){return X(this,jr,am).call(this,1)}get mimetype(){return X(this,jr,am).call(this,2)}get name(){return X(this,jr,am).call(this,3)}get data(){let e=l(Ct,Ui),t=l(this,ar).getUint32(e);e+=4+t;let n=l(this,ar).getUint32(e);e+=4+n;let i=l(this,ar).getUint32(e);e+=4+i;let o=l(this,ar).getUint32(e);if(o!==0)return new Uint8Array(l(this,Fo),e+4,o)}clearData(){let e=l(Ct,Ui),t=l(this,ar).getUint32(e);e+=4+t;let n=l(this,ar).getUint32(e);e+=4+n;let i=l(this,ar).getUint32(e);e+=4+i;let o=l(this,ar).getUint32(e);new Uint8Array(l(this,Fo),e+4,o).fill(0),l(this,ar).setUint32(e,0)}get cssFontInfo(){let e=l(Ct,Ui),t=l(this,ar).getUint32(e);e+=4+t;let n=l(this,ar).getUint32(e);e+=4+n;let i=l(this,ar).getUint32(e);if(i===0)return null;let o=new Uint8Array(i);return o.set(new Uint8Array(l(this,Fo),e+4,i)),new jv(o.buffer)}get systemFontInfo(){let e=l(Ct,Ui),t=l(this,ar).getUint32(e);e+=4+t;let n=l(this,ar).getUint32(e);if(n===0)return null;let i=new Uint8Array(n);return i.set(new Uint8Array(l(this,Fo),e+4,n)),new $v(i.buffer)}static write(e){let t=e.systemFontInfo?$v.write(e.systemFontInfo):null,n=e.cssFontInfo?jv.write(e.cssFontInfo):null,i=new TextEncoder,o={},s=0;for(let v of Ct.strings)o[v]=i.encode(e[v]),s+=4+o[v].length;let a=l(Ct,Ui)+4+s+4+(t?t.byteLength:0)+4+(n?n.byteLength:0)+4+(e.data?e.data.length:0),u=new ArrayBuffer(a),c=new Uint8Array(u),f=new DataView(u),h=0,d=Ct.bools.length,m=0,y=0;for(let v=0;v<d;v++){let w=e[Ct.bools[v]];m|=(w===void 0?0:w?2:1)<<y,y+=2,(y===8||v===d-1)&&(f.setUint8(h++,m),m=0,y=0)}zt(h===l(Ct,Dd),"FontInfo.write: Boolean properties offset mismatch");for(let v of Ct.numbers)f.setFloat64(h,e[v]),h+=8;if(zt(h===l(Ct,Id),"FontInfo.write: Number properties offset mismatch"),e.bbox){f.setUint8(h++,4);for(let v of e.bbox)f.setInt16(h,v,!0),h+=2}else f.setUint8(h++,0),h+=8;if(zt(h===l(Ct,Nd),"FontInfo.write: BBox properties offset mismatch"),e.fontMatrix){f.setUint8(h++,6);for(let v of e.fontMatrix)f.setFloat64(h,v,!0),h+=8}else f.setUint8(h++,0),h+=48;if(zt(h===l(Ct,Od),"FontInfo.write: FontMatrix properties offset mismatch"),e.defaultVMetrics){f.setUint8(h++,1);for(let v of e.defaultVMetrics)f.setInt16(h,v,!0),h+=2}else f.setUint8(h++,0),h+=6;zt(h===l(Ct,Ui),"FontInfo.write: DefaultVMetrics properties offset mismatch"),f.setUint32(l(Ct,Ui),0),h+=4;for(let v of Ct.strings){let w=o[v],b=w.length;f.setUint32(h,b),c.set(w,h+4),h+=4+b}if(f.setUint32(l(Ct,Ui),h-l(Ct,Ui)-4),!t)f.setUint32(h,0),h+=4;else{let v=t.byteLength;f.setUint32(h,v),zt(h+4+v<=u.byteLength,"FontInfo.write: Buffer overflow at systemFontInfo"),c.set(new Uint8Array(t),h+4),h+=4+v}if(!n)f.setUint32(h,0),h+=4;else{let v=n.byteLength;f.setUint32(h,v),zt(h+4+v<=u.byteLength,"FontInfo.write: Buffer overflow at cssFontInfo"),c.set(new Uint8Array(n),h+4),h+=4+v}return e.data===void 0?(f.setUint32(h,0),h+=4):(f.setUint32(h,e.data.length),c.set(e.data,h+4),h+=4+e.data.length),zt(h<=u.byteLength,"FontInfo.write: Buffer overflow"),u.transferToFixedLength(h)}};Dd=new WeakMap,Id=new WeakMap,Nd=new WeakMap,Od=new WeakMap,Ui=new WeakMap,Fo=new WeakMap,b0=new WeakMap,ar=new WeakMap,jr=new WeakSet,Hs=function(e){zt(e<Ct.bools.length,"Invalid boolean index");let t=Math.floor(e/4),n=e*2%8,i=l(this,ar).getUint8(t)>>n&3;return i===0?void 0:i===2},sv=function(e){return zt(e<Ct.numbers.length,"Invalid number index"),l(this,ar).getFloat64(l(Ct,Dd)+e*8)},am=function(e){zt(e<Ct.strings.length,"Invalid string index");let t=l(Ct,Ui)+4;for(let o=0;o<e;o++)t+=l(this,ar).getUint32(t)+4;let n=l(this,ar).getUint32(t),i=new Uint8Array(n);return i.set(new Uint8Array(l(this,Fo),t+4,n)),l(this,b0).decode(i)},ze(Ct,"bools",["black","bold","disableFontFace","fontExtraProperties","isInvalidPDFjsFont","isType3Font","italic","missingFile","remeasure","vertical"]),ze(Ct,"numbers",["ascent","defaultWidth","descent"]),ze(Ct,"strings",["fallbackName","loadedName","mimetype","name"]),z(Ct,Dd,Math.ceil(Ct.bools.length*2/8)),z(Ct,Id,l(Ct,Dd)+Ct.numbers.length*8),z(Ct,Nd,l(Ct,Id)+1+8),z(Ct,Od,l(Ct,Nd)+1+48),z(Ct,Ui,l(Ct,Od)+1+6);Gx=Ct,mr=class mr{constructor(e){this.buffer=e,this.view=new DataView(e),this.data=new Uint8Array(e)}static write(e){let t,n=null,i=[],o=[],s=[],a=[],u=null,c=null;switch(e[0]){case"RadialAxial":t=e[1]==="axial"?1:2,n=e[2],s=e[3],t===1?i.push(...e[4],...e[5]):i.push(e[4][0],e[4][1],e[6],e[5][0],e[5][1],e[7]);break;case"Mesh":t=3,u=e[1],i=e[2],o=e[3],a=e[4]||[],n=e[6],c=e[7];break;default:throw new Error(`Unsupported pattern type: ${e[0]}`)}let f=Math.floor(i.length/2),h=Math.floor(o.length/3),d=s.length,m=a.length,y=0;for(let A of a)y+=1,y=Math.ceil(y/4)*4,y+=4+A.coords.length*4,y+=4+A.colors.length*4,A.verticesPerRow!==void 0&&(y+=4);let v=20+f*8+h*3+d*8+(n?16:0)+(c?3:0)+y,w=new ArrayBuffer(v),b=new DataView(w),E=new Uint8Array(w);b.setUint8(l(mr,w0),t),b.setUint8(l(mr,v0),n?1:0),b.setUint8(l(mr,E0),c?1:0),b.setUint8(l(mr,_0),u),b.setUint32(l(mr,A0),f,!0),b.setUint32(l(mr,x0),h,!0),b.setUint32(l(mr,S0),d,!0),b.setUint32(l(mr,T0),m,!0);let _=20;new Float32Array(w,_,f*2).set(i),_+=f*8,E.set(o,_),_+=h*3;for(let[A,F]of s)b.setFloat32(_,A,!0),_+=4,b.setUint32(_,parseInt(F.slice(1),16),!0),_+=4;if(n)for(let A of n)b.setFloat32(_,A,!0),_+=4;c&&(E.set(c,_),_+=3);for(let A=0;A<a.length;A++){let F=a[A];b.setUint8(_,F.type),_+=1,_=Math.ceil(_/4)*4,b.setUint32(_,F.coords.length,!0),_+=4,new Int32Array(w,_,F.coords.length).set(F.coords),_+=F.coords.length*4,b.setUint32(_,F.colors.length,!0),_+=4,new Int32Array(w,_,F.colors.length).set(F.colors),_+=F.colors.length*4,F.verticesPerRow!==void 0&&(b.setUint32(_,F.verticesPerRow,!0),_+=4)}return w}getIR(){let e=this.view,t=this.data[l(mr,w0)],n=!!this.data[l(mr,v0)],i=!!this.data[l(mr,E0)],o=e.getUint32(l(mr,A0),!0),s=e.getUint32(l(mr,x0),!0),a=e.getUint32(l(mr,S0),!0),u=e.getUint32(l(mr,T0),!0),c=20,f=new Float32Array(this.buffer,c,o*2);c+=o*8;let h=new Uint8Array(this.buffer,c,s*3);c+=s*3;let d=[];for(let w=0;w<a;++w){let b=e.getFloat32(c,!0);c+=4;let E=e.getUint32(c,!0);c+=4,d.push([b,`#${E.toString(16).padStart(6,"0")}`])}let m=null;if(n){m=[];for(let w=0;w<4;++w)m.push(e.getFloat32(c,!0)),c+=4}let y=null;i&&(y=new Uint8Array(this.buffer,c,3),c+=3);let v=[];for(let w=0;w<u;++w){let b=e.getUint8(c);c+=1,c=Math.ceil(c/4)*4;let E=e.getUint32(c,!0);c+=4;let _=new Int32Array(this.buffer,c,E);c+=E*4;let S=e.getUint32(c,!0);c+=4;let A=new Int32Array(this.buffer,c,S);c+=S*4;let F={type:b,coords:_,colors:A};b===mx.LATTICE&&(F.verticesPerRow=e.getUint32(c,!0),c+=4),v.push(F)}if(t===1)return["RadialAxial","axial",m,d,Array.from(f.slice(0,2)),Array.from(f.slice(2,4)),null,null];if(t===2)return["RadialAxial","radial",m,d,[f[0],f[1]],[f[3],f[4]],f[2],f[5]];if(t===3){let w=this.data[l(mr,_0)],b=null;if(f.length>0){let E=f[0],_=f[0],S=f[1],A=f[1];for(let F=0;F<f.length;F+=2){let I=f[F],q=f[F+1];E=E>I?I:E,S=S>q?q:S,_=_<I?I:_,A=A<q?q:A}b=[E,S,_,A]}return["Mesh",w,f,h,v,b,m,y]}throw new Error(`Unsupported pattern kind: ${t}`)}};w0=new WeakMap,v0=new WeakMap,E0=new WeakMap,_0=new WeakMap,A0=new WeakMap,x0=new WeakMap,S0=new WeakMap,T0=new WeakMap,z(mr,w0,0),z(mr,v0,1),z(mr,E0,2),z(mr,_0,3),z(mr,A0,4),z(mr,x0,8),z(mr,S0,12),z(mr,T0,16);Vx=mr,Yx=class{constructor(e){z(this,kd);O(this,kd,e)}static write(e){let t,n;return $r.isFloat16ArraySupported?(n=new ArrayBuffer(e.length*2),t=new Float16Array(n)):(n=new ArrayBuffer(e.length*4),t=new Float32Array(n)),t.set(e),n}get path(){return $r.isFloat16ArraySupported?new Float16Array(l(this,kd)):new Float32Array(l(this,kd))}};kd=new WeakMap;Xx=r=>typeof r=="object"&&Number.isInteger(r?.num)&&r.num>=0&&Number.isInteger(r?.gen)&&r.gen>=0,VV=r=>typeof r=="object"&&typeof r?.name=="string",t3=zV.bind(null,Xx,VV),Kx=class{constructor(){z(this,ja,new Map);z(this,_E,Promise.resolve())}postMessage(e,t){let n={data:structuredClone(e,t?{transfer:t}:null)};l(this,_E).then(()=>{for(let[i]of l(this,ja))i.call(this,n)})}addEventListener(e,t,n=null){let i=null;if(n?.signal instanceof AbortSignal){let{signal:o}=n;if(o.aborted){Tt("LoopbackPort - cannot use an `aborted` signal.");return}let s=()=>this.removeEventListener(e,t);i=()=>o.removeEventListener("abort",s),o.addEventListener("abort",s)}l(this,ja).set(t,i)}removeEventListener(e,t){l(this,ja).get(t)?.(),l(this,ja).delete(t)}terminate(){for(let[,e]of l(this,ja))e?.();l(this,ja).clear()}};ja=new WeakMap,_E=new WeakMap;$w={DATA:1,ERROR:2},Zr={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};Rc=class{constructor(e,t,n){z(this,Ps);z(this,Ld,new AbortController);this.sourceName=e,this.targetName=t,this.comObj=n,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),n.addEventListener("message",X(this,Ps,r3).bind(this),{signal:l(this,Ld).signal})}on(e,t){let n=this.actionHandler;if(n[e])throw new Error(`There is already an actionName called "${e}"`);n[e]=t}send(e,t,n){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:t},n)}sendWithPromise(e,t,n){let i=this.callbackId++,o=Promise.withResolvers();this.callbackCapabilities[i]=o;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:i,data:t},n)}catch(s){o.reject(s)}return o.promise}sendWithStream(e,t,n,i){let o=this.streamId++,s=this.sourceName,a=this.targetName,u=this.comObj;return new ReadableStream({start:c=>{let f=Promise.withResolvers();return this.streamControllers[o]={controller:c,startCall:f,pullCall:null,cancelCall:null,isClosed:!1},u.postMessage({sourceName:s,targetName:a,action:e,streamId:o,data:t,desiredSize:c.desiredSize},i),f.promise},pull:c=>{let f=Promise.withResolvers();return this.streamControllers[o].pullCall=f,u.postMessage({sourceName:s,targetName:a,stream:Zr.PULL,streamId:o,desiredSize:c.desiredSize}),f.promise},cancel:c=>{zt(c instanceof Error,"cancel must have a valid reason");let f=Promise.withResolvers();return this.streamControllers[o].cancelCall=f,this.streamControllers[o].isClosed=!0,u.postMessage({sourceName:s,targetName:a,stream:Zr.CANCEL,streamId:o,reason:yi(c)}),f.promise}},n)}destroy(){l(this,Ld)?.abort(),O(this,Ld,null)}};Ld=new WeakMap,Ps=new WeakSet,r3=function({data:e}){if(e.targetName!==this.sourceName)return;if(e.stream){X(this,Ps,i3).call(this,e);return}if(e.callback){let n=e.callbackId,i=this.callbackCapabilities[n];if(!i)throw new Error(`Cannot resolve callback ${n}`);if(delete this.callbackCapabilities[n],e.callback===$w.DATA)i.resolve(e.data);else if(e.callback===$w.ERROR)i.reject(yi(e.reason));else throw new Error("Unexpected callback case");return}let t=this.actionHandler[e.action];if(!t)throw new Error(`Unknown action from worker: ${e.action}`);if(e.callbackId){let n=this.sourceName,i=e.sourceName,o=this.comObj;Promise.try(t,e.data).then(function(s){o.postMessage({sourceName:n,targetName:i,callback:$w.DATA,callbackId:e.callbackId,data:s})},function(s){o.postMessage({sourceName:n,targetName:i,callback:$w.ERROR,callbackId:e.callbackId,reason:yi(s)})});return}if(e.streamId){X(this,Ps,n3).call(this,e);return}t(e.data)},n3=function(e){let t=e.streamId,n=this.sourceName,i=e.sourceName,o=this.comObj,s=this,a=this.actionHandler[e.action],u={enqueue(c,f=1,h){if(this.isCancelled)return;let d=this.desiredSize;this.desiredSize-=f,d>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),o.postMessage({sourceName:n,targetName:i,stream:Zr.ENQUEUE,streamId:t,chunk:c},h)},close(){this.isCancelled||(this.isCancelled=!0,o.postMessage({sourceName:n,targetName:i,stream:Zr.CLOSE,streamId:t}),delete s.streamSinks[t])},error(c){zt(c instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,o.postMessage({sourceName:n,targetName:i,stream:Zr.ERROR,streamId:t,reason:yi(c)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};u.sinkCapability.resolve(),u.ready=u.sinkCapability.promise,this.streamSinks[t]=u,Promise.try(a,e.data,u).then(function(){o.postMessage({sourceName:n,targetName:i,stream:Zr.START_COMPLETE,streamId:t,success:!0})},function(c){o.postMessage({sourceName:n,targetName:i,stream:Zr.START_COMPLETE,streamId:t,reason:yi(c)})})},i3=function(e){let t=e.streamId,n=this.sourceName,i=e.sourceName,o=this.comObj,s=this.streamControllers[t],a=this.streamSinks[t];switch(e.stream){case Zr.START_COMPLETE:e.success?s.startCall.resolve():s.startCall.reject(yi(e.reason));break;case Zr.PULL_COMPLETE:e.success?s.pullCall.resolve():s.pullCall.reject(yi(e.reason));break;case Zr.PULL:if(!a){o.postMessage({sourceName:n,targetName:i,stream:Zr.PULL_COMPLETE,streamId:t,success:!0});break}a.desiredSize<=0&&e.desiredSize>0&&a.sinkCapability.resolve(),a.desiredSize=e.desiredSize,Promise.try(a.onPull||ZB).then(function(){o.postMessage({sourceName:n,targetName:i,stream:Zr.PULL_COMPLETE,streamId:t,success:!0})},function(c){o.postMessage({sourceName:n,targetName:i,stream:Zr.PULL_COMPLETE,streamId:t,reason:yi(c)})});break;case Zr.ENQUEUE:if(zt(s,"enqueue should have stream controller"),s.isClosed)break;s.controller.enqueue(e.chunk);break;case Zr.CLOSE:if(zt(s,"close should have stream controller"),s.isClosed)break;s.isClosed=!0,s.controller.close(),X(this,Ps,ov).call(this,s,t);break;case Zr.ERROR:zt(s,"error should have stream controller"),s.controller.error(yi(e.reason)),X(this,Ps,ov).call(this,s,t);break;case Zr.CANCEL_COMPLETE:e.success?s.cancelCall.resolve():s.cancelCall.reject(yi(e.reason)),X(this,Ps,ov).call(this,s,t);break;case Zr.CANCEL:if(!a)break;let u=yi(e.reason);Promise.try(a.onCancel||ZB,u).then(function(){o.postMessage({sourceName:n,targetName:i,stream:Zr.CANCEL_COMPLETE,streamId:t,success:!0})},function(c){o.postMessage({sourceName:n,targetName:i,stream:Zr.CANCEL_COMPLETE,streamId:t,reason:yi(c)})}),a.sinkCapability.reject(u),a.isCancelled=!0,delete this.streamSinks[t];break;default:throw new Error("Unexpected stream case")}},ov=async function(e,t){await Promise.allSettled([e.startCall?.promise,e.pullCall?.promise,e.cancelCall?.promise]),delete this.streamControllers[t]};Wv=class{constructor({enableHWA:e=!1}){z(this,C0,!1);O(this,C0,e)}create(e,t){if(e<=0||t<=0)throw new Error("Invalid canvas size");let n=this._createCanvas(e,t);return{canvas:n,context:n.getContext("2d",{willReadFrequently:!l(this,C0)})}}reset(e,t,n){if(!e.canvas)throw new Error("Canvas is not specified");if(t<=0||n<=0)throw new Error("Invalid canvas size");e.canvas.width=t,e.canvas.height=n}destroy(e){if(!e.canvas)throw new Error("Canvas is not specified");e.canvas.width=0,e.canvas.height=0,e.canvas=null,e.context=null}_createCanvas(e,t){Vt("Abstract method `_createCanvas` called.")}};C0=new WeakMap;Zx=class extends Wv{constructor({ownerDocument:e=globalThis.document,enableHWA:t=!1}){super({enableHWA:t}),this._document=e}_createCanvas(e,t){let n=this._document.createElement("canvas");return n.width=e,n.height=t,n}},zv=class{constructor({baseUrl:e=null,isCompressed:t=!0}){this.baseUrl=e,this.isCompressed=t}async fetch({name:e}){if(!this.baseUrl)throw new Error("Ensure that the `cMapUrl` and `cMapPacked` API parameters are provided.");if(!e)throw new Error("CMap name must be specified.");let t=this.baseUrl+e+(this.isCompressed?".bcmap":"");return this._fetch(t).then(n=>({cMapData:n,isCompressed:this.isCompressed})).catch(n=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${t}`)})}async _fetch(e){Vt("Abstract method `_fetch` called.")}},Hv=class extends zv{async _fetch(e){let t=await $p(e,this.isCompressed?"bytes":"text");return t instanceof Uint8Array?t:ME(t)}},qv=class{addFilter(e){return"none"}addHCMFilter(e,t){return"none"}addAlphaFilter(e){return"none"}addLuminosityFilter(e){return"none"}addHighlightHCMFilter(e,t,n,i,o){return"none"}destroy(e=!1){}},Jx=class extends qv{constructor({docId:t,ownerDocument:n=globalThis.document}){super();z(this,ct);z(this,Zc);z(this,Pd);z(this,$a);z(this,Wa);z(this,qn);z(this,Jc);z(this,Qc,0);O(this,Wa,t),O(this,qn,n)}addFilter(t){if(!t)return"none";let n=l(this,ct,$n).get(t);if(n)return n;let[i,o,s]=X(this,ct,av).call(this,t),a=t.length===1?i:`${i}${o}${s}`;if(n=l(this,ct,$n).get(a),n)return l(this,ct,$n).set(t,n),n;let u=`g_${l(this,Wa)}_transfer_map_${on(this,Qc)._++}`,c=X(this,ct,Hh).call(this,u);l(this,ct,$n).set(t,c),l(this,ct,$n).set(a,c);let f=X(this,ct,qh).call(this,u);return X(this,ct,cm).call(this,i,o,s,f),c}addHCMFilter(t,n){let i=`${t}-${n}`,o="base",s=l(this,ct,lm).get(o);if(s?.key===i||(s?(s.filter?.remove(),s.key=i,s.url="none",s.filter=null):(s={key:i,url:"none",filter:null},l(this,ct,lm).set(o,s)),!t||!n))return s.url;let a=X(this,ct,fm).call(this,t);t=at.makeHexColor(...a);let u=X(this,ct,fm).call(this,n);if(n=at.makeHexColor(...u),l(this,ct,zh).style.color="",t==="#000000"&&n==="#ffffff"||t===n)return s.url;let c=new Array(256);for(let y=0;y<=255;y++){let v=y/255;c[y]=v<=.03928?v/12.92:((v+.055)/1.055)**2.4}let f=c.join(","),h=`g_${l(this,Wa)}_hcm_filter`,d=s.filter=X(this,ct,qh).call(this,h);X(this,ct,cm).call(this,f,f,f,d),X(this,ct,Qx).call(this,d);let m=(y,v)=>{let w=a[y]/255,b=u[y]/255,E=new Array(v+1);for(let _=0;_<=v;_++)E[_]=w+_/v*(b-w);return E.join(",")};return X(this,ct,cm).call(this,m(0,5),m(1,5),m(2,5),d),s.url=X(this,ct,Hh).call(this,h),s.url}addAlphaFilter(t){let n=l(this,ct,$n).get(t);if(n)return n;let[i]=X(this,ct,av).call(this,[t]),o=`alpha_${i}`;if(n=l(this,ct,$n).get(o),n)return l(this,ct,$n).set(t,n),n;let s=`g_${l(this,Wa)}_alpha_map_${on(this,Qc)._++}`,a=X(this,ct,Hh).call(this,s);l(this,ct,$n).set(t,a),l(this,ct,$n).set(o,a);let u=X(this,ct,qh).call(this,s);return X(this,ct,eS).call(this,i,u),a}addLuminosityFilter(t){let n=l(this,ct,$n).get(t||"luminosity");if(n)return n;let i,o;if(t?([i]=X(this,ct,av).call(this,[t]),o=`luminosity_${i}`):o="luminosity",n=l(this,ct,$n).get(o),n)return l(this,ct,$n).set(t,n),n;let s=`g_${l(this,Wa)}_luminosity_map_${on(this,Qc)._++}`,a=X(this,ct,Hh).call(this,s);l(this,ct,$n).set(t,a),l(this,ct,$n).set(o,a);let u=X(this,ct,qh).call(this,s);return X(this,ct,s3).call(this,u),t&&X(this,ct,eS).call(this,i,u),a}addHighlightHCMFilter(t,n,i,o,s){let a=`${n}-${i}-${o}-${s}`,u=l(this,ct,lm).get(t);if(u?.key===a||(u?(u.filter?.remove(),u.key=a,u.url="none",u.filter=null):(u={key:a,url:"none",filter:null},l(this,ct,lm).set(t,u)),!n||!i))return u.url;let[c,f]=[n,i].map(X(this,ct,fm).bind(this)),h=Math.round(.2126*c[0]+.7152*c[1]+.0722*c[2]),d=Math.round(.2126*f[0]+.7152*f[1]+.0722*f[2]),[m,y]=[o,s].map(X(this,ct,fm).bind(this));d<h&&([h,d,m,y]=[d,h,y,m]),l(this,ct,zh).style.color="";let v=(E,_,S)=>{let A=new Array(256),F=(d-h)/S,I=E/255,q=(_-E)/(255*S),ee=0;for(let K=0;K<=S;K++){let ne=Math.round(h+K*F),L=I+K*q;for(let $=ee;$<=ne;$++)A[$]=L;ee=ne+1}for(let K=ee;K<256;K++)A[K]=A[ee-1];return A.join(",")},w=`g_${l(this,Wa)}_hcm_${t}_filter`,b=u.filter=X(this,ct,qh).call(this,w);return X(this,ct,Qx).call(this,b),X(this,ct,cm).call(this,v(m[0],y[0],5),v(m[1],y[1],5),v(m[2],y[2],5),b),u.url=X(this,ct,Hh).call(this,w),u.url}destroy(t=!1){t&&l(this,Jc)?.size||(l(this,$a)?.parentNode.parentNode.remove(),O(this,$a,null),l(this,Pd)?.clear(),O(this,Pd,null),l(this,Jc)?.clear(),O(this,Jc,null),O(this,Qc,0))}};Zc=new WeakMap,Pd=new WeakMap,$a=new WeakMap,Wa=new WeakMap,qn=new WeakMap,Jc=new WeakMap,Qc=new WeakMap,ct=new WeakSet,$n=function(){return l(this,Pd)||O(this,Pd,new Map)},lm=function(){return l(this,Jc)||O(this,Jc,new Map)},zh=function(){if(!l(this,$a)){let t=l(this,qn).createElement("div"),{style:n}=t;n.visibility="hidden",n.contain="strict",n.width=n.height=0,n.position="absolute",n.top=n.left=0,n.zIndex=-1;let i=l(this,qn).createElementNS(xa,"svg");i.setAttribute("width",0),i.setAttribute("height",0),O(this,$a,l(this,qn).createElementNS(xa,"defs")),t.append(i),i.append(l(this,$a)),l(this,qn).body.append(t)}return l(this,$a)},av=function(t){if(t.length===1){let c=t[0],f=new Array(256);for(let d=0;d<256;d++)f[d]=c[d]/255;let h=f.join(",");return[h,h,h]}let[n,i,o]=t,s=new Array(256),a=new Array(256),u=new Array(256);for(let c=0;c<256;c++)s[c]=n[c]/255,a[c]=i[c]/255,u[c]=o[c]/255;return[s.join(","),a.join(","),u.join(",")]},Hh=function(t){if(l(this,Zc)===void 0){O(this,Zc,"");let n=l(this,qn).URL;n!==l(this,qn).baseURI&&(jy(n)?Tt('#createUrl: ignore "data:"-URL for performance reasons.'):O(this,Zc,YT(n,"")))}return`url(${l(this,Zc)}#${t})`},s3=function(t){let n=l(this,qn).createElementNS(xa,"feColorMatrix");n.setAttribute("type","matrix"),n.setAttribute("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"),t.append(n)},Qx=function(t){let n=l(this,qn).createElementNS(xa,"feColorMatrix");n.setAttribute("type","matrix"),n.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),t.append(n)},qh=function(t){let n=l(this,qn).createElementNS(xa,"filter");return n.setAttribute("color-interpolation-filters","sRGB"),n.setAttribute("id",t),l(this,ct,zh).append(n),n},um=function(t,n,i){let o=l(this,qn).createElementNS(xa,n);o.setAttribute("type","discrete"),o.setAttribute("tableValues",i),t.append(o)},cm=function(t,n,i,o){let s=l(this,qn).createElementNS(xa,"feComponentTransfer");o.append(s),X(this,ct,um).call(this,s,"feFuncR",t),X(this,ct,um).call(this,s,"feFuncG",n),X(this,ct,um).call(this,s,"feFuncB",i)},eS=function(t,n){let i=l(this,qn).createElementNS(xa,"feComponentTransfer");n.append(i),X(this,ct,um).call(this,i,"feFuncA",t)},fm=function(t){return l(this,ct,zh).style.color=t,Wp(getComputedStyle(l(this,ct,zh)).getPropertyValue("color"))};Gv=class{constructor({baseUrl:e=null}){this.baseUrl=e}async fetch({filename:e}){if(!this.baseUrl)throw new Error("Ensure that the `standardFontDataUrl` API parameter is provided.");if(!e)throw new Error("Font filename must be specified.");let t=`${this.baseUrl}${e}`;return this._fetch(t).catch(n=>{throw new Error(`Unable to load font data at: ${t}`)})}async _fetch(e){Vt("Abstract method `_fetch` called.")}},Vv=class extends Gv{async _fetch(e){return $p(e,"bytes")}},Yv=class{constructor({baseUrl:e=null}){this.baseUrl=e}async fetch({filename:e}){if(!this.baseUrl)throw new Error("Ensure that the `wasmUrl` API parameter is provided.");if(!e)throw new Error("Wasm filename must be specified.");let t=`${this.baseUrl}${e}`;return this._fetch(t).catch(n=>{throw new Error(`Unable to load wasm data at: ${t}`)})}async _fetch(e){Vt("Abstract method `_fetch` called.")}},Xv=class extends Yv{async _fetch(e){return $p(e,"bytes")}};ni&&Tt("Please use the `legacy` build in Node.js environments.");tS=class extends qv{},rS=class extends Wv{_createCanvas(e,t){return We.getBuiltinModule("module").createRequire("")("@napi-rs/canvas").createCanvas(e,t)}},nS=class extends zv{async _fetch(e){return JT(e)}},iS=class extends Gv{async _fetch(e){return JT(e)}},sS=class extends Yv{async _fetch(e){return JT(e)}},jh="__forcedDependency",{floor:JB,ceil:QB}=Math;oS=new Uint32Array(new Uint8Array([255,255,0,0]).buffer)[0],aS=class{constructor(e,t){z(this,Md);z(this,cu);O(this,Md,e),O(this,cu,t)}get length(){return l(this,Md).length}isEmpty(e){return l(this,Md)[e]===oS}minX(e){return l(this,cu)[e*4+0]/256}minY(e){return l(this,cu)[e*4+1]/256}maxX(e){return(l(this,cu)[e*4+2]+1)/256}maxY(e){return(l(this,cu)[e*4+3]+1)/256}};Md=new WeakMap,cu=new WeakMap;zw=(r,e)=>r?.getOrInsertComputed(e,()=>({dependencies:new Set,isRenderingOperation:!1})),lS=class{constructor(e,t,n=!1){z(this,D0);z(this,vi,{__proto__:null});z(this,Ei,{__proto__:null,transform:[],moveText:[],sameLineText:[],[jh]:[]});z(this,ef,new Map);z(this,Ys,[]);z(this,tf,[]);z(this,za,[[1,0,0,1,0,0]]);z(this,tr,[-1/0,-1/0,1/0,1/0]);z(this,lr,new Float64Array([1/0,1/0,-1/0,-1/0]));z(this,Ha,-1);z(this,_i,new Set);z(this,R0,new Map);z(this,Bd,new Map);z(this,rf);z(this,nf);z(this,qa);z(this,Gn);z(this,Uo);O(this,rf,e.width),O(this,nf,e.height),X(this,D0,uS).call(this,t),n&&O(this,Uo,new Map)}growOperationsCount(e){e>=l(this,Gn).length&&X(this,D0,uS).call(this,e,l(this,Gn))}save(e){return O(this,vi,{__proto__:l(this,vi)}),O(this,Ei,{__proto__:l(this,Ei),transform:{__proto__:l(this,Ei).transform},moveText:{__proto__:l(this,Ei).moveText},sameLineText:{__proto__:l(this,Ei).sameLineText},[jh]:{__proto__:l(this,Ei)[jh]}}),O(this,tr,{__proto__:l(this,tr)}),l(this,Ys).push(e),this}restore(e){let t=Object.getPrototypeOf(l(this,vi));if(t===null)return this;O(this,vi,t),O(this,Ei,Object.getPrototypeOf(l(this,Ei))),O(this,tr,Object.getPrototypeOf(l(this,tr)));let n=l(this,Ys).pop();return n!==void 0&&(zw(l(this,Uo),e)?.dependencies.add(n),l(this,Gn)[e]=l(this,Gn)[n]),this}recordOpenMarker(e){return l(this,Ys).push(e),this}getOpenMarker(){return l(this,Ys).length===0?null:l(this,Ys).at(-1)}recordCloseMarker(e){let t=l(this,Ys).pop();return t!==void 0&&(zw(l(this,Uo),e)?.dependencies.add(t),l(this,Gn)[e]=l(this,Gn)[t]),this}beginMarkedContent(e){return l(this,tf).push(e),this}endMarkedContent(e){let t=l(this,tf).pop();return t!==void 0&&(zw(l(this,Uo),e)?.dependencies.add(t),l(this,Gn)[e]=l(this,Gn)[t]),this}pushBaseTransform(e){return l(this,za).push(at.multiplyByDOMMatrix(l(this,za).at(-1),e.getTransform())),this}popBaseTransform(){return l(this,za).length>1&&l(this,za).pop(),this}recordSimpleData(e,t){return l(this,vi)[e]=t,this}recordIncrementalData(e,t){return l(this,Ei)[e].push(t),this}resetIncrementalData(e,t){return l(this,Ei)[e].length=0,this}recordNamedData(e,t){return l(this,ef).set(e,t),this}recordSimpleDataFromNamed(e,t,n){l(this,vi)[e]=l(this,ef).get(t)??n}recordFutureForcedDependency(e,t){return this.recordIncrementalData(jh,t),this}inheritSimpleDataAsFutureForcedDependencies(e){for(let t of e)t in l(this,vi)&&this.recordFutureForcedDependency(t,l(this,vi)[t]);return this}inheritPendingDependenciesAsFutureForcedDependencies(){for(let e of l(this,_i))this.recordFutureForcedDependency(jh,e);return this}resetBBox(e){return l(this,Ha)!==e&&(O(this,Ha,e),l(this,lr)[0]=1/0,l(this,lr)[1]=1/0,l(this,lr)[2]=-1/0,l(this,lr)[3]=-1/0),this}recordClipBox(e,t,n,i,o,s){let a=at.multiplyByDOMMatrix(l(this,za).at(-1),t.getTransform()),u=[1/0,1/0,-1/0,-1/0];at.axialAlignedBoundingBox([n,o,i,s],a,u);let c=at.intersect(l(this,tr),u);return c?(l(this,tr)[0]=c[0],l(this,tr)[1]=c[1],l(this,tr)[2]=c[2],l(this,tr)[3]=c[3]):(l(this,tr)[0]=l(this,tr)[1]=1/0,l(this,tr)[2]=l(this,tr)[3]=-1/0),this}recordBBox(e,t,n,i,o,s){let a=l(this,tr);if(a[0]===1/0)return this;let u=at.multiplyByDOMMatrix(l(this,za).at(-1),t.getTransform());if(a[0]===-1/0)return at.axialAlignedBoundingBox([n,o,i,s],u,l(this,lr)),this;let c=[1/0,1/0,-1/0,-1/0];return at.axialAlignedBoundingBox([n,o,i,s],u,c),l(this,lr)[0]=Math.min(l(this,lr)[0],Math.max(c[0],a[0])),l(this,lr)[1]=Math.min(l(this,lr)[1],Math.max(c[1],a[1])),l(this,lr)[2]=Math.max(l(this,lr)[2],Math.min(c[2],a[2])),l(this,lr)[3]=Math.max(l(this,lr)[3],Math.min(c[3],a[3])),this}recordCharacterBBox(e,t,n,i=1,o=0,s=0,a){let u=n.bbox,c,f;if(u&&(c=u[2]!==u[0]&&u[3]!==u[1]&&l(this,Bd).get(n),c!==!1&&(f=[0,0,0,0],at.axialAlignedBoundingBox(u,n.fontMatrix,f),(i!==1||o!==0||s!==0)&&at.scaleMinMax([i,0,0,-i,o,s],f),c)))return this.recordBBox(e,t,f[0],f[2],f[1],f[3]);if(!a)return this.recordFullPageBBox(e);let h=a();return u&&f&&c===void 0&&(c=f[0]<=o-h.actualBoundingBoxLeft&&f[2]>=o+h.actualBoundingBoxRight&&f[1]<=s-h.actualBoundingBoxAscent&&f[3]>=s+h.actualBoundingBoxDescent,l(this,Bd).set(n,c),c)?this.recordBBox(e,t,f[0],f[2],f[1],f[3]):this.recordBBox(e,t,o-h.actualBoundingBoxLeft,o+h.actualBoundingBoxRight,s-h.actualBoundingBoxAscent,s+h.actualBoundingBoxDescent)}recordFullPageBBox(e){return l(this,lr)[0]=Math.max(0,l(this,tr)[0]),l(this,lr)[1]=Math.max(0,l(this,tr)[1]),l(this,lr)[2]=Math.min(l(this,rf),l(this,tr)[2]),l(this,lr)[3]=Math.min(l(this,nf),l(this,tr)[3]),this}getSimpleIndex(e){return l(this,vi)[e]}recordDependencies(e,t){let n=l(this,_i),i=l(this,vi),o=l(this,Ei);for(let s of t)s in l(this,vi)?n.add(i[s]):s in o&&o[s].forEach(n.add,n);return this}recordNamedDependency(e,t){return l(this,ef).has(t)&&l(this,_i).add(l(this,ef).get(t)),this}recordOperation(e,t=!1){if(this.recordDependencies(e,[jh]),l(this,Uo)){let n=zw(l(this,Uo),e),{dependencies:i}=n;l(this,_i).forEach(i.add,i),l(this,Ys).forEach(i.add,i),l(this,tf).forEach(i.add,i),i.delete(e),n.isRenderingOperation=!0}if(l(this,Ha)===e){let n=JB(l(this,lr)[0]*256/l(this,rf)),i=JB(l(this,lr)[1]*256/l(this,nf)),o=QB(l(this,lr)[2]*256/l(this,rf)),s=QB(l(this,lr)[3]*256/l(this,nf));Ww(l(this,qa),e,n,i,o,s);for(let a of l(this,_i))a!==e&&Ww(l(this,qa),a,n,i,o,s);for(let a of l(this,Ys))a!==e&&Ww(l(this,qa),a,n,i,o,s);for(let a of l(this,tf))a!==e&&Ww(l(this,qa),a,n,i,o,s);t||(l(this,_i).clear(),O(this,Ha,-1))}return this}recordShowTextOperation(e,t=!1){let n=Array.from(l(this,_i));this.recordOperation(e,t),this.recordIncrementalData("sameLineText",e);for(let i of n)this.recordIncrementalData("sameLineText",i);return this}bboxToClipBoxDropOperation(e,t=!1){return l(this,Ha)===e&&(O(this,Ha,-1),l(this,tr)[0]=Math.max(l(this,tr)[0],l(this,lr)[0]),l(this,tr)[1]=Math.max(l(this,tr)[1],l(this,lr)[1]),l(this,tr)[2]=Math.min(l(this,tr)[2],l(this,lr)[2]),l(this,tr)[3]=Math.min(l(this,tr)[3],l(this,lr)[3]),t||l(this,_i).clear()),this}_takePendingDependencies(){let e=l(this,_i);return O(this,_i,new Set),e}_extractOperation(e){let t=l(this,R0).get(e);return l(this,R0).delete(e),t}_pushPendingDependencies(e){for(let t of e)l(this,_i).add(t)}take(){return l(this,Bd).clear(),new aS(l(this,Gn),l(this,qa))}takeDebugMetadata(){return l(this,Uo)}};vi=new WeakMap,Ei=new WeakMap,ef=new WeakMap,Ys=new WeakMap,tf=new WeakMap,za=new WeakMap,tr=new WeakMap,lr=new WeakMap,Ha=new WeakMap,_i=new WeakMap,R0=new WeakMap,Bd=new WeakMap,rf=new WeakMap,nf=new WeakMap,qa=new WeakMap,Gn=new WeakMap,Uo=new WeakMap,D0=new WeakSet,uS=function(e,t){let n=new ArrayBuffer(e*4);O(this,qa,new Uint8ClampedArray(n)),O(this,Gn,new Uint32Array(n)),t&&t.length>0?(l(this,Gn).set(t),l(this,Gn).fill(oS,t.length)):l(this,Gn).fill(oS)};tC=class tC{constructor(e,t,n){z(this,pr);z(this,Br);z(this,Xs);z(this,Fd,0);z(this,Ud,0);if(e instanceof tC&&l(e,Xs)===!!n)return e;O(this,pr,e),O(this,Br,t),O(this,Xs,!!n)}growOperationsCount(){throw new Error("Unreachable")}save(e){return on(this,Ud)._++,l(this,pr).save(l(this,Br)),this}restore(e){return l(this,Ud)>0&&(l(this,pr).restore(l(this,Br)),on(this,Ud)._--),this}recordOpenMarker(e){return on(this,Fd)._++,this}getOpenMarker(){return l(this,Fd)>0?l(this,Br):l(this,pr).getOpenMarker()}recordCloseMarker(e){return on(this,Fd)._--,this}beginMarkedContent(e){return this}endMarkedContent(e){return this}pushBaseTransform(e){return l(this,pr).pushBaseTransform(e),this}popBaseTransform(){return l(this,pr).popBaseTransform(),this}recordSimpleData(e,t){return l(this,pr).recordSimpleData(e,l(this,Br)),this}recordIncrementalData(e,t){return l(this,pr).recordIncrementalData(e,l(this,Br)),this}resetIncrementalData(e,t){return l(this,pr).resetIncrementalData(e,l(this,Br)),this}recordNamedData(e,t){return this}recordSimpleDataFromNamed(e,t,n){return l(this,pr).recordSimpleDataFromNamed(e,t,l(this,Br)),this}recordFutureForcedDependency(e,t){return l(this,pr).recordFutureForcedDependency(e,l(this,Br)),this}inheritSimpleDataAsFutureForcedDependencies(e){return l(this,pr).inheritSimpleDataAsFutureForcedDependencies(e),this}inheritPendingDependenciesAsFutureForcedDependencies(){return l(this,pr).inheritPendingDependenciesAsFutureForcedDependencies(),this}resetBBox(e){return l(this,Xs)||l(this,pr).resetBBox(l(this,Br)),this}recordClipBox(e,t,n,i,o,s){return l(this,Xs)||l(this,pr).recordClipBox(l(this,Br),t,n,i,o,s),this}recordBBox(e,t,n,i,o,s){return l(this,Xs)||l(this,pr).recordBBox(l(this,Br),t,n,i,o,s),this}recordCharacterBBox(e,t,n,i,o,s,a){return l(this,Xs)||l(this,pr).recordCharacterBBox(l(this,Br),t,n,i,o,s,a),this}recordFullPageBBox(e){return l(this,Xs)||l(this,pr).recordFullPageBBox(l(this,Br)),this}getSimpleIndex(e){return l(this,pr).getSimpleIndex(e)}recordDependencies(e,t){return l(this,pr).recordDependencies(l(this,Br),t),this}recordNamedDependency(e,t){return l(this,pr).recordNamedDependency(l(this,Br),t),this}recordOperation(e){return l(this,pr).recordOperation(l(this,Br),!0),this}recordShowTextOperation(e){return l(this,pr).recordShowTextOperation(l(this,Br),!0),this}bboxToClipBoxDropOperation(e){return l(this,Xs)||l(this,pr).bboxToClipBoxDropOperation(l(this,Br),!0),this}take(){throw new Error("Unreachable")}takeDebugMetadata(){throw new Error("Unreachable")}};pr=new WeakMap,Br=new WeakMap,Xs=new WeakMap,Fd=new WeakMap,Ud=new WeakMap;Kv=tC,ys={stroke:["path","transform","filter","strokeColor","strokeAlpha","lineWidth","lineCap","lineJoin","miterLimit","dash"],fill:["path","transform","filter","fillColor","fillAlpha","globalCompositeOperation","SMask"],imageXObject:["transform","SMask","filter","fillAlpha","strokeAlpha","globalCompositeOperation"],rawFillPath:["filter","fillColor","fillAlpha"],showText:["transform","leading","charSpacing","wordSpacing","hScale","textRise","moveText","textMatrix","font","fontObj","filter","fillColor","textRenderingMode","SMask","fillAlpha","strokeAlpha","globalCompositeOperation","sameLineText"],transform:["transform"],transformAndFill:["transform","fillColor"]},Ln={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};km=class{isModifyingCurrentTransform(){return!1}getPattern(){Vt("Abstract method `getPattern` called.")}},fS=class extends km{constructor(e){super(),this._type=e[1],this._bbox=e[2],this._colorStops=e[3],this._p0=e[4],this._p1=e[5],this._r0=e[6],this._r1=e[7],this.matrix=null}isOriginBased(){return this._p0[0]===0&&this._p0[1]===0&&(!this.isRadial()||this._p1[0]===0&&this._p1[1]===0)}isRadial(){return this._type==="radial"}_createGradient(e,t=null){let n,i=this._p0,o=this._p1;if(t&&(i=i.slice(),o=o.slice(),at.applyTransform(i,t),at.applyTransform(o,t)),this._type==="axial")n=e.createLinearGradient(i[0],i[1],o[0],o[1]);else if(this._type==="radial"){let s=this._r0,a=this._r1;if(t){let u=new Float32Array(2);at.singularValueDecompose2dScale(t,u),s*=u[0],a*=u[0]}n=e.createRadialGradient(i[0],i[1],s,o[0],o[1],a)}for(let s of this._colorStops)n.addColorStop(s[0],s[1]);return n}getPattern(e,t,n,i){let o;if(i===Ln.STROKE||i===Ln.FILL){if(this.isOriginBased()){let d=at.transform(n,t.baseTransform);this.matrix&&(d=at.transform(d,this.matrix));let m=.001,y=Math.hypot(d[0],d[1]),v=Math.hypot(d[2],d[3]),w=(d[0]*d[2]+d[1]*d[3])/(y*v);if(Math.abs(w)<m)if(this.isRadial()){if(Math.abs(y-v)<m)return this._createGradient(e,d)}else return this._createGradient(e,d)}let s=t.current.getClippedPathBoundingBox(i,Dr(e))||[0,0,0,0],a=Math.ceil(s[2]-s[0])||1,u=Math.ceil(s[3]-s[1])||1,c=t.cachedCanvases.getCanvas("pattern",a,u),f=c.context;f.clearRect(0,0,f.canvas.width,f.canvas.height),f.beginPath(),f.rect(0,0,f.canvas.width,f.canvas.height),f.translate(-s[0],-s[1]),n=at.transform(n,[1,0,0,1,s[0],s[1]]),f.transform(...t.baseTransform),this.matrix&&f.transform(...this.matrix),cS(f,this._bbox),f.fillStyle=this._createGradient(f),f.fill(),o=e.createPattern(c.canvas,"no-repeat");let h=new DOMMatrix(n);o.setTransform(h)}else cS(e,this._bbox),o=this._createGradient(e);return o}};hS=class extends km{constructor(e){super(),this._coords=e[2],this._colors=e[3],this._figures=e[4],this._bounds=e[5],this._bbox=e[6],this._background=e[7],this.matrix=null}_createMeshCanvas(e,t,n){let a=Math.floor(this._bounds[0]),u=Math.floor(this._bounds[1]),c=Math.ceil(this._bounds[2])-a,f=Math.ceil(this._bounds[3])-u,h=Math.min(Math.ceil(Math.abs(c*e[0]*1.1)),3e3),d=Math.min(Math.ceil(Math.abs(f*e[1]*1.1)),3e3),m=c/h,y=f/d,v={coords:this._coords,colors:this._colors,offsetX:-a,offsetY:-u,scaleX:1/m,scaleY:1/y},w=h+4,b=d+4,E=n.getCanvas("mesh",w,b),_=E.context,S=_.createImageData(h,d);if(t){let F=S.data;for(let I=0,q=F.length;I<q;I+=4)F[I]=t[0],F[I+1]=t[1],F[I+2]=t[2],F[I+3]=255}for(let F of this._figures)YV(S,F,v);return _.putImageData(S,2,2),{canvas:E.canvas,offsetX:a-2*m,offsetY:u-2*y,scaleX:m,scaleY:y}}isModifyingCurrentTransform(){return!0}getPattern(e,t,n,i){cS(e,this._bbox);let o=new Float32Array(2);if(i===Ln.SHADING)at.singularValueDecompose2dScale(Dr(e),o);else if(this.matrix){at.singularValueDecompose2dScale(this.matrix,o);let[a,u]=o;at.singularValueDecompose2dScale(t.baseTransform,o),o[0]*=a,o[1]*=u}else at.singularValueDecompose2dScale(t.baseTransform,o);let s=this._createMeshCanvas(o,i===Ln.SHADING?null:this._background,t.cachedCanvases);return i!==Ln.SHADING&&(e.setTransform(...t.baseTransform),this.matrix&&e.transform(...this.matrix)),e.translate(s.offsetX,s.offsetY),e.scale(s.scaleX,s.scaleY),e.createPattern(s.canvas,"no-repeat")}},dS=class extends km{getPattern(){return"hotpink"}};eF={COLORED:1,UNCOLORED:2},AE=class AE{constructor(e,t,n,i){this.color=e[1],this.operatorList=e[2],this.matrix=e[3],this.bbox=e[4],this.xstep=e[5],this.ystep=e[6],this.paintType=e[7],this.tilingType=e[8],this.ctx=t,this.canvasGraphicsFactory=n,this.baseTransform=i}createPatternCanvas(e,t){let{bbox:n,operatorList:i,paintType:o,tilingType:s,color:a,canvasGraphicsFactory:u}=this,{xstep:c,ystep:f}=this;c=Math.abs(c),f=Math.abs(f),PE("TilingType: "+s);let h=n[0],d=n[1],m=n[2],y=n[3],v=m-h,w=y-d,b=new Float32Array(2);at.singularValueDecompose2dScale(this.matrix,b);let[E,_]=b;at.singularValueDecompose2dScale(this.baseTransform,b);let S=E*b[0],A=_*b[1],F=v,I=w,q=!1,ee=!1,K=Math.ceil(c*S),ne=Math.ceil(f*A),L=Math.ceil(v*S),$=Math.ceil(w*A);K>=L?F=c:q=!0,ne>=$?I=f:ee=!0;let Y=this.getSizeAndScale(F,this.ctx.canvas.width,S),ie=this.getSizeAndScale(I,this.ctx.canvas.height,A),re=e.cachedCanvases.getCanvas("pattern",Y.size,ie.size),k=re.context,x=u.createCanvasGraphics(k,t);if(x.groupLevel=e.groupLevel,this.setFillAndStrokeStyleToContext(x,o,a),k.translate(-Y.scale*h,-ie.scale*d),x.transform(0,Y.scale,0,0,ie.scale,0,0),k.save(),x.dependencyTracker?.save(),this.clipBbox(x,h,d,m,y),x.baseTransform=Dr(x.ctx),x.executeOperatorList(i),x.endDrawing(),x.dependencyTracker?.restore(),k.restore(),q||ee){let P=re.canvas;q&&(F=c),ee&&(I=f);let C=this.getSizeAndScale(F,this.ctx.canvas.width,S),j=this.getSizeAndScale(I,this.ctx.canvas.height,A),U=C.size,B=j.size,Q=e.cachedCanvases.getCanvas("pattern-workaround",U,B),fe=Q.context,Ee=q?Math.floor(v/c):0,te=ee?Math.floor(w/f):0;for(let H=0;H<=Ee;H++)for(let ae=0;ae<=te;ae++)fe.drawImage(P,U*H,B*ae,U,B,0,0,U,B);return{canvas:Q.canvas,scaleX:C.scale,scaleY:j.scale,offsetX:h,offsetY:d}}return{canvas:re.canvas,scaleX:Y.scale,scaleY:ie.scale,offsetX:h,offsetY:d}}getSizeAndScale(e,t,n){let i=Math.max(AE.MAX_PATTERN_SIZE,t),o=Math.ceil(e*n);return o>=i?o=i:n=o/e,{scale:n,size:o}}clipBbox(e,t,n,i,o){let s=i-t,a=o-n;e.ctx.rect(t,n,s,a),at.axialAlignedBoundingBox([t,n,i,o],Dr(e.ctx),e.current.minMax),e.clip(),e.endPath()}setFillAndStrokeStyleToContext(e,t,n){let i=e.ctx,o=e.current;switch(t){case eF.COLORED:let{fillStyle:s,strokeStyle:a}=this.ctx;i.fillStyle=o.fillColor=s,i.strokeStyle=o.strokeColor=a;break;case eF.UNCOLORED:i.fillStyle=i.strokeStyle=n,o.fillColor=o.strokeColor=n;break;default:throw new bx(`Unsupported paint type: ${t}`)}}isModifyingCurrentTransform(){return!1}getPattern(e,t,n,i,o){let s=n;i!==Ln.SHADING&&(s=at.transform(s,t.baseTransform),this.matrix&&(s=at.transform(s,this.matrix)));let a=this.createPatternCanvas(t,o),u=new DOMMatrix(s);u=u.translate(a.offsetX,a.offsetY),u=u.scale(1/a.scaleX,1/a.scaleY);let c=e.createPattern(a.canvas,"repeat");return c.setTransform(u),c}};ze(AE,"MAX_PATTERN_SIZE",3e3);pS=AE;tF=16,rF=100,ZV=15,nF=10,Ci=16,dx=new DOMMatrix,ts=new Float32Array(2),Zh=new Float32Array([1/0,1/0,-1/0,-1/0]);gS=class{constructor(e){this.canvasFactory=e,this.cache=Object.create(null)}getCanvas(e,t,n){let i;return this.cache[e]!==void 0?(i=this.cache[e],this.canvasFactory.reset(i,t,n)):(i=this.canvasFactory.create(t,n),this.cache[e]=i),i}delete(e){delete this.cache[e]}clear(){for(let e in this.cache){let t=this.cache[e];this.canvasFactory.destroy(t),delete this.cache[e]}}};Zv=class{constructor(e,t,n){ze(this,"alphaIsShape",!1);ze(this,"fontSize",0);ze(this,"fontSizeScale",1);ze(this,"textMatrix",null);ze(this,"textMatrixScale",1);ze(this,"fontMatrix",gx);ze(this,"leading",0);ze(this,"x",0);ze(this,"y",0);ze(this,"lineX",0);ze(this,"lineY",0);ze(this,"charSpacing",0);ze(this,"wordSpacing",0);ze(this,"textHScale",1);ze(this,"textRenderingMode",cn.FILL);ze(this,"textRise",0);ze(this,"fillColor","#000000");ze(this,"strokeColor","#000000");ze(this,"patternFill",!1);ze(this,"patternStroke",!1);ze(this,"fillAlpha",1);ze(this,"strokeAlpha",1);ze(this,"lineWidth",1);ze(this,"activeSMask",null);ze(this,"transferMaps","none");n?.(this),this.clipBox=new Float32Array([0,0,e,t]),this.minMax=Zh.slice()}clone(){let e=Object.create(this);return e.clipBox=this.clipBox.slice(),e.minMax=this.minMax.slice(),e}getPathBoundingBox(e=Ln.FILL,t=null){let n=this.minMax.slice();if(e===Ln.STROKE){t||Vt("Stroke bounding box must include transform."),at.singularValueDecompose2dScale(t,ts);let i=ts[0]*this.lineWidth/2,o=ts[1]*this.lineWidth/2;n[0]-=i,n[1]-=o,n[2]+=i,n[3]+=o}return n}updateClipFromPath(){let e=at.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(e||[0,0,0,0])}isEmptyClip(){return this.minMax[0]===1/0}startNewPathAndClipBox(e){this.clipBox.set(e,0),this.minMax.set(Zh,0)}getClippedPathBoundingBox(e=Ln.FILL,t=null){return at.intersect(this.clipBox,this.getPathBoundingBox(e,t))}};QV=["butt","round","square"],eY=["miter","round","bevel"],tY={},aF={},rC=class rC{constructor(e,t,n,i,o,{optionalContentConfig:s,markedContentStack:a=null},u,c,f){z(this,oo);this.ctx=e,this.current=new Zv(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.commonObjs=t,this.objs=n,this.canvasFactory=i,this.filterFactory=o,this.groupStack=[],this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=a||[],this.optionalContentConfig=s,this.cachedCanvases=new gS(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=u,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=c,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map,this.dependencyTracker=f??null}getObject(e,t,n=null){return typeof t=="string"?(this.dependencyTracker?.recordNamedDependency(e,t),t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t)):n}beginDrawing({transform:e,viewport:t,transparency:n=!1,background:i=null}){let o=this.ctx.canvas.width,s=this.ctx.canvas.height,a=this.ctx.fillStyle;if(this.ctx.fillStyle=i||"#ffffff",this.ctx.fillRect(0,0,o,s),this.ctx.fillStyle=a,n){let u=this.cachedCanvases.getCanvas("transparent",o,s);this.compositeCtx=this.ctx,this.transparentCanvas=u.canvas,this.ctx=u.context,this.ctx.save(),this.ctx.transform(...Dr(this.compositeCtx))}this.ctx.save(),qw(this.ctx),e&&(this.ctx.transform(...e),this.outputScaleX=e[0],this.outputScaleY=e[0]),this.ctx.transform(...t.transform),this.viewportScale=t.scale,this.baseTransform=Dr(this.ctx)}executeOperatorList(e,t,n,i,o){let s=e.argsArray,a=e.fnArray,u=t||0,c=s.length;if(c===u)return u;let f=c-u>nF&&typeof n=="function",h=f?Date.now()+ZV:0,d=0,m=this.commonObjs,y=this.objs,v,w;for(;;){if(i!==void 0&&u===i.nextBreakPoint)return i.breakIt(u,n),u;if(!o||o(u))if(v=a[u],w=s[u]??null,v!==Op.dependency)w===null?this[v](u):this[v](u,...w);else for(let b of w){this.dependencyTracker?.recordNamedData(b,u);let E=b.startsWith("g_")?m:y;if(!E.has(b))return E.get(b,n),u}if(u++,u===c)return u;if(f&&++d>nF){if(Date.now()>h)return n(),u;d=0}}}endDrawing(){X(this,oo,mS).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(let e of this._cachedBitmapsMap.values()){for(let t of e.values())typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement&&(t.width=t.height=0);e.clear()}this._cachedBitmapsMap.clear(),X(this,oo,yS).call(this)}_scaleImage(e,t){let n=e.width??e.displayWidth,i=e.height??e.displayHeight,o=Math.max(Math.hypot(t[0],t[1]),1),s=Math.max(Math.hypot(t[2],t[3]),1),a=n,u=i,c="prescale1",f,h;for(;o>2&&a>1||s>2&&u>1;){let d=a,m=u;o>2&&a>1&&(d=a>=16384?Math.floor(a/2)-1||1:Math.ceil(a/2),o/=a/d),s>2&&u>1&&(m=u>=16384?Math.floor(u/2)-1||1:Math.ceil(u)/2,s/=u/m),f=this.cachedCanvases.getCanvas(c,d,m),h=f.context,h.clearRect(0,0,d,m),h.drawImage(e,0,0,a,u,0,0,d,m),e=f.canvas,a=d,u=m,c=c==="prescale1"?"prescale2":"prescale1"}return{img:e,paintWidth:a,paintHeight:u}}_createMaskCanvas(e,t){let n=this.ctx,{width:i,height:o}=t,s=this.current.fillColor,a=this.current.patternFill,u=Dr(n),c,f,h,d;if((t.bitmap||t.data)&&t.count>1){let K=t.bitmap||t.data.buffer;f=JSON.stringify(a?u:[u.slice(0,4),s]),c=this._cachedBitmapsMap.getOrInsertComputed(K,BE);let ne=c.get(f);if(ne&&!a){let L=Math.round(Math.min(u[0],u[2])+u[4]),$=Math.round(Math.min(u[1],u[3])+u[5]);return this.dependencyTracker?.recordDependencies(e,ys.transformAndFill),{canvas:ne,offsetX:L,offsetY:$}}h=ne}h||(d=this.cachedCanvases.getCanvas("maskCanvas",i,o),sF(d.context,t));let m=at.transform(u,[1/i,0,0,-1/o,0,0]);m=at.transform(m,[1,0,0,1,0,-o]);let y=Zh.slice();at.axialAlignedBoundingBox([0,0,i,o],m,y);let[v,w,b,E]=y,_=Math.round(b-v)||1,S=Math.round(E-w)||1,A=this.cachedCanvases.getCanvas("fillCanvas",_,S),F=A.context,I=v,q=w;F.translate(-I,-q),F.transform(...m),h||(h=this._scaleImage(d.canvas,xo(F)),h=h.img,c&&a&&c.set(f,h)),F.imageSmoothingEnabled=oF(Dr(F),t.interpolate),Hw(F,h,0,0,h.width,h.height,0,0,i,o),F.globalCompositeOperation="source-in";let ee=at.transform(xo(F),[1,0,0,1,-I,-q]);return F.fillStyle=a?s.getPattern(n,this,ee,Ln.FILL,e):s,F.fillRect(0,0,i,o),c&&!a&&(this.cachedCanvases.delete("fillCanvas"),c.set(f,A.canvas)),this.dependencyTracker?.recordDependencies(e,ys.transformAndFill),{canvas:A.canvas,offsetX:Math.round(I),offsetY:Math.round(q)}}setLineWidth(e,t){this.dependencyTracker?.recordSimpleData("lineWidth",e),t!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=t,this.ctx.lineWidth=t}setLineCap(e,t){this.dependencyTracker?.recordSimpleData("lineCap",e),this.ctx.lineCap=QV[t]}setLineJoin(e,t){this.dependencyTracker?.recordSimpleData("lineJoin",e),this.ctx.lineJoin=eY[t]}setMiterLimit(e,t){this.dependencyTracker?.recordSimpleData("miterLimit",e),this.ctx.miterLimit=t}setDash(e,t,n){this.dependencyTracker?.recordSimpleData("dash",e);let i=this.ctx;i.setLineDash!==void 0&&(i.setLineDash(t),i.lineDashOffset=n)}setRenderingIntent(e,t){}setFlatness(e,t){}setGState(e,t){for(let[n,i]of t)switch(n){case"LW":this.setLineWidth(e,i);break;case"LC":this.setLineCap(e,i);break;case"LJ":this.setLineJoin(e,i);break;case"ML":this.setMiterLimit(e,i);break;case"D":this.setDash(e,i[0],i[1]);break;case"RI":this.setRenderingIntent(e,i);break;case"FL":this.setFlatness(e,i);break;case"Font":this.setFont(e,i[0],i[1]);break;case"CA":this.dependencyTracker?.recordSimpleData("strokeAlpha",e),this.current.strokeAlpha=i;break;case"ca":this.dependencyTracker?.recordSimpleData("fillAlpha",e),this.ctx.globalAlpha=this.current.fillAlpha=i;break;case"BM":this.dependencyTracker?.recordSimpleData("globalCompositeOperation",e),this.ctx.globalCompositeOperation=i;break;case"SMask":this.dependencyTracker?.recordSimpleData("SMask",e),this.current.activeSMask=i?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.dependencyTracker?.recordSimpleData("filter",e),this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(i);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){let e=this.inSMaskMode;this.current.activeSMask&&!e?this.beginSMaskMode():!this.current.activeSMask&&e&&this.endSMaskMode()}beginSMaskMode(e){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");let t=this.ctx.canvas.width,n=this.ctx.canvas.height,i="smaskGroupAt"+this.groupLevel,o=this.cachedCanvases.getCanvas(i,t,n);this.suspendedCtx=this.ctx;let s=this.ctx=o.context;s.setTransform(this.suspendedCtx.getTransform()),Kg(this.suspendedCtx,s),JV(s,this.suspendedCtx),this.setGState(e,[["BM","source-over"]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),Kg(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(e){if(!this.current.activeSMask)return;e?(e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.ceil(e[2]),e[3]=Math.ceil(e[3])):e=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];let t=this.current.activeSMask,n=this.suspendedCtx;this.composeSMask(n,t,this.ctx,e),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}composeSMask(e,t,n,i){let o=i[0],s=i[1],a=i[2]-o,u=i[3]-s;a===0||u===0||(this.genericComposeSMask(t.context,n,a,u,t.subtype,t.backdrop,t.transferMap,o,s,t.offsetX,t.offsetY),e.save(),e.globalAlpha=1,e.globalCompositeOperation="source-over",e.setTransform(1,0,0,1,0,0),e.drawImage(n.canvas,0,0),e.restore())}genericComposeSMask(e,t,n,i,o,s,a,u,c,f,h){let d=e.canvas,m=u-f,y=c-h;if(s)if(m<0||y<0||m+n>d.width||y+i>d.height){let w=this.cachedCanvases.getCanvas("maskExtension",n,i),b=w.context;b.drawImage(d,-m,-y),b.globalCompositeOperation="destination-atop",b.fillStyle=s,b.fillRect(0,0,n,i),b.globalCompositeOperation="source-over",d=w.canvas,m=y=0}else{e.save(),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0);let w=new Path2D;w.rect(m,y,n,i),e.clip(w),e.globalCompositeOperation="destination-atop",e.fillStyle=s,e.fillRect(m,y,n,i),e.restore()}t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0),o==="Alpha"&&a?t.filter=this.filterFactory.addAlphaFilter(a):o==="Luminosity"&&(t.filter=this.filterFactory.addLuminosityFilter(a));let v=new Path2D;v.rect(u,c,n,i),t.clip(v),t.globalCompositeOperation="destination-in",t.drawImage(d,m,y,n,i,u,c,n,i),t.restore()}save(e){this.inSMaskMode&&Kg(this.ctx,this.suspendedCtx),this.ctx.save();let t=this.current;this.stateStack.push(t),this.current=t.clone(),this.dependencyTracker?.save(e)}restore(e){if(this.dependencyTracker?.restore(e),this.stateStack.length===0){this.inSMaskMode&&this.endSMaskMode();return}this.current=this.stateStack.pop(),this.ctx.restore(),this.inSMaskMode&&Kg(this.suspendedCtx,this.ctx),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}transform(e,t,n,i,o,s,a){this.dependencyTracker?.recordIncrementalData("transform",e),this.ctx.transform(t,n,i,o,s,a),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(e,t,n,i){let[o]=n;if(!i){o||(o=n[0]=new Path2D),this[t](e,o);return}if(this.dependencyTracker!==null){let s=t===Op.stroke?this.current.lineWidth/2:0;this.dependencyTracker.resetBBox(e).recordBBox(e,this.ctx,i[0]-s,i[2]+s,i[1]-s,i[3]+s).recordDependencies(e,["transform"])}o instanceof Path2D||(o=n[0]=EF(o)),at.axialAlignedBoundingBox(i,Dr(this.ctx),this.current.minMax),this[t](e,o),this._pathStartIdx=e}closePath(e){this.ctx.closePath()}stroke(e,t,n=!0){let i=this.ctx,o=this.current.strokeColor;if(i.globalAlpha=this.current.strokeAlpha,this.contentVisible)if(typeof o=="object"&&o?.getPattern){let s=o.isModifyingCurrentTransform()?i.getTransform():null;if(i.save(),i.strokeStyle=o.getPattern(i,this,xo(i),Ln.STROKE,e),s){let a=new Path2D;a.addPath(t,i.getTransform().invertSelf().multiplySelf(s)),t=a}this.rescaleAndStroke(t,!1),i.restore()}else this.rescaleAndStroke(t,!0);this.dependencyTracker?.recordDependencies(e,ys.stroke),n&&this.consumePath(e,t,this.current.getClippedPathBoundingBox(Ln.STROKE,Dr(this.ctx))),i.globalAlpha=this.current.fillAlpha}closeStroke(e,t){this.stroke(e,t)}fill(e,t,n=!0){let i=this.ctx,o=this.current.fillColor,s=this.current.patternFill,a=!1;if(s){let c=o.isModifyingCurrentTransform()?i.getTransform():null;if(this.dependencyTracker?.save(e),i.save(),i.fillStyle=o.getPattern(i,this,xo(i),Ln.FILL,e),c){let f=new Path2D;f.addPath(t,i.getTransform().invertSelf().multiplySelf(c)),t=f}a=!0}let u=this.current.getClippedPathBoundingBox();this.contentVisible&&u!==null&&(this.pendingEOFill?(i.fill(t,"evenodd"),this.pendingEOFill=!1):i.fill(t)),this.dependencyTracker?.recordDependencies(e,ys.fill),a&&(i.restore(),this.dependencyTracker?.restore(e)),n&&this.consumePath(e,t,u)}eoFill(e,t){this.pendingEOFill=!0,this.fill(e,t)}fillStroke(e,t){this.fill(e,t,!1),this.stroke(e,t,!1),this.consumePath(e,t)}eoFillStroke(e,t){this.pendingEOFill=!0,this.fillStroke(e,t)}closeFillStroke(e,t){this.fillStroke(e,t)}closeEOFillStroke(e,t){this.pendingEOFill=!0,this.fillStroke(e,t)}endPath(e,t){this.consumePath(e,t)}rawFillPath(e,t){this.ctx.fill(t),this.dependencyTracker?.recordDependencies(e,ys.rawFillPath).recordOperation(e)}clip(e){this.dependencyTracker?.recordFutureForcedDependency("clipMode",e),this.pendingClip=tY}eoClip(e){this.dependencyTracker?.recordFutureForcedDependency("clipMode",e),this.pendingClip=aF}beginText(e){this.current.textMatrix=null,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0,this.dependencyTracker?.recordOpenMarker(e).resetIncrementalData("sameLineText").resetIncrementalData("moveText",e)}endText(e){let t=this.pendingTextPaths,n=this.ctx;if(this.dependencyTracker){let{dependencyTracker:i}=this;t!==void 0&&i.recordFutureForcedDependency("textClip",i.getOpenMarker()).recordFutureForcedDependency("textClip",e),i.recordCloseMarker(e)}if(t!==void 0){let i=new Path2D,o=n.getTransform().invertSelf();for(let{transform:s,x:a,y:u,fontSize:c,path:f}of t)f&&i.addPath(f,new DOMMatrix(s).preMultiplySelf(o).translate(a,u).scale(c,-c));n.clip(i)}delete this.pendingTextPaths}setCharSpacing(e,t){this.dependencyTracker?.recordSimpleData("charSpacing",e),this.current.charSpacing=t}setWordSpacing(e,t){this.dependencyTracker?.recordSimpleData("wordSpacing",e),this.current.wordSpacing=t}setHScale(e,t){this.dependencyTracker?.recordSimpleData("hScale",e),this.current.textHScale=t/100}setLeading(e,t){this.dependencyTracker?.recordSimpleData("leading",e),this.current.leading=-t}setFont(e,t,n){this.dependencyTracker?.recordSimpleData("font",e).recordSimpleDataFromNamed("fontObj",t,e);let i=this.commonObjs.get(t),o=this.current;if(!i)throw new Error(`Can't find font for ${t}`);if(o.fontMatrix=i.fontMatrix||gx,(o.fontMatrix[0]===0||o.fontMatrix[3]===0)&&Tt("Invalid font matrix for font "+t),n<0?(n=-n,o.fontDirection=-1):o.fontDirection=1,this.current.font=i,this.current.fontSize=n,i.isType3Font)return;let s=i.loadedName||"sans-serif",a=i.systemFontInfo?.css||`"${s}", ${i.fallbackName}`,u="normal";i.black?u="900":i.bold&&(u="bold");let c=i.italic?"italic":"normal",f=n;n<tF?f=tF:n>rF&&(f=rF),this.current.fontSizeScale=n/f,this.ctx.font=`${c} ${u} ${f}px ${a}`}setTextRenderingMode(e,t){this.dependencyTracker?.recordSimpleData("textRenderingMode",e),this.current.textRenderingMode=t}setTextRise(e,t){this.dependencyTracker?.recordSimpleData("textRise",e),this.current.textRise=t}moveText(e,t,n){this.dependencyTracker?.resetIncrementalData("sameLineText").recordIncrementalData("moveText",e),this.current.x=this.current.lineX+=t,this.current.y=this.current.lineY+=n}setLeadingMoveText(e,t,n){this.setLeading(e,-n),this.moveText(e,t,n)}setTextMatrix(e,t){this.dependencyTracker?.resetIncrementalData("sameLineText").recordSimpleData("textMatrix",e);let{current:n}=this;n.textMatrix=t,n.textMatrixScale=Math.hypot(t[0],t[1]),n.x=n.lineX=0,n.y=n.lineY=0}nextLine(e){this.moveText(e,0,this.current.leading),this.dependencyTracker?.recordIncrementalData("moveText",this.dependencyTracker.getSimpleIndex("leading")??e)}paintChar(e,t,n,i,o,s){let a=this.ctx,u=this.current,c=u.font,f=u.textRenderingMode,h=u.fontSize/u.fontSizeScale,d=f&cn.FILL_STROKE_MASK,m=!!(f&cn.ADD_TO_PATH_FLAG),y=u.patternFill&&!c.missingFile,v=u.patternStroke&&!c.missingFile,w;if((c.disableFontFace||m||y||v)&&!c.missingFile&&(w=c.getPathGenerator(this.commonObjs,t)),w&&(c.disableFontFace||y||v)){a.save(),a.translate(n,i),a.scale(h,-h),this.dependencyTracker?.recordCharacterBBox(e,a,c);let b;if(d===cn.FILL||d===cn.FILL_STROKE)if(o){b=a.getTransform(),a.setTransform(...o);let E=X(this,oo,bS).call(this,w,b,o);a.fill(E)}else a.fill(w);if(d===cn.STROKE||d===cn.FILL_STROKE)if(s){b||(b=a.getTransform()),a.setTransform(...s);let{a:E,b:_,c:S,d:A}=b,F=at.inverseTransform(s),I=at.transform([E,_,S,A,0,0],F);at.singularValueDecompose2dScale(I,ts),a.lineWidth*=Math.max(ts[0],ts[1])/h,a.stroke(X(this,oo,bS).call(this,w,b,s))}else a.lineWidth/=h,a.stroke(w);a.restore()}else(d===cn.FILL||d===cn.FILL_STROKE)&&(a.fillText(t,n,i),this.dependencyTracker?.recordCharacterBBox(e,a,c,h,n,i,()=>a.measureText(t))),(d===cn.STROKE||d===cn.FILL_STROKE)&&(this.dependencyTracker&&this.dependencyTracker?.recordCharacterBBox(e,a,c,h,n,i,()=>a.measureText(t)).recordDependencies(e,ys.stroke),a.strokeText(t,n,i));m&&((this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:Dr(a),x:n,y:i,fontSize:h,path:w}),this.dependencyTracker?.recordCharacterBBox(e,a,c,h,n,i))}get isFontSubpixelAAEnabled(){let{context:e}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);e.scale(1.5,1),e.fillText("I",0,10);let t=e.getImageData(0,0,10,10).data,n=!1;for(let i=3;i<t.length;i+=4)if(t[i]>0&&t[i]<255){n=!0;break}return Et(this,"isFontSubpixelAAEnabled",n)}showText(e,t){this.dependencyTracker&&(this.dependencyTracker.recordDependencies(e,ys.showText).resetBBox(e),this.current.textRenderingMode&cn.ADD_TO_PATH_FLAG&&this.dependencyTracker.recordFutureForcedDependency("textClip",e).inheritPendingDependenciesAsFutureForcedDependencies());let n=this.current,i=n.font;if(i.isType3Font){this.showType3Text(e,t),this.dependencyTracker?.recordShowTextOperation(e);return}let o=n.fontSize;if(o===0){this.dependencyTracker?.recordOperation(e);return}let s=this.ctx,a=n.fontSizeScale,u=n.charSpacing,c=n.wordSpacing,f=n.fontDirection,h=n.textHScale*f,d=t.length,m=i.vertical,y=m?1:-1,v=i.defaultVMetrics,w=o*n.fontMatrix[0],b=n.textRenderingMode===cn.FILL&&!i.disableFontFace&&!n.patternFill;s.save(),n.textMatrix&&s.transform(...n.textMatrix),s.translate(n.x,n.y+n.textRise),f>0?s.scale(h,-1):s.scale(h,1);let E,_,S=n.textRenderingMode&cn.FILL_STROKE_MASK,A=S===cn.FILL||S===cn.FILL_STROKE,F=S===cn.STROKE||S===cn.FILL_STROKE;if(A&&n.patternFill){s.save();let ne=n.fillColor.getPattern(s,this,xo(s),Ln.FILL,e);E=Dr(s),s.restore(),s.fillStyle=ne}if(F&&n.patternStroke){s.save();let ne=n.strokeColor.getPattern(s,this,xo(s),Ln.STROKE,e);_=Dr(s),s.restore(),s.strokeStyle=ne}let I=n.lineWidth,q=n.textMatrixScale;if(q===0||I===0?F&&(I=this.getSinglePixelWidth()):I/=q,a!==1&&(s.scale(a,a),I/=a),s.lineWidth=I,i.isInvalidPDFjsFont){let ne=[],L=0;for(let Y of t)ne.push(Y.unicode),L+=Y.width;let $=ne.join("");if(s.fillText($,0,0),this.dependencyTracker!==null){let Y=s.measureText($);this.dependencyTracker.recordBBox(e,this.ctx,-Y.actualBoundingBoxLeft,Y.actualBoundingBoxRight,-Y.actualBoundingBoxAscent,Y.actualBoundingBoxDescent).recordShowTextOperation(e)}n.x+=L*w*h,s.restore(),this.compose();return}let ee=0,K;for(K=0;K<d;++K){let ne=t[K];if(typeof ne=="number"){ee+=y*ne*o/1e3;continue}let L=!1,$=(ne.isSpace?c:0)+u,Y=ne.fontChar,ie=ne.accent,re,k,x=ne.width;if(m){let j=ne.vmetric||v,U=-(ne.vmetric?j[1]:x*.5)*w,B=j[2]*w;x=j?-j[0]:x,re=U/a,k=(ee+B)/a}else re=ee/a,k=0;let P;if(i.remeasure&&x>0){P=s.measureText(Y);let j=P.width*1e3/o*a;if(x<j&&this.isFontSubpixelAAEnabled){let U=x/j;L=!0,s.save(),s.scale(U,1),re/=U}else x!==j&&(re+=(x-j)/2e3*o/a)}if(this.contentVisible&&(ne.isInFont||i.missingFile)){if(b&&!ie)s.fillText(Y,re,k),this.dependencyTracker?.recordCharacterBBox(e,s,P?{bbox:null}:i,o/a,re,k,()=>P??s.measureText(Y));else if(this.paintChar(e,Y,re,k,E,_),ie){let j=re+o*ie.offset.x/a,U=k-o*ie.offset.y/a;this.paintChar(e,ie.fontChar,j,U,E,_)}}let C=m?x*w-$*f:x*w+$*f;ee+=C,L&&s.restore()}m?n.y-=ee:n.x+=ee*h,s.restore(),this.compose(),this.dependencyTracker?.recordShowTextOperation(e)}showType3Text(e,t){let n=this.ctx,i=this.current,o=i.font,s=i.fontSize,a=i.fontDirection,u=o.vertical?1:-1,c=i.charSpacing,f=i.wordSpacing,h=i.textHScale*a,d=i.fontMatrix||gx,m=t.length,y=i.textRenderingMode===cn.INVISIBLE,v,w,b,E;if(y||s===0)return;this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,n.save(),i.textMatrix&&n.transform(...i.textMatrix),n.translate(i.x,i.y+i.textRise),n.scale(h,a);let _=this.dependencyTracker;for(this.dependencyTracker=_?new Kv(_,e):null,v=0;v<m;++v){if(w=t[v],typeof w=="number"){E=u*w*s/1e3,this.ctx.translate(E,0),i.x+=E*h;continue}let S=(w.isSpace?f:0)+c,A=o.charProcOperatorList[w.operatorListId];A?this.contentVisible&&(this.save(),n.scale(s,s),n.transform(...d),this.executeOperatorList(A),this.restore()):Tt(`Type3 character "${w.operatorListId}" is not available.`);let F=[w.width,0];at.applyTransform(F,d),b=F[0]*s+S,n.translate(b,0),i.x+=b*h}n.restore(),_&&(this.dependencyTracker=_)}setCharWidth(e,t,n){}setCharWidthAndBounds(e,t,n,i,o,s,a){let u=new Path2D;u.rect(i,o,s-i,a-o),this.ctx.clip(u),this.dependencyTracker?.recordBBox(e,this.ctx,i,s,o,a).recordClipBox(e,this.ctx,i,s,o,a),this.endPath(e)}getColorN_Pattern(e,t){let n;if(t[0]==="TilingPattern"){let i=this.baseTransform||Dr(this.ctx),o={createCanvasGraphics:(s,a)=>new rC(s,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack},void 0,void 0,this.dependencyTracker?new Kv(this.dependencyTracker,a,!0):null)};n=new pS(t,this.ctx,o,i)}else n=this._getPattern(e,t[1],t[2]);return n}setStrokeColorN(e,...t){this.dependencyTracker?.recordSimpleData("strokeColor",e),this.current.strokeColor=this.getColorN_Pattern(e,t),this.current.patternStroke=!0}setFillColorN(e,...t){this.dependencyTracker?.recordSimpleData("fillColor",e),this.current.fillColor=this.getColorN_Pattern(e,t),this.current.patternFill=!0}setStrokeRGBColor(e,t){this.dependencyTracker?.recordSimpleData("strokeColor",e),this.ctx.strokeStyle=this.current.strokeColor=t,this.current.patternStroke=!1}setStrokeTransparent(e){this.dependencyTracker?.recordSimpleData("strokeColor",e),this.ctx.strokeStyle=this.current.strokeColor="transparent",this.current.patternStroke=!1}setFillRGBColor(e,t){this.dependencyTracker?.recordSimpleData("fillColor",e),this.ctx.fillStyle=this.current.fillColor=t,this.current.patternFill=!1}setFillTransparent(e){this.dependencyTracker?.recordSimpleData("fillColor",e),this.ctx.fillStyle=this.current.fillColor="transparent",this.current.patternFill=!1}_getPattern(e,t,n=null){let i;return this.cachedPatterns.has(t)?i=this.cachedPatterns.get(t):(i=XV(this.getObject(e,t)),this.cachedPatterns.set(t,i)),n&&(i.matrix=n),i}shadingFill(e,t){if(!this.contentVisible)return;let n=this.ctx;this.save(e);let i=this._getPattern(e,t);n.fillStyle=i.getPattern(n,this,xo(n),Ln.SHADING,e);let o=xo(n);if(o){let{width:s,height:a}=n.canvas,u=Zh.slice();at.axialAlignedBoundingBox([0,0,s,a],o,u);let[c,f,h,d]=u;this.ctx.fillRect(c,f,h-c,d-f)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.dependencyTracker?.resetBBox(e).recordFullPageBBox(e).recordDependencies(e,ys.transform).recordDependencies(e,ys.fill).recordOperation(e),this.compose(this.current.getClippedPathBoundingBox()),this.restore(e)}beginInlineImage(){Vt("Should not call beginInlineImage")}beginImageData(){Vt("Should not call beginImageData")}paintFormXObjectBegin(e,t,n){if(this.contentVisible&&(this.save(e),this.baseTransformStack.push(this.baseTransform),t&&this.transform(e,...t),this.baseTransform=Dr(this.ctx),n)){at.axialAlignedBoundingBox(n,this.baseTransform,this.current.minMax);let[i,o,s,a]=n,u=new Path2D;u.rect(i,o,s-i,a-o),this.ctx.clip(u),this.dependencyTracker?.recordClipBox(e,this.ctx,i,s,o,a),this.endPath(e)}}paintFormXObjectEnd(e){this.contentVisible&&(this.restore(e),this.baseTransform=this.baseTransformStack.pop())}beginGroup(e,t){if(!this.contentVisible)return;this.save(e),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);let n=this.ctx;t.isolated||PE("TODO: Support non-isolated groups."),t.knockout&&Tt("Knockout groups not supported.");let i=Dr(n);if(t.matrix&&n.transform(...t.matrix),!t.bbox)throw new Error("Bounding box is required.");let o=Zh.slice();at.axialAlignedBoundingBox(t.bbox,Dr(n),o);let s=[0,0,n.canvas.width,n.canvas.height];o=at.intersect(o,s)||[0,0,0,0];let a=Math.floor(o[0]),u=Math.floor(o[1]),c=Math.max(Math.ceil(o[2])-a,1),f=Math.max(Math.ceil(o[3])-u,1);this.current.startNewPathAndClipBox([0,0,c,f]);let h="groupAt"+this.groupLevel;t.smask&&(h+="_smask_"+this.smaskCounter++%2);let d=this.cachedCanvases.getCanvas(h,c,f),m=d.context;m.translate(-a,-u),m.transform(...i);let y=new Path2D,[v,w,b,E]=t.bbox;if(y.rect(v,w,b-v,E-w),t.matrix){let _=new Path2D;_.addPath(y,new DOMMatrix(t.matrix)),y=_}m.clip(y),t.smask&&this.smaskStack.push({canvas:d.canvas,context:m,offsetX:a,offsetY:u,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null}),(!t.smask||this.dependencyTracker)&&(n.setTransform(1,0,0,1,0,0),n.translate(a,u),n.save()),Kg(n,m),this.ctx=m,this.dependencyTracker?.inheritSimpleDataAsFutureForcedDependencies(["fillAlpha","strokeAlpha","globalCompositeOperation"]).pushBaseTransform(n),this.setGState(e,[["BM","source-over"],["ca",1],["CA",1],["TR",null]]),this.groupStack.push(n),this.groupLevel++}endGroup(e,t){if(!this.contentVisible)return;this.groupLevel--;let n=this.ctx,i=this.groupStack.pop();if(this.ctx=i,this.ctx.imageSmoothingEnabled=!1,this.dependencyTracker?.popBaseTransform(),t.smask)this.tempSMask=this.smaskStack.pop(),this.restore(e),this.dependencyTracker&&this.ctx.restore();else{this.ctx.restore();let o=Dr(this.ctx);this.restore(e),this.ctx.save(),this.ctx.setTransform(...o);let s=Zh.slice();at.axialAlignedBoundingBox([0,0,n.canvas.width,n.canvas.height],o,s),this.ctx.drawImage(n.canvas,0,0),this.ctx.restore(),this.compose(s)}}beginAnnotation(e,t,n,i,o,s){if(X(this,oo,mS).call(this),qw(this.ctx),this.ctx.save(),this.save(e),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),n){let a=n[2]-n[0],u=n[3]-n[1];if(s&&this.annotationCanvasMap){i=i.slice(),i[4]-=n[0],i[5]-=n[1],n=n.slice(),n[0]=n[1]=0,n[2]=a,n[3]=u,at.singularValueDecompose2dScale(Dr(this.ctx),ts);let{viewportScale:c}=this,f=Math.ceil(a*this.outputScaleX*c),h=Math.ceil(u*this.outputScaleY*c);this.annotationCanvas=this.canvasFactory.create(f,h);let{canvas:d,context:m}=this.annotationCanvas;this.annotationCanvasMap.set(t,d),this.annotationCanvas.savedCtx=this.ctx,this.ctx=m,this.ctx.save(),this.ctx.setTransform(ts[0],0,0,-ts[1],0,u*ts[1]),qw(this.ctx)}else{qw(this.ctx),this.endPath(e);let c=new Path2D;c.rect(n[0],n[1],a,u),this.ctx.clip(c)}}this.current=new Zv(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(e,...i),this.transform(e,...o)}endAnnotation(e){this.annotationCanvas&&(this.ctx.restore(),X(this,oo,yS).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(e,t){if(!this.contentVisible)return;let n=t.count;t=this.getObject(e,t.data,t),t.count=n;let i=this.ctx,o=this._createMaskCanvas(e,t),s=o.canvas;i.save(),i.setTransform(1,0,0,1,0,0),i.drawImage(s,o.offsetX,o.offsetY),this.dependencyTracker?.resetBBox(e).recordBBox(e,this.ctx,o.offsetX,o.offsetX+s.width,o.offsetY,o.offsetY+s.height).recordOperation(e),i.restore(),this.compose()}paintImageMaskXObjectRepeat(e,t,n,i=0,o=0,s,a){if(!this.contentVisible)return;t=this.getObject(e,t.data,t);let u=this.ctx;u.save();let c=Dr(u);u.transform(n,i,o,s,0,0);let f=this._createMaskCanvas(e,t);u.setTransform(1,0,0,1,f.offsetX-c[4],f.offsetY-c[5]),this.dependencyTracker?.resetBBox(e);for(let h=0,d=a.length;h<d;h+=2){let m=at.transform(c,[n,i,o,s,a[h],a[h+1]]);u.drawImage(f.canvas,m[4],m[5]),this.dependencyTracker?.recordBBox(e,this.ctx,m[4],m[4]+f.canvas.width,m[5],m[5]+f.canvas.height)}u.restore(),this.compose(),this.dependencyTracker?.recordOperation(e)}paintImageMaskXObjectGroup(e,t){if(!this.contentVisible)return;let n=this.ctx,i=this.current.fillColor,o=this.current.patternFill;this.dependencyTracker?.resetBBox(e).recordDependencies(e,ys.transformAndFill);for(let s of t){let{data:a,width:u,height:c,transform:f}=s,h=this.cachedCanvases.getCanvas("maskCanvas",u,c),d=h.context;d.save();let m=this.getObject(e,a,s);sF(d,m),d.globalCompositeOperation="source-in",d.fillStyle=o?i.getPattern(d,this,xo(n),Ln.FILL,e):i,d.fillRect(0,0,u,c),d.restore(),n.save(),n.transform(...f),n.scale(1,-1),Hw(n,h.canvas,0,0,u,c,0,-1,1,1),this.dependencyTracker?.recordBBox(e,n,0,u,0,c),n.restore()}this.compose(),this.dependencyTracker?.recordOperation(e)}paintImageXObject(e,t){if(!this.contentVisible)return;let n=this.getObject(e,t);if(!n){Tt("Dependent image isn't ready yet");return}this.paintInlineImageXObject(e,n)}paintImageXObjectRepeat(e,t,n,i,o){if(!this.contentVisible)return;let s=this.getObject(e,t);if(!s){Tt("Dependent image isn't ready yet");return}let a=s.width,u=s.height,c=[];for(let f=0,h=o.length;f<h;f+=2)c.push({transform:[n,0,0,i,o[f],o[f+1]],x:0,y:0,w:a,h:u});this.paintInlineImageXObjectGroup(e,s,c)}applyTransferMapsToCanvas(e){return this.current.transferMaps!=="none"&&(e.filter=this.current.transferMaps,e.drawImage(e.canvas,0,0),e.filter="none"),e.canvas}applyTransferMapsToBitmap(e){if(this.current.transferMaps==="none")return e.bitmap;let{bitmap:t,width:n,height:i}=e,o=this.cachedCanvases.getCanvas("inlineImage",n,i),s=o.context;return s.filter=this.current.transferMaps,s.drawImage(t,0,0),s.filter="none",o.canvas}paintInlineImageXObject(e,t){if(!this.contentVisible)return;let n=t.width,i=t.height,o=this.ctx;this.save(e);let{filter:s}=o;s!=="none"&&s!==""&&(o.filter="none"),o.scale(1/n,-1/i);let a;if(t.bitmap)a=this.applyTransferMapsToBitmap(t);else if(typeof HTMLElement=="function"&&t instanceof HTMLElement||!t.data)a=t;else{let f=this.cachedCanvases.getCanvas("inlineImage",n,i).context;iF(f,t),a=this.applyTransferMapsToCanvas(f)}let u=this._scaleImage(a,xo(o));o.imageSmoothingEnabled=oF(Dr(o),t.interpolate),this.dependencyTracker?.resetBBox(e).recordBBox(e,o,0,n,-i,0).recordDependencies(e,ys.imageXObject).recordOperation(e),Hw(o,u.img,0,0,u.paintWidth,u.paintHeight,0,-i,n,i),this.compose(),this.restore(e)}paintInlineImageXObjectGroup(e,t,n){if(!this.contentVisible)return;let i=this.ctx,o;if(t.bitmap)o=t.bitmap;else{let s=t.width,a=t.height,c=this.cachedCanvases.getCanvas("inlineImage",s,a).context;iF(c,t),o=this.applyTransferMapsToCanvas(c)}this.dependencyTracker?.resetBBox(e);for(let s of n)i.save(),i.transform(...s.transform),i.scale(1,-1),Hw(i,o,s.x,s.y,s.w,s.h,0,-1,1,1),this.dependencyTracker?.recordBBox(e,i,0,1,-1,0),i.restore();this.dependencyTracker?.recordOperation(e),this.compose()}paintSolidColorImageMask(e){this.contentVisible&&(this.dependencyTracker?.resetBBox(e).recordBBox(e,this.ctx,0,1,0,1).recordDependencies(e,ys.fill).recordOperation(e),this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(e,t){}markPointProps(e,t,n){}beginMarkedContent(e,t){this.dependencyTracker?.beginMarkedContent(e),this.markedContentStack.push({visible:!0})}beginMarkedContentProps(e,t,n){this.dependencyTracker?.beginMarkedContent(e),t==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(n)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(e){this.dependencyTracker?.endMarkedContent(e),this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(e){}endCompat(e){}consumePath(e,t,n){let i=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(n);let o=this.ctx;this.pendingClip?(i||(this.pendingClip===aF?o.clip(t,"evenodd"):o.clip(t)),this.pendingClip=null,this.dependencyTracker?.bboxToClipBoxDropOperation(e).recordFutureForcedDependency("clipPath",e)):this.dependencyTracker?.recordOperation(e),this.current.startNewPathAndClipBox(this.current.clipBox)}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){let e=Dr(this.ctx);if(e[1]===0&&e[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(e[0]),Math.abs(e[3]));else{let t=Math.abs(e[0]*e[3]-e[2]*e[1]),n=Math.hypot(e[0],e[2]),i=Math.hypot(e[1],e[3]);this._cachedGetSinglePixelWidth=Math.max(n,i)/t}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){let{lineWidth:e}=this.current,{a:t,b:n,c:i,d:o}=this.ctx.getTransform(),s,a;if(n===0&&i===0){let u=Math.abs(t),c=Math.abs(o);if(u===c)if(e===0)s=a=1/u;else{let f=u*e;s=a=f<1?1/f:1}else if(e===0)s=1/u,a=1/c;else{let f=u*e,h=c*e;s=f<1?1/f:1,a=h<1?1/h:1}}else{let u=Math.abs(t*o-n*i),c=Math.hypot(t,n),f=Math.hypot(i,o);if(e===0)s=f/u,a=c/u;else{let h=e*u;s=f>h?f/h:1,a=c>h?c/h:1}}this._cachedScaleForStroking[0]=s,this._cachedScaleForStroking[1]=a}return this._cachedScaleForStroking}rescaleAndStroke(e,t){let{ctx:n,current:{lineWidth:i}}=this,[o,s]=this.getScaleForStroking();if(o===s){n.lineWidth=(i||1)*o,n.stroke(e);return}let a=n.getLineDash();t&&n.save(),n.scale(o,s),dx.a=1/o,dx.d=1/s;let u=new Path2D;if(u.addPath(e,dx),a.length>0){let c=Math.max(o,s);n.setLineDash(a.map(f=>f/c)),n.lineDashOffset/=c}n.lineWidth=i||1,n.stroke(u),t&&n.restore()}isContentVisible(){for(let e=this.markedContentStack.length-1;e>=0;e--)if(!this.markedContentStack[e].visible)return!1;return!0}};oo=new WeakSet,mS=function(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.current.activeSMask=null,this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)},yS=function(){if(this.pageColors){let e=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(e!=="none"){let t=this.ctx.filter;this.ctx.filter=e,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=t}}},bS=function(e,t,n){let i=new Path2D;return i.addPath(e,new DOMMatrix(n).invertSelf().multiplySelf(t)),i};rd=rC;for(let r in Op)rd.prototype[r]!==void 0&&(rd.prototype[Op[r]]=rd.prototype[r]);Os=class{static get workerPort(){return l(this,I0)}static set workerPort(e){if(!(typeof Worker<"u"&&e instanceof Worker)&&e!==null)throw new Error("Invalid `workerPort` type.");O(this,I0,e)}static get workerSrc(){return l(this,N0)}static set workerSrc(e){if(typeof e!="string")throw new Error("Invalid `workerSrc` type.");O(this,N0,e)}};I0=new WeakMap,N0=new WeakMap,z(Os,I0,null),z(Os,N0,"");wS=class{constructor({parsedData:e,rawData:t}){z(this,jd);z(this,O0);O(this,jd,e),O(this,O0,t)}getRaw(){return l(this,O0)}get(e){return l(this,jd).get(e)??null}[Symbol.iterator](){return l(this,jd).entries()}};jd=new WeakMap,O0=new WeakMap;Gh=Symbol("INTERNAL"),vS=class{constructor(e,{name:t,intent:n,usage:i,rbGroups:o}){z(this,k0,!1);z(this,L0,!1);z(this,P0,!1);z(this,$d,!0);O(this,k0,!!(e&es.DISPLAY)),O(this,L0,!!(e&es.PRINT)),this.name=t,this.intent=n,this.usage=i,this.rbGroups=o}get visible(){if(l(this,P0))return l(this,$d);if(!l(this,$d))return!1;let{print:e,view:t}=this.usage;return l(this,k0)?t?.viewState!=="OFF":l(this,L0)?e?.printState!=="OFF":!0}_setVisible(e,t,n=!1){e!==Gh&&Vt("Internal method `_setVisible` called."),O(this,P0,n),O(this,$d,t)}};k0=new WeakMap,L0=new WeakMap,P0=new WeakMap,$d=new WeakMap;ES=class{constructor(e,t=es.DISPLAY){z(this,M0);z(this,fu,null);z(this,ur,new Map);z(this,Wd,null);z(this,zd,null);if(this.renderingIntent=t,this.name=null,this.creator=null,e!==null){this.name=e.name,this.creator=e.creator,O(this,zd,e.order);for(let n of e.groups)l(this,ur).set(n.id,new vS(t,n));if(e.baseState==="OFF")for(let n of l(this,ur).values())n._setVisible(Gh,!1);for(let n of e.on)l(this,ur).get(n)._setVisible(Gh,!0);for(let n of e.off)l(this,ur).get(n)._setVisible(Gh,!1);O(this,Wd,this.getHash())}}isVisible(e){if(l(this,ur).size===0)return!0;if(!e)return PE("Optional content group not defined."),!0;if(e.type==="OCG")return l(this,ur).has(e.id)?l(this,ur).get(e.id).visible:(Tt(`Optional content group not found: ${e.id}`),!0);if(e.type==="OCMD"){if(e.expression)return X(this,M0,_S).call(this,e.expression);if(!e.policy||e.policy==="AnyOn"){for(let t of e.ids){if(!l(this,ur).has(t))return Tt(`Optional content group not found: ${t}`),!0;if(l(this,ur).get(t).visible)return!0}return!1}else if(e.policy==="AllOn"){for(let t of e.ids){if(!l(this,ur).has(t))return Tt(`Optional content group not found: ${t}`),!0;if(!l(this,ur).get(t).visible)return!1}return!0}else if(e.policy==="AnyOff"){for(let t of e.ids){if(!l(this,ur).has(t))return Tt(`Optional content group not found: ${t}`),!0;if(!l(this,ur).get(t).visible)return!0}return!1}else if(e.policy==="AllOff"){for(let t of e.ids){if(!l(this,ur).has(t))return Tt(`Optional content group not found: ${t}`),!0;if(l(this,ur).get(t).visible)return!1}return!0}return Tt(`Unknown optional content policy ${e.policy}.`),!0}return Tt(`Unknown group type ${e.type}.`),!0}setVisibility(e,t=!0,n=!0){let i=l(this,ur).get(e);if(!i){Tt(`Optional content group not found: ${e}`);return}if(n&&t&&i.rbGroups.length)for(let o of i.rbGroups)for(let s of o)s!==e&&l(this,ur).get(s)?._setVisible(Gh,!1,!0);i._setVisible(Gh,!!t,!0),O(this,fu,null)}setOCGState({state:e,preserveRB:t}){let n;for(let i of e){switch(i){case"ON":case"OFF":case"Toggle":n=i;continue}let o=l(this,ur).get(i);if(o)switch(n){case"ON":this.setVisibility(i,!0,t);break;case"OFF":this.setVisibility(i,!1,t);break;case"Toggle":this.setVisibility(i,!o.visible,t);break}}O(this,fu,null)}get hasInitialVisibility(){return l(this,Wd)===null||this.getHash()===l(this,Wd)}getOrder(){return l(this,ur).size?l(this,zd)?l(this,zd).slice():[...l(this,ur).keys()]:null}getGroup(e){return l(this,ur).get(e)||null}getHash(){if(l(this,fu)!==null)return l(this,fu);let e=new Fv;for(let[t,n]of l(this,ur))e.update(`${t}:${n.visible}`);return O(this,fu,e.hexdigest())}[Symbol.iterator](){return l(this,ur).entries()}};fu=new WeakMap,ur=new WeakMap,Wd=new WeakMap,zd=new WeakMap,M0=new WeakSet,_S=function(e){let t=e.length;if(t<2)return!0;let n=e[0];for(let i=1;i<t;i++){let o=e[i],s;if(Array.isArray(o))s=X(this,M0,_S).call(this,o);else if(l(this,ur).has(o))s=l(this,ur).get(o).visible;else return Tt(`Optional content group not found: ${o}`),!0;switch(n){case"And":if(!s)return!1;break;case"Or":if(s)return!0;break;case"Not":return!s;default:return!0}}return n==="And"};Pp=class{constructor(e,t,n){z(this,B0,null);z(this,F0,null);ze(this,"_fullReader",null);ze(this,"_rangeReaders",new Set);ze(this,"_source",null);this._source=e,O(this,B0,t),O(this,F0,n)}get _progressiveDataLength(){return this._fullReader?._loaded??0}getFullReader(){return zt(!this._fullReader,"BasePDFStream.getFullReader can only be called once."),this._fullReader=new(l(this,B0))(this)}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;let n=new(l(this,F0))(this,e,t);return this._rangeReaders.add(n),n}cancelAllRequests(e){this._fullReader?.cancel(e);for(let t of new Set(this._rangeReaders))t.cancel(e)}};B0=new WeakMap,F0=new WeakMap;Mp=class{constructor(e){ze(this,"onProgress",null);ze(this,"_contentLength",0);ze(this,"_filename",null);ze(this,"_headersCapability",Promise.withResolvers());ze(this,"_isRangeSupported",!1);ze(this,"_isStreamingSupported",!1);ze(this,"_loaded",0);ze(this,"_stream",null);this._stream=e}_callOnProgress(){this.onProgress?.({loaded:this._loaded,total:this._contentLength})}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){Vt("Abstract method `read` called")}cancel(e){Vt("Abstract method `cancel` called")}},Bp=class{constructor(e,t,n){ze(this,"_stream",null);this._stream=e}async read(){Vt("Abstract method `read` called")}cancel(e){Vt("Abstract method `cancel` called")}};AS=class extends Pp{constructor(t){super(t,SS,TS);z(this,U0);ze(this,"_progressiveDone",!1);ze(this,"_queuedChunks",[]);let{pdfDataRangeTransport:n}=t,{initialData:i,progressiveDone:o}=n;if(i?.length>0){let s=lF(i);this._queuedChunks.push(s)}this._progressiveDone=o,n.addRangeListener((s,a)=>{X(this,U0,xS).call(this,s,a)}),n.addProgressiveReadListener(s=>{X(this,U0,xS).call(this,void 0,s)}),n.addProgressiveDoneListener(()=>{this._fullReader?.progressiveDone(),this._progressiveDone=!0}),n.transportReady()}getFullReader(){let t=super.getFullReader();return this._queuedChunks=null,t}getRangeReader(t,n){let i=super.getRangeReader(t,n);return i&&(i.onDone=()=>this._rangeReaders.delete(i),this._source.pdfDataRangeTransport.requestDataRange(t,n)),i}cancelAllRequests(t){super.cancelAllRequests(t),this._source.pdfDataRangeTransport.abort()}};U0=new WeakSet,xS=function(t,n){let i=lF(n);if(t===void 0)this._fullReader?this._fullReader._enqueue(i):this._queuedChunks.push(i);else{let o=this._rangeReaders.keys().find(s=>s._begin===t);zt(o,"#onReceiveData - no `PDFDataTransportStreamRangeReader` instance found."),o._enqueue(i)}};SS=class extends Mp{constructor(t){super(t);z(this,j0,UE.bind(this));ze(this,"_done",!1);ze(this,"_queuedChunks",null);ze(this,"_requests",[]);let{pdfDataRangeTransport:n,disableRange:i,disableStream:o}=t._source,{length:s,contentDispositionFilename:a}=n;this._queuedChunks=t._queuedChunks||[];for(let c of this._queuedChunks)this._loaded+=c.byteLength;this._done=t._progressiveDone,this._contentLength=s,this._isStreamingSupported=!o,this._isRangeSupported=!i,FE(a)&&(this._filename=a),this._headersCapability.resolve();let u=this._loaded;Promise.resolve().then(()=>{u>0&&this._loaded===u&&this._callOnProgress()})}_enqueue(t){this._done||(this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunks.push(t),this._loaded+=t.byteLength,this._callOnProgress())}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};let t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0,l(this,j0).call(this)}progressiveDone(){this._done||(this._done=!0),this._queuedChunks.length===0&&l(this,j0).call(this)}};j0=new WeakMap;TS=class extends Bp{constructor(t,n,i){super(t,n,i);z(this,$0,UE.bind(this));ze(this,"onDone",null);ze(this,"_begin",-1);ze(this,"_done",!1);ze(this,"_queuedChunk",null);ze(this,"_requests",[]);this._begin=n}_enqueue(t){this._done||(this._requests.length===0?this._queuedChunk=t:(this._requests.shift().resolve({value:t,done:!1}),l(this,$0).call(this)),this._done=!0,this.onDone?.())}async read(){if(this._queuedChunk){let n=this._queuedChunk;return this._queuedChunk=null,{value:n,done:!1}}if(this._done)return{value:void 0,done:!0};let t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0,l(this,$0).call(this),this.onDone?.()}};$0=new WeakMap;CS=class extends Pp{constructor(t){super(t,RS,DS);ze(this,"_responseOrigin",null);let{httpHeaders:n,url:i}=t;zt(/https?:/.test(i.protocol),"PDFFetchStream only supports http(s):// URLs."),this.headers=o3(!0,n)}},RS=class extends Mp{constructor(t){super(t);ze(this,"_abortController",new AbortController);ze(this,"_reader",null);let{disableRange:n,disableStream:i,length:o,rangeChunkSize:s,url:a,withCredentials:u}=t._source;this._contentLength=o,this._isStreamingSupported=!i,this._isRangeSupported=!n;let c=new Headers(t.headers);c3(a,c,u,this._abortController).then(f=>{t._responseOrigin=jE(f.url),f3(f.status,a),this._reader=f.body.getReader();let h=f.headers,{allowRangeRequests:d,suggestedLength:m}=a3({responseHeaders:h,isHttp:!0,rangeChunkSize:s,disableRange:n});this._isRangeSupported=d,this._contentLength=m||this._contentLength,this._filename=l3(h),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new so("Streaming is disabled.")),this._headersCapability.resolve()}).catch(this._headersCapability.reject)}async read(){await this._headersCapability.promise;let{value:t,done:n}=await this._reader.read();return n?{value:t,done:n}:(this._loaded+=t.byteLength,this._callOnProgress(),{value:WE(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}},DS=class extends Bp{constructor(t,n,i){super(t,n,i);ze(this,"_abortController",new AbortController);ze(this,"_readCapability",Promise.withResolvers());ze(this,"_reader",null);let{url:o,withCredentials:s}=t._source,a=new Headers(t.headers);a.append("Range",`bytes=${n}-${i-1}`),c3(o,a,s,this._abortController).then(u=>{let c=jE(u.url);u3(c,t._responseOrigin),f3(u.status,o),this._reader=u.body.getReader(),this._readCapability.resolve()}).catch(this._readCapability.reject)}async read(){await this._readCapability.promise;let{value:t,done:n}=await this._reader.read();return n?{value:t,done:n}:{value:WE(t),done:!1}}cancel(t){this._reader?.cancel(t),this._abortController.abort()}},px=200,uF=206;IS=class extends Pp{constructor(t){super(t,NS,OS);z(this,jp);z(this,jo,new WeakMap);ze(this,"_responseOrigin",null);let{httpHeaders:n,url:i}=t;this.url=i,this.isHttp=/https?:/.test(i.protocol),this.headers=o3(this.isHttp,n)}_request(t){let n=new XMLHttpRequest,i={validateStatus:null,onHeadersReceived:t.onHeadersReceived,onDone:t.onDone,onError:t.onError,onProgress:t.onProgress};l(this,jo).set(n,i),n.open("GET",this.url),n.withCredentials=this._source.withCredentials;for(let[o,s]of this.headers)n.setRequestHeader(o,s);return this.isHttp&&"begin"in t&&"end"in t?(n.setRequestHeader("Range",`bytes=${t.begin}-${t.end-1}`),i.validateStatus=o=>o===uF||o===px):i.validateStatus=o=>o===px,n.responseType="arraybuffer",zt(t.onError,"Expected `onError` callback to be provided."),n.onerror=()=>t.onError(n.status),n.onreadystatechange=X(this,jp,d3).bind(this,n),n.onprogress=X(this,jp,h3).bind(this,n),n.send(null),n}_abortRequest(t){l(this,jo).has(t)&&(l(this,jo).delete(t),t.abort())}getRangeReader(t,n){let i=super.getRangeReader(t,n);return i&&(i.onClosed=()=>this._rangeReaders.delete(i)),i}};jo=new WeakMap,jp=new WeakSet,h3=function(t,n){l(this,jo).get(t)?.onProgress?.(n)},d3=function(t,n){let i=l(this,jo).get(t);if(!i||(t.readyState>=2&&i.onHeadersReceived&&(i.onHeadersReceived(),delete i.onHeadersReceived),t.readyState!==4)||!l(this,jo).has(t))return;if(l(this,jo).delete(t),t.status===0&&this.isHttp){i.onError(t.status);return}let o=t.status||px;if(!i.validateStatus(o)){i.onError(t.status);return}let s=nY(t.response);if(o===uF){let a=t.getResponseHeader("Content-Range");/bytes (\d+)-(\d+)\/(\d+)/.test(a)?i.onDone(s):(Tt('Missing or invalid "Content-Range" header.'),i.onError(0))}else s?i.onDone(s):i.onError(t.status)};NS=class extends Mp{constructor(t){super(t);z(this,Jo);z(this,W0,UE.bind(this));ze(this,"_cachedChunks",[]);ze(this,"_done",!1);ze(this,"_requests",[]);ze(this,"_storedError",null);let{length:n}=t._source;this._contentLength=n,this._fullRequestXhr=t._request({onHeadersReceived:X(this,Jo,p3).bind(this),onDone:X(this,Jo,g3).bind(this),onError:X(this,Jo,m3).bind(this),onProgress:X(this,Jo,y3).bind(this)})}async read(){if(await this._headersCapability.promise,this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};let t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0,this._headersCapability.reject(t),l(this,W0).call(this),this._stream._abortRequest(this._fullRequestXhr),this._fullRequestXhr=null}};W0=new WeakMap,Jo=new WeakSet,p3=function(){let t=this._stream,{disableRange:n,rangeChunkSize:i}=t._source,o=this._fullRequestXhr;t._responseOrigin=jE(o.responseURL);let s=o.getAllResponseHeaders(),a=new Headers(s?s.trimStart().replace(/[^\S ]+$/,"").split(/[\r\n]+/).map(f=>{let[h,...d]=f.split(": ");return[h,d.join(": ")]}):[]),{allowRangeRequests:u,suggestedLength:c}=a3({responseHeaders:a,isHttp:t.isHttp,rangeChunkSize:i,disableRange:n});u&&(this._isRangeSupported=!0),this._contentLength=c||this._contentLength,this._filename=l3(a),this._isRangeSupported&&t._abortRequest(o),this._headersCapability.resolve()},g3=function(t){this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._cachedChunks.push(t),this._done=!0,this._cachedChunks.length===0&&l(this,W0).call(this)},m3=function(t){this._storedError=$E(t,this._stream.url),this._headersCapability.reject(this._storedError);for(let n of this._requests)n.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0},y3=function(t){this.onProgress?.({loaded:t.loaded,total:t.lengthComputable?t.total:this._contentLength})};OS=class extends Bp{constructor(t,n,i){super(t,n,i);z(this,ml);z(this,z0,UE.bind(this));ze(this,"onClosed",null);ze(this,"_done",!1);ze(this,"_queuedChunk",null);ze(this,"_requests",[]);ze(this,"_storedError",null);this._requestXhr=t._request({begin:n,end:i,onHeadersReceived:X(this,ml,b3).bind(this),onDone:X(this,ml,w3).bind(this),onError:X(this,ml,kS).bind(this),onProgress:null})}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){let n=this._queuedChunk;return this._queuedChunk=null,{value:n,done:!1}}if(this._done)return{value:void 0,done:!0};let t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0,l(this,z0).call(this),this._stream._abortRequest(this._requestXhr),this.onClosed?.()}};z0=new WeakMap,ml=new WeakSet,b3=function(){let t=jE(this._requestXhr?.responseURL);try{u3(t,this._stream._responseOrigin)}catch(n){this._storedError=n,X(this,ml,kS).call(this,0)}},w3=function(t){this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunk=t,this._done=!0,l(this,z0).call(this),this.onClosed?.()},kS=function(t){this._storedError??(this._storedError=$E(t,this._stream.url));for(let n of this._requests)n.reject(this._storedError);this._requests.length=0,this._queuedChunk=null};LS=class extends Pp{constructor(e){super(e,PS,MS);let{url:t}=e;zt(t.protocol==="file:","PDFNodeStream only supports file:// URLs.")}},PS=class extends Mp{constructor(t){super(t);ze(this,"_reader",null);let{disableRange:n,disableStream:i,length:o,rangeChunkSize:s,url:a}=t._source;this._contentLength=o,this._isStreamingSupported=!i,this._isRangeSupported=!n;let u=We.getBuiltinModule("fs");u.promises.lstat(a).then(c=>{let f=u.createReadStream(a),h=v3(f);this._reader=h.getReader();let{size:d}=c;d<=2*s&&(this._isRangeSupported=!1),this._contentLength=d,!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new so("Streaming is disabled.")),this._headersCapability.resolve()}).catch(c=>{c.code==="ENOENT"&&(c=$E(0,a)),this._headersCapability.reject(c)})}async read(){await this._headersCapability.promise;let{value:t,done:n}=await this._reader.read();return n?{value:t,done:n}:(this._loaded+=t.byteLength,this._callOnProgress(),{value:WE(t),done:!1})}cancel(t){this._reader?.cancel(t)}},MS=class extends Bp{constructor(t,n,i){super(t,n,i);ze(this,"_readCapability",Promise.withResolvers());ze(this,"_reader",null);let{url:o}=t._source,s=We.getBuiltinModule("fs");try{let a=s.createReadStream(o,{start:n,end:i-1}),u=v3(a);this._reader=u.getReader(),this._readCapability.resolve()}catch(a){this._readCapability.reject(a)}}async read(){await this._readCapability.promise;let{value:t,done:n}=await this._reader.read();return n?{value:t,done:n}:{value:WE(t),done:!1}}cancel(t){this._reader?.cancel(t)}},hm=Symbol("INITIAL_DATA"),iY=()=>({...Promise.withResolvers(),data:hm}),Jv=class{constructor(){z(this,H0);z(this,Ks,new Map)}get(e,t=null){if(t){let i=X(this,H0,BS).call(this,e);return i.promise.then(()=>t(i.data)),null}let n=l(this,Ks).get(e);if(!n||n.data===hm)throw new Error(`Requesting object that isn't resolved yet ${e}.`);return n.data}has(e){let t=l(this,Ks).get(e);return!!t&&t.data!==hm}delete(e){let t=l(this,Ks).get(e);return!t||t.data===hm?!1:(l(this,Ks).delete(e),!0)}resolve(e,t=null){let n=X(this,H0,BS).call(this,e);n.data=t,n.resolve()}clear(){for(let{data:e}of l(this,Ks).values())e?.bitmap?.close();l(this,Ks).clear()}*[Symbol.iterator](){for(let[e,{data:t}]of l(this,Ks))t!==hm&&(yield[e,t])}};Ks=new WeakMap,H0=new WeakSet,BS=function(e){return l(this,Ks).getOrInsertComputed(e,iY)};sY=1e5,cF=30,Cn=class Cn{constructor({textContentSource:e,container:t,viewport:n}){z(this,yl);z(this,hu,Promise.withResolvers());z(this,Ai,null);z(this,q0,!1);z(this,G0,!!globalThis.FontInspector?.enabled);z(this,sf,null);z(this,Ga,null);z(this,V0,0);z(this,Y0,0);z(this,of,null);z(this,X0,null);z(this,Hd,0);z(this,du,0);z(this,qd,Object.create(null));z(this,K0,[]);z(this,Gd,null);z(this,af,[]);z(this,Z0,new WeakMap);z(this,J0,null);var u;if(e instanceof ReadableStream)O(this,Gd,e);else if(typeof e=="object")O(this,Gd,new ReadableStream({start(c){c.enqueue(e),c.close()}}));else throw new Error('No "textContentSource" parameter specified.');O(this,Ai,O(this,X0,t)),O(this,du,n.scale*Zo.pixelRatio),O(this,Hd,n.rotation),O(this,Ga,{div:null,properties:null,ctx:null});let{pageWidth:i,pageHeight:o,pageX:s,pageY:a}=n.rawDims;O(this,J0,[1,0,0,-1,-s,a+o]),O(this,Y0,i),O(this,V0,o),X(u=Cn,is,A3).call(u),t.style.setProperty("--min-font-size",l(Cn,Yd)),Lu(t,n),l(this,hu).promise.finally(()=>{l(Cn,Xd).delete(this),O(this,Ga,null),O(this,qd,null)}).catch(()=>{})}static get fontFamilyMap(){let{isWindows:e,isFirefox:t}=$r.platform;return Et(this,"fontFamilyMap",new Map([["sans-serif",`${e&&t?"Calibri, ":""}sans-serif`],["monospace",`${e&&t?"Lucida Console, ":""}monospace`]]))}render(){let e=()=>{l(this,of).read().then(({value:t,done:n})=>{if(n){l(this,hu).resolve();return}l(this,sf)??O(this,sf,t.lang),Object.assign(l(this,qd),t.styles),X(this,yl,E3).call(this,t.items),e()},l(this,hu).reject)};return O(this,of,l(this,Gd).getReader()),l(Cn,Xd).add(this),e(),l(this,hu).promise}update({viewport:e,onBefore:t=null}){var o;let n=e.scale*Zo.pixelRatio,i=e.rotation;if(i!==l(this,Hd)&&(t?.(),O(this,Hd,i),Lu(l(this,X0),{rotation:i})),n!==l(this,du)){t?.(),O(this,du,n);let s={div:null,properties:null,ctx:X(o=Cn,is,lv).call(o,l(this,sf))};for(let a of l(this,af))s.properties=l(this,Z0).get(a),s.div=a,X(this,yl,FS).call(this,s)}}cancel(){let e=new so("TextLayer task cancelled.");l(this,of)?.cancel(e).catch(()=>{}),O(this,of,null),l(this,hu).reject(e)}get textDivs(){return l(this,af)}get textContentItemsStr(){return l(this,K0)}static cleanup(){if(!(l(this,Xd).size>0)){l(this,Vd).clear();for(let{canvas:e}of l(this,lf).values())e.remove();l(this,lf).clear()}}};hu=new WeakMap,Ai=new WeakMap,q0=new WeakMap,G0=new WeakMap,sf=new WeakMap,Ga=new WeakMap,V0=new WeakMap,Y0=new WeakMap,of=new WeakMap,X0=new WeakMap,Hd=new WeakMap,du=new WeakMap,qd=new WeakMap,K0=new WeakMap,Gd=new WeakMap,af=new WeakMap,Z0=new WeakMap,J0=new WeakMap,Vd=new WeakMap,lf=new WeakMap,Q0=new WeakMap,Yd=new WeakMap,Xd=new WeakMap,yl=new WeakSet,E3=function(e){var i,o;if(l(this,q0))return;(o=l(this,Ga)).ctx??(o.ctx=X(i=Cn,is,lv).call(i,l(this,sf)));let t=l(this,af),n=l(this,K0);for(let s of e){if(t.length>sY){Tt("Ignoring additional textDivs for performance reasons."),O(this,q0,!0);return}if(s.str===void 0){if(s.type==="beginMarkedContentProps"||s.type==="beginMarkedContent"){let a=l(this,Ai);O(this,Ai,document.createElement("span")),l(this,Ai).classList.add("markedContent"),s.id&&l(this,Ai).setAttribute("id",`${s.id}`),s.tag==="Artifact"&&(l(this,Ai).ariaHidden=!0),a.append(l(this,Ai))}else s.type==="endMarkedContent"&&O(this,Ai,l(this,Ai).parentNode);continue}n.push(s.str),X(this,yl,_3).call(this,s)}},_3=function(e){var y;let t=document.createElement("span"),n={angle:0,canvasWidth:0,hasText:e.str!=="",hasEOL:e.hasEOL,fontSize:0};l(this,af).push(t);let i=at.transform(l(this,J0),e.transform),o=Math.atan2(i[1],i[0]),s=l(this,qd)[e.fontName];s.vertical&&(o+=Math.PI/2);let a=l(this,G0)&&s.fontSubstitution||s.fontFamily;a=Cn.fontFamilyMap.get(a)||a;let u=Math.hypot(i[2],i[3]),c=u*X(y=Cn,is,x3).call(y,a,s,l(this,sf)),f,h;o===0?(f=i[4],h=i[5]-c):(f=i[4]+c*Math.sin(o),h=i[5]-c*Math.cos(o));let d=t.style;d.left=`${(100*f/l(this,Y0)).toFixed(2)}%`,d.top=`${(100*h/l(this,V0)).toFixed(2)}%`,d.setProperty("--font-height",`${u.toFixed(2)}px`),d.fontFamily=a,n.fontSize=u,t.setAttribute("role","presentation"),t.textContent=e.str,t.dir=e.dir,l(this,G0)&&(t.dataset.fontName=s.fontSubstitutionLoadedName||e.fontName),o!==0&&(n.angle=o*(180/Math.PI));let m=!1;if(e.str.length>1)m=!0;else if(e.str!==" "&&e.transform[0]!==e.transform[3]){let v=Math.abs(e.transform[0]),w=Math.abs(e.transform[3]);v!==w&&Math.max(v,w)/Math.min(v,w)>1.5&&(m=!0)}if(m&&(n.canvasWidth=s.vertical?e.height:e.width),l(this,Z0).set(t,n),l(this,Ga).div=t,l(this,Ga).properties=n,X(this,yl,FS).call(this,l(this,Ga)),n.hasText&&l(this,Ai).append(t),n.hasEOL){let v=document.createElement("br");v.setAttribute("role","presentation"),l(this,Ai).append(v)}},FS=function(e){var s;let{div:t,properties:n,ctx:i}=e,{style:o}=t;if(n.canvasWidth!==0&&n.hasText){let{fontFamily:a}=o,{canvasWidth:u,fontSize:c}=n;X(s=Cn,is,US).call(s,i,c*l(this,du),a);let{width:f}=i.measureText(t.textContent);f>0&&o.setProperty("--scale-x",u*l(this,du)/f)}n.angle!==0&&o.setProperty("--rotate",`${n.angle}deg`)},is=new WeakSet,lv=function(e=null){let t=l(this,lf).get(e||(e=""));if(!t){let n=document.createElement("canvas");n.className="hiddenCanvasElement",n.lang=e,document.body.append(n),t=n.getContext("2d",{alpha:!1,willReadFrequently:!0}),l(this,lf).set(e,t),l(this,Q0).set(t,{size:0,family:""})}return t},US=function(e,t,n){let i=l(this,Q0).get(e);t===i.size&&n===i.family||(e.font=`${t}px ${n}`,i.size=t,i.family=n)},A3=function(){if(l(this,Yd)!==null)return;let e=document.createElement("div");e.style.opacity=0,e.style.lineHeight=1,e.style.fontSize="1px",e.style.position="absolute",e.textContent="X",document.body.append(e),O(this,Yd,e.getBoundingClientRect().height),e.remove()},x3=function(e,t,n){let i=l(this,Vd).get(e);if(i)return i;let o=X(this,is,lv).call(this,n);o.canvas.width=o.canvas.height=cF,X(this,is,US).call(this,o,cF,e);let s=o.measureText(""),a=s.fontBoundingBoxAscent,u=Math.abs(s.fontBoundingBoxDescent);o.canvas.width=o.canvas.height=0;let c=.8;return a?c=a/(a+u):($r.platform.isFirefox&&Tt("Enable the `dom.textMetrics.fontBoundingBox.enabled` preference in `about:config` to improve TextLayer rendering."),t.ascent?c=t.ascent:t.descent&&(c=1+t.descent)),l(this,Vd).set(e,c),c},z(Cn,is),z(Cn,Vd,new Map),z(Cn,lf,new Map),z(Cn,Q0,new WeakMap),z(Cn,Yd,null),z(Cn,Xd,new Set);Fp=Cn,oY=100;SE=class SE{constructor(){ze(this,"_capability",Promise.withResolvers());ze(this,"_transport",null);ze(this,"_worker",null);ze(this,"docId",`d${on(SE,xE)._++}`);ze(this,"destroyed",!1);ze(this,"onPassword",null);ze(this,"onProgress",null)}get promise(){return this._capability.promise}async destroy(){this.destroyed=!0;try{this._worker?.port&&(this._worker._pendingDestroy=!0),await this._transport?.destroy()}catch(e){throw this._worker?.port&&delete this._worker._pendingDestroy,e}this._transport=null,this._worker?.destroy(),this._worker=null}async getData(){return this._transport.getData()}};xE=new WeakMap,z(SE,xE,0);jS=SE,Lm=class{constructor(e,t,n=!1,i=null){z(this,Kd,Promise.withResolvers());z(this,ey,[]);z(this,ty,[]);z(this,ry,[]);this.length=e,this.initialData=t,this.progressiveDone=n,this.contentDispositionFilename=i,Object.defineProperty(this,"onDataProgress",{value:()=>{yF("`PDFDataRangeTransport.prototype.onDataProgress` - method was removed, since loading progress is now reported automatically through the `PDFDataTransportStream` class (and related code).")}})}addRangeListener(e){l(this,ry).push(e)}addProgressiveReadListener(e){l(this,ty).push(e)}addProgressiveDoneListener(e){l(this,ey).push(e)}onDataRange(e,t){for(let n of l(this,ry))n(e,t)}onDataProgressiveRead(e){l(this,Kd).promise.then(()=>{for(let t of l(this,ty))t(e)})}onDataProgressiveDone(){l(this,Kd).promise.then(()=>{for(let e of l(this,ey))e()})}transportReady(){l(this,Kd).resolve()}requestDataRange(e,t){Vt("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}};Kd=new WeakMap,ey=new WeakMap,ty=new WeakMap,ry=new WeakMap;$S=class{constructor(e,t){this._pdfInfo=e,this._transport=t}get pagesMapper(){return this._transport.pagesMapper}get annotationStorage(){return this._transport.annotationStorage}get canvasFactory(){return this._transport.canvasFactory}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return Et(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(e){return this._transport.getPage(e)}getPageIndex(e){return this._transport.getPageIndex(e)}getDestinations(){return this._transport.getDestinations()}getDestination(e){return this._transport.getDestination(e)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getAnnotationsByType(e,t){return this._transport.getAnnotationsByType(e,t)}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:e="display"}={}){let{renderingIntent:t}=this._transport.getRenderingIntent(e);return this._transport.getOptionalContentConfig(t)}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}extractPages(e){return this._transport.extractPages(e)}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(e=!1){return this._transport.startCleanup(e||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(e){return this._transport.cachedPageNumber(e)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}},WS=class{constructor(e,t,n,i,o=!1){z(this,uf);z(this,Va,!1);z(this,Zd,null);this._pageIndex=e,this._pageInfo=t,this._transport=n,this._stats=o?new Lv:null,this._pdfBug=o,this.commonObjs=n.commonObjs,this.objs=new Jv,this._intentStates=new Map,this.destroyed=!1,this.recordedBBoxes=null,O(this,Zd,i)}get pageNumber(){return this._pageIndex+1}set pageNumber(e){this._pageIndex=e-1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:e,rotation:t=this.rotate,offsetX:n=0,offsetY:i=0,dontFlip:o=!1}={}){return new Dm({viewBox:this.view,userUnit:this.userUnit,scale:e,rotation:t,offsetX:n,offsetY:i,dontFlip:o})}getAnnotations({intent:e="display"}={}){let{renderingIntent:t}=this._transport.getRenderingIntent(e);return this._transport.getAnnotations(this._pageIndex,t)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return Et(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:e,canvas:t=e.canvas,viewport:n,intent:i="display",annotationMode:o=ul.ENABLE,transform:s=null,background:a=null,optionalContentConfigPromise:u=null,annotationCanvasMap:c=null,pageColors:f=null,printAnnotationStorage:h=null,isEditing:d=!1,recordOperations:m=!1,operationsFilter:y=null}){this._stats?.time("Overall");let v=this._transport.getRenderingIntent(i,o,h,d),{renderingIntent:w,cacheKey:b}=v;O(this,Va,!1),u||(u=this._transport.getOptionalContentConfig(w));let E=this._intentStates.getOrInsertComputed(b,kv);E.streamReaderCancelTimeout&&(clearTimeout(E.streamReaderCancelTimeout),E.streamReaderCancelTimeout=null);let _=!!(w&es.PRINT);E.displayReadyCapability||(E.displayReadyCapability=Promise.withResolvers(),E.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(v));let S=!!(this._pdfBug&&globalThis.StepperManager?.enabled),A=!this.recordedBBoxes&&(m||S),F=ee=>{if(E.renderTasks.delete(I),A){let K=I.gfx?.dependencyTracker.take();K&&(I.stepper&&I.stepper.setOperatorBBoxes(K,I.gfx.dependencyTracker.takeDebugMetadata()),m&&(this.recordedBBoxes=K))}_&&O(this,Va,!0),X(this,uf,dm).call(this),ee?(I.capability.reject(ee),this._abortOperatorList({intentState:E,reason:ee instanceof Error?ee:new Error(ee)})):I.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),globalThis.Stats?.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},I=new qS({callback:F,params:{canvas:t,canvasContext:e,dependencyTracker:A?new lS(t,E.operatorList.length,S):null,viewport:n,transform:s,background:a},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:c,operatorList:E.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!_,pdfBug:this._pdfBug,pageColors:f,enableHWA:this._transport.enableHWA,operationsFilter:y});(E.renderTasks||(E.renderTasks=new Set)).add(I);let q=I.task;return Promise.all([E.displayReadyCapability.promise,u]).then(([ee,K])=>{if(this.destroyed){F();return}if(this._stats?.time("Rendering"),!(K.renderingIntent&w))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");I.initializeGraphics({transparency:ee,optionalContentConfig:K}),I.operatorListChanged()}).catch(F),q}getOperatorList({intent:e="display",annotationMode:t=ul.ENABLE,printAnnotationStorage:n=null,isEditing:i=!1}={}){function o(){a.operatorList.lastChunk&&(a.opListReadCapability.resolve(a.operatorList),a.renderTasks.delete(u))}let s=this._transport.getRenderingIntent(e,t,n,i,!0),a=this._intentStates.getOrInsertComputed(s.cacheKey,kv),u;return a.opListReadCapability||(u=Object.create(null),u.operatorListChanged=o,a.opListReadCapability=Promise.withResolvers(),(a.renderTasks||(a.renderTasks=new Set)).add(u),a.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(s)),a.opListReadCapability.promise}streamTextContent({includeMarkedContent:e=!1,disableNormalization:t=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageId:l(this,Zd).getPageId(this._pageIndex+1)-1,pageIndex:this._pageIndex,includeMarkedContent:e===!0,disableNormalization:t===!0},{highWaterMark:100,size(i){return i.items.length}})}async getTextContent(e={}){if(this._transport._htmlForXfa)return this.getXfa().then(i=>Cm.textContent(i));let t=this.streamTextContent(e),n={items:[],styles:Object.create(null),lang:null};for await(let i of t)n.lang??(n.lang=i.lang),Object.assign(n.styles,i.styles),n.items.push(...i.items);return n}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;let e=[];for(let t of this._intentStates.values())if(this._abortOperatorList({intentState:t,reason:new Error("Page was destroyed."),force:!0}),!t.opListReadCapability)for(let n of t.renderTasks)e.push(n.completed),n.cancel();return this.objs.clear(),O(this,Va,!1),Promise.all(e)}cleanup(e=!1){O(this,Va,!0);let t=X(this,uf,dm).call(this);return e&&t&&this._stats&&(this._stats=new Lv),t}_startRenderPage(e,t){let n=this._intentStates.get(t);n&&(this._stats?.timeEnd("Page Request"),n.displayReadyCapability?.resolve(e))}_renderPageChunk(e,t){for(let n=0,i=e.length;n<i;n++)t.operatorList.fnArray.push(e.fnArray[n]),t.operatorList.argsArray.push(e.argsArray[n]);t.operatorList.lastChunk=e.lastChunk,t.operatorList.separateAnnots=e.separateAnnots;for(let n of t.renderTasks)n.operatorListChanged();e.lastChunk&&X(this,uf,dm).call(this)}_pumpOperatorList({renderingIntent:e,cacheKey:t,annotationStorageSerializable:n,modifiedIds:i}){let{map:o,transfer:s}=n,u=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageId:l(this,Zd).getPageId(this._pageIndex+1)-1,pageIndex:this._pageIndex,intent:e,cacheKey:t,annotationStorage:o,modifiedIds:i},void 0,s).getReader(),c=this._intentStates.get(t);c.streamReader=u;let f=()=>{u.read().then(({value:h,done:d})=>{if(d){c.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(h,c),f())},h=>{if(c.streamReader=null,!this._transport.destroyed){if(c.operatorList){c.operatorList.lastChunk=!0;for(let d of c.renderTasks)d.operatorListChanged();X(this,uf,dm).call(this)}if(c.displayReadyCapability)c.displayReadyCapability.reject(h);else if(c.opListReadCapability)c.opListReadCapability.reject(h);else throw h}})};f()}_abortOperatorList({intentState:e,reason:t,force:n=!1}){if(e.streamReader){if(e.streamReaderCancelTimeout&&(clearTimeout(e.streamReaderCancelTimeout),e.streamReaderCancelTimeout=null),!n){if(e.renderTasks.size>0)return;if(t instanceof Lp){let i=oY;t.extraDelay>0&&t.extraDelay<1e3&&(i+=t.extraDelay),e.streamReaderCancelTimeout=setTimeout(()=>{e.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:e,reason:t,force:!0})},i);return}}if(e.streamReader.cancel(new so(t.message)).catch(()=>{}),e.streamReader=null,!this._transport.destroyed){for(let[i,o]of this._intentStates)if(o===e){this._intentStates.delete(i);break}this.cleanup()}}}get stats(){return this._stats}};Va=new WeakMap,Zd=new WeakMap,uf=new WeakSet,dm=function(){if(!l(this,Va)||this.destroyed)return!1;for(let{renderTasks:e,operatorList:t}of this._intentStates.values())if(e.size>0||!t.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),O(this,Va,!1),!0};xr=class xr{constructor({name:e=null,port:t=null,verbosity:n=MV()}={}){z(this,ii);z(this,pu,Promise.withResolvers());z(this,Zs,null);z(this,Ya,null);z(this,cf,null);if(this.name=e,this.destroyed=!1,this.verbosity=n,t){if(l(xr,hf).has(t))throw new Error("Cannot use more than one PDFWorker per port.");l(xr,hf).set(t,this),X(this,ii,T3).call(this,t)}else X(this,ii,C3).call(this)}get promise(){return l(this,pu).promise}get port(){return l(this,Ya)}get messageHandler(){return l(this,Zs)}destroy(){this.destroyed=!0,l(this,cf)?.terminate(),O(this,cf,null),l(xr,hf).delete(l(this,Ya)),O(this,Ya,null),l(this,Zs)?.destroy(),O(this,Zs,null)}static create(e){let t=l(this,hf).get(e?.port);if(t){if(t._pendingDestroy)throw new Error("PDFWorker.create - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return t}return new xr(e)}static get workerSrc(){if(Os.workerSrc)return Os.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _setupFakeWorkerGlobal(){return Et(this,"_setupFakeWorkerGlobal",(async()=>l(this,Jd,cv)?l(this,Jd,cv):(await import(this.workerSrc)).WorkerMessageHandler)())}};pu=new WeakMap,Zs=new WeakMap,Ya=new WeakMap,cf=new WeakMap,TE=new WeakMap,ff=new WeakMap,hf=new WeakMap,ii=new WeakSet,uv=function(){l(this,pu).resolve(),l(this,Zs).send("configure",{verbosity:this.verbosity})},T3=function(e){O(this,Ya,e),O(this,Zs,new Rc("main","worker",e)),l(this,Zs).on("ready",()=>{}),X(this,ii,uv).call(this)},C3=function(){if(l(xr,ff)||l(xr,Jd,cv)){X(this,ii,pm).call(this);return}let{workerSrc:e}=xr;try{xr._isSameOrigin(window.location,e)||(e=xr._createCDNWrapper(new URL(e,window.location).href));let t=new Worker(e,{type:"module"}),n=new Rc("main","worker",t),i=()=>{o.abort(),n.destroy(),t.terminate(),this.destroyed?l(this,pu).reject(new Error("Worker was destroyed")):X(this,ii,pm).call(this)},o=new AbortController;t.addEventListener("error",()=>{l(this,cf)||i()},{signal:o.signal}),n.on("test",a=>{if(o.abort(),this.destroyed||!a){i();return}O(this,Zs,n),O(this,Ya,t),O(this,cf,t),X(this,ii,uv).call(this)}),n.on("ready",a=>{if(o.abort(),this.destroyed){i();return}try{s()}catch{X(this,ii,pm).call(this)}});let s=()=>{let a=new Uint8Array;n.send("test",a,[a.buffer])};s();return}catch{PE("The worker has been disabled.")}X(this,ii,pm).call(this)},pm=function(){l(xr,ff)||(Tt("Setting up fake worker."),O(xr,ff,!0)),xr._setupFakeWorkerGlobal.then(e=>{if(this.destroyed){l(this,pu).reject(new Error("Worker was destroyed"));return}let t=new Kx;O(this,Ya,t);let n=`fake${on(xr,TE)._++}`,i=new Rc(n+"_worker",n,t);e.setup(i,t),O(this,Zs,new Rc(n,n+"_worker",t)),X(this,ii,uv).call(this)}).catch(e=>{l(this,pu).reject(new Error(`Setting up fake worker failed: "${e.message}".`))})},Jd=new WeakSet,cv=function(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}},z(xr,Jd),z(xr,TE,0),z(xr,ff,!1),z(xr,hf,new WeakMap),ni&&(O(xr,ff,!0),Os.workerSrc||(Os.workerSrc="./pdf.worker.mjs")),xr._isSameOrigin=(e,t)=>{let n=URL.parse(e);if(!n?.origin||n.origin==="null")return!1;let i=new URL(t,n);return n.origin===i.origin},xr._createCDNWrapper=e=>{let t=`await import("${e}");`;return URL.createObjectURL(new Blob([t],{type:"text/javascript"}))},xr.fromPort=e=>{if(yF("`PDFWorker.fromPort` - please use `PDFWorker.create` instead."),!e?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");return xr.create(e)};Up=xr,zS=class{constructor(e,t,n,i,o,s){z(this,ns);ze(this,"downloadInfoCapability",Promise.withResolvers());z(this,ji,null);z(this,df,new Map);z(this,Xa,null);z(this,xi,new Map);z(this,$o,new Map);z(this,Qd,new Map);z(this,Ka,null);z(this,ep,null);this.messageHandler=e,this.loadingTask=t,O(this,Xa,n),this.commonObjs=new Jv,this.fontLoader=new Hx({ownerDocument:i.ownerDocument,styleElement:i.styleElement}),this.enableHWA=i.enableHWA,this.loadingParams=i.loadingParams,this._params=i,this.canvasFactory=o.canvasFactory,this.filterFactory=o.filterFactory,this.cMapReaderFactory=o.cMapReaderFactory,this.standardFontDataFactory=o.standardFontDataFactory,this.wasmFactory=o.wasmFactory,this.destroyed=!1,this.destroyCapability=null,this.setupMessageHandler(),this.pagesMapper=s,this.pagesMapper.addListener(X(this,ns,R3).bind(this))}get annotationStorage(){return Et(this,"annotationStorage",new Om)}getRenderingIntent(e,t=ul.ENABLE,n=null,i=!1,o=!1){let s=es.DISPLAY,a=Nm;switch(e){case"any":s=es.ANY;break;case"display":break;case"print":s=es.PRINT;break;default:Tt(`getRenderingIntent - invalid intent: ${e}`)}let u=s&es.PRINT&&n instanceof Uv?n:this.annotationStorage;switch(t){case ul.DISABLE:s+=es.ANNOTATIONS_DISABLE;break;case ul.ENABLE:break;case ul.ENABLE_FORMS:s+=es.ANNOTATIONS_FORMS;break;case ul.ENABLE_STORAGE:s+=es.ANNOTATIONS_STORAGE,a=u.serializable;break;default:Tt(`getRenderingIntent - invalid annotationMode: ${t}`)}i&&(s+=es.IS_EDITING),o&&(s+=es.OPLIST);let{ids:c,hash:f}=u.modifiedIds,h=[s,a.hash,f];return{renderingIntent:s,cacheKey:h.join("_"),annotationStorageSerializable:a,modifiedIds:c}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),l(this,Ka)?.reject(new Error("Worker was destroyed during onPassword callback"));let e=[];for(let n of l(this,xi).values())e.push(n._destroy());l(this,xi).clear(),l(this,$o).clear(),l(this,Qd).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();let t=this.messageHandler.sendWithPromise("Terminate",null);return e.push(t),Promise.all(e).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),l(this,df).clear(),this.filterFactory.destroy(),Fp.cleanup(),l(this,Xa)?.cancelAllRequests(new so("Worker was terminated.")),this.messageHandler?.destroy(),this.messageHandler=null,this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){let{messageHandler:e,loadingTask:t}=this;e.on("GetReader",(n,i)=>{zt(l(this,Xa),"GetReader - no `BasePDFStream` instance available."),O(this,ji,l(this,Xa).getFullReader()),l(this,ji).onProgress=o=>X(this,ns,fv).call(this,o),i.onPull=()=>{l(this,ji).read().then(function({value:o,done:s}){if(s){i.close();return}zt(o instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),i.enqueue(new Uint8Array(o),1,[o])}).catch(o=>{i.error(o)})},i.onCancel=o=>{l(this,ji).cancel(o),i.ready.catch(s=>{if(!this.destroyed)throw s})}}),e.on("ReaderHeadersReady",async n=>{await l(this,ji).headersReady;let{isStreamingSupported:i,isRangeSupported:o,contentLength:s}=l(this,ji);return i&&o&&(l(this,ji).onProgress=null),{isStreamingSupported:i,isRangeSupported:o,contentLength:s}}),e.on("GetRangeReader",(n,i)=>{zt(l(this,Xa),"GetRangeReader - no `BasePDFStream` instance available.");let o=l(this,Xa).getRangeReader(n.begin,n.end);if(!o){i.close();return}i.onPull=()=>{o.read().then(function({value:s,done:a}){if(a){i.close();return}zt(s instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),i.enqueue(new Uint8Array(s),1,[s])}).catch(s=>{i.error(s)})},i.onCancel=s=>{o.cancel(s),i.ready.catch(a=>{if(!this.destroyed)throw a})}}),e.on("GetDoc",({pdfInfo:n})=>{this.pagesMapper.pagesNumber=n.numPages,this._numPages=n.numPages,this._htmlForXfa=n.htmlForXfa,delete n.htmlForXfa,t._capability.resolve(new $S(n,this))}),e.on("DocException",n=>{t._capability.reject(yi(n))}),e.on("PasswordRequest",n=>{O(this,Ka,Promise.withResolvers());try{if(!t.onPassword)throw yi(n);let i=o=>{o instanceof Error?l(this,Ka).reject(o):l(this,Ka).resolve({password:o})};t.onPassword(i,n.code)}catch(i){l(this,Ka).reject(i)}return l(this,Ka).promise}),e.on("DataLoaded",n=>{X(this,ns,fv).call(this,{loaded:n.length,total:n.length}),this.downloadInfoCapability.resolve(n)}),e.on("StartRenderPage",n=>{if(this.destroyed)return;l(this,xi).get(n.pageIndex)._startRenderPage(n.transparency,n.cacheKey)}),e.on("commonobj",([n,i,o])=>{if(this.destroyed||this.commonObjs.has(n))return null;switch(i){case"Font":if("error"in o){let h=o.error;Tt(`Error during font loading: ${h}`),this.commonObjs.resolve(n,h);break}let s=new Gx(o),a=this._params.pdfBug&&globalThis.FontInspector?.enabled?(h,d)=>globalThis.FontInspector.fontAdded(h,d):null,u=new qx(s,a,o.extra,o.charProcOperatorList);this.fontLoader.bind(u).catch(()=>e.sendWithPromise("FontFallback",{id:n})).finally(()=>{!u.fontExtraProperties&&u.data&&u.clearData(),this.commonObjs.resolve(n,u)});break;case"CopyLocalImage":let{imageRef:c}=o;zt(c,"The imageRef must be defined.");for(let h of l(this,xi).values())for(let[,d]of h.objs)if(d?.ref===c)return d.dataLen?(this.commonObjs.resolve(n,structuredClone(d)),d.dataLen):null;break;case"FontPath":this.commonObjs.resolve(n,new Yx(o));break;case"Image":this.commonObjs.resolve(n,o);break;case"Pattern":let f=new Vx(o);this.commonObjs.resolve(n,f.getIR());break;default:throw new Error(`Got unknown common object type ${i}`)}return null}),e.on("obj",([n,i,o,s])=>{if(this.destroyed)return;let a=l(this,xi).get(i);if(!a.objs.has(n)){if(a._intentStates.size===0){s?.bitmap?.close();return}switch(o){case"Image":case"Pattern":a.objs.resolve(n,s);break;default:throw new Error(`Got unknown object type ${o}`)}}}),e.on("DocProgress",n=>{this.destroyed||X(this,ns,fv).call(this,n)}),e.on("FetchBinaryData",async n=>{if(this.destroyed)throw new Error("Worker was destroyed.");let i=this[n.type];if(!i)throw new Error(`${n.type} not initialized, see the \`useWorkerFetch\` parameter.`);return i.fetch(n)})}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&Tt("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");let{map:e,transfer:t}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:e,filename:l(this,ji)?.filename??null},t).finally(()=>{this.annotationStorage.resetModified()})}extractPages(e){return this.messageHandler.sendWithPromise("ExtractPages",{pageInfos:e})}getPage(e){if(!Number.isInteger(e)||e<=0||e>this.pagesMapper.pagesNumber)return Promise.reject(new Error("Invalid page request."));let t=e-1,n=this.pagesMapper.getPageId(e)-1,i=l(this,$o).get(t);if(i)return i;let o=this.messageHandler.sendWithPromise("GetPage",{pageIndex:n}).then(s=>{if(this.destroyed)throw new Error("Transport destroyed");s.refStr&&l(this,Qd).set(s.refStr,n);let a=new WS(t,s,this,this.pagesMapper,this._params.pdfBug);return l(this,xi).set(t,a),a});return l(this,$o).set(t,o),o}async getPageIndex(e){if(!Xx(e))throw new Error("Invalid pageIndex request.");let t=await this.messageHandler.sendWithPromise("GetPageIndex",{num:e.num,gen:e.gen}),n=this.pagesMapper.getPageNumber(t+1);if(n===0)throw new Error("GetPageIndex: page has been removed.");return n-1}getAnnotations(e,t){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:this.pagesMapper.getPageId(e+1)-1,intent:t})}getFieldObjects(){return X(this,ns,gm).call(this,"GetFieldObjects")}hasJSActions(){return X(this,ns,gm).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(e){return typeof e!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:e})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getAnnotationsByType(e,t){return this.messageHandler.sendWithPromise("GetAnnotationsByType",{types:e,pageIndexesToSkip:t})}getDocJSActions(){return X(this,ns,gm).call(this,"GetDocJSActions")}getPageJSActions(e){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:this.pagesMapper.getPageId(e+1)-1})}getStructTree(e){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:this.pagesMapper.getPageId(e+1)-1})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(e){return X(this,ns,gm).call(this,"GetOptionalContentConfig").then(t=>new ES(t,e))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){let e="GetMetadata";return l(this,df).getOrInsertComputed(e,()=>this.messageHandler.sendWithPromise(e,null).then(t=>({info:t[0],metadata:t[1]?new wS(t[1]):null,contentDispositionFilename:l(this,ji)?.filename??null,contentLength:l(this,ji)?.contentLength??null,hasStructTree:t[2]})))}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(e=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(let t of l(this,xi).values())if(!t.cleanup())throw new Error(`startCleanup: Page ${t.pageNumber} is currently rendering.`);this.commonObjs.clear(),e||this.fontLoader.clear(),l(this,df).clear(),this.filterFactory.destroy(!0),Fp.cleanup()}}cachedPageNumber(e){if(!Xx(e))return null;let t=e.gen===0?`${e.num}R`:`${e.num}R${e.gen}`,n=l(this,Qd).get(t);if(n>=0){let i=this.pagesMapper.getPageNumber(n+1);if(i!==0)return i}return null}};ji=new WeakMap,df=new WeakMap,Xa=new WeakMap,xi=new WeakMap,$o=new WeakMap,Qd=new WeakMap,Ka=new WeakMap,ep=new WeakMap,ns=new WeakSet,R3=function({type:e,pageNumbers:t}){if(e==="copy"){O(this,ep,new Map);for(let s of t)l(this,ep).set(s,{proxy:l(this,xi).get(s-1)||null,promise:l(this,$o).get(s-1)||null});return}if(e==="delete")for(let s of t)l(this,xi).delete(s-1),l(this,$o).delete(s-1);let n=new Map,i=new Map,{pagesMapper:o}=this;for(let s=0,a=o.pagesNumber;s<a;s++){let u=o.getPrevPageNumber(s+1);if(u<0){let{proxy:d,promise:m}=l(this,ep)?.get(-u)||{};d&&n.set(s,d),m&&i.set(s,m);continue}let c=u-1,f=l(this,xi).get(c);f&&n.set(s,f);let h=l(this,$o).get(c);h&&i.set(s,h)}O(this,xi,n),O(this,$o,i)},gm=function(e,t=null){return l(this,df).getOrInsertComputed(e,()=>this.messageHandler.sendWithPromise(e,t))},fv=function({loaded:e,total:t}){this.loadingTask.onProgress?.({loaded:e,total:t,percent:dn(Math.round(e/t*100),0,100)})};HS=class{constructor(e){ze(this,"_internalRenderTask",null);ze(this,"onContinue",null);ze(this,"onError",null);this._internalRenderTask=e}get promise(){return this._internalRenderTask.capability.promise}cancel(e=0){this._internalRenderTask.cancel(null,e)}get separateAnnots(){let{separateAnnots:e}=this._internalRenderTask.operatorList;if(!e)return!1;let{annotationCanvasMap:t}=this._internalRenderTask;return e.form||e.canvas&&t?.size>0}},Tc=class Tc{constructor({callback:e,params:t,objs:n,commonObjs:i,annotationCanvasMap:o,operatorList:s,pageIndex:a,canvasFactory:u,filterFactory:c,useRequestAnimationFrame:f=!1,pdfBug:h=!1,pageColors:d=null,enableHWA:m=!1,operationsFilter:y=null}){z(this,gu,null);this.callback=e,this.params=t,this.objs=n,this.commonObjs=i,this.annotationCanvasMap=o,this.operatorListIdx=null,this.operatorList=s,this._pageIndex=a,this.canvasFactory=u,this.filterFactory=c,this._pdfBug=h,this.pageColors=d,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=f===!0&&typeof window<"u",this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new HS(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=t.canvas,this._canvasContext=t.canvas?null:t.canvasContext,this._enableHWA=m,this._dependencyTracker=t.dependencyTracker,this._operationsFilter=y}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:e=!1,optionalContentConfig:t}){if(this.cancelled)return;if(this._canvas){if(l(Tc,pf).has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");l(Tc,pf).add(this._canvas)}this._pdfBug&&globalThis.StepperManager?.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());let{viewport:n,transform:i,background:o,dependencyTracker:s}=this.params,a=this._canvasContext||this._canvas.getContext("2d",{alpha:!1,willReadFrequently:!this._enableHWA});this.gfx=new rd(a,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:t},this.annotationCanvasMap,this.pageColors,s),this.gfx.beginDrawing({transform:i,viewport:n,transparency:e,background:o}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(e=null,t=0){this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),l(this,gu)&&(window.cancelAnimationFrame(l(this,gu)),O(this,gu,null)),l(Tc,pf).delete(this._canvas),e||(e=new Lp(`Rendering cancelled, page ${this._pageIndex+1}`,t)),this.callback(e),this.task.onError?.(e)}operatorListChanged(){if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}this.gfx.dependencyTracker?.growOperationsCount(this.operatorList.fnArray.length),this.stepper?.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?O(this,gu,window.requestAnimationFrame(()=>{O(this,gu,null),this._nextBound().catch(this._cancelBound)})):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper,this._operationsFilter),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),l(Tc,pf).delete(this._canvas),this.callback())))}};gu=new WeakMap,pf=new WeakMap,z(Tc,pf,new WeakSet);qS=Tc,D3="5.5.207",I3="527964698",bi=class bi{constructor({editor:e=null,uiManager:t=null}){z(this,cr);z(this,$i,null);z(this,gf,null);z(this,tp);z(this,hn,null);z(this,ny,!1);z(this,rp,!1);z(this,Za,null);z(this,iy);z(this,mu,null);z(this,Js,null);e?(O(this,rp,!1),O(this,Za,e)):O(this,rp,!0),O(this,Js,e?._uiManager||t),O(this,iy,l(this,Js)._eventBus),O(this,tp,e?.color?.toUpperCase()||l(this,Js)?.highlightColors.values().next().value||"#FFFF98"),l(bi,sy)||O(bi,sy,Object.freeze({blue:"pdfjs-editor-colorpicker-blue",green:"pdfjs-editor-colorpicker-green",pink:"pdfjs-editor-colorpicker-pink",red:"pdfjs-editor-colorpicker-red",yellow:"pdfjs-editor-colorpicker-yellow"}))}static get _keyboardManager(){return Et(this,"_keyboardManager",new Hf([[["Escape","mac+Escape"],bi.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],bi.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],bi.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],bi.prototype._moveToPrevious],[["Home","mac+Home"],bi.prototype._moveToBeginning],[["End","mac+End"],bi.prototype._moveToEnd]]))}renderButton(){let e=O(this,$i,document.createElement("button"));e.className="colorPicker",e.tabIndex="0",e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),e.ariaHasPopup="true",l(this,Za)&&(e.ariaControls=`${l(this,Za).id}_colorpicker_dropdown`);let t=l(this,Js)._signal;e.addEventListener("click",X(this,cr,_c).bind(this),{signal:t}),e.addEventListener("keydown",X(this,cr,YS).bind(this),{signal:t});let n=O(this,gf,document.createElement("span"));return n.className="swatch",n.ariaHidden="true",n.style.backgroundColor=l(this,tp),e.append(n),e}renderMainDropdown(){let e=O(this,hn,X(this,cr,GS).call(this));return e.ariaOrientation="horizontal",e.ariaLabelledBy="highlightColorPickerLabel",e}_colorSelectFromKeyboard(e){if(e.target===l(this,$i)){X(this,cr,_c).call(this,e);return}let t=e.target.getAttribute("data-color");t&&X(this,cr,VS).call(this,t,e)}_moveToNext(e){if(!l(this,cr,jl)){X(this,cr,_c).call(this,e);return}if(e.target===l(this,$i)){l(this,hn).firstElementChild?.focus();return}e.target.nextSibling?.focus()}_moveToPrevious(e){if(e.target===l(this,hn)?.firstElementChild||e.target===l(this,$i)){l(this,cr,jl)&&this._hideDropdownFromKeyboard();return}l(this,cr,jl)||X(this,cr,_c).call(this,e),e.target.previousSibling?.focus()}_moveToBeginning(e){if(!l(this,cr,jl)){X(this,cr,_c).call(this,e);return}l(this,hn).firstElementChild?.focus()}_moveToEnd(e){if(!l(this,cr,jl)){X(this,cr,_c).call(this,e);return}l(this,hn).lastElementChild?.focus()}hideDropdown(){l(this,hn)?.classList.add("hidden"),l(this,$i).ariaExpanded="false",l(this,mu)?.abort(),O(this,mu,null)}_hideDropdownFromKeyboard(){if(!l(this,rp)){if(!l(this,cr,jl)){l(this,Za)?.unselect();return}this.hideDropdown(),l(this,$i).focus({preventScroll:!0,focusVisible:l(this,ny)})}}updateColor(e){if(l(this,gf)&&(l(this,gf).style.backgroundColor=e),!l(this,hn))return;let t=l(this,Js).highlightColors.values();for(let n of l(this,hn).children)n.ariaSelected=t.next().value===e.toUpperCase()}destroy(){l(this,$i)?.remove(),O(this,$i,null),O(this,gf,null),l(this,hn)?.remove(),O(this,hn,null)}};$i=new WeakMap,gf=new WeakMap,tp=new WeakMap,hn=new WeakMap,ny=new WeakMap,rp=new WeakMap,Za=new WeakMap,iy=new WeakMap,mu=new WeakMap,Js=new WeakMap,sy=new WeakMap,cr=new WeakSet,GS=function(){let e=document.createElement("div"),t=l(this,Js)._signal;e.addEventListener("contextmenu",ss,{signal:t}),e.className="dropdown",e.role="listbox",e.ariaMultiSelectable="false",e.ariaOrientation="vertical",e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown"),l(this,Za)&&(e.id=`${l(this,Za).id}_colorpicker_dropdown`);for(let[n,i]of l(this,Js).highlightColors){let o=document.createElement("button");o.tabIndex="0",o.role="option",o.setAttribute("data-color",i),o.title=n,o.setAttribute("data-l10n-id",l(bi,sy)[n]);let s=document.createElement("span");o.append(s),s.className="swatch",s.style.backgroundColor=i,o.ariaSelected=i===l(this,tp),o.addEventListener("click",X(this,cr,VS).bind(this,i),{signal:t}),e.append(o)}return e.addEventListener("keydown",X(this,cr,YS).bind(this),{signal:t}),e},VS=function(e,t){t.stopPropagation(),l(this,iy).dispatch("switchannotationeditorparams",{source:this,type:Ft.HIGHLIGHT_COLOR,value:e}),this.updateColor(e)},YS=function(e){bi._keyboardManager.exec(this,e)},_c=function(e){if(l(this,cr,jl)){this.hideDropdown();return}if(O(this,ny,e.detail===0),l(this,mu)||(O(this,mu,new AbortController),window.addEventListener("pointerdown",X(this,cr,N3).bind(this),{signal:l(this,Js).combinedSignal(l(this,mu))})),l(this,$i).ariaExpanded="true",l(this,hn)){l(this,hn).classList.remove("hidden");return}let t=O(this,hn,X(this,cr,GS).call(this));l(this,$i).append(t)},N3=function(e){l(this,hn)?.contains(e.target)||this.hideDropdown()},jl=function(){return l(this,hn)&&!l(this,hn).classList.contains("hidden")},z(bi,sy,null);Pm=bi,Cc=class Cc{constructor(e){z(this,Wo,null);z(this,oy,null);z(this,np,null);O(this,oy,e),O(this,np,e._uiManager),l(Cc,ay)||O(Cc,ay,Object.freeze({freetext:"pdfjs-editor-color-picker-free-text-input",ink:"pdfjs-editor-color-picker-ink-input"}))}renderButton(){if(l(this,Wo))return l(this,Wo);let{editorType:e,colorType:t,color:n}=l(this,oy),i=O(this,Wo,document.createElement("input"));return i.type="color",i.value=n||"#000000",i.className="basicColorPicker",i.tabIndex=0,i.setAttribute("data-l10n-id",l(Cc,ay)[e]),i.addEventListener("input",()=>{l(this,np).updateParams(t,i.value)},{signal:l(this,np)._signal}),i}update(e){l(this,Wo)&&(l(this,Wo).value=e)}destroy(){l(this,Wo)?.remove(),O(this,Wo,null)}hideDropdown(){}};Wo=new WeakMap,oy=new WeakMap,np=new WeakMap,ay=new WeakMap,z(Cc,ay,null);Qv=Cc;eE=class{static CMYK_G([e,t,n,i]){return["G",1-Math.min(1,.3*e+.59*n+.11*t+i)]}static G_CMYK([e]){return["CMYK",0,0,0,1-e]}static G_RGB([e]){return["RGB",e,e,e]}static G_rgb([e]){return e=Zg(e),[e,e,e]}static G_HTML([e]){let t=fF(e);return`#${t}${t}${t}`}static RGB_G([e,t,n]){return["G",.3*e+.59*t+.11*n]}static RGB_rgb(e){return e.map(Zg)}static RGB_HTML(e){return`#${e.map(fF).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([e,t,n,i]){return["RGB",1-Math.min(1,e+i),1-Math.min(1,n+i),1-Math.min(1,t+i)]}static CMYK_rgb([e,t,n,i]){return[Zg(1-Math.min(1,e+i)),Zg(1-Math.min(1,n+i)),Zg(1-Math.min(1,t+i))]}static CMYK_HTML(e){let t=this.CMYK_RGB(e).slice(1);return this.RGB_HTML(t)}static RGB_CMYK([e,t,n]){let i=1-e,o=1-t,s=1-n,a=Math.min(i,o,s);return["CMYK",i,o,s,a]}},XS=class{create(e,t,n=!1){if(e<=0||t<=0)throw new Error("Invalid SVG dimensions");let i=this._createSVG("svg:svg");return i.setAttribute("version","1.1"),n||(i.setAttribute("width",`${e}px`),i.setAttribute("height",`${t}px`)),i.setAttribute("preserveAspectRatio","none"),i.setAttribute("viewBox",`0 0 ${e} ${t}`),i}createElement(e){if(typeof e!="string")throw new Error("Invalid SVG element type");return this._createSVG(e)}_createSVG(e){Vt("Abstract method `_createSVG` called.")}},qf=class extends XS{_createSVG(e){return document.createElementNS(xa,e)}},aY=9,Gf=new WeakSet,lY=new Date().getTimezoneOffset()*60*1e3,Sm=class{static create(e){switch(e.data.annotationType){case Vr.LINK:return new Mm(e);case Vr.TEXT:return new JS(e);case Vr.WIDGET:switch(e.data.fieldType){case"Tx":return new QS(e);case"Btn":return e.data.radioButton?new tE(e):e.data.checkBox?new tT(e):new rT(e);case"Ch":return new nT(e);case"Sig":return new eT(e)}return new pl(e);case Vr.POPUP:return new Bm(e);case Vr.FREETEXT:return new rE(e);case Vr.LINE:return new fT(e);case Vr.SQUARE:return new hT(e);case Vr.CIRCLE:return new dT(e);case Vr.POLYLINE:return new nE(e);case Vr.CARET:return new gT(e);case Vr.INK:return new Fm(e);case Vr.POLYGON:return new pT(e);case Vr.HIGHLIGHT:return new iE(e);case Vr.UNDERLINE:return new yT(e);case Vr.SQUIGGLY:return new bT(e);case Vr.STRIKEOUT:return new wT(e);case Vr.STAMP:return new sE(e);case Vr.FILEATTACHMENT:return new vT(e);default:return new Nr(e)}}},nC=class nC{constructor(e,{isRenderable:t=!1,ignoreBorder:n=!1,createQuadrilaterals:i=!1}={}){z(this,ly);z(this,mf,null);z(this,ip,!1);z(this,Ds,null);this.isRenderable=t,this.data=e.data,this.layer=e.layer,this.linkService=e.linkService,this.downloadManager=e.downloadManager,this.imageResourcesPath=e.imageResourcesPath,this.renderForms=e.renderForms,this.svgFactory=e.svgFactory,this.annotationStorage=e.annotationStorage,this.enableComment=e.enableComment,this.enableScripting=e.enableScripting,this.hasJSActions=e.hasJSActions,this._fieldObjects=e.fieldObjects,this.parent=e.parent,this.hasOwnCommentButton=!1,t&&(this.contentElement=this.container=this._createContainer(n)),i&&this._createQuadrilaterals()}static _hasPopupData({contentsObj:e,richText:t}){return!!(e?.str||t?.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return nC._hasPopupData(this.data)||this.enableComment&&!!this.commentText}get commentData(){let{data:e}=this,t=this.annotationStorage?.getEditor(e.id);return t?t.getData():e}get hasCommentButton(){return this.enableComment&&this.hasPopupElement}get commentButtonPosition(){let e=this.annotationStorage?.getEditor(this.data.id);if(e)return e.commentButtonPositionInPage;let{quadPoints:t,inkLists:n,rect:i}=this.data,o=-1/0,s=-1/0;if(t?.length>=8){for(let a=0;a<t.length;a+=8)t[a+1]>s?(s=t[a+1],o=t[a+2]):t[a+1]===s&&(o=Math.max(o,t[a+2]));return[o,s]}if(n?.length>=1){for(let a of n)for(let u=0,c=a.length;u<c;u+=2)a[u+1]>s?(s=a[u+1],o=a[u]):a[u+1]===s&&(o=Math.max(o,a[u]));if(o!==1/0)return[o,s]}return i?[i[2],i[3]]:null}_normalizePoint(e){let{page:{view:t},viewport:{rawDims:{pageWidth:n,pageHeight:i,pageX:o,pageY:s}}}=this.parent;return e[1]=t[3]-e[1]+t[1],e[0]=100*(e[0]-o)/n,e[1]=100*(e[1]-s)/i,e}get commentText(){let{data:e}=this;return this.annotationStorage.getRawValue(`${Tm}${e.id}`)?.popup?.contents||e.contentsObj?.str||""}set commentText(e){let{data:t}=this,n={deleted:!e,contents:e||""};this.annotationStorage.updateEditor(t.id,{popup:n})||this.annotationStorage.setValue(`${Tm}${t.id}`,{id:t.id,annotationType:t.annotationType,page:this.parent.page,popup:n,popupRef:t.popupRef,modificationDate:new Date}),e||this.removePopup()}removePopup(){(l(this,Ds)?.popup||this.popup)?.remove(),O(this,Ds,this.popup=null)}updateEdited(e){if(!this.container)return;e.rect&&(l(this,mf)||O(this,mf,{rect:this.data.rect.slice(0)}));let{rect:t,popup:n}=e;t&&X(this,ly,KS).call(this,t);let i=l(this,Ds)?.popup||this.popup;!i&&n?.text&&(this._createPopup(n),i=l(this,Ds).popup),i&&(i.updateEdited(e),n?.deleted&&(i.remove(),O(this,Ds,null),this.popup=null))}resetEdited(){l(this,mf)&&(X(this,ly,KS).call(this,l(this,mf).rect),l(this,Ds)?.popup.resetEdited(),O(this,mf,null))}_createContainer(e){let{data:t,parent:{page:n,viewport:i}}=this,o=document.createElement("section");o.setAttribute("data-annotation-id",t.id),!(this instanceof pl)&&!(this instanceof Mm)&&(o.tabIndex=0);let{style:s}=o;if(s.zIndex=this.parent.zIndex,this.parent.zIndex+=2,t.alternativeText&&(o.title=t.alternativeText),t.noRotate&&o.classList.add("norotate"),!t.rect||this instanceof Bm){let{rotation:v}=t;return!t.hasOwnCanvas&&v!==0&&this.setRotation(v,o),o}let{width:a,height:u}=this;if(!e&&t.borderStyle.width>0){s.borderWidth=`${t.borderStyle.width}px`;let v=t.borderStyle.horizontalCornerRadius,w=t.borderStyle.verticalCornerRadius;if(v>0||w>0){let E=`calc(${v}px * var(--total-scale-factor)) / calc(${w}px * var(--total-scale-factor))`;s.borderRadius=E}else if(this instanceof tE){let E=`calc(${a}px * var(--total-scale-factor)) / calc(${u}px * var(--total-scale-factor))`;s.borderRadius=E}switch(t.borderStyle.style){case $h.SOLID:s.borderStyle="solid";break;case $h.DASHED:s.borderStyle="dashed";break;case $h.BEVELED:Tt("Unimplemented border style: beveled");break;case $h.INSET:Tt("Unimplemented border style: inset");break;case $h.UNDERLINE:s.borderBottomStyle="solid";break;default:break}let b=t.borderColor||null;b?(O(this,ip,!0),s.borderColor=at.makeHexColor(b[0]|0,b[1]|0,b[2]|0)):s.borderWidth=0}let c=at.normalizeRect([t.rect[0],n.view[3]-t.rect[1]+n.view[1],t.rect[2],n.view[3]-t.rect[3]+n.view[1]]),{pageWidth:f,pageHeight:h,pageX:d,pageY:m}=i.rawDims;s.left=`${100*(c[0]-d)/f}%`,s.top=`${100*(c[1]-m)/h}%`;let{rotation:y}=t;return t.hasOwnCanvas||y===0?(s.width=`${100*a/f}%`,s.height=`${100*u/h}%`):this.setRotation(y,o),o}setRotation(e,t=this.container){if(!this.data.rect)return;let{pageWidth:n,pageHeight:i}=this.parent.viewport.rawDims,{width:o,height:s}=this;e%180!==0&&([o,s]=[s,o]),t.style.width=`${100*o/n}%`,t.style.height=`${100*s/i}%`,t.setAttribute("data-main-rotation",(360-e)%360)}get _commonActions(){let e=(t,n,i)=>{let o=i.detail[t],s=o[0],a=o.slice(1);i.target.style[n]=eE[`${s}_HTML`](a),this.annotationStorage.setValue(this.data.id,{[n]:eE[`${s}_rgb`](a)})};return Et(this,"_commonActions",{display:t=>{let{display:n}=t.detail,i=n%2===1;this.container.style.visibility=i?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:i,noPrint:n===1||n===2})},print:t=>{this.annotationStorage.setValue(this.data.id,{noPrint:!t.detail.print})},hidden:t=>{let{hidden:n}=t.detail;this.container.style.visibility=n?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:n,noView:n})},focus:t=>{setTimeout(()=>t.target.focus({preventScroll:!1}),0)},userName:t=>{t.target.title=t.detail.userName},readonly:t=>{t.target.disabled=t.detail.readonly},required:t=>{this._setRequired(t.target,t.detail.required)},bgColor:t=>{e("bgColor","backgroundColor",t)},fillColor:t=>{e("fillColor","backgroundColor",t)},fgColor:t=>{e("fgColor","color",t)},textColor:t=>{e("textColor","color",t)},borderColor:t=>{e("borderColor","borderColor",t)},strokeColor:t=>{e("strokeColor","borderColor",t)},rotation:t=>{let n=t.detail.rotation;this.setRotation(n),this.annotationStorage.setValue(this.data.id,{rotation:n})}})}_dispatchEventFromSandbox(e,t){let n=this._commonActions;for(let i of Object.keys(t.detail))(e[i]||n[i])?.(t)}_setDefaultPropertiesFromJS(e){if(!this.enableScripting)return;let t=this.annotationStorage.getRawValue(this.data.id);if(!t)return;let n=this._commonActions;for(let[i,o]of Object.entries(t)){let s=n[i];if(s){let a={detail:{[i]:o},target:e};s(a),delete t[i]}}}_createQuadrilaterals(){if(!this.container)return;let{quadPoints:e}=this.data;if(!e)return;let[t,n,i,o]=this.data.rect.map(v=>Math.fround(v));if(e.length===8){let[v,w,b,E]=e.subarray(2,6);if(i===v&&o===w&&t===b&&n===E)return}let{style:s}=this.container,a;if(l(this,ip)){let{borderColor:v,borderWidth:w}=s;s.borderWidth=0,a=["url('data:image/svg+xml;utf8,",'<svg xmlns="http://www.w3.org/2000/svg"',' preserveAspectRatio="none" viewBox="0 0 1 1">',`<g fill="transparent" stroke="${v}" stroke-width="${w}">`],this.container.classList.add("hasBorder")}let u=i-t,c=o-n,{svgFactory:f}=this,h=f.createElement("svg");h.classList.add("quadrilateralsContainer"),h.setAttribute("width",0),h.setAttribute("height",0),h.role="none";let d=f.createElement("defs");h.append(d);let m=f.createElement("clipPath"),y=`clippath_${this.data.id}`;m.setAttribute("id",y),m.setAttribute("clipPathUnits","objectBoundingBox"),d.append(m);for(let v=2,w=e.length;v<w;v+=8){let b=e[v],E=e[v+1],_=e[v+2],S=e[v+3],A=f.createElement("rect"),F=(_-t)/u,I=(o-E)/c,q=(b-_)/u,ee=(E-S)/c;A.setAttribute("x",F),A.setAttribute("y",I),A.setAttribute("width",q),A.setAttribute("height",ee),m.append(A),a?.push(`<rect vector-effect="non-scaling-stroke" x="${F}" y="${I}" width="${q}" height="${ee}"/>`)}l(this,ip)&&(a.push("</g></svg>')"),s.backgroundImage=a.join("")),this.container.append(h),this.container.style.clipPath=`url(#${y})`}_createPopup(e=null){let{data:t}=this,n,i;e?(n={str:e.text},i=e.date):(n=t.contentsObj,i=t.modificationDate),O(this,Ds,new Bm({data:{color:t.color,titleObj:t.titleObj,modificationDate:i,contentsObj:n,richText:t.richText,parentRect:t.rect,borderStyle:0,id:`popup_${t.id}`,rotation:t.rotation,noRotate:!0},linkService:this.linkService,parent:this.parent,elements:[this]}))}get hasPopupElement(){return!!(l(this,Ds)||this.popup||this.data.popupRef)}get extraPopupElement(){return l(this,Ds)}render(){Vt("Abstract method `AnnotationElement.render` called")}_getElementsByName(e,t=null){let n=[];if(this._fieldObjects){let i=this._fieldObjects[e];if(i)for(let{page:o,id:s,exportValues:a}of i){if(o===-1||s===t)continue;let u=typeof a=="string"?a:null,c=document.querySelector(`[data-element-id="${s}"]`);if(c&&!Gf.has(c)){Tt(`_getElementsByName - element not allowed: ${s}`);continue}n.push({id:s,exportValue:u,domElement:c})}return n}for(let i of document.getElementsByName(e)){let{exportValue:o}=i,s=i.getAttribute("data-element-id");s!==t&&Gf.has(i)&&n.push({id:s,exportValue:o,domElement:i})}return n}show(){this.container&&(this.container.hidden=!1),this.popup?.maybeShow()}hide(){this.container&&(this.container.hidden=!0),this.popup?.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){let e=this.getElementsToTriggerPopup();if(Array.isArray(e))for(let t of e)t.classList.add("highlightArea");else e.classList.add("highlightArea")}_editOnDoubleClick(){if(!this._isEditable)return;let{annotationEditorType:e,data:{id:t}}=this;this.container.addEventListener("dblclick",()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:e,editId:t,mustEnterInEditMode:!0})})}get width(){return this.data.rect[2]-this.data.rect[0]}get height(){return this.data.rect[3]-this.data.rect[1]}};mf=new WeakMap,ip=new WeakMap,Ds=new WeakMap,ly=new WeakSet,KS=function(e){let{container:{style:t},data:{rect:n,rotation:i},parent:{viewport:{rawDims:{pageWidth:o,pageHeight:s,pageX:a,pageY:u}}}}=this;n?.splice(0,4,...e),t.left=`${100*(e[0]-a)/o}%`,t.top=`${100*(s-e[3]+u)/s}%`,i===0?(t.width=`${100*(e[2]-e[0])/o}%`,t.height=`${100*(e[3]-e[1])/s}%`):this.setRotation(i)};Nr=nC,ZS=class extends Nr{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.editor=e.editor}render(){return this.container.className="editorAnnotation",this.container}createOrUpdatePopup(){let{editor:e}=this;e.hasComment&&this._createPopup(e.comment)}get hasCommentButton(){return this.enableComment&&this.editor.hasComment}get commentButtonPosition(){return this.editor.commentButtonPositionInPage}get commentText(){return this.editor.comment.text}set commentText(e){this.editor.comment=e,e||this.removePopup()}get commentData(){return this.editor.getData()}remove(){this.parent.removeAnnotation(this.data.id),this.container.remove(),this.container=null,this.removePopup()}},Mm=class extends Nr{constructor(t,n=null){super(t,{isRenderable:!0,ignoreBorder:!!n?.ignoreBorder,createQuadrilaterals:!0});z(this,rs);this.isTooltipOnly=t.data.isTooltipOnly}render(){let{data:t,linkService:n}=this,i=document.createElement("a");i.setAttribute("data-element-id",t.id);let o=!1;return t.url?(n.addLinkAttributes(i,t.url,t.newWindow),o=!0):t.action?(this._bindNamedAction(i,t.action,t.overlaidText),o=!0):t.attachment?(X(this,rs,O3).call(this,i,t.attachment,t.overlaidText,t.attachmentDest),o=!0):t.setOCGState?(X(this,rs,k3).call(this,i,t.setOCGState,t.overlaidText),o=!0):t.dest?(this._bindLink(i,t.dest,t.overlaidText),o=!0):(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(i,t),o=!0),t.resetForm?(this._bindResetFormAction(i,t.resetForm),o=!0):this.isTooltipOnly&&!o&&(this._bindLink(i,""),o=!0)),this.container.classList.add("linkAnnotation"),o&&(this.contentElement=i,this.container.append(i)),this.container}_bindLink(t,n,i=""){t.href=this.linkService.getDestinationHash(n),t.onclick=()=>(n&&this.linkService.goToDestination(n),!1),(n||n==="")&&X(this,rs,Ac).call(this),i&&(t.title=i)}_bindNamedAction(t,n,i=""){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(n),!1),i&&(t.title=i),X(this,rs,Ac).call(this)}_bindJSAction(t,n){t.href=this.linkService.getAnchorUrl("");let i=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(let o of Object.keys(n.actions)){let s=i.get(o);s&&(t[s]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n.id,name:o}}),!1))}n.overlaidText&&(t.title=n.overlaidText),t.onclick||(t.onclick=()=>!1),X(this,rs,Ac).call(this)}_bindResetFormAction(t,n){let i=t.onclick;if(i||(t.href=this.linkService.getAnchorUrl("")),X(this,rs,Ac).call(this),!this._fieldObjects){Tt('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),i||(t.onclick=()=>!1);return}t.onclick=()=>{i?.();let{fields:o,refs:s,include:a}=n,u=[];if(o.length!==0||s.length!==0){let h=new Set(s);for(let d of o){let m=this._fieldObjects[d]||[];for(let{id:y}of m)h.add(y)}for(let d of Object.values(this._fieldObjects))for(let m of d)h.has(m.id)===a&&u.push(m)}else for(let h of Object.values(this._fieldObjects))u.push(...h);let c=this.annotationStorage,f=[];for(let h of u){let{id:d}=h;switch(f.push(d),h.type){case"text":{let y=h.defaultValue||"";c.setValue(d,{value:y});break}case"checkbox":case"radiobutton":{let y=h.defaultValue===h.exportValues;c.setValue(d,{value:y});break}case"combobox":case"listbox":{let y=h.defaultValue||"";c.setValue(d,{value:y});break}default:continue}let m=document.querySelector(`[data-element-id="${d}"]`);if(m){if(!Gf.has(m)){Tt(`_bindResetFormAction - element not allowed: ${d}`);continue}}else continue;m.dispatchEvent(new Event("resetform"))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:f,name:"ResetForm"}}),!1}}};rs=new WeakSet,Ac=function(){this.container.setAttribute("data-internal-link","")},O3=function(t,n,i="",o=null){t.href=this.linkService.getAnchorUrl(""),n.description?t.title=n.description:i&&(t.title=i),t.onclick=()=>(this.downloadManager?.openOrDownloadData(n.content,n.filename,o),!1),X(this,rs,Ac).call(this)},k3=function(t,n,i=""){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(n),!1),i&&(t.title=i),X(this,rs,Ac).call(this)};JS=class extends Nr{constructor(e){super(e,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");let e=document.createElement("img");return e.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",e.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),e.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.append(e),this.container}},pl=class extends Nr{render(){return this.container}showElementAndHideCanvas(e){this.data.hasOwnCanvas&&(e.previousSibling?.nodeName==="CANVAS"&&(e.previousSibling.hidden=!0),e.hidden=!1)}_getKeyModifier(e){return $r.platform.isMac?e.metaKey:e.ctrlKey}_setEventListener(e,t,n,i,o){n.includes("mouse")?e.addEventListener(n,s=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:o(s),shift:s.shiftKey,modifier:this._getKeyModifier(s)}})}):e.addEventListener(n,s=>{if(n==="blur"){if(!t.focused||!s.relatedTarget)return;t.focused=!1}else if(n==="focus"){if(t.focused)return;t.focused=!0}o&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:o(s)}})})}_setEventListeners(e,t,n,i){for(let[o,s]of n)(s==="Action"||this.data.actions?.[s])&&((s==="Focus"||s==="Blur")&&(t||(t={focused:!1})),this._setEventListener(e,t,o,s,i),s==="Focus"&&!this.data.actions?.Blur?this._setEventListener(e,t,"blur","Blur",null):s==="Blur"&&!this.data.actions?.Focus&&this._setEventListener(e,t,"focus","Focus",null))}_setBackgroundColor(e){let t=this.data.backgroundColor||null;e.style.backgroundColor=t===null?"transparent":at.makeHexColor(t[0],t[1],t[2])}_setTextStyle(e){let t=["left","center","right"],{fontColor:n}=this.data.defaultAppearanceData,i=this.data.defaultAppearanceData.fontSize||aY,o=e.style,s,a=2,u=c=>Math.round(10*c)/10;if(this.data.multiLine){let c=Math.abs(this.data.rect[3]-this.data.rect[1]-a),f=Math.round(c/(Xw*i))||1,h=c/f;s=Math.min(i,u(h/Xw))}else{let c=Math.abs(this.data.rect[3]-this.data.rect[1]-a);s=Math.min(i,u(c/Xw))}o.fontSize=`calc(${s}px * var(--total-scale-factor))`,o.color=at.makeHexColor(n[0],n[1],n[2]),this.data.textAlignment!==null&&(o.textAlign=t[this.data.textAlignment])}_setRequired(e,t){t?e.setAttribute("required",!0):e.removeAttribute("required"),e.setAttribute("aria-required",t)}},QS=class extends pl{constructor(e){let t=e.renderForms||e.data.hasOwnCanvas||!e.data.hasAppearance&&!!e.data.fieldValue;super(e,{isRenderable:t})}setPropertyOnSiblings(e,t,n,i){let o=this.annotationStorage;for(let s of this._getElementsByName(e.name,e.id))s.domElement&&(s.domElement[t]=n),o.setValue(s.id,{[i]:n})}render(){let e=this.annotationStorage,t=this.data.id;this.container.classList.add("textWidgetAnnotation");let n=null;if(this.renderForms){let i=e.getValue(t,{value:this.data.fieldValue}),o=i.value||"",s=e.getValue(t,{charLimit:this.data.maxLen}).charLimit;s&&o.length>s&&(o=o.slice(0,s));let a=i.formattedValue||this.data.textContent?.join(`
|
|
96
|
-
`)||null;a&&this.data.comb&&(a=a.replaceAll(/\s+/g,""));let u={userValue:o,formattedValue:a,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(n=document.createElement("textarea"),n.textContent=a??o,this.data.doNotScroll&&(n.style.overflowY="hidden")):(n=document.createElement("input"),n.type=this.data.password?"password":"text",n.setAttribute("value",a??o),this.data.doNotScroll&&(n.style.overflowX="hidden")),this.data.hasOwnCanvas&&(n.hidden=!0),Gf.add(n),this.contentElement=n,n.setAttribute("data-element-id",t),n.disabled=this.data.readOnly,n.name=this.data.fieldName,n.tabIndex=0;let{datetimeFormat:c,datetimeType:f,timeStep:h}=this.data,d=!!f&&this.enableScripting;c&&(n.title=c),this._setRequired(n,this.data.required),s&&(n.maxLength=s),n.addEventListener("input",y=>{e.setValue(t,{value:y.target.value}),this.setPropertyOnSiblings(n,"value",y.target.value,"value"),u.formattedValue=null}),n.addEventListener("resetform",y=>{let v=this.data.defaultFieldValue??"";n.value=u.userValue=v,u.formattedValue=null});let m=y=>{let{formattedValue:v}=u;v!=null&&(y.target.value=v),y.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){n.addEventListener("focus",v=>{if(u.focused)return;let{target:w}=v;if(d&&(w.type=f,h&&(w.step=h)),u.userValue){let b=u.userValue;if(d)if(f==="time"){let E=new Date(b),_=[E.getHours(),E.getMinutes(),E.getSeconds()];w.value=_.map(S=>S.toString().padStart(2,"0")).join(":")}else w.value=new Date(b-lY).toISOString().split(f==="date"?"T":".",1)[0];else w.value=b}u.lastCommittedValue=w.value,u.commitKey=1,this.data.actions?.Focus||(u.focused=!0)}),n.addEventListener("updatefromsandbox",v=>{this.showElementAndHideCanvas(v.target);let w={value(b){u.userValue=b.detail.value??"",d||e.setValue(t,{value:u.userValue.toString()}),b.target.value=u.userValue},formattedValue(b){let{formattedValue:E}=b.detail;u.formattedValue=E,E!=null&&b.target!==document.activeElement&&(b.target.value=E);let _={formattedValue:E};d&&(_.value=E),e.setValue(t,_)},selRange(b){b.target.setSelectionRange(...b.detail.selRange)},charLimit:b=>{let{charLimit:E}=b.detail,{target:_}=b;if(E===0){_.removeAttribute("maxLength");return}_.setAttribute("maxLength",E);let S=u.userValue;!S||S.length<=E||(S=S.slice(0,E),_.value=u.userValue=S,e.setValue(t,{value:S}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:S,willCommit:!0,commitKey:1,selStart:_.selectionStart,selEnd:_.selectionEnd}}))}};this._dispatchEventFromSandbox(w,v)}),n.addEventListener("keydown",v=>{u.commitKey=1;let w=-1;if(v.key==="Escape"?w=0:v.key==="Enter"&&!this.data.multiLine?w=2:v.key==="Tab"&&(u.commitKey=3),w===-1)return;let{value:b}=v.target;u.lastCommittedValue!==b&&(u.lastCommittedValue=b,u.userValue=b,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:b,willCommit:!0,commitKey:w,selStart:v.target.selectionStart,selEnd:v.target.selectionEnd}}))});let y=m;m=null,n.addEventListener("blur",v=>{if(!u.focused||!v.relatedTarget)return;this.data.actions?.Blur||(u.focused=!1);let{target:w}=v,{value:b}=w;if(d){if(b&&f==="time"){let E=b.split(":").map(_=>parseInt(_,10));b=new Date(2e3,0,1,E[0],E[1],E[2]||0).valueOf(),w.step=""}else b.includes("T")||(b=`${b}T00:00`),b=new Date(b).valueOf();w.type="text"}u.userValue=b,u.lastCommittedValue!==b&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:b,willCommit:!0,commitKey:u.commitKey,selStart:v.target.selectionStart,selEnd:v.target.selectionEnd}}),y(v)}),this.data.actions?.Keystroke&&n.addEventListener("beforeinput",v=>{u.lastCommittedValue=null;let{data:w,target:b}=v,{value:E,selectionStart:_,selectionEnd:S}=b,A=_,F=S;switch(v.inputType){case"deleteWordBackward":{let I=E.substring(0,_).match(/\w*[^\w]*$/);I&&(A-=I[0].length);break}case"deleteWordForward":{let I=E.substring(_).match(/^[^\w]*\w*/);I&&(F+=I[0].length);break}case"deleteContentBackward":_===S&&(A-=1);break;case"deleteContentForward":_===S&&(F+=1);break}v.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:E,change:w||"",willCommit:!1,selStart:A,selEnd:F}})}),this._setEventListeners(n,u,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],v=>v.target.value)}if(m&&n.addEventListener("blur",m),this.data.comb){let v=(this.data.rect[2]-this.data.rect[0])/s;n.classList.add("comb"),n.style.letterSpacing=`calc(${v}px * var(--total-scale-factor) - 1ch)`}}else n=document.createElement("div"),n.textContent=this.data.fieldValue,n.style.verticalAlign="middle",n.style.display="table-cell",this.data.hasOwnCanvas&&(n.hidden=!0);return this._setTextStyle(n),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}},eT=class extends pl{constructor(e){super(e,{isRenderable:!!e.data.hasOwnCanvas})}},tT=class extends pl{constructor(e){super(e,{isRenderable:e.renderForms})}render(){let e=this.annotationStorage,t=this.data,n=t.id,i=e.getValue(n,{value:t.exportValue===t.fieldValue}).value;typeof i=="string"&&(i=i!=="Off",e.setValue(n,{value:i})),this.container.classList.add("buttonWidgetAnnotation","checkBox");let o=document.createElement("input");return Gf.add(o),o.setAttribute("data-element-id",n),o.disabled=t.readOnly,this._setRequired(o,this.data.required),o.type="checkbox",o.name=t.fieldName,i&&o.setAttribute("checked",!0),o.setAttribute("exportValue",t.exportValue),o.tabIndex=0,o.addEventListener("change",s=>{let{name:a,checked:u}=s.target;for(let c of this._getElementsByName(a,n)){let f=u&&c.exportValue===t.exportValue;c.domElement&&(c.domElement.checked=f),e.setValue(c.id,{value:f})}e.setValue(n,{value:u})}),o.addEventListener("resetform",s=>{let a=t.defaultFieldValue||"Off";s.target.checked=a===t.exportValue}),this.enableScripting&&this.hasJSActions&&(o.addEventListener("updatefromsandbox",s=>{let a={value(u){u.target.checked=u.detail.value!=="Off",e.setValue(n,{value:u.target.checked})}};this._dispatchEventFromSandbox(a,s)}),this._setEventListeners(o,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],s=>s.target.checked)),this._setBackgroundColor(o),this._setDefaultPropertiesFromJS(o),this.container.append(o),this.container}},tE=class extends pl{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");let e=this.annotationStorage,t=this.data,n=t.id,i=e.getValue(n,{value:t.fieldValue===t.buttonValue}).value;if(typeof i=="string"&&(i=i!==t.buttonValue,e.setValue(n,{value:i})),i)for(let s of this._getElementsByName(t.fieldName,n))e.setValue(s.id,{value:!1});let o=document.createElement("input");if(Gf.add(o),o.setAttribute("data-element-id",n),o.disabled=t.readOnly,this._setRequired(o,this.data.required),o.type="radio",o.name=t.fieldName,i&&o.setAttribute("checked",!0),o.tabIndex=0,o.addEventListener("change",s=>{let{name:a,checked:u}=s.target;for(let c of this._getElementsByName(a,n))e.setValue(c.id,{value:!1});e.setValue(n,{value:u})}),o.addEventListener("resetform",s=>{let a=t.defaultFieldValue;s.target.checked=a!=null&&a===t.buttonValue}),this.enableScripting&&this.hasJSActions){let s=t.buttonValue;o.addEventListener("updatefromsandbox",a=>{let u={value:c=>{let f=s===c.detail.value;for(let h of this._getElementsByName(c.target.name)){let d=f&&h.id===n;h.domElement&&(h.domElement.checked=d),e.setValue(h.id,{value:d})}}};this._dispatchEventFromSandbox(u,a)}),this._setEventListeners(o,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],a=>a.target.checked)}return this._setBackgroundColor(o),this._setDefaultPropertiesFromJS(o),this.container.append(o),this.container}},rT=class extends Mm{constructor(e){super(e,{ignoreBorder:e.data.hasAppearance})}render(){let e=super.render();e.classList.add("buttonWidgetAnnotation","pushButton");let t=e.lastChild;return this.enableScripting&&this.hasJSActions&&t&&(this._setDefaultPropertiesFromJS(t),t.addEventListener("updatefromsandbox",n=>{this._dispatchEventFromSandbox({},n)})),e}},nT=class extends pl{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");let e=this.annotationStorage,t=this.data.id,n=e.getValue(t,{value:this.data.fieldValue}),i=document.createElement("select");Gf.add(i),i.setAttribute("data-element-id",t),i.disabled=this.data.readOnly,this._setRequired(i,this.data.required),i.name=this.data.fieldName,i.tabIndex=0;let o=this.data.combo&&this.data.options.length>0;this.data.combo||(i.size=this.data.options.length,this.data.multiSelect&&(i.multiple=!0)),i.addEventListener("resetform",f=>{let h=this.data.defaultFieldValue;for(let d of i.options)d.selected=d.value===h});for(let f of this.data.options){let h=document.createElement("option");h.textContent=f.displayValue,h.value=f.exportValue,n.value.includes(f.exportValue)&&(h.setAttribute("selected",!0),o=!1),i.append(h)}let s=null;if(o){let f=document.createElement("option");f.value=" ",f.setAttribute("hidden",!0),f.setAttribute("selected",!0),i.prepend(f),s=()=>{f.remove(),i.removeEventListener("input",s),s=null},i.addEventListener("input",s)}let a=f=>{let h=f?"value":"textContent",{options:d,multiple:m}=i;return m?Array.prototype.filter.call(d,y=>y.selected).map(y=>y[h]):d.selectedIndex===-1?null:d[d.selectedIndex][h]},u=a(!1),c=f=>{let h=f.target.options;return Array.prototype.map.call(h,d=>({displayValue:d.textContent,exportValue:d.value}))};return this.enableScripting&&this.hasJSActions?(i.addEventListener("updatefromsandbox",f=>{let h={value(d){s?.();let m=d.detail.value,y=new Set(Array.isArray(m)?m:[m]);for(let v of i.options)v.selected=y.has(v.value);e.setValue(t,{value:a(!0)}),u=a(!1)},multipleSelection(d){i.multiple=!0},remove(d){let m=i.options,y=d.detail.remove;m[y].selected=!1,i.remove(y),m.length>0&&Array.prototype.findIndex.call(m,w=>w.selected)===-1&&(m[0].selected=!0),e.setValue(t,{value:a(!0),items:c(d)}),u=a(!1)},clear(d){for(;i.length!==0;)i.remove(0);e.setValue(t,{value:null,items:[]}),u=a(!1)},insert(d){let{index:m,displayValue:y,exportValue:v}=d.detail.insert,w=i.children[m],b=document.createElement("option");b.textContent=y,b.value=v,w?w.before(b):i.append(b),e.setValue(t,{value:a(!0),items:c(d)}),u=a(!1)},items(d){let{items:m}=d.detail;for(;i.length!==0;)i.remove(0);for(let y of m){let{displayValue:v,exportValue:w}=y,b=document.createElement("option");b.textContent=v,b.value=w,i.append(b)}i.options.length>0&&(i.options[0].selected=!0),e.setValue(t,{value:a(!0),items:c(d)}),u=a(!1)},indices(d){let m=new Set(d.detail.indices);for(let y of d.target.options)y.selected=m.has(y.index);e.setValue(t,{value:a(!0)}),u=a(!1)},editable(d){d.target.disabled=!d.detail.editable}};this._dispatchEventFromSandbox(h,f)}),i.addEventListener("input",f=>{let h=a(!0),d=a(!1);e.setValue(t,{value:h}),f.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:u,change:d,changeEx:h,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(i,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],f=>f.target.value)):i.addEventListener("input",function(f){e.setValue(t,{value:a(!0)})}),this.data.combo&&this._setTextStyle(i),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}},Bm=class extends Nr{constructor(t){let{data:n,elements:i,parent:o}=t,s=!!o._commentManager;super(t,{isRenderable:!s&&Nr._hasPopupData(n)});z(this,uy);if(this.elements=i,s&&Nr._hasPopupData(n)){let a=this.popup=X(this,uy,iT).call(this);for(let u of i)u.popup=a}else this.popup=null}render(){let{container:t}=this;t.classList.add("popupAnnotation"),t.role="comment";let n=this.popup=X(this,uy,iT).call(this),i=[];for(let o of this.elements)o.popup=n,o.container.ariaHasPopup="dialog",i.push(o.data.id),o.addHighlightArea();return this.container.setAttribute("aria-controls",i.map(o=>`${Xh}${o}`).join(",")),this.container}};uy=new WeakSet,iT=function(){return new sT({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate||this.data.creationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open,commentManager:this.parent._commentManager})};sT=class{constructor({container:e,color:t,elements:n,titleObj:i,modificationDate:o,contentsObj:s,richText:a,parent:u,rect:c,parentRect:f,open:h,commentManager:d=null}){z(this,Dt);z(this,Wi,null);z(this,yu,X(this,Dt,M3).bind(this));z(this,CE,X(this,Dt,cT).bind(this));z(this,RE,X(this,Dt,gv).bind(this));z(this,sp,X(this,Dt,pv).bind(this));z(this,op,null);z(this,Fr,null);z(this,zo,null);z(this,bu,null);z(this,yf,null);z(this,ap,null);z(this,lp,null);z(this,Ho,!1);z(this,zi,null);z(this,Ja,null);z(this,Qa,null);z(this,Ur,null);z(this,el,null);z(this,wu,null);z(this,cy,null);z(this,tl,null);z(this,up,null);z(this,bf,null);z(this,vu,!1);z(this,vn,null);z(this,Eu,null);O(this,Fr,e),O(this,up,i),O(this,zo,s),O(this,tl,a),O(this,ap,u),O(this,op,t),O(this,cy,c),O(this,lp,f),O(this,yf,n),O(this,Wi,d),O(this,vn,n[0]),O(this,bu,Wf.toDateObject(o)),this.trigger=n.flatMap(m=>m.getElementsToTriggerPopup()),d||(X(this,Dt,hv).call(this),l(this,Fr).hidden=!0,h&&X(this,Dt,pv).call(this))}renderCommentButton(){if(l(this,Ur)){l(this,Ur).parentNode||l(this,vn).container.after(l(this,Ur));return}if(l(this,el)||X(this,Dt,oT).call(this),!l(this,el))return;let{signal:e}=O(this,Ja,new AbortController),t=l(this,vn).hasOwnCommentButton,n=()=>{l(this,Wi).toggleCommentPopup(this,!0,void 0,!t)},i=()=>{l(this,Wi).toggleCommentPopup(this,!1,!0,!t)},o=()=>{l(this,Wi).toggleCommentPopup(this,!1,!1)};if(t){O(this,Ur,l(this,vn).container);for(let s of this.trigger)s.ariaHasPopup="dialog",s.ariaControls="commentPopup",s.addEventListener("keydown",l(this,yu),{signal:e}),s.addEventListener("click",n,{signal:e}),s.addEventListener("pointerenter",i,{signal:e}),s.addEventListener("pointerleave",o,{signal:e}),s.classList.add("popupTriggerArea")}else{let s=O(this,Ur,document.createElement("button"));s.className="annotationCommentButton";let a=l(this,vn).container;s.style.zIndex=a.style.zIndex+1,s.tabIndex=0,s.ariaHasPopup="dialog",s.ariaControls="commentPopup",s.setAttribute("data-l10n-id","pdfjs-show-comment-button"),X(this,Dt,lT).call(this),X(this,Dt,aT).call(this),s.addEventListener("keydown",l(this,yu),{signal:e}),s.addEventListener("click",n,{signal:e}),s.addEventListener("pointerenter",i,{signal:e}),s.addEventListener("pointerleave",o,{signal:e}),a.after(s)}}get commentButtonColor(){let{color:e,opacity:t}=l(this,vn).commentData;return e?l(this,ap)._commentManager.makeCommentColor(e,t):null}focusCommentButton(){setTimeout(()=>{l(this,Ur)?.focus()},0)}getData(){let{richText:e,color:t,opacity:n,creationDate:i,modificationDate:o}=l(this,vn).commentData;return{contentsObj:{str:this.comment},richText:e,color:t,opacity:n,creationDate:i,modificationDate:o}}get elementBeforePopup(){return l(this,Ur)}get comment(){return l(this,Eu)||O(this,Eu,l(this,vn).commentText),l(this,Eu)}set comment(e){e!==this.comment&&(l(this,vn).commentText=O(this,Eu,e))}focus(){l(this,vn).container?.focus()}get parentBoundingClientRect(){return l(this,vn).layer.getBoundingClientRect()}setCommentButtonStates({selected:e,hasPopup:t}){l(this,Ur)&&(l(this,Ur).classList.toggle("selected",e),l(this,Ur).ariaExpanded=t)}setSelectedCommentButton(e){l(this,Ur).classList.toggle("selected",e)}get commentPopupPosition(){if(l(this,wu))return l(this,wu);let{x:e,y:t,height:n}=l(this,Ur).getBoundingClientRect(),{x:i,y:o,width:s,height:a}=l(this,vn).layer.getBoundingClientRect();return[(e-i)/s,(t+n-o)/a]}set commentPopupPosition(e){O(this,wu,e)}hasDefaultPopupPosition(){return l(this,wu)===null}get commentButtonPosition(){return l(this,el)}get commentButtonWidth(){return l(this,Ur).getBoundingClientRect().width/this.parentBoundingClientRect.width}editComment(e){let[t,n]=l(this,wu)||this.commentButtonPosition.map(c=>c/100),i=this.parentBoundingClientRect,{x:o,y:s,width:a,height:u}=i;l(this,Wi).showDialog(null,this,o+t*a,s+n*u,{...e,parentDimensions:i})}render(){if(l(this,zi))return;let e=O(this,zi,document.createElement("div"));if(e.className="popup",l(this,op)){let n=e.style.outlineColor=at.makeHexColor(...l(this,op));e.style.backgroundColor=`color-mix(in srgb, ${n} 30%, white)`}let t=document.createElement("span");if(t.className="header",l(this,up)?.str){let n=document.createElement("span");n.className="title",t.append(n),{dir:n.dir,str:n.textContent}=l(this,up)}if(e.append(t),l(this,bu)){let n=document.createElement("time");n.className="popupDate",n.setAttribute("data-l10n-id","pdfjs-annotation-date-time-string"),n.setAttribute("data-l10n-args",JSON.stringify({dateObj:l(this,bu).valueOf()})),n.dateTime=l(this,bu).toISOString(),t.append(n)}ZT({html:l(this,Dt,dv)||l(this,zo).str,dir:l(this,zo)?.dir,className:"popupContent"},e),l(this,Fr).append(e)}updateEdited({rect:e,popup:t,deleted:n}){if(l(this,Wi)){n?(this.remove(),O(this,Eu,null)):t&&(t.deleted?this.remove():(X(this,Dt,lT).call(this),O(this,Eu,t.text))),e&&(O(this,el,null),X(this,Dt,oT).call(this),X(this,Dt,aT).call(this));return}if(n||t?.deleted){this.remove();return}X(this,Dt,hv).call(this),l(this,bf)||O(this,bf,{contentsObj:l(this,zo),richText:l(this,tl)}),e&&O(this,Qa,null),t&&t.text&&(O(this,tl,X(this,Dt,P3).call(this,t.text)),O(this,bu,Wf.toDateObject(t.date)),O(this,zo,null)),l(this,zi)?.remove(),O(this,zi,null)}resetEdited(){l(this,bf)&&({contentsObj:on(this,zo)._,richText:on(this,tl)._}=l(this,bf),O(this,bf,null),l(this,zi)?.remove(),O(this,zi,null),O(this,Qa,null))}remove(){if(l(this,Ja)?.abort(),O(this,Ja,null),l(this,zi)?.remove(),O(this,zi,null),O(this,vu,!1),O(this,Ho,!1),l(this,Ur)?.remove(),O(this,Ur,null),this.trigger)for(let e of this.trigger)e.classList.remove("popupTriggerArea")}forceHide(){O(this,vu,this.isVisible),l(this,vu)&&(l(this,Fr).hidden=!0)}maybeShow(){l(this,Wi)||(X(this,Dt,hv).call(this),l(this,vu)&&(l(this,zi)||X(this,Dt,gv).call(this),O(this,vu,!1),l(this,Fr).hidden=!1))}get isVisible(){return l(this,Wi)?!1:l(this,Fr).hidden===!1}};Wi=new WeakMap,yu=new WeakMap,CE=new WeakMap,RE=new WeakMap,sp=new WeakMap,op=new WeakMap,Fr=new WeakMap,zo=new WeakMap,bu=new WeakMap,yf=new WeakMap,ap=new WeakMap,lp=new WeakMap,Ho=new WeakMap,zi=new WeakMap,Ja=new WeakMap,Qa=new WeakMap,Ur=new WeakMap,el=new WeakMap,wu=new WeakMap,cy=new WeakMap,tl=new WeakMap,up=new WeakMap,bf=new WeakMap,vu=new WeakMap,vn=new WeakMap,Eu=new WeakMap,Dt=new WeakSet,hv=function(){if(l(this,Ja))return;O(this,Ja,new AbortController);let{signal:e}=l(this,Ja);for(let t of this.trigger)t.addEventListener("click",l(this,sp),{signal:e}),t.addEventListener("pointerenter",l(this,RE),{signal:e}),t.addEventListener("pointerleave",l(this,CE),{signal:e}),t.classList.add("popupTriggerArea");for(let t of l(this,yf))t.container?.addEventListener("keydown",l(this,yu),{signal:e})},oT=function(){let e=l(this,yf).find(t=>t.hasCommentButton);e&&O(this,el,e._normalizePoint(e.commentButtonPosition))},aT=function(){if(l(this,vn).extraPopupElement&&!l(this,vn).editor)return;l(this,Ur)||this.renderCommentButton();let[e,t]=l(this,el),{style:n}=l(this,Ur);n.left=`calc(${e}%)`,n.top=`calc(${t}% - var(--comment-button-dim))`},lT=function(){l(this,vn).extraPopupElement||(l(this,Ur)||this.renderCommentButton(),l(this,Ur).style.backgroundColor=this.commentButtonColor||"")},dv=function(){let e=l(this,tl),t=l(this,zo);return e?.str&&(!t?.str||t.str===e.str)&&l(this,tl).html||null},uT=function(){return l(this,Dt,dv)?.attributes?.style?.fontSize||0},L3=function(){return l(this,Dt,dv)?.attributes?.style?.color||null},P3=function(e){let t=[],n={str:e,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:t}]}},i={style:{color:l(this,Dt,L3),fontSize:l(this,Dt,uT)?`calc(${l(this,Dt,uT)}px * var(--total-scale-factor))`:""}};for(let o of e.split(`
|
|
97
|
-
`))t.push({name:"span",value:o,attributes:i});return n},M3=function(e){e.altKey||e.shiftKey||e.ctrlKey||e.metaKey||(e.key==="Enter"||e.key==="Escape"&&l(this,Ho))&&X(this,Dt,pv).call(this)},B3=function(){if(l(this,Qa)!==null)return;let{page:{view:e},viewport:{rawDims:{pageWidth:t,pageHeight:n,pageX:i,pageY:o}}}=l(this,ap),s=!!l(this,lp),a=s?l(this,lp):l(this,cy);for(let y of l(this,yf))if(!a||at.intersect(y.data.rect,a)!==null){a=y.data.rect,s=!0;break}let u=at.normalizeRect([a[0],e[3]-a[1]+e[1],a[2],e[3]-a[3]+e[1]]),f=s?a[2]-a[0]+5:0,h=u[0]+f,d=u[1];O(this,Qa,[100*(h-i)/t,100*(d-o)/n]);let{style:m}=l(this,Fr);m.left=`${l(this,Qa)[0]}%`,m.top=`${l(this,Qa)[1]}%`},pv=function(){if(l(this,Wi)){l(this,Wi).toggleCommentPopup(this,!1);return}O(this,Ho,!l(this,Ho)),l(this,Ho)?(X(this,Dt,gv).call(this),l(this,Fr).addEventListener("click",l(this,sp)),l(this,Fr).addEventListener("keydown",l(this,yu))):(X(this,Dt,cT).call(this),l(this,Fr).removeEventListener("click",l(this,sp)),l(this,Fr).removeEventListener("keydown",l(this,yu)))},gv=function(){l(this,zi)||this.render(),this.isVisible?l(this,Ho)&&l(this,Fr).classList.add("focused"):(X(this,Dt,B3).call(this),l(this,Fr).hidden=!1,l(this,Fr).style.zIndex=parseInt(l(this,Fr).style.zIndex)+1e3)},cT=function(){l(this,Fr).classList.remove("focused"),!(l(this,Ho)||!this.isVisible)&&(l(this,Fr).hidden=!0,l(this,Fr).style.zIndex=parseInt(l(this,Fr).style.zIndex)-1e3)};rE=class extends Nr{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.textContent=e.data.textContent,this.textPosition=e.data.textPosition,this.annotationEditorType=At.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){let e=this.contentElement=document.createElement("div");e.classList.add("annotationTextContent"),e.setAttribute("role","comment");for(let t of this.textContent){let n=document.createElement("span");n.textContent=t,e.append(n)}this.container.append(e)}return!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this._editOnDoubleClick(),this.container}},fT=class extends Nr{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0});z(this,fy,null)}render(){this.container.classList.add("lineAnnotation");let{data:t,width:n,height:i}=this,o=this.svgFactory.create(n,i,!0),s=O(this,fy,this.svgFactory.createElement("svg:line"));return s.setAttribute("x1",t.rect[2]-t.lineCoordinates[0]),s.setAttribute("y1",t.rect[3]-t.lineCoordinates[1]),s.setAttribute("x2",t.rect[2]-t.lineCoordinates[2]),s.setAttribute("y2",t.rect[3]-t.lineCoordinates[3]),s.setAttribute("stroke-width",t.borderStyle.width||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),o.append(s),this.container.append(o),!t.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return l(this,fy)}addHighlightArea(){this.container.classList.add("highlightArea")}};fy=new WeakMap;hT=class extends Nr{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0});z(this,hy,null)}render(){this.container.classList.add("squareAnnotation");let{data:t,width:n,height:i}=this,o=this.svgFactory.create(n,i,!0),s=t.borderStyle.width,a=O(this,hy,this.svgFactory.createElement("svg:rect"));return a.setAttribute("x",s/2),a.setAttribute("y",s/2),a.setAttribute("width",n-s),a.setAttribute("height",i-s),a.setAttribute("stroke-width",s||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","transparent"),o.append(a),this.container.append(o),!t.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return l(this,hy)}addHighlightArea(){this.container.classList.add("highlightArea")}};hy=new WeakMap;dT=class extends Nr{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0});z(this,dy,null)}render(){this.container.classList.add("circleAnnotation");let{data:t,width:n,height:i}=this,o=this.svgFactory.create(n,i,!0),s=t.borderStyle.width,a=O(this,dy,this.svgFactory.createElement("svg:ellipse"));return a.setAttribute("cx",n/2),a.setAttribute("cy",i/2),a.setAttribute("rx",n/2-s/2),a.setAttribute("ry",i/2-s/2),a.setAttribute("stroke-width",s||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","transparent"),o.append(a),this.container.append(o),!t.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return l(this,dy)}addHighlightArea(){this.container.classList.add("highlightArea")}};dy=new WeakMap;nE=class extends Nr{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0});z(this,py,null);this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);let{data:{rect:t,vertices:n,borderStyle:i,popupRef:o},width:s,height:a}=this;if(!n)return this.container;let u=this.svgFactory.create(s,a,!0),c=[];for(let h=0,d=n.length;h<d;h+=2){let m=n[h]-t[0],y=t[3]-n[h+1];c.push(`${m},${y}`)}c=c.join(" ");let f=O(this,py,this.svgFactory.createElement(this.svgElementName));return f.setAttribute("points",c),f.setAttribute("stroke-width",i.width||1),f.setAttribute("stroke","transparent"),f.setAttribute("fill","transparent"),u.append(f),this.container.append(u),!o&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return l(this,py)}addHighlightArea(){this.container.classList.add("highlightArea")}};py=new WeakMap;pT=class extends nE{constructor(e){super(e),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}},gT=class extends Nr{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}},Fm=class extends Nr{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0});z(this,my);z(this,gy,null);z(this,wf,[]);this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=this.data.it==="InkHighlight"?At.HIGHLIGHT:At.INK}render(){this.container.classList.add(this.containerClassName);let{data:{rect:t,rotation:n,inkLists:i,borderStyle:o,popupRef:s}}=this,{transform:a,width:u,height:c}=X(this,my,mT).call(this,n,t),f=this.svgFactory.create(u,c,!0),h=O(this,gy,this.svgFactory.createElement("svg:g"));f.append(h),h.setAttribute("stroke-width",o.width||1),h.setAttribute("stroke-linecap","round"),h.setAttribute("stroke-linejoin","round"),h.setAttribute("stroke-miterlimit",10),h.setAttribute("stroke","transparent"),h.setAttribute("fill","transparent"),h.setAttribute("transform",a);for(let d=0,m=i.length;d<m;d++){let y=this.svgFactory.createElement(this.svgElementName);l(this,wf).push(y),y.setAttribute("points",i[d].join(",")),h.append(y)}return!s&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.append(f),this._editOnDoubleClick(),this.container}updateEdited(t){super.updateEdited(t);let{thickness:n,points:i,rect:o}=t,s=l(this,gy);if(n>=0&&s.setAttribute("stroke-width",n||1),i)for(let a=0,u=l(this,wf).length;a<u;a++)l(this,wf)[a].setAttribute("points",i[a].join(","));if(o){let{transform:a,width:u,height:c}=X(this,my,mT).call(this,this.data.rotation,o);s.parentElement.setAttribute("viewBox",`0 0 ${u} ${c}`),s.setAttribute("transform",a)}}getElementsToTriggerPopup(){return l(this,wf)}addHighlightArea(){this.container.classList.add("highlightArea")}};gy=new WeakMap,wf=new WeakMap,my=new WeakSet,mT=function(t,n){switch(t){case 90:return{transform:`rotate(90) translate(${-n[0]},${n[1]}) scale(1,-1)`,width:n[3]-n[1],height:n[2]-n[0]};case 180:return{transform:`rotate(180) translate(${-n[2]},${n[1]}) scale(1,-1)`,width:n[2]-n[0],height:n[3]-n[1]};case 270:return{transform:`rotate(270) translate(${-n[2]},${n[3]}) scale(1,-1)`,width:n[3]-n[1],height:n[2]-n[0]};default:return{transform:`translate(${-n[0]},${n[3]}) scale(1,-1)`,width:n[2]-n[0],height:n[3]-n[1]}}};iE=class extends Nr{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}),this.annotationEditorType=At.HIGHLIGHT}render(){let{data:{overlaidText:e,popupRef:t}}=this;if(!t&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add("highlightAnnotation"),this._editOnDoubleClick(),e){let n=document.createElement("mark");n.classList.add("overlaidText"),n.textContent=e,this.container.append(n)}return this.container}},yT=class extends Nr{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){let{data:{overlaidText:e,popupRef:t}}=this;if(!t&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add("underlineAnnotation"),e){let n=document.createElement("u");n.classList.add("overlaidText"),n.textContent=e,this.container.append(n)}return this.container}},bT=class extends Nr{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){let{data:{overlaidText:e,popupRef:t}}=this;if(!t&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add("squigglyAnnotation"),e){let n=document.createElement("u");n.classList.add("overlaidText"),n.textContent=e,this.container.append(n)}return this.container}},wT=class extends Nr{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){let{data:{overlaidText:e,popupRef:t}}=this;if(!t&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add("strikeoutAnnotation"),e){let n=document.createElement("s");n.classList.add("overlaidText"),n.textContent=e,this.container.append(n)}return this.container}},sE=class extends Nr{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.annotationEditorType=At.STAMP}render(){return this.container.classList.add("stampAnnotation"),this.container.setAttribute("role","img"),!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this._editOnDoubleClick(),this.container}},vT=class extends Nr{constructor(t){super(t,{isRenderable:!0});z(this,by);z(this,yy,null);let{file:n}=this.data;this.filename=n.filename,this.content=n.content,this.linkService.eventBus?.dispatch("fileattachmentannotation",{source:this,...n})}render(){this.container.classList.add("fileAttachmentAnnotation");let{container:t,data:n}=this,i;n.hasAppearance||n.fillAlpha===0?i=document.createElement("div"):(i=document.createElement("img"),i.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(n.name)?"paperclip":"pushpin"}.svg`,n.fillAlpha&&n.fillAlpha<1&&(i.style=`filter: opacity(${Math.round(n.fillAlpha*100)}%);`)),i.addEventListener("dblclick",X(this,by,ET).bind(this)),O(this,yy,i);let{isMac:o}=$r.platform;return t.addEventListener("keydown",s=>{s.key==="Enter"&&(o?s.metaKey:s.ctrlKey)&&X(this,by,ET).call(this)}),!n.popupRef&&this.hasPopupData?(this.hasOwnCommentButton=!0,this._createPopup()):i.classList.add("popupTriggerArea"),t.append(i),t}getElementsToTriggerPopup(){return l(this,yy)}addHighlightArea(){this.container.classList.add("highlightArea")}};yy=new WeakMap,by=new WeakSet,ET=function(){this.downloadManager?.openOrDownloadData(this.content,this.filename)};iC=class iC{constructor({div:e,accessibilityManager:t,annotationCanvasMap:n,annotationEditorUIManager:i,page:o,viewport:s,structTreeLayer:a,commentManager:u,linkService:c,annotationStorage:f}){z(this,fl);z(this,vf,null);z(this,Ef,null);z(this,cp,null);z(this,_u,new Map);z(this,wy,null);z(this,_f,null);z(this,Hi,[]);z(this,vy,!1);this.div=e,O(this,vf,t),O(this,Ef,n),O(this,wy,a||null),O(this,_f,c||null),O(this,cp,f||new Om),this.page=o,this.viewport=s,this.zIndex=0,this._annotationEditorUIManager=i,this._commentManager=u||null}hasEditableAnnotations(){return l(this,_u).size>0}async render(e){let{annotations:t}=e,n=this.div;Lu(n,this.viewport);let i=new Map,o=[],s={data:null,layer:n,linkService:l(this,_f),downloadManager:e.downloadManager,imageResourcesPath:e.imageResourcesPath||"",renderForms:e.renderForms!==!1,svgFactory:new qf,annotationStorage:l(this,cp),enableComment:e.enableComment===!0,enableScripting:e.enableScripting===!0,hasJSActions:e.hasJSActions,fieldObjects:e.fieldObjects,parent:this,elements:null};for(let a of t){if(a.noHTML)continue;let u=a.annotationType===Vr.POPUP;if(u){let h=i.get(a.id);if(!h)continue;if(!this._commentManager){o.push(a);continue}s.elements=h}else if(a.rect[2]===a.rect[0]||a.rect[3]===a.rect[1])continue;s.data=a;let c=Sm.create(s);if(!c.isRenderable)continue;u||(l(this,Hi).push(c),a.popupRef&&i.getOrInsertComputed(a.popupRef,KT).push(c));let f=c.render();a.hidden&&(f.style.visibility="hidden"),c._isEditable&&(l(this,_u).set(c.data.id,c),this._annotationEditorUIManager?.renderAnnotationElement(c))}await X(this,fl,mv).call(this);for(let a of o){let u=s.elements=i.get(a.id);s.data=a;let c=Sm.create(s);if(!c.isRenderable)continue;let f=c.render();c.contentElement.id=`${Xh}${a.id}`,a.hidden&&(f.style.visibility="hidden"),u.at(-1).container.after(f)}X(this,fl,_T).call(this)}async addLinkAnnotations(e){let t={data:null,layer:this.div,linkService:l(this,_f),svgFactory:new qf,parent:this};for(let n of e){n.borderStyle||(n.borderStyle=iC._defaultBorderStyle),t.data=n;let i=Sm.create(t);i.isRenderable&&(i.render(),i.contentElement.id=`${Xh}${n.id}`,l(this,Hi).push(i))}await X(this,fl,mv).call(this)}update({viewport:e}){let t=this.div;this.viewport=e,Lu(t,{rotation:e.rotation}),X(this,fl,_T).call(this),t.hidden=!1}getEditableAnnotations(){return Array.from(l(this,_u).values())}getEditableAnnotation(e){return l(this,_u).get(e)}addFakeAnnotation(e){let{div:t}=this,{id:n,rotation:i}=e,o=new ZS({data:{id:n,rect:e.getPDFRect(),rotation:i},editor:e,layer:t,parent:this,enableComment:!!this._commentManager,linkService:l(this,_f),annotationStorage:l(this,cp)});return o.render(),o.contentElement.id=`${Xh}${n}`,o.createOrUpdatePopup(),l(this,Hi).push(o),o}removeAnnotation(e){let t=l(this,Hi).findIndex(i=>i.data.id===e);if(t<0)return;let[n]=l(this,Hi).splice(t,1);l(this,vf)?.removePointerInTextLayer(n.contentElement)}updateFakeAnnotations(e){if(e.length!==0){for(let t of e)t.updateFakeAnnotationElement(this);X(this,fl,mv).call(this)}}togglePointerEvents(e=!1){this.div.classList.toggle("disabled",!e)}static get _defaultBorderStyle(){return Et(this,"_defaultBorderStyle",Object.freeze({width:1,rawWidth:1,style:$h.SOLID,dashArray:[3],horizontalCornerRadius:0,verticalCornerRadius:0}))}};vf=new WeakMap,Ef=new WeakMap,cp=new WeakMap,_u=new WeakMap,wy=new WeakMap,_f=new WeakMap,Hi=new WeakMap,vy=new WeakMap,fl=new WeakSet,mv=async function(){if(l(this,Hi).length===0)return;this.div.replaceChildren();let e=[];if(!l(this,vy)){O(this,vy,!0);for(let{contentElement:n,data:{id:i}}of l(this,Hi)){let o=n.id=`${Xh}${i}`;e.push(l(this,wy)?.getAriaAttributes(o).then(s=>{if(s)for(let[a,u]of s)n.setAttribute(a,u)}))}}l(this,Hi).sort(({data:{rect:[n,i,o,s]}},{data:{rect:[a,u,c,f]}})=>{if(n===o&&i===s)return 1;if(a===c&&u===f)return-1;let h=s,d=i,m=(i+s)/2,y=f,v=u,w=(u+f)/2;if(m>=y&&w<=d)return-1;if(w>=h&&m<=v)return 1;let b=(n+o)/2,E=(a+c)/2;return b-E});let t=document.createDocumentFragment();for(let n of l(this,Hi))t.append(n.container),this._commentManager?(n.extraPopupElement?.popup||n.popup)?.renderCommentButton():n.extraPopupElement&&t.append(n.extraPopupElement.render());if(this.div.append(t),await Promise.all(e),l(this,vf))for(let n of l(this,Hi))l(this,vf).addPointerInTextLayer(n.contentElement,!1)},_T=function(){if(!l(this,Ef))return;let e=this.div;for(let[t,n]of l(this,Ef)){let i=e.querySelector(`[data-annotation-id="${t}"]`);if(!i)continue;n.className="annotationContent";let{firstChild:o}=i;o?o.nodeName==="CANVAS"?o.replaceWith(n):o.classList.contains("annotationContent")?o.after(n):o.before(n):i.append(n);let s=l(this,_u).get(t);s&&(s._hasNoCanvas?(this._annotationEditorUIManager?.setMissingCanvas(t,i.id,n),s._hasNoCanvas=!1):s.canvas=n)}l(this,Ef).clear()};oE=iC,Gw=/\r\n?|\n/g,Er=class Er extends br{constructor(t){super({...t,name:"freeTextEditor"});z(this,en);z(this,qi,"");z(this,Ey,`${this.id}-editor`);z(this,Af,null);z(this,Gi);ze(this,"_colorPicker",null);this.color=t.color||Er._defaultColor||br._defaultLineColor,O(this,Gi,t.fontSize||Er._defaultFontSize),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-freetext-added-alert"),this.canAddComment=!1}static get _keyboardManager(){let t=Er.prototype,n=s=>s.isEmpty(),i=Pu.TRANSLATE_SMALL,o=Pu.TRANSLATE_BIG;return Et(this,"_keyboardManager",new Hf([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],t.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],t.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],t._translateEmpty,{args:[-i,0],checker:n}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t._translateEmpty,{args:[-o,0],checker:n}],[["ArrowRight","mac+ArrowRight"],t._translateEmpty,{args:[i,0],checker:n}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t._translateEmpty,{args:[o,0],checker:n}],[["ArrowUp","mac+ArrowUp"],t._translateEmpty,{args:[0,-i],checker:n}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t._translateEmpty,{args:[0,-o],checker:n}],[["ArrowDown","mac+ArrowDown"],t._translateEmpty,{args:[0,i],checker:n}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t._translateEmpty,{args:[0,o],checker:n}]]))}static initialize(t,n){br.initialize(t,n);let i=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(i.getPropertyValue("--freetext-padding"))}static updateDefaultParams(t,n){switch(t){case Ft.FREETEXT_SIZE:Er._defaultFontSize=n;break;case Ft.FREETEXT_COLOR:Er._defaultColor=n;break}}updateParams(t,n){switch(t){case Ft.FREETEXT_SIZE:X(this,en,F3).call(this,n);break;case Ft.FREETEXT_COLOR:X(this,en,U3).call(this,n);break}}static get defaultPropertiesToUpdate(){return[[Ft.FREETEXT_SIZE,Er._defaultFontSize],[Ft.FREETEXT_COLOR,Er._defaultColor||br._defaultLineColor]]}get propertiesToUpdate(){return[[Ft.FREETEXT_SIZE,l(this,Gi)],[Ft.FREETEXT_COLOR,this.color]]}get toolbarButtons(){return this._colorPicker||(this._colorPicker=new Qv(this)),[["colorPicker",this._colorPicker]]}get colorType(){return Ft.FREETEXT_COLOR}onUpdatedColor(){this.editorDiv.style.color=this.color,this._colorPicker?.update(this.color),super.onUpdatedColor()}_translateEmpty(t,n){this._uiManager.translateSelectedEditors(t,n,!0)}getInitialTranslation(){let t=this.parentScale;return[-Er._internalPadding*t,-(Er._internalPadding+l(this,Gi))*t]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){if(!super.enableEditMode())return!1;this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),O(this,Af,new AbortController);let t=this._uiManager.combinedSignal(l(this,Af));return this.editorDiv.addEventListener("keydown",this.editorDivKeydown.bind(this),{signal:t}),this.editorDiv.addEventListener("focus",this.editorDivFocus.bind(this),{signal:t}),this.editorDiv.addEventListener("blur",this.editorDivBlur.bind(this),{signal:t}),this.editorDiv.addEventListener("input",this.editorDivInput.bind(this),{signal:t}),this.editorDiv.addEventListener("paste",this.editorDivPaste.bind(this),{signal:t}),!0}disableEditMode(){return super.disableEditMode()?(this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",l(this,Ey)),this._isDraggable=!0,l(this,Af)?.abort(),O(this,Af,null),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freetextEditing"),!0):!1}focusin(t){this._focusEventsAllowed&&(super.focusin(t),t.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(t){this.width||(this.enableEditMode(),t&&this.editorDiv.focus(),this._initialOptions?.isCentered&&this.center(),this._initialOptions=null)}isEmpty(){return!this.editorDiv||this.editorDiv.innerText.trim()===""}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freetextEditing")),super.remove()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();let t=l(this,qi),n=O(this,qi,X(this,en,j3).call(this).trimEnd());if(t===n)return;let i=o=>{if(O(this,qi,o),!o){this.remove();return}X(this,en,wv).call(this),this._uiManager.rebuild(this),X(this,en,yv).call(this)};this.addCommands({cmd:()=>{i(n)},undo:()=>{i(t)},mustExec:!1}),X(this,en,yv).call(this)}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}keydown(t){t.target===this.div&&t.key==="Enter"&&(this.enterInEditMode(),t.preventDefault())}editorDivKeydown(t){Er._keyboardManager.exec(this,t)}editorDivFocus(t){this.isEditing=!0}editorDivBlur(t){this.isEditing=!1}editorDivInput(t){this.parent.div.classList.toggle("freetextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}get canChangeContent(){return!0}render(){if(this.div)return this.div;let t,n;(this._isCopy||this.annotationElementId)&&(t=this.x,n=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",l(this,Ey)),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text2"),this.editorDiv.setAttribute("data-l10n-attrs","default-content"),this.enableEditing(),this.editorDiv.contentEditable=!0;let{style:i}=this.editorDiv;if(i.fontSize=`calc(${l(this,Gi)}px * var(--total-scale-factor))`,i.color=this.color,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),this._isCopy||this.annotationElementId){let[o,s]=this.parentDimensions;if(this.annotationElementId){let{position:a}=this._initialData,[u,c]=this.getInitialTranslation();[u,c]=this.pageTranslationToScreen(u,c);let[f,h]=this.pageDimensions,[d,m]=this.pageTranslation,y,v;switch(this.rotation){case 0:y=t+(a[0]-d)/f,v=n+this.height-(a[1]-m)/h;break;case 90:y=t+(a[0]-d)/f,v=n-(a[1]-m)/h,[u,c]=[c,-u];break;case 180:y=t-this.width+(a[0]-d)/f,v=n-(a[1]-m)/h,[u,c]=[-u,-c];break;case 270:y=t+(a[0]-d-this.height*h)/f,v=n+(a[1]-m-this.width*f)/h,[u,c]=[-c,u];break}this.setAt(y*o,v*s,u,c)}else this._moveAfterPaste(t,n);X(this,en,wv).call(this),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}editorDivPaste(t){var y,v,w;let n=t.clipboardData||window.clipboardData,{types:i}=n;if(i.length===1&&i[0]==="text/plain")return;t.preventDefault();let o=X(y=Er,hl,xT).call(y,n.getData("text")||"").replaceAll(Gw,`
|
|
98
|
-
`);if(!o)return;let s=window.getSelection();if(!s.rangeCount)return;this.editorDiv.normalize(),s.deleteFromDocument();let a=s.getRangeAt(0);if(!o.includes(`
|
|
99
|
-
`)){a.insertNode(document.createTextNode(o)),this.editorDiv.normalize(),s.collapseToStart();return}let{startContainer:u,startOffset:c}=a,f=[],h=[];if(u.nodeType===Node.TEXT_NODE){let b=u.parentElement;if(h.push(u.nodeValue.slice(c).replaceAll(Gw,"")),b!==this.editorDiv){let E=f;for(let _ of this.editorDiv.childNodes){if(_===b){E=h;continue}E.push(X(v=Er,hl,bv).call(v,_))}}f.push(u.nodeValue.slice(0,c).replaceAll(Gw,""))}else if(u===this.editorDiv){let b=f,E=0;for(let _ of this.editorDiv.childNodes)E++===c&&(b=h),b.push(X(w=Er,hl,bv).call(w,_))}O(this,qi,`${f.join(`
|
|
100
|
-
`)}${o}${h.join(`
|
|
101
|
-
`)}`),X(this,en,wv).call(this);let d=new Range,m=Math.sumPrecise(f.map(b=>b.length));for(let{firstChild:b}of this.editorDiv.childNodes)if(b.nodeType===Node.TEXT_NODE){let E=b.nodeValue.length;if(m<=E){d.setStart(b,m),d.setEnd(b,m);break}m-=E}s.removeAllRanges(),s.addRange(d)}get contentDiv(){return this.editorDiv}getPDFRect(){let t=Er._internalPadding*this.parentScale;return this.getRect(t,t)}static async deserialize(t,n,i){var a;let o=null;if(t instanceof rE){let{data:{defaultAppearanceData:{fontSize:u,fontColor:c},rect:f,rotation:h,id:d,popupRef:m,richText:y,contentsObj:v,creationDate:w,modificationDate:b},textContent:E,textPosition:_,parent:{page:{pageNumber:S}}}=t;if(!E||E.length===0)return null;o=t={annotationType:At.FREETEXT,color:Array.from(c),fontSize:u,value:E.join(`
|
|
102
|
-
`),position:_,pageIndex:S-1,rect:f.slice(0),rotation:h,annotationElementId:d,id:d,deleted:!1,popupRef:m,comment:v?.str||null,richText:y,creationDate:w,modificationDate:b}}let s=await super.deserialize(t,n,i);return O(s,Gi,t.fontSize),s.color=at.makeHexColor(...t.color),O(s,qi,X(a=Er,hl,xT).call(a,t.value)),s._initialData=o,t.comment&&s.setCommentData(t),s}serialize(t=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();let n=br._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.color),i=Object.assign(super.serialize(t),{color:n,fontSize:l(this,Gi),value:X(this,en,$3).call(this)});return this.addComment(i),t?(i.isCopy=!0,i):this.annotationElementId&&!X(this,en,W3).call(this,i)?null:(i.id=this.annotationElementId,i)}renderAnnotationElement(t){let n=super.renderAnnotationElement(t);if(!n)return null;let{style:i}=n;i.fontSize=`calc(${l(this,Gi)}px * var(--total-scale-factor))`,i.color=this.color,n.replaceChildren();for(let o of l(this,qi).split(`
|
|
103
|
-
`)){let s=document.createElement("div");s.append(o?document.createTextNode(o):document.createElement("br")),n.append(s)}return t.updateEdited({rect:this.getPDFRect(),popup:this._uiManager.hasCommentManager()||this.hasEditedComment?this.comment:{text:l(this,qi)}}),n}resetAnnotationElement(t){super.resetAnnotationElement(t),t.resetEdited()}};qi=new WeakMap,Ey=new WeakMap,Af=new WeakMap,Gi=new WeakMap,en=new WeakSet,F3=function(t){let n=o=>{this.editorDiv.style.fontSize=`calc(${o}px * var(--total-scale-factor))`,this.translate(0,-(o-l(this,Gi))*this.parentScale),O(this,Gi,o),X(this,en,yv).call(this)},i=l(this,Gi);this.addCommands({cmd:n.bind(this,t),undo:n.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Ft.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})},U3=function(t){let n=o=>{this.color=o,this.onUpdatedColor()},i=this.color;this.addCommands({cmd:n.bind(this,t),undo:n.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Ft.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})},j3=function(){var i;let t=[];this.editorDiv.normalize();let n=null;for(let o of this.editorDiv.childNodes)n?.nodeType===Node.TEXT_NODE&&o.nodeName==="BR"||(t.push(X(i=Er,hl,bv).call(i,o)),n=o);return t.join(`
|
|
104
|
-
`)},yv=function(){let[t,n]=this.parentDimensions,i;if(this.isAttachedToDOM)i=this.div.getBoundingClientRect();else{let{currentLayer:o,div:s}=this,a=s.style.display,u=s.classList.contains("hidden");s.classList.remove("hidden"),s.style.display="hidden",o.div.append(this.div),i=s.getBoundingClientRect(),s.remove(),s.style.display=a,s.classList.toggle("hidden",u)}this.rotation%180===this.parentRotation%180?(this.width=i.width/t,this.height=i.height/n):(this.width=i.height/t,this.height=i.width/n),this.fixAndSetPosition()},hl=new WeakSet,bv=function(t){return(t.nodeType===Node.TEXT_NODE?t.nodeValue:t.innerText).replaceAll(Gw,"")},wv=function(){if(this.editorDiv.replaceChildren(),!!l(this,qi))for(let t of l(this,qi).split(`
|
|
105
|
-
`)){let n=document.createElement("div");n.append(t?document.createTextNode(t):document.createElement("br")),this.editorDiv.append(n)}},$3=function(){return l(this,qi).replaceAll("\xA0"," ")},xT=function(t){return t.replaceAll(" ","\xA0")},W3=function(t){let{value:n,fontSize:i,color:o,pageIndex:s}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||t.value!==n||t.fontSize!==i||t.color.some((a,u)=>a!==o[u])||t.pageIndex!==s},z(Er,hl),ze(Er,"_freeTextDefaultContent",""),ze(Er,"_internalPadding",0),ze(Er,"_defaultColor",null),ze(Er,"_defaultFontSize",10),ze(Er,"_type","freetext"),ze(Er,"_editorType",At.FREETEXT);AT=Er,ut=class{toSVGPath(){Vt("Abstract method `toSVGPath` must be implemented.")}get box(){Vt("Abstract getter `box` must be implemented.")}serialize(e,t){Vt("Abstract method `serialize` must be implemented.")}static _rescale(e,t,n,i,o,s){s||(s=new Float32Array(e.length));for(let a=0,u=e.length;a<u;a+=2)s[a]=t+e[a]*i,s[a+1]=n+e[a+1]*o;return s}static _rescaleAndSwap(e,t,n,i,o,s){s||(s=new Float32Array(e.length));for(let a=0,u=e.length;a<u;a+=2)s[a]=t+e[a+1]*i,s[a+1]=n+e[a]*o;return s}static _translate(e,t,n,i){i||(i=new Float32Array(e.length));for(let o=0,s=e.length;o<s;o+=2)i[o]=t+e[o],i[o+1]=n+e[o+1];return i}static svgRound(e){return Math.round(e*1e4)}static _normalizePoint(e,t,n,i,o){switch(o){case 90:return[1-t/n,e/i];case 180:return[1-e/n,1-t/i];case 270:return[t/n,1-e/i];default:return[e/n,t/i]}}static _normalizePagePoint(e,t,n){switch(n){case 90:return[1-t,e];case 180:return[1-e,1-t];case 270:return[t,1-e];default:return[e,t]}}static createBezierPoints(e,t,n,i,o,s){return[(e+5*n)/6,(t+5*i)/6,(5*n+o)/6,(5*i+s)/6,(n+o)/2,(i+s)/2]}};ze(ut,"PRECISION",1e-4);Ra=class Ra{constructor({x:e,y:t},n,i,o,s,a=0){z(this,pn);z(this,Vi);z(this,Qs,[]);z(this,fp);z(this,hp);z(this,qo,[]);z(this,Lt,new Float32Array(18));z(this,xf);z(this,Sf);z(this,_y);z(this,Ay);z(this,dp);z(this,pp);z(this,Au,[]);O(this,Vi,n),O(this,pp,o*i),O(this,hp,s),l(this,Lt).set([NaN,NaN,NaN,NaN,e,t],6),O(this,fp,a),O(this,Ay,l(Ra,xy)*i),O(this,_y,l(Ra,IE)*i),O(this,dp,i),l(this,Au).push(e,t)}isEmpty(){return isNaN(l(this,Lt)[8])}add({x:e,y:t}){O(this,xf,e),O(this,Sf,t);let[n,i,o,s]=l(this,Vi),[a,u,c,f]=l(this,Lt).subarray(8,12),h=e-c,d=t-f,m=Math.hypot(h,d);if(m<l(this,_y))return!1;let y=m-l(this,Ay),v=y/m,w=v*h,b=v*d,E=a,_=u;a=c,u=f,c+=w,f+=b,l(this,Au)?.push(e,t);let S=-b/y,A=w/y,F=S*l(this,pp),I=A*l(this,pp);return l(this,Lt).set(l(this,Lt).subarray(2,8),0),l(this,Lt).set([c+F,f+I],4),l(this,Lt).set(l(this,Lt).subarray(14,18),12),l(this,Lt).set([c-F,f-I],16),isNaN(l(this,Lt)[6])?(l(this,qo).length===0&&(l(this,Lt).set([a+F,u+I],2),l(this,qo).push(NaN,NaN,NaN,NaN,(a+F-n)/o,(u+I-i)/s),l(this,Lt).set([a-F,u-I],14),l(this,Qs).push(NaN,NaN,NaN,NaN,(a-F-n)/o,(u-I-i)/s)),l(this,Lt).set([E,_,a,u,c,f],6),!this.isEmpty()):(l(this,Lt).set([E,_,a,u,c,f],6),Math.abs(Math.atan2(_-u,E-a)-Math.atan2(b,w))<Math.PI/2?([a,u,c,f]=l(this,Lt).subarray(2,6),l(this,qo).push(NaN,NaN,NaN,NaN,((a+c)/2-n)/o,((u+f)/2-i)/s),[a,u,E,_]=l(this,Lt).subarray(14,18),l(this,Qs).push(NaN,NaN,NaN,NaN,((E+a)/2-n)/o,((_+u)/2-i)/s),!0):([E,_,a,u,c,f]=l(this,Lt).subarray(0,6),l(this,qo).push(((E+5*a)/6-n)/o,((_+5*u)/6-i)/s,((5*a+c)/6-n)/o,((5*u+f)/6-i)/s,((a+c)/2-n)/o,((u+f)/2-i)/s),[c,f,a,u,E,_]=l(this,Lt).subarray(12,18),l(this,Qs).push(((E+5*a)/6-n)/o,((_+5*u)/6-i)/s,((5*a+c)/6-n)/o,((5*u+f)/6-i)/s,((a+c)/2-n)/o,((u+f)/2-i)/s),!0))}toSVGPath(){if(this.isEmpty())return"";let e=l(this,qo),t=l(this,Qs);if(isNaN(l(this,Lt)[6])&&!this.isEmpty())return X(this,pn,z3).call(this);let n=[];n.push(`M${e[4]} ${e[5]}`);for(let i=6;i<e.length;i+=6)isNaN(e[i])?n.push(`L${e[i+4]} ${e[i+5]}`):n.push(`C${e[i]} ${e[i+1]} ${e[i+2]} ${e[i+3]} ${e[i+4]} ${e[i+5]}`);X(this,pn,q3).call(this,n);for(let i=t.length-6;i>=6;i-=6)isNaN(t[i])?n.push(`L${t[i+4]} ${t[i+5]}`):n.push(`C${t[i]} ${t[i+1]} ${t[i+2]} ${t[i+3]} ${t[i+4]} ${t[i+5]}`);return X(this,pn,H3).call(this,n),n.join(" ")}newFreeDrawOutline(e,t,n,i,o,s){return new lE(e,t,n,i,o,s)}getOutlines(){let e=l(this,qo),t=l(this,Qs),n=l(this,Lt),[i,o,s,a]=l(this,Vi),u=new Float32Array((l(this,Au)?.length??0)+2);for(let h=0,d=u.length-2;h<d;h+=2)u[h]=(l(this,Au)[h]-i)/s,u[h+1]=(l(this,Au)[h+1]-o)/a;if(u[u.length-2]=(l(this,xf)-i)/s,u[u.length-1]=(l(this,Sf)-o)/a,isNaN(n[6])&&!this.isEmpty())return X(this,pn,G3).call(this,u);let c=new Float32Array(l(this,qo).length+24+l(this,Qs).length),f=e.length;for(let h=0;h<f;h+=2){if(isNaN(e[h])){c[h]=c[h+1]=NaN;continue}c[h]=e[h],c[h+1]=e[h+1]}f=X(this,pn,Y3).call(this,c,f);for(let h=t.length-6;h>=6;h-=6)for(let d=0;d<6;d+=2){if(isNaN(t[h+d])){c[f]=c[f+1]=NaN,f+=2;continue}c[f]=t[h+d],c[f+1]=t[h+d+1],f+=2}return X(this,pn,V3).call(this,c,f),this.newFreeDrawOutline(c,u,l(this,Vi),l(this,dp),l(this,fp),l(this,hp))}};Vi=new WeakMap,Qs=new WeakMap,fp=new WeakMap,hp=new WeakMap,qo=new WeakMap,Lt=new WeakMap,xf=new WeakMap,Sf=new WeakMap,_y=new WeakMap,Ay=new WeakMap,dp=new WeakMap,pp=new WeakMap,Au=new WeakMap,xy=new WeakMap,DE=new WeakMap,IE=new WeakMap,pn=new WeakSet,mm=function(){let e=l(this,Lt).subarray(4,6),t=l(this,Lt).subarray(16,18),[n,i,o,s]=l(this,Vi);return[(l(this,xf)+(e[0]-t[0])/2-n)/o,(l(this,Sf)+(e[1]-t[1])/2-i)/s,(l(this,xf)+(t[0]-e[0])/2-n)/o,(l(this,Sf)+(t[1]-e[1])/2-i)/s]},z3=function(){let[e,t,n,i]=l(this,Vi),[o,s,a,u]=X(this,pn,mm).call(this);return`M${(l(this,Lt)[2]-e)/n} ${(l(this,Lt)[3]-t)/i} L${(l(this,Lt)[4]-e)/n} ${(l(this,Lt)[5]-t)/i} L${o} ${s} L${a} ${u} L${(l(this,Lt)[16]-e)/n} ${(l(this,Lt)[17]-t)/i} L${(l(this,Lt)[14]-e)/n} ${(l(this,Lt)[15]-t)/i} Z`},H3=function(e){let t=l(this,Qs);e.push(`L${t[4]} ${t[5]} Z`)},q3=function(e){let[t,n,i,o]=l(this,Vi),s=l(this,Lt).subarray(4,6),a=l(this,Lt).subarray(16,18),[u,c,f,h]=X(this,pn,mm).call(this);e.push(`L${(s[0]-t)/i} ${(s[1]-n)/o} L${u} ${c} L${f} ${h} L${(a[0]-t)/i} ${(a[1]-n)/o}`)},G3=function(e){let t=l(this,Lt),[n,i,o,s]=l(this,Vi),[a,u,c,f]=X(this,pn,mm).call(this),h=new Float32Array(36);return h.set([NaN,NaN,NaN,NaN,(t[2]-n)/o,(t[3]-i)/s,NaN,NaN,NaN,NaN,(t[4]-n)/o,(t[5]-i)/s,NaN,NaN,NaN,NaN,a,u,NaN,NaN,NaN,NaN,c,f,NaN,NaN,NaN,NaN,(t[16]-n)/o,(t[17]-i)/s,NaN,NaN,NaN,NaN,(t[14]-n)/o,(t[15]-i)/s],0),this.newFreeDrawOutline(h,e,l(this,Vi),l(this,dp),l(this,fp),l(this,hp))},V3=function(e,t){let n=l(this,Qs);return e.set([NaN,NaN,NaN,NaN,n[4],n[5]],t),t+=6},Y3=function(e,t){let n=l(this,Lt).subarray(4,6),i=l(this,Lt).subarray(16,18),[o,s,a,u]=l(this,Vi),[c,f,h,d]=X(this,pn,mm).call(this);return e.set([NaN,NaN,NaN,NaN,(n[0]-o)/a,(n[1]-s)/u,NaN,NaN,NaN,NaN,c,f,NaN,NaN,NaN,NaN,h,d,NaN,NaN,NaN,NaN,(i[0]-o)/a,(i[1]-s)/u],t),t+=24},z(Ra,xy,8),z(Ra,DE,2),z(Ra,IE,l(Ra,xy)+l(Ra,DE));aE=Ra,lE=class extends ut{constructor(t,n,i,o,s,a){super();z(this,NE);z(this,gp);z(this,Tf,new Float32Array(4));z(this,rl);z(this,Sy);z(this,Yi);z(this,Ty);z(this,Xr);O(this,Xr,t),O(this,Yi,n),O(this,gp,i),O(this,Ty,o),O(this,rl,s),O(this,Sy,a),this.firstPoint=[NaN,NaN],this.lastPoint=[NaN,NaN],X(this,NE,X3).call(this,a);let[u,c,f,h]=l(this,Tf);for(let d=0,m=t.length;d<m;d+=2)t[d]=(t[d]-u)/f,t[d+1]=(t[d+1]-c)/h;for(let d=0,m=n.length;d<m;d+=2)n[d]=(n[d]-u)/f,n[d+1]=(n[d+1]-c)/h}toSVGPath(){let t=[`M${l(this,Xr)[4]} ${l(this,Xr)[5]}`];for(let n=6,i=l(this,Xr).length;n<i;n+=6){if(isNaN(l(this,Xr)[n])){t.push(`L${l(this,Xr)[n+4]} ${l(this,Xr)[n+5]}`);continue}t.push(`C${l(this,Xr)[n]} ${l(this,Xr)[n+1]} ${l(this,Xr)[n+2]} ${l(this,Xr)[n+3]} ${l(this,Xr)[n+4]} ${l(this,Xr)[n+5]}`)}return t.push("Z"),t.join(" ")}serialize([t,n,i,o],s){let a=i-t,u=o-n,c,f;switch(s){case 0:c=ut._rescale(l(this,Xr),t,o,a,-u),f=ut._rescale(l(this,Yi),t,o,a,-u);break;case 90:c=ut._rescaleAndSwap(l(this,Xr),t,n,a,u),f=ut._rescaleAndSwap(l(this,Yi),t,n,a,u);break;case 180:c=ut._rescale(l(this,Xr),i,n,-a,u),f=ut._rescale(l(this,Yi),i,n,-a,u);break;case 270:c=ut._rescaleAndSwap(l(this,Xr),i,o,-a,-u),f=ut._rescaleAndSwap(l(this,Yi),i,o,-a,-u);break}return{outline:Array.from(c),points:[Array.from(f)]}}get box(){return l(this,Tf)}newOutliner(t,n,i,o,s,a=0){return new aE(t,n,i,o,s,a)}getNewOutline(t,n){let[i,o,s,a]=l(this,Tf),[u,c,f,h]=l(this,gp),d=s*f,m=a*h,y=i*f+u,v=o*h+c,w=this.newOutliner({x:l(this,Yi)[0]*d+y,y:l(this,Yi)[1]*m+v},l(this,gp),l(this,Ty),t,l(this,Sy),n??l(this,rl));for(let b=2;b<l(this,Yi).length;b+=2)w.add({x:l(this,Yi)[b]*d+y,y:l(this,Yi)[b+1]*m+v});return w.getOutlines()}};gp=new WeakMap,Tf=new WeakMap,rl=new WeakMap,Sy=new WeakMap,Yi=new WeakMap,Ty=new WeakMap,Xr=new WeakMap,NE=new WeakSet,X3=function(t){let n=l(this,Xr),i=n[4],o=n[5],s=[i,o,i,o],a=i,u=o,c=i,f=o,h=t?Math.max:Math.min,d=new Float32Array(4);for(let y=6,v=n.length;y<v;y+=6){let w=n[y+4],b=n[y+5];isNaN(n[y])?(at.pointBoundingBox(w,b,s),u>b?(a=w,u=b):u===b&&(a=h(a,w)),f<b?(c=w,f=b):f===b&&(c=h(c,w))):(d[0]=d[1]=1/0,d[2]=d[3]=-1/0,at.bezierBoundingBox(i,o,...n.slice(y,y+6),d),at.rectBoundingBox(d[0],d[1],d[2],d[3],s),u>d[1]?(a=d[0],u=d[1]):u===d[1]&&(a=h(a,d[0])),f<d[3]?(c=d[2],f=d[3]):f===d[3]&&(c=h(c,d[2]))),i=w,o=b}let m=l(this,Tf);m[0]=s[0]-l(this,rl),m[1]=s[1]-l(this,rl),m[2]=s[2]-s[0]+2*l(this,rl),m[3]=s[3]-s[1]+2*l(this,rl),this.firstPoint=[a,u],this.lastPoint=[c,f]};Um=class{constructor(e,t=0,n=0,i=!0){z(this,si);z(this,Cy);z(this,Ry);z(this,Dy);z(this,xu,[]);z(this,eo,[]);let o=[1/0,1/0,-1/0,-1/0],a=10**-4;for(let{x:w,y:b,width:E,height:_}of e){let S=Math.floor((w-t)/a)*a,A=Math.ceil((w+E+t)/a)*a,F=Math.floor((b-t)/a)*a,I=Math.ceil((b+_+t)/a)*a,q=[S,F,I,!0],ee=[A,F,I,!1];l(this,xu).push(q,ee),at.rectBoundingBox(S,F,A,I,o)}let u=o[2]-o[0]+2*n,c=o[3]-o[1]+2*n,f=o[0]-n,h=o[1]-n,d=i?-1/0:1/0,m=1/0,y=l(this,xu).at(i?-1:-2),v=[y[0],y[2]];for(let w of l(this,xu)){let[b,E,_,S]=w;!S&&i?E<m?(m=E,d=b):E===m&&(d=Math.max(d,b)):S&&!i&&(E<m?(m=E,d=b):E===m&&(d=Math.min(d,b))),w[0]=(b-f)/u,w[1]=(E-h)/c,w[2]=(_-h)/c}O(this,Cy,new Float32Array([f,h,u,c])),O(this,Ry,[d,m]),O(this,Dy,v)}getOutlines(){l(this,xu).sort((t,n)=>t[0]-n[0]||t[1]-n[1]||t[2]-n[2]);let e=[];for(let t of l(this,xu))t[3]?(e.push(...X(this,si,ST).call(this,t)),X(this,si,Z3).call(this,t)):(X(this,si,J3).call(this,t),e.push(...X(this,si,ST).call(this,t)));return X(this,si,K3).call(this,e)}};Cy=new WeakMap,Ry=new WeakMap,Dy=new WeakMap,xu=new WeakMap,eo=new WeakMap,si=new WeakSet,K3=function(e){let t=[],n=new Set;for(let s of e){let[a,u,c]=s;t.push([a,u,s],[a,c,s])}t.sort((s,a)=>s[1]-a[1]||s[0]-a[0]);for(let s=0,a=t.length;s<a;s+=2){let u=t[s][2],c=t[s+1][2];u.push(c),c.push(u),n.add(u),n.add(c)}let i=[],o;for(;n.size>0;){let s=n.values().next().value,[a,u,c,f,h]=s;n.delete(s);let d=a,m=u;for(o=[a,c],i.push(o);;){let y;if(n.has(f))y=f;else if(n.has(h))y=h;else break;n.delete(y),[a,u,c,f,h]=y,d!==a&&(o.push(d,m,a,m===u?u:c),d=a),m=m===u?c:u}o.push(d,m)}return new TT(i,l(this,Cy),l(this,Ry),l(this,Dy))},vv=function(e){let t=l(this,eo),n=0,i=t.length-1;for(;n<=i;){let o=n+i>>1,s=t[o][0];if(s===e)return o;s<e?n=o+1:i=o-1}return i+1},Z3=function([,e,t]){let n=X(this,si,vv).call(this,e);l(this,eo).splice(n,0,[e,t])},J3=function([,e,t]){let n=X(this,si,vv).call(this,e);for(let i=n;i<l(this,eo).length;i++){let[o,s]=l(this,eo)[i];if(o!==e)break;if(o===e&&s===t){l(this,eo).splice(i,1);return}}for(let i=n-1;i>=0;i--){let[o,s]=l(this,eo)[i];if(o!==e)break;if(o===e&&s===t){l(this,eo).splice(i,1);return}}},ST=function(e){let[t,n,i]=e,o=[[t,n,i]],s=X(this,si,vv).call(this,i);for(let a=0;a<s;a++){let[u,c]=l(this,eo)[a];for(let f=0,h=o.length;f<h;f++){let[,d,m]=o[f];if(!(c<=d||m<=u)){if(d>=u){if(m>c)o[f][1]=c;else{if(h===1)return[];o.splice(f,1),f--,h--}continue}o[f][2]=u,m>c&&o.push([t,c,m])}}}return o};TT=class extends ut{constructor(t,n,i,o){super();z(this,Iy);z(this,mp);O(this,mp,t),O(this,Iy,n),this.firstPoint=i,this.lastPoint=o}toSVGPath(){let t=[];for(let n of l(this,mp)){let[i,o]=n;t.push(`M${i} ${o}`);for(let s=2;s<n.length;s+=2){let a=n[s],u=n[s+1];a===i?(t.push(`V${u}`),o=u):u===o&&(t.push(`H${a}`),i=a)}t.push("Z")}return t.join(" ")}serialize([t,n,i,o],s){let a=[],u=i-t,c=o-n;for(let f of l(this,mp)){let h=new Array(f.length);for(let d=0;d<f.length;d+=2)h[d]=t+f[d]*u,h[d+1]=o-f[d+1]*c;a.push(h)}return a}get box(){return l(this,Iy)}get classNamesForOutlining(){return["highlightOutline"]}};Iy=new WeakMap,mp=new WeakMap;jm=class extends aE{newFreeDrawOutline(e,t,n,i,o,s){return new CT(e,t,n,i,o,s)}},CT=class extends lE{newOutliner(e,t,n,i,o,s=0){return new jm(e,t,n,i,o,s)}},Gt=class Gt extends br{constructor(t){super({...t,name:"highlightEditor"});z(this,Rt);z(this,yp,null);z(this,Ny,0);z(this,nl);z(this,Cf,null);z(this,Oy,null);z(this,Si,null);z(this,ky,null);z(this,Ly,0);z(this,Rf,null);z(this,Xi,null);z(this,Ki,null);z(this,On,!1);z(this,bp,null);z(this,wp,null);z(this,Vn,null);z(this,vp,"");z(this,Is);z(this,Py,"");this.color=t.color||Gt._defaultColor,O(this,Is,t.thickness||Gt._defaultThickness),this.opacity=t.opacity||Gt._defaultOpacity,O(this,nl,t.boxes||null),O(this,Py,t.methodOfCreation||""),O(this,vp,t.text||""),this._isDraggable=!1,this.defaultL10nId="pdfjs-editor-highlight-editor",t.highlightId>-1?(O(this,On,!0),X(this,Rt,Ev).call(this,t),X(this,Rt,xc).call(this)):l(this,nl)&&(O(this,yp,t.anchorNode),O(this,Ny,t.anchorOffset),O(this,ky,t.focusNode),O(this,Ly,t.focusOffset),X(this,Rt,RT).call(this),X(this,Rt,xc).call(this),this.rotate(this.rotation)),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-highlight-added-alert")}static get _keyboardManager(){let t=Gt.prototype;return Et(this,"_keyboardManager",new Hf([[["ArrowLeft","mac+ArrowLeft"],t._moveCaret,{args:[0]}],[["ArrowRight","mac+ArrowRight"],t._moveCaret,{args:[1]}],[["ArrowUp","mac+ArrowUp"],t._moveCaret,{args:[2]}],[["ArrowDown","mac+ArrowDown"],t._moveCaret,{args:[3]}]]))}get telemetryInitialData(){return{action:"added",type:l(this,On)?"free_highlight":"highlight",color:this._uiManager.getNonHCMColorName(this.color),thickness:l(this,Is),methodOfCreation:l(this,Py)}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.getNonHCMColorName(this.color)}}static computeTelemetryFinalData(t){return{numberOfColors:t.get("color").size}}static initialize(t,n){br.initialize(t,n),Gt._defaultColor||(Gt._defaultColor=n.highlightColors?.values().next().value||"#fff066")}static updateDefaultParams(t,n){switch(t){case Ft.HIGHLIGHT_COLOR:Gt._defaultColor=n;break;case Ft.HIGHLIGHT_THICKNESS:Gt._defaultThickness=n;break}}translateInPage(t,n){}get toolbarPosition(){return l(this,wp)}get commentButtonPosition(){return l(this,bp)}updateParams(t,n){switch(t){case Ft.HIGHLIGHT_COLOR:X(this,Rt,Q3).call(this,n);break;case Ft.HIGHLIGHT_THICKNESS:X(this,Rt,e8).call(this,n);break}}static get defaultPropertiesToUpdate(){return[[Ft.HIGHLIGHT_COLOR,Gt._defaultColor],[Ft.HIGHLIGHT_THICKNESS,Gt._defaultThickness]]}get propertiesToUpdate(){return[[Ft.HIGHLIGHT_COLOR,this.color||Gt._defaultColor],[Ft.HIGHLIGHT_THICKNESS,l(this,Is)||Gt._defaultThickness],[Ft.HIGHLIGHT_FREE,l(this,On)]]}onUpdatedColor(){this.parent?.drawLayer.updateProperties(l(this,Ki),{root:{fill:this.color,"fill-opacity":this.opacity}}),l(this,Oy)?.updateColor(this.color),super.onUpdatedColor()}get toolbarButtons(){return this._uiManager.highlightColors?[["colorPicker",O(this,Oy,new Pm({editor:this}))]]:super.toolbarButtons}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition(X(this,Rt,Av).call(this))}getBaseTranslation(){return[0,0]}getRect(t,n){return super.getRect(t,n,X(this,Rt,Av).call(this))}onceAdded(t){this.annotationElementId||this.parent.addUndoableEditor(this),t&&this.div.focus()}remove(){X(this,Rt,DT).call(this),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(X(this,Rt,xc).call(this),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){let n=!1;this.parent&&!t?X(this,Rt,DT).call(this):t&&(X(this,Rt,xc).call(this,t),n=!this.parent&&this.div?.classList.contains("selectedEditor")),super.setParent(t),this.show(this._isVisible),n&&this.select()}rotate(t){var o,s,a;let{drawLayer:n}=this.parent,i;l(this,On)?(t=(t-this.rotation+360)%360,i=X(o=Gt,Ls,Vh).call(o,l(this,Xi).box,t)):i=X(s=Gt,Ls,Vh).call(s,[this.x,this.y,this.width,this.height],t),n.updateProperties(l(this,Ki),{bbox:i,root:{"data-main-rotation":t}}),n.updateProperties(l(this,Vn),{bbox:X(a=Gt,Ls,Vh).call(a,l(this,Si).box,t),root:{"data-main-rotation":t}})}render(){if(this.div)return this.div;let t=super.render();l(this,vp)&&(t.setAttribute("aria-label",l(this,vp)),t.setAttribute("role","mark")),l(this,On)?t.classList.add("free"):this.div.addEventListener("keydown",X(this,Rt,r8).bind(this),{signal:this._uiManager._signal});let n=O(this,Rf,document.createElement("div"));return t.append(n),n.setAttribute("aria-hidden","true"),n.className="internal",n.style.clipPath=l(this,Cf),this.setDims(),CF(this,l(this,Rf),["pointerover","pointerleave"]),this.enableEditing(),t}pointerover(){this.isSelected||this.parent?.drawLayer.updateProperties(l(this,Vn),{rootClass:{hovered:!0}})}pointerleave(){this.isSelected||this.parent?.drawLayer.updateProperties(l(this,Vn),{rootClass:{hovered:!1}})}_moveCaret(t){switch(this.parent.unselect(this),t){case 0:case 2:X(this,Rt,_v).call(this,!0);break;case 1:case 3:X(this,Rt,_v).call(this,!1);break}}select(){super.select(),l(this,Vn)&&this.parent?.drawLayer.updateProperties(l(this,Vn),{rootClass:{hovered:!1,selected:!0}})}unselect(){super.unselect(),l(this,Vn)&&(this.parent?.drawLayer.updateProperties(l(this,Vn),{rootClass:{selected:!1}}),l(this,On)||X(this,Rt,_v).call(this,!1))}get _mustFixPosition(){return!l(this,On)}show(t=this._isVisible){super.show(t),this.parent&&(this.parent.drawLayer.updateProperties(l(this,Ki),{rootClass:{hidden:!t}}),this.parent.drawLayer.updateProperties(l(this,Vn),{rootClass:{hidden:!t}}))}static startHighlighting(t,n,{target:i,x:o,y:s}){let{x:a,y:u,width:c,height:f}=i.getBoundingClientRect(),h=new AbortController,d=t.combinedSignal(h),m=y=>{h.abort(),X(this,Ls,o8).call(this,t,y)};window.addEventListener("blur",m,{signal:d}),window.addEventListener("pointerup",m,{signal:d}),window.addEventListener("pointerdown",Ir,{capture:!0,passive:!1,signal:d}),window.addEventListener("contextmenu",ss,{signal:d}),i.addEventListener("pointermove",X(this,Ls,s8).bind(this,t),{signal:d}),this._freeHighlight=new jm({x:o,y:s},[a,u,c,f],t.scale,this._defaultThickness/2,n,.001),{id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=t.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:this._defaultColor,"fill-opacity":this._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:this._freeHighlight.toSVGPath()}},!0,!0)}static async deserialize(t,n,i){var v,w,b,E;let o=null;if(t instanceof iE){let{data:{quadPoints:_,rect:S,rotation:A,id:F,color:I,opacity:q,popupRef:ee,richText:K,contentsObj:ne,creationDate:L,modificationDate:$},parent:{page:{pageNumber:Y}}}=t;o=t={annotationType:At.HIGHLIGHT,color:Array.from(I),opacity:q,quadPoints:_,boxes:null,pageIndex:Y-1,rect:S.slice(0),rotation:A,annotationElementId:F,id:F,deleted:!1,popupRef:ee,richText:K,comment:ne?.str||null,creationDate:L,modificationDate:$}}else if(t instanceof Fm){let{data:{inkLists:_,rect:S,rotation:A,id:F,color:I,borderStyle:{rawWidth:q},popupRef:ee,richText:K,contentsObj:ne,creationDate:L,modificationDate:$},parent:{page:{pageNumber:Y}}}=t;o=t={annotationType:At.HIGHLIGHT,color:Array.from(I),thickness:q,inkLists:_,boxes:null,pageIndex:Y-1,rect:S.slice(0),rotation:A,annotationElementId:F,id:F,deleted:!1,popupRef:ee,richText:K,comment:ne?.str||null,creationDate:L,modificationDate:$}}let{color:s,quadPoints:a,inkLists:u,opacity:c}=t,f=await super.deserialize(t,n,i);f.color=at.makeHexColor(...s),f.opacity=c||1,u&&O(f,Is,t.thickness),f._initialData=o,t.comment&&f.setCommentData(t);let[h,d]=f.pageDimensions,[m,y]=f.pageTranslation;if(a){let _=O(f,nl,[]);for(let S=0;S<a.length;S+=8)_.push({x:(a[S]-m)/h,y:1-(a[S+1]-y)/d,width:(a[S+2]-a[S])/h,height:(a[S+1]-a[S+5])/d});X(v=f,Rt,RT).call(v),X(w=f,Rt,xc).call(w),f.rotate(f.rotation)}else if(u){O(f,On,!0);let _=u[0],S={x:_[0]-m,y:d-(_[1]-y)},A=new jm(S,[0,0,h,d],1,l(f,Is)/2,!0,.001);for(let q=0,ee=_.length;q<ee;q+=2)S.x=_[q]-m,S.y=d-(_[q+1]-y),A.add(S);let{id:F,clipPathId:I}=n.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:f.color,"fill-opacity":f._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:A.toSVGPath()}},!0,!0);X(b=f,Rt,Ev).call(b,{highlightOutlines:A.getOutlines(),highlightId:F,clipPathId:I}),X(E=f,Rt,xc).call(E),f.rotate(f.parentRotation)}return f}serialize(t=!1){if(this.isEmpty()||t)return null;if(this.deleted)return this.serializeDeleted();let n=br._colorManager.convert(this._uiManager.getNonHCMColor(this.color)),i=super.serialize(t);return Object.assign(i,{color:n,opacity:this.opacity,thickness:l(this,Is),quadPoints:X(this,Rt,n8).call(this),outlines:X(this,Rt,i8).call(this,i.rect)}),this.addComment(i),this.annotationElementId&&!X(this,Rt,a8).call(this,i)?null:(i.id=this.annotationElementId,i)}renderAnnotationElement(t){return this.deleted?(t.hide(),null):(t.updateEdited({rect:this.getPDFRect(),popup:this.comment}),null)}static canCreateNewEmptyEditor(){return!1}};yp=new WeakMap,Ny=new WeakMap,nl=new WeakMap,Cf=new WeakMap,Oy=new WeakMap,Si=new WeakMap,ky=new WeakMap,Ly=new WeakMap,Rf=new WeakMap,Xi=new WeakMap,Ki=new WeakMap,On=new WeakMap,bp=new WeakMap,wp=new WeakMap,Vn=new WeakMap,vp=new WeakMap,Is=new WeakMap,Py=new WeakMap,Rt=new WeakSet,RT=function(){let t=new Um(l(this,nl),.001);O(this,Xi,t.getOutlines()),[this.x,this.y,this.width,this.height]=l(this,Xi).box;let n=new Um(l(this,nl),.0025,.001,this._uiManager.direction==="ltr");O(this,Si,n.getOutlines());let{firstPoint:i}=l(this,Xi);O(this,bp,[(i[0]-this.x)/this.width,(i[1]-this.y)/this.height]);let{lastPoint:o}=l(this,Si);O(this,wp,[(o[0]-this.x)/this.width,(o[1]-this.y)/this.height])},Ev=function({highlightOutlines:t,highlightId:n,clipPathId:i}){var d,m;if(O(this,Xi,t),O(this,Si,t.getNewOutline(l(this,Is)/2+1.5,.0025)),n>=0)O(this,Ki,n),O(this,Cf,i),this.parent.drawLayer.finalizeDraw(n,{bbox:t.box,path:{d:t.toSVGPath()}}),O(this,Vn,this.parent.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:!0},bbox:l(this,Si).box,path:{d:l(this,Si).toSVGPath()}},!0));else if(this.parent){let y=this.parent.viewport.rotation;this.parent.drawLayer.updateProperties(l(this,Ki),{bbox:X(d=Gt,Ls,Vh).call(d,l(this,Xi).box,(y-this.rotation+360)%360),path:{d:t.toSVGPath()}}),this.parent.drawLayer.updateProperties(l(this,Vn),{bbox:X(m=Gt,Ls,Vh).call(m,l(this,Si).box,y),path:{d:l(this,Si).toSVGPath()}})}let[s,a,u,c]=t.box;switch(this.rotation){case 0:this.x=s,this.y=a,this.width=u,this.height=c;break;case 90:{let[y,v]=this.parentDimensions;this.x=a,this.y=1-s,this.width=u*v/y,this.height=c*y/v;break}case 180:this.x=1-s,this.y=1-a,this.width=u,this.height=c;break;case 270:{let[y,v]=this.parentDimensions;this.x=1-a,this.y=s,this.width=u*v/y,this.height=c*y/v;break}}let{firstPoint:f}=t;O(this,bp,[(f[0]-s)/u,(f[1]-a)/c]);let{lastPoint:h}=l(this,Si);O(this,wp,[(h[0]-s)/u,(h[1]-a)/c])},Q3=function(t){let n=(s,a)=>{this.color=s,this.opacity=a,this.onUpdatedColor()},i=this.color,o=this.opacity;this.addCommands({cmd:n.bind(this,t,Gt._defaultOpacity),undo:n.bind(this,i,o),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Ft.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.getNonHCMColorName(t)},!0)},e8=function(t){let n=l(this,Is),i=o=>{O(this,Is,o),X(this,Rt,t8).call(this,o)};this.addCommands({cmd:i.bind(this,t),undo:i.bind(this,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Ft.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:t},!0)},t8=function(t){l(this,On)&&(X(this,Rt,Ev).call(this,{highlightOutlines:l(this,Xi).getNewOutline(t/2)}),this.fixAndSetPosition(),this.setDims())},DT=function(){l(this,Ki)===null||!this.parent||(this.parent.drawLayer.remove(l(this,Ki)),O(this,Ki,null),this.parent.drawLayer.remove(l(this,Vn)),O(this,Vn,null))},xc=function(t=this.parent){l(this,Ki)===null&&({id:on(this,Ki)._,clipPathId:on(this,Cf)._}=t.drawLayer.draw({bbox:l(this,Xi).box,root:{viewBox:"0 0 1 1",fill:this.color,"fill-opacity":this.opacity},rootClass:{highlight:!0,free:l(this,On)},path:{d:l(this,Xi).toSVGPath()}},!1,!0),O(this,Vn,t.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:l(this,On)},bbox:l(this,Si).box,path:{d:l(this,Si).toSVGPath()}},l(this,On))),l(this,Rf)&&(l(this,Rf).style.clipPath=l(this,Cf)))},Ls=new WeakSet,Vh=function([t,n,i,o],s){switch(s){case 90:return[1-n-o,t,o,i];case 180:return[1-t-i,1-n-o,i,o];case 270:return[n,1-t-i,o,i]}return[t,n,i,o]},r8=function(t){Gt._keyboardManager.exec(this,t)},_v=function(t){if(!l(this,yp))return;let n=window.getSelection();t?n.setPosition(l(this,yp),l(this,Ny)):n.setPosition(l(this,ky),l(this,Ly))},Av=function(){return l(this,On)?this.rotation:0},n8=function(){if(l(this,On))return null;let[t,n]=this.pageDimensions,[i,o]=this.pageTranslation,s=l(this,nl),a=new Float32Array(s.length*8),u=0;for(let{x:c,y:f,width:h,height:d}of s){let m=c*t+i,y=(1-f)*n+o;a[u]=a[u+4]=m,a[u+1]=a[u+3]=y,a[u+2]=a[u+6]=m+h*t,a[u+5]=a[u+7]=y-d*n,u+=8}return a},i8=function(t){return l(this,Xi).serialize(t,X(this,Rt,Av).call(this))},s8=function(t,n){this._freeHighlight.add(n)&&t.drawLayer.updateProperties(this._freeHighlightId,{path:{d:this._freeHighlight.toSVGPath()}})},o8=function(t,n){this._freeHighlight.isEmpty()?t.drawLayer.remove(this._freeHighlightId):t.createAndAddNewEditor(n,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:"main_toolbar"}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=""},a8=function(t){let{color:n}=this._initialData;return this.hasEditedComment||t.color.some((i,o)=>i!==n[o])},z(Gt,Ls),ze(Gt,"_defaultColor",null),ze(Gt,"_defaultOpacity",1),ze(Gt,"_defaultThickness",12),ze(Gt,"_type","highlight"),ze(Gt,"_editorType",At.HIGHLIGHT),ze(Gt,"_freeHighlightId",-1),ze(Gt,"_freeHighlight",null),ze(Gt,"_freeHighlightClipId","");uE=Gt,cE=class{constructor(){z(this,Df,Object.create(null))}updateProperty(e,t){this[e]=t,this.updateSVGProperty(e,t)}updateProperties(e){if(e)for(let[t,n]of Object.entries(e))t.startsWith("_")||this.updateProperty(t,n)}updateSVGProperty(e,t){l(this,Df)[e]=t}toSVGProperties(){let e=l(this,Df);return O(this,Df,Object.create(null)),{root:e}}reset(){O(this,Df,Object.create(null))}updateAll(e=this){this.updateProperties(e)}clone(){Vt("Not implemented")}};Df=new WeakMap;Bt=class Bt extends br{constructor(t){super(t);z(this,$t);z(this,Zi,null);z(this,Ep);ze(this,"_colorPicker",null);ze(this,"_drawId",null);O(this,Ep,t.mustBeCommitted||!1),this._addOutlines(t)}onUpdatedColor(){this._colorPicker?.update(this.color),super.onUpdatedColor()}_addOutlines(t){t.drawOutlines&&(X(this,$t,IT).call(this,t),X(this,$t,ym).call(this))}static _mergeSVGProperties(t,n){let i=new Set(Object.keys(t));for(let[o,s]of Object.entries(n))i.has(o)?Object.assign(t[o],s):t[o]=s;return t}static getDefaultDrawingOptions(t){Vt("Not implemented")}static get typesMap(){Vt("Not implemented")}static get isDrawer(){return!0}static get supportMultipleDrawings(){return!1}static updateDefaultParams(t,n){let i=this.typesMap.get(t);i&&this._defaultDrawingOptions.updateProperty(i,n),this._currentParent&&(l(Bt,En).updateProperty(i,n),this._currentParent.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}updateParams(t,n){let i=this.constructor.typesMap.get(t);i&&this._updateProperty(t,i,n)}static get defaultPropertiesToUpdate(){let t=[],n=this._defaultDrawingOptions;for(let[i,o]of this.typesMap)t.push([i,n[o]]);return t}get propertiesToUpdate(){let t=[],{_drawingOptions:n}=this;for(let[i,o]of this.constructor.typesMap)t.push([i,n[o]]);return t}_updateProperty(t,n,i){let o=this._drawingOptions,s=o[n],a=u=>{o.updateProperty(n,u);let c=l(this,Zi).updateProperty(n,u);c&&X(this,$t,bm).call(this,c),this.parent?.drawLayer.updateProperties(this._drawId,o.toSVGProperties()),t===this.colorType&&this.onUpdatedColor()};this.addCommands({cmd:a.bind(this,i),undo:a.bind(this,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:t,overwriteIfSameType:!0,keepUndo:!0})}_onResizing(){this.parent?.drawLayer.updateProperties(this._drawId,Bt._mergeSVGProperties(l(this,Zi).getPathResizingSVGProperties(X(this,$t,xv).call(this)),{bbox:X(this,$t,Yh).call(this)}))}_onResized(){this.parent?.drawLayer.updateProperties(this._drawId,Bt._mergeSVGProperties(l(this,Zi).getPathResizedSVGProperties(X(this,$t,xv).call(this)),{bbox:X(this,$t,Yh).call(this)}))}_onTranslating(t,n){this.parent?.drawLayer.updateProperties(this._drawId,{bbox:X(this,$t,Yh).call(this)})}_onTranslated(){this.parent?.drawLayer.updateProperties(this._drawId,Bt._mergeSVGProperties(l(this,Zi).getPathTranslatedSVGProperties(X(this,$t,xv).call(this),this.parentDimensions),{bbox:X(this,$t,Yh).call(this)}))}_onStartDragging(){this.parent?.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!0}})}_onStopDragging(){this.parent?.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!1}})}commit(){super.commit(),this.disableEditMode(),this.disableEditing()}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}getBaseTranslation(){return[0,0]}get isResizable(){return!0}onceAdded(t){this.annotationElementId||this.parent.addUndoableEditor(this),this._isDraggable=!0,l(this,Ep)&&(O(this,Ep,!1),this.commit(),this.parent.setSelected(this),t&&this.isOnScreen&&this.div.focus())}remove(){X(this,$t,OT).call(this),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(X(this,$t,ym).call(this),X(this,$t,bm).call(this,l(this,Zi).box),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){let n=!1;this.parent&&!t?(this._uiManager.removeShouldRescale(this),X(this,$t,OT).call(this)):t&&(this._uiManager.addShouldRescale(this),X(this,$t,ym).call(this,t),n=!this.parent&&this.div?.classList.contains("selectedEditor")),super.setParent(t),n&&this.select()}rotate(){this.parent&&this.parent.drawLayer.updateProperties(this._drawId,Bt._mergeSVGProperties({bbox:X(this,$t,Yh).call(this)},l(this,Zi).updateRotation((this.parentRotation-this.rotation+360)%360)))}onScaleChanging(){this.parent&&X(this,$t,bm).call(this,l(this,Zi).updateParentDimensions(this.parentDimensions,this.parent.scale))}static onScaleChangingWhenDrawing(){}render(){if(this.div)return this.div;let t,n;this._isCopy&&(t=this.x,n=this.y);let i=super.render();i.classList.add("draw");let o=document.createElement("div");return i.append(o),o.setAttribute("aria-hidden","true"),o.className="internal",this.setDims(),this._uiManager.addShouldRescale(this),this.disableEditing(),this._isCopy&&this._moveAfterPaste(t,n),i}static createDrawerInstance(t,n,i,o,s){Vt("Not implemented")}static startDrawing(t,n,i,o){let{target:s,offsetX:a,offsetY:u,pointerId:c,pointerType:f}=o;if(Wn.isInitializedAndDifferentPointerType(f))return;let{viewport:{rotation:h}}=t,{width:d,height:m}=s.getBoundingClientRect(),y=O(Bt,If,new AbortController),v=t.combinedSignal(y);if(Wn.setPointer(f,c),window.addEventListener("pointerup",w=>{Wn.isSamePointerIdOrRemove(w.pointerId)&&this._endDraw(w)},{signal:v}),window.addEventListener("pointercancel",w=>{Wn.isSamePointerIdOrRemove(w.pointerId)&&this._currentParent.endDrawingSession()},{signal:v}),window.addEventListener("pointerdown",w=>{Wn.isSamePointerType(w.pointerType)&&(Wn.initializeAndAddPointerId(w.pointerId),l(Bt,En).isCancellable()&&(l(Bt,En).removeLastElement(),l(Bt,En).isEmpty()?this._currentParent.endDrawingSession(!0):this._endDraw(null)))},{capture:!0,passive:!1,signal:v}),window.addEventListener("contextmenu",ss,{signal:v}),s.addEventListener("pointermove",this._drawMove.bind(this),{signal:v}),s.addEventListener("touchmove",w=>{Wn.isSameTimeStamp(w.timeStamp)&&Ir(w)},{signal:v}),t.toggleDrawing(),n._editorUndoBar?.hide(),l(Bt,En)){t.drawLayer.updateProperties(this._currentDrawId,l(Bt,En).startNew(a,u,d,m,h));return}n.updateUIForDefaultProperties(this),O(Bt,En,this.createDrawerInstance(a,u,d,m,h)),O(Bt,Nf,this.getDefaultDrawingOptions()),this._currentParent=t,{id:this._currentDrawId}=t.drawLayer.draw(this._mergeSVGProperties(l(Bt,Nf).toSVGProperties(),l(Bt,En).defaultSVGProperties),!0,!1)}static _drawMove(t){if(Wn.isSameTimeStamp(t.timeStamp),!l(Bt,En))return;let{offsetX:n,offsetY:i,pointerId:o}=t;if(Wn.isSamePointerId(o)){if(Wn.isUsingMultiplePointers()){this._endDraw(t);return}this._currentParent.drawLayer.updateProperties(this._currentDrawId,l(Bt,En).add(n,i)),Wn.setTimeStamp(t.timeStamp),Ir(t)}}static _cleanup(t){t&&(this._currentDrawId=-1,this._currentParent=null,O(Bt,En,null),O(Bt,Nf,null),Wn.clearTimeStamp()),l(Bt,If)&&(l(Bt,If).abort(),O(Bt,If,null),Wn.clearPointerIds())}static _endDraw(t){let n=this._currentParent;if(n){if(n.toggleDrawing(!0),this._cleanup(!1),t?.target===n.div&&n.drawLayer.updateProperties(this._currentDrawId,l(Bt,En).end(t.offsetX,t.offsetY)),this.supportMultipleDrawings){let i=l(Bt,En),o=this._currentDrawId,s=i.getLastElement();n.addCommands({cmd:()=>{n.drawLayer.updateProperties(o,i.setLastElement(s))},undo:()=>{n.drawLayer.updateProperties(o,i.removeLastElement())},mustExec:!1,type:Ft.DRAW_STEP});return}this.endDrawing(!1)}}static endDrawing(t){let n=this._currentParent;if(!n)return null;if(n.toggleDrawing(!0),n.cleanUndoStack(Ft.DRAW_STEP),!l(Bt,En).isEmpty()){let{pageDimensions:[i,o],scale:s}=n,a=n.createAndAddNewEditor({offsetX:0,offsetY:0},!1,{drawId:this._currentDrawId,drawOutlines:l(Bt,En).getOutlines(i*s,o*s,s,this._INNER_MARGIN),drawingOptions:l(Bt,Nf),mustBeCommitted:!t});return this._cleanup(!0),a}return n.drawLayer.remove(this._currentDrawId),this._cleanup(!0),null}createDrawingOptions(t){}static deserializeDraw(t,n,i,o,s,a){Vt("Not implemented")}static async deserialize(t,n,i){var h,d;let{rawDims:{pageWidth:o,pageHeight:s,pageX:a,pageY:u}}=n.viewport,c=this.deserializeDraw(a,u,o,s,this._INNER_MARGIN,t),f=await super.deserialize(t,n,i);return f.createDrawingOptions(t),X(h=f,$t,IT).call(h,{drawOutlines:c}),X(d=f,$t,ym).call(d),f.onScaleChanging(),f.rotate(),f}serializeDraw(t){let[n,i]=this.pageTranslation,[o,s]=this.pageDimensions;return l(this,Zi).serialize([n,i,o,s],t)}renderAnnotationElement(t){return t.updateEdited({rect:this.getPDFRect()}),null}static canCreateNewEmptyEditor(){return!1}};Zi=new WeakMap,Ep=new WeakMap,En=new WeakMap,If=new WeakMap,Nf=new WeakMap,$t=new WeakSet,IT=function({drawOutlines:t,drawId:n,drawingOptions:i}){O(this,Zi,t),this._drawingOptions||(this._drawingOptions=i),this.annotationElementId||this._uiManager.a11yAlert(`pdfjs-editor-${this.editorType}-added-alert`),n>=0?(this._drawId=n,this.parent.drawLayer.finalizeDraw(n,t.defaultProperties)):this._drawId=X(this,$t,NT).call(this,t,this.parent),X(this,$t,bm).call(this,t.box)},NT=function(t,n){let{id:i}=n.drawLayer.draw(Bt._mergeSVGProperties(this._drawingOptions.toSVGProperties(),t.defaultSVGProperties),!1,!1);return i},OT=function(){this._drawId===null||!this.parent||(this.parent.drawLayer.remove(this._drawId),this._drawId=null,this._drawingOptions.reset())},ym=function(t=this.parent){if(!(this._drawId!==null&&this.parent===t)){if(this._drawId!==null){this.parent.drawLayer.updateParent(this._drawId,t.drawLayer);return}this._drawingOptions.updateAll(),this._drawId=X(this,$t,NT).call(this,l(this,Zi),t)}},l8=function([t,n,i,o]){let{parentDimensions:[s,a],rotation:u}=this;switch(u){case 90:return[n,1-t,i*(a/s),o*(s/a)];case 180:return[1-t,1-n,i,o];case 270:return[1-n,t,i*(a/s),o*(s/a)];default:return[t,n,i,o]}},xv=function(){let{x:t,y:n,width:i,height:o,parentDimensions:[s,a],rotation:u}=this;switch(u){case 90:return[1-n,t,i*(s/a),o*(a/s)];case 180:return[1-t,1-n,i,o];case 270:return[n,1-t,i*(s/a),o*(a/s)];default:return[t,n,i,o]}},bm=function(t){[this.x,this.y,this.width,this.height]=X(this,$t,l8).call(this,t),this.div&&(this.fixAndSetPosition(),this.setDims()),this._onResized()},Yh=function(){let{x:t,y:n,width:i,height:o,rotation:s,parentRotation:a,parentDimensions:[u,c]}=this;switch((s*4+a)/90){case 1:return[1-n-o,t,o,i];case 2:return[1-t-i,1-n-o,i,o];case 3:return[n,1-t-i,o,i];case 4:return[t,n-i*(u/c),o*(c/u),i*(u/c)];case 5:return[1-n,t,i*(u/c),o*(c/u)];case 6:return[1-t-o*(c/u),1-n,o*(c/u),i*(u/c)];case 7:return[n-i*(u/c),1-t-o*(c/u),i*(u/c),o*(c/u)];case 8:return[t-i,n-o,i,o];case 9:return[1-n,t-i,o,i];case 10:return[1-t,1-n,i,o];case 11:return[n-o,1-t,o,i];case 12:return[t-o*(c/u),n,o*(c/u),i*(u/c)];case 13:return[1-n-i*(u/c),t-o*(c/u),i*(u/c),o*(c/u)];case 14:return[1-t,1-n-i*(u/c),o*(c/u),i*(u/c)];case 15:return[n,1-t,i*(u/c),o*(c/u)];default:return[t,n,i,o]}},ze(Bt,"_currentDrawId",-1),ze(Bt,"_currentParent",null),z(Bt,En,null),z(Bt,If,null),z(Bt,Nf,null),ze(Bt,"_INNER_MARGIN",3);fE=Bt,kT=class{constructor(e,t,n,i,o,s){z(this,Ap);z(this,Go,new Float64Array(6));z(this,_n);z(this,An);z(this,Of);z(this,_p);z(this,ei);z(this,kn,"");z(this,Ns,0);z(this,kf,new Vf);z(this,Lf);z(this,Pf);O(this,Lf,n),O(this,Pf,i),O(this,Of,o),O(this,_p,s),[e,t]=X(this,Ap,Sv).call(this,e,t);let a=O(this,_n,[NaN,NaN,NaN,NaN,e,t]);O(this,ei,[e,t]),O(this,An,[{line:a,points:l(this,ei)}]),l(this,Go).set(a,0)}updateProperty(e,t){e==="stroke-width"&&O(this,_p,t)}isEmpty(){return!l(this,An)||l(this,An).length===0}isCancellable(){return l(this,ei).length<=10}add(e,t){[e,t]=X(this,Ap,Sv).call(this,e,t);let[n,i,o,s]=l(this,Go).subarray(2,6),a=e-o,u=t-s;return Math.hypot(l(this,Lf)*a,l(this,Pf)*u)<=2?null:(l(this,ei).push(e,t),isNaN(n)?(l(this,Go).set([o,s,e,t],2),l(this,_n).push(NaN,NaN,NaN,NaN,e,t),{path:{d:this.toSVGPath()}}):(isNaN(l(this,Go)[0])&&l(this,_n).splice(6,6),l(this,Go).set([n,i,o,s,e,t],0),l(this,_n).push(...ut.createBezierPoints(n,i,o,s,e,t)),{path:{d:this.toSVGPath()}}))}end(e,t){let n=this.add(e,t);return n||(l(this,ei).length===2?{path:{d:this.toSVGPath()}}:null)}startNew(e,t,n,i,o){O(this,Lf,n),O(this,Pf,i),O(this,Of,o),[e,t]=X(this,Ap,Sv).call(this,e,t);let s=O(this,_n,[NaN,NaN,NaN,NaN,e,t]);O(this,ei,[e,t]);let a=l(this,An).at(-1);return a&&(a.line=new Float32Array(a.line),a.points=new Float32Array(a.points)),l(this,An).push({line:s,points:l(this,ei)}),l(this,Go).set(s,0),O(this,Ns,0),this.toSVGPath(),null}getLastElement(){return l(this,An).at(-1)}setLastElement(e){return l(this,An)?(l(this,An).push(e),O(this,_n,e.line),O(this,ei,e.points),O(this,Ns,0),{path:{d:this.toSVGPath()}}):l(this,kf).setLastElement(e)}removeLastElement(){if(!l(this,An))return l(this,kf).removeLastElement();l(this,An).pop(),O(this,kn,"");for(let e=0,t=l(this,An).length;e<t;e++){let{line:n,points:i}=l(this,An)[e];O(this,_n,n),O(this,ei,i),O(this,Ns,0),this.toSVGPath()}return{path:{d:l(this,kn)}}}toSVGPath(){let e=ut.svgRound(l(this,_n)[4]),t=ut.svgRound(l(this,_n)[5]);if(l(this,ei).length===2)return O(this,kn,`${l(this,kn)} M ${e} ${t} Z`),l(this,kn);if(l(this,ei).length<=6){let i=l(this,kn).lastIndexOf("M");O(this,kn,`${l(this,kn).slice(0,i)} M ${e} ${t}`),O(this,Ns,6)}if(l(this,ei).length===4){let i=ut.svgRound(l(this,_n)[10]),o=ut.svgRound(l(this,_n)[11]);return O(this,kn,`${l(this,kn)} L ${i} ${o}`),O(this,Ns,12),l(this,kn)}let n=[];l(this,Ns)===0&&(n.push(`M ${e} ${t}`),O(this,Ns,6));for(let i=l(this,Ns),o=l(this,_n).length;i<o;i+=6){let[s,a,u,c,f,h]=l(this,_n).slice(i,i+6).map(ut.svgRound);n.push(`C${s} ${a} ${u} ${c} ${f} ${h}`)}return O(this,kn,l(this,kn)+n.join(" ")),O(this,Ns,l(this,_n).length),l(this,kn)}getOutlines(e,t,n,i){let o=l(this,An).at(-1);return o.line=new Float32Array(o.line),o.points=new Float32Array(o.points),l(this,kf).build(l(this,An),e,t,n,l(this,Of),l(this,_p),i),O(this,Go,null),O(this,_n,null),O(this,An,null),O(this,kn,null),l(this,kf)}get defaultSVGProperties(){return{root:{viewBox:"0 0 10000 10000"},rootClass:{draw:!0},bbox:[0,0,1,1]}}};Go=new WeakMap,_n=new WeakMap,An=new WeakMap,Of=new WeakMap,_p=new WeakMap,ei=new WeakMap,kn=new WeakMap,Ns=new WeakMap,kf=new WeakMap,Lf=new WeakMap,Pf=new WeakMap,Ap=new WeakSet,Sv=function(e,t){return ut._normalizePoint(e,t,l(this,Lf),l(this,Pf),l(this,Of))};Vf=class extends ut{constructor(){super(...arguments);z(this,Pn);z(this,ti);z(this,My,0);z(this,By);z(this,Ji);z(this,Vo);z(this,Yo);z(this,xp);z(this,Sp);z(this,Mf)}build(t,n,i,o,s,a,u){O(this,Vo,n),O(this,Yo,i),O(this,xp,o),O(this,Sp,s),O(this,Mf,a),O(this,By,u??0),O(this,Ji,t),X(this,Pn,c8).call(this)}get thickness(){return l(this,Mf)}setLastElement(t){return l(this,Ji).push(t),{path:{d:this.toSVGPath()}}}removeLastElement(){return l(this,Ji).pop(),{path:{d:this.toSVGPath()}}}toSVGPath(){let t=[];for(let{line:n}of l(this,Ji)){if(t.push(`M${ut.svgRound(n[4])} ${ut.svgRound(n[5])}`),n.length===6){t.push("Z");continue}if(n.length===12&&isNaN(n[6])){t.push(`L${ut.svgRound(n[10])} ${ut.svgRound(n[11])}`);continue}for(let i=6,o=n.length;i<o;i+=6){let[s,a,u,c,f,h]=n.subarray(i,i+6).map(ut.svgRound);t.push(`C${s} ${a} ${u} ${c} ${f} ${h}`)}}return t.join("")}serialize([t,n,i,o],s){let a=[],u=[],[c,f,h,d]=X(this,Pn,u8).call(this),m,y,v,w,b,E,_,S,A;switch(l(this,Sp)){case 0:A=ut._rescale,m=t,y=n+o,v=i,w=-o,b=t+c*i,E=n+(1-f-d)*o,_=t+(c+h)*i,S=n+(1-f)*o;break;case 90:A=ut._rescaleAndSwap,m=t,y=n,v=i,w=o,b=t+f*i,E=n+c*o,_=t+(f+d)*i,S=n+(c+h)*o;break;case 180:A=ut._rescale,m=t+i,y=n,v=-i,w=o,b=t+(1-c-h)*i,E=n+f*o,_=t+(1-c)*i,S=n+(f+d)*o;break;case 270:A=ut._rescaleAndSwap,m=t+i,y=n+o,v=-i,w=-o,b=t+(1-f-d)*i,E=n+(1-c-h)*o,_=t+(1-f)*i,S=n+(1-c)*o;break}for(let{line:F,points:I}of l(this,Ji))a.push(A(F,m,y,v,w,s?new Array(F.length):null)),u.push(A(I,m,y,v,w,s?new Array(I.length):null));return{lines:a,points:u,rect:[b,E,_,S]}}static deserialize(t,n,i,o,s,{paths:{lines:a,points:u},rotation:c,thickness:f}){let h=[],d,m,y,v,w;switch(c){case 0:w=ut._rescale,d=-t/i,m=n/o+1,y=1/i,v=-1/o;break;case 90:w=ut._rescaleAndSwap,d=-n/o,m=-t/i,y=1/o,v=1/i;break;case 180:w=ut._rescale,d=t/i+1,m=-n/o,y=-1/i,v=1/o;break;case 270:w=ut._rescaleAndSwap,d=n/o+1,m=t/i+1,y=-1/o,v=-1/i;break}if(!a){a=[];for(let E of u){let _=E.length;if(_===2){a.push(new Float32Array([NaN,NaN,NaN,NaN,E[0],E[1]]));continue}if(_===4){a.push(new Float32Array([NaN,NaN,NaN,NaN,E[0],E[1],NaN,NaN,NaN,NaN,E[2],E[3]]));continue}let S=new Float32Array(3*(_-2));a.push(S);let[A,F,I,q]=E.subarray(0,4);S.set([NaN,NaN,NaN,NaN,A,F],0);for(let ee=4;ee<_;ee+=2){let K=E[ee],ne=E[ee+1];S.set(ut.createBezierPoints(A,F,I,q,K,ne),(ee-2)*3),[A,F,I,q]=[I,q,K,ne]}}}for(let E=0,_=a.length;E<_;E++)h.push({line:w(a[E].map(S=>S??NaN),d,m,y,v),points:w(u[E].map(S=>S??NaN),d,m,y,v)});let b=new this.prototype.constructor;return b.build(h,i,o,1,c,f,s),b}get box(){return l(this,ti)}updateProperty(t,n){return t==="stroke-width"?X(this,Pn,f8).call(this,n):null}updateParentDimensions([t,n],i){let[o,s]=X(this,Pn,Ta).call(this);O(this,Vo,t),O(this,Yo,n),O(this,xp,i);let[a,u]=X(this,Pn,Ta).call(this),c=a-o,f=u-s,h=l(this,ti);return h[0]-=c,h[1]-=f,h[2]+=2*c,h[3]+=2*f,h}updateRotation(t){return O(this,My,t),{path:{transform:this.rotationTransform}}}get viewBox(){return l(this,ti).map(ut.svgRound).join(" ")}get defaultProperties(){let[t,n]=l(this,ti);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${ut.svgRound(t)} ${ut.svgRound(n)}`}}}get rotationTransform(){let[,,t,n]=l(this,ti),i=0,o=0,s=0,a=0,u=0,c=0;switch(l(this,My)){case 90:o=n/t,s=-t/n,u=t;break;case 180:i=-1,a=-1,u=t,c=n;break;case 270:o=-n/t,s=t/n,c=n;break;default:return""}return`matrix(${i} ${o} ${s} ${a} ${ut.svgRound(u)} ${ut.svgRound(c)})`}getPathResizingSVGProperties([t,n,i,o]){let[s,a]=X(this,Pn,Ta).call(this),[u,c,f,h]=l(this,ti);if(Math.abs(f-s)<=ut.PRECISION||Math.abs(h-a)<=ut.PRECISION){let w=t+i/2-(u+f/2),b=n+o/2-(c+h/2);return{path:{"transform-origin":`${ut.svgRound(t)} ${ut.svgRound(n)}`,transform:`${this.rotationTransform} translate(${w} ${b})`}}}let d=(i-2*s)/(f-2*s),m=(o-2*a)/(h-2*a),y=f/i,v=h/o;return{path:{"transform-origin":`${ut.svgRound(u)} ${ut.svgRound(c)}`,transform:`${this.rotationTransform} scale(${y} ${v}) translate(${ut.svgRound(s)} ${ut.svgRound(a)}) scale(${d} ${m}) translate(${ut.svgRound(-s)} ${ut.svgRound(-a)})`}}}getPathResizedSVGProperties([t,n,i,o]){let[s,a]=X(this,Pn,Ta).call(this),u=l(this,ti),[c,f,h,d]=u;if(u[0]=t,u[1]=n,u[2]=i,u[3]=o,Math.abs(h-s)<=ut.PRECISION||Math.abs(d-a)<=ut.PRECISION){let b=t+i/2-(c+h/2),E=n+o/2-(f+d/2);for(let{line:_,points:S}of l(this,Ji))ut._translate(_,b,E,_),ut._translate(S,b,E,S);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${ut.svgRound(t)} ${ut.svgRound(n)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}let m=(i-2*s)/(h-2*s),y=(o-2*a)/(d-2*a),v=-m*(c+s)+t+s,w=-y*(f+a)+n+a;if(m!==1||y!==1||v!==0||w!==0)for(let{line:b,points:E}of l(this,Ji))ut._rescale(b,v,w,m,y,b),ut._rescale(E,v,w,m,y,E);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${ut.svgRound(t)} ${ut.svgRound(n)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}getPathTranslatedSVGProperties([t,n],i){let[o,s]=i,a=l(this,ti),u=t-a[0],c=n-a[1];if(l(this,Vo)===o&&l(this,Yo)===s)for(let{line:f,points:h}of l(this,Ji))ut._translate(f,u,c,f),ut._translate(h,u,c,h);else{let f=l(this,Vo)/o,h=l(this,Yo)/s;O(this,Vo,o),O(this,Yo,s);for(let{line:d,points:m}of l(this,Ji))ut._rescale(d,u,c,f,h,d),ut._rescale(m,u,c,f,h,m);a[2]*=f,a[3]*=h}return a[0]=t,a[1]=n,{root:{viewBox:this.viewBox},path:{d:this.toSVGPath(),"transform-origin":`${ut.svgRound(t)} ${ut.svgRound(n)}`}}}get defaultSVGProperties(){let t=l(this,ti);return{root:{viewBox:this.viewBox},rootClass:{draw:!0},path:{d:this.toSVGPath(),"transform-origin":`${ut.svgRound(t[0])} ${ut.svgRound(t[1])}`,transform:this.rotationTransform||null},bbox:t}}};ti=new WeakMap,My=new WeakMap,By=new WeakMap,Ji=new WeakMap,Vo=new WeakMap,Yo=new WeakMap,xp=new WeakMap,Sp=new WeakMap,Mf=new WeakMap,Pn=new WeakSet,Ta=function(t=l(this,Mf)){let n=l(this,By)+t/2*l(this,xp);return l(this,Sp)%180===0?[n/l(this,Vo),n/l(this,Yo)]:[n/l(this,Yo),n/l(this,Vo)]},u8=function(){let[t,n,i,o]=l(this,ti),[s,a]=X(this,Pn,Ta).call(this,0);return[t+s,n+a,i-2*s,o-2*a]},c8=function(){let t=O(this,ti,new Float32Array([1/0,1/0,-1/0,-1/0]));for(let{line:o}of l(this,Ji)){if(o.length<=12){for(let u=4,c=o.length;u<c;u+=6)at.pointBoundingBox(o[u],o[u+1],t);continue}let s=o[4],a=o[5];for(let u=6,c=o.length;u<c;u+=6){let[f,h,d,m,y,v]=o.subarray(u,u+6);at.bezierBoundingBox(s,a,f,h,d,m,y,v,t),s=y,a=v}}let[n,i]=X(this,Pn,Ta).call(this);t[0]=dn(t[0]-n,0,1),t[1]=dn(t[1]-i,0,1),t[2]=dn(t[2]+n,0,1),t[3]=dn(t[3]+i,0,1),t[2]-=t[0],t[3]-=t[1]},f8=function(t){let[n,i]=X(this,Pn,Ta).call(this);O(this,Mf,t);let[o,s]=X(this,Pn,Ta).call(this),[a,u]=[o-n,s-i],c=l(this,ti);return c[0]-=a,c[1]-=u,c[2]+=2*a,c[3]+=2*u,c};hE=class r extends cE{constructor(e){super(),this._viewParameters=e,super.updateProperties({fill:"none",stroke:br._defaultLineColor,"stroke-opacity":1,"stroke-width":1,"stroke-linecap":"round","stroke-linejoin":"round","stroke-miterlimit":10})}updateSVGProperty(e,t){e==="stroke-width"&&(t??(t=this["stroke-width"]),t*=this._viewParameters.realScale),super.updateSVGProperty(e,t)}clone(){let e=new r(this._viewParameters);return e.updateAll(this),e}},td=class td extends fE{constructor(t){super({...t,name:"inkEditor"});z(this,OE);this._willKeepAspectRatio=!0,this.defaultL10nId="pdfjs-editor-ink-editor"}static initialize(t,n){br.initialize(t,n),this._defaultDrawingOptions=new hE(n.viewParameters)}static getDefaultDrawingOptions(t){let n=this._defaultDrawingOptions.clone();return n.updateProperties(t),n}static get supportMultipleDrawings(){return!0}static get typesMap(){return Et(this,"typesMap",new Map([[Ft.INK_THICKNESS,"stroke-width"],[Ft.INK_COLOR,"stroke"],[Ft.INK_OPACITY,"stroke-opacity"]]))}static createDrawerInstance(t,n,i,o,s){return new kT(t,n,i,o,s,this._defaultDrawingOptions["stroke-width"])}static deserializeDraw(t,n,i,o,s,a){return Vf.deserialize(t,n,i,o,s,a)}static async deserialize(t,n,i){let o=null;if(t instanceof Fm){let{data:{inkLists:a,rect:u,rotation:c,id:f,color:h,opacity:d,borderStyle:{rawWidth:m},popupRef:y,richText:v,contentsObj:w,creationDate:b,modificationDate:E},parent:{page:{pageNumber:_}}}=t;o=t={annotationType:At.INK,color:Array.from(h),thickness:m,opacity:d,paths:{points:a},boxes:null,pageIndex:_-1,rect:u.slice(0),rotation:c,annotationElementId:f,id:f,deleted:!1,popupRef:y,richText:v,comment:w?.str||null,creationDate:b,modificationDate:E}}let s=await super.deserialize(t,n,i);return s._initialData=o,t.comment&&s.setCommentData(t),s}get toolbarButtons(){return this._colorPicker||(this._colorPicker=new Qv(this)),[["colorPicker",this._colorPicker]]}get colorType(){return Ft.INK_COLOR}get color(){return this._drawingOptions.stroke}get opacity(){return this._drawingOptions["stroke-opacity"]}onScaleChanging(){if(!this.parent)return;super.onScaleChanging();let{_drawId:t,_drawingOptions:n,parent:i}=this;n.updateSVGProperty("stroke-width"),i.drawLayer.updateProperties(t,n.toSVGProperties())}static onScaleChangingWhenDrawing(){let t=this._currentParent;t&&(super.onScaleChangingWhenDrawing(),this._defaultDrawingOptions.updateSVGProperty("stroke-width"),t.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}createDrawingOptions({color:t,thickness:n,opacity:i}){this._drawingOptions=td.getDefaultDrawingOptions({stroke:at.makeHexColor(...t),"stroke-width":n,"stroke-opacity":i})}serialize(t=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();let{lines:n,points:i}=this.serializeDraw(t),{_drawingOptions:{stroke:o,"stroke-opacity":s,"stroke-width":a}}=this,u=Object.assign(super.serialize(t),{color:br._colorManager.convert(o),opacity:s,thickness:a,paths:{lines:n,points:i}});return this.addComment(u),t?(u.isCopy=!0,u):this.annotationElementId&&!X(this,OE,h8).call(this,u)?null:(u.id=this.annotationElementId,u)}renderAnnotationElement(t){if(this.deleted)return t.hide(),null;let{points:n,rect:i}=this.serializeDraw(!1);return t.updateEdited({rect:i,thickness:this._drawingOptions["stroke-width"],points:n,popup:this.comment}),null}};OE=new WeakSet,h8=function(t){let{color:n,thickness:i,opacity:o,pageIndex:s}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized||t.color.some((a,u)=>a!==n[u])||t.thickness!==i||t.opacity!==o||t.pageIndex!==s},ze(td,"_type","ink"),ze(td,"_editorType",At.INK),ze(td,"_defaultDrawingOptions",null);LT=td,$m=class extends Vf{toSVGPath(){let e=super.toSVGPath();return e.endsWith("Z")||(e+="Z"),e}},Vw=8,Jg=3,ks=class{static extractContoursFromText(e,{fontFamily:t,fontStyle:n,fontWeight:i},o,s,a,u){let c=new OffscreenCanvas(1,1),f=c.getContext("2d",{alpha:!1}),h=200,d=f.font=`${n} ${i} ${h}px ${t}`,{actualBoundingBoxLeft:m,actualBoundingBoxRight:y,actualBoundingBoxAscent:v,actualBoundingBoxDescent:w,fontBoundingBoxAscent:b,fontBoundingBoxDescent:E,width:_}=f.measureText(e),S=1.5,A=Math.ceil(Math.max(Math.abs(m)+Math.abs(y)||0,_)*S),F=Math.ceil(Math.max(Math.abs(v)+Math.abs(w)||h,Math.abs(b)+Math.abs(E)||h)*S);c=new OffscreenCanvas(A,F),f=c.getContext("2d",{alpha:!0,willReadFrequently:!0}),f.font=d,f.filter="grayscale(1)",f.fillStyle="white",f.fillRect(0,0,A,F),f.fillStyle="black",f.fillText(e,A*(S-1)/2,F*(3-S)/2);let I=X(this,Kt,BT).call(this,f.getImageData(0,0,A,F).data),q=X(this,Kt,y8).call(this,I),ee=X(this,Kt,FT).call(this,q),K=X(this,Kt,MT).call(this,I,A,F,ee);return this.processDrawnLines({lines:{curves:K,width:A,height:F},pageWidth:o,pageHeight:s,rotation:a,innerMargin:u,mustSmooth:!0,areContours:!0})}static process(e,t,n,i,o){let[s,a,u]=X(this,Kt,b8).call(this,e),[c,f]=X(this,Kt,m8).call(this,s,a,u,Math.hypot(a,u)*l(this,Bf).sigmaSFactor,l(this,Bf).sigmaR,l(this,Bf).kernelSize),h=X(this,Kt,FT).call(this,f),d=X(this,Kt,MT).call(this,c,a,u,h);return this.processDrawnLines({lines:{curves:d,width:a,height:u},pageWidth:t,pageHeight:n,rotation:i,innerMargin:o,mustSmooth:!0,areContours:!0})}static processDrawnLines({lines:e,pageWidth:t,pageHeight:n,rotation:i,innerMargin:o,mustSmooth:s,areContours:a}){i%180!==0&&([t,n]=[n,t]);let{curves:u,width:c,height:f}=e,h=e.thickness??0,d=[],m=Math.min(t/c,n/f),y=m/t,v=m/n,w=[];for(let{points:E}of u){let _=s?X(this,Kt,g8).call(this,E):E;if(!_)continue;w.push(_);let S=_.length,A=new Float32Array(S),F=new Float32Array(3*(S===2?2:S-2));if(d.push({line:F,points:A}),S===2){A[0]=_[0]*y,A[1]=_[1]*v,F.set([NaN,NaN,NaN,NaN,A[0],A[1]],0);continue}let[I,q,ee,K]=_;I*=y,q*=v,ee*=y,K*=v,A.set([I,q,ee,K],0),F.set([NaN,NaN,NaN,NaN,I,q],0);for(let ne=4;ne<S;ne+=2){let L=A[ne]=_[ne]*y,$=A[ne+1]=_[ne+1]*v;F.set(ut.createBezierPoints(I,q,ee,K,L,$),(ne-2)*3),[I,q,ee,K]=[ee,K,L,$]}}if(d.length===0)return null;let b=a?new $m:new Vf;return b.build(d,t,n,1,i,a?0:h,o),{outline:b,newCurves:w,areContours:a,thickness:h,width:c,height:f}}static async compressSignature({outlines:e,areContours:t,thickness:n,width:i,height:o}){let s=1/0,a=-1/0,u=0;for(let _ of e){u+=_.length;for(let S=2,A=_.length;S<A;S++){let F=_[S]-_[S-2];s=Math.min(s,F),a=Math.max(a,F)}}let c;s>=-128&&a<=127?c=Int8Array:s>=-32768&&a<=32767?c=Int16Array:c=Int32Array;let f=e.length,h=Vw+Jg*f,d=new Uint32Array(h),m=0;d[m++]=h*Uint32Array.BYTES_PER_ELEMENT+(u-2*f)*c.BYTES_PER_ELEMENT,d[m++]=0,d[m++]=i,d[m++]=o,d[m++]=t?0:1,d[m++]=Math.max(0,Math.floor(n??0)),d[m++]=f,d[m++]=c.BYTES_PER_ELEMENT;for(let _ of e)d[m++]=_.length-2,d[m++]=_[0],d[m++]=_[1];let y=new CompressionStream("deflate-raw"),v=y.writable.getWriter();await v.ready,v.write(d);let w=c.prototype.constructor;for(let _ of e){let S=new w(_.length-2);for(let A=2,F=_.length;A<F;A++)S[A-2]=_[A]-_[A-2];v.write(S)}v.close();let b=await new Response(y.readable).arrayBuffer();return new Uint8Array(b).toBase64()}static async decompressSignature(e){try{let t=Uint8Array.fromBase64(e),{readable:n,writable:i}=new DecompressionStream("deflate-raw"),o=i.getWriter();await o.ready,o.write(t).then(async()=>{await o.ready,await o.close()}).catch(()=>{});let s=null,a=0;for await(let _ of n)s||(s=new Uint8Array(new Uint32Array(_.buffer,0,4)[0])),s.set(_,a),a+=_.length;let u=new Uint32Array(s.buffer,0,s.length>>2),c=u[1];if(c!==0)throw new Error(`Invalid version: ${c}`);let f=u[2],h=u[3],d=u[4]===0,m=u[5],y=u[6],v=u[7],w=[],b=(Vw+Jg*y)*Uint32Array.BYTES_PER_ELEMENT,E;switch(v){case Int8Array.BYTES_PER_ELEMENT:E=new Int8Array(s.buffer,b);break;case Int16Array.BYTES_PER_ELEMENT:E=new Int16Array(s.buffer,b);break;case Int32Array.BYTES_PER_ELEMENT:E=new Int32Array(s.buffer,b);break}a=0;for(let _=0;_<y;_++){let S=u[Jg*_+Vw],A=new Float32Array(S+2);w.push(A);for(let F=0;F<Jg-1;F++)A[F]=u[Jg*_+Vw+F+1];for(let F=0;F<S;F++)A[F+2]=A[F]+E[a++]}return{areContours:d,thickness:m,outlines:w,width:f,height:h}}catch(t){return Tt(`decompressSignature: ${t}`),null}}};Bf=new WeakMap,Kt=new WeakSet,PT=function(e,t,n,i){return n-=e,i-=t,n===0?i>0?0:4:n===1?i+6:2-i},to=new WeakMap,d8=function(e,t,n,i,o,s,a){let u=X(this,Kt,PT).call(this,n,i,o,s);for(let c=0;c<8;c++){let f=(-c+u-a+16)%8,h=l(this,to)[2*f],d=l(this,to)[2*f+1];if(e[(n+h)*t+(i+d)]!==0)return f}return-1},p8=function(e,t,n,i,o,s,a){let u=X(this,Kt,PT).call(this,n,i,o,s);for(let c=0;c<8;c++){let f=(c+u+a+16)%8,h=l(this,to)[2*f],d=l(this,to)[2*f+1];if(e[(n+h)*t+(i+d)]!==0)return f}return-1},MT=function(e,t,n,i){let o=e.length,s=new Int32Array(o);for(let f=0;f<o;f++)s[f]=e[f]<=i?1:0;for(let f=1;f<n-1;f++)s[f*t]=s[f*t+t-1]=0;for(let f=0;f<t;f++)s[f]=s[t*n-1-f]=0;let a=1,u,c=[];for(let f=1;f<n-1;f++){u=1;for(let h=1;h<t-1;h++){let d=f*t+h,m=s[d];if(m===0)continue;let y=f,v=h;if(m===1&&s[d-1]===0)a+=1,v-=1;else if(m>=1&&s[d+1]===0)a+=1,v+=1,m>1&&(u=m);else{m!==1&&(u=Math.abs(m));continue}let w=[h,f],b=v===h+1,E={isHole:b,points:w,id:a,parent:0};c.push(E);let _;for(let ne of c)if(ne.id===u){_=ne;break}_?_.isHole?E.parent=b?_.parent:u:E.parent=b?u:_.parent:E.parent=b?u:0;let S=X(this,Kt,d8).call(this,s,t,f,h,y,v,0);if(S===-1){s[d]=-a,s[d]!==1&&(u=Math.abs(s[d]));continue}let A=l(this,to)[2*S],F=l(this,to)[2*S+1],I=f+A,q=h+F;y=I,v=q;let ee=f,K=h;for(;;){let ne=X(this,Kt,p8).call(this,s,t,ee,K,y,v,1);A=l(this,to)[2*ne],F=l(this,to)[2*ne+1];let L=ee+A,$=K+F;w.push($,L);let Y=ee*t+K;if(s[Y+1]===0?s[Y]=-a:s[Y]===1&&(s[Y]=a),L===f&&$===h&&ee===I&&K===q){s[d]!==1&&(u=Math.abs(s[d]));break}else y=ee,v=K,ee=L,K=$}}}return c},Tv=function(e,t,n,i){if(n-t<=4){for(let I=t;I<n-2;I+=2)i.push(e[I],e[I+1]);return}let o=e[t],s=e[t+1],a=e[n-4]-o,u=e[n-3]-s,c=Math.hypot(a,u),f=a/c,h=u/c,d=f*s-h*o,m=u/a,y=1/c,v=Math.atan(m),w=Math.cos(v),b=Math.sin(v),E=y*(Math.abs(w)+Math.abs(b)),_=y*(1-E+E**2),S=Math.max(Math.atan(Math.abs(b+w)*_),Math.atan(Math.abs(b-w)*_)),A=0,F=t;for(let I=t+2;I<n-2;I+=2){let q=Math.abs(d-f*e[I+1]+h*e[I]);q>A&&(F=I,A=q)}A>(c*S)**2?(X(this,Kt,Tv).call(this,e,t,F+2,i),X(this,Kt,Tv).call(this,e,F,n,i)):i.push(o,s)},g8=function(e){let t=[],n=e.length;return X(this,Kt,Tv).call(this,e,0,n,t),t.push(e[n-2],e[n-1]),t.length<=4?null:t},m8=function(e,t,n,i,o,s){let a=new Float32Array(s**2),u=-2*i**2,c=s>>1;for(let v=0;v<s;v++){let w=(v-c)**2;for(let b=0;b<s;b++)a[v*s+b]=Math.exp((w+(b-c)**2)/u)}let f=new Float32Array(256),h=-2*o**2;for(let v=0;v<256;v++)f[v]=Math.exp(v**2/h);let d=e.length,m=new Uint8Array(d),y=new Uint32Array(256);for(let v=0;v<n;v++)for(let w=0;w<t;w++){let b=v*t+w,E=e[b],_=0,S=0;for(let F=0;F<s;F++){let I=v+F-c;if(!(I<0||I>=n))for(let q=0;q<s;q++){let ee=w+q-c;if(ee<0||ee>=t)continue;let K=e[I*t+ee],ne=a[F*s+q]*f[Math.abs(K-E)];_+=K*ne,S+=ne}}let A=m[b]=Math.round(_/S);y[A]++}return[m,y]},y8=function(e){let t=new Uint32Array(256);for(let n of e)t[n]++;return t},BT=function(e){let t=e.length,n=new Uint8ClampedArray(t>>2),i=-1/0,o=1/0;for(let a=0,u=n.length;a<u;a++){let c=n[a]=e[a<<2];i=Math.max(i,c),o=Math.min(o,c)}let s=255/(i-o);for(let a=0,u=n.length;a<u;a++)n[a]=(n[a]-o)*s;return n},FT=function(e){let t,n=-1/0,i=-1/0,o=e.findIndex(u=>u!==0),s=o,a=o;for(t=o;t<256;t++){let u=e[t];u>n&&(t-s>i&&(i=t-s,a=t-1),n=u,s=t)}for(t=a-1;t>=0&&!(e[t]>e[t+1]);t--);return t},b8=function(e){let t=e,{width:n,height:i}=e,{maxDim:o}=l(this,Bf),s=n,a=i;if(n>o||i>o){let d=n,m=i,y=Math.log2(Math.max(n,i)/o),v=Math.floor(y);y=y===v?v-1:v;for(let b=0;b<y;b++){s=Math.ceil(d/2),a=Math.ceil(m/2);let E=new OffscreenCanvas(s,a);E.getContext("2d").drawImage(e,0,0,d,m,0,0,s,a),d=s,m=a,e!==t&&e.close(),e=E.transferToImageBitmap()}let w=Math.min(o/s,o/a);s=Math.round(s*w),a=Math.round(a*w)}let c=new OffscreenCanvas(s,a).getContext("2d",{willReadFrequently:!0});c.fillStyle="white",c.fillRect(0,0,s,a),c.filter="grayscale(1)",c.drawImage(e,0,0,e.width,e.height,0,0,s,a);let f=c.getImageData(0,0,s,a).data;return[X(this,Kt,BT).call(this,f),s,a]},z(ks,Kt),z(ks,Bf,{maxDim:512,sigmaSFactor:.02,sigmaR:25,kernelSize:16}),z(ks,to,new Int32Array([0,1,-1,1,-1,0,-1,-1,0,-1,1,-1,1,0,1,1]));UT=class r extends cE{constructor(){super(),super.updateProperties({fill:br._defaultLineColor,"stroke-width":0})}clone(){let e=new r;return e.updateAll(this),e}},jT=class r extends hE{constructor(e){super(e),super.updateProperties({stroke:br._defaultLineColor,"stroke-width":1})}clone(){let e=new r(this._viewParameters);return e.updateAll(this),e}},Pi=class Pi extends fE{constructor(t){super({...t,mustBeCommitted:!0,name:"signatureEditor"});z(this,Su,!1);z(this,Xo,null);z(this,Tu,null);z(this,Ff,null);this._willKeepAspectRatio=!0,O(this,Tu,t.signatureData||null),O(this,Xo,null),this.defaultL10nId="pdfjs-editor-signature-editor1"}static initialize(t,n){br.initialize(t,n),this._defaultDrawingOptions=new UT,this._defaultDrawnSignatureOptions=new jT(n.viewParameters)}static getDefaultDrawingOptions(t){let n=this._defaultDrawingOptions.clone();return n.updateProperties(t),n}static get supportMultipleDrawings(){return!1}static get typesMap(){return Et(this,"typesMap",new Map)}static get isDrawer(){return!1}get telemetryFinalData(){return{type:"signature",hasDescription:!!l(this,Xo)}}static computeTelemetryFinalData(t){let n=t.get("hasDescription");return{hasAltText:n.get(!0)??0,hasNoAltText:n.get(!1)??0}}get isResizable(){return!0}onScaleChanging(){this._drawId!==null&&super.onScaleChanging()}render(){if(this.div)return this.div;let t,n,{_isCopy:i}=this;if(i&&(this._isCopy=!1,t=this.x,n=this.y),super.render(),this._drawId===null)if(l(this,Tu)){let{lines:o,mustSmooth:s,areContours:a,description:u,uuid:c,heightInPage:f}=l(this,Tu),{rawDims:{pageWidth:h,pageHeight:d},rotation:m}=this.parent.viewport,y=ks.processDrawnLines({lines:o,pageWidth:h,pageHeight:d,rotation:m,innerMargin:Pi._INNER_MARGIN,mustSmooth:s,areContours:a});this.addSignature(y,f,u,c)}else this.div.setAttribute("data-l10n-args",JSON.stringify({description:""})),this.div.hidden=!0,this._uiManager.getSignature(this);else this.div.setAttribute("data-l10n-args",JSON.stringify({description:l(this,Xo)||""}));return i&&(this._isCopy=!0,this._moveAfterPaste(t,n)),this.div}setUuid(t){O(this,Ff,t),this.addEditToolbar()}getUuid(){return l(this,Ff)}get description(){return l(this,Xo)}set description(t){O(this,Xo,t),this.div&&(this.div.setAttribute("data-l10n-args",JSON.stringify({description:t})),super.addEditToolbar().then(n=>{n?.updateEditSignatureButton(t)}))}getSignaturePreview(){let{newCurves:t,areContours:n,thickness:i,width:o,height:s}=l(this,Tu),a=Math.max(o,s),u=ks.processDrawnLines({lines:{curves:t.map(c=>({points:c})),thickness:i,width:o,height:s},pageWidth:a,pageHeight:a,rotation:0,innerMargin:0,mustSmooth:!1,areContours:n});return{areContours:n,outline:u.outline}}get toolbarButtons(){return this._uiManager.signatureManager?[["editSignature",this._uiManager.signatureManager]]:super.toolbarButtons}addSignature(t,n,i,o){let{x:s,y:a}=this,{outline:u}=O(this,Tu,t);O(this,Su,u instanceof $m),this.description=i;let c;l(this,Su)?c=Pi.getDefaultDrawingOptions():(c=Pi._defaultDrawnSignatureOptions.clone(),c.updateProperties({"stroke-width":u.thickness})),this._addOutlines({drawOutlines:u,drawingOptions:c});let[,f]=this.pageDimensions,h=n/f;h=h>=1?.5:h,this.width*=h/this.height,this.width>=1&&(h*=.9/this.width,this.width=.9),this.height=h,this.setDims(),this.x=s,this.y=a,this.center(),this._onResized(),this.onScaleChanging(),this.rotate(),this._uiManager.addToAnnotationStorage(this),this.setUuid(o),this._reportTelemetry({action:"pdfjs.signature.inserted",data:{hasBeenSaved:!!o,hasDescription:!!i}}),this.div.hidden=!1}getFromImage(t){let{rawDims:{pageWidth:n,pageHeight:i},rotation:o}=this.parent.viewport;return ks.process(t,n,i,o,Pi._INNER_MARGIN)}getFromText(t,n){let{rawDims:{pageWidth:i,pageHeight:o},rotation:s}=this.parent.viewport;return ks.extractContoursFromText(t,n,i,o,s,Pi._INNER_MARGIN)}getDrawnSignature(t){let{rawDims:{pageWidth:n,pageHeight:i},rotation:o}=this.parent.viewport;return ks.processDrawnLines({lines:t,pageWidth:n,pageHeight:i,rotation:o,innerMargin:Pi._INNER_MARGIN,mustSmooth:!1,areContours:!1})}createDrawingOptions({areContours:t,thickness:n}){t?this._drawingOptions=Pi.getDefaultDrawingOptions():(this._drawingOptions=Pi._defaultDrawnSignatureOptions.clone(),this._drawingOptions.updateProperties({"stroke-width":n}))}serialize(t=!1){if(this.isEmpty())return null;let{lines:n,points:i}=this.serializeDraw(t),{_drawingOptions:{"stroke-width":o}}=this,s=Object.assign(super.serialize(t),{isSignature:!0,areContours:l(this,Su),color:[0,0,0],thickness:l(this,Su)?0:o});return this.addComment(s),t?(s.paths={lines:n,points:i},s.uuid=l(this,Ff),s.isCopy=!0):s.lines=n,l(this,Xo)&&(s.accessibilityData={type:"Figure",alt:l(this,Xo)}),s}static deserializeDraw(t,n,i,o,s,a){return a.areContours?$m.deserialize(t,n,i,o,s,a):Vf.deserialize(t,n,i,o,s,a)}static async deserialize(t,n,i){let o=await super.deserialize(t,n,i);return O(o,Su,t.areContours),o.description=t.accessibilityData?.alt||"",O(o,Ff,t.uuid),o}};Su=new WeakMap,Xo=new WeakMap,Tu=new WeakMap,Ff=new WeakMap,ze(Pi,"_type","signature"),ze(Pi,"_editorType",At.SIGNATURE),ze(Pi,"_defaultDrawingOptions",null);$T=Pi,wm=class extends br{constructor(t){super({...t,name:"stampEditor"});z(this,Wt);z(this,Tr,null);z(this,xn,null);z(this,Cu,null);z(this,il,null);z(this,Ru,null);z(this,Tp,"");z(this,sl,null);z(this,Uf,!1);z(this,Ko,null);z(this,Qi,!1);z(this,Cp,!1);O(this,il,t.bitmapUrl),O(this,Ru,t.bitmapFile),this.defaultL10nId="pdfjs-editor-stamp-editor"}static initialize(t,n){br.initialize(t,n)}static isHandlingMimeForPasting(t){return Pv.includes(t)}static paste(t,n){n.pasteEditor({mode:At.STAMP},{bitmapFile:t.getAsFile()})}altTextFinish(){this._uiManager.useNewAltTextFlow&&(this.div.hidden=!1),super.altTextFinish()}get telemetryFinalData(){return{type:"stamp",hasAltText:!!this.altTextData?.altText}}static computeTelemetryFinalData(t){let n=t.get("hasAltText");return{hasAltText:n.get(!0)??0,hasNoAltText:n.get(!1)??0}}async mlGuessAltText(t=null,n=!0){if(this.hasAltTextData())return null;let{mlManager:i}=this._uiManager;if(!i)throw new Error("No ML.");if(!await i.isEnabledFor("altText"))throw new Error("ML isn't enabled for alt text.");let{data:o,width:s,height:a}=t||this.copyCanvas(null,null,!0).imageData,u=await i.guess({name:"altText",request:{data:o,width:s,height:a,channels:o.length/(s*a)}});if(!u)throw new Error("No response from the AI service.");if(u.error)throw new Error("Error from the AI service.");if(u.cancel)return null;if(!u.output)throw new Error("No valid response from the AI service.");let c=u.output;return await this.setGuessedAltText(c),n&&!this.hasAltTextData()&&(this.altTextData={alt:c,decorative:!1}),c}remove(){l(this,xn)&&(O(this,Tr,null),this._uiManager.imageManager.deleteId(l(this,xn)),l(this,sl)?.remove(),O(this,sl,null),l(this,Ko)&&(clearTimeout(l(this,Ko)),O(this,Ko,null))),super.remove()}rebuild(){if(!this.parent){l(this,xn)&&X(this,Wt,Cv).call(this);return}super.rebuild(),this.div!==null&&(l(this,xn)&&l(this,sl)===null&&X(this,Wt,Cv).call(this),this.isAttachedToDOM||this.parent.add(this))}onceAdded(t){this._isDraggable=!0,t&&this.div.focus()}isEmpty(){return!(l(this,Cu)||l(this,Tr)||l(this,il)||l(this,Ru)||l(this,xn)||l(this,Uf))}get toolbarButtons(){return[["altText",this.createAltText()]]}get isResizable(){return!0}render(){if(this.div)return this.div;let t,n;return this._isCopy&&(t=this.x,n=this.y),super.render(),this.div.hidden=!0,this.createAltText(),l(this,Uf)||(l(this,Tr)?X(this,Wt,Rv).call(this):X(this,Wt,Cv).call(this)),this._isCopy&&this._moveAfterPaste(t,n),this._uiManager.addShouldRescale(this),this.div}setCanvas(t,n){let{id:i,bitmap:o}=this._uiManager.imageManager.getFromCanvas(t,n);n.remove(),i&&this._uiManager.imageManager.isValidId(i)&&(O(this,xn,i),o&&O(this,Tr,o),O(this,Uf,!1),X(this,Wt,Rv).call(this))}_onResized(){this.onScaleChanging()}onScaleChanging(){if(!this.parent)return;l(this,Ko)!==null&&clearTimeout(l(this,Ko)),O(this,Ko,setTimeout(()=>{O(this,Ko,null),X(this,Wt,WT).call(this)},200))}copyCanvas(t,n,i=!1){t||(t=224);let{width:o,height:s}=l(this,Tr),a=new Zo,u=l(this,Tr),c=o,f=s,h=null;if(n){if(o>n||s>n){let I=Math.min(n/o,n/s);c=Math.floor(o*I),f=Math.floor(s*I)}h=document.createElement("canvas");let m=h.width=Math.ceil(c*a.sx),y=h.height=Math.ceil(f*a.sy);l(this,Qi)||(u=X(this,Wt,Dv).call(this,m,y));let v=h.getContext("2d");v.filter=this._uiManager.hcmFilter;let w="white",b="#cfcfd8";this._uiManager.hcmFilter!=="none"?b="black":vx.isDarkMode&&(w="#8f8f9d",b="#42414d");let E=15,_=E*a.sx,S=E*a.sy,A=new OffscreenCanvas(_*2,S*2),F=A.getContext("2d");F.fillStyle=w,F.fillRect(0,0,_*2,S*2),F.fillStyle=b,F.fillRect(0,0,_,S),F.fillRect(_,S,_,S),v.fillStyle=v.createPattern(A,"repeat"),v.fillRect(0,0,m,y),v.drawImage(u,0,0,u.width,u.height,0,0,m,y)}let d=null;if(i){let m,y;if(a.symmetric&&u.width<t&&u.height<t)m=u.width,y=u.height;else if(u=l(this,Tr),o>t||s>t){let b=Math.min(t/o,t/s);m=Math.floor(o*b),y=Math.floor(s*b),l(this,Qi)||(u=X(this,Wt,Dv).call(this,m,y))}let w=new OffscreenCanvas(m,y).getContext("2d",{willReadFrequently:!0});w.drawImage(u,0,0,u.width,u.height,0,0,m,y),d={width:m,height:y,data:w.getImageData(0,0,m,y).data}}return{canvas:h,width:c,height:f,imageData:d}}static async deserialize(t,n,i){let o=null,s=!1;if(t instanceof sE){let{data:{rect:w,rotation:b,id:E,structParent:_,popupRef:S,richText:A,contentsObj:F,creationDate:I,modificationDate:q},container:ee,parent:{page:{pageNumber:K}},canvas:ne}=t,L,$;ne?(delete t.canvas,{id:L,bitmap:$}=i.imageManager.getFromCanvas(ee.id,ne),ne.remove()):(s=!0,t._hasNoCanvas=!0);let Y=(await n._structTree.getAriaAttributes(`${Xh}${E}`))?.get("aria-label")||"";o=t={annotationType:At.STAMP,bitmapId:L,bitmap:$,pageIndex:K-1,rect:w.slice(0),rotation:b,annotationElementId:E,id:E,deleted:!1,accessibilityData:{decorative:!1,altText:Y},isSvg:!1,structParent:_,popupRef:S,richText:A,comment:F?.str||null,creationDate:I,modificationDate:q}}let a=await super.deserialize(t,n,i),{rect:u,bitmap:c,bitmapUrl:f,bitmapId:h,isSvg:d,accessibilityData:m}=t;s?(i.addMissingCanvas(t.id,a),O(a,Uf,!0)):h&&i.imageManager.isValidId(h)?(O(a,xn,h),c&&O(a,Tr,c)):O(a,il,f),O(a,Qi,d);let[y,v]=a.pageDimensions;return a.width=(u[2]-u[0])/y,a.height=(u[3]-u[1])/v,m&&(a.altTextData=m),a._initialData=o,t.comment&&a.setCommentData(t),O(a,Cp,!!o),a}serialize(t=!1,n=null){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();let i=Object.assign(super.serialize(t),{bitmapId:l(this,xn),isSvg:l(this,Qi)});if(this.addComment(i),t)return i.bitmapUrl=X(this,Wt,Iv).call(this,!0),i.accessibilityData=this.serializeAltText(!0),i.isCopy=!0,i;let{decorative:o,altText:s}=this.serializeAltText(!1);if(!o&&s&&(i.accessibilityData={type:"Figure",alt:s}),this.annotationElementId){let u=X(this,Wt,w8).call(this,i);return u.isSame?null:(u.isSameAltText?delete i.accessibilityData:i.accessibilityData.structParent=this._initialData.structParent??-1,i.id=this.annotationElementId,delete i.bitmapId,i)}if(n===null)return i;n.stamps||(n.stamps=new Map);let a=l(this,Qi)?(i.rect[2]-i.rect[0])*(i.rect[3]-i.rect[1]):null;if(!n.stamps.has(l(this,xn)))n.stamps.set(l(this,xn),{area:a,serialized:i}),i.bitmap=X(this,Wt,Iv).call(this,!1);else if(l(this,Qi)){let u=n.stamps.get(l(this,xn));a>u.area&&(u.area=a,u.serialized.bitmap.close(),u.serialized.bitmap=X(this,Wt,Iv).call(this,!1))}return i}renderAnnotationElement(t){return this.deleted?(t.hide(),null):(t.updateEdited({rect:this.getPDFRect(),popup:this.comment}),null)}};Tr=new WeakMap,xn=new WeakMap,Cu=new WeakMap,il=new WeakMap,Ru=new WeakMap,Tp=new WeakMap,sl=new WeakMap,Uf=new WeakMap,Ko=new WeakMap,Qi=new WeakMap,Cp=new WeakMap,Wt=new WeakSet,vm=function(t,n=!1){if(!t){this.remove();return}O(this,Tr,t.bitmap),n||(O(this,xn,t.id),O(this,Qi,t.isSvg)),t.file&&O(this,Tp,t.file.name),X(this,Wt,Rv).call(this)},Em=function(){if(O(this,Cu,null),this._uiManager.enableWaiting(!1),!!l(this,sl)){if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&l(this,Tr)){this.addEditToolbar().then(()=>{this._editToolbar.hide(),this._uiManager.editAltText(this,!0)});return}if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&l(this,Tr)){this._reportTelemetry({action:"pdfjs.image.image_added",data:{alt_text_modal:!1,alt_text_type:"empty"}});try{this.mlGuessAltText()}catch{}}this.div.focus()}},Cv=function(){if(l(this,xn)){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(l(this,xn)).then(i=>X(this,Wt,vm).call(this,i,!0)).finally(()=>X(this,Wt,Em).call(this));return}if(l(this,il)){let i=l(this,il);O(this,il,null),this._uiManager.enableWaiting(!0),O(this,Cu,this._uiManager.imageManager.getFromUrl(i).then(o=>X(this,Wt,vm).call(this,o)).finally(()=>X(this,Wt,Em).call(this)));return}if(l(this,Ru)){let i=l(this,Ru);O(this,Ru,null),this._uiManager.enableWaiting(!0),O(this,Cu,this._uiManager.imageManager.getFromFile(i).then(o=>X(this,Wt,vm).call(this,o)).finally(()=>X(this,Wt,Em).call(this)));return}let t=document.createElement("input");t.type="file",t.accept=Pv.join(",");let n=this._uiManager._signal;O(this,Cu,new Promise(i=>{t.addEventListener("change",async()=>{if(!t.files||t.files.length===0)this.remove();else{this._uiManager.enableWaiting(!0);let o=await this._uiManager.imageManager.getFromFile(t.files[0]);this._reportTelemetry({action:"pdfjs.image.image_selected",data:{alt_text_modal:this._uiManager.useNewAltTextFlow}}),X(this,Wt,vm).call(this,o)}i()},{signal:n}),t.addEventListener("cancel",()=>{this.remove(),i()},{signal:n})}).finally(()=>X(this,Wt,Em).call(this))),t.click()},Rv=function(){let{div:t}=this,{width:n,height:i}=l(this,Tr),[o,s]=this.pageDimensions,a=.75;if(this.width)n=this.width*o,i=this.height*s;else if(n>a*o||i>a*s){let c=Math.min(a*o/n,a*s/i);n*=c,i*=c}this._uiManager.enableWaiting(!1);let u=O(this,sl,document.createElement("canvas"));u.setAttribute("role","img"),this.addContainer(u),this.width=n/o,this.height=i/s,this.setDims(),this._initialOptions?.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,(!this._uiManager.useNewAltTextWhenAddingImage||!this._uiManager.useNewAltTextFlow||this.annotationElementId)&&(t.hidden=!1),X(this,Wt,WT).call(this),l(this,Cp)||(this.parent.addUndoableEditor(this),O(this,Cp,!0)),this._reportTelemetry({action:"inserted_image"}),l(this,Tp)&&this.div.setAttribute("aria-description",l(this,Tp)),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-stamp-added-alert")},Dv=function(t,n){let{width:i,height:o}=l(this,Tr),s=i,a=o,u=l(this,Tr);for(;s>2*t||a>2*n;){let c=s,f=a;s>2*t&&(s=s>=16384?Math.floor(s/2)-1:Math.ceil(s/2)),a>2*n&&(a=a>=16384?Math.floor(a/2)-1:Math.ceil(a/2));let h=new OffscreenCanvas(s,a);h.getContext("2d").drawImage(u,0,0,c,f,0,0,s,a),u=h.transferToImageBitmap()}return u},WT=function(){let[t,n]=this.parentDimensions,{width:i,height:o}=this,s=new Zo,a=Math.ceil(i*t*s.sx),u=Math.ceil(o*n*s.sy),c=l(this,sl);if(!c||c.width===a&&c.height===u)return;c.width=a,c.height=u;let f=l(this,Qi)?l(this,Tr):X(this,Wt,Dv).call(this,a,u),h=c.getContext("2d");h.filter=this._uiManager.hcmFilter,h.drawImage(f,0,0,f.width,f.height,0,0,a,u)},Iv=function(t){if(t){if(l(this,Qi)){let o=this._uiManager.imageManager.getSvgUrl(l(this,xn));if(o)return o}let n=document.createElement("canvas");return{width:n.width,height:n.height}=l(this,Tr),n.getContext("2d").drawImage(l(this,Tr),0,0),n.toDataURL()}if(l(this,Qi)){let[n,i]=this.pageDimensions,o=Math.round(this.width*n*dl.PDF_TO_CSS_UNITS),s=Math.round(this.height*i*dl.PDF_TO_CSS_UNITS),a=new OffscreenCanvas(o,s);return a.getContext("2d").drawImage(l(this,Tr),0,0,l(this,Tr).width,l(this,Tr).height,0,0,o,s),a.transferToImageBitmap()}return structuredClone(l(this,Tr))},w8=function(t){let{pageIndex:n,accessibilityData:{altText:i}}=this._initialData,o=t.pageIndex===n,s=(t.accessibilityData?.alt||"")===i;return{isSame:!this.hasEditedComment&&!this._hasBeenMoved&&!this._hasBeenResized&&o&&s,isSameAltText:s}},ze(wm,"_type","stamp"),ze(wm,"_editorType",At.STAMP);qs=class qs{constructor({uiManager:e,pageIndex:t,div:n,structTreeLayer:i,accessibilityManager:o,annotationLayer:s,drawLayer:a,textLayer:u,viewport:c,l10n:f}){z(this,rr);z(this,jf);z(this,Rp,!1);z(this,Du,null);z(this,Iu,null);z(this,ol,null);z(this,Ti,new Map);z(this,Nu,!1);z(this,Dp,!1);z(this,Ip,!1);z(this,ro,null);z(this,al,null);z(this,Sn,null);z(this,ll,null);z(this,Ou,null);z(this,Np,-1);z(this,ht);let h=[...l(qs,ku).values()];if(!qs._initialized){qs._initialized=!0;for(let d of h)d.initialize(f,e)}e.registerEditorTypes(h),O(this,ht,e),this.pageIndex=t,this.div=n,O(this,jf,o),O(this,Du,s),this.viewport=c,O(this,Sn,u),this.drawLayer=a,this._structTree=i,l(this,ht).addLayer(this)}updatePageIndex(e){for(let t of l(this,rr,_m))t.updatePageIndex(e);this.pageIndex=e,l(this,ht).addLayer(this)}async setClonedFrom(e){if(!e)return;let t=[];for(let n of l(e,rr,_m)){let i=n.serialize(!0);i&&(i.isCopy=!1,t.push(this.deserialize(i).then(o=>{o&&this.addOrRebuild(o)})))}await Promise.all(t)}get isEmpty(){return l(this,Ti).size===0}get isInvisible(){return this.isEmpty&&l(this,ht).getMode()===At.NONE}updateToolbar(e){l(this,ht).updateToolbar(e)}updateMode(e=l(this,ht).getMode()){switch(X(this,rr,Nv).call(this),e){case At.NONE:this.div.classList.toggle("nonEditing",!0),this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),this.disableClick();return;case At.INK:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick();break;case At.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);let{classList:t}=this.div;if(t.toggle("nonEditing",!1),e===At.POPUP)t.toggle("commentEditing",!0);else{t.toggle("commentEditing",!1);for(let n of l(qs,ku).values())t.toggle(`${n._type}Editing`,e===n._editorType)}this.div.hidden=!1}hasTextLayer(e){return e===l(this,Sn)?.div}setEditingState(e){l(this,ht).setEditingState(e)}addCommands(e){l(this,ht).addCommands(e)}cleanUndoStack(e){l(this,ht).cleanUndoStack(e)}toggleDrawing(e=!1){this.div.classList.toggle("drawing",!e)}togglePointerEvents(e=!1){this.div.classList.toggle("disabled",!e)}toggleAnnotationLayerPointerEvents(e=!1){l(this,Du)?.togglePointerEvents(e)}async enable(){O(this,Ip,!0),this.div.tabIndex=0,this.togglePointerEvents(!0),this.div.classList.toggle("nonEditing",!1),l(this,Ou)?.abort(),O(this,Ou,null);let e=new Set;for(let n of l(this,rr,_m))n.enableEditing(),n.show(!0),n.annotationElementId&&(l(this,ht).removeChangedExistingAnnotation(n),e.add(n.annotationElementId));let t=l(this,Du);if(t)for(let n of t.getEditableAnnotations()){if(n.hide(),l(this,ht).isDeletedAnnotationElement(n.data.id)||e.has(n.data.id))continue;let i=await this.deserialize(n);i&&(this.addOrRebuild(i),i.enableEditing())}O(this,Ip,!1),l(this,ht)._eventBus.dispatch("editorsrendered",{source:this,pageNumber:this.pageIndex+1})}disable(){if(O(this,Dp,!0),this.div.tabIndex=-1,this.togglePointerEvents(!1),this.div.classList.toggle("nonEditing",!0),l(this,Sn)&&!l(this,Ou)){O(this,Ou,new AbortController);let i=l(this,ht).combinedSignal(l(this,Ou));l(this,Sn).div.addEventListener("pointerdown",o=>{let{clientX:a,clientY:u,timeStamp:c}=o,f=l(this,Np);if(c-f>500){O(this,Np,c);return}O(this,Np,-1);let{classList:h}=this.div;h.toggle("getElements",!0);let d=document.elementsFromPoint(a,u);if(h.toggle("getElements",!1),!this.div.contains(d[0]))return;let m,y=new RegExp(`^${Tm}[0-9]+$`);for(let w of d)if(y.test(w.id)){m=w.id;break}if(!m)return;let v=l(this,Ti).get(m);v?.annotationElementId===null&&(o.stopPropagation(),o.preventDefault(),v.dblclick(o))},{signal:i,capture:!0})}let e=l(this,Du),t=[];if(e){let i=new Map,o=new Map;for(let a of l(this,rr,_m)){if(a.disableEditing(),!a.annotationElementId){t.push(a);continue}if(a.serialize()!==null){i.set(a.annotationElementId,a);continue}else o.set(a.annotationElementId,a);this.getEditableAnnotation(a.annotationElementId)?.show(),a.remove()}let s=e.getEditableAnnotations();for(let a of s){let{id:u}=a.data;if(l(this,ht).isDeletedAnnotationElement(u)){a.updateEdited({deleted:!0});continue}let c=o.get(u);if(c){c.resetAnnotationElement(a),c.show(!1),a.show();continue}c=i.get(u),c&&(l(this,ht).addChangedExistingAnnotation(c),c.renderAnnotationElement(a)&&c.show(!1)),a.show()}}X(this,rr,Nv).call(this),this.isEmpty&&(this.div.hidden=!0);let{classList:n}=this.div;for(let i of l(qs,ku).values())n.remove(`${i._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),e?.updateFakeAnnotations(t),O(this,Dp,!1)}getEditableAnnotation(e){return l(this,Du)?.getEditableAnnotation(e)||null}setActiveEditor(e){l(this,ht).getActive()!==e&&l(this,ht).setActiveEditor(e)}enableTextSelection(){if(this.div.tabIndex=-1,l(this,Sn)?.div&&!l(this,ll)){O(this,ll,new AbortController);let e=l(this,ht).combinedSignal(l(this,ll));l(this,Sn).div.addEventListener("pointerdown",X(this,rr,v8).bind(this),{signal:e}),l(this,Sn).div.classList.add("highlighting")}}disableTextSelection(){this.div.tabIndex=0,l(this,Sn)?.div&&l(this,ll)&&(l(this,ll).abort(),O(this,ll,null),l(this,Sn).div.classList.remove("highlighting"))}enableClick(){if(l(this,Iu))return;O(this,Iu,new AbortController);let e=l(this,ht).combinedSignal(l(this,Iu));this.div.addEventListener("pointerdown",this.pointerdown.bind(this),{signal:e});let t=this.pointerup.bind(this);this.div.addEventListener("pointerup",t,{signal:e}),this.div.addEventListener("pointercancel",t,{signal:e})}disableClick(){l(this,Iu)?.abort(),O(this,Iu,null)}attach(e){l(this,Ti).set(e.id,e);let{annotationElementId:t}=e;t&&l(this,ht).isDeletedAnnotationElement(t)&&l(this,ht).removeDeletedAnnotationElement(e)}detach(e){l(this,Ti).delete(e.id),l(this,jf)?.removePointerInTextLayer(e.contentDiv),!l(this,Dp)&&e.annotationElementId&&l(this,ht).addDeletedAnnotationElement(e)}remove(e){this.detach(e),l(this,ht).removeEditor(e),e.div.remove(),e.isAttachedToDOM=!1}changeParent(e){e.parent!==this&&(e.parent&&e.annotationElementId&&(l(this,ht).addDeletedAnnotationElement(e),br.deleteAnnotationElement(e),e.annotationElementId=null),this.attach(e),e.parent?.detach(e),e.setParent(this),e.div&&e.isAttachedToDOM&&(e.div.remove(),this.div.append(e.div)))}add(e){if(!(e.parent===this&&e.isAttachedToDOM)){if(this.changeParent(e),l(this,ht).addEditor(e),this.attach(e),!e.isAttachedToDOM){let t=e.render();this.div.append(t),e.isAttachedToDOM=!0}e.fixAndSetPosition(),e.onceAdded(!l(this,Ip)),l(this,ht).addToAnnotationStorage(e),e._reportTelemetry(e.telemetryInitialData)}}moveEditorInDOM(e){if(!e.isAttachedToDOM)return;let{activeElement:t}=document;e.div.contains(t)&&!l(this,ol)&&(e._focusEventsAllowed=!1,O(this,ol,setTimeout(()=>{O(this,ol,null),e.div.contains(document.activeElement)?e._focusEventsAllowed=!0:(e.div.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0,signal:l(this,ht)._signal}),t.focus())},0))),e._structTreeParentId=l(this,jf)?.moveElementInDOM(this.div,e.div,e.contentDiv,!0)}addOrRebuild(e){e.needsToBeRebuilt()?(e.parent||(e.parent=this),e.rebuild(),e.show()):this.add(e)}addUndoableEditor(e){let t=()=>e._uiManager.rebuild(e),n=()=>{e.remove()};this.addCommands({cmd:t,undo:n,mustExec:!1})}getEditorByUID(e){for(let t of l(this,Ti).values())if(t.uid===e)return t;return null}getNextId(){return l(this,ht).getId()}combinedSignal(e){return l(this,ht).combinedSignal(e)}canCreateNewEmptyEditor(){return l(this,rr,To)?.canCreateNewEmptyEditor()}async pasteEditor(e,t){this.updateToolbar(e),await l(this,ht).updateMode(e.mode);let{offsetX:n,offsetY:i}=X(this,rr,HT).call(this),o=this.getNextId(),s=X(this,rr,zT).call(this,{parent:this,id:o,x:n,y:i,uiManager:l(this,ht),isCentered:!0,...t});s&&this.add(s)}async deserialize(e){return await l(qs,ku).get(e.annotationType??e.annotationEditorType)?.deserialize(e,this,l(this,ht))||null}createAndAddNewEditor(e,t,n={}){let i=this.getNextId(),o=X(this,rr,zT).call(this,{parent:this,id:i,x:e.offsetX,y:e.offsetY,uiManager:l(this,ht),isCentered:t,...n});return o&&this.add(o),o}get boundingClientRect(){return this.div.getBoundingClientRect()}addNewEditor(e={}){this.createAndAddNewEditor(X(this,rr,HT).call(this),!0,e)}setSelected(e){l(this,ht).setSelected(e)}toggleSelected(e){l(this,ht).toggleSelected(e)}unselect(e){l(this,ht).unselect(e)}pointerup(e){let{isMac:t}=$r.platform;if(e.button!==0||e.ctrlKey&&t||e.target!==this.div||!l(this,Nu)||(O(this,Nu,!1),l(this,rr,To)?.isDrawer&&l(this,rr,To).supportMultipleDrawings))return;if(!l(this,Rp)){O(this,Rp,!0);return}let n=l(this,ht).getMode();if(n===At.STAMP||n===At.SIGNATURE){l(this,ht).unselectAll();return}this.createAndAddNewEditor(e,!1)}pointerdown(e){if(l(this,ht).getMode()===At.HIGHLIGHT&&this.enableTextSelection(),l(this,Nu)){O(this,Nu,!1);return}let{isMac:t}=$r.platform;if(e.button!==0||e.ctrlKey&&t||e.target!==this.div)return;if(O(this,Nu,!0),l(this,rr,To)?.isDrawer){this.startDrawingSession(e);return}let n=l(this,ht).getActive();O(this,Rp,!n||n.isEmpty())}startDrawingSession(e){if(this.div.focus({preventScroll:!0}),l(this,ro)){l(this,rr,To).startDrawing(this,l(this,ht),!1,e);return}l(this,ht).setCurrentDrawingSession(this),O(this,ro,new AbortController);let t=l(this,ht).combinedSignal(l(this,ro));this.div.addEventListener("blur",({relatedTarget:n})=>{n&&!this.div.contains(n)&&(O(this,al,null),this.commitOrRemove())},{signal:t}),l(this,rr,To).startDrawing(this,l(this,ht),!1,e)}pause(e){if(e){let{activeElement:t}=document;this.div.contains(t)&&O(this,al,t);return}l(this,al)&&setTimeout(()=>{l(this,al)?.focus(),O(this,al,null)},0)}endDrawingSession(e=!1){return l(this,ro)?(l(this,ht).setCurrentDrawingSession(null),l(this,ro).abort(),O(this,ro,null),O(this,al,null),l(this,rr,To).endDrawing(e)):null}findNewParent(e,t,n){let i=l(this,ht).findParent(t,n);return i===null||i===this?!1:(i.changeParent(e),!0)}commitOrRemove(){return l(this,ro)?(this.endDrawingSession(),!0):!1}onScaleChanging(){l(this,ro)&&l(this,rr,To).onScaleChangingWhenDrawing(this)}destroy(){this.commitOrRemove(),l(this,ht).getActive()?.parent===this&&(l(this,ht).commitOrRemove(),l(this,ht).setActiveEditor(null)),l(this,ol)&&(clearTimeout(l(this,ol)),O(this,ol,null));for(let e of l(this,Ti).values())l(this,jf)?.removePointerInTextLayer(e.contentDiv),e.setParent(null),e.isAttachedToDOM=!1,e.div.remove();this.div=null,l(this,Ti).clear(),l(this,ht).removeLayer(this)}render({viewport:e}){this.viewport=e,Lu(this.div,e);for(let t of l(this,ht).getEditors(this.pageIndex))this.add(t),t.rebuild();this.updateMode()}update({viewport:e}){l(this,ht).commitOrRemove(),X(this,rr,Nv).call(this);let t=this.viewport.rotation,n=e.rotation;if(this.viewport=e,Lu(this.div,{rotation:n}),t!==n)for(let i of l(this,Ti).values())i.rotate(n)}get pageDimensions(){let{pageWidth:e,pageHeight:t}=this.viewport.rawDims;return[e,t]}get scale(){return l(this,ht).viewParameters.realScale}};jf=new WeakMap,Rp=new WeakMap,Du=new WeakMap,Iu=new WeakMap,ol=new WeakMap,Ti=new WeakMap,Nu=new WeakMap,Dp=new WeakMap,Ip=new WeakMap,ro=new WeakMap,al=new WeakMap,Sn=new WeakMap,ll=new WeakMap,Ou=new WeakMap,Np=new WeakMap,ht=new WeakMap,ku=new WeakMap,rr=new WeakSet,_m=function(){return l(this,Ti).size!==0?l(this,Ti).values():l(this,ht).getEditors(this.pageIndex)},v8=function(e){l(this,ht).unselectAll();let{target:t}=e;if(t===l(this,Sn).div||(t.getAttribute("role")==="img"||t.classList.contains("endOfContent"))&&l(this,Sn).div.contains(t)){let{isMac:n}=$r.platform;if(e.button!==0||e.ctrlKey&&n)return;l(this,ht).showAllEditors("highlight",!0,!0),l(this,Sn).div.classList.add("free"),this.toggleDrawing(),uE.startHighlighting(this,l(this,ht).direction==="ltr",{target:l(this,Sn).div,x:e.x,y:e.y}),l(this,Sn).div.addEventListener("pointerup",()=>{l(this,Sn).div.classList.remove("free"),this.toggleDrawing(!0)},{once:!0,signal:l(this,ht)._signal}),e.preventDefault()}},To=function(){return l(qs,ku).get(l(this,ht).getMode())},zT=function(e){let t=l(this,rr,To);return t?new t.prototype.constructor(e):null},HT=function(){let{x:e,y:t,width:n,height:i}=this.boundingClientRect,o=Math.max(0,e),s=Math.max(0,t),a=Math.min(window.innerWidth,e+n),u=Math.min(window.innerHeight,t+i),c=(o+a)/2-e,f=(s+u)/2-t,[h,d]=this.viewport.rotation%180===0?[c,f]:[f,c];return{offsetX:h,offsetY:d}},Nv=function(){for(let e of l(this,Ti).values())e.isEmpty()&&e.remove()},ze(qs,"_initialized",!1),z(qs,ku,new Map([AT,LT,wm,uE,$T].map(e=>[e._editorType,e])));dE=qs,fn=class fn{constructor(){z(this,Qo);z(this,no,null);z(this,ri,new Map);z(this,$f,new Map)}setParent(e){if(!l(this,no)){O(this,no,e);return}if(l(this,no)!==e){if(l(this,ri).size>0)for(let t of l(this,ri).values())t.remove(),e.append(t);O(this,no,e)}}static get _svgFactory(){return Et(this,"_svgFactory",new qf)}draw(e,t=!1,n=!1){let i=on(fn,Fy)._++,o=X(this,Qo,qT).call(this),s=fn._svgFactory.createElement("defs");o.append(s);let a=fn._svgFactory.createElement("path");s.append(a);let u=`path_${i}`;a.setAttribute("id",u),a.setAttribute("vector-effect","non-scaling-stroke"),t&&l(this,$f).set(i,a);let c=n?X(this,Qo,_8).call(this,s,u):null,f=fn._svgFactory.createElement("use");return o.append(f),f.setAttribute("href",`#${u}`),this.updateProperties(o,e),l(this,ri).set(i,o),{id:i,clipPathId:`url(#${c})`}}drawOutline(e,t){let n=on(fn,Fy)._++,i=X(this,Qo,qT).call(this),o=fn._svgFactory.createElement("defs");i.append(o);let s=fn._svgFactory.createElement("path");o.append(s);let a=`path_${n}`;s.setAttribute("id",a),s.setAttribute("vector-effect","non-scaling-stroke");let u;if(t){let h=fn._svgFactory.createElement("mask");o.append(h),u=`mask_${n}`,h.setAttribute("id",u),h.setAttribute("maskUnits","objectBoundingBox");let d=fn._svgFactory.createElement("rect");h.append(d),d.setAttribute("width","1"),d.setAttribute("height","1"),d.setAttribute("fill","white");let m=fn._svgFactory.createElement("use");h.append(m),m.setAttribute("href",`#${a}`),m.setAttribute("stroke","none"),m.setAttribute("fill","black"),m.setAttribute("fill-rule","nonzero"),m.classList.add("mask")}let c=fn._svgFactory.createElement("use");i.append(c),c.setAttribute("href",`#${a}`),u&&c.setAttribute("mask",`url(#${u})`);let f=c.cloneNode();return i.append(f),c.classList.add("mainOutline"),f.classList.add("secondaryOutline"),this.updateProperties(i,e),l(this,ri).set(n,i),n}finalizeDraw(e,t){l(this,$f).delete(e),this.updateProperties(e,t)}updateProperties(e,t){var u;if(!t)return;let{root:n,bbox:i,rootClass:o,path:s}=t,a=typeof e=="number"?l(this,ri).get(e):e;if(a){if(n&&X(this,Qo,GT).call(this,a,n),i&&X(u=fn,kE,E8).call(u,a,i),o){let{classList:c}=a;for(let[f,h]of Object.entries(o))c.toggle(f,h)}if(s){let f=a.firstElementChild.firstElementChild;X(this,Qo,GT).call(this,f,s)}}}updateParent(e,t){if(t===this)return;let n=l(this,ri).get(e);n&&(l(t,no).append(n),l(this,ri).delete(e),l(t,ri).set(e,n))}remove(e){l(this,$f).delete(e),l(this,no)!==null&&(l(this,ri).get(e).remove(),l(this,ri).delete(e))}destroy(){O(this,no,null);for(let e of l(this,ri).values())e.remove();l(this,ri).clear(),l(this,$f).clear()}};no=new WeakMap,ri=new WeakMap,$f=new WeakMap,Fy=new WeakMap,kE=new WeakSet,E8=function(e,[t,n,i,o]){let{style:s}=e;s.top=`${100*n}%`,s.left=`${100*t}%`,s.width=`${100*i}%`,s.height=`${100*o}%`},Qo=new WeakSet,qT=function(){let e=fn._svgFactory.create(1,1,!0);return l(this,no).append(e),e.setAttribute("aria-hidden",!0),e},_8=function(e,t){let n=fn._svgFactory.createElement("clipPath");e.append(n);let i=`clip_${t}`;n.setAttribute("id",i),n.setAttribute("clipPathUnits","objectBoundingBox");let o=fn._svgFactory.createElement("use");return n.append(o),o.setAttribute("href",`#${t}`),o.classList.add("clip"),i},GT=function(e,t){for(let[n,i]of Object.entries(t))i===null?e.removeAttribute(n):e.setAttribute(n,i)},z(fn,kE),z(fn,Fy,0);pE=fn;globalThis._pdfjsTestingUtils={HighlightOutliner:Um};globalThis.pdfjsLib={AbortException:so,AnnotationEditorLayer:dE,AnnotationEditorParamsType:Ft,AnnotationEditorType:At,AnnotationEditorUIManager:Pu,AnnotationLayer:oE,AnnotationMode:ul,AnnotationType:Vr,applyOpacity:wF,build:I3,ColorPicker:Pm,createValidAbsoluteUrl:VT,CSSConstants:Mv,DOMSVGFactory:qf,DrawLayer:pE,FeatureTest:$r,fetchData:$p,findContrastColor:vF,getDocument:S3,getFilenameFromUrl:gF,getPdfFilenameFromUrl:mF,getRGB:Wp,getUuid:XT,getXfaPageViewport:bF,GlobalWorkerOptions:Os,ImageKind:Am,InvalidPDFException:kp,isDataScheme:jy,isPdfFile:FE,isValidExplicitDest:t3,makeArr:KT,makeMap:BE,makeObj:kv,MathClamp:dn,noContextMenu:ss,normalizeUnicode:pF,OPS:Op,OutputScale:Zo,PasswordResponses:dF,PDFDataRangeTransport:Lm,PDFDateString:Wf,PDFWorker:Up,PermissionFlag:hF,PixelsPerInch:dl,RenderingCancelledException:Lp,renderRichText:ZT,ResponseException:zf,setLayerDimensions:Lu,shadow:Et,SignatureExtractor:ks,stopEvent:Ir,SupportedImageMimeTypes:Pv,TextLayer:Fp,TouchManager:Im,updateUrlHash:YT,Util:at,VerbosityLevel:Uy,version:D3,XfaLayer:Rm}});var AY={};uo(AY,{OfficeParser:()=>Xf,default:()=>EY,parseOffice:()=>vY});Te();Re();Ce();Te();Re();Ce();Pb();Te();Re();Ce();Te();Re();Ce();Te();Re();Ce();var Sk=ju(Gb()),qt=r=>new Sk.DOMParser().parseFromString(r,"text/xml"),Le=(r,e)=>Array.from(r.getElementsByTagName(e)),Tn=(r,e)=>{let t=[];if(!r.childNodes)return t;for(let n=0;n<r.childNodes.length;n++){let i=r.childNodes[n];i.nodeType===1&&i.tagName===e&&t.push(i)}return t},Il=r=>{let e=qt(r),t={},n=Le(e,"cp:coreProperties")[0];if(n){let o=Le(n,"dc:title")[0];o&&o.textContent&&(t.title=o.textContent);let s=Le(n,"dc:creator")[0];s&&s.textContent&&(t.author=s.textContent);let a=Le(n,"cp:lastModifiedBy")[0];a&&a.textContent&&(t.lastModifiedBy=a.textContent);let u=Le(n,"dcterms:created")[0];u&&u.textContent&&(t.created=new Date(u.textContent));let c=Le(n,"dcterms:modified")[0];return c&&c.textContent&&(t.modified=new Date(c.textContent)),t}let i=Le(e,"office:meta")[0];if(i){let o=Le(i,"dc:title")[0];o&&o.textContent&&(t.title=o.textContent);let s=Le(i,"dc:creator")[0];s&&s.textContent&&(t.author=s.textContent);let a=Le(i,"dc:description")[0];a&&a.textContent&&(t.description=a.textContent);let u=Le(i,"dc:subject")[0];u&&u.textContent&&(t.subject=u.textContent);let c=Le(i,"meta:creation-date")[0];c&&c.textContent&&(t.created=new Date(c.textContent));let f=Le(i,"dc:date")[0];f&&f.textContent&&(t.modified=new Date(f.textContent))}return t};var Ag=(r,e)=>{let t=r.localName===e||r.tagName===e?r:r.getElementsByTagName(e)[0];if(!t)return;let n=t.getElementsByTagName("c:rich"),i=t.getElementsByTagName("a:p"),o=n.length>0?Array.from(n):Array.from(i);if(o.length>0){let a="";for(let u of o){let c=u.getElementsByTagName("a:t");for(let f=0;f<c.length;f++)a+=(c[f].textContent||"")+" "}if(a.trim())return a.trim()}let s=t.getElementsByTagName("c:v")[0];if(s&&s.textContent)return s.textContent.trim()||void 0},h7=r=>{let e=r.toString("utf8"),n=qt(e).documentElement,i=Ag(n,"c:title"),o,s,a=n.getElementsByTagName("c:catAx");a.length>0&&(o=Ag(a[0],"c:title"));let u=n.getElementsByTagName("c:valAx");u.length>0&&(s=Ag(u[0],"c:title"));let c=n.getElementsByTagName("c:ser"),f=[],h=[];for(let m=0;m<c.length;m++){let y=c[m],v=Ag(y,"c:tx"),w=[],b=y.getElementsByTagName("c:val")[0]||y.getElementsByTagName("c:yVal")[0];if(b){let A=b.getElementsByTagName("c:v");for(let F=0;F<A.length;F++){let I=A[F].textContent?.trim();I&&w.push(I)}}let E=[],_=y.getElementsByTagName("c:dLbl");for(let A=0;A<_.length;A++){let F=Ag(_[A],"c:tx");F&&E.push(F)}let S=y.getElementsByTagName("c:cat")[0]||y.getElementsByTagName("c:xVal")[0];if(S){let A=S.getElementsByTagName("c:v"),F=[];for(let I=0;I<A.length;I++){let q=A[I].textContent?.trim();q&&F.push(q)}F.length>0&&h.length===0&&h.push(...F)}f.push({name:v,values:w,pointLabels:E})}let d=[];for(let m of f)m.name&&d.push(m.name),d.push(...h),d.push(...m.values);return{title:i,xAxisTitle:o,yAxisTitle:s,dataSets:f,labels:h,rawTexts:d}},d7=r=>{let e=r.toString("utf8"),t=qt(e),n=Le(t,"chart:chart")[0]||t.documentElement,i=Le(n,"chart:title")[0],o=i&&Le(i,"text:p")[0]?.textContent||void 0,s=Le(n,"table:table")[0],a=[],u=[],c=[];if(s){let m=[],y=Tn(s,"table:table-header-rows")[0];if(y&&m.push(...Tn(y,"table:table-row")),m.push(...Tn(s,"table:table-row")),m.length>0){let v=Tn(m[0],"table:table-cell");for(let w=1;w<v.length;w++){let b=parseInt(v[w].getAttribute("table:number-columns-repeated")||"1"),E=Tn(v[w],"text:p")[0]?.textContent||void 0;for(let _=0;_<b;_++)a.push({name:E,values:[],pointLabels:[]})}for(let w=1;w<m.length;w++){let b=Tn(m[w],"table:table-cell");if(b.length>0){let E=Tn(b[0],"text:p")[0]?.textContent||void 0;E&&u.push(E);let _=0;for(let S=1;S<b.length;S++){let A=parseInt(b[S].getAttribute("table:number-columns-repeated")||"1"),F=b[S].getAttribute("office:value")||Tn(b[S],"text:p")[0]?.textContent||"";for(let I=0;I<A;I++)a[_]&&a[_].values.push(F),_++}}}}}else{let m=Le(n,"chart:series");for(let v of m){let w=v.getAttribute("chart:label-cell-address"),b=v.getAttribute("chart:values-cell-range-address"),E,_=Le(v,"text:p");_.length>0&&(E=_[0].textContent||void 0),!E&&w&&(E=`Series ${w.split(".").pop()?.replace(/\$/g,"")||w}`);let S={name:E,values:[],pointLabels:[]};b&&S.values.push(`[${b}]`),a.push(S)}let y=Le(n,"chart:categories")[0];if(y){let v=y.getAttribute("table:cell-range-address");v&&u.push(`[${v}]`)}}let f=Le(t,"chart:axis"),h,d;for(let m of f){let y=m.getAttribute("chart:dimension"),v=Le(m,"chart:title")[0],w=v&&Le(v,"text:p")[0]?.textContent||void 0;y==="x"?h=w:y==="y"&&(d=w)}o&&c.push(o);for(let m of a)m.name&&c.push(m.name),c.push(...u),c.push(...m.values);return{title:o,xAxisTitle:h,yAxisTitle:d,dataSets:a,labels:u,rawTexts:c}},uc=r=>r.toString("utf8",0,500).includes("urn:oasis:names:tc:opendocument:xmlns:chart:1.0")?d7(r):h7(r);Te();Re();Ce();var Th="[OfficeParser]: ";var p7={EXTENSION_UNSUPPORTED:r=>`Sorry, OfficeParser currently supports docx, pptx, xlsx, odt, odp, ods, pdf, rtf files only. Create a ticket in Issues on github to add support for ${r} files. Stay tuned for further updates.`,FILE_CORRUPTED:r=>`Your file ${r} seems to be corrupted. If you are sure it is fine, please create a ticket in Issues on github with the file to reproduce error.`,FILE_DOES_NOT_EXIST:r=>`File ${r} could not be found! Check if the file exists or verify if the relative path to the file is correct from your terminal's location.`,LOCATION_NOT_FOUND:r=>`Entered location ${r} is not reachable! Please make sure that the entered directory location exists. Check relative paths and reenter.`,IMPROPER_ARGUMENTS:"Improper arguments",IMPROPER_BUFFERS:"Error occured while reading the file buffers",INVALID_INPUT:"Invalid input type: Expected a Buffer or a valid file path",PDF_WORKER_MISSING:'Missing PDF worker configuration. PDF parsing in browser environments requires a worker source. Please provide "pdfWorkerSrc" in your configuration.'},Tk=(r,e)=>{let t=p7[r];return typeof t=="function"?t(e):t},ma=(r,e,t)=>{let n=Tk(r,t);return e.outputErrorToConsole&&console.error(Th+n),new Error(Th+n)},Ck=(r,e,t)=>{let n=r.message||r;return t&&(n.includes("end of central directory record")||n.includes("invalid XML")||n.includes("Failed to open zip file")||n.includes("invalid distance too far back"))&&(n=Tk("FILE_CORRUPTED",t)),e.outputErrorToConsole&&console.error(Th+n),new Error(Th+n)},pi=(r,e,t)=>{e.outputErrorToConsole&&(t?console.warn(Th+r,t):console.warn(Th+r))};Te();Re();Ce();var g7=r=>{switch(r.toLowerCase()){case"jpg":case"jpeg":return"image/jpeg";case"png":return"image/png";case"gif":return"image/gif";case"bmp":return"image/bmp";case"tiff":return"image/tiff";case"webp":return"image/webp";default:return"application/octet-stream"}},m7=r=>{if(!(r.length<4)){if(r[0]===137&&r[1]===80&&r[2]===78&&r[3]===71)return"image/png";if(r[0]===255&&r[1]===216&&r[2]===255)return"image/jpeg";if(r[0]===71&&r[1]===73&&r[2]===70&&r[3]===56)return"image/gif";if(r[0]===66&&r[1]===77)return"image/bmp";if(r[0]===73&&r[1]===73&&r[2]===42&&r[3]===0||r[0]===77&&r[1]===77&&r[2]===0&&r[3]===42)return"image/tiff";if(r.length>=12&&r[0]===82&&r[1]===73&&r[2]===70&&r[3]===70&&r[8]===87&&r[9]===69&&r[10]===66&&r[11]===80)return"image/webp"}},js=(r,e)=>{let t=r.split(".").pop()||"",n=m7(e);return n||(n=g7(t)),{type:"image",mimeType:n,data:e.toString("base64"),name:r,extension:t}};Te();Re();Ce();var yL=ju(mL()),hs=async(r,e="eng")=>{let t=await(0,yL.createWorker)(e,1,{logger:()=>{}}),n=r;typeof window<"u"&&typeof Blob<"u"&&He.isBuffer(r)&&(n=new Blob([r],{type:"image/bmp"}));let i=await t.recognize(n);return await t.terminate(),i.data.text};Te();Re();Ce();var hB=ju(KP()),dB=ju(fB()),Fl=(r,e)=>new Promise((t,n)=>{hB.default.fromBuffer(r,{lazyEntries:!0},(i,o)=>{if(i)return n(i);if(!o)return n(new Error("Failed to open zip file"));let s=[];o.readEntry(),o.on("entry",a=>{e(a.fileName)?o.openReadStream(a,(u,c)=>{if(u)return n(u);if(!c)return n(new Error("Failed to open read stream"));c.pipe((0,dB.default)(f=>{s.push({path:a.fileName,content:f}),o.readEntry()}))}):o.readEntry()}),o.on("end",()=>t(s)),o.on("error",n)})});var pB=async(r,e)=>{let t=/xl\/worksheets\/sheet\d+.xml/g,n=/xl\/drawings\/drawing\d+.xml/g,i=/xl\/charts\/chart\d+.xml/g,o="xl/sharedStrings.xml",s=/xl\/media\/.*/,a=/docProps\/core\.xml/,u=/xl\/worksheets\/_rels\/sheet\d+\.xml\.rels/g,c=/xl\/drawings\/_rels\/drawing\d+\.xml\.rels/g,f=await Fl(r,L=>!!L.match(t)||!!L.match(n)||!!L.match(i)||L===o||L==="xl/styles.xml"||L==="xl/workbook.xml"||L==="xl/_rels/workbook.xml.rels"||!!L.match(a)||!!e.extractAttachments&&(!!L.match(s)||!!L.match(u)||!!L.match(c))),h=f.find(L=>L.path===o),d=[];if(h){let L=qt(h.content.toString()),$=Le(L,"si");for(let Y of $){let ie=Le(Y,"r");if(ie.length>0){let re=[];for(let k of ie){let x=Le(k,"t")[0];if(x){let P=x.textContent||"",C=Le(k,"rPr")[0],j={};if(C){Le(C,"b").length>0&&(j.bold=!0),Le(C,"i").length>0&&(j.italic=!0),Le(C,"u").length>0&&(j.underline=!0),Le(C,"strike").length>0&&(j.strikethrough=!0);let U=Le(C,"sz")[0];U&&(j.size=U.getAttribute("val")+"pt");let B=Le(C,"color")[0];if(B){let Ee=B.getAttribute("rgb");Ee&&(j.color="#"+Ee.substring(2))}let Q=Le(C,"rFont")[0];Q&&(j.font=Q.getAttribute("val")||void 0);let fe=Le(C,"vertAlign")[0];if(fe){let Ee=fe.getAttribute("val");Ee==="subscript"&&(j.subscript=!0),Ee==="superscript"&&(j.superscript=!0)}}re.push({type:"text",text:P,formatting:Object.keys(j).length>0?j:void 0})}}d.push(re)}else{let re=Le(Y,"t"),k="";for(let x of re)k+=x.textContent||"";d.push(k)}}}let m=f.find(L=>L.path==="xl/styles.xml"),y={};if(m){let L=qt(m.content.toString()),$=Le(L,"fonts")[0],Y=[];if($){let x=Le($,"font");for(let P of x){let C={};Le(P,"b").length>0&&(C.bold=!0),Le(P,"i").length>0&&(C.italic=!0),Le(P,"u").length>0&&(C.underline=!0),Le(P,"strike").length>0&&(C.strikethrough=!0);let j=Le(P,"sz")[0];if(j){let fe=j.getAttribute("val");fe&&(C.size=fe+"pt")}let U=Le(P,"color")[0];if(U){let fe=U.getAttribute("rgb");fe&&(C.color="#"+fe.substring(2))}let B=Le(P,"name")[0];if(B){let fe=B.getAttribute("val");fe&&(C.font=fe)}let Q=Le(P,"vertAlign")[0];if(Q){let fe=Q.getAttribute("val");fe==="subscript"&&(C.subscript=!0),fe==="superscript"&&(C.superscript=!0)}Y.push(C)}}let ie=Le(L,"fills")[0],re=[];if(ie){let x=Le(ie,"fill");for(let P of x){let C={},j=Le(P,"patternFill")[0];if(j){let U=Le(j,"fgColor")[0];if(U){let B=U.getAttribute("rgb"),Q=U.getAttribute("theme");if(B&&B!=="00000000")C.backgroundColor="#"+B.substring(2);else if(Q){let fe=parseInt(Q);fe===0?C.backgroundColor="#FFFFFF":fe===1?C.backgroundColor="#000000":fe===2?C.backgroundColor="#EEECE1":fe===3&&(C.backgroundColor="#1F497D")}}}re.push(C)}}let k=Le(L,"cellXfs")[0];if(k){let x=Le(k,"xf");for(let P=0;P<x.length;P++){let C=x[P],j={},U=C.getAttribute("fontId");if(U){let fe=parseInt(U);Y[fe]&&Object.assign(j,Y[fe])}let B=C.getAttribute("fillId");if(B){let fe=parseInt(B);re[fe]&&re[fe].backgroundColor&&(j.backgroundColor=re[fe].backgroundColor)}let Q=Le(C,"alignment")[0];if(Q){let fe=Q.getAttribute("horizontal");(fe==="center"||fe==="right"||fe==="justify"||fe==="left")&&(j.alignment=fe)}y[P]=j}}}let v=[],w=f.filter(L=>L.path.match(/xl\/media\/.*/)),b=f.filter(L=>L.path.match(i)),E={};if(e.extractAttachments){let L=f.filter(Y=>Y.path.match(c));for(let Y of L){let re=`xl/drawings/${Y.path.split("/").pop()?.replace(".rels","")||""}`,k=qt(Y.content.toString()),x=Le(k,"Relationship");E[re]||(E[re]={});for(let P of x){let C=P.getAttribute("Id"),j=P.getAttribute("Target");if(C&&j&&j.includes("media/")){let U="xl/"+j.replace("../","");E[re][C]={path:U}}}}let $=f.filter(Y=>Y.path.match(n));for(let Y of $){let ie=qt(Y.content.toString()),re=Le(ie,"xdr:pic"),k=E[Y.path]||{};for(let x of re){let P=Le(x,"xdr:blipFill")[0],C=P?Le(P,"a:blip")[0]:null,j=C?C.getAttribute("r:embed"):null,U=Le(x,"xdr:nvPicPr")[0],B=U?Le(U,"xdr:cNvPr")[0]:null,Q=B?B.getAttribute("descr")||B.getAttribute("name"):void 0;j&&k[j]&&(k[j].altText=Q||"")}}for(let Y of w){let ie=js(Y.path.split("/").pop()||"image",Y.content),re="";for(let k in E){for(let x in E[k])if(E[k][x].path===Y.path){re=E[k][x].altText||"";break}if(re)break}if(re&&(ie.altText=re),v.push(ie),e.ocr&&ie.mimeType.startsWith("image/"))try{let k=await hs(Y.content,e.ocrLanguage);k.trim()&&(ie.ocrText=k.trim())}catch(k){pi(`OCR failed for ${ie.name}:`,e,k)}}for(let Y of b){let ie={type:"chart",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",data:Y.content.toString("base64"),name:Y.path.split("/").pop()||"",extension:"xml"};try{let re=uc(Y.content);ie.chartData=re}catch(re){pi(`Failed to extract chart data from ${Y.path}:`,e,re)}v.push(ie)}}let _={};if(e.extractAttachments){let L=f.filter($=>$.path.match(c));for(let $ of L){let ie=`xl/drawings/${$.path.split("/").pop()?.replace(".rels","")||""}`,re=qt($.content.toString()),k=Le(re,"Relationship");_[ie]||(_[ie]={});for(let x of k){let P=x.getAttribute("Id"),C=x.getAttribute("Target"),j=x.getAttribute("Type");if(P&&C&&j&&j.includes("chart")){let U=C.split("/").pop()||"";_[ie][P]=U}}}}let S={},A=f.find(L=>L.path==="xl/workbook.xml"),F=f.find(L=>L.path==="xl/_rels/workbook.xml.rels");if(A&&F){let L=qt(F.content.toString()),$=Le(L,"Relationship"),Y={};for(let k of $){let x=k.getAttribute("Id"),P=k.getAttribute("Target");if(x&&P){let C=P.split("/").pop()||"";Y[x]=C}}let ie=qt(A.content.toString()),re=Le(ie,"sheet");for(let k of re){let x=k.getAttribute("name"),P=k.getAttribute("r:id");x&&P&&Y[P]&&(S[Y[P]]=x)}}let I=[],q=[];for(let L of f)if(!L.path.match(s)&&L.path!==o&&L.path!=="xl/styles.xml"&&!L.path.match(n)&&!L.path.match(i)&&!L.path.match(u)&&!L.path.match(c)&&L.path.match(t)){e.includeRawContent&&q.push(L.content.toString());let $=[],Y=/<row.*?>[\s\S]*?<\/row>/g,ie=L.content.toString().match(Y);if(ie)for(let x of ie){let P=[],C=/<c.*?>[\s\S]*?<\/c>/g,j=x.match(C),U=x.match(/r="(\d+)"/),B=U?parseInt(U[1])-1:0;if(j)for(let Q of j){let fe=Q.match(/t="([a-z]+)"/),Ee=fe?fe[1]:"n",te=Q.match(/<v>(.*?)<\/v>/),H=Q.match(/<t>(.*?)<\/t>/),ae="",we=[];if(Ee==="s"&&te){let oe=parseInt(te[1]),ge=d[oe];Array.isArray(ge)?(we=JSON.parse(JSON.stringify(ge)),ae=we.map(Se=>Se.text).join("")):ae=ge||""}else Ee==="inlineStr"&&H?ae=H[1]:te&&(ae=te[1]);let xe=Q.match(/r="([A-Z]+)(\d+)"/),M=(xe?xe[1]:"").charCodeAt(0)-65;if(ae||we.length>0){let oe=Q.match(/s="(\d+)"/),ge=oe?parseInt(oe[1]):void 0,Se=ge!==void 0&&y[ge]?y[ge]:{};if(we.length>0)for(let pe of we)pe.formatting||(pe.formatting={}),Se.backgroundColor&&(pe.formatting.backgroundColor=Se.backgroundColor),Se.alignment&&(pe.formatting.alignment=Se.alignment),!pe.formatting.font&&Se.font&&(pe.formatting.font=Se.font),!pe.formatting.size&&Se.size&&(pe.formatting.size=Se.size);else we.push({type:"text",text:ae,formatting:Se});let be={type:"cell",text:ae,children:we,metadata:{row:B,col:M}};e.includeRawContent&&(be.rawContent=Q),P.push(be)}}if(P.length>0){let Q={type:"row",children:P,metadata:void 0};e.includeRawContent&&(Q.rawContent=x),$.push(Q)}}if(e.extractAttachments){let P=`xl/worksheets/_rels/${L.path.split("/").pop()||""}.rels`,C=f.find(B=>B.path===P),j={};if(C){let B=qt(C.content.toString()),Q=Le(B,"Relationship");for(let fe of Q){let Ee=fe.getAttribute("Id"),te=fe.getAttribute("Target"),H=fe.getAttribute("Type");Ee&&te&&H&&H.includes("drawing")&&(j[Ee]="xl/drawings/"+te.replace("../drawings/",""))}}let U=L.content.toString().match(/<drawing r:id="(.*?)"/g);if(U)for(let B of U){let Q=B.match(/r:id="(.*?)"/),fe=Q?Q[1]:null;if(fe&&j[fe]){let Ee=j[fe],te=E[Ee];if(te)for(let ae in te){let we=te[ae],xe=v.find(V=>V.name===we.path.split("/").pop());if(xe){let V={type:"image",text:"",children:[],metadata:{attachmentName:xe.name||"unknown",altText:we.altText||void 0}};$.push(V)}}let H=_[Ee];if(H)for(let ae in H){let we=H[ae];if(v.find(V=>V.name===we)){let V={type:"chart",text:"",children:[],metadata:{attachmentName:we}};$.push(V)}}}}}let re=L.path.split("/").pop()||"Sheet",k=S[re]||re;I.push({type:"sheet",children:$,metadata:{sheetName:k},rawContent:e.includeRawContent?L.content.toString():void 0})}let ee=f.find(L=>L.path.match(a)),K=ee?Il(ee.content.toString()):{},ne=L=>{for(let $ of L){if("attachmentName"in($.metadata||{})){let Y=$.metadata,ie=v.find(re=>re.name===Y.attachmentName);ie&&($.type==="image"&&(ie.ocrText&&($.text=ie.ocrText),Y.altText&&(ie.altText=Y.altText)),$.type==="chart"&&ie.chartData&&($.text=ie.chartData.rawTexts.join(e.newlineDelimiter||`
|
|
106
|
-
`)))}$.children&&ne($.children)}};return ne(I),{type:"xlsx",metadata:K,content:I,attachments:v,toText:()=>I.map(L=>{let $=Y=>{let ie="";return Y.children?ie+=Y.children.map($).filter(re=>re!="").join(Y.children[0]?.children?e.newlineDelimiter??`
|
|
107
|
-
`:""):ie+=Y.text||"",ie};return $(L)}).filter(L=>L!="").join(e.newlineDelimiter??`
|
|
108
|
-
`)}};Te();Re();Ce();var gB=async(r,e)=>{let t=/content\.xml/,n=/Object \d+\/content\.xml/,i=/(Pictures|media)\/.*/,o=/meta\.xml/,s=/styles\.xml/,a=/mimetype/,u=await Fl(r,Y=>!!Y.match(t)||!!Y.match(n)||!!Y.match(o)||!!Y.match(s)||!!Y.match(a)||!!e.extractAttachments&&!!Y.match(i)),c=u.find(Y=>Y.path==="mimetype"),f="odt";if(c){let Y=c.content.toString().trim();Y.includes("spreadsheet")?f="ods":Y.includes("presentation")?f="odp":Y.includes("text")&&(f="odt")}let h=u.find(Y=>Y.path==="content.xml")||u.find(Y=>Y.path.match(t)),d=u.find(Y=>Y.path==="styles.xml"),m=[],y=[],v={},w={},b={};d&&(Y=>{let ie=qt(Y),re=Le(ie,"style:style");for(let k of re){let x=k.getAttribute("style:name");if(!x)continue;let P={},C=Le(k,"style:paragraph-properties")[0];if(C){let Q=C.getAttribute("fo:text-align");if(Q){let Ee={start:"left",left:"left",center:"center",end:"right",right:"right",justify:"justify"};Ee[Q]&&(P.alignment=Ee[Q])}Le(C,"style:drop-cap")[0]&&(P.dropCap=!0)}Object.keys(P).length>0&&(w[x]=P);let j=Le(k,"style:text-properties")[0],U=Le(k,"style:table-cell-properties")[0],B={};if(U){let Q=U.getAttribute("fo:background-color");Q&&Q!=="transparent"&&(B.backgroundColor=Q)}if(j){(j.getAttribute("fo:font-weight")==="bold"||j.getAttribute("style:font-weight-asian")==="bold")&&(B.bold=!0),(j.getAttribute("fo:font-style")==="italic"||j.getAttribute("style:font-style-asian")==="italic")&&(B.italic=!0),j.getAttribute("style:text-underline-style")==="solid"&&(B.underline=!0),j.getAttribute("style:text-line-through-style")==="solid"&&(B.strikethrough=!0);let Q=j.getAttribute("fo:font-size")||j.getAttribute("style:font-size-asian");Q&&(B.size=Q);let fe=j.getAttribute("fo:color");fe&&(B.color=fe);let Ee=j.getAttribute("fo:background-color");Ee&&Ee!=="transparent"&&(B.backgroundColor=Ee);let te=j.getAttribute("style:font-name")||j.getAttribute("fo:font-family");te&&(B.font=te);let H=j.getAttribute("style:text-position");H&&(H.startsWith("sub")&&(B.subscript=!0),H.startsWith("super")&&(B.superscript=!0)),Object.keys(B).length>0&&(v[x]=B)}}})(d.content.toString());let _=(Y,ie,re,k,x,P={},C)=>{let j=[],U="";if(!Y.childNodes)return{text:"",children:[]};for(let B=0;B<Y.childNodes.length;B++){let Q=Y.childNodes[B];if(Q.nodeType===3){let fe=Q.textContent||"";fe&&(U+=fe,j.push({type:"text",text:fe,formatting:P,metadata:C?{...C}:void 0}))}else if(Q.nodeType===1){let fe=Q,Ee=fe.tagName;if(Ee==="text:s"){let te=parseInt(fe.getAttribute("text:c")||"1"),H=" ".repeat(te);U+=H,j.push({type:"text",text:H,formatting:P,metadata:C?{...C}:void 0})}else if(Ee==="text:tab")U+=" ",j.push({type:"text",text:" ",formatting:P,metadata:C?{...C}:void 0});else if(Ee==="text:line-break")U+=`
|
|
109
|
-
`,j.push({type:"text",text:`
|
|
110
|
-
`,formatting:P,metadata:C?{...C}:void 0});else if(Ee==="text:span"){let te=fe.getAttribute("text:style-name"),H=te?{...P,...ie[te]}:P,ae=_(fe,ie,re,k,x,H,C);U+=ae.text,j.push(...ae.children)}else if(Ee==="text:a"){let te=fe.getAttribute("xlink:href")||"",H=te.startsWith("#")?"internal":"external",we=_(fe,ie,re,k,x,P,{link:te,linkType:H});U+=we.text,j.push(...we.children)}else if(Ee==="text:note"&&!re.ignoreNotes){let te=fe.getAttribute("text:note-class")||"footnote",H=fe.getAttribute("text:id")||fe.getAttribute("xml:id")||void 0,ae=Le(fe,"text:note-body")[0];if(ae){let we=Le(ae,"text:p"),xe=[],V="";for(let oe of we){let ge=S(oe,x,ie,re);V+=(V?" ":"")+ge.text;let Se={type:"paragraph",text:ge.text,children:ge.children,metadata:ge.alignment?{alignment:ge.alignment}:void 0};xe.push(Se)}let M={type:"note",text:V,children:xe,metadata:{noteType:te,noteId:H}};re.putNotesAtLast?k.push(M):j.push(M)}}else if(Ee==="draw:frame"){let te=fe,H="",ae=Le(te,"svg:title")[0],we=Le(te,"svg:desc")[0];ae&&ae.textContent?H=ae.textContent:we&&we.textContent&&(H=we.textContent);let xe="",V=Le(te,"draw:image");if(V.length>0&&(xe=V[0].getAttribute("xlink:href")||"",xe)){let oe=xe.split("/");xe=oe[oe.length-1]}let M={type:"image",text:"",children:[],metadata:{attachmentName:xe,...H?{altText:H}:{}}};re.includeRawContent&&(M.rawContent=te.toString()),j.push(M)}}}return{text:U,children:j}},S=(Y,ie,re,k)=>{let x=Y.getAttribute("text:style-name"),P=x?ie[x]:void 0,C=P?.alignment,j=P?.dropCap,U=_(Y,re,k,y,ie);if(x&&U.children.forEach(B=>{if(B.type==="text"){B.metadata||(B.metadata={});let Q=B.metadata;Q.style||(Q.style=x)}}),U.children.length===0&&Y.textContent){let B=Y.textContent;B.trim()&&(U.text=B,U.children.push({type:"text",text:B}))}if(j&&U.children.length>0){let B=U.children[0];if(B.type==="text"&&B.text)if(B.text.length===1)B.formatting={...B.formatting,size:"58.5pt"};else{let Q=B.text[0],fe=B.text.substring(1),Ee={type:"text",text:Q,formatting:{...B.formatting,size:"58.5pt"},metadata:B.metadata};B.text=fe,U.children.unshift(Ee)}}return{text:U.text,children:U.children,alignment:C,style:x||void 0}},A=(Y,ie,re,k)=>{let x=[],P=Tn(Y,"table:table-row"),C=0;for(let j of P){let U=[],B=Tn(j,"table:table-cell"),Q=parseInt(j.getAttribute("table:number-rows-repeated")||"1"),fe=0;for(let Ee of B){let te=[],H={value:""},ae=parseInt(Ee.getAttribute("table:number-columns-repeated")||"1"),we=parseInt(Ee.getAttribute("table:number-columns-spanned")||"1"),xe=parseInt(Ee.getAttribute("table:number-rows-spanned")||"1"),V=oe=>{if(oe.childNodes)for(let ge=0;ge<oe.childNodes.length;ge++){let Se=oe.childNodes[ge];if(Se.nodeType===1){let be=Se;if(be.tagName==="text:p"||be.tagName==="text:h"){let pe=S(be,ie,re,k),Ae={type:be.tagName==="text:h"?"heading":"paragraph",text:pe.text,children:pe.children,metadata:{...pe.alignment?{alignment:pe.alignment}:{},...pe.style?{style:pe.style}:{}}};Object.keys(Ae.metadata||{}).length===0&&delete Ae.metadata,be.tagName==="text:h"&&(Ae.metadata||(Ae.metadata={}),Ae.metadata.level=parseInt(be.getAttribute("text:outline-level")||"1")),k.includeRawContent&&(Ae.rawContent=be.toString()),te.push(Ae),H.value+=pe.text,H.value&&!H.value.endsWith(`
|
|
111
|
-
`)&&(H.value+=`
|
|
112
|
-
`)}else if(be.tagName==="table:table"){let pe=A(be,ie,re,k);te.push(pe)}else(be.tagName==="draw:frame"||be.tagName==="draw:text-box")&&V(be)}}};V(Ee);let M=H.value;M.endsWith(`
|
|
113
|
-
`)&&(M=M.slice(0,-1));for(let oe=0;oe<ae;oe++){let ge={type:"cell",text:M,children:te.length>0?oe===0?te:JSON.parse(JSON.stringify(te)):[],metadata:{row:C,col:fe}},Se=ge.metadata;we>1&&(Se.colSpan=we),xe>1&&(Se.rowSpan=xe),k.includeRawContent&&(ge.rawContent=Ee.toString()),U.push(ge),fe++}}for(let Ee=0;Ee<Q;Ee++){let te={type:"row",children:Ee===0?U:JSON.parse(JSON.stringify(U))};Ee>0&&te.children?.forEach(H=>{H.metadata&&"row"in H.metadata&&(H.metadata.row=C)}),k.includeRawContent&&(te.rawContent=j.toString()),x.push(te),C++}}return{type:"table",children:x}};h&&(Y=>{let ie=qt(Y),re=Le(ie,"office:body")[0],k=Le(ie,"office:automatic-styles")[0];if(k){let P=Le(k,"style:style");for(let C of P){let j=C.getAttribute("style:name");if(!j)continue;let U=Le(C,"style:paragraph-properties")[0],B={};if(U){let fe=U.getAttribute("fo:text-align");if(fe){let te={start:"left",left:"left",center:"center",end:"right",right:"right",justify:"justify"};te[fe]&&(B.alignment=te[fe])}Le(U,"style:drop-cap")[0]&&(B.dropCap=!0)}Object.keys(B).length>0&&(w[j]=B);let Q=Le(C,"style:text-properties")[0];if(Q){let fe={};(Q.getAttribute("fo:font-weight")==="bold"||Q.getAttribute("style:font-weight-asian")==="bold")&&(fe.bold=!0),(Q.getAttribute("fo:font-style")==="italic"||Q.getAttribute("style:font-style-asian")==="italic")&&(fe.italic=!0),Q.getAttribute("style:text-underline-style")==="solid"&&(fe.underline=!0),Q.getAttribute("style:text-line-through-style")==="solid"&&(fe.strikethrough=!0);let Ee=Q.getAttribute("fo:font-size")||Q.getAttribute("style:font-size-asian");Ee&&(fe.size=Ee);let te=Q.getAttribute("fo:color");te&&(fe.color=te);let H=Q.getAttribute("fo:background-color");H&&H!=="transparent"&&(fe.backgroundColor=H);let ae=Q.getAttribute("style:font-name")||Q.getAttribute("fo:font-family");ae&&(fe.font=ae);let we=Q.getAttribute("style:text-position");we&&(we.startsWith("sub")&&(fe.subscript=!0),we.startsWith("super")&&(fe.superscript=!0)),Object.keys(fe).length>0&&(v[j]=fe)}}}let x=(P,C,j=!1)=>{if(P.tagName==="text:p"){let U=S(P,w,v,e),B=j||(P.getAttribute("text:style-name")||"").toLowerCase().includes("title")?"heading":"paragraph",Q={type:B,text:U.text,children:U.children,metadata:{...U.alignment?{alignment:U.alignment}:{},...U.style?{style:U.style}:{}}};B==="heading"&&Q.metadata&&(Q.metadata.level=Q.metadata.level||1),Object.keys(Q.metadata||{}).length===0&&delete Q.metadata,e.includeRawContent&&(Q.rawContent=P.toString()),C.push(Q)}else if(P.tagName==="text:h"){let U=parseInt(P.getAttribute("text:outline-level")||"1"),B=S(P,w,v,e),Q={type:"heading",text:B.text,children:B.children,metadata:{level:U,...B.alignment?{alignment:B.alignment}:{},...B.style?{style:B.style}:{}}};e.includeRawContent&&(Q.rawContent=P.toString()),C.push(Q)}else if(P.tagName==="table:table"){let U=A(P,w,v,e);e.includeRawContent&&(U.rawContent=P.toString()),C.push(U)}else if(P.tagName==="text:list"){let U=Tn(P,"text:list-item"),B=P.getAttribute("text:style-name")||P.getAttribute("xml:id"),Q=B||`list-${C.length}`,fe="unordered",Ee=!1,te=B;if(!te){let xe=P.parentNode;for(;xe&&!te&&!(xe.nodeName==="text:list"&&(te=xe.getAttribute("text:style-name"),te));)xe=xe.parentNode}if(te){let xe=Le(qt(h?.content.toString()||""),"office:automatic-styles")[0];if(xe){let V=Le(xe,"text:list-style");for(let M of V)if(M.getAttribute("style:name")===te){let oe=Le(M,"text:list-level-style-bullet"),ge=Le(M,"text:list-level-style-number"),Se=Le(M,"text:list-level-style-image");ge.length>0?(fe="ordered",Ee=ge.some(be=>!!be.getAttribute("style:num-format"))):oe.length>0&&(fe="unordered",Ee=oe.some(be=>!!be.getAttribute("text:bullet-char"))),Se.length>0&&(Ee=!0);break}}if(d&&!Ee){let V=qt(d.content.toString()),M=Le(V,"text:list-style");for(let oe of M)if(oe.getAttribute("style:name")===te){let ge=Le(oe,"text:list-level-style-bullet"),Se=Le(oe,"text:list-level-style-number"),be=Le(oe,"text:list-level-style-image");Se.length>0?(fe="ordered",Ee=Se.some(pe=>!!pe.getAttribute("style:num-format"))):ge.length>0&&(fe="unordered",Ee=ge.some(pe=>!!pe.getAttribute("text:bullet-char"))),be.length>0&&(Ee=!0);break}}}if(!Ee){for(let xe=0;xe<U.length;xe++){let V=U[xe];if(V.childNodes)for(let M=0;M<V.childNodes.length;M++){let oe=V.childNodes[M];oe.nodeType===1&&x(oe,C,j)}}return}let H=0,ae=P.parentNode;for(;ae;)ae.nodeName==="text:list"&&H++,ae=ae.parentNode;b[Q]||(b[Q]={});let we=H.toString();b[Q][we]===void 0&&(b[Q][we]=-1);for(let xe=0;xe<U.length;xe++){let V=U[xe];b[Q][we]++;let M=b[Q][we];for(let oe=H+1;oe<10;oe++)b[Q][oe.toString()]!==void 0&&(b[Q][oe.toString()]=-1);if(V.childNodes)for(let oe=0;oe<V.childNodes.length;oe++){let ge=V.childNodes[oe];if(ge.nodeType===1){let Se=ge;if(Se.tagName==="text:p"){let be=S(Se,w,v,e),pe={type:"list",text:be.text,children:be.children,metadata:{listType:fe,indentation:H,itemIndex:M,listId:Q,alignment:be.alignment||"left",style:be.style}};e.includeRawContent&&(pe.rawContent=Se.toString()),C.push(pe)}else if(Se.tagName==="text:h"){let be=parseInt(Se.getAttribute("text:outline-level")||"1"),pe=S(Se,w,v,e),Ae={type:"list",text:pe.text,children:pe.children,metadata:{listType:fe,indentation:H,itemIndex:M,listId:Q,...pe.alignment?{alignment:pe.alignment}:{},style:pe.style}};e.includeRawContent&&(Ae.rawContent=Se.toString()),C.push(Ae)}else Se.tagName==="text:list"&&x(Se,C,j)}}}}else if(P.tagName==="draw:frame"){let U=P.getAttribute("presentation:class"),B=U==="title"||U==="sub-title",Q=Le(P,"draw:text-box")[0],fe=Le(P,"draw:image")[0],Ee=Le(P,"table:table")[0],te=Le(P,"draw:object")[0];if(Q)x(Q,C,B||j);else if(Ee){let H=A(Ee,w,v,e);e.includeRawContent&&(H.rawContent=Ee.toString()),C.push(H)}else if(fe){let H="",ae=Le(P,"svg:title")[0],we=Le(P,"svg:desc")[0];ae&&ae.textContent?H=ae.textContent:we&&we.textContent&&(H=we.textContent);let xe=fe.getAttribute("xlink:href")||"";if(xe){let M=xe.split("/");xe=M[M.length-1]}let V={type:"image",text:"",children:[],metadata:{attachmentName:xe,...H?{altText:H}:{}}};e.includeRawContent&&(V.rawContent=P.toString()),C.push(V)}else if(te){let H=te.getAttribute("xlink:href");if(H){let ae=H.split("/")[0],we=`${ae}/content.xml`,xe=u.find(V=>V.path===we||V.path.endsWith(we));if(xe){let V=uc(xe.content),M={type:"chart",text:V.rawTexts.join(" "),metadata:{attachmentName:ae,chartData:V}};e.includeRawContent&&(M.rawContent=P.toString()),C.push(M)}else{let V={type:"chart",text:"",metadata:{attachmentName:ae}};e.includeRawContent&&(V.rawContent=P.toString()),C.push(V)}}}}else if(P.childNodes)for(let U=0;U<P.childNodes.length;U++){let B=P.childNodes[U];B.nodeType===1&&x(B,C,j)}};if(f==="ods"){let P=Le(re,"office:spreadsheet")[0];if(P){let C=Le(P,"table:table");for(let j=0;j<C.length;j++){let U=C[j],B=U.getAttribute("table:name")||`Sheet${j+1}`,Q=[],fe=Le(U,"table:table-row"),Ee=0;for(let H=0;H<fe.length;H++){let ae=fe[H],we=[],xe=Le(ae,"table:table-cell"),V=0,M=parseInt(ae.getAttribute("table:number-rows-repeated")||"1");for(let oe=0;oe<xe.length;oe++){let ge=xe[oe],Se=parseInt(ge.getAttribute("table:number-columns-repeated")||"1"),be="",pe=[],Ae=Le(ge,"text:p");for(let ke=0;ke<Ae.length;ke++){let Ne=Ae[ke],Ze=Le(Ne,"text:span");if(Ze.length>0)for(let tt of Ze){let it=tt.getAttribute("text:style-name"),T=it?v[it]:{},g=tt.textContent||"";be+=g;let p={type:"text",text:g,formatting:T};pe.push(p)}else{let tt=Ne.textContent||"";if(be+=tt,tt.trim()){let it={type:"text",text:tt,formatting:{}};pe.push(it)}}ke<Ae.length-1&&(be+=`
|
|
114
|
-
`)}let $e=Le(ge,"draw:frame");for(let ke of $e){let Ne="",Ze=Le(ke,"svg:title")[0],tt=Le(ke,"svg:desc")[0];Ze&&Ze.textContent?Ne=Ze.textContent:tt&&tt.textContent&&(Ne=tt.textContent);let it="",T=Le(ke,"draw:image");if(T.length>0){let R=T[0].getAttribute("xlink:href");if(R){let J=R.split("/");it=J[J.length-1]}}let g="",p=Le(ke,"draw:object");if(p.length>0){let R=p[0].getAttribute("xlink:href");R&&(g=R.split("/")[0])}if(T.length>0){let R={type:"image",text:"",children:[],metadata:{attachmentName:it,...Ne?{altText:Ne}:{}}};e.includeRawContent&&(R.rawContent=ke.toString()),pe.push(R)}else if(g){let R={type:"chart",text:"",children:[],metadata:{attachmentName:g}};pe.push(R)}}for(let ke=0;ke<Se;ke++){if(be||pe.length>0||f!=="ods"){let Ne={type:"cell",text:be,children:pe,metadata:{row:Ee,col:V}};e.includeRawContent&&(Ne.rawContent=ge.toString()),we.push(Ne)}V++}}if(we.length>0)for(let oe=0;oe<M;oe++){let ge={type:"row",children:JSON.parse(JSON.stringify(we)),metadata:void 0};oe>0&&ge.children?.forEach(Se=>{Se.metadata&&"row"in Se.metadata&&(Se.metadata.row=Ee)}),e.includeRawContent&&(ge.rawContent=ae.toString()),Q.push(ge),Ee++}else Ee+=M}let te={type:"sheet",children:Q,metadata:{sheetName:B}};e.includeRawContent&&(te.rawContent=U.toString()),m.push(te)}}}else if(f==="odp"){let P=Le(re,"office:presentation")[0];if(P){let C=Tn(P,"draw:page"),j=[];for(let U=0;U<C.length;U++){let B=C[U],Q={type:"slide",children:[],metadata:{slideNumber:U+1}},fe,Ee=B.childNodes;if(Ee)for(let te=0;te<Ee.length;te++){let H=Ee[te];if(H.nodeType===1){let ae=H;if(ae.tagName==="presentation:notes"){e.ignoreNotes||(fe={type:"note",children:[],metadata:{slideNumber:U+1,noteId:`slide-note-${U+1}`}},x(ae,fe.children));continue}x(ae,Q.children)}}e.includeRawContent&&(Q.rawContent=B.toString()),m.push(Q),fe&&fe.children&&fe.children.length>0&&(e.putNotesAtLast?j.push(fe):m.push(fe))}j.length>0&&m.push(...j)}}else{let P=Le(re,"office:text")[0];P&&x(P,m)}})(h.content.toString());let I=[],q=u.filter(Y=>Y.path.match(/(Pictures|media)\/.*/));if(e.extractAttachments){let Y=u.filter(ie=>ie.path.match(/Object \d+\/content\.xml/));for(let ie of Y){let re=qt(ie.content.toString());if(Le(re,"chart:chart").length>0){let x=ie.path.split("/")[0],P={type:"chart",mimeType:"application/vnd.oasis.opendocument.chart",data:ie.content.toString("base64"),name:x,extension:"xml"},C=uc(ie.content);C.rawTexts.length>0&&(P.chartData=C),I.push(P)}}}if(e.extractAttachments)for(let Y of q){let ie=js(Y.path.split("/").pop()||"image",Y.content);if(I.push(ie),e.ocr&&ie.mimeType.startsWith("image/"))try{ie.ocrText=(await hs(Y.content,e.ocrLanguage)).trim()}catch(re){pi(`OCR failed for ${ie.name}:`,e,re)}}let ee=u.find(Y=>Y.path.match(o)),K=ee?Il(ee.content.toString()):{},ne=(Y,ie)=>{let re=x=>{let P=x.replace(/^\[|\]$/g,""),[C,j]=P.split(":"),U=C.lastIndexOf(".");if(U===-1)return[x];let B=C.substring(0,U).replace(/^'|'$/g,""),Q=C.substring(U+1).replace(/\$/g,""),fe=Q;if(j)if(j.startsWith("."))fe=j.substring(1).replace(/\$/g,"");else{let xe=j.lastIndexOf(".");fe=j.substring(xe+1).replace(/\$/g,"")}let Ee=xe=>{let V=xe.match(/[A-Z]+/),M=xe.match(/\d+/);if(!V||!M)return null;let oe=V[0],ge=0;for(let be=0;be<oe.length;be++)ge=ge*26+(oe.charCodeAt(be)-65+1);return ge-=1,{r:parseInt(M[0])-1,c:ge}},te=Ee(Q),H=Ee(fe);if(!te||!H)return[x];let ae=ie.find(xe=>xe.type==="sheet"&&xe.metadata?.sheetName===B);if(!ae||!ae.children)return[x];let we=[];for(let xe of ae.children)if(xe.children)for(let V of xe.children){let M=V.metadata;M&&M.row>=te.r&&M.row<=H.r&&M.col>=te.c&&M.col<=H.c&&we.push(V.text||"")}return we.length>0?we:[]};for(let x of Y.dataSets){let P=[];for(let C of x.values)C.startsWith("[")?P.push(...re(C)):P.push(C);x.values=P}let k=[];for(let x of Y.labels)x.startsWith("[")?k.push(...re(x)):k.push(x);Y.labels=k,Y.rawTexts=[],Y.title&&Y.rawTexts.push(Y.title);for(let x of Y.dataSets)x.name&&Y.rawTexts.push(x.name),Y.rawTexts.push(...Y.labels),Y.rawTexts.push(...x.values)};for(let Y of I)Y.type==="chart"&&Y.chartData&&ne(Y.chartData,m);(Y=>{let ie=new Set,re=C=>{for(let j of C){if(j.metadata&&"attachmentName"in j.metadata){let U=j.metadata.attachmentName;U&&ie.add(U)}j.children&&re(j.children)}};re(Y);let k=I.filter(C=>C.type==="image"&&C.name&&!ie.has(C.name)),x=0,P=C=>{if((C.type==="image"||C.type==="chart")&&C.metadata&&"attachmentName"in C.metadata){let j=C.metadata.attachmentName;if(!j&&C.type==="image"&&x<k.length&&(j=k[x++].name,C.metadata.attachmentName=j),j){let U=I.find(B=>B.name===j);U&&(U.ocrText&&(C.text=U.ocrText),U.chartData&&C.type==="chart"&&(C.text=U.chartData.rawTexts.join(e.newlineDelimiter??`
|
|
115
|
-
`)))}}C.children&&C.children.forEach(P)};Y.forEach(P)})(m);let $={};for(let Y in v)$[Y]={formatting:v[Y],alignment:w[Y]?.alignment};for(let Y in w)$[Y]||($[Y]={formatting:{},alignment:w[Y]?.alignment});return e.putNotesAtLast&&y.length>0&&m.push(...y),{type:f,metadata:{...K,styleMap:$},content:m,attachments:I,toText:()=>m.map(Y=>{let ie=re=>{let k="";if(re.children&&re.children.length>0){let P=re.children.some(C=>C.children&&C.children.length>0)?e.newlineDelimiter??`
|
|
116
|
-
`:"";k+=re.children.map(ie).filter(C=>C!="").join(P)}else k+=re.text||"";return k};return ie(Y)}).filter(Y=>Y!="").join(e.newlineDelimiter??`
|
|
117
|
-
`)}};Te();Re();Ce();Te();Re();Ce();async function sC(r){return new Function("s","return import(s)")(r)}async function S8(){return typeof window>"u"?sC("file-type"):Promise.resolve().then(()=>(HB(),zB))}async function T8(){if(typeof window>"u")try{return await sC("pdfjs-dist/legacy/build/pdf.mjs")}catch{return await sC("pdfjs-dist")}return Promise.resolve().then(()=>(x8(),A8))}function C8(r){if(r)try{let e=r.startsWith("D:")?r.slice(2):r,t=parseInt(e.slice(0,4),10),n=parseInt(e.slice(4,6),10)-1,i=parseInt(e.slice(6,8),10)||1,o=parseInt(e.slice(8,10),10)||0,s=parseInt(e.slice(10,12),10)||0,a=parseInt(e.slice(12,14),10)||0,u=e.slice(14).match(/([+-Z])(\d{2})'?(\d{2})?'?/);if(u){let c=u[1]==="-"?-1:1,f=parseInt(u[2],10)||0,h=parseInt(u[3],10)||0,d=c*(f*60+h),m=Date.UTC(t,n,i,o,s,a);return new Date(m-d*6e4)}return new Date(t,n,i,o,s,a)}catch{try{return new Date(r)}catch{return}}}function cY(r){let e=[];for(let i of r)for(let o of i)o.type==="text"&&o.height>0&&e.push(o.height);if(e.length===0)return{median:12,max:12};e.sort((i,o)=>i-o);let t=e[Math.floor(e.length/2)],n=e[e.length-1];return{median:t,max:n}}function fY(r,e){if(r<=e.median*1.2)return 0;let t=r/e.median;return t>=2?1:t>=1.7?2:t>=1.5?3:t>=1.35?4:t>=1.2?5:0}function hY(r,e){let t=r.x+r.width/2,n=r.y+r.height/2;for(let i of e){let[o,s,a,u]=i.rect,c=Math.min(o,a),f=Math.max(o,a),h=Math.min(s,u),d=Math.max(s,u);if(t>=c&&t<=f&&n>=h&&n<=d)return i}}function dY(r,e,t){let n=Math.floor((24*r+31)/32)*4,i=n-r*3,o=54,s=n*e,a=o+s,u=He.alloc(a);u.write("BM",0),u.writeUInt32LE(a,2),u.writeUInt32LE(0,6),u.writeUInt32LE(o,10),u.writeUInt32LE(40,14),u.writeInt32LE(r,18),u.writeInt32LE(-e,22),u.writeUInt16LE(1,26),u.writeUInt16LE(24,28),u.writeUInt32LE(0,30),u.writeUInt32LE(s,34),u.writeInt32LE(2835,38),u.writeInt32LE(2835,42),u.writeUInt32LE(0,46),u.writeUInt32LE(0,50);let c=o;for(let f=0;f<e;f++){for(let h=0;h<r;h++){let d=(f*r+h)*4,m=t[d+0],y=t[d+1],v=t[d+2],b=t[d+3]/255,E=Math.round(m*b+255*(1-b)),_=Math.round(y*b+255*(1-b)),S=Math.round(v*b+255*(1-b));u[c+0]=S,u[c+1]=_,u[c+2]=E,c+=3}for(let h=0;h<i;h++)u[c]=0,c++}return u}function pY(r,e,t,n){let i;if(n===1){i=new Uint8ClampedArray(e*t*4);for(let o=0;o<e*t;o++){let s=r[o];i[o*4]=s,i[o*4+1]=s,i[o*4+2]=s,i[o*4+3]=255}}else if(n===2||r.length===e*t*3){i=new Uint8ClampedArray(e*t*4);for(let o=0;o<e*t;o++)i[o*4]=r[o*3],i[o*4+1]=r[o*3+1],i[o*4+2]=r[o*3+2],i[o*4+3]=255}else i=r instanceof Uint8ClampedArray?r:new Uint8ClampedArray(r);return He.from(i.buffer,i.byteOffset,i.byteLength)}var R8=async(r,e)=>{let t=await T8();if(e.pdfWorkerSrc)t.GlobalWorkerOptions.workerSrc=e.pdfWorkerSrc;else if(typeof window<"u")t.GlobalWorkerOptions.workerSrc=`https://unpkg.com/pdfjs-dist@${t.version}/build/pdf.worker.min.mjs`;else try{let y=Uu.resolve("pdfjs-dist/legacy/build/pdf.worker.mjs");t.GlobalWorkerOptions.workerSrc=y}catch(y){e.outputErrorToConsole&&console.warn("[PdfParser] Could not auto-resolve local worker path:",y)}let n=new Uint8Array(r),i=t.getDocument({data:n,verbosity:0}),o;try{o=await i.promise}catch(y){throw y.message?.includes("workerSrc")||y.message?.includes('No "GlobalWorkerOptions.workerSrc" specified')?ma("PDF_WORKER_MISSING",e):y}let s=[],a=[],u=o.numPages,c=[],h=(await o.getMetadata().catch(()=>({info:{}}))).info,d={pages:u,title:h?.Title||void 0,author:h?.Author||void 0,subject:h?.Subject||void 0,description:h?.Keywords||void 0,created:C8(h?.CreationDate),modified:C8(h?.ModDate)};try{let y=await o.getAttachments();if(y&&e.extractAttachments)for(let v in y){let w=y[v],b=He.from(w.content),E=js(w.filename,b);a.push(E)}}catch(y){e.outputErrorToConsole&&console.error("Error extracting embedded attachments:",y)}for(let y=1;y<=u;y++){let v,w,b=[];try{v=await o.getPage(y),w=await v.getTextContent()}catch(_){e.outputErrorToConsole&&console.warn(`[PdfParser] Error loading page ${y}:`,_),c.push(b);continue}let E=v.commonObjs;for(let _ of w.items){let S=_.transform,A=S[4],F=S[5],I=_.width||0,q=_.height||Math.abs(S[3])||12,ee={},K;if(_.fontName&&E)try{if(E.has(_.fontName)){let ne=await new Promise(L=>{E.get(_.fontName,$=>L($))});if(ne?.name){K=ne.name.replace(/^[A-Z]{6}\+/,""),ee.font=K;let L=ne.name.toLowerCase();L.includes("bold")&&(ee.bold=!0),(L.includes("italic")||L.includes("oblique"))&&(ee.italic=!0)}}}catch{}q>0&&(ee.size=Math.round(q).toString()),b.push({type:"text",x:A,y:F,width:I,height:q,text:_.str,fontName:K,formatting:ee})}if(e.extractAttachments||e.ocr)try{let _=await v.getOperatorList(),S=_.fnArray,A=_.argsArray;for(let F=0;F<S.length;F++){let I=S[F];if(I===t.OPS.dependency){let q=A[F];for(let ee of q)try{if(v.objs.has(ee))continue;await new Promise(K=>{let ne=setTimeout(()=>{K()},500);v.objs.get(ee,L=>{clearTimeout(ne),K()})})}catch(K){e.outputErrorToConsole&&console.error(`[PdfParser] Failed to load dependency ${ee}:`,K)}}if(I===t.OPS.paintImageXObject||I===t.OPS.paintXObject){let q=A[F][0];try{let ee=v.objs.has(q),K=v.objs;if(!ee&&v.commonObjs.has(q)&&(ee=!0,K=v.commonObjs),ee){let L=await new Promise($=>{K.get(q,Y=>$(Y))});if(typeof window<"u"&&!L.data&&L.bitmap)try{let $=document.createElement("canvas");$.width=L.width,$.height=L.height;let Y=$.getContext("2d");Y&&(Y.drawImage(L.bitmap,0,0),L.data=Y.getImageData(0,0,L.width,L.height).data,L.kind=3)}catch($){e.outputErrorToConsole&&console.error("[PdfParser] Failed to extract from ImageBitmap:",$)}if(L?.data&&L.width>0&&L.height>0){let $=0,Y=0;for(let ie=F-1;ie>=0;ie--)if(S[ie]===t.OPS.transform){$=A[ie][4],Y=A[ie][5];break}b.push({type:"image",x:$,y:Y,name:q,data:L.data,width:L.width,height:L.height,kind:L.kind})}}}catch{}}}}catch(_){e.outputErrorToConsole&&console.error(`Error extracting images from page ${y}:`,_)}c.push(b)}let m=cY(c);for(let y=0;y<c.length;y++){let v=y+1,w;try{w=await o.getPage(v)}catch(q){e.outputErrorToConsole&&console.warn(`[PdfParser] Error loading page ${v} in second pass:`,q);continue}let b=c[y],E=[],_=[];try{let q=await w.getAnnotations();for(let ee of q)ee.subtype==="Link"&&ee.rect&&_.push({rect:ee.rect,url:ee.url,dest:ee.dest})}catch(q){e.outputErrorToConsole&&console.error(`Error extracting annotations from page ${v}:`,q)}b.sort((q,ee)=>Math.abs(ee.y-q.y)>5?ee.y-q.y:q.x-ee.x);let S=null,A=0,F=-1,I=0;for(let q of b)if(q.type==="text"){let ee=q.text;if(!ee)continue;if(F!==-1&&Math.abs(q.y-F)>5&&S&&((S.text||"").trim().length>0&&E.push(S),S=null),!S&&ee.trim().length===0){F=q.y;continue}let ne=fY(q.height,m);if(S||(ne>0?S={type:"heading",text:"",children:[],metadata:{level:ne}}:S={type:"paragraph",text:"",children:[]},A=q.height),ee.trim().length===0){if(S.children&&S.children.length>0){let ie=S.children[S.children.length-1];ie.type==="text"&&ie.text&&(ie.text+=ee,S.text+=ee)}F=q.y;continue}if(S.text&&S.text.length>0&&!S.text.endsWith(" ")&&(S.text+=" ",S.children&&S.children.length>0)){let ie=S.children[S.children.length-1];ie.type==="text"&&ie.text&&(ie.text+=" ")}S.text+=ee;let L=hY(q,_),$;L&&(L.url?$={link:L.url,linkType:L.url.startsWith("#")?"internal":"external"}:L.dest&&($={link:typeof L.dest=="string"?`#${L.dest}`:"#internal",linkType:"internal"}));let Y=!1;if(S.children&&S.children.length>0&&!$){let ie=S.children[S.children.length-1];ie.type==="text"&&gY(ie.formatting,q.formatting)&&!ie.metadata&&(ie.text=(ie.text||"")+ee,Y=!0)}if(!Y){let ie={type:"text",text:ee,formatting:Object.keys(q.formatting).length>0?q.formatting:void 0};$&&(ie.metadata=$),S.children?.push(ie)}F=q.y}else if(q.type==="image"){S&&((S.text||"").trim().length>0&&E.push(S),S=null),I++;let ee=`pdf_image_p${v}_${I}.bmp`;if(e.extractAttachments)try{let K=pY(q.data,q.width,q.height,q.kind),ne=dY(q.width,q.height,new Uint8Array(K)),L=js(ee,ne);if(L.mimeType="image/bmp",e.ocr)try{q.width>=10&&q.height>=10&&(L.ocrText=(await hs(ne,e.ocrLanguage)).trim())}catch(Y){e.outputErrorToConsole&&console.error(`OCR failed for ${ee}:`,Y)}a.push(L);let $={attachmentName:ee};E.push({type:"image",text:L.ocrText||"",metadata:{...$}})}catch(K){pi(`Failed to process image ${ee}:`,e,K)}}S&&(S.text||"").trim().length>0&&E.push(S),s.push({type:"page",children:E,text:E.map(q=>q.text).join(e.newlineDelimiter??`
|
|
118
|
-
|
|
119
|
-
`),metadata:{pageNumber:v}})}return{type:"pdf",metadata:d,content:s,attachments:a,toText:()=>s.map(y=>y.text).join(e.newlineDelimiter??`
|
|
120
|
-
|
|
121
|
-
`)}};function gY(r,e){if(!r&&!e)return!0;if(!r||!e)return!1;let t=Object.keys(r).sort(),n=Object.keys(e).sort();if(t.length!==n.length)return!1;for(let i=0;i<t.length;i++){let o=t[i];if(t[i]!==n[i]||r[o]!==e[o])return!1}return!0}Te();Re();Ce();var D8=ju(Gb());var I8=async(r,e)=>{let t=/ppt\/(notesSlides|slides)\/(notesSlide|slide)\d+.xml/g,n=/ppt\/slides\/slide\d+.xml/g,i=/ppt\/slides\/_rels\/slide\d+\.xml\.rels/,o=/lide(\d+)\.xml/,s=/ppt\/media\/.*/,a=/ppt\/charts\/chart\d+\.xml/,u=/docProps\/core\.xml/,c=new D8.XMLSerializer,f=await Fl(r,ie=>!!ie.match(e.ignoreNotes?n:t)||!!ie.match(u)||!!ie.match(i)||!!e.extractAttachments&&(!!ie.match(s)||!!ie.match(a))),h=f.find(ie=>ie.path.match(u)),d=h?Il(h.content.toString()):{};f.sort((ie,re)=>{let k=ie.path.match(o),x=re.path.match(o),P=k?parseInt(k[1]):0,C=x?parseInt(x[1]):0;return P-C});let m=[],y=[],v={},w=0,b=0,E=!1,_=null,S=0,A={},F=ie=>{let re=[],k=Le(ie,"a:tr");for(let x=0;x<k.length;x++){let P=k[x],C=[],j=Le(P,"a:tc");for(let B=0;B<j.length;B++){let Q=j[B],fe=[],Ee="",te=Le(Q,"a:txBody")[0];if(te){let ae=Le(te,"a:p");for(let we of ae){let xe={type:"paragraph",text:"",children:[],metadata:{}};e.includeRawContent&&(xe.rawContent=we.toString());let V=Le(we,"a:r");for(let M of V){let oe=Le(M,"a:t")[0];if(oe&&oe.childNodes[0]){let ge=oe.childNodes[0].nodeValue||"";xe.text+=ge;let Se=Le(M,"a:rPr")[0],be={};if(Se){Se.getAttribute("b")==="1"&&(be.bold=!0),Se.getAttribute("i")==="1"&&(be.italic=!0),Se.getAttribute("u")==="sng"&&(be.underline=!0),Se.getAttribute("strike")==="sngStrike"&&(be.strikethrough=!0);let pe=Se.getAttribute("sz");pe&&(be.size=(parseInt(pe)/100).toString()+"pt");let Ae=Le(Se,"a:solidFill")[0];if(Ae){let ke=Le(Ae,"a:srgbClr")[0];if(ke){let Ne=ke.getAttribute("val");Ne&&(be.color="#"+Ne)}}let $e=Le(Se,"a:latin")[0];if($e){let ke=$e.getAttribute("typeface");ke&&(be.font=ke)}}xe.children?.push({type:"text",text:ge,formatting:be})}}fe.push(xe),Ee+=xe.text}}let H={type:"cell",text:Ee,children:fe,metadata:{row:x,col:B}};C.push(H)}let U={type:"row",children:C};re.push(U)}return{type:"table",children:re}},I=(ie,re)=>{let k=Le(ie,"a:blip")[0];if(!k)return null;let x=k.getAttribute("r:embed");if(!x)return null;let P=v[re]?.[x];if(!P||P.type!=="image")return null;let C=P.target,j=Le(ie,"p:nvPicPr")[0],B=(j?Le(j,"p:cNvPr")[0]:null)?.getAttribute("descr")||void 0;return{type:"image",text:"",metadata:{attachmentName:C,altText:B}}},q=(ie,re)=>{let k=Le(ie,"a:graphicData")[0];if(!k||!(k.getAttribute("uri")==="http://schemas.openxmlformats.org/drawingml/2006/chart"))return null;let C=Le(k,"c:chart")[0];if(!C)return null;let j=C.getAttribute("r:id");if(!j)return null;let U=v[re]?.[j];if(!U||U.type!=="chart")return null;let Q={type:"chart",text:"",metadata:{attachmentName:U.target}};return e.includeRawContent&&(Q.rawContent=c.serializeToString(ie)),Q},ee=(ie,re)=>{let k=Le(ie,"a:tbl")[0];if(k){let x=F(k);if(e.includeRawContent&&(x.rawContent=c.serializeToString(ie)),x.children&&x.children.length>0)return x}if(ie.getElementsByTagName("c:chart").length>0){let x=q(ie,re);if(x)return x}return null},K=(ie,re)=>{let k=[],x=Le(ie,"p:nvSpPr")[0],P=x?Le(x,"p:nvPr")[0]:null,C=P?Le(P,"p:ph")[0]:null,j=C?C.getAttribute("type"):"body",U=j==="title"||j==="ctrTitle",B=Le(ie,"p:txBody")[0];if(B){let Q=Le(B,"a:p");for(let fe=0;fe<Q.length;fe++){let Ee=Q[fe],te={type:U?"heading":"paragraph",text:"",children:[],metadata:U?{level:1}:{}},H=Le(Ee,"a:pPr")[0],ae=!1,we="unordered",xe=0;if(H){let M=H.getAttribute("lvl");M&&(xe=parseInt(M));let oe=Le(H,"a:buAutoNum")[0],ge=Le(H,"a:buChar")[0],Se=Le(H,"a:buBlip")[0],be=Le(H,"a:bu")[0];oe?(ae=!0,we="ordered"):(ge||Se||be)&&(ae=!0,we="unordered");let pe=H.getAttribute("algn");if(pe){let Ae={l:"left",ctr:"center",r:"right",just:"justify"};Ae[pe]&&(te.metadata.alignment=Ae[pe])}}if(ae){te.type="list";let M=xe;if(!E||we!==_){w++;for(let ge in A)delete A[ge];b=0,A[M]=0}else if(M>S)b=0,A[M]=0;else if(M<S){for(let Se in A){let be=parseInt(Se);be>M&&delete A[be]}b=(A[M]||0)+1,A[M]=b}else b=(A[M]||0)+1,A[M]=b;E=!0,_=we,S=M,te.metadata={...te.metadata,listType:we,indentation:M,listId:w.toString(),itemIndex:b,alignment:te.metadata?.alignment||"left"}}else E=!1,_=null,S=0;U&&(te.metadata={...te.metadata,level:1}),e.includeRawContent&&(te.rawContent=Ee.toString());let V=Le(Ee,"a:r");for(let M=0;M<V.length;M++){let oe=V[M],ge=Le(oe,"a:t")[0];if(ge&&ge.childNodes[0]){let Se=ge.childNodes[0].nodeValue||"";te.text+=Se;let be=Le(oe,"a:rPr")[0],pe={};if(be){be.getAttribute("b")==="1"&&(pe.bold=!0),be.getAttribute("i")==="1"&&(pe.italic=!0),be.getAttribute("u")==="sng"&&(pe.underline=!0),be.getAttribute("strike")==="sngStrike"&&(pe.strikethrough=!0);let ke=be.getAttribute("sz");ke&&(pe.size=(parseInt(ke)/100).toString()+"pt");let Ne=Le(be,"a:solidFill")[0];if(Ne){let T=Le(Ne,"a:srgbClr")[0];if(T){let g=T.getAttribute("val");g&&(pe.color="#"+g)}}let Ze=Le(be,"a:highlight")[0];if(Ze){let T=Le(Ze,"a:srgbClr")[0];if(T){let g=T.getAttribute("val");g&&(pe.backgroundColor="#"+g)}}let tt=Le(be,"a:latin")[0];if(tt){let T=tt.getAttribute("typeface");T&&(pe.font=T)}let it=be.getAttribute("baseline");if(it){let T=parseInt(it);T<0&&(pe.subscript=!0),T>0&&(pe.superscript=!0)}}let Ae={type:"text",text:Se,formatting:pe},$e=Le(oe,"a:hlinkClick")[0];if($e){let ke=$e.getAttribute("r:id"),Ne=$e.getAttribute("action"),Ze,tt;ke&&v[re]&&v[re][ke]&&v[re][ke].type==="hyperlink"?(Ze=v[re][ke].target,tt="external"):ke&&v[re]&&v[re][ke]&&v[re][ke].type==="slide"?(Ze=v[re][ke].target,tt="internal"):Ne&&(Ze=Ne,tt="internal"),Ze&&(Ae.metadata={link:Ze,linkType:tt})}te.children?.push(Ae)}}te.text&&k.push(te)}}return k};function ne(ie,re){let k=[];for(let x of Array.from(ie?.childNodes||[])){if(x.nodeType!==1)continue;let P=x,C=P.tagName;if(C==="p:sp")k.push(...K(P,re));else if(C==="p:pic"){let j=I(P,re);j&&k.push(j)}else if(C==="p:graphicFrame"){let j=ee(P,re);j&&k.push(j)}else if(C==="p:grpSp"){let j=P.getElementsByTagName("p:spTree")[0];k.push(...ne(j,re))}}return k}for(let ie of f)if(ie.path.match(i)){let re=ie.path.match(/slide(\d+)\.xml\.rels/);if(re){let k=parseInt(re[1]);v[k]={};let x=qt(ie.content.toString()),P=Le(x,"Relationship");for(let C=0;C<P.length;C++){let j=P[C].getAttribute("Id"),U=P[C].getAttribute("Type"),B=P[C].getAttribute("Target");if(j&&U&&B){let Q="other";U.includes("relationships/image")?Q="image":U.includes("relationships/hyperlink")?Q="hyperlink":U.includes("relationships/chart")?Q="chart":U.includes("relationships/slide")?Q="slide":U.includes("relationships/notesSlide")&&(Q="notes");let fe=B;B.startsWith("http://")||B.startsWith("https://")||(fe=fe.split("/").pop()||""),v[k][j]={type:Q,target:fe}}}}}for(let ie of f){if(ie.path.match(s)||ie.path.match(a)||ie.path.match(i)||ie.path.match(u))continue;let re=ie.content.toString(),k=qt(re);e.includeRawContent&&y.push(re);let x=ie.path.match(o),P=x?parseInt(x[1]):0,C=ie.path.includes("notesSlide"),j={type:C?"note":"slide",children:[],metadata:{slideNumber:P,...C?{noteId:`slide-note-${P}`}:{}}};e.includeRawContent&&(j.rawContent=ie.content.toString());let U=Le(k,"p:spTree")[0];U&&j.children?.push(...ne(U,P)),j.children&&j.children.length>0&&m.push(j)}let L=[],$=f.filter(ie=>ie.path.match(/ppt\/media\/.*/)),Y=f.filter(ie=>ie.path.match(/ppt\/charts\/chart\d+\.xml/));if(e.extractAttachments){for(let re of $){let k=js(re.path.split("/").pop()||"image",re.content);if(L.push(k),e.ocr&&k.mimeType.startsWith("image/"))try{k.ocrText=(await hs(re.content,e.ocrLanguage)).trim()}catch(x){pi(`OCR failed for ${k.name}:`,e,x)}}for(let re of Y){let k={type:"chart",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",data:re.content.toString("base64"),name:re.path.split("/").pop()||"",extension:"xml"};L.push(k);try{let x=await uc(re.content);k.chartData=x}catch(x){pi(`Failed to extract text from chart ${re.path}:`,e,x)}}let ie=re=>{for(let k of re){if("attachmentName"in(k.metadata||{})){let x=k.metadata,P=L.find(C=>C.name===x.attachmentName);P&&(k.type==="image"&&(P.altText=x.altText,P.ocrText&&(k.text=P.ocrText)),k.type==="chart"&&(k.text=P.chartData?.rawTexts.join(e.newlineDelimiter||`
|
|
122
|
-
`)))}k.children&&ie(k.children)}};ie(m)}return!e.ignoreNotes&&e.putNotesAtLast&&m.sort((ie,re)=>{let k=ie.type==="note"?1:0,x=re.type==="note"?1:0;return k-x}),{type:"pptx",metadata:d,content:m,attachments:L,toText:()=>m.map(ie=>{let re=k=>{let x="";return k.children?x+=k.children.map(re).filter(P=>P!="").join(k.children[0]?.children?e.newlineDelimiter??`
|
|
123
|
-
`:""):x+=k.text||"",x};return re(ie)}).filter(ie=>ie!="").join(e.newlineDelimiter??`
|
|
124
|
-
`)}};Te();Re();Ce();var mY={pngblip:"png",jpegblip:"jpeg",gifblip:"gif",tiffblip:"tiff",dibitmap:"bmp",wbitmap:"bmp"},yY={png:"image/png",jpeg:"image/jpeg",gif:"image/gif",tiff:"image/tiff",bmp:"image/bmp"},oC=class{constructor(e){this.index=0;this.buffer=e,this.length=e.length}parse(){let e={type:"group",content:[]},t=[e];for(;this.index<this.length;){let n=this.buffer[this.index],i=t[t.length-1];if(n===123){this.index++;let o={type:"group",content:[]};i.content.push(o),t.push(o)}else n===125?(this.index++,t.length>1&&t.pop()):n===92?(this.index++,this.parseControl(i)):n===13||n===10?this.index++:this.parseText(i)}return e}parseControl(e){if(this.index>=this.length)return;let t=this.buffer[this.index];if(t===123||t===125||t===92){e.content.push({type:"text",value:String.fromCharCode(t)}),this.index++;return}if(t===39){if(this.index++,this.index+1<this.length){let a=this.buffer.toString("utf8",this.index,this.index+2),u=parseInt(a,16);if(!isNaN(u)){let f={128:8364,130:8218,131:402,132:8222,133:8230,134:8224,135:8225,136:710,137:8240,138:352,139:8249,140:338,142:381,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,152:732,153:8482,154:353,155:8250,156:339,158:382,159:376}[u]||u;e.content.push({type:"text",value:String.fromCharCode(f)})}this.index+=2}return}if(t===42){e.content.push({type:"control",value:"*"}),this.index++;return}let n="";for(;this.index<this.length;){let a=this.buffer[this.index];if(a>=97&&a<=122||a>=65&&a<=90)n+=String.fromCharCode(a),this.index++;else break}let i,o=!1,s="";for(this.index<this.length&&this.buffer[this.index]===45&&(s+="-",this.index++);this.index<this.length;){let a=this.buffer[this.index];if(a>=48&&a<=57)s+=String.fromCharCode(a),this.index++,o=!0;else break}if(o&&(i=parseInt(s,10)),this.index<this.length&&this.buffer[this.index]===32&&this.index++,n==="bin"&&i!==void 0&&i>0){this.index+=i;return}e.content.push({type:"control",value:n,param:i}),(e.content.length===1&&e.type==="group"||e.content.length===2&&e.content[0].type==="control"&&e.content[0].value==="*")&&(e.destination=n)}parseText(e){let t="";for(;this.index<this.length;){let n=this.buffer[this.index];if(n===123||n===125||n===92||n===13||n===10)break;t+=String.fromCharCode(n),this.index++}t.length>0&&e.content.push({type:"text",value:t})}},N8=async(r,e)=>{try{let n=new oC(r).parse(),i=bY(n),o=wY(n),s=[],a=[],u=[],c="",f=[],h="",d="",m={},y=s,v=0,w="left",b=!1,E,_,S,A,F,I=[],q=0,ee=0,K=()=>I.length>0?I[I.length-1]:void 0,ne=()=>{I.length===0&&I.push({rows:[],currentCells:[],currentCellContent:[],rowIndex:0})},L=!1,$=!1,Y=0,ie=[],re={isMergedContinuation:!1},k=0,x=0,P={},C=!1,j=!1,U,B,Q={},fe=!1,Ee,te,H={},ae={},we,xe=(p,R)=>p.bold!==R.bold||p.italic!==R.italic||p.underline!==R.underline||p.strikethrough!==R.strikethrough||p.size!==R.size||p.font!==R.font||p.color!==R.color||p.backgroundColor!==R.backgroundColor||p.subscript!==R.subscript||p.superscript!==R.superscript,V=()=>{if(d){let p={type:"text",text:d,formatting:{...m}};we&&(p.metadata={link:we,linkType:Ae(we)}),f.push(p),c+=d,d=""}},M=!1,oe=()=>{V();let p=c||f.length>0;if(L&&!$&&!M&&p){let R=c,J=[...f],D=h;c="",f=[],h="",be(),c=R,f=J,h=D}if(p){let R="paragraph",J;if(_!==void 0&&_>0)R="heading",J={level:_},A=void 0,F=void 0;else if(b){R="list";let le=S||A,he=E||F||"unordered",_e=0;le&&(ae[le]||(ae[le]={}),ae[le][v]===void 0?ae[le][v]=0:ae[le][v]++,_e=ae[le][v]),J={listType:he,indentation:v,listId:le||"",itemIndex:_e,alignment:w},le&&(A=le),he&&(F=he)}let D={type:R,text:c,children:f,formatting:void 0,metadata:J};e.includeRawContent&&h&&(D.rawContent=h),L&&$?(ne(),K().currentCellContent.push(D)):y.push(D),c="",f=[],h="",v=0,b=!1,E=void 0,_=void 0,S=void 0}},ge=p=>{oe();let R=p||K();if(!R)return;let J={type:"cell",text:R.currentCellContent.map(D=>D.text).join(`
|
|
125
|
-
`),children:[...R.currentCellContent],metadata:{row:R.rowIndex,col:R.currentCells.length}};return R.currentCellContent=[],J},Se=p=>{let R=p||K();if(!R)return;let J=ge(R);if(J&&(J.children&&J.children.length>0||J.text)&&R.currentCells.push(J),R.currentCells.length>0){let D={type:"row",text:R.currentCells.map(le=>le.text).filter(le=>le!=="").join(e.newlineDelimiter??`
|
|
126
|
-
`),children:[...R.currentCells]};R.rows.push(D),R.currentCells=[],R.rowIndex++}},be=()=>{if(M)return;M=!0;let p=K();if(!p){M=!1;return}if(Se(p),p.rows.length>0){Y++;let R={type:"table",text:p.rows.map(J=>J.text).join(`
|
|
127
|
-
`),children:[...p.rows]};I.length>1?I[I.length-2].currentCellContent.push(R):y.push(R)}I.pop(),I.length===0&&(L=!1,$=!1),M=!1},pe=p=>{let R,J=D=>{if(D.type==="text"){let le=D.value,he=le.match(/HYPERLINK\s+"([^"]+)"/i);if(he)return he[1];let _e=le.match(/"(https?:\/\/[^"]+|mailto:[^"]+|#[^"]+)"/);if(_e)return _e[1]}else if(D.type==="group"){let le=!1,he;for(let _e of D.content)if(_e.type==="text"){_e.value.toUpperCase().includes("HYPERLINK")&&(le=!0);let Ie=_e.value.match(/"([^"]+)"/);Ie&&le&&(he=Ie[1])}else if(_e.type==="group"){let ve=J(_e);ve&&(he=ve)}if(he)return he}};for(let D of p.content)if(D.type==="group"){let le=J(D);if(le)return le}return R},Ae=p=>{let R=p.trim();return R.startsWith("#")||!/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(R)?"internal":"external"},$e=p=>{let R="",J=D=>{if(D.type==="text")R+=D.value;else if(D.type==="group")for(let le of D.content)J(le)};for(let D of p.content)J(D);return R},ke=p=>{let R,J="";for(let le of p.content)if(le.type==="control"){let he=mY[le.value];he&&(R=he)}else le.type==="text"?J+=le.value.replace(/[^0-9a-fA-F]/g,""):le.type;if(!R||J.length===0)return;let D=yY[R];if(D)try{let le=He.from(J,"hex"),he=R,_e=`image_${u.length+1}.${he}`;return{type:"image",mimeType:D,data:le.toString("base64"),name:_e,extension:he}}catch{return}},Ne=p=>{if(!/^[a-zA-Z]/.test(p.value))return`\\${p.value}`;let R=`\\${p.value}`;return p.param!==void 0&&(R+=p.param),R+=" ",R},Ze=p=>p.value.replace(/([\\{}])/g,"\\$1"),tt=(p,R,J=0)=>{if(p.type==="group"){let D=["fonttbl","colortbl","stylesheet","info","macpict","pmmetafile","wmetafile","dibitmap","bitmap","object","nextGenerator","header","footer","nonshppict","xml","private","upnp","ud","filetbl","operator","author","creatim","revtim","printim","comment","fldinst","listtext","pntext"],le=!1,he=!1,_e=!1,ve=!1;if(p.destination){if(p.destination==="footnote")he=!0;else if(p.destination==="field"){let Me=pe(p);Me&&(V(),_e=!0,we=Me)}else if(p.destination==="listtable")C=!0;else if(C&&p.destination==="list")j=!0,U=void 0,B=void 0;else if(p.destination==="listoverridetable")fe=!0;else if(fe&&p.destination==="listoverride")Ee=void 0,te=void 0;else if(p.destination==="pict")e.extractAttachments?ve=!0:le=!0;else if(D.includes(p.destination))le=!0;else if(p.content.length>0&&p.content[0].type==="control"&&p.content[0].value==="*"){let Me=["fldinst","nesttableprops"];e.extractAttachments&&Me.push("shppict","listpicture"),Me.includes(p.destination||"")||(le=!0)}}if(p.destination==="listtext"||p.destination==="pntext"){b||(v=0),b=!0;let Me=$e(p);if(Me){let nt=Me.trim();["\xB7","\u2022","o","\xA7","\u25A0","\u25A1","\u25CF","\u25CB","\u25C6","\u25C7","\u25BA","\u25B8","\xB7","\u2022","\u25CF","\u25CB"].some(je=>nt.includes(je))||nt.length===1&&!/[0-9a-zA-Z]/.test(nt)?E="unordered":(/^[0-9ivxlcdm]+[\.\)]/i.test(nt)||/^[a-z][\.\)]/i.test(nt))&&(E="ordered")}le=!0}if(le)return;if(h+="{",ve){let Me=ke(p);Me&&(u.push(Me),!C&&!j&&(oe(),y.push({type:"image",text:"",metadata:{attachmentName:Me.name||`image_${u.length}`}})));for(let nt of p.content)if(nt.type==="control")h+=Ne(nt);else if(nt.type==="text")h+=Ze(nt);else if(nt.type==="group"){let N=Pe=>{for(let je of Pe.content)je.type==="control"?h+=Ne(je):je.type==="text"?h+=Ze(je):je.type==="group"&&(h+="{",N(je),h+="}")};N(p)}h+="}";return}let Ie=y;if(he){if(e.ignoreNotes)return;oe(),q++;let Me="footnote";ee===1?Me="endnote":ee===2&&(Me=p.content.some(Pe=>Pe.type==="control"&&Pe.value==="ftnalt")?"endnote":"footnote");let nt={type:"note",children:[],metadata:{noteId:q.toString(),noteType:Me}};a.push(nt),y=nt.children}let Z={...R};for(let Me of p.content){if(Me.type==="group"&&Me.destination==="fldinst"){h+="{";let nt=N=>{for(let Pe of N.content)Pe.type==="control"?h+=Ne(Pe):Pe.type==="text"?h+=Ze(Pe):Pe.type==="group"&&(h+="{",nt(Pe),h+="}")};nt(Me),h+="}";continue}tt(Me,Z,J+1)}p.destination==="listtable"?C=!1:p.destination==="list"?(j=!1,U!==void 0&&B!==void 0&&(Q[U]=B)):p.destination==="listoverridetable"?fe=!1:fe&&p.destination==="listoverride"&&te!==void 0&&Ee!==void 0&&(H[te]=Ee),he&&(oe(),y=Ie),_e&&(V(),we=void 0),h+="}"}else if(p.type==="text"){if(C||fe){h+=Ze(p);return}xe(m,R)&&(V(),m={...R}),d+=p.value,h+=Ze(p)}else if(p.type==="control"){if(h+=Ne(p),C){if(p.value==="listid")U=p.param;else if(p.value==="levelnfc"||p.value==="levelnfcn"){let D=p.param!==void 0&&(p.param===0||p.param>=0&&p.param<=4);(!B||B==="unordered"&&D)&&(B=D?"ordered":"unordered")}return}if(fe){p.value==="listid"?Ee=p.param:p.value==="ls"&&(te=p.param);return}if(p.value==="par")oe(),m={...R};else if(p.value==="trowd"){let D=K();L&&D&&D.currentCellContent.length>0?(ne(),I.push({rows:[],currentCells:[],currentCellContent:[],rowIndex:0})):L||(L=!0,ne()),$=!0,ie=[],re={isMergedContinuation:!1},k=0}else if(p.value==="clvmrg")re.isMergedContinuation=!0;else if(p.value==="clmgf")re.isMergedContinuation=!1;else if(p.value==="cellx")ie.push({...re}),re={isMergedContinuation:!1};else if(p.value==="cell"){$=!0;let D=!1;k<ie.length&&(D=ie[k].isMergedContinuation),k++;let le=ge();if(le&&!D){let he=K();he&&he.currentCells.push(le)}m={...R}}else if(p.value==="nestcell"){if(I.length>1){let le=K();le&&(le.rows.length>0||le.currentCells.length>0)&&be()}$=!0;let D=ge();if(D){let le=K();le&&le.currentCells.push(D)}m={...R}}else if(p.value==="row")Se(),m={...R},k=0,$=!1;else if(p.value==="nestrow")I.length>1&&be(),Se(),m={...R},k=0;else if(p.value==="intbl")L=!0,$=!0,ne();else if(p.value==="pard")$=!1,v=0,w="left",b=!1,E=void 0,_=void 0,S=void 0,R.backgroundColor=void 0;else if(p.value==="tab")xe(m,R)&&(V(),m={...R}),d+=" ";else if(p.value==="line")xe(m,R)&&(V(),m={...R}),d+=`
|
|
128
|
-
`;else if(p.value==="lquote")xe(m,R)&&(V(),m={...R}),d+="\u2018";else if(p.value==="rquote")xe(m,R)&&(V(),m={...R}),d+="\u2019";else if(p.value==="ldblquote")xe(m,R)&&(V(),m={...R}),d+="\u201C";else if(p.value==="rdblquote")xe(m,R)&&(V(),m={...R}),d+="\u201D";else if(p.value==="u"){if(p.param!==void 0){let D=p.param;D<0&&(D+=65536),xe(m,R)&&(V(),m={...R}),d+=String.fromCharCode(D)}}else if(p.value==="b")R.bold=p.param!==0;else if(p.value==="i")R.italic=p.param!==0;else if(p.value==="ul")R.underline=p.param!==0;else if(p.value==="ulnone")R.underline=!1;else if(p.value==="strike")R.strikethrough=p.param!==0;else if(p.value==="plain")R.bold=!1,R.italic=!1,R.underline=!1,R.strikethrough=!1,R.subscript=!1,R.superscript=!1,R.size=void 0,R.font=void 0,R.color=void 0,R.backgroundColor=void 0;else if(p.value==="fs")p.param!==void 0&&(R.size=(p.param/2).toString()+"pt");else if(p.value==="f")p.param!==void 0&&i[p.param]&&(R.font=i[p.param]);else if(p.value==="cf")p.param!==void 0&&o[p.param]&&(R.color=o[p.param]);else if(p.value==="fet")p.param!==void 0&&(ee=p.param);else if(p.value==="cb"||p.value==="highlight"||p.value==="chcbpat"||p.value==="cbpat")p.param!==void 0&&o[p.param]&&(R.backgroundColor=o[p.param]);else if(p.value==="sub")R.subscript=!0,R.superscript=!1;else if(p.value==="super")R.superscript=!0,R.subscript=!1;else if(p.value==="nosupersub")R.subscript=!1,R.superscript=!1;else if(p.value==="li")p.param!==void 0&&(v=Math.floor(p.param/360));else if(p.value==="ls"){if(p.param!==void 0){b||(v=0),b=!0,P[p.param]||(x++,P[p.param]=`rtf-list-${x}`),S=P[p.param];let D=H[p.param]!==void 0?H[p.param]:p.param;Q[D]&&(E=Q[D])}}else p.value==="ilvl"?p.param!==void 0&&(b=!0,v=p.param):p.value==="pnlvl"?(b=!0,p.param!==void 0&&(v=p.param)):p.value==="levelnfc"||p.value==="pnf"?p.param!==void 0&&(b=!0,p.param===23?E="unordered":E="ordered"):p.value==="pndec"||p.value==="pnord"||p.value==="pnlcltr"||p.value==="pnucltr"?(b||(v=0),b=!0,E="ordered"):p.value==="pnbullet"||p.value==="pncard"?(b||(v=0),b=!0,E="unordered"):p.value==="s"?p.param!==void 0&&p.param>=1&&p.param<=9&&(_=p.param):p.value==="ql"?w="left":p.value==="qc"?w="center":p.value==="qr"?w="right":p.value==="qj"&&(w="justify")}};tt(n,{});let it=K();if((L||it&&(it.rows.length>0||it.currentCells.length>0))&&be(),oe(),!e.putNotesAtLast&&a.length>0&&(s.push(...a),a.length=0),e.ocr&&e.extractAttachments){for(let R of u)if(R.mimeType.startsWith("image/"))try{let J=He.from(R.data,"base64");R.ocrText=(await hs(J,e.ocrLanguage)).trim()}catch(J){pi(`OCR failed for ${R.name}:`,e,J)}let p=R=>{for(let J of R){if(J.type==="image"&&J.metadata&&"attachmentName"in J.metadata){let D=J.metadata,le=u.find(he=>he.name===D.attachmentName);le&&(le.ocrText&&(J.text=le.ocrText),le.altText&&(D.altText=le.altText))}J.children&&p(J.children)}};p(s)}let T=p=>{for(let R of p){if(R.type==="note"&&R.children){let J=D=>D.children&&D.children.length>0?D.children.map(J).join(""):D.text||"";R.text=R.children.map(J).join("").trim()}R.children&&T(R.children)}};T(s),T(a);let g={type:"rtf",metadata:{},content:s,attachments:u,toText:()=>{let p=s.map(R=>R.text).join(e.newlineDelimiter??`
|
|
129
|
-
`);return e.putNotesAtLast&&a.length>0&&(p+=(e.newlineDelimiter??`
|
|
130
|
-
`)+a.map(R=>R.text).join(e.newlineDelimiter??`
|
|
131
|
-
`)),p}};return e.putNotesAtLast&&a.length>0&&s.push(...a),g}catch(t){throw t}};function bY(r){let e={},t=n=>{for(let i of n.content)if(i.type==="group"){if(i.destination==="fonttbl"){for(let o of i.content)if(o.type==="group"){let s,a="";for(let u of o.content)u.type==="control"&&u.value==="f"?s=u.param:u.type==="text"&&(a+=u.value);s!==void 0&&a&&(a=a.replace(/;$/,"").trim(),e[s]=a)}return!0}if(t(i))return!0}return!1};return t(r),e}function wY(r){let e={},t=n=>{for(let i of n.content)if(i.type==="group"){if(i.destination==="colortbl"){let o=0,s=0,a=0,u=0;for(let c of i.content)if(c.type==="control")c.value==="red"&&c.param!==void 0?s=c.param:c.value==="green"&&c.param!==void 0?a=c.param:c.value==="blue"&&c.param!==void 0&&(u=c.param);else if(c.type==="text"&&c.value===";"){let f=`#${s.toString(16).padStart(2,"0")}${a.toString(16).padStart(2,"0")}${u.toString(16).padStart(2,"0")}`;e[o]=f,o++,s=0,a=0,u=0}return!0}if(t(i))return!0}return!1};return t(r),e}Te();Re();Ce();var O8=ju(Gb());var k8=async(r,e)=>{let t=/word\/document[\d+]?.xml/,n=/word\/footnotes[\d+]?.xml/,i=/word\/endnotes[\d+]?.xml/,o=/word\/numbering[\d+]?.xml/,s=/(word\/)?media\/.*/,a=/docProps\/core[\d+]?.xml/,u=/word\/_rels\/document[\d+]?.xml\.rels/,c=/word\/styles[\d+]?.xml/,f=new O8.XMLSerializer,h=x=>{let P={},C=f.serializeToString(x),j=(M,oe)=>{let ge=new RegExp(`<${oe}(?:\\s+w:val="([^"]+)")?\\s*\\/?>`),Se=M.match(ge);if(Se){let be=Se[1];return be===void 0?!0:be==="1"||be==="true"||be==="on"}return null},U=j(C,"w:b");U!==null&&(P.bold=U);let B=j(C,"w:i");B!==null&&(P.italic=B);let Q=C.match(/<w:u(?: w:val="([^"]+)")?\/?>/);if(Q){let M=Q[1];(!M||M!=="none")&&(P.underline=!0)}let fe=j(C,"w:strike"),Ee=j(C,"w:dstrike");fe!==null?P.strikethrough=fe:Ee!==null&&(P.strikethrough=Ee);let te=C.match(/<w:sz w:val="(\d+)"/);te&&(P.size=(parseInt(te[1])/2).toString()+"pt");let H=C.match(/<w:color w:val="([^"]+)"/);H&&H[1]!=="auto"&&(P.color="#"+H[1]);let ae=C.match(/<w:shd[^>]*w:fill="([^"]+)"/);ae&&ae[1]!=="auto"&&(P.backgroundColor="#"+ae[1]);let we=C.match(/<w:highlight w:val="([^"]+)"/);if(we&&we[1]!=="none"){let M={yellow:"#FFFF00",green:"#00FF00",cyan:"#00FFFF",magenta:"#FF00FF",blue:"#0000FF",red:"#FF0000",darkBlue:"#00008B",darkCyan:"#008B8B",darkGreen:"#006400",darkMagenta:"#8B008B",darkRed:"#8B0000",darkYellow:"#808000",darkGray:"#A9A9A9",lightGray:"#D3D3D3",black:"#000000"};P.backgroundColor=M[we[1]]||we[1]}let xe=C.match(/<w:rFonts[^>]*w:ascii="([^"]+)"/);if(xe)P.font=xe[1];else{let M=C.match(/<w:rFonts[^>]*w:hAnsi="([^"]+)"/);M&&(P.font=M[1])}let V=C.match(/<w:vertAlign w:val="([^"]+)"/);return V&&(V[1]==="subscript"&&(P.subscript=!0),V[1]==="superscript"&&(P.superscript=!0)),P},d=await Fl(r,x=>!!x.match(t)||!!x.match(n)||!!x.match(i)||!!x.match(o)||!!x.match(a)||!!x.match(u)||!!x.match(c)||!!e.extractAttachments&&!!x.match(s)),m=d.find(x=>x.path.match(a)),y=m?Il(m.content.toString()):{},v=new Map,w=new Map,b=[],E=[],_=d.filter(x=>x.path.match(s)),S=d.find(x=>x.path.match(u)),A={};if(S){let x=qt(S.content.toString()),P=Le(x,"Relationship");for(let C=0;C<P.length;C++){let j=P[C].getAttribute("Id"),U=P[C].getAttribute("Target");j&&U&&(A[j]=U)}}let F=d.find(x=>x.path.match(o)),I={};if(F){let x=qt(F.content.toString()),P=Le(x,"w:num"),C=Le(x,"w:abstractNum"),j={};for(let U=0;U<C.length;U++){let B=C[U].getAttribute("w:abstractNumId");B&&(j[B]=C[U])}for(let U=0;U<P.length;U++){let B=P[U].getAttribute("w:numId"),fe=Le(P[U],"w:abstractNumId")[0]?.getAttribute("w:val");if(B&&fe&&j[fe]){I[B]={};let Ee=Le(j[fe],"w:lvl");for(let te=0;te<Ee.length;te++){let H=Ee[te].getAttribute("w:ilvl"),ae=Le(Ee[te],"w:numFmt")[0],we=Le(Ee[te],"w:lvlText")[0];H&&(I[B][H]={numFmt:ae?.getAttribute("w:val")||"decimal",lvlText:we?.getAttribute("w:val")||""})}}}}let q=d.find(x=>x.path.match(c)),ee={};if(q){let x=qt(q.content.toString()),P=Le(x,"w:style");for(let C=0;C<P.length;C++){let j=P[C].getAttribute("w:styleId");if(j){let U=Le(P[C],"w:rPr")[0],B=Le(P[C],"w:pPr")[0],Q=U?h(U):{},fe,Ee;if(B){let te=Le(B,"w:jc")[0];if(te){let ae=te.getAttribute("w:val");(ae==="left"||ae==="center"||ae==="right"||ae==="justify")&&(fe=ae)}let H=Le(B,"w:shd")[0];if(H){let ae=H.getAttribute("w:fill");ae&&ae!=="auto"&&(Ee="#"+ae)}}ee[j]={formatting:Q,alignment:fe,backgroundColor:Ee}}}}let K={};if(q){let x=qt(q.content.toString()),P=Le(x,"w:docDefaults")[0];if(P){let C=Le(P,"w:rPrDefault")[0];if(C){let j=Le(C,"w:rPr")[0];j&&(K=h(j))}}}let ne;if(q){let x=qt(q.content.toString()),P=Le(x,"w:style");for(let C=0;C<P.length;C++){let j=P[C].getAttribute("w:type"),U=P[C].getAttribute("w:default"),B=P[C].getAttribute("w:styleId");if(j==="paragraph"&&U==="1"&&B){ne=B;break}}!ne&&ee.Normal&&(ne="Normal")}let L=[],$=[],Y={},ie={},re=x=>{let P=f.serializeToString(x),C=Le(x,"w:numPr")[0],j=!!C,U=Le(x,"w:pPr")[0],B=U?Le(U,"w:pStyle")[0]:null,Q=B?B.getAttribute("w:val"):null,fe=Q?Q.startsWith("Heading")||Q==="Title":!1,Ee=Q&&ee[Q]?ee[Q]:{formatting:{}},te=Ee.alignment;if(U){let oe=Le(U,"w:jc")[0];if(oe){let ge=oe.getAttribute("w:val");(ge==="left"||ge==="center"||ge==="right"||ge==="justify")&&(te=ge)}}let H=Ee.backgroundColor;if(U){let oe=Le(U,"w:shd")[0];if(oe){let ge=oe.getAttribute("w:fill");ge&&ge!=="auto"&&(H="#"+ge)}}let ae={...Ee.formatting};if(U){let oe=Le(U,"w:rPr")[0];if(oe){let ge=h(oe);for(let Se in ge){let be=ge[Se];be===!1?delete ae[Se]:be!==void 0&&(ae[Se]=be)}}}let we="",xe=[],V=oe=>{if(oe.nodeName==="w:r"){let ge=oe,Se=Le(ge,"w:rPr")[0],be={};for(let ke in ae)be[ke]=ae[ke];let pe=Se?Le(Se,"w:rStyle")[0]:null,Ae=pe?pe.getAttribute("w:val"):Q;if(Ae&&ee[Ae])for(let ke in ee[Ae].formatting)be[ke]=ee[Ae].formatting[ke];if(Se){let ke=h(Se);for(let Ne in ke){let Ze=ke[Ne];Ze===!1?delete be[Ne]:Ze!==void 0&&(be[Ne]=Ze)}}!be.backgroundColor&&H&&(be.backgroundColor=H);let $e=Le(ge,"w:t");for(let ke of $e){let Ne=ke.textContent||"";we+=Ne;let Ze={type:"text",text:Ne,formatting:be};e.includeRawContent&&(Ze.rawContent=f.serializeToString(ke));let tt=Ae||Q||ne;tt&&(Ze.metadata={style:tt}),xe.push(Ze)}if(e.extractAttachments){let ke=Le(ge,"w:drawing"),Ne=Le(ge,"w:pict"),Ze=[...ke,...Ne];for(let tt of Ze){let it=f.serializeToString(tt),T="",g=Le(tt,"wp:docPr")[0];g&&(T=g.getAttribute("descr")||g.getAttribute("title")||"");let p="",R=Le(tt,"a:blip")[0];if(R)p=R.getAttribute("r:embed")||"";else{let J=Le(tt,"v:imagedata")[0];J&&(p=J.getAttribute("r:id")||"")}if(p&&A[p]){let D=A[p].split("/").pop();if(D){let le={type:"image",text:"",metadata:{attachmentName:D,altText:T}};e.includeRawContent&&(le.rawContent=it),xe.push(le)}}else{let J={type:"image",text:""};e.includeRawContent&&(J.rawContent=it),xe.push(J)}}}if(!e.ignoreNotes){let ke=Le(ge,"w:footnoteReference")[0];if(ke){let Ze=ke.getAttribute("w:id");if(Ze&&v.has(Ze)){let tt=v.get(Ze),it={type:"note",text:tt.map(T=>T.text).join(" "),children:tt,metadata:{noteType:"footnote",noteId:Ze}};e.putNotesAtLast?b.push(it):xe.push(it)}}let Ne=Le(ge,"w:endnoteReference")[0];if(Ne){let Ze=Ne.getAttribute("w:id");if(Ze&&w.has(Ze)){let tt=w.get(Ze),it={type:"note",text:tt.map(T=>T.text).join(" "),children:tt,metadata:{noteType:"endnote",noteId:Ze}};e.putNotesAtLast?b.push(it):xe.push(it)}}}}else if(oe.nodeName==="w:hyperlink"){let ge=oe,Se=ge.getAttribute("r:id"),be=ge.getAttribute("w:anchor"),pe;be?pe={link:"#"+be,linkType:"internal"}:Se&&A[Se]&&(pe={link:A[Se],linkType:"external"});let Ae=Array.from(ge.childNodes);for(let $e of Ae){let ke=xe.length;if(V($e),pe)for(let Ne=ke;Ne<xe.length;Ne++)xe[Ne].type==="text"&&(xe[Ne].metadata={...xe[Ne].metadata??{},...pe})}}},M=Array.from(x.childNodes);for(let oe of M)V(oe);if(j){let oe=Le(C,"w:numId")[0],ge=Le(C,"w:ilvl")[0],Se=oe&&oe.getAttribute("w:val")||"0",be=ge?parseInt(ge.getAttribute("w:val")||"0"):0,pe="ordered",Ae=0;if(Se&&I[Se]){let ke=be.toString();Y[Se]||(Y[Se]={}),Y[Se][ke]||(Y[Se][ke]=0),Y[Se][ke]++;for(let Ze=be+1;Ze<10;Ze++)Y[Se][Ze.toString()]&&(Y[Se][Ze.toString()]=0);pe=(I[Se][ke]?.numFmt||"decimal")==="bullet"?"unordered":"ordered",ie[Se]||(ie[Se]={}),ie[Se][ke]===void 0?ie[Se][ke]=0:ie[Se][ke]++,Ae=ie[Se][ke]}let $e={type:"list",text:we,children:xe,metadata:{listType:pe,indentation:be,alignment:te||"left",listId:Se,itemIndex:Ae,style:Q}};return e.includeRawContent&&($e.rawContent=P),$e}else if(fe){let oe=Q&&parseInt(Q.replace("Heading",""))||1,ge={type:"heading",text:we,children:xe,metadata:{level:oe,alignment:te,style:Q??void 0}};return e.includeRawContent&&(ge.rawContent=P),ge}else{let oe={type:"paragraph",text:we,children:xe,metadata:{alignment:te,style:Q??void 0}};return e.includeRawContent&&(oe.rawContent=P),oe}},k=x=>{let P=[],C=Tn(x,"w:tr");for(let j=0;j<C.length;j++){let U=C[j],B=[],Q=Tn(U,"w:tc");for(let Ee=0;Ee<Q.length;Ee++){let te=Q[Ee],H=[],ae="",we=Array.from(te.childNodes);for(let V of we)if(V.nodeName==="w:p"){let M=re(V);H.push(M),ae+=M.text}else if(V.nodeName==="w:tbl"){let M=k(V);H.push(M)}let xe={type:"cell",text:ae,children:H,metadata:{row:j,col:Ee}};B.push(xe)}let fe={type:"row",children:B};P.push(fe)}return{type:"table",children:P}};if(!e.ignoreNotes){let x=d.find(C=>C.path.match(n));if(x){let C=qt(x.content.toString()),j=Le(C,"w:footnote");for(let U of j){let B=U.getAttribute("w:id");if(!B||B==="-1"||B==="0")continue;let Q=Le(U,"w:p");v.set(B,Q.map(fe=>re(fe)))}}let P=d.find(C=>C.path.match(i));if(P){let C=qt(P.content.toString()),j=Le(C,"w:endnote");for(let U of j){let B=U.getAttribute("w:id");if(!B||B==="-1"||B==="0")continue;let Q=Le(U,"w:p");w.set(B,Q.map(fe=>re(fe)))}}}for(let x of d){if(x.path.match(s)||x.path.match(o)||x.path.match(u)||x.path.match(c)||x.path.match(n)||x.path.match(i))continue;let P=x.content.toString();e.includeRawContent&&$.push(P);let C=qt(P),j=Le(C,"w:body")[0];if(j){let U=Array.from(j.childNodes);for(let B of U)B.nodeName==="w:p"?L.push(re(B)):B.nodeName==="w:tbl"&&L.push(k(B))}}if(e.extractAttachments){for(let x of _){let P=js(x.path.split("/").pop()||"image",x.content);if(E.push(P),e.ocr&&P.mimeType.startsWith("image/"))try{P.ocrText=(await hs(x.content,e.ocrLanguage)).trim()}catch(C){pi(`OCR failed for ${P.name}:`,e,C)}}if(e.ocr){let x=P=>{for(let C of P){if(C.type==="image"&&"attachmentName"in(C.metadata||{})){let j=C.metadata,U=E.find(B=>B.name===j.attachmentName);U&&U.ocrText&&(C.text=U.ocrText,U.altText=j.altText)}C.children&&x(C.children)}};x(L)}}return e.putNotesAtLast&&b.length>0&&L.push(...b),{type:"docx",metadata:{...y,formatting:K,styleMap:ee},content:L,attachments:E,toText:()=>L.map(x=>{let P=C=>{let j="";return C.children?j+=C.children.map(P).filter(U=>U!="").join(C.children[0]?.children?e.newlineDelimiter??`
|
|
132
|
-
`:""):j+=C.text||"",j};return P(x)}).filter(x=>x!="").join(e.newlineDelimiter??`
|
|
133
|
-
`)}};var Xf=class{static async parseOffice(e,t,n){let i,o={};typeof t=="function"?(i=t,o=n||{}):o=t||{};let s={ignoreNotes:!1,newlineDelimiter:`
|
|
134
|
-
`,putNotesAtLast:!1,outputErrorToConsole:!1,extractAttachments:!1,ocr:!1,ocrLanguage:"eng",includeRawContent:!1,pdfWorkerSrc:"",...o},a=He.alloc(0),u="",c;try{if(!e)throw ma("IMPROPER_ARGUMENTS",s);if(e instanceof ArrayBuffer)a=He.from(e);else if(He.isBuffer(e))a=e;else if(typeof e=="string"){if(c=e,!kb(e))throw ma("FILE_DOES_NOT_EXIST",s,e);if(t_(e).isDirectory())throw ma("LOCATION_NOT_FOUND",s,e);a=r_(e),u=e.split(".").pop()?.toLowerCase()||""}else throw ma("INVALID_INPUT",s);if(!u){let{fileTypeFromBuffer:h}=await S8(),d=await h(a);if(d)u=d.ext.toLowerCase();else throw ma("IMPROPER_BUFFERS",s)}let f;switch(u){case"docx":f=await k8(a,s);break;case"pptx":f=await I8(a,s);break;case"xlsx":f=await pB(a,s);break;case"odt":case"odp":case"ods":f=await gB(a,s);break;case"pdf":f=await R8(a,s);break;case"rtf":f=await N8(a,s);break;default:throw ma("EXTENSION_UNSUPPORTED",s,u)}return i&&i(f),f}catch(f){let h=Ck(f,s,c);throw i&&i(void 0,h),h}}};var vY=Xf.parseOffice;var EY=Xf;if(typeof Uu<"u"&&typeof module<"u"&&Uu.main===module){let i=function(o){return o.startsWith("--")&&o.includes("=")};_Y=i;let r=We.argv.slice(2),e,t=!1,n=[];if(r.forEach(o=>{i(o)?n.push(o):e||(e=o)}),e){let o={};n.forEach(s=>{let[a,u]=s.split("="),c=a.replace("--","");c==="toText"?u.toLowerCase()==="true"?t=!0:u.toLowerCase()==="false"?t=!1:console.log(`Invalid value for toText: ${u}`):u.toLowerCase()==="true"?o[c]=!0:u.toLowerCase()==="false"?o[c]=!1:o[c]=u}),Xf.parseOffice(e,o).then(s=>{console.log(t?s.toText():JSON.stringify(s,null,2))}).catch(console.error)}else console.log("Usage: node officeparser [file] [--option=value]")}var _Y;return zr(AY);})();
|
|
135
|
-
/*! Bundled license information:
|
|
136
|
-
|
|
137
|
-
@jspm/core/nodelibs/browser/chunk-DtuTasat.js:
|
|
138
|
-
@jspm/core/nodelibs/browser/chunk-B738Er4n.js:
|
|
139
|
-
ieee754/index.js:
|
|
140
|
-
(*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
141
|
-
|
|
142
|
-
@jspm/core/nodelibs/browser/chunk-CjPlbOtt.js:
|
|
143
|
-
(*!
|
|
144
|
-
* The buffer module from node.js, for the browser.
|
|
145
|
-
*
|
|
146
|
-
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
147
|
-
* @license MIT
|
|
148
|
-
*)
|
|
149
|
-
|
|
150
|
-
@jspm/core/nodelibs/browser/chunk-CcCWfKp1.js:
|
|
151
|
-
(*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
152
|
-
*/
|
|
153
|
-
//# sourceMappingURL=officeparser.browser.js.map
|